diff --git a/frontend/dist/VERSION b/frontend/dist/VERSION index a21982d9..43a0fffe 100644 --- a/frontend/dist/VERSION +++ b/frontend/dist/VERSION @@ -1 +1 @@ -0.9.321 +0.9.322 diff --git a/frontend/dist/assets/AnalyzerFilterPanel-Dspm437W.js b/frontend/dist/assets/AnalyzerFilterPanel-C99KUEiV.js similarity index 98% rename from frontend/dist/assets/AnalyzerFilterPanel-Dspm437W.js rename to frontend/dist/assets/AnalyzerFilterPanel-C99KUEiV.js index 6da6258c..b4aadffc 100644 --- a/frontend/dist/assets/AnalyzerFilterPanel-Dspm437W.js +++ b/frontend/dist/assets/AnalyzerFilterPanel-C99KUEiV.js @@ -1,4 +1,4 @@ -import{e as U,c$ as J,ao as q,aa as G,cF as Q,ct as V,r as d,j as n,bN as K,B as Y}from"./index-Bcr7MabU.js";import{c as Z}from"./node-types-BFsObq9k.js";import{C as W}from"./circle-question-mark-CHrfUdMk.js";import{F as ee}from"./funnel-DFQf6jmi.js";import{S as te}from"./search-D6EZ95nX.js";/** +import{e as U,c$ as J,ao as q,aa as G,cF as Q,ct as V,r as d,j as n,bN as K,B as Y}from"./index-CR6htdhJ.js";import{c as Z}from"./node-types-BvQCDNK9.js";import{C as W}from"./circle-question-mark-BTap0a_9.js";import{F as ee}from"./funnel-4oboVPXr.js";import{S as te}from"./search-Djg1V5_Y.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/AutoConfigureDialog-nQzi_zPM.js b/frontend/dist/assets/AutoConfigureDialog-BizEoaly.js similarity index 98% rename from frontend/dist/assets/AutoConfigureDialog-nQzi_zPM.js rename to frontend/dist/assets/AutoConfigureDialog-BizEoaly.js index f5520928..a906ef88 100644 --- a/frontend/dist/assets/AutoConfigureDialog-nQzi_zPM.js +++ b/frontend/dist/assets/AutoConfigureDialog-BizEoaly.js @@ -1 +1 @@ -import{r as f,ef as Z,j as e,a7 as K,aa as X,c4 as M,ct as U,cF as V,ew as G,eB as ee,aC as ae,aL as se,aD as te,a2 as J,bZ as ne,B as w,c as g,aF as le}from"./index-Bcr7MabU.js";import{C as ie}from"./PageLayout-Bd1lZEvE.js";import{W as re}from"./wand-sparkles-D_MagcvJ.js";import{A as oe}from"./arrow-right-Bv8RdUpJ.js";const ce={0:"1-byte",1:"2-byte",2:"3-byte"};function de(s){return ce[s]??`${s+1}-byte`}function ke({nodeName:s,publicKey:a,pathHashMode:r}){const[c,n]=f.useState(null),[o,m]=f.useState(null);f.useEffect(()=>{let l=!1;return(async()=>{try{const p=await Z();if(l)return;if(p.success&&p.data){const h=p.data;n(Array.isArray(h.configured)?h.configured:[]),m(Array.isArray(h.configured_companions)?h.configured_companions:[])}}catch{}})(),()=>{l=!0}},[]);const y=l=>{var p;return((p=l.settings)==null?void 0:p.node_name)||l.name};return e.jsxs(ie,{neomorphic:!0,children:[e.jsx(K,{icon:e.jsx(X,{}),title:"Node Information"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 sm:gap-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Repeater Name"}),e.jsx("div",{className:"mt-0.5 sm:mt-1 space-y-2",children:e.jsxs("div",{children:[e.jsx("p",{className:"type-data text-fg-primary truncate font-mono",title:s,children:s}),a&&e.jsx("div",{className:"mt-1 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:a})})]})}),r!=null&&e.jsxs("div",{className:"mt-4",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Path Hash Size"}),e.jsx("p",{className:"type-data text-fg-primary mt-0.5 font-mono",children:de(r)})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Room Servers"}),e.jsx("div",{className:"mt-0.5 sm:mt-1 space-y-2",children:c===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):c.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):c.map(l=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:y(l),children:y(l)})]}),(l.public_key||l.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:l.public_key||l.identity_key})})]},l.name))})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Companions"}),e.jsx("div",{className:"mt-0.5 sm:mt-1 space-y-2",children:o===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):o.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(V,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):o.map(l=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(V,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:y(l),children:y(l)})]}),(l.public_key||l.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:l.public_key||l.identity_key})})]},l.name))})]})]})]})}const j=168,S={sparse:50,light:200,moderate:500,dense:1e3},me={sparse:{bucketCapacity:3,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:15,violationThreshold:2,basePenaltyMinutes:30,penaltyMultiplier:2,maxPenaltyHours:12,violationDecayHours:2,ewmaAlpha:.15,hysteresisMinutes:8},light:{bucketCapacity:2,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:20,violationThreshold:2,basePenaltyMinutes:60,penaltyMultiplier:3,maxPenaltyHours:24,violationDecayHours:2,ewmaAlpha:.12,hysteresisMinutes:6},moderate:{bucketCapacity:2,refillTokens:1,refillIntervalHours:2,minIntervalSeconds:30,violationThreshold:1,basePenaltyMinutes:120,penaltyMultiplier:4,maxPenaltyHours:48,violationDecayHours:4,ewmaAlpha:.1,hysteresisMinutes:5},dense:{bucketCapacity:1,refillTokens:1,refillIntervalHours:4,minIntervalSeconds:60,violationThreshold:1,basePenaltyMinutes:180,penaltyMultiplier:4,maxPenaltyHours:72,violationDecayHours:6,ewmaAlpha:.08,hysteresisMinutes:3},congested:{bucketCapacity:1,refillTokens:1,refillIntervalHours:8,minIntervalSeconds:120,violationThreshold:1,basePenaltyMinutes:360,penaltyMultiplier:4,maxPenaltyHours:168,violationDecayHours:12,ewmaAlpha:.03,hysteresisMinutes:2}};function pe(s){return si.type===4))==null?void 0:h.count)??0,c=a.drop_reasons??[],n=((N=c.find(i=>i.reason==="advert rate limit exceeded"))==null?void 0:N.count)??0,o=c.filter(i=>i.reason.startsWith("advert penalty box")).reduce((i,d)=>i+d.count,0),m=((_=c.find(i=>i.reason==="Duplicate"))==null?void 0:_.count)??0;let y=0;try{const i=await G("/api/advert_rate_limit_stats");i.success&&i.data&&(y=i.data.tracked_pubkeys??Object.keys(i.data.bucket_states??{}).length)}catch{y=Math.max(1,Math.round(r/j/12))}const l=a.total_packets/j,p=r/j;return{hours:j,totalPackets:a.total_packets,transmittedPackets:a.transmitted_packets,droppedPackets:a.dropped_packets,packetsPerHour:l,advertsPerHour:p,advertPercent:a.total_packets>0?r/a.total_packets*100:0,advertCount:r,trackedSources:Math.max(1,y),advertsPerSourcePerHour:p/Math.max(1,y),rateLimitDrops:n,penaltyBoxDrops:o,duplicateDrops:m,meshDensity:pe(l)}}function ue(s){const a=me[s.meshDensity],r=s.packetsPerHour/60,c=Math.max(.01,B(r*.2)),n=Math.max(c+.01,B(r*.5)),o=Math.max(n+.01,B(r*.9));return{tokenBucket:{enabled:!0,bucket_capacity:a.bucketCapacity,refill_tokens:a.refillTokens,refill_interval_seconds:a.refillIntervalHours*3600,min_interval_seconds:a.minIntervalSeconds},penaltyBox:{enabled:!0,violation_threshold:a.violationThreshold,base_penalty_seconds:a.basePenaltyMinutes*60,penalty_multiplier:a.penaltyMultiplier,max_penalty_seconds:a.maxPenaltyHours*3600,violation_decay_seconds:a.violationDecayHours*3600},adaptive:{enabled:!0,ewma_alpha:a.ewmaAlpha,hysteresis_seconds:a.hysteresisMinutes*60,thresholds:{quiet_max:c,normal_max:n,busy_max:o}}}}async function ye(s){const a=await xe(),r=ue(a);return{analysis:a,recommended:r,current:{tokenBucket:s.tokenBucket??null,penaltyBox:s.penaltyBox??null,adaptive:s.adaptive??null}}}function B(s){return Math.round(s*100)/100}function k(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m`;const a=s/3600;return a===Math.floor(a)?`${a}h`:`${a.toFixed(1)}h`}function A(s){return s.toLocaleString(void 0,{maximumFractionDigits:1})}const he={sparse:"Sparse",light:"Light",moderate:"Moderate",dense:"Dense",congested:"Congested"},fe={sparse:"text-sys-green",light:"text-sys-cyan",moderate:"text-sys-blue",dense:"text-sys-amber",congested:"text-sys-red"},ge={rate_limit_enabled:!1,bucket_capacity:10,refill_tokens:5,refill_interval_seconds:3600,min_interval_seconds:0,penalty_enabled:!1,violation_threshold:5,base_penalty_seconds:1800,penalty_multiplier:2,max_penalty_seconds:86400,violation_decay_seconds:21600,adaptive_enabled:!1,ewma_alpha:.1,hysteresis_seconds:300,quiet_max:2,normal_max:6,busy_max:10},Ne=["rate_limit_enabled","bucket_capacity","refill_tokens","refill_interval_seconds","min_interval_seconds","penalty_enabled","violation_threshold","base_penalty_seconds","penalty_multiplier","max_penalty_seconds","violation_decay_seconds","adaptive_enabled","ewma_alpha","hysteresis_seconds","quiet_max","normal_max","busy_max"];function D({title:s,enabled:a,defaultOpen:r=!1,children:c}){const[n,o]=f.useState(r);return e.jsxs("div",{className:"bg-subtle-fill radius-inner overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>o(!n),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-subtle-fill-hover transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:s}),e.jsx("span",{className:g("type-data-xs px-1.5 py-0.5 rounded-full font-medium uppercase tracking-wide",a?"bg-sys-green/15 text-sys-green":"bg-sys-red/15 text-sys-red"),children:a?"On":"Off"})]}),e.jsx(le,{className:g("w-4 h-4 text-fg-muted transition-transform",n&&"rotate-180")})]}),n&&e.jsx("div",{className:"px-4 pb-4 pt-1 space-y-1",children:c})]})}function u({label:s,current:a,recommended:r,format:c=n=>String(n)}){const n=a!=null?c(a):"—",o=c(r),m=a!=null&&n!==o;return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1",children:[e.jsx("span",{className:"type-body-sm text-fg-muted flex-1 min-w-0 truncate",children:s}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:g("data-box data-box-compact",m?"text-fg-muted line-through opacity-60":"text-fg-secondary"),children:n}),m&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{className:"data-box data-box-compact text-sys-blue font-medium",children:o})]})]})]})}function we({open:s,onClose:a,currentConfig:r,onApplied:c}){var C,H,P,T,I,R,L,E,$,z,F,O,q,Y;const[n,o]=f.useState("idle"),[m,y]=f.useState(null),[l,p]=f.useState(null),h=f.useCallback(async()=>{o("analyzing"),p(null);try{const t=await ye(r);y(t),o("ready")}catch(t){p(t instanceof Error?t.message:"Analysis failed"),o("error")}},[r]),N=f.useCallback(async()=>{if(!m)return;o("applying"),p(null);const{tokenBucket:t,penaltyBox:b,adaptive:v}=m.recommended,Q={rate_limit_enabled:t.enabled,bucket_capacity:t.bucket_capacity,refill_tokens:t.refill_tokens,refill_interval_seconds:t.refill_interval_seconds,min_interval_seconds:t.min_interval_seconds,penalty_enabled:b.enabled,violation_threshold:b.violation_threshold,base_penalty_seconds:b.base_penalty_seconds,penalty_multiplier:b.penalty_multiplier,max_penalty_seconds:b.max_penalty_seconds,violation_decay_seconds:b.violation_decay_seconds,adaptive_enabled:v.enabled,ewma_alpha:v.ewma_alpha,hysteresis_seconds:v.hysteresis_seconds,quiet_max:v.thresholds.quiet_max,normal_max:v.thresholds.normal_max,busy_max:v.thresholds.busy_max};try{const W=await ee(Q);W.success?(o("applied"),c==null||c()):(p(W.error||"Failed to apply settings"),o("error"))}catch{p("Failed to apply settings"),o("error")}},[m,c]),_=f.useCallback(()=>{a(),setTimeout(()=>{o("idle"),y(null),p(null)},300)},[a]);s&&n==="idle"&&h();const i=m==null?void 0:m.analysis,d=m==null?void 0:m.recommended,x=m==null?void 0:m.current;return e.jsxs(ae,{open:s,onClose:_,size:"lg",children:[e.jsx(se,{icon:e.jsx(re,{size:20}),title:"Auto-Configure",onClose:_}),e.jsxs(te,{className:"flex flex-col gap-5 max-h-[70vh] overflow-y-auto",children:[n==="analyzing"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12",children:[e.jsx(J,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Analyzing 7 days of mesh traffic…"})]}),n==="error"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8",children:[e.jsx(ne,{className:"w-6 h-6 text-sys-amber"}),e.jsx("p",{className:"type-body-sm text-fg-secondary",children:l}),e.jsx(w,{plain:!0,onClick:h,className:"text-sys-blue",children:"Retry"})]}),(n==="ready"||n==="applying"||n==="applied")&&i&&d&&x&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("div",{className:"type-micro mb-3",children:"7-DAY ANALYSIS"}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Pkts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(i.packetsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Adverts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(i.advertsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Sources"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:i.trackedSources})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Density"}),e.jsx("div",{className:g("data-box data-box-fill data-box-left",fe[i.meshDensity]),children:he[i.meshDensity]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(D,{title:"Token Bucket of Shame",enabled:d.tokenBucket.enabled,defaultOpen:!0,children:[e.jsx(u,{label:"Bucket Capacity",current:(C=x.tokenBucket)==null?void 0:C.bucket_capacity,recommended:d.tokenBucket.bucket_capacity,format:t=>`${t} tokens`}),e.jsx(u,{label:"Refill Tokens",current:(H=x.tokenBucket)==null?void 0:H.refill_tokens,recommended:d.tokenBucket.refill_tokens,format:t=>`${t} tokens`}),e.jsx(u,{label:"Refill Interval",current:(P=x.tokenBucket)==null?void 0:P.refill_interval_seconds,recommended:d.tokenBucket.refill_interval_seconds,format:t=>k(t)}),e.jsx(u,{label:"Min Interval",current:(T=x.tokenBucket)==null?void 0:T.min_interval_seconds,recommended:d.tokenBucket.min_interval_seconds,format:t=>`${t}s`})]}),e.jsxs(D,{title:"Jail",enabled:d.penaltyBox.enabled,children:[e.jsx(u,{label:"Violation Threshold",current:(I=x.penaltyBox)==null?void 0:I.violation_threshold,recommended:d.penaltyBox.violation_threshold,format:t=>`${t} violations`}),e.jsx(u,{label:"Base Penalty",current:(R=x.penaltyBox)==null?void 0:R.base_penalty_seconds,recommended:d.penaltyBox.base_penalty_seconds,format:t=>k(t)}),e.jsx(u,{label:"Multiplier",current:(L=x.penaltyBox)==null?void 0:L.penalty_multiplier,recommended:d.penaltyBox.penalty_multiplier,format:t=>`${t}×`}),e.jsx(u,{label:"Max Penalty",current:(E=x.penaltyBox)==null?void 0:E.max_penalty_seconds,recommended:d.penaltyBox.max_penalty_seconds,format:t=>k(t)}),e.jsx(u,{label:"Violation Decay",current:($=x.penaltyBox)==null?void 0:$.violation_decay_seconds,recommended:d.penaltyBox.violation_decay_seconds,format:t=>k(t)})]}),e.jsxs(D,{title:"Adaptive Tiers",enabled:d.adaptive.enabled,children:[e.jsx(u,{label:"EWMA α",current:(z=x.adaptive)==null?void 0:z.ewma_alpha,recommended:d.adaptive.ewma_alpha}),e.jsx(u,{label:"Hysteresis",current:(F=x.adaptive)==null?void 0:F.hysteresis_seconds,recommended:d.adaptive.hysteresis_seconds,format:t=>k(t)}),e.jsx(u,{label:"Quiet Max",current:(O=x.adaptive)==null?void 0:O.thresholds.quiet_max,recommended:d.adaptive.thresholds.quiet_max,format:t=>`${t} pkts/min`}),e.jsx(u,{label:"Normal Max",current:(q=x.adaptive)==null?void 0:q.thresholds.normal_max,recommended:d.adaptive.thresholds.normal_max,format:t=>`${t} pkts/min`}),e.jsx(u,{label:"Busy Max",current:(Y=x.adaptive)==null?void 0:Y.thresholds.busy_max,recommended:d.adaptive.thresholds.busy_max,format:t=>`${t} pkts/min`})]})]}),e.jsxs("div",{className:g("flex justify-between gap-4 pt-1",n==="applied"?"items-center":"items-end"),children:[n==="applied"?e.jsx("span",{className:"type-body-sm text-zinc-500",children:"Settings applied"}):e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Analyzed"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[A(i.totalPackets)," packets"]})]}),e.jsx("div",{className:"flex items-center gap-2",children:n==="applied"?e.jsx(w,{color:"primary",onClick:_,children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(w,{plain:!0,onClick:_,children:"Cancel"}),e.jsx(w,{color:"primary",onClick:N,disabled:n==="applying",children:n==="applying"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4 animate-spin"}),"Applying…"]}):"Apply All"})]})})]})]})]})]})}export{we as A,ke as N,ge as S,Ne as a}; +import{r as f,ef as Z,j as e,a7 as K,aa as X,c4 as M,ct as U,cF as V,ew as G,eB as ee,aC as ae,aL as se,aD as te,a2 as J,bZ as ne,B as w,c as g,aF as le}from"./index-CR6htdhJ.js";import{C as ie}from"./PageLayout-Dk902Dlo.js";import{W as re}from"./wand-sparkles-qgdZS22e.js";import{A as oe}from"./arrow-right-3jiFJDYq.js";const ce={0:"1-byte",1:"2-byte",2:"3-byte"};function de(s){return ce[s]??`${s+1}-byte`}function ke({nodeName:s,publicKey:a,pathHashMode:r}){const[c,n]=f.useState(null),[o,m]=f.useState(null);f.useEffect(()=>{let l=!1;return(async()=>{try{const p=await Z();if(l)return;if(p.success&&p.data){const h=p.data;n(Array.isArray(h.configured)?h.configured:[]),m(Array.isArray(h.configured_companions)?h.configured_companions:[])}}catch{}})(),()=>{l=!0}},[]);const y=l=>{var p;return((p=l.settings)==null?void 0:p.node_name)||l.name};return e.jsxs(ie,{neomorphic:!0,children:[e.jsx(K,{icon:e.jsx(X,{}),title:"Node Information"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 sm:gap-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Repeater Name"}),e.jsx("div",{className:"mt-0.5 sm:mt-1 space-y-2",children:e.jsxs("div",{children:[e.jsx("p",{className:"type-data text-fg-primary truncate font-mono",title:s,children:s}),a&&e.jsx("div",{className:"mt-1 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:a})})]})}),r!=null&&e.jsxs("div",{className:"mt-4",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Path Hash Size"}),e.jsx("p",{className:"type-data text-fg-primary mt-0.5 font-mono",children:de(r)})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Room Servers"}),e.jsx("div",{className:"mt-0.5 sm:mt-1 space-y-2",children:c===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):c.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):c.map(l=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:y(l),children:y(l)})]}),(l.public_key||l.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:l.public_key||l.identity_key})})]},l.name))})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Companions"}),e.jsx("div",{className:"mt-0.5 sm:mt-1 space-y-2",children:o===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):o.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(V,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):o.map(l=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(V,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:y(l),children:y(l)})]}),(l.public_key||l.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:l.public_key||l.identity_key})})]},l.name))})]})]})]})}const j=168,S={sparse:50,light:200,moderate:500,dense:1e3},me={sparse:{bucketCapacity:3,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:15,violationThreshold:2,basePenaltyMinutes:30,penaltyMultiplier:2,maxPenaltyHours:12,violationDecayHours:2,ewmaAlpha:.15,hysteresisMinutes:8},light:{bucketCapacity:2,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:20,violationThreshold:2,basePenaltyMinutes:60,penaltyMultiplier:3,maxPenaltyHours:24,violationDecayHours:2,ewmaAlpha:.12,hysteresisMinutes:6},moderate:{bucketCapacity:2,refillTokens:1,refillIntervalHours:2,minIntervalSeconds:30,violationThreshold:1,basePenaltyMinutes:120,penaltyMultiplier:4,maxPenaltyHours:48,violationDecayHours:4,ewmaAlpha:.1,hysteresisMinutes:5},dense:{bucketCapacity:1,refillTokens:1,refillIntervalHours:4,minIntervalSeconds:60,violationThreshold:1,basePenaltyMinutes:180,penaltyMultiplier:4,maxPenaltyHours:72,violationDecayHours:6,ewmaAlpha:.08,hysteresisMinutes:3},congested:{bucketCapacity:1,refillTokens:1,refillIntervalHours:8,minIntervalSeconds:120,violationThreshold:1,basePenaltyMinutes:360,penaltyMultiplier:4,maxPenaltyHours:168,violationDecayHours:12,ewmaAlpha:.03,hysteresisMinutes:2}};function pe(s){return si.type===4))==null?void 0:h.count)??0,c=a.drop_reasons??[],n=((N=c.find(i=>i.reason==="advert rate limit exceeded"))==null?void 0:N.count)??0,o=c.filter(i=>i.reason.startsWith("advert penalty box")).reduce((i,d)=>i+d.count,0),m=((_=c.find(i=>i.reason==="Duplicate"))==null?void 0:_.count)??0;let y=0;try{const i=await G("/api/advert_rate_limit_stats");i.success&&i.data&&(y=i.data.tracked_pubkeys??Object.keys(i.data.bucket_states??{}).length)}catch{y=Math.max(1,Math.round(r/j/12))}const l=a.total_packets/j,p=r/j;return{hours:j,totalPackets:a.total_packets,transmittedPackets:a.transmitted_packets,droppedPackets:a.dropped_packets,packetsPerHour:l,advertsPerHour:p,advertPercent:a.total_packets>0?r/a.total_packets*100:0,advertCount:r,trackedSources:Math.max(1,y),advertsPerSourcePerHour:p/Math.max(1,y),rateLimitDrops:n,penaltyBoxDrops:o,duplicateDrops:m,meshDensity:pe(l)}}function ue(s){const a=me[s.meshDensity],r=s.packetsPerHour/60,c=Math.max(.01,B(r*.2)),n=Math.max(c+.01,B(r*.5)),o=Math.max(n+.01,B(r*.9));return{tokenBucket:{enabled:!0,bucket_capacity:a.bucketCapacity,refill_tokens:a.refillTokens,refill_interval_seconds:a.refillIntervalHours*3600,min_interval_seconds:a.minIntervalSeconds},penaltyBox:{enabled:!0,violation_threshold:a.violationThreshold,base_penalty_seconds:a.basePenaltyMinutes*60,penalty_multiplier:a.penaltyMultiplier,max_penalty_seconds:a.maxPenaltyHours*3600,violation_decay_seconds:a.violationDecayHours*3600},adaptive:{enabled:!0,ewma_alpha:a.ewmaAlpha,hysteresis_seconds:a.hysteresisMinutes*60,thresholds:{quiet_max:c,normal_max:n,busy_max:o}}}}async function ye(s){const a=await xe(),r=ue(a);return{analysis:a,recommended:r,current:{tokenBucket:s.tokenBucket??null,penaltyBox:s.penaltyBox??null,adaptive:s.adaptive??null}}}function B(s){return Math.round(s*100)/100}function k(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m`;const a=s/3600;return a===Math.floor(a)?`${a}h`:`${a.toFixed(1)}h`}function A(s){return s.toLocaleString(void 0,{maximumFractionDigits:1})}const he={sparse:"Sparse",light:"Light",moderate:"Moderate",dense:"Dense",congested:"Congested"},fe={sparse:"text-sys-green",light:"text-sys-cyan",moderate:"text-sys-blue",dense:"text-sys-amber",congested:"text-sys-red"},ge={rate_limit_enabled:!1,bucket_capacity:10,refill_tokens:5,refill_interval_seconds:3600,min_interval_seconds:0,penalty_enabled:!1,violation_threshold:5,base_penalty_seconds:1800,penalty_multiplier:2,max_penalty_seconds:86400,violation_decay_seconds:21600,adaptive_enabled:!1,ewma_alpha:.1,hysteresis_seconds:300,quiet_max:2,normal_max:6,busy_max:10},Ne=["rate_limit_enabled","bucket_capacity","refill_tokens","refill_interval_seconds","min_interval_seconds","penalty_enabled","violation_threshold","base_penalty_seconds","penalty_multiplier","max_penalty_seconds","violation_decay_seconds","adaptive_enabled","ewma_alpha","hysteresis_seconds","quiet_max","normal_max","busy_max"];function D({title:s,enabled:a,defaultOpen:r=!1,children:c}){const[n,o]=f.useState(r);return e.jsxs("div",{className:"bg-subtle-fill radius-inner overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>o(!n),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-subtle-fill-hover transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:s}),e.jsx("span",{className:g("type-data-xs px-1.5 py-0.5 rounded-full font-medium uppercase tracking-wide",a?"bg-sys-green/15 text-sys-green":"bg-sys-red/15 text-sys-red"),children:a?"On":"Off"})]}),e.jsx(le,{className:g("w-4 h-4 text-fg-muted transition-transform",n&&"rotate-180")})]}),n&&e.jsx("div",{className:"px-4 pb-4 pt-1 space-y-1",children:c})]})}function u({label:s,current:a,recommended:r,format:c=n=>String(n)}){const n=a!=null?c(a):"—",o=c(r),m=a!=null&&n!==o;return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1",children:[e.jsx("span",{className:"type-body-sm text-fg-muted flex-1 min-w-0 truncate",children:s}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:g("data-box data-box-compact",m?"text-fg-muted line-through opacity-60":"text-fg-secondary"),children:n}),m&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{className:"data-box data-box-compact text-sys-blue font-medium",children:o})]})]})]})}function we({open:s,onClose:a,currentConfig:r,onApplied:c}){var C,H,P,T,I,R,L,E,$,z,F,O,q,Y;const[n,o]=f.useState("idle"),[m,y]=f.useState(null),[l,p]=f.useState(null),h=f.useCallback(async()=>{o("analyzing"),p(null);try{const t=await ye(r);y(t),o("ready")}catch(t){p(t instanceof Error?t.message:"Analysis failed"),o("error")}},[r]),N=f.useCallback(async()=>{if(!m)return;o("applying"),p(null);const{tokenBucket:t,penaltyBox:b,adaptive:v}=m.recommended,Q={rate_limit_enabled:t.enabled,bucket_capacity:t.bucket_capacity,refill_tokens:t.refill_tokens,refill_interval_seconds:t.refill_interval_seconds,min_interval_seconds:t.min_interval_seconds,penalty_enabled:b.enabled,violation_threshold:b.violation_threshold,base_penalty_seconds:b.base_penalty_seconds,penalty_multiplier:b.penalty_multiplier,max_penalty_seconds:b.max_penalty_seconds,violation_decay_seconds:b.violation_decay_seconds,adaptive_enabled:v.enabled,ewma_alpha:v.ewma_alpha,hysteresis_seconds:v.hysteresis_seconds,quiet_max:v.thresholds.quiet_max,normal_max:v.thresholds.normal_max,busy_max:v.thresholds.busy_max};try{const W=await ee(Q);W.success?(o("applied"),c==null||c()):(p(W.error||"Failed to apply settings"),o("error"))}catch{p("Failed to apply settings"),o("error")}},[m,c]),_=f.useCallback(()=>{a(),setTimeout(()=>{o("idle"),y(null),p(null)},300)},[a]);s&&n==="idle"&&h();const i=m==null?void 0:m.analysis,d=m==null?void 0:m.recommended,x=m==null?void 0:m.current;return e.jsxs(ae,{open:s,onClose:_,size:"lg",children:[e.jsx(se,{icon:e.jsx(re,{size:20}),title:"Auto-Configure",onClose:_}),e.jsxs(te,{className:"flex flex-col gap-5 max-h-[70vh] overflow-y-auto",children:[n==="analyzing"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12",children:[e.jsx(J,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Analyzing 7 days of mesh traffic…"})]}),n==="error"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8",children:[e.jsx(ne,{className:"w-6 h-6 text-sys-amber"}),e.jsx("p",{className:"type-body-sm text-fg-secondary",children:l}),e.jsx(w,{plain:!0,onClick:h,className:"text-sys-blue",children:"Retry"})]}),(n==="ready"||n==="applying"||n==="applied")&&i&&d&&x&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("div",{className:"type-micro mb-3",children:"7-DAY ANALYSIS"}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Pkts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(i.packetsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Adverts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(i.advertsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Sources"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:i.trackedSources})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Density"}),e.jsx("div",{className:g("data-box data-box-fill data-box-left",fe[i.meshDensity]),children:he[i.meshDensity]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(D,{title:"Token Bucket of Shame",enabled:d.tokenBucket.enabled,defaultOpen:!0,children:[e.jsx(u,{label:"Bucket Capacity",current:(C=x.tokenBucket)==null?void 0:C.bucket_capacity,recommended:d.tokenBucket.bucket_capacity,format:t=>`${t} tokens`}),e.jsx(u,{label:"Refill Tokens",current:(H=x.tokenBucket)==null?void 0:H.refill_tokens,recommended:d.tokenBucket.refill_tokens,format:t=>`${t} tokens`}),e.jsx(u,{label:"Refill Interval",current:(P=x.tokenBucket)==null?void 0:P.refill_interval_seconds,recommended:d.tokenBucket.refill_interval_seconds,format:t=>k(t)}),e.jsx(u,{label:"Min Interval",current:(T=x.tokenBucket)==null?void 0:T.min_interval_seconds,recommended:d.tokenBucket.min_interval_seconds,format:t=>`${t}s`})]}),e.jsxs(D,{title:"Jail",enabled:d.penaltyBox.enabled,children:[e.jsx(u,{label:"Violation Threshold",current:(I=x.penaltyBox)==null?void 0:I.violation_threshold,recommended:d.penaltyBox.violation_threshold,format:t=>`${t} violations`}),e.jsx(u,{label:"Base Penalty",current:(R=x.penaltyBox)==null?void 0:R.base_penalty_seconds,recommended:d.penaltyBox.base_penalty_seconds,format:t=>k(t)}),e.jsx(u,{label:"Multiplier",current:(L=x.penaltyBox)==null?void 0:L.penalty_multiplier,recommended:d.penaltyBox.penalty_multiplier,format:t=>`${t}×`}),e.jsx(u,{label:"Max Penalty",current:(E=x.penaltyBox)==null?void 0:E.max_penalty_seconds,recommended:d.penaltyBox.max_penalty_seconds,format:t=>k(t)}),e.jsx(u,{label:"Violation Decay",current:($=x.penaltyBox)==null?void 0:$.violation_decay_seconds,recommended:d.penaltyBox.violation_decay_seconds,format:t=>k(t)})]}),e.jsxs(D,{title:"Adaptive Tiers",enabled:d.adaptive.enabled,children:[e.jsx(u,{label:"EWMA α",current:(z=x.adaptive)==null?void 0:z.ewma_alpha,recommended:d.adaptive.ewma_alpha}),e.jsx(u,{label:"Hysteresis",current:(F=x.adaptive)==null?void 0:F.hysteresis_seconds,recommended:d.adaptive.hysteresis_seconds,format:t=>k(t)}),e.jsx(u,{label:"Quiet Max",current:(O=x.adaptive)==null?void 0:O.thresholds.quiet_max,recommended:d.adaptive.thresholds.quiet_max,format:t=>`${t} pkts/min`}),e.jsx(u,{label:"Normal Max",current:(q=x.adaptive)==null?void 0:q.thresholds.normal_max,recommended:d.adaptive.thresholds.normal_max,format:t=>`${t} pkts/min`}),e.jsx(u,{label:"Busy Max",current:(Y=x.adaptive)==null?void 0:Y.thresholds.busy_max,recommended:d.adaptive.thresholds.busy_max,format:t=>`${t} pkts/min`})]})]}),e.jsxs("div",{className:g("flex justify-between gap-4 pt-1",n==="applied"?"items-center":"items-end"),children:[n==="applied"?e.jsx("span",{className:"type-body-sm text-zinc-500",children:"Settings applied"}):e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Analyzed"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[A(i.totalPackets)," packets"]})]}),e.jsx("div",{className:"flex items-center gap-2",children:n==="applied"?e.jsx(w,{color:"primary",onClick:_,children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(w,{plain:!0,onClick:_,children:"Cancel"}),e.jsx(w,{color:"primary",onClick:N,disabled:n==="applying",children:n==="applying"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4 animate-spin"}),"Applying…"]}):"Apply All"})]})})]})]})]})]})}export{we as A,ke as N,ge as S,Ne as a}; diff --git a/frontend/dist/assets/BasemapLayer-A-p_Dr5u.js b/frontend/dist/assets/BasemapLayer-B6qv9zHt.js similarity index 95% rename from frontend/dist/assets/BasemapLayer-A-p_Dr5u.js rename to frontend/dist/assets/BasemapLayer-B6qv9zHt.js index 70ff2791..e1400948 100644 --- a/frontend/dist/assets/BasemapLayer-A-p_Dr5u.js +++ b/frontend/dist/assets/BasemapLayer-B6qv9zHt.js @@ -1 +1 @@ -import{r as o}from"./index-Bcr7MabU.js";import{u as w}from"./maplibre-gl-CsF9Hmsz.js";const C={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},x={light:"basemap-light-",dark:"basemap-dark-"},k={};async function E(i){if(k[i])return k[i];const t=await(await fetch(C[i])).json();return k[i]=t,t}function R({mode:i}){const{current:l}=w(),[t,b]=o.useState(null),u=o.useRef({light:!1,dark:!1}),m=o.useRef({light:[],dark:[]});o.useEffect(()=>{const e=()=>{var a;const s=(a=l==null?void 0:l.getMap)==null?void 0:a.call(l);s&&!t&&b(s)};e();const r=setInterval(e,50),c=setTimeout(()=>clearInterval(r),5e3);return()=>{clearInterval(r),clearTimeout(c)}},[l,t]);const g=o.useCallback(async(e,r,c)=>{var L,I;if(u.current[r])return;const s=x[r],a=await E(r),d=[];for(const[y,f]of Object.entries(a.sources||{})){const n=s+y;e.getSource(n)||e.addSource(n,f)}const v=(I=(((L=e.getStyle())==null?void 0:L.layers)||[]).find(y=>!y.id.startsWith("basemap-light-")&&!y.id.startsWith("basemap-dark-")))==null?void 0:I.id;for(const y of a.layers||[]){const f=s+y.id;if(d.push(f),e.getLayer(f))continue;const n={...y,id:f};"source"in n&&typeof n.source=="string"&&(n.source=s+n.source),n.layout||(n.layout={}),n.layout.visibility=c?"visible":"none";try{e.addLayer(n,v)}catch(S){console.warn(`[BasemapLayer] Failed to add layer ${f}:`,S)}}m.current[r]=d,u.current[r]=!0},[]),h=o.useCallback((e,r,c)=>{const s=m.current[r],a=c?"visible":"none";for(const d of s)if(e.getLayer(d))try{e.setLayoutProperty(d,"visibility",a)}catch{}},[]),p=o.useCallback(e=>{var s;const c=(((s=e.getStyle())==null?void 0:s.layers)||[]).filter(a=>!a.id.startsWith("basemap-light-")&&!a.id.startsWith("basemap-dark-"));for(const a of c)try{e.moveLayer(a.id)}catch{}},[]);return o.useEffect(()=>{if(!t)return;const e=r=>{t.hasImage(r.id)||t.addImage(r.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return t.on("styleimagemissing",e),()=>{t.off("styleimagemissing",e)}},[t]),o.useEffect(()=>{if(!t)return;let e=!1;const r=async()=>{if(!e)try{await Promise.all([g(t,"light",i==="light"),g(t,"dark",i==="dark")]),e||p(t)}catch(s){console.error("[BasemapLayer] Setup error:",s)}};t.isStyleLoaded()?r():(t.once("style.load",r),t.once("load",()=>{!e&&!u.current.light&&r()}));const c=()=>{e||setTimeout(()=>{!e&&u.current.light&&u.current.dark&&p(t)},100)};return t.on("styledata",c),()=>{e=!0,t.off("styledata",c)}},[t,g,p,i]),o.useEffect(()=>{t&&(!u.current.light||!u.current.dark||(h(t,"light",i==="light"),h(t,"dark",i==="dark")))},[t,i,h]),null}export{R as B}; +import{r as o}from"./index-CR6htdhJ.js";import{u as w}from"./maplibre-gl-Df1NK1kQ.js";const C={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},x={light:"basemap-light-",dark:"basemap-dark-"},k={};async function E(i){if(k[i])return k[i];const t=await(await fetch(C[i])).json();return k[i]=t,t}function R({mode:i}){const{current:l}=w(),[t,b]=o.useState(null),u=o.useRef({light:!1,dark:!1}),m=o.useRef({light:[],dark:[]});o.useEffect(()=>{const e=()=>{var a;const s=(a=l==null?void 0:l.getMap)==null?void 0:a.call(l);s&&!t&&b(s)};e();const r=setInterval(e,50),c=setTimeout(()=>clearInterval(r),5e3);return()=>{clearInterval(r),clearTimeout(c)}},[l,t]);const g=o.useCallback(async(e,r,c)=>{var L,I;if(u.current[r])return;const s=x[r],a=await E(r),d=[];for(const[y,f]of Object.entries(a.sources||{})){const n=s+y;e.getSource(n)||e.addSource(n,f)}const v=(I=(((L=e.getStyle())==null?void 0:L.layers)||[]).find(y=>!y.id.startsWith("basemap-light-")&&!y.id.startsWith("basemap-dark-")))==null?void 0:I.id;for(const y of a.layers||[]){const f=s+y.id;if(d.push(f),e.getLayer(f))continue;const n={...y,id:f};"source"in n&&typeof n.source=="string"&&(n.source=s+n.source),n.layout||(n.layout={}),n.layout.visibility=c?"visible":"none";try{e.addLayer(n,v)}catch(S){console.warn(`[BasemapLayer] Failed to add layer ${f}:`,S)}}m.current[r]=d,u.current[r]=!0},[]),h=o.useCallback((e,r,c)=>{const s=m.current[r],a=c?"visible":"none";for(const d of s)if(e.getLayer(d))try{e.setLayoutProperty(d,"visibility",a)}catch{}},[]),p=o.useCallback(e=>{var s;const c=(((s=e.getStyle())==null?void 0:s.layers)||[]).filter(a=>!a.id.startsWith("basemap-light-")&&!a.id.startsWith("basemap-dark-"));for(const a of c)try{e.moveLayer(a.id)}catch{}},[]);return o.useEffect(()=>{if(!t)return;const e=r=>{t.hasImage(r.id)||t.addImage(r.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return t.on("styleimagemissing",e),()=>{t.off("styleimagemissing",e)}},[t]),o.useEffect(()=>{if(!t)return;let e=!1;const r=async()=>{if(!e)try{await Promise.all([g(t,"light",i==="light"),g(t,"dark",i==="dark")]),e||p(t)}catch(s){console.error("[BasemapLayer] Setup error:",s)}};t.isStyleLoaded()?r():(t.once("style.load",r),t.once("load",()=>{!e&&!u.current.light&&r()}));const c=()=>{e||setTimeout(()=>{!e&&u.current.light&&u.current.dark&&p(t)},100)};return t.on("styledata",c),()=>{e=!0,t.off("styledata",c)}},[t,g,p,i]),o.useEffect(()=>{t&&(!u.current.light||!u.current.dark||(h(t,"light",i==="light"),h(t,"dark",i==="dark")))},[t,i,h]),null}export{R as B}; diff --git a/frontend/dist/assets/ChatBubble-BqSfRbsT.js b/frontend/dist/assets/ChatBubble-CpAqiMRZ.js similarity index 97% rename from frontend/dist/assets/ChatBubble-BqSfRbsT.js rename to frontend/dist/assets/ChatBubble-CpAqiMRZ.js index a0dfbd23..d0c4f3e1 100644 --- a/frontend/dist/assets/ChatBubble-BqSfRbsT.js +++ b/frontend/dist/assets/ChatBubble-CpAqiMRZ.js @@ -1 +1 @@ -import{r as B,j as e,c as s}from"./index-Bcr7MabU.js";import{e as M,g as W,a as E,c as S,f as g,b}from"./chat-utils-lxurr5ix.js";const v=["","text-[42px]","text-[36px]","text-[30px]"],O=B.memo(function({senderName:x,text:n,timestamp:d,nameAccessory:y,bubbleAccessory:c,className:o,isOutgoing:N,status:t,onRetry:m,onRetryAsFlood:h,retryAttempt:p,maxRetries:l,signed:w,echoCount:r,bubbleVariant:V="accent",onMentionClick:f}){const{emoji:u,cleanName:j}=M(x),k=W(j),C=E(x),a=S(n);return N?e.jsxs("div",{className:s("group flex flex-col items-end w-full p-2",o),children:[e.jsxs("div",{className:"flex items-end gap-1.5 max-w-[80%]",children:[c,a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5","rounded-2xl rounded-br-md",t==="failed"?"bg-sys-red depth-raised-soft":"bg-sys-blue depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-white leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:g(n,{isOutgoing:!0,onMentionClick:f})})})]}),e.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-0.5 mr-1",children:[r!=null&&r>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-sys-green tabular-nums font-medium",children:[e.jsxs("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M17 1l4 4-4 4"}),e.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),e.jsx("path",{d:"M7 23l-4-4 4-4"}),e.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]}),r]}),t==="confirmed"&&e.jsxs("svg",{className:"w-3 h-3 text-sys-green",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("polyline",{points:"3 12 8 17 14 6"}),e.jsx("polyline",{points:"10 12 15 17 21 6"})]}),t==="sent"&&e.jsx("svg",{className:"w-3 h-3 text-fg-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),t==="pending"&&e.jsx("svg",{className:"w-3 h-3 text-chat-timestamp animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),t==="retrying"&&e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3 text-sys-amber animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),p!=null&&l!=null&&e.jsxs("span",{className:"text-[10px] text-sys-amber font-medium tabular-nums",children:["Retry ",p,"/",l]})]}),t==="unconfirmed"&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-sys-amber flex-shrink-0"}),t==="failed"&&e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"w-3 h-3 text-sys-red",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),l!=null&&l>0&&e.jsxs("span",{className:"text-[10px] text-sys-red/70",children:["after ",l," ",l===1?"retry":"retries"]}),m&&e.jsx("button",{onClick:m,className:"text-[10px] font-medium text-sys-red hover:text-sys-red/80 underline underline-offset-2 transition-colors",children:"Retry"}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-fg-muted/50",children:"·"}),e.jsx("button",{onClick:h,className:"text-[10px] font-medium text-sys-amber hover:text-sys-amber/80 underline underline-offset-2 transition-colors",children:"Flood"})]})]}),e.jsx("span",{className:"text-[10px] text-chat-timestamp tabular-nums",children:b(d)})]})]}):e.jsxs("div",{className:s("group flex items-start gap-4 w-full p-2",o),children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:s("clay-avatar w-9 h-9",u?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":k},children:u||C}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:b(d)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:j}),w&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]}),y]}),e.jsxs("div",{className:"flex items-end gap-1.5",children:[a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5 max-w-full","rounded-2xl rounded-tl-md","bg-chat-incoming depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:g(n,{onMentionClick:f})})}),c]})]})]})});function T({text:i}){return e.jsx("div",{className:"flex justify-center my-1",children:e.jsx("span",{className:s("px-3 py-1 rounded-full","bg-subtle-fill text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:i})})}export{O as C,T as S}; +import{r as B,j as e,c as s}from"./index-CR6htdhJ.js";import{e as M,g as W,a as E,c as S,f as g,b}from"./chat-utils-DHa6YwrS.js";const v=["","text-[42px]","text-[36px]","text-[30px]"],O=B.memo(function({senderName:x,text:n,timestamp:d,nameAccessory:y,bubbleAccessory:c,className:o,isOutgoing:N,status:t,onRetry:m,onRetryAsFlood:h,retryAttempt:p,maxRetries:l,signed:w,echoCount:r,bubbleVariant:V="accent",onMentionClick:f}){const{emoji:u,cleanName:j}=M(x),k=W(j),C=E(x),a=S(n);return N?e.jsxs("div",{className:s("group flex flex-col items-end w-full p-2",o),children:[e.jsxs("div",{className:"flex items-end gap-1.5 max-w-[80%]",children:[c,a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5","rounded-2xl rounded-br-md",t==="failed"?"bg-sys-red depth-raised-soft":"bg-sys-blue depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-white leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:g(n,{isOutgoing:!0,onMentionClick:f})})})]}),e.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-0.5 mr-1",children:[r!=null&&r>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-sys-green tabular-nums font-medium",children:[e.jsxs("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M17 1l4 4-4 4"}),e.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),e.jsx("path",{d:"M7 23l-4-4 4-4"}),e.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]}),r]}),t==="confirmed"&&e.jsxs("svg",{className:"w-3 h-3 text-sys-green",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("polyline",{points:"3 12 8 17 14 6"}),e.jsx("polyline",{points:"10 12 15 17 21 6"})]}),t==="sent"&&e.jsx("svg",{className:"w-3 h-3 text-fg-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),t==="pending"&&e.jsx("svg",{className:"w-3 h-3 text-chat-timestamp animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),t==="retrying"&&e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3 text-sys-amber animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),p!=null&&l!=null&&e.jsxs("span",{className:"text-[10px] text-sys-amber font-medium tabular-nums",children:["Retry ",p,"/",l]})]}),t==="unconfirmed"&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-sys-amber flex-shrink-0"}),t==="failed"&&e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"w-3 h-3 text-sys-red",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),l!=null&&l>0&&e.jsxs("span",{className:"text-[10px] text-sys-red/70",children:["after ",l," ",l===1?"retry":"retries"]}),m&&e.jsx("button",{onClick:m,className:"text-[10px] font-medium text-sys-red hover:text-sys-red/80 underline underline-offset-2 transition-colors",children:"Retry"}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-fg-muted/50",children:"·"}),e.jsx("button",{onClick:h,className:"text-[10px] font-medium text-sys-amber hover:text-sys-amber/80 underline underline-offset-2 transition-colors",children:"Flood"})]})]}),e.jsx("span",{className:"text-[10px] text-chat-timestamp tabular-nums",children:b(d)})]})]}):e.jsxs("div",{className:s("group flex items-start gap-4 w-full p-2",o),children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:s("clay-avatar w-9 h-9",u?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":k},children:u||C}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:b(d)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:j}),w&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]}),y]}),e.jsxs("div",{className:"flex items-end gap-1.5",children:[a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5 max-w-full","rounded-2xl rounded-tl-md","bg-chat-incoming depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:g(n,{onMentionClick:f})})}),c]})]})]})});function T({text:i}){return e.jsx("div",{className:"flex justify-center my-1",children:e.jsx("span",{className:s("px-3 py-1 rounded-full","bg-subtle-fill text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:i})})}export{O as C,T as S}; diff --git a/frontend/dist/assets/CollisionExplorerModal-Y6S5TUlx.js b/frontend/dist/assets/CollisionExplorerModal-BjNF8_2U.js similarity index 96% rename from frontend/dist/assets/CollisionExplorerModal-Y6S5TUlx.js rename to frontend/dist/assets/CollisionExplorerModal-BjNF8_2U.js index 2e31e627..e60507fd 100644 --- a/frontend/dist/assets/CollisionExplorerModal-Y6S5TUlx.js +++ b/frontend/dist/assets/CollisionExplorerModal-BjNF8_2U.js @@ -1 +1 @@ -import{r as c,a6 as L,ci as S,ab as H,j as e,aC as k,bZ as R,aD as B,d0 as E,c0 as T,c as N,ao as D,V as M,a3 as P,a0 as _,a1 as z,ct as I,cF as F}from"./index-Bcr7MabU.js";import{M as W,S as q,L as A,a as U}from"./maplibre-gl-CsF9Hmsz.js";import{B as V}from"./BasemapLayer-A-p_Dr5u.js";import{M as Y}from"./map-pin-CmfqMW3N.js";import{S as Z}from"./share-2-CBcJN8r0.js";const $={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"};function w({node:o,isHovered:v,onHover:f}){const[g,p]=c.useState(!1),y=c.useCallback(async d=>{d.stopPropagation(),await P(o.hash),p(!0),setTimeout(()=>p(!1),2e3)},[o.hash]),h=o.contactType.toLowerCase(),m=h.includes("room")||h.includes("server"),l=h==="companion"||h==="client";let n=Z,r="text-sys-blue";return m?(n=I,r="text-signal-fair"):l?(n=F,r="text-fg-muted"):o.isNeighbor&&(r="text-sys-green"),e.jsxs("div",{className:N("flex items-center gap-3 px-3 py-2.5 radius-inner transition-base cursor-pointer",v?"bg-sys-blue/10":"hover:bg-subtle-fill"),onMouseEnter:()=>f(o.hash),onMouseLeave:()=>f(null),children:[e.jsx(n,{className:N("w-4 h-4 flex-shrink-0",r)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"type-label text-fg-primary truncate",children:o.name}),o.isNeighbor&&e.jsx(M,{color:"green",compact:!0,children:"NBR"}),o.isRepeater&&e.jsx(M,{color:"zinc",compact:!0,children:"RPT"}),o.isHub&&e.jsx(M,{color:"indigo",compact:!0,children:"HUB"})]}),e.jsxs("button",{onClick:y,className:N("mt-1 inline-flex items-center gap-1 type-data-xs px-1.5 py-0.5 rounded","border transition-all cursor-pointer",g?"border-sys-green/50 bg-sys-green/10 text-sys-green":"border-edge-subtle bg-subtle/50 text-fg-muted hover:border-edge-strong"),title:`Copy: ${o.hash}`,children:[o.hash.slice(0,12),"…",g?e.jsx(_,{className:"w-2.5 h-2.5"}):e.jsx(z,{className:"w-2.5 h-2.5 opacity-50"})]})]})]})}function C({nodes:o,hoveredHash:v,onHover:f}){const g=E(),p=c.useRef(null),y=T(),[h,m]=c.useState(!1),l=c.useMemo(()=>o.filter(a=>a.latitude!=null&&a.longitude!=null&&(a.latitude!==0||a.longitude!==0)),[o]),n=c.useMemo(()=>{if(l.length===0)return null;let a=1/0,s=-1/0,t=1/0,i=-1/0;for(const x of l)a=Math.min(a,x.longitude),s=Math.max(s,x.longitude),t=Math.min(t,x.latitude),i=Math.max(i,x.latitude);const u=.01;if(i-tn?{longitude:(n[0][0]+n[1][0])/2,latitude:(n[0][1]+n[1][1])/2}:{longitude:0,latitude:0},[n]),d=c.useMemo(()=>{if(l.length<2)return null;const a=[];for(let s=0;s{var s;const a=(s=p.current)==null?void 0:s.getMap();if(!a||!n){m(!0);return}a.fitBounds(n,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:13,duration:0}),setTimeout(()=>m(!0),50)},[n]),b=y&&h;return l.length===0?e.jsx("div",{className:"h-full flex items-center justify-center bg-subtle/30 radius-inner",children:e.jsxs("div",{className:"text-center text-fg-secondary p-4",children:[e.jsx(Y,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No location data available"})]})}):e.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden bg-elevated",children:[e.jsx("div",{className:N("absolute inset-0 flex items-center justify-center z-10","transition-opacity duration-200 pointer-events-none",b?"opacity-0":"opacity-100 bg-elevated"),children:e.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),e.jsx("div",{className:N("h-full w-full transition-opacity duration-200",b?"opacity-100":"opacity-0"),children:e.jsxs(W,{ref:p,initialViewState:{longitude:r.longitude,latitude:r.latitude,zoom:10},style:{height:"100%",width:"100%"},mapStyle:$,attributionControl:!1,onLoad:j,children:[e.jsx(V,{mode:g}),d&&e.jsx(q,{id:"collision-edges",type:"geojson",data:d,children:e.jsx(A,{id:"collision-edges-line",type:"line",paint:{"line-color":"#3B3F4A","line-width":2,"line-opacity":.8},layout:{"line-cap":"round","line-join":"round"}})}),l.map(a=>{const s=a.hash===v,t=D(a.hash);return e.jsx(U,{longitude:a.longitude,latitude:a.latitude,anchor:"center",children:e.jsx("div",{className:"cursor-pointer transition-all duration-150",onMouseEnter:()=>f(a.hash),onMouseLeave:()=>f(null),style:{pointerEvents:"auto"},children:e.jsxs(M,{color:"amber",filled:!0,className:"type-data-xs shadow-lg",children:[t,s&&e.jsx("span",{className:"ml-1 opacity-75 font-sans",children:a.name})]})})},a.hash)})]})})]})}function G({isOpen:o,prefix:v,candidateHashes:f,onClose:g}){const p=L(),y=S(),h=H(),[m,l]=c.useState(null),n=c.useMemo(()=>new Set(h.map(s=>s.hash)),[h]),r=(p==null?void 0:p.neighbors)??{},d=c.useMemo(()=>{const s=t=>{if(r[t])return r[t];if(!t.startsWith("0x")&&r["0x"+t])return r["0x"+t];if(t.startsWith("0x")&&r[t.slice(2)])return r[t.slice(2)]};return f.map(t=>{var u;const i=s(t);return{hash:t,name:(i==null?void 0:i.node_name)||(i==null?void 0:i.name)||`Unknown (${t.slice(0,8)}…)`,contactType:(i==null?void 0:i.contact_type)||"",isRepeater:(i==null?void 0:i.is_repeater)||((u=i==null?void 0:i.contact_type)==null?void 0:u.toLowerCase())==="repeater"||!1,isNeighbor:n.has(t)||n.has("0x"+t)||n.has(t.replace(/^0x/,"")),isHub:y.has(t),latitude:i==null?void 0:i.latitude,longitude:i==null?void 0:i.longitude}}).sort((t,i)=>t.isNeighbor!==i.isNeighbor?t.isNeighbor?-1:1:t.isHub!==i.isHub?t.isHub?-1:1:t.name.localeCompare(i.name))},[f,r,n,y]),j=c.useMemo(()=>d.some(s=>s.latitude!=null&&s.longitude!=null&&(s.latitude!==0||s.longitude!==0)),[d]),b=c.useCallback(s=>{l(s)},[]),a=j?"4xl":"lg";return o?e.jsxs(k,{open:o,onClose:g,size:a,motionPlus:!0,className:j?"sm:h-[500px] sm:max-h-[600px]":"",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-edge-subtle",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 radius-inner bg-signal-fair/10",children:e.jsx(R,{className:"w-5 h-5 text-signal-fair"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"type-micro",children:["Prefix Collision: ",e.jsx("span",{className:"font-mono text-sys-blue",children:v})]}),e.jsxs("p",{className:"text-xs text-fg-secondary",children:[d.length," nodes share this prefix"]})]})]}),e.jsx("button",{onClick:g,className:"sm:hidden min-h-[44px] min-w-[44px] px-3 flex items-center justify-center text-[15px] font-medium text-sys-blue active:text-sys-blue/70 transition-base radius-inner active:bg-subtle-fill",children:"Done"}),e.jsx("button",{onClick:g,className:"hidden sm:flex items-center justify-center p-2 text-fg-muted hover:text-fg-primary transition-base radius-inner hover:bg-subtle","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs(B,{className:"p-0 overflow-hidden flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"sm:hidden flex-1 overflow-y-auto",children:[j&&e.jsx("div",{className:"h-64 p-2 border-b border-edge-subtle",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:b})}),e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:b},s.hash))})]}),j?e.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[280px_minmax(400px,1fr)] flex-1 overflow-hidden sm:min-w-[700px]",children:[e.jsx("div",{className:"overflow-y-auto border-r border-edge-subtle",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:b},s.hash))})}),e.jsx("div",{className:"overflow-hidden p-2",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:b})})]}):e.jsx("div",{className:"hidden sm:block flex-1 overflow-y-auto",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:b},s.hash))})})]})]}):null}const ee=c.memo(G);export{ee as C}; +import{r as c,a6 as L,ci as S,ab as H,j as e,aC as k,bZ as R,aD as B,d0 as E,c0 as T,c as N,ao as D,V as M,a3 as P,a0 as _,a1 as z,ct as I,cF as F}from"./index-CR6htdhJ.js";import{M as W,S as q,L as A,a as U}from"./maplibre-gl-Df1NK1kQ.js";import{B as V}from"./BasemapLayer-B6qv9zHt.js";import{M as Y}from"./map-pin-DLf5Z8nk.js";import{S as Z}from"./share-2-Cm0TgUDc.js";const $={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"};function w({node:o,isHovered:v,onHover:f}){const[g,p]=c.useState(!1),y=c.useCallback(async d=>{d.stopPropagation(),await P(o.hash),p(!0),setTimeout(()=>p(!1),2e3)},[o.hash]),h=o.contactType.toLowerCase(),m=h.includes("room")||h.includes("server"),l=h==="companion"||h==="client";let n=Z,r="text-sys-blue";return m?(n=I,r="text-signal-fair"):l?(n=F,r="text-fg-muted"):o.isNeighbor&&(r="text-sys-green"),e.jsxs("div",{className:N("flex items-center gap-3 px-3 py-2.5 radius-inner transition-base cursor-pointer",v?"bg-sys-blue/10":"hover:bg-subtle-fill"),onMouseEnter:()=>f(o.hash),onMouseLeave:()=>f(null),children:[e.jsx(n,{className:N("w-4 h-4 flex-shrink-0",r)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"type-label text-fg-primary truncate",children:o.name}),o.isNeighbor&&e.jsx(M,{color:"green",compact:!0,children:"NBR"}),o.isRepeater&&e.jsx(M,{color:"zinc",compact:!0,children:"RPT"}),o.isHub&&e.jsx(M,{color:"indigo",compact:!0,children:"HUB"})]}),e.jsxs("button",{onClick:y,className:N("mt-1 inline-flex items-center gap-1 type-data-xs px-1.5 py-0.5 rounded","border transition-all cursor-pointer",g?"border-sys-green/50 bg-sys-green/10 text-sys-green":"border-edge-subtle bg-subtle/50 text-fg-muted hover:border-edge-strong"),title:`Copy: ${o.hash}`,children:[o.hash.slice(0,12),"…",g?e.jsx(_,{className:"w-2.5 h-2.5"}):e.jsx(z,{className:"w-2.5 h-2.5 opacity-50"})]})]})]})}function C({nodes:o,hoveredHash:v,onHover:f}){const g=E(),p=c.useRef(null),y=T(),[h,m]=c.useState(!1),l=c.useMemo(()=>o.filter(a=>a.latitude!=null&&a.longitude!=null&&(a.latitude!==0||a.longitude!==0)),[o]),n=c.useMemo(()=>{if(l.length===0)return null;let a=1/0,s=-1/0,t=1/0,i=-1/0;for(const x of l)a=Math.min(a,x.longitude),s=Math.max(s,x.longitude),t=Math.min(t,x.latitude),i=Math.max(i,x.latitude);const u=.01;if(i-tn?{longitude:(n[0][0]+n[1][0])/2,latitude:(n[0][1]+n[1][1])/2}:{longitude:0,latitude:0},[n]),d=c.useMemo(()=>{if(l.length<2)return null;const a=[];for(let s=0;s{var s;const a=(s=p.current)==null?void 0:s.getMap();if(!a||!n){m(!0);return}a.fitBounds(n,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:13,duration:0}),setTimeout(()=>m(!0),50)},[n]),b=y&&h;return l.length===0?e.jsx("div",{className:"h-full flex items-center justify-center bg-subtle/30 radius-inner",children:e.jsxs("div",{className:"text-center text-fg-secondary p-4",children:[e.jsx(Y,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No location data available"})]})}):e.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden bg-elevated",children:[e.jsx("div",{className:N("absolute inset-0 flex items-center justify-center z-10","transition-opacity duration-200 pointer-events-none",b?"opacity-0":"opacity-100 bg-elevated"),children:e.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),e.jsx("div",{className:N("h-full w-full transition-opacity duration-200",b?"opacity-100":"opacity-0"),children:e.jsxs(W,{ref:p,initialViewState:{longitude:r.longitude,latitude:r.latitude,zoom:10},style:{height:"100%",width:"100%"},mapStyle:$,attributionControl:!1,onLoad:j,children:[e.jsx(V,{mode:g}),d&&e.jsx(q,{id:"collision-edges",type:"geojson",data:d,children:e.jsx(A,{id:"collision-edges-line",type:"line",paint:{"line-color":"#3B3F4A","line-width":2,"line-opacity":.8},layout:{"line-cap":"round","line-join":"round"}})}),l.map(a=>{const s=a.hash===v,t=D(a.hash);return e.jsx(U,{longitude:a.longitude,latitude:a.latitude,anchor:"center",children:e.jsx("div",{className:"cursor-pointer transition-all duration-150",onMouseEnter:()=>f(a.hash),onMouseLeave:()=>f(null),style:{pointerEvents:"auto"},children:e.jsxs(M,{color:"amber",filled:!0,className:"type-data-xs shadow-lg",children:[t,s&&e.jsx("span",{className:"ml-1 opacity-75 font-sans",children:a.name})]})})},a.hash)})]})})]})}function G({isOpen:o,prefix:v,candidateHashes:f,onClose:g}){const p=L(),y=S(),h=H(),[m,l]=c.useState(null),n=c.useMemo(()=>new Set(h.map(s=>s.hash)),[h]),r=(p==null?void 0:p.neighbors)??{},d=c.useMemo(()=>{const s=t=>{if(r[t])return r[t];if(!t.startsWith("0x")&&r["0x"+t])return r["0x"+t];if(t.startsWith("0x")&&r[t.slice(2)])return r[t.slice(2)]};return f.map(t=>{var u;const i=s(t);return{hash:t,name:(i==null?void 0:i.node_name)||(i==null?void 0:i.name)||`Unknown (${t.slice(0,8)}…)`,contactType:(i==null?void 0:i.contact_type)||"",isRepeater:(i==null?void 0:i.is_repeater)||((u=i==null?void 0:i.contact_type)==null?void 0:u.toLowerCase())==="repeater"||!1,isNeighbor:n.has(t)||n.has("0x"+t)||n.has(t.replace(/^0x/,"")),isHub:y.has(t),latitude:i==null?void 0:i.latitude,longitude:i==null?void 0:i.longitude}}).sort((t,i)=>t.isNeighbor!==i.isNeighbor?t.isNeighbor?-1:1:t.isHub!==i.isHub?t.isHub?-1:1:t.name.localeCompare(i.name))},[f,r,n,y]),j=c.useMemo(()=>d.some(s=>s.latitude!=null&&s.longitude!=null&&(s.latitude!==0||s.longitude!==0)),[d]),b=c.useCallback(s=>{l(s)},[]),a=j?"4xl":"lg";return o?e.jsxs(k,{open:o,onClose:g,size:a,motionPlus:!0,className:j?"sm:h-[500px] sm:max-h-[600px]":"",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-edge-subtle",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 radius-inner bg-signal-fair/10",children:e.jsx(R,{className:"w-5 h-5 text-signal-fair"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"type-micro",children:["Prefix Collision: ",e.jsx("span",{className:"font-mono text-sys-blue",children:v})]}),e.jsxs("p",{className:"text-xs text-fg-secondary",children:[d.length," nodes share this prefix"]})]})]}),e.jsx("button",{onClick:g,className:"sm:hidden min-h-[44px] min-w-[44px] px-3 flex items-center justify-center text-[15px] font-medium text-sys-blue active:text-sys-blue/70 transition-base radius-inner active:bg-subtle-fill",children:"Done"}),e.jsx("button",{onClick:g,className:"hidden sm:flex items-center justify-center p-2 text-fg-muted hover:text-fg-primary transition-base radius-inner hover:bg-subtle","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs(B,{className:"p-0 overflow-hidden flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"sm:hidden flex-1 overflow-y-auto",children:[j&&e.jsx("div",{className:"h-64 p-2 border-b border-edge-subtle",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:b})}),e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:b},s.hash))})]}),j?e.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[280px_minmax(400px,1fr)] flex-1 overflow-hidden sm:min-w-[700px]",children:[e.jsx("div",{className:"overflow-y-auto border-r border-edge-subtle",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:b},s.hash))})}),e.jsx("div",{className:"overflow-hidden p-2",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:b})})]}):e.jsx("div",{className:"hidden sm:block flex-1 overflow-y-auto",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:b},s.hash))})})]})]}):null}const ee=c.memo(G);export{ee as C}; diff --git a/frontend/dist/assets/Companion-RZ1tWdUk.js b/frontend/dist/assets/Companion-wAuzneXz.js similarity index 98% rename from frontend/dist/assets/Companion-RZ1tWdUk.js rename to frontend/dist/assets/Companion-wAuzneXz.js index 557c0fb3..ac5ffbf0 100644 --- a/frontend/dist/assets/Companion-RZ1tWdUk.js +++ b/frontend/dist/assets/Companion-wAuzneXz.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompanionPathMap-DAgjHpZ7.js","assets/index-Bcr7MabU.js","assets/usePipelineStore-nFeiBWWq.js","assets/node-types-BFsObq9k.js","assets/useReplayTick-DfhG2SSf.js","assets/payload-detail-jRk0k5AL.js","assets/car-Cn7MZO12.js","assets/map-pin-off-DbUyHIkr.js","assets/index-7uzBcJ1E.css","assets/maplibre-gl-B1CfjdFi.css","assets/CompanionEchoMap-BLZcQnij.js"])))=>i.map(i=>d[i]); -import{aY as Ua,fB as ws,a_ as mn,a$ as Ga,aZ as Tt,b0 as pn,r as l,b1 as Ka,b2 as ge,b5 as _e,aU as ee,b9 as X,b6 as fe,bj as qa,ba as Mt,be as $t,bf as At,bk as Va,bg as Me,bh as mt,bl as Ja,bi as ye,bm as ks,bn as Qa,bo as Xa,bp as ot,bq as Ya,br as Za,bs as er,aX as at,b7 as tr,fD as sr,d8 as Oe,fE as xn,bu as nr,bv as le,bw as ar,bD as rr,dl as lr,dm as ir,bF as or,fF as cr,bt as De,bE as pt,by as dr,fG as Ft,bH as Cs,fH as xt,b3 as Ye,bA as hn,bB as ur,bC as mr,d6 as Ss,d9 as Is,fC as pr,bG as xr,b4 as hr,bc as fr,bd as gr,bx as fn,d4 as gn,e as re,j as e,c as R,a0 as Ne,fI as yr,t as br,c_ as ie,fJ as ae,cF as je,ct as ht,aa as Ke,bN as ft,f2 as Re,f3 as Ee,f4 as Pe,d as ve,fK as vr,fL as jr,m as oe,fM as Nr,cU as ct,aC as Ce,aL as Te,aE as qe,aD as Se,a2 as ue,bZ as Ve,eJ as $e,B as U,fN as wr,fO as gt,au as kr,Q as Cr,fP as _s,_ as yn,cb as Sr,V as Le,fQ as Ir,dz as _r,fR as Ot,fS as Mr,fT as Rr,bJ as Rt,fU as Er,fV as Pr,fW as Tr,dK as $r,a1 as Dt,ef as Ar,fX as Fr,fY as Or,fZ as bn,f_ as Dr,a8 as Lr,f$ as zr,g0 as vn,fq as Hr,g1 as Br,g2 as Wr,I as he,C as Ms,g3 as jn,g4 as Ur,g5 as Gr,g6 as Kr,g7 as qr,g8 as Vr,g9 as Jr,ga as Qr,gb as Xr,gc as Yr,gd as Zr,a6 as el,ge as tl,gf as sl,gg as nl,gh as al,gi as rl,gj as ll,gk as il,gl as ol,gm as cl,gn as dl,go as ul,gp as ml,eE as pl}from"./index-Bcr7MabU.js";import{P as Rs,a as Es,B as Ps,C as Ts}from"./PageLayout-Bd1lZEvE.js";import{e as yt,g as bt,a as vt,f as xl,b as hl}from"./chat-utils-lxurr5ix.js";import{c as $s,S as fl,a as gl}from"./SignalIndicator-CYjIo_Mn.js";import{b as yl,F as bl,y as vl,R as jl,T as Nl,w as wl,A as kl,M as Nn}from"./map-pin-CmfqMW3N.js";import{p as Cl,a as rt,c as Y,f as st,b as Sl,L as Il,S as nt,s as _l,u as Ml,d as Rl}from"./element-movement-DUifCLY7.js";import{s as El}from"./use-text-value-B9WhdAMT.js";import{F as Pl}from"./use-tree-walker-DFaznB-R.js";import{a as lt}from"./index-BbwbpcoC.js";import{S as As}from"./search-D6EZ95nX.js";import{S as Tl}from"./share-2-CBcJN8r0.js";import{R as Je,L as $l}from"./route-DdD1xQhl.js";import{R as wn}from"./rotate-ccw-C1kT5MK1.js";import{T as Qe}from"./trash-2-Dyph4AYl.js";import{H as ze}from"./hash-DnbanjL5.js";import{C as Al}from"./check-check-XzEYoNqt.js";import{P as Xe}from"./plus-DZIbd-kZ.js";import{S as Fl,C as Ol}from"./ChatBubble-BqSfRbsT.js";import{p as Dl}from"./payload-detail-jRk0k5AL.js";import{A as Ll}from"./arrow-down-DFZvzXIi.js";import{C as zl}from"./chevron-right-BrHsAUr1.js";import{C as kn}from"./circle-alert-CbWxNnM7.js";import{f as Hl,c as Bl,a as Wl,M as Ul}from"./variants-Dh1uX6Aa.js";import{C as Cn}from"./clock-vUFydv3d.js";import{A as Sn}from"./activity-BHsjc-ov.js";import{T as In}from"./thermometer-DrBja3ui.js";import{S as Gl}from"./shield-check-Bjhdd7t0.js";import{W as Fs}from"./wand-sparkles-D_MagcvJ.js";import{C as Kl}from"./compass-D-aH3UW_.js";import{G as Os}from"./git-branch-CzidlvuL.js";import{F as ce,L as de,D as Ie}from"./fieldset-Sxb3-P4w.js";import{C as _n}from"./ConfirmModal-CvAkhuom.js";import{K as Mn}from"./key-round-CzmFaK7Z.js";import{F as Rn,P as ql}from"./pencil-C-yivzpx.js";var Vl=Object.defineProperty,Jl=(s,t,n)=>t in s?Vl(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,Ds=(s,t,n)=>(Jl(s,typeof t!="symbol"?t+"":t,n),n),ne=(s=>(s[s.Open=0]="Open",s[s.Closed=1]="Closed",s))(ne||{}),dt=(s=>(s[s.Pointer=0]="Pointer",s[s.Other=1]="Other",s))(dt||{}),V=(s=>(s[s.OpenMenu=0]="OpenMenu",s[s.CloseMenu=1]="CloseMenu",s[s.GoToItem=2]="GoToItem",s[s.Search=3]="Search",s[s.ClearSearch=4]="ClearSearch",s[s.RegisterItems=5]="RegisterItems",s[s.UnregisterItems=6]="UnregisterItems",s[s.SetButtonElement=7]="SetButtonElement",s[s.SetItemsElement=8]="SetItemsElement",s[s.SortItems=9]="SortItems",s[s.MarkButtonAsMoved=10]="MarkButtonAsMoved",s))(V||{});function Ls(s,t=n=>n){let n=s.activeItemIndex!==null?s.items[s.activeItemIndex]:null,a=pn(t(s.items.slice()),i=>i.dataRef.current.domRef.current),r=n?a.indexOf(n):null;return r===-1&&(r=null),{items:a,activeItemIndex:r}}let Ql={1(s){if(s.menuState===1)return s;let t=s.buttonElement?rt.Tracked(Sl(s.buttonElement)):s.buttonPositionState;return{...s,activeItemIndex:null,pendingFocus:{focus:Y.Nothing},menuState:1,buttonPositionState:t}},0(s,t){return s.menuState===0?s:{...s,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:rt.Idle}},2:(s,t)=>{var n,a,r,i,o;if(s.menuState===1)return s;let u={...s,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Y.Nothing)return{...u,activeItemIndex:null};if(t.focus===Y.Specific)return{...u,activeItemIndex:s.items.findIndex(c=>c.id===t.id)};if(t.focus===Y.Previous){let c=s.activeItemIndex;if(c!==null){let x=s.items[c].dataRef.current.domRef,y=st(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(y!==null){let g=s.items[y].dataRef.current.domRef;if(((a=x.current)==null?void 0:a.previousElementSibling)===g.current||((r=g.current)==null?void 0:r.previousElementSibling)===null)return{...u,activeItemIndex:y}}}}else if(t.focus===Y.Next){let c=s.activeItemIndex;if(c!==null){let x=s.items[c].dataRef.current.domRef,y=st(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(y!==null){let g=s.items[y].dataRef.current.domRef;if(((i=x.current)==null?void 0:i.nextElementSibling)===g.current||((o=g.current)==null?void 0:o.nextElementSibling)===null)return{...u,activeItemIndex:y}}}}let d=Ls(s),f=st(t,{resolveItems:()=>d.items,resolveActiveIndex:()=>d.activeItemIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...u,...d,activeItemIndex:f}},3:(s,t)=>{let n=s.searchQuery!==""?0:1,a=s.searchQuery+t.value.toLowerCase(),r=(s.activeItemIndex!==null?s.items.slice(s.activeItemIndex+n).concat(s.items.slice(0,s.activeItemIndex+n)):s.items).find(o=>{var u;return((u=o.dataRef.current.textValue)==null?void 0:u.startsWith(a))&&!o.dataRef.current.disabled}),i=r?s.items.indexOf(r):-1;return i===-1||i===s.activeItemIndex?{...s,searchQuery:a}:{...s,searchQuery:a,activeItemIndex:i,activationTrigger:1}},4(s){return s.searchQuery===""?s:{...s,searchQuery:"",searchActiveItemIndex:null}},5:(s,t)=>{let n=s.items.concat(t.items.map(r=>r)),a=s.activeItemIndex;return s.pendingFocus.focus!==Y.Nothing&&(a=st(s.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>s.activeItemIndex,resolveId:r=>r.id,resolveDisabled:r=>r.dataRef.current.disabled})),{...s,items:n,activeItemIndex:a,pendingFocus:{focus:Y.Nothing},pendingShouldSort:!0}},6:(s,t)=>{let n=s.items,a=[],r=new Set(t.items);for(let[i,o]of n.entries())if(r.has(o.id)&&(a.push(i),r.delete(o.id),r.size===0))break;if(a.length>0){n=n.slice();for(let i of a.reverse())n.splice(i,1)}return{...s,items:n,activationTrigger:1}},7:(s,t)=>s.buttonElement===t.element?s:{...s,buttonElement:t.element},8:(s,t)=>s.itemsElement===t.element?s:{...s,itemsElement:t.element},9:s=>s.pendingShouldSort?{...s,...Ls(s),pendingShouldSort:!1}:s,10(s){return s.buttonPositionState.kind!=="Tracked"?s:{...s,buttonPositionState:rt.Moved}}};class Lt extends Ua{constructor(t){super(t),Ds(this,"actions",{registerItem:ws(()=>{let n=[],a=new Set;return[(r,i)=>{a.has(i)||(a.add(i),n.push({id:r,dataRef:i}))},()=>(a.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:ws(()=>{let n=[];return[a=>n.push(a),()=>this.send({type:6,items:n.splice(0)})]})}),Ds(this,"selectors",{activeDescendantId(n){var a;let r=n.activeItemIndex,i=n.items;return r===null||(a=i[r])==null?void 0:a.id},isActive(n,a){var r;let i=n.activeItemIndex,o=n.items;return i!==null?((r=o[i])==null?void 0:r.id)===a:!1},shouldScrollIntoView(n,a){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,a)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,a=mn.get(null);this.disposables.add(a.on(Ga.Push,r=>{!a.selectors.isTop(r,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>a.actions.push(n)),this.on(1,()=>a.actions.pop(n))}this.disposables.group(n=>{this.on(1,a=>{a.buttonElement&&(n.dispose(),n.add(Cl(a.buttonElement,a.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new Lt({id:t,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:Y.Nothing},buttonPositionState:rt.Idle})}reduce(t,n){return Tt(n.type,Ql,t,n)}}const En=l.createContext(null);function zt(s){let t=l.useContext(En);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pn),n}return t}function Pn({id:s,__demoMode:t=!1}){let n=l.useMemo(()=>Lt.new({id:s,__demoMode:t}),[]);return Ka(()=>n.dispose()),n}let Xl=l.Fragment;function Yl(s,t){let n=l.useId(),{__demoMode:a=!1,...r}=s,i=Pn({id:n,__demoMode:a}),[o,u,d]=fe(i,k=>[k.menuState,k.itemsElement,k.buttonElement]),f=_e(t),c=mn.get(null),x=fe(c,l.useCallback(k=>c.selectors.isTop(k,n),[c,n]));rr(x,[d,u],(k,h)=>{var w;i.send({type:V.CloseMenu}),lr(h,ir.Loose)||(k.preventDefault(),(w=i.state.buttonElement)==null||w.focus())});let y=ee(()=>{i.send({type:V.CloseMenu})}),g=Me({open:o===ne.Open,close:y}),m={ref:f},j=ye();return le.createElement(kl,null,le.createElement(En.Provider,{value:i},le.createElement(or,{value:Tt(o,{[ne.Open]:ot.Open,[ne.Closed]:ot.Closed})},j({ourProps:m,theirProps:r,slot:g,defaultTag:Xl,name:"Menu"}))))}let Zl="button";function ei(s,t){let n=zt("Menu.Button"),a=l.useId(),{id:r=`headlessui-menu-button-${a}`,disabled:i=!1,autoFocus:o=!1,...u}=s,d=l.useRef(null),f=yl(),c=_e(t,d,bl(),ee(N=>n.send({type:V.SetButtonElement,element:N}))),x=ee(N=>{switch(N.key){case X.Space:case X.Enter:case X.ArrowDown:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.First}});break;case X.ArrowUp:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.Last}});break}}),y=ee(N=>{switch(N.key){case X.Space:N.preventDefault();break}}),[g,m,j]=fe(n,N=>[N.menuState,N.buttonElement,N.itemsElement]),k=g===ne.Open;Il(k,{trigger:m,action:l.useCallback(N=>{if(m!=null&&m.contains(N.target))return nt.Ignore;let C=N.target.closest('[role="menuitem"]:not([data-disabled])');return qa(C)?nt.Select(C):j!=null&&j.contains(N.target)?nt.Ignore:nt.Close},[m,j]),close:l.useCallback(()=>n.send({type:V.CloseMenu}),[]),select:l.useCallback(N=>N.click(),[])});let h=_l(N=>{var C;i||(g===ne.Open?(Mt.flushSync(()=>n.send({type:V.CloseMenu})),(C=d.current)==null||C.focus({preventScroll:!0})):(N.preventDefault(),n.send({type:V.OpenMenu,focus:{focus:Y.Nothing},trigger:dt.Pointer})))}),{isFocusVisible:w,focusProps:E}=$t({autoFocus:o}),{isHovered:M,hoverProps:b}=At({isDisabled:i}),{pressed:I,pressProps:T}=Va({disabled:i}),_=Me({open:g===ne.Open,active:I||g===ne.Open,disabled:i,hover:M,focus:w,autofocus:o}),p=mt(f(),{ref:c,id:r,type:Ja(s,d.current),"aria-haspopup":"menu","aria-controls":j==null?void 0:j.id,"aria-expanded":g===ne.Open,disabled:i||void 0,autoFocus:o,onKeyDown:x,onKeyUp:y},h,E,b,T);return ye()({ourProps:p,theirProps:u,slot:_,defaultTag:Zl,name:"Menu.Button"})}let ti="div",si=Cs.RenderStrategy|Cs.Static;function ni(s,t){let n=l.useId(),{id:a=`headlessui-menu-items-${n}`,anchor:r,portal:i=!1,modal:o=!0,transition:u=!1,...d}=s,f=vl(r),c=zt("Menu.Items"),[x,y]=jl(f),g=Nl(),[m,j]=l.useState(null),k=_e(t,f?x:null,ee(O=>c.send({type:V.SetItemsElement,element:O})),j),[h,w]=fe(c,O=>[O.menuState,O.buttonElement]),E=ks(w),M=ks(m);f&&(i=!0);let b=Qa(),[I,T]=Xa(u,m,b!==null?(b&ot.Open)===ot.Open:h===ne.Open);Ya(I,w,()=>{c.send({type:V.CloseMenu})});let _=fe(c,O=>O.__demoMode),p=_?!1:o&&h===ne.Open;Za(p,M);let N=_?!1:o&&h===ne.Open;er(N,{allowed:l.useCallback(()=>[w,m],[w,m])});let C=fe(c,c.selectors.didButtonMove)?!1:I;l.useEffect(()=>{let O=m;O&&h===ne.Open&&(at(O)||O.focus({preventScroll:!0}))},[h,m]),Pl(h===ne.Open,{container:m,accept(O){return O.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:O.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(O){O.setAttribute("role","none")}});let v=tr(),L=ee(O=>{var q,J,B;switch(v.dispose(),O.key){case X.Space:if(c.state.searchQuery!=="")return O.preventDefault(),O.stopPropagation(),c.send({type:V.Search,value:O.key});case X.Enter:if(O.preventDefault(),O.stopPropagation(),c.state.activeItemIndex!==null){let{dataRef:A}=c.state.items[c.state.activeItemIndex];(J=(q=A.current)==null?void 0:q.domRef.current)==null||J.click()}c.send({type:V.CloseMenu}),xn(c.state.buttonElement);break;case X.ArrowDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Next});case X.ArrowUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Previous});case X.Home:case X.PageUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.First});case X.End:case X.PageDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Last});case X.Escape:O.preventDefault(),O.stopPropagation(),Mt.flushSync(()=>c.send({type:V.CloseMenu})),(B=c.state.buttonElement)==null||B.focus({preventScroll:!0});break;case X.Tab:O.preventDefault(),O.stopPropagation(),Mt.flushSync(()=>c.send({type:V.CloseMenu})),sr(c.state.buttonElement,O.shiftKey?Oe.Previous:Oe.Next);break;default:O.key.length===1&&(c.send({type:V.Search,value:O.key}),v.setTimeout(()=>c.send({type:V.ClearSearch}),350));break}}),S=ee(O=>{switch(O.key){case X.Space:O.preventDefault();break}}),D=Me({open:h===ne.Open}),$=mt(f?g():{},{"aria-activedescendant":fe(c,c.selectors.activeDescendantId),"aria-labelledby":fe(c,O=>{var q;return(q=O.buttonElement)==null?void 0:q.id}),id:a,onKeyDown:L,onKeyUp:S,role:"menu",tabIndex:h===ne.Open?0:void 0,ref:k,style:{...d.style,...y,"--button-width":wl(I,w,!0).width},...nr(T)}),G=ye();return le.createElement(ar,{enabled:i?s.static||I:!1,ownerDocument:E},G({ourProps:$,theirProps:d,slot:D,defaultTag:ti,features:si,visible:C,name:"Menu.Items"}))}let ai=l.Fragment;function ri(s,t){let n=l.useId(),{id:a=`headlessui-menu-item-${n}`,disabled:r=!1,...i}=s,o=zt("Menu.Item"),u=fe(o,C=>o.selectors.isActive(C,a)),d=l.useRef(null),f=_e(t,d),c=fe(o,C=>o.selectors.shouldScrollIntoView(C,a));De(()=>{if(c)return dr().requestAnimationFrame(()=>{var C,v;(v=(C=d.current)==null?void 0:C.scrollIntoView)==null||v.call(C,{block:"nearest"})})},[c,d]);let x=El(d),y=l.useRef({disabled:r,domRef:d,get textValue(){return x()}});De(()=>{y.current.disabled=r},[y,r]),De(()=>(o.actions.registerItem(a,y),()=>o.actions.unregisterItem(a)),[y,a]);let g=ee(()=>{o.send({type:V.CloseMenu})}),m=ee(C=>{if(r)return C.preventDefault();o.send({type:V.CloseMenu}),xn(o.state.buttonElement)}),j=ee(()=>{if(r)return o.send({type:V.GoToItem,focus:Y.Nothing});o.send({type:V.GoToItem,focus:Y.Specific,id:a})}),k=Ml(),h=ee(C=>k.update(C)),w=ee(C=>{k.wasMoved(C)&&(r||u||o.send({type:V.GoToItem,focus:Y.Specific,id:a,trigger:dt.Pointer}))}),E=ee(C=>{k.wasMoved(C)&&(r||u&&o.state.activationTrigger===dt.Pointer&&o.send({type:V.GoToItem,focus:Y.Nothing}))}),[M,b]=pt(),[I,T]=Ft(),_=Me({active:u,focus:u,disabled:r,close:g}),p={id:a,ref:f,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-labelledby":M,"aria-describedby":I,disabled:void 0,onClick:m,onFocus:j,onPointerEnter:h,onMouseEnter:h,onPointerMove:w,onMouseMove:w,onPointerLeave:E,onMouseLeave:E},N=ye();return le.createElement(b,null,le.createElement(T,null,N({ourProps:p,theirProps:i,slot:_,defaultTag:ai,name:"Menu.Item"})))}let li="div";function ii(s,t){let[n,a]=pt(),r=s,i={ref:t,"aria-labelledby":n,role:"group"},o=ye();return le.createElement(a,null,o({ourProps:i,theirProps:r,slot:{},defaultTag:li,name:"Menu.Section"}))}let oi="header";function ci(s,t){let n=l.useId(),{id:a=`headlessui-menu-heading-${n}`,...r}=s,i=cr();De(()=>i.register(a),[a,i.register]);let o={id:a,ref:t,role:"presentation",...i.props};return ye()({ourProps:o,theirProps:r,slot:{},defaultTag:oi,name:"Menu.Heading"})}let di="div";function ui(s,t){let n=s,a={ref:t,role:"separator"};return ye()({ourProps:a,theirProps:n,slot:{},defaultTag:di,name:"Menu.Separator"})}let mi=ge(Yl),Tn=ge(ei),$n=ge(ni),Et=ge(ri),pi=ge(ii),xi=ge(ci),An=ge(ui),hi=Object.assign(mi,{Button:Tn,Items:$n,Item:Et,Section:pi,Heading:xi,Separator:An});var fi=(s=>(s[s.RegisterOption=0]="RegisterOption",s[s.UnregisterOption=1]="UnregisterOption",s))(fi||{});let gi={0(s,t){let n=[...s.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...s,options:pn(n,a=>a.element.current)}},1(s,t){let n=s.options.slice(),a=s.options.findIndex(r=>r.id===t.id);return a===-1?s:(n.splice(a,1),{...s,options:n})}},Ht=l.createContext(null);Ht.displayName="RadioGroupDataContext";function Bt(s){let t=l.useContext(Ht);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Bt),n}return t}let Wt=l.createContext(null);Wt.displayName="RadioGroupActionsContext";function Ut(s){let t=l.useContext(Wt);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ut),n}return t}function yi(s,t){return Tt(t.type,gi,s,t)}let bi="div";function vi(s,t){let n=l.useId(),a=hn(),{id:r=`headlessui-radiogroup-${n}`,value:i,form:o,name:u,onChange:d,by:f,disabled:c=a||!1,defaultValue:x,tabIndex:y=0,...g}=s,m=Rl(f),[j,k]=l.useReducer(yi,{options:[]}),h=j.options,[w,E]=pt(),[M,b]=Ft(),I=l.useRef(null),T=_e(I,t),_=ur(x),[p,N]=mr(i,d,_),C=l.useMemo(()=>h.find(A=>!A.propsRef.current.disabled),[h]),v=l.useMemo(()=>h.some(A=>m(A.propsRef.current.value,p)),[h,p]),L=ee(A=>{var z;if(c||m(A,p))return!1;let F=(z=h.find(W=>m(W.propsRef.current.value,A)))==null?void 0:z.propsRef.current;return F!=null&&F.disabled?!1:(N==null||N(A),!0)}),S=ee(A=>{if(!I.current)return;let z=h.filter(F=>F.propsRef.current.disabled===!1).map(F=>F.element.current);switch(A.key){case X.Enter:pr(A.currentTarget);break;case X.ArrowLeft:case X.ArrowUp:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Previous|Oe.WrapAround)===Is.Success){let F=h.find(W=>at(W.element.current));F&&L(F.propsRef.current.value)}break;case X.ArrowRight:case X.ArrowDown:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Next|Oe.WrapAround)===Is.Success){let F=h.find(W=>at(W.element.current));F&&L(F.propsRef.current.value)}break;case X.Space:{A.preventDefault(),A.stopPropagation();let F=h.find(W=>at(W.element.current));F&&L(F.propsRef.current.value)}break}}),D=ee(A=>(k({type:0,...A}),()=>k({type:1,id:A.id}))),$=l.useMemo(()=>({value:p,firstOption:C,containsCheckedOption:v,disabled:c,compare:m,tabIndex:y,...j}),[p,C,v,c,m,y,j]),G=l.useMemo(()=>({registerOption:D,change:L}),[D,L]),O={ref:T,id:r,role:"radiogroup","aria-labelledby":w,"aria-describedby":M,onKeyDown:S},q=Me({value:p}),J=l.useCallback(()=>{if(_!==void 0)return L(_)},[L,_]),B=ye();return le.createElement(b,{name:"RadioGroup.Description"},le.createElement(E,{name:"RadioGroup.Label"},le.createElement(Wt.Provider,{value:G},le.createElement(Ht.Provider,{value:$},u!=null&&le.createElement(xr,{disabled:c,data:{[u]:p||"on"},overrides:{type:"radio",checked:p!=null},form:o,onReset:J}),B({ourProps:O,theirProps:g,slot:q,defaultTag:bi,name:"RadioGroup"})))))}let ji="div";function Ni(s,t){var n;let a=Bt("RadioGroup.Option"),r=Ut("RadioGroup.Option"),i=l.useId(),{id:o=`headlessui-radiogroup-option-${i}`,value:u,disabled:d=a.disabled||!1,autoFocus:f=!1,...c}=s,x=l.useRef(null),y=_e(x,t),[g,m]=pt(),[j,k]=Ft(),h=fn({value:u,disabled:d});De(()=>r.registerOption({id:o,element:x,propsRef:h}),[o,r,x,h]);let w=ee(v=>{var L;if(gn(v.currentTarget))return v.preventDefault();r.change(u)&&((L=x.current)==null||L.focus())}),E=((n=a.firstOption)==null?void 0:n.id)===o,{isFocusVisible:M,focusProps:b}=$t({autoFocus:f}),{isHovered:I,hoverProps:T}=At({isDisabled:d}),_=a.compare(a.value,u),p=mt({ref:y,id:o,role:"radio","aria-checked":_?"true":"false","aria-labelledby":g,"aria-describedby":j,"aria-disabled":d?!0:void 0,tabIndex:d?-1:_||!a.containsCheckedOption&&E?a.tabIndex:-1,onClick:d?void 0:w,autoFocus:f},b,T),N=Me({checked:_,disabled:d,active:M,hover:I,focus:M,autofocus:f}),C=ye();return le.createElement(k,{name:"RadioGroup.Description"},le.createElement(m,{name:"RadioGroup.Label"},C({ourProps:p,theirProps:c,slot:N,defaultTag:ji,name:"RadioGroup.Option"})))}let wi="span";function ki(s,t){var n;let a=Bt("Radio"),r=Ut("Radio"),i=l.useId(),o=hr(),u=hn(),{id:d=o||`headlessui-radio-${i}`,value:f,disabled:c=a.disabled||u||!1,autoFocus:x=!1,...y}=s,g=l.useRef(null),m=_e(g,t),j=fr(),k=gr(),h=fn({value:f,disabled:c});De(()=>r.registerOption({id:d,element:g,propsRef:h}),[d,r,g,h]);let w=ee(C=>{var v;if(gn(C.currentTarget))return C.preventDefault();r.change(f)&&((v=g.current)==null||v.focus())}),{isFocusVisible:E,focusProps:M}=$t({autoFocus:x}),{isHovered:b,hoverProps:I}=At({isDisabled:c}),T=((n=a.firstOption)==null?void 0:n.id)===d,_=a.compare(a.value,f),p=mt({ref:m,id:d,role:"radio","aria-checked":_?"true":"false","aria-labelledby":j,"aria-describedby":k,"aria-disabled":c?!0:void 0,tabIndex:c?-1:_||!a.containsCheckedOption&&T?a.tabIndex:-1,autoFocus:x,onClick:c?void 0:w},M,I),N=Me({checked:_,disabled:c,hover:b,focus:E,autofocus:x});return ye()({ourProps:p,theirProps:y,slot:N,defaultTag:wi,name:"Radio"})}let Ci=ge(vi),Si=ge(Ni),jt=ge(ki),Ii=Ye,_i=xt,Mi=Object.assign(Ci,{Option:Si,Radio:jt,Label:Ii,Description:_i});/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompanionPathMap-r_W6gfQA.js","assets/index-CR6htdhJ.js","assets/usePipelineStore-CyVtwxqQ.js","assets/node-types-BvQCDNK9.js","assets/useReplayTick-DoGUoba6.js","assets/payload-detail-B6eeo8Zi.js","assets/car-BDe4EgpC.js","assets/map-pin-off-DzBgJ4-5.js","assets/index-7uzBcJ1E.css","assets/maplibre-gl-B1CfjdFi.css","assets/CompanionEchoMap-C048dCxi.js"])))=>i.map(i=>d[i]); +import{aY as Ua,fB as ws,a_ as mn,a$ as Ga,aZ as Tt,b0 as pn,r as l,b1 as Ka,b2 as ge,b5 as _e,aU as ee,b9 as X,b6 as fe,bj as qa,ba as Mt,be as $t,bf as At,bk as Va,bg as Me,bh as mt,bl as Ja,bi as ye,bm as ks,bn as Qa,bo as Xa,bp as ot,bq as Ya,br as Za,bs as er,aX as at,b7 as tr,fD as sr,d8 as Oe,fE as xn,bu as nr,bv as le,bw as ar,bD as rr,dl as lr,dm as ir,bF as or,fF as cr,bt as De,bE as pt,by as dr,fG as Ft,bH as Cs,fH as xt,b3 as Ye,bA as hn,bB as ur,bC as mr,d6 as Ss,d9 as Is,fC as pr,bG as xr,b4 as hr,bc as fr,bd as gr,bx as fn,d4 as gn,e as re,j as e,c as R,a0 as Ne,fI as yr,t as br,c_ as ie,fJ as ae,cF as je,ct as ht,aa as Ke,bN as ft,f2 as Re,f3 as Ee,f4 as Pe,d as ve,fK as vr,fL as jr,m as oe,fM as Nr,cU as ct,aC as Ce,aL as Te,aE as qe,aD as Se,a2 as ue,bZ as Ve,eJ as $e,B as U,fN as wr,fO as gt,au as kr,Q as Cr,fP as _s,_ as yn,cb as Sr,V as Le,fQ as Ir,dz as _r,fR as Ot,fS as Mr,fT as Rr,bJ as Rt,fU as Er,fV as Pr,fW as Tr,dK as $r,a1 as Dt,ef as Ar,fX as Fr,fY as Or,fZ as bn,f_ as Dr,a8 as Lr,f$ as zr,g0 as vn,fq as Hr,g1 as Br,g2 as Wr,I as he,C as Ms,g3 as jn,g4 as Ur,g5 as Gr,g6 as Kr,g7 as qr,g8 as Vr,g9 as Jr,ga as Qr,gb as Xr,gc as Yr,gd as Zr,a6 as el,ge as tl,gf as sl,gg as nl,gh as al,gi as rl,gj as ll,gk as il,gl as ol,gm as cl,gn as dl,go as ul,gp as ml,eE as pl}from"./index-CR6htdhJ.js";import{P as Rs,a as Es,B as Ps,C as Ts}from"./PageLayout-Dk902Dlo.js";import{e as yt,g as bt,a as vt,f as xl,b as hl}from"./chat-utils-DHa6YwrS.js";import{c as $s,S as fl,a as gl}from"./SignalIndicator-ClMJO5cF.js";import{b as yl,F as bl,y as vl,R as jl,T as Nl,w as wl,A as kl,M as Nn}from"./map-pin-DLf5Z8nk.js";import{p as Cl,a as rt,c as Y,f as st,b as Sl,L as Il,S as nt,s as _l,u as Ml,d as Rl}from"./element-movement-DIPTY4wV.js";import{s as El}from"./use-text-value-Ch4p-2-R.js";import{F as Pl}from"./use-tree-walker-BLvCEoIh.js";import{a as lt}from"./index-CnoLcwbn.js";import{S as As}from"./search-Djg1V5_Y.js";import{S as Tl}from"./share-2-Cm0TgUDc.js";import{R as Je,L as $l}from"./route-BdG55Ep-.js";import{R as wn}from"./rotate-ccw-D8J04SFo.js";import{T as Qe}from"./trash-2-DDi3fVjz.js";import{H as ze}from"./hash-D5cqF2Y_.js";import{C as Al}from"./check-check-TgoebkD3.js";import{P as Xe}from"./plus-CfHg5JLg.js";import{S as Fl,C as Ol}from"./ChatBubble-CpAqiMRZ.js";import{p as Dl}from"./payload-detail-B6eeo8Zi.js";import{A as Ll}from"./arrow-down-DFhP0Q_b.js";import{C as zl}from"./chevron-right-D2DgrpVm.js";import{C as kn}from"./circle-alert-BFYzxudo.js";import{f as Hl,c as Bl,a as Wl,M as Ul}from"./variants-B-xhsx06.js";import{C as Cn}from"./clock-BFNcreJN.js";import{A as Sn}from"./activity-B1_-JLqt.js";import{T as In}from"./thermometer-BJ9Pjk-U.js";import{S as Gl}from"./shield-check-CX3GhuSg.js";import{W as Fs}from"./wand-sparkles-qgdZS22e.js";import{C as Kl}from"./compass-fAtfJAIE.js";import{G as Os}from"./git-branch-94MoMaKB.js";import{F as ce,L as de,D as Ie}from"./fieldset-CnJ1jd-h.js";import{C as _n}from"./ConfirmModal-CijEsZrl.js";import{K as Mn}from"./key-round-CTDlyfAN.js";import{F as Rn,P as ql}from"./pencil-JjdQp1l1.js";var Vl=Object.defineProperty,Jl=(s,t,n)=>t in s?Vl(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,Ds=(s,t,n)=>(Jl(s,typeof t!="symbol"?t+"":t,n),n),ne=(s=>(s[s.Open=0]="Open",s[s.Closed=1]="Closed",s))(ne||{}),dt=(s=>(s[s.Pointer=0]="Pointer",s[s.Other=1]="Other",s))(dt||{}),V=(s=>(s[s.OpenMenu=0]="OpenMenu",s[s.CloseMenu=1]="CloseMenu",s[s.GoToItem=2]="GoToItem",s[s.Search=3]="Search",s[s.ClearSearch=4]="ClearSearch",s[s.RegisterItems=5]="RegisterItems",s[s.UnregisterItems=6]="UnregisterItems",s[s.SetButtonElement=7]="SetButtonElement",s[s.SetItemsElement=8]="SetItemsElement",s[s.SortItems=9]="SortItems",s[s.MarkButtonAsMoved=10]="MarkButtonAsMoved",s))(V||{});function Ls(s,t=n=>n){let n=s.activeItemIndex!==null?s.items[s.activeItemIndex]:null,a=pn(t(s.items.slice()),i=>i.dataRef.current.domRef.current),r=n?a.indexOf(n):null;return r===-1&&(r=null),{items:a,activeItemIndex:r}}let Ql={1(s){if(s.menuState===1)return s;let t=s.buttonElement?rt.Tracked(Sl(s.buttonElement)):s.buttonPositionState;return{...s,activeItemIndex:null,pendingFocus:{focus:Y.Nothing},menuState:1,buttonPositionState:t}},0(s,t){return s.menuState===0?s:{...s,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:rt.Idle}},2:(s,t)=>{var n,a,r,i,o;if(s.menuState===1)return s;let u={...s,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Y.Nothing)return{...u,activeItemIndex:null};if(t.focus===Y.Specific)return{...u,activeItemIndex:s.items.findIndex(c=>c.id===t.id)};if(t.focus===Y.Previous){let c=s.activeItemIndex;if(c!==null){let x=s.items[c].dataRef.current.domRef,y=st(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(y!==null){let g=s.items[y].dataRef.current.domRef;if(((a=x.current)==null?void 0:a.previousElementSibling)===g.current||((r=g.current)==null?void 0:r.previousElementSibling)===null)return{...u,activeItemIndex:y}}}}else if(t.focus===Y.Next){let c=s.activeItemIndex;if(c!==null){let x=s.items[c].dataRef.current.domRef,y=st(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(y!==null){let g=s.items[y].dataRef.current.domRef;if(((i=x.current)==null?void 0:i.nextElementSibling)===g.current||((o=g.current)==null?void 0:o.nextElementSibling)===null)return{...u,activeItemIndex:y}}}}let d=Ls(s),f=st(t,{resolveItems:()=>d.items,resolveActiveIndex:()=>d.activeItemIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...u,...d,activeItemIndex:f}},3:(s,t)=>{let n=s.searchQuery!==""?0:1,a=s.searchQuery+t.value.toLowerCase(),r=(s.activeItemIndex!==null?s.items.slice(s.activeItemIndex+n).concat(s.items.slice(0,s.activeItemIndex+n)):s.items).find(o=>{var u;return((u=o.dataRef.current.textValue)==null?void 0:u.startsWith(a))&&!o.dataRef.current.disabled}),i=r?s.items.indexOf(r):-1;return i===-1||i===s.activeItemIndex?{...s,searchQuery:a}:{...s,searchQuery:a,activeItemIndex:i,activationTrigger:1}},4(s){return s.searchQuery===""?s:{...s,searchQuery:"",searchActiveItemIndex:null}},5:(s,t)=>{let n=s.items.concat(t.items.map(r=>r)),a=s.activeItemIndex;return s.pendingFocus.focus!==Y.Nothing&&(a=st(s.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>s.activeItemIndex,resolveId:r=>r.id,resolveDisabled:r=>r.dataRef.current.disabled})),{...s,items:n,activeItemIndex:a,pendingFocus:{focus:Y.Nothing},pendingShouldSort:!0}},6:(s,t)=>{let n=s.items,a=[],r=new Set(t.items);for(let[i,o]of n.entries())if(r.has(o.id)&&(a.push(i),r.delete(o.id),r.size===0))break;if(a.length>0){n=n.slice();for(let i of a.reverse())n.splice(i,1)}return{...s,items:n,activationTrigger:1}},7:(s,t)=>s.buttonElement===t.element?s:{...s,buttonElement:t.element},8:(s,t)=>s.itemsElement===t.element?s:{...s,itemsElement:t.element},9:s=>s.pendingShouldSort?{...s,...Ls(s),pendingShouldSort:!1}:s,10(s){return s.buttonPositionState.kind!=="Tracked"?s:{...s,buttonPositionState:rt.Moved}}};class Lt extends Ua{constructor(t){super(t),Ds(this,"actions",{registerItem:ws(()=>{let n=[],a=new Set;return[(r,i)=>{a.has(i)||(a.add(i),n.push({id:r,dataRef:i}))},()=>(a.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:ws(()=>{let n=[];return[a=>n.push(a),()=>this.send({type:6,items:n.splice(0)})]})}),Ds(this,"selectors",{activeDescendantId(n){var a;let r=n.activeItemIndex,i=n.items;return r===null||(a=i[r])==null?void 0:a.id},isActive(n,a){var r;let i=n.activeItemIndex,o=n.items;return i!==null?((r=o[i])==null?void 0:r.id)===a:!1},shouldScrollIntoView(n,a){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,a)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,a=mn.get(null);this.disposables.add(a.on(Ga.Push,r=>{!a.selectors.isTop(r,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>a.actions.push(n)),this.on(1,()=>a.actions.pop(n))}this.disposables.group(n=>{this.on(1,a=>{a.buttonElement&&(n.dispose(),n.add(Cl(a.buttonElement,a.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new Lt({id:t,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:Y.Nothing},buttonPositionState:rt.Idle})}reduce(t,n){return Tt(n.type,Ql,t,n)}}const En=l.createContext(null);function zt(s){let t=l.useContext(En);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pn),n}return t}function Pn({id:s,__demoMode:t=!1}){let n=l.useMemo(()=>Lt.new({id:s,__demoMode:t}),[]);return Ka(()=>n.dispose()),n}let Xl=l.Fragment;function Yl(s,t){let n=l.useId(),{__demoMode:a=!1,...r}=s,i=Pn({id:n,__demoMode:a}),[o,u,d]=fe(i,k=>[k.menuState,k.itemsElement,k.buttonElement]),f=_e(t),c=mn.get(null),x=fe(c,l.useCallback(k=>c.selectors.isTop(k,n),[c,n]));rr(x,[d,u],(k,h)=>{var w;i.send({type:V.CloseMenu}),lr(h,ir.Loose)||(k.preventDefault(),(w=i.state.buttonElement)==null||w.focus())});let y=ee(()=>{i.send({type:V.CloseMenu})}),g=Me({open:o===ne.Open,close:y}),m={ref:f},j=ye();return le.createElement(kl,null,le.createElement(En.Provider,{value:i},le.createElement(or,{value:Tt(o,{[ne.Open]:ot.Open,[ne.Closed]:ot.Closed})},j({ourProps:m,theirProps:r,slot:g,defaultTag:Xl,name:"Menu"}))))}let Zl="button";function ei(s,t){let n=zt("Menu.Button"),a=l.useId(),{id:r=`headlessui-menu-button-${a}`,disabled:i=!1,autoFocus:o=!1,...u}=s,d=l.useRef(null),f=yl(),c=_e(t,d,bl(),ee(N=>n.send({type:V.SetButtonElement,element:N}))),x=ee(N=>{switch(N.key){case X.Space:case X.Enter:case X.ArrowDown:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.First}});break;case X.ArrowUp:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.Last}});break}}),y=ee(N=>{switch(N.key){case X.Space:N.preventDefault();break}}),[g,m,j]=fe(n,N=>[N.menuState,N.buttonElement,N.itemsElement]),k=g===ne.Open;Il(k,{trigger:m,action:l.useCallback(N=>{if(m!=null&&m.contains(N.target))return nt.Ignore;let C=N.target.closest('[role="menuitem"]:not([data-disabled])');return qa(C)?nt.Select(C):j!=null&&j.contains(N.target)?nt.Ignore:nt.Close},[m,j]),close:l.useCallback(()=>n.send({type:V.CloseMenu}),[]),select:l.useCallback(N=>N.click(),[])});let h=_l(N=>{var C;i||(g===ne.Open?(Mt.flushSync(()=>n.send({type:V.CloseMenu})),(C=d.current)==null||C.focus({preventScroll:!0})):(N.preventDefault(),n.send({type:V.OpenMenu,focus:{focus:Y.Nothing},trigger:dt.Pointer})))}),{isFocusVisible:w,focusProps:E}=$t({autoFocus:o}),{isHovered:M,hoverProps:b}=At({isDisabled:i}),{pressed:I,pressProps:T}=Va({disabled:i}),_=Me({open:g===ne.Open,active:I||g===ne.Open,disabled:i,hover:M,focus:w,autofocus:o}),p=mt(f(),{ref:c,id:r,type:Ja(s,d.current),"aria-haspopup":"menu","aria-controls":j==null?void 0:j.id,"aria-expanded":g===ne.Open,disabled:i||void 0,autoFocus:o,onKeyDown:x,onKeyUp:y},h,E,b,T);return ye()({ourProps:p,theirProps:u,slot:_,defaultTag:Zl,name:"Menu.Button"})}let ti="div",si=Cs.RenderStrategy|Cs.Static;function ni(s,t){let n=l.useId(),{id:a=`headlessui-menu-items-${n}`,anchor:r,portal:i=!1,modal:o=!0,transition:u=!1,...d}=s,f=vl(r),c=zt("Menu.Items"),[x,y]=jl(f),g=Nl(),[m,j]=l.useState(null),k=_e(t,f?x:null,ee(O=>c.send({type:V.SetItemsElement,element:O})),j),[h,w]=fe(c,O=>[O.menuState,O.buttonElement]),E=ks(w),M=ks(m);f&&(i=!0);let b=Qa(),[I,T]=Xa(u,m,b!==null?(b&ot.Open)===ot.Open:h===ne.Open);Ya(I,w,()=>{c.send({type:V.CloseMenu})});let _=fe(c,O=>O.__demoMode),p=_?!1:o&&h===ne.Open;Za(p,M);let N=_?!1:o&&h===ne.Open;er(N,{allowed:l.useCallback(()=>[w,m],[w,m])});let C=fe(c,c.selectors.didButtonMove)?!1:I;l.useEffect(()=>{let O=m;O&&h===ne.Open&&(at(O)||O.focus({preventScroll:!0}))},[h,m]),Pl(h===ne.Open,{container:m,accept(O){return O.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:O.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(O){O.setAttribute("role","none")}});let v=tr(),L=ee(O=>{var q,J,B;switch(v.dispose(),O.key){case X.Space:if(c.state.searchQuery!=="")return O.preventDefault(),O.stopPropagation(),c.send({type:V.Search,value:O.key});case X.Enter:if(O.preventDefault(),O.stopPropagation(),c.state.activeItemIndex!==null){let{dataRef:A}=c.state.items[c.state.activeItemIndex];(J=(q=A.current)==null?void 0:q.domRef.current)==null||J.click()}c.send({type:V.CloseMenu}),xn(c.state.buttonElement);break;case X.ArrowDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Next});case X.ArrowUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Previous});case X.Home:case X.PageUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.First});case X.End:case X.PageDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Last});case X.Escape:O.preventDefault(),O.stopPropagation(),Mt.flushSync(()=>c.send({type:V.CloseMenu})),(B=c.state.buttonElement)==null||B.focus({preventScroll:!0});break;case X.Tab:O.preventDefault(),O.stopPropagation(),Mt.flushSync(()=>c.send({type:V.CloseMenu})),sr(c.state.buttonElement,O.shiftKey?Oe.Previous:Oe.Next);break;default:O.key.length===1&&(c.send({type:V.Search,value:O.key}),v.setTimeout(()=>c.send({type:V.ClearSearch}),350));break}}),S=ee(O=>{switch(O.key){case X.Space:O.preventDefault();break}}),D=Me({open:h===ne.Open}),$=mt(f?g():{},{"aria-activedescendant":fe(c,c.selectors.activeDescendantId),"aria-labelledby":fe(c,O=>{var q;return(q=O.buttonElement)==null?void 0:q.id}),id:a,onKeyDown:L,onKeyUp:S,role:"menu",tabIndex:h===ne.Open?0:void 0,ref:k,style:{...d.style,...y,"--button-width":wl(I,w,!0).width},...nr(T)}),G=ye();return le.createElement(ar,{enabled:i?s.static||I:!1,ownerDocument:E},G({ourProps:$,theirProps:d,slot:D,defaultTag:ti,features:si,visible:C,name:"Menu.Items"}))}let ai=l.Fragment;function ri(s,t){let n=l.useId(),{id:a=`headlessui-menu-item-${n}`,disabled:r=!1,...i}=s,o=zt("Menu.Item"),u=fe(o,C=>o.selectors.isActive(C,a)),d=l.useRef(null),f=_e(t,d),c=fe(o,C=>o.selectors.shouldScrollIntoView(C,a));De(()=>{if(c)return dr().requestAnimationFrame(()=>{var C,v;(v=(C=d.current)==null?void 0:C.scrollIntoView)==null||v.call(C,{block:"nearest"})})},[c,d]);let x=El(d),y=l.useRef({disabled:r,domRef:d,get textValue(){return x()}});De(()=>{y.current.disabled=r},[y,r]),De(()=>(o.actions.registerItem(a,y),()=>o.actions.unregisterItem(a)),[y,a]);let g=ee(()=>{o.send({type:V.CloseMenu})}),m=ee(C=>{if(r)return C.preventDefault();o.send({type:V.CloseMenu}),xn(o.state.buttonElement)}),j=ee(()=>{if(r)return o.send({type:V.GoToItem,focus:Y.Nothing});o.send({type:V.GoToItem,focus:Y.Specific,id:a})}),k=Ml(),h=ee(C=>k.update(C)),w=ee(C=>{k.wasMoved(C)&&(r||u||o.send({type:V.GoToItem,focus:Y.Specific,id:a,trigger:dt.Pointer}))}),E=ee(C=>{k.wasMoved(C)&&(r||u&&o.state.activationTrigger===dt.Pointer&&o.send({type:V.GoToItem,focus:Y.Nothing}))}),[M,b]=pt(),[I,T]=Ft(),_=Me({active:u,focus:u,disabled:r,close:g}),p={id:a,ref:f,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-labelledby":M,"aria-describedby":I,disabled:void 0,onClick:m,onFocus:j,onPointerEnter:h,onMouseEnter:h,onPointerMove:w,onMouseMove:w,onPointerLeave:E,onMouseLeave:E},N=ye();return le.createElement(b,null,le.createElement(T,null,N({ourProps:p,theirProps:i,slot:_,defaultTag:ai,name:"Menu.Item"})))}let li="div";function ii(s,t){let[n,a]=pt(),r=s,i={ref:t,"aria-labelledby":n,role:"group"},o=ye();return le.createElement(a,null,o({ourProps:i,theirProps:r,slot:{},defaultTag:li,name:"Menu.Section"}))}let oi="header";function ci(s,t){let n=l.useId(),{id:a=`headlessui-menu-heading-${n}`,...r}=s,i=cr();De(()=>i.register(a),[a,i.register]);let o={id:a,ref:t,role:"presentation",...i.props};return ye()({ourProps:o,theirProps:r,slot:{},defaultTag:oi,name:"Menu.Heading"})}let di="div";function ui(s,t){let n=s,a={ref:t,role:"separator"};return ye()({ourProps:a,theirProps:n,slot:{},defaultTag:di,name:"Menu.Separator"})}let mi=ge(Yl),Tn=ge(ei),$n=ge(ni),Et=ge(ri),pi=ge(ii),xi=ge(ci),An=ge(ui),hi=Object.assign(mi,{Button:Tn,Items:$n,Item:Et,Section:pi,Heading:xi,Separator:An});var fi=(s=>(s[s.RegisterOption=0]="RegisterOption",s[s.UnregisterOption=1]="UnregisterOption",s))(fi||{});let gi={0(s,t){let n=[...s.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...s,options:pn(n,a=>a.element.current)}},1(s,t){let n=s.options.slice(),a=s.options.findIndex(r=>r.id===t.id);return a===-1?s:(n.splice(a,1),{...s,options:n})}},Ht=l.createContext(null);Ht.displayName="RadioGroupDataContext";function Bt(s){let t=l.useContext(Ht);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Bt),n}return t}let Wt=l.createContext(null);Wt.displayName="RadioGroupActionsContext";function Ut(s){let t=l.useContext(Wt);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ut),n}return t}function yi(s,t){return Tt(t.type,gi,s,t)}let bi="div";function vi(s,t){let n=l.useId(),a=hn(),{id:r=`headlessui-radiogroup-${n}`,value:i,form:o,name:u,onChange:d,by:f,disabled:c=a||!1,defaultValue:x,tabIndex:y=0,...g}=s,m=Rl(f),[j,k]=l.useReducer(yi,{options:[]}),h=j.options,[w,E]=pt(),[M,b]=Ft(),I=l.useRef(null),T=_e(I,t),_=ur(x),[p,N]=mr(i,d,_),C=l.useMemo(()=>h.find(A=>!A.propsRef.current.disabled),[h]),v=l.useMemo(()=>h.some(A=>m(A.propsRef.current.value,p)),[h,p]),L=ee(A=>{var z;if(c||m(A,p))return!1;let F=(z=h.find(W=>m(W.propsRef.current.value,A)))==null?void 0:z.propsRef.current;return F!=null&&F.disabled?!1:(N==null||N(A),!0)}),S=ee(A=>{if(!I.current)return;let z=h.filter(F=>F.propsRef.current.disabled===!1).map(F=>F.element.current);switch(A.key){case X.Enter:pr(A.currentTarget);break;case X.ArrowLeft:case X.ArrowUp:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Previous|Oe.WrapAround)===Is.Success){let F=h.find(W=>at(W.element.current));F&&L(F.propsRef.current.value)}break;case X.ArrowRight:case X.ArrowDown:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Next|Oe.WrapAround)===Is.Success){let F=h.find(W=>at(W.element.current));F&&L(F.propsRef.current.value)}break;case X.Space:{A.preventDefault(),A.stopPropagation();let F=h.find(W=>at(W.element.current));F&&L(F.propsRef.current.value)}break}}),D=ee(A=>(k({type:0,...A}),()=>k({type:1,id:A.id}))),$=l.useMemo(()=>({value:p,firstOption:C,containsCheckedOption:v,disabled:c,compare:m,tabIndex:y,...j}),[p,C,v,c,m,y,j]),G=l.useMemo(()=>({registerOption:D,change:L}),[D,L]),O={ref:T,id:r,role:"radiogroup","aria-labelledby":w,"aria-describedby":M,onKeyDown:S},q=Me({value:p}),J=l.useCallback(()=>{if(_!==void 0)return L(_)},[L,_]),B=ye();return le.createElement(b,{name:"RadioGroup.Description"},le.createElement(E,{name:"RadioGroup.Label"},le.createElement(Wt.Provider,{value:G},le.createElement(Ht.Provider,{value:$},u!=null&&le.createElement(xr,{disabled:c,data:{[u]:p||"on"},overrides:{type:"radio",checked:p!=null},form:o,onReset:J}),B({ourProps:O,theirProps:g,slot:q,defaultTag:bi,name:"RadioGroup"})))))}let ji="div";function Ni(s,t){var n;let a=Bt("RadioGroup.Option"),r=Ut("RadioGroup.Option"),i=l.useId(),{id:o=`headlessui-radiogroup-option-${i}`,value:u,disabled:d=a.disabled||!1,autoFocus:f=!1,...c}=s,x=l.useRef(null),y=_e(x,t),[g,m]=pt(),[j,k]=Ft(),h=fn({value:u,disabled:d});De(()=>r.registerOption({id:o,element:x,propsRef:h}),[o,r,x,h]);let w=ee(v=>{var L;if(gn(v.currentTarget))return v.preventDefault();r.change(u)&&((L=x.current)==null||L.focus())}),E=((n=a.firstOption)==null?void 0:n.id)===o,{isFocusVisible:M,focusProps:b}=$t({autoFocus:f}),{isHovered:I,hoverProps:T}=At({isDisabled:d}),_=a.compare(a.value,u),p=mt({ref:y,id:o,role:"radio","aria-checked":_?"true":"false","aria-labelledby":g,"aria-describedby":j,"aria-disabled":d?!0:void 0,tabIndex:d?-1:_||!a.containsCheckedOption&&E?a.tabIndex:-1,onClick:d?void 0:w,autoFocus:f},b,T),N=Me({checked:_,disabled:d,active:M,hover:I,focus:M,autofocus:f}),C=ye();return le.createElement(k,{name:"RadioGroup.Description"},le.createElement(m,{name:"RadioGroup.Label"},C({ourProps:p,theirProps:c,slot:N,defaultTag:ji,name:"RadioGroup.Option"})))}let wi="span";function ki(s,t){var n;let a=Bt("Radio"),r=Ut("Radio"),i=l.useId(),o=hr(),u=hn(),{id:d=o||`headlessui-radio-${i}`,value:f,disabled:c=a.disabled||u||!1,autoFocus:x=!1,...y}=s,g=l.useRef(null),m=_e(g,t),j=fr(),k=gr(),h=fn({value:f,disabled:c});De(()=>r.registerOption({id:d,element:g,propsRef:h}),[d,r,g,h]);let w=ee(C=>{var v;if(gn(C.currentTarget))return C.preventDefault();r.change(f)&&((v=g.current)==null||v.focus())}),{isFocusVisible:E,focusProps:M}=$t({autoFocus:x}),{isHovered:b,hoverProps:I}=At({isDisabled:c}),T=((n=a.firstOption)==null?void 0:n.id)===d,_=a.compare(a.value,f),p=mt({ref:m,id:d,role:"radio","aria-checked":_?"true":"false","aria-labelledby":j,"aria-describedby":k,"aria-disabled":c?!0:void 0,tabIndex:c?-1:_||!a.containsCheckedOption&&T?a.tabIndex:-1,autoFocus:x,onClick:c?void 0:w},M,I),N=Me({checked:_,disabled:c,hover:b,focus:E,autofocus:x});return ye()({ourProps:p,theirProps:y,slot:N,defaultTag:wi,name:"Radio"})}let Ci=ge(vi),Si=ge(Ni),jt=ge(ki),Ii=Ye,_i=xt,Mi=Object.assign(Ci,{Option:Si,Radio:jt,Label:Ii,Description:_i});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -86,6 +86,6 @@ import{aY as Ua,fB as ws,a_ as mn,a$ as Ga,aZ as Tt,b0 as pn,r as l,b1 as Ka,b2 `).map(a=>a.trim()).filter(Boolean);if(t.length<2)return null;const n=[];for(const a of t){const r=a.match(/^(\d{1,2}[AP]M):\s*/i);if(!r)continue;let i=a.slice(r[0].length),o="";for(const g of Nt)if(i.includes(g)){o=g,i=i.replace(g,"").trim();break}if(!o)continue;let u;const d=i.match(/(\d+)%/);d&&(u=parseInt(d[1],10),i=i.replace(d[0],"").trim());const f=i.match(/(-?\d+)°/);if(!f)continue;const c=parseInt(f[1],10),x=i.indexOf(f[0]),y=x>0?i.slice(0,x).trim():"";n.push({hour:r[1].toUpperCase(),conditionEmoji:o,condition:y||"Unknown",temp:c,precipChance:u})}return n.length>=2?n:null}function qn(s){const t=s.split(` `).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;const n=[];for(const a of t){const r=a.match(/^([0-9A-Fa-f]{2})\s*→\s*(.+)/);if(!r)continue;const i=r[1].toUpperCase(),o=r[2].trim();if(o==="?")n.push({hex:i,unknown:!0});else if(/^\d+\s*matches?$/i.test(o))n.push({hex:i,matchCount:parseInt(o,10)});else{let u,d=o;d.includes("🎯")?(u="high",d=d.replace("🎯","").trim()):d.includes("📍")?(u="medium",d=d.replace("📍","").trim()):d.includes("❓")&&(u="low",d=d.replace("❓","").trim()),n.push({hex:i,name:d,confidence:u})}}return n.length>=2?{hops:n}:null}const ko=new Set(["🟢","🟡","🟠","🔴","🟣","🟤"]);function Vn(s){let t="";for(const x of ko)if(s.includes(x)){t=x;break}if(!t)return null;const n=s.match(/(?:AQI:?\s*)?\b(\d{1,3})\b\s*\(?(Good|Moderate|USG|Unhealthy|Very Unhealthy|Hazardous)\)?/i)??s.match(new RegExp(`${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*(\\d{1,3})\\s*\\(?(\\w[\\w ]*?)\\)?(?:\\s|$)`));if(!n)return null;const a=parseInt(n[1],10),r=n[2].trim(),i=s.split(` `)[0],o=i.indexOf(t),u=o>2?i.slice(0,o).replace(/:$/,"").trim():void 0,d=[],f=/(PM2\.5|PM10|O3|NO2|CO|SO2):\s*([\d.]+)/gi;let c;for(;(c=f.exec(s))!==null;)d.push({name:c[1].toUpperCase(),value:parseFloat(c[2])});return{location:u,aqi:a,category:r,colorEmoji:t,pollutants:d}}function Jn(s){const t=/A[- ]?Index:?\s*\d/i.test(s)||/\bA:\s*\d/i.test(s),n=/K[- ]?Index:?\s*\d/i.test(s)||/\bK:\s*\d/i.test(s);if(!t&&!n)return null;const a=s.match(/A[- ]?Index:?\s*(\d+)/i)??s.match(/\bA:(\d+)/),r=s.match(/K[- ]?Index:?\s*(\d+)/i)??s.match(/\bK:(\d+)/),i=s.match(/Sun(?:spots)?:?\s*(\d+)/i),o=s.match(/(?:Solar\s*)?Flux:?\s*(\d+)/i),u=s.match(/X[- ]?[Rr]ay(?:\s*Flux)?:?\s*([A-Z]\d+\.?\d*)/i)??s.match(/Xray:([A-Z]\d+\.?\d*)/i),d=s.match(/(?:Signal\s*)?Noise:?\s*([A-Z]\d+)/i);return{aIndex:a?parseInt(a[1],10):void 0,kIndex:r?parseInt(r[1],10):void 0,sunspots:i?parseInt(i[1],10):void 0,solarFlux:o?parseInt(o[1],10):void 0,xrayFlux:u==null?void 0:u[1],signalNoise:d==null?void 0:d[1]}}function Qn(s){const t=[],n=/([dn])(\d+m(?:-\d+m)?)=(Good|Fair|Poor|Excellent)/gi;let a;for(;(a=n.exec(s))!==null;)t.push({time:a[1].toLowerCase()==="d"?"day":"night",name:a[2],condition:a[3]});if(t.length>=2)return{bands:t};const r=/([DN]):\s*((?:\d+m(?:-\d+m)?(?:Good|Fair|Poor|Excellent)\s*)+)/gi;let i;for(;(i=r.exec(s))!==null;){const o=i[1].toUpperCase()==="D"?"day":"night",u=/(\d+m(?:-\d+m)?)(Good|Fair|Poor|Excellent)/gi;let d;for(;(d=u.exec(i[2]))!==null;)t.push({time:o,name:d[1],condition:d[2]})}return t.length>=2?{bands:t}:null}function Xn(s){var g,m;const t=/Sun\s*Rise:?/i.test(s),n=/Sun\s*Set:?|\bSet:/i.test(s);if(!/Daylight:/i.test(s)&&!(t&&n))return null;const r=s.match(/(?:Sun\s*)?Rise:?\s*(.+?)(?:\n|$)/i),i=s.match(/(?:Sun\s*)?Set:?\s*(.+?)(?:\n|$)/i),o=s.match(/Daylight:?\s*(\d+)h\s*(\d+)m/i),u=s.match(/Remaining:?\s*(\d+)h\s*(\d+)m/i),d=s.match(/Azimuth:?\s*([\d.]+)/i),f=s.match(/Altitude:?\s*(-?[\d.]+)/i),c=s.search(/Sun\s*Rise/i),x=s.search(/Sun\s*Set/i),y=x>=0&&(c<0||xa.trim()).filter(Boolean),n=[];for(const a of t){let r="";for(const d of So)if(a.startsWith(d)){r=d;break}if(!r)continue;const i=a.slice(r.length).trim(),o=i.match(/^(.+?)\s+(\d+)\s*[-–]\s*(.+?)\s+(\d+)\s*\((.+)\)$/);if(o){const d=o[5].trim(),f=/final/i.test(d),c=!f&&/\d/.test(d);n.push({sportEmoji:r,away:o[1].trim(),home:o[3].trim(),awayScore:parseInt(o[2],10),homeScore:parseInt(o[4],10),status:d,isLive:c,isFinal:f});continue}const u=i.match(/^(.+?)\s*[-–]\s*(.+?)\s*\((.+)\)$/);u&&n.push({sportEmoji:r,away:u[1].trim(),home:u[2].trim(),status:u[3].trim(),isLive:!1,isFinal:!1})}return n.length>=1?{games:n}:null}function sa(s){var f,c,x,y;const t=[],n=/^(\d+)\.\s+(.+?):\s*(\d+)/gm;let a;for(;(a=n.exec(s))!==null;)t.push({rank:parseInt(a[1],10),name:a[2].trim(),value:parseInt(a[3],10)});if(t.length>=2){const g=s.match(/^(.+?)\n/i);return{type:"leaderboard",entries:t,title:(f=g==null?void 0:g[1])==null?void 0:f.replace(/📊\s*/,"").trim()}}const r=s.match(/Cmds?:\s*(\d+)/i),i=s.match(/Replies?:\s*(\d+)/i);if(!r&&!i)return null;const o=s.match(/Top\s*Cmd:\s*(.+?)\s*\(/i),u=s.match(/Top\s*User:\s*(.+?)\s*\(/i),d=s.match(/^(.+?)\n/i);return{type:"basic",commands:r?parseInt(r[1],10):void 0,replies:i?parseInt(i[1],10):void 0,topCommand:(c=o==null?void 0:o[1])==null?void 0:c.trim(),topUser:(x=u==null?void 0:u[1])==null?void 0:x.trim(),title:(y=d==null?void 0:d[1])==null?void 0:y.replace(/📊\s*/,"").trim()}}const Io=new Set(["🐱","🐈","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐾","👂","🐟","🧶","🥛"]);function na(s){if(!/\bcats?\b/i.test(s))return null;const t=s.slice(-4);for(const n of Io)if(t.includes(n))return s;return null}const _o=[{type:"dice",test:zn},{type:"joke",test:Hn},{type:"dadjoke",test:Bn},{type:"magic8",test:Wn},{type:"weather-alert",test:Un},{type:"satpass",test:Zn},{type:"aurora",test:ea},{type:"moon",test:Yn},{type:"sun",test:Xn},{type:"hfcond",test:Qn},{type:"solar",test:Jn},{type:"aqi",test:Vn},{type:"sports",test:ta},{type:"stats",test:sa},{type:"path",test:qn},{type:"weather-multiday",test:Gn},{type:"weather-hourly",test:Kn},{type:"test",test:Ln},{type:"weather",test:Dn},{type:"catfact",test:na}];function aa(s){for(const{type:t,test:n}of _o)if(n(s)!=null)return t;return null}function Mo(s,t){switch(t){case"weather":return Dn(s);case"weather-multiday":return Gn(s);case"weather-hourly":return Kn(s);case"weather-alert":return Un(s);case"test":return Ln(s);case"path":return qn(s);case"aqi":return Vn(s);case"solar":return Jn(s);case"hfcond":return Qn(s);case"sun":return Xn(s);case"moon":return Yn(s);case"satpass":return Zn(s);case"aurora":return ea(s);case"dice":return zn(s);case"joke":return Hn(s);case"dadjoke":return Bn(s);case"magic8":return Wn(s);case"sports":return ta(s);case"stats":return sa(s);case"catfact":return na(s);default:return null}}const ra=/[\u{1F916}\u{1F9BE}\u{1F9BF}]/u;function Ro(s,t,n){if(t==="bot")return!0;if(t==="not-bot")return!1;if(ra.test(s)||/bot\b/i.test(s))return!0;if(n&&n.length>0){let a=0;const r=n.slice(-5);for(const i of r)aa(i)!=null&&a++;if(a>=Math.ceil(r.length*.6))return!0}return!1}function la(s){return ra.test(s)||/bot\b/i.test(s)}const ia="pymc_howl_bot_overrides";function Eo(){try{const s=localStorage.getItem(ia);if(!s)return new Map;const t=JSON.parse(s);return new Map(t)}catch{return new Map}}function Bs(s){try{localStorage.setItem(ia,JSON.stringify([...s]))}catch{}}const oa=br(s=>({overrides:Eo(),setOverride:(t,n)=>s(a=>{const r=new Map(a.overrides);return r.set(t,n),Bs(r),{overrides:r}}),clearOverride:t=>s(n=>{const a=new Map(n.overrides);return a.delete(t),Bs(a),{overrides:a}})}));function ca(s){return oa(t=>t.overrides.get(s))}function Po(){return oa(s=>s.setOverride)}const da="pymc_companion_contacts_micro",ua="pymc_companion_favorites",St=56;function Ws(){try{return localStorage.getItem(da)==="1"}catch{return!1}}function To(s){try{localStorage.setItem(da,s?"1":"0")}catch{}}function $o(){try{const s=localStorage.getItem(ua);return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}function Ao(s){try{localStorage.setItem(ua,JSON.stringify([...s]))}catch{}}function Fo({name:s,pubkey:t,advType:n,size:a="md",signal:r}){const i=(n??0)&15,o=a==="sm"?"w-5 h-5":"w-6 h-6",u=a==="sm"?"size-3":"size-3.5";if(i===2){const x=r&&r.rssi!==0,y=x?`RSSI: ${r.rssi} dBm · SNR: ${r.snr.toFixed(1)} dB${r.rtt_ms!=null?` · RTT: ${r.rtt_ms} ms`:""}`:void 0;return e.jsx("div",{className:R(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px]",x?"ring-transparent":"ring-sys-blue"),title:y,children:x?e.jsx(fl,{rssi:r.rssi,snr:r.snr,compact:!0,showValues:!1}):e.jsx(Ke,{className:R(u,"text-sys-blue")})})}if(i===3)return e.jsx("div",{className:R(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px] ring-sys-pink"),children:e.jsx(ht,{className:R(u,"text-sys-pink")})});if(!s)return e.jsx("div",{className:R(o,"relative rounded-full bg-sys-blue/12 flex items-center justify-center flex-shrink-0"),children:e.jsx("span",{className:"text-sys-blue font-mono text-[10px] font-bold",children:t.slice(0,4)})});const{emoji:d}=yt(s),f=bt(s),c=vt(s);return e.jsx("div",{className:R(o,"relative clay-avatar",d?"text-base":"text-white text-[11px] font-bold"),style:{"--avatar-color":f},children:d||c})}const Us=[{key:"companion",label:"Companions",icon:je,color:"text-sys-blue"},{key:"room",label:"Room Servers",icon:ht,color:"text-sys-pink"},{key:"repeater",label:"Repeaters",icon:Ke,color:"text-sys-blue"}];function Oo(s){const t=(s.adv_type??0)&15;return t===3?"room":t===2?"repeater":"companion"}const Do=4e3,Lo=5e3,zo=2e3,Ho=8,Bo=l.forwardRef(function({contact:t,isActive:n,unread:a,lastMsg:r,isFav:i,microContent:o,onSelect:u,onShowDetails:d,onShareContact:f,onResetPath:c,onRemoveContact:x,onPingContact:y,repeaterNeighborHashes:g,repeaterSignal:m,toggleFavorite:j},k){const h=vr(t.public_key),w=jr(t.public_key),E=ca(t.public_key),M=Po(),b=E==="bot"||E==null&&la(t.name||""),[I,T]=l.useState(!1),[_,p]=l.useState(!1),N=l.useRef(null),[C,v]=l.useState("idle"),L=l.useRef(!1),S=l.useRef(null),[D,$]=l.useState({w:0,h:0});l.useEffect(()=>{if(h)L.current=!0,v("idle");else if(L.current){L.current=!1;const F=ae.getState().pingResults.get(t.public_key),W=F!=null&&F.rssi!==0;v(W?"success":"failed")}},[h,t.public_key]),l.useEffect(()=>{if(C==="idle")return;const W=setTimeout(()=>v("idle"),C==="success"?Lo:zo);return()=>clearTimeout(W)},[C]);const G=(h||C!=="idle")&&!I;l.useEffect(()=>{if(!G)return;const F=S.current;if(!F)return;const W=()=>{const me=F.offsetWidth,be=F.offsetHeight;$(He=>He.w===me&&He.h===be?He:{w:me,h:be})};W();const Q=new ResizeObserver(W);return Q.observe(F),()=>Q.disconnect()},[G]);const O=l.useCallback(()=>{T(!0),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>T(!1),Do)},[]),q=l.useCallback(()=>{T(!1),N.current&&clearTimeout(N.current)},[]),J=l.useCallback(async()=>{x&&(N.current&&clearTimeout(N.current),p(!0),await x(t.public_key),p(!1),T(!1))},[x,t.public_key]),B=l.useMemo(()=>{const F=w&&w.rssi!==0,W=m&&m.rssi!==0;if(!F&&!W)return null;if(F&&!W)return{rssi:w.rssi,snr:w.snr_db,rtt_ms:w.rtt_ms};if(!F&&W)return{rssi:m.rssi,snr:m.snr};const Q=m.advertCount,me=3,be=Q+me;return{rssi:Math.round((m.rssi*Q+w.rssi*me)/be),snr:(m.snr*Q+w.snr_db*me)/be,rtt_ms:w.rtt_ms}},[w,m]),A=l.useCallback(F=>{S.current=F,typeof k=="function"?k(F):k&&(k.current=F)},[k]),z=I?"":C==="success"?"bg-sys-green/5":C==="failed"?"bg-sys-red/5":h?"bg-sys-blue/5":n?"bg-sys-blue":"hover:bg-elevated";return e.jsxs(oe.div,{ref:A,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ie.fade,className:R("group relative w-full flex items-center gap-2.5 px-2.5 py-[3px] radius-inner overflow-hidden","transition-[background-color,box-shadow] duration-150",z),children:[e.jsx(ve,{children:G&&D.w>0&&(C!=="idle"?e.jsx(oe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{opacity:{duration:.15}},className:R("absolute inset-0 radius-inner ring-2 ring-inset pointer-events-none z-[2]",C==="success"?"ring-sys-green":"ring-sys-red")},`ping-${C}`):e.jsx(Nr,{borderRadius:Ho,width:D.w,height:D.h,color:"blue"},"ping-crawl"))}),e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:R("flex items-center gap-2.5",I&&!o&&"invisible pointer-events-none"),children:[e.jsxs("button",{onClick:()=>u({type:"contact",id:t.public_key}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Fo,{name:t.name,pubkey:t.public_key,advType:t.adv_type,signal:B}),a>0&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-sys-red ring-2 ring-body"}),b&&!a&&e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex items-center justify-center w-3 h-3 rounded-full bg-sys-violet ring-[1.5px] ring-body",title:"HOWL Bot",children:e.jsx(zs,{className:"w-2 h-2 text-white"})})]}),!o&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("span",{className:R("text-sm truncate flex-1",n?"text-white font-medium":i?"text-sys-amber font-bold":"text-fg-primary font-medium"),children:t.name||t.public_key.slice(0,12)+"…"})}),C==="success"&&w?e.jsxs("div",{className:"text-[11px] text-sys-green font-medium truncate tabular-nums",children:[w.rssi," dBm · ",w.snr_db.toFixed(1)," dB",w.rtt_ms!=null&&` · ${w.rtt_ms} ms`]}):C==="failed"?e.jsx("div",{className:"text-[11px] text-sys-red font-medium truncate",children:"No response"}):r?e.jsx("div",{className:R("text-[11px] truncate",n?"text-white/70":"text-fg-muted"),children:r.text}):null]})]}),!o&&e.jsx("div",{className:"relative flex-shrink-0 w-[18px] h-[18px] flex items-center justify-center",children:e.jsx(hi,{as:"div",className:"absolute inset-0",children:({open:F})=>e.jsxs(e.Fragment,{children:[e.jsx(Tn,{className:R("absolute inset-0 flex items-center justify-center rounded transition-[opacity,background-color] duration-100","focus:outline-none",n?"hover:bg-white/15":"hover:bg-subtle-fill",F?"opacity-100":"opacity-0 group-hover:opacity-100"),"aria-label":"Contact options",children:e.jsx(Li,{className:R("h-3.5 w-3.5 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-blue")})}),e.jsxs($n,{anchor:"right start",transition:!0,className:R("min-w-[10rem] max-w-[20rem]","radius-inset p-1 ml-1","surface-elevated","focus:outline-none z-50","transition-[opacity,transform]","data-[closed]:opacity-0 data-[closed]:scale-[0.98] data-[closed]:translate-x-[-4px]","data-[enter]:duration-150 data-[leave]:duration-100","data-[enter]:ease-out data-[leave]:ease-in"),children:[e.jsx(ke,{icon:e.jsx(ct,{className:"w-4 h-4"}),onClick:()=>{d==null||d({type:"contact",id:t.public_key})},children:"Details"}),f&&e.jsx(ke,{icon:e.jsx(Tl,{className:"w-4 h-4"}),onClick:()=>f(t.public_key),children:"Share"}),e.jsx(ke,{icon:e.jsx(Je,{className:"w-4 h-4"}),onClick:()=>u({type:"contact",id:t.public_key}),children:"Set Path"}),c&&e.jsx(ke,{icon:e.jsx(wn,{className:"w-4 h-4"}),onClick:()=>c(t.public_key),children:"Reset Path"}),y&&e.jsx(ke,{icon:e.jsx(Oi,{className:"w-4 h-4"}),onClick:()=>y(t.public_key),disabled:!(g!=null&&g.has(t.public_key)),children:"Ping"}),x&&e.jsx(ke,{icon:e.jsx(Qe,{className:"w-4 h-4"}),destructive:!0,onClick:O,children:"Remove Contact"}),e.jsx(io,{}),e.jsx(ke,{icon:b?e.jsx(Ti,{className:"w-4 h-4 text-fg-muted"}):e.jsx(zs,{className:"w-4 h-4 text-sys-violet"}),onClick:()=>M(t.public_key,b?"not-bot":"bot"),children:b?"Not a Bot":"Mark as HOWL Bot"}),e.jsx(ke,{icon:e.jsx(Zi,{className:R("w-4 h-4 group-data-[focus]:text-white group-data-[focus]:fill-white",i?"text-sys-amber fill-sys-amber":"text-fg-muted")}),onClick:()=>j(t.public_key),children:i?"Unfavorite":"Favorite"})]})]})})})]}),!o&&e.jsx("div",{className:R("flex items-center gap-1.5 self-center",!I&&"invisible pointer-events-none"),children:_?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:q,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:J,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(Qe,{className:"w-4 h-4 text-white"})})]})})]})]},t.public_key)}),Gs={excellent:4,good:3,fair:2,weak:1,poor:0};function Ks(s,t,n){const a=t==null?void 0:t.get(s),r=a&&a.rssi!==0,i=n==null?void 0:n.get(s),o=i&&typeof i.rssi=="number"&&i.rssi!==0;if(!r&&!o)return null;if(o&&!r)return i.rssi;if(!o&&r)return a.rssi;const u=a.advertCount,d=3;return Math.round((a.rssi*u+i.rssi*d)/(u+d))}function Wo(s,t,n,a,r){return[...s].sort((i,o)=>{const u=t.has(i.public_key)?0:1,d=t.has(o.public_key)?0:1;if(u!==d)return u-d;if(n){const f=n.get(i.public_key),c=f&&f.length>0?f[f.length-1].timestamp:0,x=n.get(o.public_key),y=x&&x.length>0?x[x.length-1].timestamp:0;if(c!==y)return y-c}if(a){const f=Ks(i.public_key,a,r),c=Ks(o.public_key,a,r);if(f!=null&&c==null)return-1;if(f==null&&c!=null)return 1;if(f!=null&&c!=null){const x=Gs[$s(f)]??0,y=Gs[$s(c)]??0;if(x!==y)return y-x}}return(i.name||"").localeCompare(o.name||"")})}const Uo=l.memo(l.forwardRef(function({contacts:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onShowDetails:o,onShareContact:u,onResetPath:d,onRemoveContact:f,onPingContact:c,repeaterNeighborHashes:x,repeaterSignalMap:y,isLoading:g,splitPercent:m=50,onMicroChange:j,className:k},h){const[w,E]=l.useState(Ws),[M,b]=l.useState(Ws),[I,T]=l.useState(""),[_,p]=l.useState(!1),[N,C]=l.useState($o),v=l.useRef(null),L=l.useRef(null),S=l.useCallback(A=>{L.current=A,typeof h=="function"?h(A):h&&(h.current=A)},[h]),D=l.useCallback(()=>{E(A=>{const z=!A;To(z);const F=L.current;if(z&&b(!0),F){let W=0;const Q=F.parentElement;if(z)W=(Q==null?void 0:Q.offsetWidth)??F.offsetWidth;else if(Q){const be=Q.style.width;Q.style.width="var(--companion-side)",W=Q.offsetWidth,Q.style.width=be}const me=z?St:Math.round(m/100*W);lt(F,{width:`${me}px`},{...ie.layoutResize,onComplete(){F.style.width=z?`${St}px`:`${m}%`,z||b(!1)}})}return j==null||j(z),z})},[m,j]),$=l.useCallback(A=>{C(z=>{const F=new Set(z);return F.has(A)?F.delete(A):F.add(A),Ao(F),F})},[]),G=_||I.length>0,O=l.useMemo(()=>{const A=new Set,z=t.filter(W=>A.has(W.public_key)?!1:(A.add(W.public_key),!0));if(!I.trim())return z;const F=I.toLowerCase();return z.filter(W=>{var Q;return((Q=W.name)==null?void 0:Q.toLowerCase().includes(F))||W.public_key.toLowerCase().includes(F)})},[t,I]),q=ae(A=>A.pingResults),J=l.useMemo(()=>{const A=new Map;for(const z of Us)A.set(z.key,[]);for(const z of O)A.get(Oo(z)).push(z);return Us.map(z=>({...z,items:Wo(A.get(z.key),N,r,z.key==="repeater"?y:void 0,z.key==="repeater"?q:void 0)})).filter(z=>z.items.length>0)},[O,N,r,y,q]),B=(n==null?void 0:n.type)==="contact"?n.id:null;return e.jsxs("div",{ref:S,className:R("flex-shrink-0 overflow-hidden flex flex-col h-full",k),style:{width:w?St:`${m}%`},children:[e.jsx("div",{className:R("flex items-center border-b border-edge-subtle flex-shrink-0",M?"justify-center p-2":"gap-2 px-3 py-2"),children:M?e.jsx("button",{onClick:D,className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Expand contacts",children:e.jsx(Ki,{className:"w-3.5 h-3.5 text-fg-muted"})}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Contacts"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>{G?(T(""),p(!1)):(p(!0),setTimeout(()=>{var A;return(A=v.current)==null?void 0:A.focus()},50))},className:R("p-1 rounded transition-colors flex-shrink-0",G?"bg-sys-blue/10 text-sys-blue":"hover:bg-subtle-fill text-fg-muted"),title:G?"Close search":"Search contacts",children:e.jsx(As,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:D,className:"p-1 hover:bg-subtle-fill rounded transition-colors flex-shrink-0",title:"Collapse contacts",children:e.jsx(Ui,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]})}),!M&&G&&e.jsxs("div",{className:"relative px-2.5 py-2 border-b border-edge-subtle/50 flex-shrink-0",children:[e.jsx(As,{className:"absolute left-5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none"}),e.jsx("input",{ref:v,type:"text",value:I,onChange:A=>T(A.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),placeholder:"Search contacts…",className:"w-full pl-8 pr-8 py-1.5 text-sm radius-inner bg-input-bg border border-input-border text-fg-primary placeholder:text-fg-muted/50 ring-focus-inset hover:border-edge-strong transition-colors",autoFocus:!0}),e.jsx("button",{onClick:()=>{T(""),p(!1)},className:"absolute right-5 top-1/2 -translate-y-1/2 p-0.5 hover:bg-subtle-fill rounded",children:e.jsx(ft,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),g&&e.jsx("div",{className:"flex items-center justify-center flex-1",children:e.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-sys-blue border-t-transparent"})}),!g&&e.jsxs("div",{className:R("flex-1 overflow-y-auto min-h-0",M?"px-0":"px-1.5"),style:{contain:"layout style paint"},children:[J.map(A=>{const z=A.icon;return e.jsxs(Re,{defaultOpen:!0,className:"mb-1",children:[e.jsxs(Ee,{className:R("px-2 py-1 flex items-center gap-1.5 w-full","text-left radius-inner hover:bg-subtle-fill-strong transition-colors"),children:[e.jsx(z,{className:R("w-3.5 h-3.5",A.color)}),!M&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:A.label}),e.jsx("span",{className:"type-data-xs text-fg-muted/50 ml-auto",children:A.items.length})]})]}),e.jsx(Pe,{children:e.jsx(ve,{initial:!1,mode:"popLayout",children:A.items.map(F=>e.jsx(Bo,{contact:F,isActive:B===F.public_key,unread:a.get(F.public_key)??0,lastMsg:(()=>{const W=r.get(F.public_key);return W&&W.length>0?W[W.length-1]:void 0})(),isFav:N.has(F.public_key),microContent:M,onSelect:i,onShowDetails:o,onShareContact:u,onResetPath:d,onRemoveContact:f,onPingContact:c,repeaterNeighborHashes:x,repeaterSignal:y==null?void 0:y.get(F.public_key),toggleFavorite:$},F.public_key))})})]},A.key)}),O.length===0&&e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-fg-muted",children:I?"No matches":"No contacts yet"})})]})]})}));function Go({open:s,onClose:t}){const n=ae(p=>p.discoverImportableChannels),a=ae(p=>p.getEmptyChannelSlots),r=ae(p=>p.importChannel),i=ae(p=>p.refreshChannels),[o,u]=l.useState("discover"),[d,f]=l.useState([]),[c,x]=l.useState([]),[y,g]=l.useState(null),m=l.useRef(!1);l.useEffect(()=>{if(!s)return;u("discover"),f([]),x([]),g(null),m.current=!1;let p=!1;return(async()=>{try{const[N,C]=await Promise.all([n(),a()]);if(p)return;if(x(C),N.length===0){g("No channels found in repeater history. Decoded messages may still be loading."),u("select");return}C.length===0&&g("No empty channel slots on device. Delete a channel first to make room."),f(N.map(v=>({name:v.name,alreadyOnDevice:v.alreadyOnDevice,selected:!v.alreadyOnDevice,status:"pending"}))),u("select")}catch(N){p||(g(N instanceof Error?N.message:"Discovery failed"),u("select"))}})(),()=>{p=!0}},[s,n,a]);const j=l.useCallback(p=>{f(N=>N.map(C=>C.name===p&&!C.alreadyOnDevice?{...C,selected:!C.selected}:C))},[]),k=l.useCallback(()=>{f(p=>p.map(N=>N.alreadyOnDevice?N:{...N,selected:!0}))},[]),h=l.useCallback(()=>{f(p=>p.map(N=>N.alreadyOnDevice?N:{...N,selected:!1}))},[]),w=l.useMemo(()=>d.filter(p=>!p.alreadyOnDevice).length,[d]),E=l.useMemo(()=>d.filter(p=>p.selected&&!p.alreadyOnDevice).length,[d]),M=l.useMemo(()=>d.filter(p=>p.status==="done").length,[d]),b=l.useMemo(()=>d.filter(p=>p.status==="failed").length,[d]),I=l.useCallback(async()=>{u("import"),m.current=!1;const p=d.filter(C=>C.selected&&!C.alreadyOnDevice),N=[...c];for(const C of p){if(m.current)break;const v=N.shift();if(v===void 0){f(S=>S.map(D=>D.name===C.name&&D.status==="pending"?{...D,status:"failed"}:D));continue}f(S=>S.map(D=>D.name===C.name?{...D,status:"sending"}:D)),await new Promise(S=>setTimeout(S,150));const L=await r(C.name,v);f(S=>S.map(D=>D.name===C.name?{...D,status:L?"done":"failed"}:D)),L||N.unshift(v),m.current||await new Promise(S=>setTimeout(S,300))}await i(),u("complete")},[d,c,r,i]),T=l.useCallback(()=>{m.current=!0},[]),_=p=>{switch(p){case"pending":return e.jsx(Fn,{className:"w-3.5 h-3.5 text-fg-muted"});case"sending":return e.jsx(ue,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"});case"done":return e.jsx(Ne,{className:"w-3.5 h-3.5 text-sys-green"});case"failed":return e.jsx(ft,{className:"w-3.5 h-3.5 text-sys-red"})}};return e.jsxs(Ce,{open:s,onClose:o==="import"?()=>{}:t,size:"sm",children:[e.jsx(Te,{icon:e.jsx(qe,{className:"w-5 h-5"}),title:"Import Channels",onClose:o==="import"?void 0:t}),e.jsxs(Se,{className:"!py-3 !px-0",children:[o==="discover"&&e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 px-6",children:[e.jsx(ue,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"text-sm text-fg-secondary",children:"Scanning repeater history…"}),e.jsx("p",{className:"text-[11px] text-fg-muted",children:"Waiting for decoded messages"})]}),o==="select"&&e.jsxs(e.Fragment,{children:[y&&e.jsxs("div",{className:"flex items-start gap-2 mx-4 mb-3 p-2.5 radius-inner bg-sys-amber/8 border border-sys-amber/20",children:[e.jsx(Ve,{className:"w-3.5 h-3.5 text-sys-amber flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-fg-secondary",children:y})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsxs("span",{className:"text-[11px] text-fg-muted",children:[w," discoverable · ",c.length," slot",c.length!==1?"s":""," free"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:k,className:"text-[11px] text-sys-blue hover:underline",children:"All"}),e.jsx("span",{className:"text-fg-muted/40",children:"·"}),e.jsx("button",{onClick:h,className:"text-[11px] text-sys-blue hover:underline",children:"None"})]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:d.map(p=>e.jsxs("button",{onClick:()=>j(p.name),disabled:p.alreadyOnDevice,className:R("w-full flex items-center gap-3 px-4 py-2 transition-colors",p.alreadyOnDevice?"opacity-40 cursor-default":"hover:bg-subtle-fill"),children:[e.jsx("div",{className:R("w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 transition-colors",p.alreadyOnDevice?"border-fg-muted/30 bg-fg-muted/10":p.selected?"border-sys-blue bg-sys-blue":"border-edge-subtle"),children:(p.selected||p.alreadyOnDevice)&&e.jsx(Ne,{className:"w-3 h-3 text-white"})}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-primary truncate",children:p.name})]}),p.alreadyOnDevice&&e.jsx("span",{className:"text-[10px] text-fg-muted bg-subtle-fill px-1.5 py-0.5 rounded flex-shrink-0",children:"on device"})]},p.name))})]})]}),(o==="import"||o==="complete")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsx("span",{className:"text-[11px] text-fg-muted",children:o==="import"?"Importing channels…":"Import complete"}),e.jsxs("span",{className:"text-[11px] tabular-nums text-fg-secondary",children:[M+b," / ",d.filter(p=>p.selected&&!p.alreadyOnDevice).length]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:d.filter(p=>p.selected&&!p.alreadyOnDevice).map(p=>e.jsxs("div",{className:R("flex items-center gap-3 px-4 py-2",p.status==="sending"&&"bg-sys-blue/5",p.status==="done"&&"bg-sys-green/5",p.status==="failed"&&"bg-sys-red/5"),children:[e.jsx("div",{className:"w-5 h-5 flex items-center justify-center flex-shrink-0",children:_(p.status)}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:R("text-sm truncate",p.status==="done"?"text-fg-primary":"text-fg-secondary"),children:p.name})]}),e.jsx("span",{className:R("text-[10px] flex-shrink-0",p.status==="sending"&&"text-sys-blue",p.status==="done"&&"text-sys-green",p.status==="failed"&&"text-sys-red",p.status==="pending"&&"text-fg-muted"),children:p.status==="sending"?"sending…":p.status==="done"?"added":p.status==="failed"?"failed":"waiting"})]},p.name))})]})]}),e.jsxs($e,{children:[o==="select"&&e.jsxs(e.Fragment,{children:[e.jsx(U,{plain:!0,onClick:t,children:"Cancel"}),e.jsxs(U,{color:"primary",onClick:I,disabled:E===0||c.length===0,children:[e.jsx(qe,{className:"w-4 h-4"}),"Import ",E," ",E===1?"Channel":"Channels"]})]}),o==="import"&&e.jsx(U,{plain:!0,onClick:T,children:"Stop"}),o==="complete"&&e.jsxs(e.Fragment,{children:[b>0&&e.jsxs("span",{className:"text-xs text-sys-red flex items-center gap-1 mr-auto",children:[e.jsx(Ve,{className:"w-3.5 h-3.5"}),b," failed"]}),e.jsxs(U,{color:"primary",onClick:t,children:[e.jsx(Al,{className:"w-4 h-4"}),"Done — ",M," imported"]})]})]})]})}const Ko=4e3;function qo(s){const t=s.frequency_hz/1e3,n=s.bandwidth_hz/1e3;return`${t} · SF${s.spreading_factor} · ${n}k`}const Vo=l.forwardRef(function({channel:t,isActive:n,unread:a,lastMsg:r,isLoadingMessages:i,selfInfo:o,onSelect:u,onDeleteChannel:d},f){const[c,x]=l.useState(!1),[y,g]=l.useState(!1),m=l.useRef(null),j=l.useCallback(()=>{x(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>x(!1),Ko)},[]),k=l.useCallback(()=>{x(!1),m.current&&clearTimeout(m.current)},[]),h=l.useCallback(async()=>{d&&(m.current&&clearTimeout(m.current),g(!0),await d(t.index),g(!1),x(!1))},[d,t.index]),w=t.name.toLowerCase()==="public",E=d&&!w;return e.jsx(oe.div,{ref:f,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ie.fade,className:R("group w-full flex items-center gap-2.5 px-2.5 py-1 radius-inner","transition-[background-color] duration-150",c?"":n?"bg-sys-blue":"hover:bg-subtle-fill-strong"),children:e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:R("flex items-center gap-2.5 min-w-0",c&&"invisible pointer-events-none"),children:[e.jsx("button",{onClick:()=>u({type:"channel",id:String(t.index)}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:R("text-sm flex-shrink-0",n?"text-white font-semibold":r?"text-fg-primary font-semibold":"text-fg-secondary font-normal"),children:t.name}),w&&o&&e.jsx("span",{className:R("text-[9px] font-medium px-1.5 py-px rounded-full whitespace-nowrap truncate",n?"text-white/80 bg-white/15":"text-fg-muted/70 bg-subtle-fill"),children:qo(o)})]}),r&&e.jsx("div",{className:R("text-[11px] truncate pl-2",n?"text-white/70":"text-fg-muted"),children:r.text})]})}),e.jsx("div",{className:"flex items-center flex-shrink-0",children:i?e.jsx("span",{className:"h-1.5 w-6 rounded-full bg-fg-muted/20 animate-pulse"}):E?e.jsxs("div",{className:"relative w-[18px] h-[18px] flex items-center justify-center",children:[a>0&&e.jsx("span",{className:"absolute inset-0 flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold leading-none group-hover:invisible transition-[visibility] duration-100",children:a>99?"99+":a}),e.jsx("button",{onClick:j,className:R("absolute inset-0 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 transition-[opacity,background-color] duration-100",n?"hover:bg-white/15":"hover:bg-subtle-fill"),title:"Remove channel",children:e.jsx(Qe,{className:R("w-3 h-3 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-red")})})]}):a>0?e.jsx("span",{className:"min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold flex items-center justify-center leading-none",children:a>99?"99+":a}):null})]}),e.jsx("div",{className:R("flex items-center gap-1.5 self-center",!c&&"invisible pointer-events-none"),children:y?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:k,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:h,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(Qe,{className:"w-4 h-4 text-white"})})]})})]})})}),Jo=l.memo(l.forwardRef(function({channels:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onAddChannel:o,onDeleteChannel:u,className:d},f){const c=wr(),x=gt(),[y,g]=l.useState(!1),m=l.useMemo(()=>{const k=new Set,h=t.filter(w=>k.has(w.index)?!1:(k.add(w.index),!0));return h.sort((w,E)=>{const M=w.name.toLowerCase()==="public",b=E.name.toLowerCase()==="public";if(M&&!b)return-1;if(!M&&b)return 1;const I=r.get(`ch:${w.index}`),T=I&&I.length>0?I[I.length-1].timestamp:0,_=r.get(`ch:${E.index}`),p=_&&_.length>0?_[_.length-1].timestamp:0;return T!==p?p-T:w.name.localeCompare(E.name)}),h},[t,r]),j=(n==null?void 0:n.type)==="channel"?n.id:null;return e.jsxs("div",{ref:f,className:R("flex-1 min-w-0 overflow-hidden flex flex-col h-full",d),children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-edge-subtle flex-shrink-0 overflow-hidden whitespace-nowrap",children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Channels"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>g(!0),className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Import channels from repeater history",children:e.jsx(qe,{className:"w-3.5 h-3.5 text-fg-muted"})}),o&&e.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Add channel",children:e.jsx(Xe,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]}),e.jsx(Go,{open:y,onClose:()=>g(!1)}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-1.5 py-1",style:{contain:"layout style paint"},children:m.length===0?e.jsxs("div",{className:"px-1.5 py-4 space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"No channels"}),o&&e.jsxs("button",{onClick:o,className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs font-medium text-sys-blue hover:bg-sys-blue/8 rounded transition-colors",children:[e.jsx(Xe,{className:"w-3.5 h-3.5"}),"Add Channel"]})]}):e.jsx(ve,{initial:!1,mode:"popLayout",children:m.map(k=>e.jsx(Vo,{channel:k,isActive:j===String(k.index),unread:a.get(`ch:${k.index}`)??0,lastMsg:(()=>{const h=r.get(`ch:${k.index}`);return h&&h.length>0?h[h.length-1]:void 0})(),isLoadingMessages:c,selfInfo:x,onSelect:i,onDeleteChannel:u},k.index))})})]})}));function Qo(s,t){const n=new Map;for(const[a,r]of s){const i=r.decoded;if(!(i!=null&&i.decrypted)||i.senderName!==t)continue;const o=i.timestamp??r.timestamp,u=Math.floor(o/30),d=`${i.text}:${u}`;n.has(d)||n.set(d,a)}return n}function Xo(s){const t=gt(),n=kr(),a=Cr(),r=t==null?void 0:t.node_name,i=l.useMemo(()=>r?Qo(n,r):new Map,[n,r]);return l.useMemo(()=>{const o=new Map;if(!r||i.size===0)return o;const u=new Map;for(const c of s){if(!c.is_outgoing||!c.is_channel)continue;const x=Math.floor(c.timestamp/30);let y=!1;for(const g of[x-1,x,x+1]){const m=i.get(`${c.text}:${g}`);if(m){const j=u.get(m)??[];j.push(c.id),u.set(m,j),y=!0;break}}}if(u.size===0)return o;const d=new Set(u.keys()),f=new Map;for(const c of a)d.has(c.packet_hash)&&f.set(c.packet_hash,(f.get(c.packet_hash)??0)+1);for(const[c,x]of u){const y=f.get(c)??0,g=Math.max(0,y-1);for(const m of x)o.set(m,g)}return o},[s,r,i,a])}const Z=l.memo(function({children:t,className:n,bgClassName:a,hideBadge:r,compact:i}){return e.jsxs("div",{className:R("relative max-w-full animate-bot-widget-in","rounded-2xl rounded-tl-md overflow-hidden","ring-1 ring-inset ring-edge-subtle",a||"bg-chat-incoming",i?"px-3 py-2":"px-3.5 py-3",n),children:[!r&&e.jsx("span",{className:"absolute top-1.5 right-2 text-[9px] text-sys-indigo/50 select-none pointer-events-none",children:"🤖"}),t]})}),Yo=new Set(["☀️","🌤","🌤️"]),Zo=new Set(["⛅","⛅️"]),ec=new Set(["☁️","🌫","🌫️"]),tc=new Set(["🌧","🌧️","🌦","🌦️","⛈","⛈️","🌩","🌩️"]),sc=new Set(["❄️","🌨","🌨️"]);function nc(s){return Yo.has(s)?"bg-gradient-to-br from-[var(--sys-blue)]/20 to-[var(--sys-indigo)]/10":Zo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-blue)]/15":ec.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60":tc.has(s)?"bg-gradient-to-br from-[var(--zinc-900)]/80 to-[var(--zinc-700)]/60":sc.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-cyan)]/10":"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60"}function Ue({label:s}){return e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-fg-primary/10 text-[10px] text-fg-primary/80 tabular-nums",children:s})}function ac({period:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted min-w-[56px]",children:s.label}),e.jsx("span",{className:"text-sm",children:s.conditionEmoji}),e.jsx("span",{className:"text-fg-primary/70",children:s.condition}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[s.temp,s.unit]}),s.wind&&e.jsx("span",{className:"text-fg-muted tabular-nums",children:s.wind})]})}const rc=l.memo(function({data:t}){const n=t.periods[0],a=t.periods.slice(1),r=nc(n.conditionEmoji);return e.jsxs(Z,{bgClassName:r,children:[e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:n.label}),e.jsxs("div",{className:"flex items-start gap-1.5 mb-2",children:[e.jsx("span",{className:"text-2xl leading-none",children:n.conditionEmoji}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-light text-fg-primary tabular-nums leading-none",children:[n.temp,"°"]}),e.jsx("span",{className:"text-xs text-fg-muted",children:n.unit.replace("°","")})]}),e.jsx("div",{className:"text-xs text-fg-primary/70 mt-0.5",children:n.condition})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[n.wind&&e.jsx(Ue,{label:`💨 ${n.wind}`}),n.humidity&&e.jsx(Ue,{label:`💧 ${n.humidity}`}),n.dewPoint&&e.jsx(Ue,{label:`💧 ${n.dewPoint}`}),n.visibility&&e.jsx(Ue,{label:`👁️ ${n.visibility}`}),n.pressure&&e.jsx(Ue,{label:`📊 ${n.pressure}`})]}),n.high!=null&&n.low!=null&&e.jsxs("div",{className:"flex items-center gap-2 text-[11px] mb-2",children:[e.jsxs("span",{className:"text-fg-muted tabular-nums",children:["L ",n.low,"°"]}),e.jsx("div",{className:"flex-1 h-1 rounded-full bg-fg-primary/15 relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-fg-primary/35",style:{width:n.high!==n.low?`${Math.max(0,Math.min(100,(n.temp-n.low)/(n.high-n.low)*100))}%`:"50%"}})}),e.jsxs("span",{className:"text-fg-primary/70 tabular-nums font-medium",children:["H ",n.high,"°"]})]}),a.length>0&&e.jsx("div",{className:"border-t border-edge-subtle pt-1.5 mt-1 space-y-0.5",children:a.map((i,o)=>e.jsx(ac,{period:i},o))})]})}),lc=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-1 flex-shrink-0 min-w-[52px]",children:[e.jsx("span",{className:"text-[11px] text-fg-muted font-medium",children:n.dayAbbrev}),e.jsx("span",{className:"text-lg leading-none",children:n.conditionEmoji}),e.jsx("span",{className:"text-[10px] text-fg-primary/70 text-center leading-tight",children:n.condition}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] tabular-nums",children:[n.high!=null&&e.jsxs("span",{className:"text-fg-primary font-medium",children:[n.high,"°"]}),n.low!=null&&e.jsxs("span",{className:"text-fg-muted",children:[n.low,"°"]})]})]},a))})})}),ic=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0 min-w-[44px]",children:[e.jsx("span",{className:"text-[10px] text-fg-muted font-medium tabular-nums",children:n.hour}),e.jsx("span",{className:"text-base leading-none",children:n.conditionEmoji}),e.jsxs("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:[n.temp,"°"]}),n.precipChance!=null&&n.precipChance>0&&e.jsxs("span",{className:R("text-[9px] tabular-nums font-medium",n.precipChance>=50?"text-sys-blue":"text-sys-blue/60"),children:[n.precipChance,"%"]})]},a))})})});function oc(s){if(!s)return"amber";const t=s.toUpperCase();return t.includes("EXTREME")||t.includes("TORNADO")||t.includes("HURRICANE")||t.includes("SEVERE")||t.includes("WARNING")?"red":"amber"}const cc={red:"border-l-sys-red",amber:"border-l-sys-amber"},dc={red:"text-sys-red",amber:"text-sys-amber"},uc=l.memo(function({data:t}){const n=oc(t.severity);return e.jsx(Z,{compact:!0,hideBadge:!0,children:e.jsxs("div",{className:R("border-l-[3px] pl-2.5 -ml-0.5",cc[n]),children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-sm leading-none",children:"⚠️"}),t.severity&&e.jsx("span",{className:R("text-[10px] font-bold uppercase tracking-wider",dc[n]),children:t.severity})]}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.headline}),t.body&&e.jsx("p",{className:"text-xs text-fg-muted mt-1 leading-relaxed whitespace-pre-wrap break-words",children:t.body})]})})}),mc={high:"🎯",medium:"📍",low:"❓"};function pc({hop:s}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] text-sys-blue font-bold tabular-nums min-w-[20px]",children:s.hex}),e.jsx("span",{className:"text-fg-muted/40 text-xs",children:"→"}),s.unknown?e.jsx("span",{className:"text-xs text-fg-muted/50 italic",children:"unknown"}):s.matchCount!=null?e.jsxs("span",{className:"text-xs text-sys-amber",children:[s.matchCount," matches"]}):e.jsxs("span",{className:R("text-xs font-medium truncate max-w-[140px]",s.confidence==="low"?"text-fg-muted":"text-fg-primary"),children:[s.name,s.confidence&&e.jsx("span",{className:"ml-0.5 text-[10px]",children:mc[s.confidence]})]})]})}const xc=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5 pr-6",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"🛤️ Path"}),e.jsxs("span",{className:"text-[10px] text-fg-muted/60 tabular-nums",children:[t.hops.length," hop",t.hops.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:t.hops.map((n,a)=>e.jsx(pc,{hop:n},a))})]})});function hc(s){return s>=10?5:s>=6?4:s>=3?3:s>=0?2:s>=-5?1:0}function fc(s){return s>=4?"bg-sys-green":s>=3?"bg-sys-amber":s>=2?"bg-sys-orange":"bg-sys-red"}function gc({bars:s}){const t=fc(s);return e.jsx("div",{className:"flex items-end gap-[2px] h-[20px]",children:[6,10,14,18,20].map((n,a)=>e.jsx("div",{className:R("w-[4px] rounded-sm transition-colors",a0?"+":"",t.snr.toFixed(1),e.jsx("span",{className:"text-[10px] text-fg-muted font-normal ml-0.5",children:"dB"})]}),t.rssi!=null&&e.jsxs("span",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.rssi," dBm"]})]})]}),(t.hops!=null||t.pathHops)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-1.5",children:[t.hops!=null&&e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-sys-blue/10 text-[10px] text-sys-blue font-semibold tabular-nums",children:[t.hops," hop",t.hops!==1?"s":""]}),t.pathHops&&t.pathHops.length>0&&e.jsx("div",{className:"flex items-center gap-0.5 text-[10px]",children:t.pathHops.map((a,r)=>e.jsxs("span",{className:"contents",children:[r>0&&e.jsx("span",{className:"text-fg-muted/40",children:"›"}),e.jsx("span",{className:"font-mono text-fg-muted",children:a})]},r))})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[10px] text-fg-muted",children:[t.distance&&e.jsx("span",{className:"tabular-nums",children:t.distance}),t.receivedAt&&e.jsxs("span",{className:"tabular-nums",children:["@ ",t.receivedAt]}),t.elapsed&&e.jsx("span",{className:"tabular-nums",children:t.elapsed}),t.phrase&&e.jsxs("span",{className:"text-fg-muted/60 italic truncate max-w-[120px]",children:['"',t.phrase,'"']})]})]})});function bc(s){return s<=50?{text:"text-sys-green",bg:"bg-sys-green/10"}:s<=100?{text:"text-sys-amber",bg:"bg-sys-amber/10"}:s<=150?{text:"text-sys-orange",bg:"bg-sys-orange/10"}:s<=200?{text:"text-sys-red",bg:"bg-sys-red/10"}:s<=300?{text:"text-sys-violet",bg:"bg-sys-violet/10"}:{text:"text-sys-red",bg:"bg-sys-red/10"}}const vc=l.memo(function({data:t}){const{text:n,bg:a}=bc(t.aqi);return e.jsxs(Z,{compact:!0,children:[t.location&&e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:t.location}),e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:R("flex items-center justify-center w-12 h-12 rounded-xl",a),children:e.jsx("span",{className:R("text-xl font-bold tabular-nums",n),children:t.aqi})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:t.colorEmoji}),e.jsx("span",{className:R("text-sm font-semibold",n),children:t.category})]}),e.jsx("span",{className:"text-[10px] text-fg-muted",children:"Air Quality Index"})]})]}),t.pollutants.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:t.pollutants.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-fg-primary/5 text-[10px] tabular-nums",children:[e.jsx("span",{className:"text-fg-muted font-medium",children:r.name}),e.jsx("span",{className:"text-fg-primary",children:r.value})]},r.name))})]})});function jc(s){return s<=3?"text-sys-green":s<=4?"text-sys-amber":s<=6?"text-sys-orange":"text-sys-red"}function Fe({label:s,value:t,className:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:s}),e.jsx("span",{className:R("text-sm font-semibold tabular-nums text-fg-primary",n),children:t})]})}const Nc=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"☀️"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Solar Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-x-4 gap-y-2",children:[t.aIndex!=null&&e.jsx(Fe,{label:"A-Index",value:t.aIndex}),t.kIndex!=null&&e.jsx(Fe,{label:"K-Index",value:t.kIndex,className:jc(t.kIndex)}),t.sunspots!=null&&e.jsx(Fe,{label:"Sunspots",value:t.sunspots}),t.xrayFlux!=null&&e.jsx(Fe,{label:"X-Ray",value:t.xrayFlux}),t.solarFlux!=null&&e.jsx(Fe,{label:"Flux",value:t.solarFlux}),t.signalNoise!=null&&e.jsx(Fe,{label:"Noise",value:t.signalNoise})]})]})});function wc(s){const t=s.toLowerCase();return t==="excellent"||t==="good"?"text-sys-green bg-sys-green/10":t==="fair"?"text-sys-amber bg-sys-amber/10":"text-sys-red bg-sys-red/10"}function qs({band:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-0.5",children:[e.jsx("span",{className:"text-[11px] text-fg-primary font-mono tabular-nums",children:s.name}),e.jsx("span",{className:R("text-[10px] font-semibold px-1.5 py-0.5 rounded",wc(s.condition)),children:s.condition})]})}const kc=l.memo(function({data:t}){const n=t.bands.filter(r=>r.time==="day"),a=t.bands.filter(r=>r.time==="night");return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"📻"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"HF Band Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Day"}),n.map((r,i)=>e.jsx(qs,{band:r},i))]}),a.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Night"}),a.map((r,i)=>e.jsx(qs,{band:r},i))]})]})]})});function Cc({progress:s}){if(s==null)return null;const t=Math.max(0,Math.min(1,s)),n=Math.PI*(1-t),a=50-40*Math.cos(n),r=45-40*Math.sin(n);return e.jsxs("svg",{viewBox:"0 0 100 50",className:"w-full h-8 mb-1","aria-hidden":"true",children:[e.jsx("line",{x1:"8",y1:"45",x2:"92",y2:"45",stroke:"var(--fg-muted)",strokeWidth:"0.5",opacity:"0.3"}),e.jsx("path",{d:"M 10 45 A 40 40 0 0 1 90 45",fill:"none",stroke:"var(--sys-amber)",strokeWidth:"1",opacity:"0.3",strokeDasharray:"3 2"}),e.jsx("circle",{cx:a,cy:r,r:"3.5",fill:"var(--sys-amber)"}),e.jsx("text",{x:"10",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↑"}),e.jsx("text",{x:"90",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↓"})]})}const Sc=l.memo(function({data:t}){let n=null;if(t.daylightHours!=null&&t.daylightMinutes!=null&&t.remainingHours!=null&&t.remainingMinutes!=null){const u=t.daylightHours*60+t.daylightMinutes,d=t.remainingHours*60+t.remainingMinutes;u>0&&(n=1-d/u)}const a=t.isEvening?t.setTime:t.riseTime,r=t.isEvening?t.riseTime:t.setTime,i=t.isEvening?"Sunset":"Sunrise",o=t.isEvening?"Sunrise":"Sunset";return e.jsxs(Z,{compact:!0,children:[e.jsx(Cc,{progress:n}),e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:i}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:a??"—"})]}),e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:o}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:r??"—"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[t.daylightHours!=null&&e.jsxs("span",{className:"text-fg-muted",children:["Daylight: ",e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.daylightHours,"h ",t.daylightMinutes,"m"]})]}),t.remainingHours!=null&&e.jsxs("span",{className:"text-sys-amber",children:["Remaining: ",e.jsxs("span",{className:"font-medium tabular-nums",children:[t.remainingHours,"h ",t.remainingMinutes,"m"]})]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),Ic=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("span",{className:"text-3xl leading-none",children:t.phaseEmoji}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-fg-primary font-medium",children:t.phaseName}),t.illumination!=null&&e.jsxs("div",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.illumination.toFixed(1),"% illuminated"]})]})]}),e.jsxs("div",{className:"flex gap-4 mb-1.5 text-[10px]",children:[t.riseTime&&e.jsxs("span",{className:"text-fg-muted",children:["Rise: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime})]}),t.setTime&&e.jsxs("span",{className:"text-fg-muted",children:["Set: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime})]})]}),(t.nextFullMoon||t.nextNewMoon)&&e.jsxs("div",{className:"flex gap-3 text-[10px] text-fg-muted",children:[t.nextFullMoon&&e.jsxs("span",{children:["🌕 ",t.nextFullMoon]}),t.nextNewMoon&&e.jsxs("span",{children:["🌑 ",t.nextNewMoon]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),_c=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"text-sm font-semibold text-fg-primary mb-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:"🛰"}),t.satName]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 text-[11px]",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Rise"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime}),e.jsx("div",{className:"text-fg-muted",children:t.startAz})]}),e.jsxs("div",{className:"flex flex-col items-center flex-1",children:[e.jsxs("div",{className:"text-[10px] font-semibold tabular-nums",style:{color:t.maxEl>=60?"var(--sys-green)":t.maxEl>=30?"var(--sys-amber)":"var(--sys-red)"},children:[t.maxEl,"° max"]}),e.jsx("div",{className:"w-full h-px my-0.5",style:{background:"var(--edge-subtle)"}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Set"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime}),e.jsx("div",{className:"text-fg-muted",children:t.endAz})]})]}),e.jsxs("div",{className:"text-[10px] text-fg-muted tabular-nums",children:["Duration: ",e.jsx("span",{className:"text-fg-primary font-medium",children:t.duration})]})]})});function Mc(s){return s<=1?"var(--sys-green)":s<=3?"var(--sys-lime)":s<=4?"var(--sys-amber)":s<=6?"var(--sys-orange)":"var(--sys-red)"}const Rc=l.memo(function({data:t}){const n=Mc(t.kpIndex);return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center text-lg font-bold",style:{background:n,color:"var(--zinc-950)"},children:t.kpIndex}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:t.status}),e.jsx("div",{className:"text-[10px] text-fg-muted",children:"Kp Index"})]})]}),t.probability!=null&&e.jsxs("div",{className:"mb-1.5",children:[e.jsxs("div",{className:"flex justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Probability"}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.probability,"%"]})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.min(t.probability,100)}%`,background:n}})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-fg-muted",children:[t.location&&e.jsx("span",{children:t.location}),t.timestamp&&e.jsx("span",{className:"tabular-nums",children:t.timestamp})]})]})}),Ec=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-base leading-none",children:"🎲"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Dice Roll"})]}),e.jsx("div",{className:"space-y-1.5",children:t.rolls.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted font-mono w-8 shrink-0",children:n.count>1?`${n.count}${n.dieType}`:n.dieType}),n.results.length>1?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-primary tabular-nums",children:["[",n.results.join(", "),"]"]}),e.jsx("span",{className:"text-fg-muted",children:"="}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]}):e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]},a))}),t.grandTotal!=null&&t.rolls.length>1&&e.jsxs("div",{className:"mt-2 pt-1.5 flex items-center justify-between text-xs",style:{borderTop:"1px solid var(--edge-subtle)"},children:[e.jsx("span",{className:"text-fg-muted",children:"Total"}),e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:t.grandTotal})]})]})}),Vs=l.memo(function({data:t,isDadJoke:n}){const a=n?"🥸":"🎭";return e.jsx(Z,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:a}),e.jsx("div",{className:"min-w-0",children:t.isTwoPart?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.setup}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words mt-2 pt-2 italic",style:{borderTop:"1px solid var(--edge-subtle)"},children:t.delivery})]}):e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.text})})]})})}),Pc=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsx("div",{className:"space-y-1.5",children:t.games.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:a>0?{borderTop:"1px solid var(--edge-subtle)",paddingTop:"6px"}:void 0,children:[e.jsx("span",{className:"text-sm leading-none shrink-0",children:n.sportEmoji}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.away}),n.awayScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.awayScore})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.home}),n.homeScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.homeScore})]})]}),e.jsxs("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded shrink-0 tabular-nums",style:{color:n.isLive?"var(--sys-green)":n.isFinal?"var(--fg-muted)":"var(--sys-blue)",background:n.isLive?"color-mix(in srgb, var(--sys-green) 12%, transparent)":n.isFinal?"color-mix(in srgb, var(--fg-muted) 10%, transparent)":"color-mix(in srgb, var(--sys-blue) 12%, transparent)"},children:[n.isLive&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full mr-1 align-middle",style:{background:"var(--sys-green)",animation:"pulse 2s ease-in-out infinite"}}),n.status]})]},a))})})}),Tc=l.memo(function({data:t}){var n;return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-sm leading-none",children:"📊"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:t.title??"Bot Stats"})]}),t.type==="basic"?e.jsxs("div",{className:"space-y-1 text-[11px]",children:[t.commands!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Commands"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.commands})]}),t.replies!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Replies"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.replies})]}),t.topCommand&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top Cmd"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topCommand})]}),t.topUser&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top User"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topUser})]})]}):e.jsx("div",{className:"space-y-1",children:(n=t.entries)==null?void 0:n.map(a=>{const r=t.entries[0].value,i=r>0?a.value/r*100:0;return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsxs("span",{className:"text-fg-muted w-4 text-right tabular-nums shrink-0",children:[a.rank,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between mb-0.5",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:a.name}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums shrink-0 ml-2",children:a.value})]}),e.jsx("div",{className:"w-full h-1 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,background:"var(--sys-blue)"}})})]})]},a.rank)})})]})}),$c=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:"🐱"}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t})]})})});function Ac({text:s}){return e.jsx(Z,{compact:!0,children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:xl(s)})})}const Fc=l.memo(function({text:t,messageType:n}){const a=l.useMemo(()=>n?Mo(t,n):null,[t,n]);if(a)switch(n){case"weather":return e.jsx(rc,{data:a});case"weather-multiday":return e.jsx(lc,{data:a});case"weather-hourly":return e.jsx(ic,{data:a});case"weather-alert":return e.jsx(uc,{data:a});case"path":return e.jsx(xc,{data:a});case"test":return e.jsx(yc,{data:a});case"aqi":return e.jsx(vc,{data:a});case"solar":return e.jsx(Nc,{data:a});case"hfcond":return e.jsx(kc,{data:a});case"sun":return e.jsx(Sc,{data:a});case"moon":return e.jsx(Ic,{data:a});case"satpass":return e.jsx(_c,{data:a});case"aurora":return e.jsx(Rc,{data:a});case"dice":return e.jsx(Ec,{data:a});case"joke":return e.jsx(Vs,{data:a});case"dadjoke":return e.jsx(Vs,{data:a,isDadJoke:!0});case"sports":return e.jsx(Pc,{data:a});case"stats":return e.jsx(Tc,{data:a});case"catfact":return e.jsx($c,{data:a})}return e.jsx(Ac,{text:t})}),Oc=l.lazy(()=>yn(()=>import("./CompanionPathMap-DAgjHpZ7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(s=>({default:s.CompanionPathMap}))),Dc=l.lazy(()=>yn(()=>import("./CompanionEchoMap-BLZcQnij.js"),__vite__mapDeps([10,1,2,3,7,8,9])).then(s=>({default:s.CompanionEchoMap}))),Js=e.jsx("div",{className:"rounded-lg bg-elevated flex items-center justify-center",style:{aspectRatio:"16 / 10"},children:e.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})});function Lc(s){const t=new Date(s*1e3),a=Math.floor((new Date().getTime()-t.getTime())/864e5);return a===0?"Today":a===1?"Yesterday":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function zc(s){const t=new Date(s*1e3);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Hc(s){const t=new Map;for(const n of s)n.name&&t.set(n.public_key,n.name);return t}function Bc(s){const t=new Map;for(const n of s)t.set(n.public_key,n);return t}function Wc(s){if(!s)return[];const t=[];for(let n=0;na.public_key.startsWith(s));return(n==null?void 0:n.name)||null}function Qs(s,t){return s.is_outgoing?"You":s.sender_name?s.sender_name:t.get(s.sender_key)??s.sender_key.slice(0,8)}const Gc=new Set(["🎭","🥸"]);function Kc({senderName:s,timestamp:t,signed:n,children:a}){const{emoji:r,cleanName:i}=yt(s),o=bt(i),u=vt(s);return e.jsxs("div",{className:"group flex items-start gap-4 w-full p-2",children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:R("clay-avatar w-9 h-9",r?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":o},children:r||u}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:hl(t)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:i}),n&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]})]}),e.jsx("div",{className:"flex items-end gap-1.5 min-w-0",children:a})]})]})}const qc=l.memo(function({msg:t,contact:n,contacts:a,selfInfo:r,echoCount:i,channelName:o,allMessages:u,children:d}){const[f,c]=l.useState(!1),[x,y]=l.useState(!1),[g,m]=l.useState(0),j=l.useRef(null),k=t.path_len,h=!t.is_outgoing,w=h&&k!=null,E=t.is_outgoing&&t.is_channel&&(i??0)>0,M=(o==null?void 0:o.toLowerCase().includes("wardrive"))??!1,b=l.useMemo(()=>M&&h?Dl(t.text):null,[M,h,t.text]),I=w||E,T=l.useMemo(()=>{const S=[];if(t.path_hops&&t.path_hops.length>0)S.push({hops:t.path_hops,snr:t.path_snr,rssi:t.path_rssi});else if(h&&(n!=null&&n.out_path)){const D=Wc(n.out_path);D.length>0&&S.push({hops:D})}if(t.alternate_paths)for(const D of t.alternate_paths)S.push(D);return S},[t.path_hops,t.path_snr,t.path_rssi,t.alternate_paths,h,n==null?void 0:n.out_path]),_=g1,C=(p==null?void 0:p.snr)??t.msg_snr,v=()=>{y(!0),c(S=>!S)},L=l.useCallback(S=>{var D;S.propertyName==="grid-template-rows"&&(f?(D=j.current)==null||D.scrollIntoView({block:"nearest",behavior:"smooth"}):y(!1))},[f]);return e.jsxs("div",{ref:j,className:R("rounded-xl px-2 py-1 -mx-2 transition-colors duration-150",I&&"hover:bg-subtle-fill cursor-pointer"),onClick:()=>I&&v(),children:[d,I&&e.jsx("div",{className:"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.83,0,0.17,1)]",style:{gridTemplateRows:f?"1fr":"0fr"},onTransitionEnd:L,children:e.jsxs("div",{className:"overflow-hidden",children:[x&&w&&e.jsxs("div",{className:"mt-1.5 ml-13 space-y-1",children:[N&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap",onClick:S=>S.stopPropagation(),children:T.map((S,D)=>e.jsxs("button",{onClick:()=>m(D),className:R("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] transition-colors",D===_?"bg-sys-blue/15 text-sys-blue font-semibold":"bg-subtle-fill text-fg-muted hover:text-fg-secondary"),children:[e.jsx(Je,{className:"w-2.5 h-2.5"}),S.hops.length||k,S.snr!=null&&e.jsxs("span",{className:"ml-0.5 opacity-70",children:[S.snr>0?"+":"",S.snr.toFixed(1)]})]},D))}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(Je,{className:"w-3 h-3 text-fg-muted flex-shrink-0"}),k===0&&!p?e.jsx("span",{className:"text-[10px] text-fg-muted font-medium",children:"Direct"}):p&&p.hops.length>0?p.hops.map((S,D)=>{const $=Uc(S,a);return e.jsxs("span",{className:"contents",children:[D>0&&e.jsx(zl,{className:"w-2.5 h-2.5 text-fg-muted/50 flex-shrink-0"}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-subtle-fill text-[10px]",children:[e.jsx("span",{className:"font-mono text-fg-primary",children:S}),$&&e.jsxs("span",{className:"text-fg-muted",children:["(",$,")"]})]})]},D)}):e.jsxs("span",{className:"text-[10px] text-fg-muted font-medium",children:[k," hop",k>1?"s":""]}),C!=null&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-fg-muted ml-0.5",children:[e.jsx(gl,{className:"w-2.5 h-2.5"}),C>0?"+":"",C.toFixed(1),"dB"]}),(p==null?void 0:p.rssi)!=null&&e.jsxs("span",{className:"text-[10px] text-fg-muted",children:[p.rssi,"dBm"]})]}),p&&p.hops.length>=1&&e.jsx(l.Suspense,{fallback:Js,children:e.jsx(Oc,{hops:p.hops,contacts:a,selfInfo:r,snr:C,wardriveCoords:b??void 0,wardriveSenderName:t.sender_name,channelMessages:M?u:void 0,messageTimestamp:t.timestamp})})]}),x&&E&&e.jsx("div",{className:"mt-1.5",children:e.jsx(l.Suspense,{fallback:Js,children:e.jsx(Dc,{text:t.text,timestamp:t.timestamp,contacts:a})})})]})})]})}),Vc=l.memo(function({messages:t,contacts:n,className:a,conversationKey:r,onRetry:i,onRetryAsFlood:o,onMentionClick:u,historyLoading:d,historyExhausted:f,onLoadOlder:c,channelName:x,contactPubKey:y}){const g=l.useRef(null),m=l.useRef(null),[j,k]=l.useState(!1),h=l.useRef(t.length),w=l.useRef(0),E=l.useRef(r);l.useEffect(()=>{if(r!==E.current){E.current=r,h.current=t.length,w.current=0,k(!1);const $=g.current;$&&($.scrollTop=$.scrollHeight)}},[r,t.length]);const M=l.useMemo(()=>Hc(n),[n]),b=l.useMemo(()=>Bc(n),[n]),I=gt(),T=Xo(t),_=ca(y??""),p=y?b.get(y):void 0,N=l.useMemo(()=>{if(!p)return!1;const $=t.filter(G=>!G.is_outgoing).slice(-5).map(G=>G.text);return Ro(p.name,_,$)},[p,_,t]),{combinedTexts:C,skipIds:v}=l.useMemo(()=>{const $=new Map,G=new Set;for(let O=0;O3)continue;const B=[...q.text][0];if(!B||!Gc.has(B)||[...J.text][0]!==B)continue;const A=J.text.slice(B.length).trimStart();$.set(q.id,q.text+` +`).map(a=>a.trim()).filter(Boolean),n=[];for(const a of t){let r="";for(const d of So)if(a.startsWith(d)){r=d;break}if(!r)continue;const i=a.slice(r.length).trim(),o=i.match(/^(.+?)\s+(\d+)\s*[-–]\s*(.+?)\s+(\d+)\s*\((.+)\)$/);if(o){const d=o[5].trim(),f=/final/i.test(d),c=!f&&/\d/.test(d);n.push({sportEmoji:r,away:o[1].trim(),home:o[3].trim(),awayScore:parseInt(o[2],10),homeScore:parseInt(o[4],10),status:d,isLive:c,isFinal:f});continue}const u=i.match(/^(.+?)\s*[-–]\s*(.+?)\s*\((.+)\)$/);u&&n.push({sportEmoji:r,away:u[1].trim(),home:u[2].trim(),status:u[3].trim(),isLive:!1,isFinal:!1})}return n.length>=1?{games:n}:null}function sa(s){var f,c,x,y;const t=[],n=/^(\d+)\.\s+(.+?):\s*(\d+)/gm;let a;for(;(a=n.exec(s))!==null;)t.push({rank:parseInt(a[1],10),name:a[2].trim(),value:parseInt(a[3],10)});if(t.length>=2){const g=s.match(/^(.+?)\n/i);return{type:"leaderboard",entries:t,title:(f=g==null?void 0:g[1])==null?void 0:f.replace(/📊\s*/,"").trim()}}const r=s.match(/Cmds?:\s*(\d+)/i),i=s.match(/Replies?:\s*(\d+)/i);if(!r&&!i)return null;const o=s.match(/Top\s*Cmd:\s*(.+?)\s*\(/i),u=s.match(/Top\s*User:\s*(.+?)\s*\(/i),d=s.match(/^(.+?)\n/i);return{type:"basic",commands:r?parseInt(r[1],10):void 0,replies:i?parseInt(i[1],10):void 0,topCommand:(c=o==null?void 0:o[1])==null?void 0:c.trim(),topUser:(x=u==null?void 0:u[1])==null?void 0:x.trim(),title:(y=d==null?void 0:d[1])==null?void 0:y.replace(/📊\s*/,"").trim()}}const Io=new Set(["🐱","🐈","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐾","👂","🐟","🧶","🥛"]);function na(s){if(!/\bcats?\b/i.test(s))return null;const t=s.slice(-4);for(const n of Io)if(t.includes(n))return s;return null}const _o=[{type:"dice",test:zn},{type:"joke",test:Hn},{type:"dadjoke",test:Bn},{type:"magic8",test:Wn},{type:"weather-alert",test:Un},{type:"satpass",test:Zn},{type:"aurora",test:ea},{type:"moon",test:Yn},{type:"sun",test:Xn},{type:"hfcond",test:Qn},{type:"solar",test:Jn},{type:"aqi",test:Vn},{type:"sports",test:ta},{type:"stats",test:sa},{type:"path",test:qn},{type:"weather-multiday",test:Gn},{type:"weather-hourly",test:Kn},{type:"test",test:Ln},{type:"weather",test:Dn},{type:"catfact",test:na}];function aa(s){for(const{type:t,test:n}of _o)if(n(s)!=null)return t;return null}function Mo(s,t){switch(t){case"weather":return Dn(s);case"weather-multiday":return Gn(s);case"weather-hourly":return Kn(s);case"weather-alert":return Un(s);case"test":return Ln(s);case"path":return qn(s);case"aqi":return Vn(s);case"solar":return Jn(s);case"hfcond":return Qn(s);case"sun":return Xn(s);case"moon":return Yn(s);case"satpass":return Zn(s);case"aurora":return ea(s);case"dice":return zn(s);case"joke":return Hn(s);case"dadjoke":return Bn(s);case"magic8":return Wn(s);case"sports":return ta(s);case"stats":return sa(s);case"catfact":return na(s);default:return null}}const ra=/[\u{1F916}\u{1F9BE}\u{1F9BF}]/u;function Ro(s,t,n){if(t==="bot")return!0;if(t==="not-bot")return!1;if(ra.test(s)||/bot\b/i.test(s))return!0;if(n&&n.length>0){let a=0;const r=n.slice(-5);for(const i of r)aa(i)!=null&&a++;if(a>=Math.ceil(r.length*.6))return!0}return!1}function la(s){return ra.test(s)||/bot\b/i.test(s)}const ia="pymc_howl_bot_overrides";function Eo(){try{const s=localStorage.getItem(ia);if(!s)return new Map;const t=JSON.parse(s);return new Map(t)}catch{return new Map}}function Bs(s){try{localStorage.setItem(ia,JSON.stringify([...s]))}catch{}}const oa=br(s=>({overrides:Eo(),setOverride:(t,n)=>s(a=>{const r=new Map(a.overrides);return r.set(t,n),Bs(r),{overrides:r}}),clearOverride:t=>s(n=>{const a=new Map(n.overrides);return a.delete(t),Bs(a),{overrides:a}})}));function ca(s){return oa(t=>t.overrides.get(s))}function Po(){return oa(s=>s.setOverride)}const da="pymc_companion_contacts_micro",ua="pymc_companion_favorites",St=56;function Ws(){try{return localStorage.getItem(da)==="1"}catch{return!1}}function To(s){try{localStorage.setItem(da,s?"1":"0")}catch{}}function $o(){try{const s=localStorage.getItem(ua);return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}function Ao(s){try{localStorage.setItem(ua,JSON.stringify([...s]))}catch{}}function Fo({name:s,pubkey:t,advType:n,size:a="md",signal:r}){const i=(n??0)&15,o=a==="sm"?"w-5 h-5":"w-6 h-6",u=a==="sm"?"size-3":"size-3.5";if(i===2){const x=r&&r.rssi!==0,y=x?`RSSI: ${r.rssi} dBm · SNR: ${r.snr.toFixed(1)} dB${r.rtt_ms!=null?` · RTT: ${r.rtt_ms} ms`:""}`:void 0;return e.jsx("div",{className:R(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px]",x?"ring-transparent":"ring-sys-blue"),title:y,children:x?e.jsx(fl,{rssi:r.rssi,snr:r.snr,compact:!0,showValues:!1}):e.jsx(Ke,{className:R(u,"text-sys-blue")})})}if(i===3)return e.jsx("div",{className:R(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px] ring-sys-pink"),children:e.jsx(ht,{className:R(u,"text-sys-pink")})});if(!s)return e.jsx("div",{className:R(o,"relative rounded-full bg-sys-blue/12 flex items-center justify-center flex-shrink-0"),children:e.jsx("span",{className:"text-sys-blue font-mono text-[10px] font-bold",children:t.slice(0,4)})});const{emoji:d}=yt(s),f=bt(s),c=vt(s);return e.jsx("div",{className:R(o,"relative clay-avatar",d?"text-base":"text-white text-[11px] font-bold"),style:{"--avatar-color":f},children:d||c})}const Us=[{key:"companion",label:"Companions",icon:je,color:"text-sys-blue"},{key:"room",label:"Room Servers",icon:ht,color:"text-sys-pink"},{key:"repeater",label:"Repeaters",icon:Ke,color:"text-sys-blue"}];function Oo(s){const t=(s.adv_type??0)&15;return t===3?"room":t===2?"repeater":"companion"}const Do=4e3,Lo=5e3,zo=2e3,Ho=8,Bo=l.forwardRef(function({contact:t,isActive:n,unread:a,lastMsg:r,isFav:i,microContent:o,onSelect:u,onShowDetails:d,onShareContact:f,onResetPath:c,onRemoveContact:x,onPingContact:y,repeaterNeighborHashes:g,repeaterSignal:m,toggleFavorite:j},k){const h=vr(t.public_key),w=jr(t.public_key),E=ca(t.public_key),M=Po(),b=E==="bot"||E==null&&la(t.name||""),[I,T]=l.useState(!1),[_,p]=l.useState(!1),N=l.useRef(null),[C,v]=l.useState("idle"),L=l.useRef(!1),S=l.useRef(null),[D,$]=l.useState({w:0,h:0});l.useEffect(()=>{if(h)L.current=!0,v("idle");else if(L.current){L.current=!1;const F=ae.getState().pingResults.get(t.public_key),W=F!=null&&F.rssi!==0;v(W?"success":"failed")}},[h,t.public_key]),l.useEffect(()=>{if(C==="idle")return;const W=setTimeout(()=>v("idle"),C==="success"?Lo:zo);return()=>clearTimeout(W)},[C]);const G=(h||C!=="idle")&&!I;l.useEffect(()=>{if(!G)return;const F=S.current;if(!F)return;const W=()=>{const me=F.offsetWidth,be=F.offsetHeight;$(He=>He.w===me&&He.h===be?He:{w:me,h:be})};W();const Q=new ResizeObserver(W);return Q.observe(F),()=>Q.disconnect()},[G]);const O=l.useCallback(()=>{T(!0),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>T(!1),Do)},[]),q=l.useCallback(()=>{T(!1),N.current&&clearTimeout(N.current)},[]),J=l.useCallback(async()=>{x&&(N.current&&clearTimeout(N.current),p(!0),await x(t.public_key),p(!1),T(!1))},[x,t.public_key]),B=l.useMemo(()=>{const F=w&&w.rssi!==0,W=m&&m.rssi!==0;if(!F&&!W)return null;if(F&&!W)return{rssi:w.rssi,snr:w.snr_db,rtt_ms:w.rtt_ms};if(!F&&W)return{rssi:m.rssi,snr:m.snr};const Q=m.advertCount,me=3,be=Q+me;return{rssi:Math.round((m.rssi*Q+w.rssi*me)/be),snr:(m.snr*Q+w.snr_db*me)/be,rtt_ms:w.rtt_ms}},[w,m]),A=l.useCallback(F=>{S.current=F,typeof k=="function"?k(F):k&&(k.current=F)},[k]),z=I?"":C==="success"?"bg-sys-green/5":C==="failed"?"bg-sys-red/5":h?"bg-sys-blue/5":n?"bg-sys-blue":"hover:bg-elevated";return e.jsxs(oe.div,{ref:A,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ie.fade,className:R("group relative w-full flex items-center gap-2.5 px-2.5 py-[3px] radius-inner overflow-hidden","transition-[background-color,box-shadow] duration-150",z),children:[e.jsx(ve,{children:G&&D.w>0&&(C!=="idle"?e.jsx(oe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{opacity:{duration:.15}},className:R("absolute inset-0 radius-inner ring-2 ring-inset pointer-events-none z-[2]",C==="success"?"ring-sys-green":"ring-sys-red")},`ping-${C}`):e.jsx(Nr,{borderRadius:Ho,width:D.w,height:D.h,color:"blue"},"ping-crawl"))}),e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:R("flex items-center gap-2.5",I&&!o&&"invisible pointer-events-none"),children:[e.jsxs("button",{onClick:()=>u({type:"contact",id:t.public_key}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Fo,{name:t.name,pubkey:t.public_key,advType:t.adv_type,signal:B}),a>0&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-sys-red ring-2 ring-body"}),b&&!a&&e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex items-center justify-center w-3 h-3 rounded-full bg-sys-violet ring-[1.5px] ring-body",title:"HOWL Bot",children:e.jsx(zs,{className:"w-2 h-2 text-white"})})]}),!o&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("span",{className:R("text-sm truncate flex-1",n?"text-white font-medium":i?"text-sys-amber font-bold":"text-fg-primary font-medium"),children:t.name||t.public_key.slice(0,12)+"…"})}),C==="success"&&w?e.jsxs("div",{className:"text-[11px] text-sys-green font-medium truncate tabular-nums",children:[w.rssi," dBm · ",w.snr_db.toFixed(1)," dB",w.rtt_ms!=null&&` · ${w.rtt_ms} ms`]}):C==="failed"?e.jsx("div",{className:"text-[11px] text-sys-red font-medium truncate",children:"No response"}):r?e.jsx("div",{className:R("text-[11px] truncate",n?"text-white/70":"text-fg-muted"),children:r.text}):null]})]}),!o&&e.jsx("div",{className:"relative flex-shrink-0 w-[18px] h-[18px] flex items-center justify-center",children:e.jsx(hi,{as:"div",className:"absolute inset-0",children:({open:F})=>e.jsxs(e.Fragment,{children:[e.jsx(Tn,{className:R("absolute inset-0 flex items-center justify-center rounded transition-[opacity,background-color] duration-100","focus:outline-none",n?"hover:bg-white/15":"hover:bg-subtle-fill",F?"opacity-100":"opacity-0 group-hover:opacity-100"),"aria-label":"Contact options",children:e.jsx(Li,{className:R("h-3.5 w-3.5 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-blue")})}),e.jsxs($n,{anchor:"right start",transition:!0,className:R("min-w-[10rem] max-w-[20rem]","radius-inset p-1 ml-1","surface-elevated","focus:outline-none z-50","transition-[opacity,transform]","data-[closed]:opacity-0 data-[closed]:scale-[0.98] data-[closed]:translate-x-[-4px]","data-[enter]:duration-150 data-[leave]:duration-100","data-[enter]:ease-out data-[leave]:ease-in"),children:[e.jsx(ke,{icon:e.jsx(ct,{className:"w-4 h-4"}),onClick:()=>{d==null||d({type:"contact",id:t.public_key})},children:"Details"}),f&&e.jsx(ke,{icon:e.jsx(Tl,{className:"w-4 h-4"}),onClick:()=>f(t.public_key),children:"Share"}),e.jsx(ke,{icon:e.jsx(Je,{className:"w-4 h-4"}),onClick:()=>u({type:"contact",id:t.public_key}),children:"Set Path"}),c&&e.jsx(ke,{icon:e.jsx(wn,{className:"w-4 h-4"}),onClick:()=>c(t.public_key),children:"Reset Path"}),y&&e.jsx(ke,{icon:e.jsx(Oi,{className:"w-4 h-4"}),onClick:()=>y(t.public_key),disabled:!(g!=null&&g.has(t.public_key)),children:"Ping"}),x&&e.jsx(ke,{icon:e.jsx(Qe,{className:"w-4 h-4"}),destructive:!0,onClick:O,children:"Remove Contact"}),e.jsx(io,{}),e.jsx(ke,{icon:b?e.jsx(Ti,{className:"w-4 h-4 text-fg-muted"}):e.jsx(zs,{className:"w-4 h-4 text-sys-violet"}),onClick:()=>M(t.public_key,b?"not-bot":"bot"),children:b?"Not a Bot":"Mark as HOWL Bot"}),e.jsx(ke,{icon:e.jsx(Zi,{className:R("w-4 h-4 group-data-[focus]:text-white group-data-[focus]:fill-white",i?"text-sys-amber fill-sys-amber":"text-fg-muted")}),onClick:()=>j(t.public_key),children:i?"Unfavorite":"Favorite"})]})]})})})]}),!o&&e.jsx("div",{className:R("flex items-center gap-1.5 self-center",!I&&"invisible pointer-events-none"),children:_?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:q,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:J,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(Qe,{className:"w-4 h-4 text-white"})})]})})]})]},t.public_key)}),Gs={excellent:4,good:3,fair:2,weak:1,poor:0};function Ks(s,t,n){const a=t==null?void 0:t.get(s),r=a&&a.rssi!==0,i=n==null?void 0:n.get(s),o=i&&typeof i.rssi=="number"&&i.rssi!==0;if(!r&&!o)return null;if(o&&!r)return i.rssi;if(!o&&r)return a.rssi;const u=a.advertCount,d=3;return Math.round((a.rssi*u+i.rssi*d)/(u+d))}function Wo(s,t,n,a,r){return[...s].sort((i,o)=>{const u=t.has(i.public_key)?0:1,d=t.has(o.public_key)?0:1;if(u!==d)return u-d;if(n){const f=n.get(i.public_key),c=f&&f.length>0?f[f.length-1].timestamp:0,x=n.get(o.public_key),y=x&&x.length>0?x[x.length-1].timestamp:0;if(c!==y)return y-c}if(a){const f=Ks(i.public_key,a,r),c=Ks(o.public_key,a,r);if(f!=null&&c==null)return-1;if(f==null&&c!=null)return 1;if(f!=null&&c!=null){const x=Gs[$s(f)]??0,y=Gs[$s(c)]??0;if(x!==y)return y-x}}return(i.name||"").localeCompare(o.name||"")})}const Uo=l.memo(l.forwardRef(function({contacts:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onShowDetails:o,onShareContact:u,onResetPath:d,onRemoveContact:f,onPingContact:c,repeaterNeighborHashes:x,repeaterSignalMap:y,isLoading:g,splitPercent:m=50,onMicroChange:j,className:k},h){const[w,E]=l.useState(Ws),[M,b]=l.useState(Ws),[I,T]=l.useState(""),[_,p]=l.useState(!1),[N,C]=l.useState($o),v=l.useRef(null),L=l.useRef(null),S=l.useCallback(A=>{L.current=A,typeof h=="function"?h(A):h&&(h.current=A)},[h]),D=l.useCallback(()=>{E(A=>{const z=!A;To(z);const F=L.current;if(z&&b(!0),F){let W=0;const Q=F.parentElement;if(z)W=(Q==null?void 0:Q.offsetWidth)??F.offsetWidth;else if(Q){const be=Q.style.width;Q.style.width="var(--companion-side)",W=Q.offsetWidth,Q.style.width=be}const me=z?St:Math.round(m/100*W);lt(F,{width:`${me}px`},{...ie.layoutResize,onComplete(){F.style.width=z?`${St}px`:`${m}%`,z||b(!1)}})}return j==null||j(z),z})},[m,j]),$=l.useCallback(A=>{C(z=>{const F=new Set(z);return F.has(A)?F.delete(A):F.add(A),Ao(F),F})},[]),G=_||I.length>0,O=l.useMemo(()=>{const A=new Set,z=t.filter(W=>A.has(W.public_key)?!1:(A.add(W.public_key),!0));if(!I.trim())return z;const F=I.toLowerCase();return z.filter(W=>{var Q;return((Q=W.name)==null?void 0:Q.toLowerCase().includes(F))||W.public_key.toLowerCase().includes(F)})},[t,I]),q=ae(A=>A.pingResults),J=l.useMemo(()=>{const A=new Map;for(const z of Us)A.set(z.key,[]);for(const z of O)A.get(Oo(z)).push(z);return Us.map(z=>({...z,items:Wo(A.get(z.key),N,r,z.key==="repeater"?y:void 0,z.key==="repeater"?q:void 0)})).filter(z=>z.items.length>0)},[O,N,r,y,q]),B=(n==null?void 0:n.type)==="contact"?n.id:null;return e.jsxs("div",{ref:S,className:R("flex-shrink-0 overflow-hidden flex flex-col h-full",k),style:{width:w?St:`${m}%`},children:[e.jsx("div",{className:R("flex items-center border-b border-edge-subtle flex-shrink-0",M?"justify-center p-2":"gap-2 px-3 py-2"),children:M?e.jsx("button",{onClick:D,className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Expand contacts",children:e.jsx(Ki,{className:"w-3.5 h-3.5 text-fg-muted"})}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Contacts"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>{G?(T(""),p(!1)):(p(!0),setTimeout(()=>{var A;return(A=v.current)==null?void 0:A.focus()},50))},className:R("p-1 rounded transition-colors flex-shrink-0",G?"bg-sys-blue/10 text-sys-blue":"hover:bg-subtle-fill text-fg-muted"),title:G?"Close search":"Search contacts",children:e.jsx(As,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:D,className:"p-1 hover:bg-subtle-fill rounded transition-colors flex-shrink-0",title:"Collapse contacts",children:e.jsx(Ui,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]})}),!M&&G&&e.jsxs("div",{className:"relative px-2.5 py-2 border-b border-edge-subtle/50 flex-shrink-0",children:[e.jsx(As,{className:"absolute left-5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none"}),e.jsx("input",{ref:v,type:"text",value:I,onChange:A=>T(A.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),placeholder:"Search contacts…",className:"w-full pl-8 pr-8 py-1.5 text-sm radius-inner bg-input-bg border border-input-border text-fg-primary placeholder:text-fg-muted/50 ring-focus-inset hover:border-edge-strong transition-colors",autoFocus:!0}),e.jsx("button",{onClick:()=>{T(""),p(!1)},className:"absolute right-5 top-1/2 -translate-y-1/2 p-0.5 hover:bg-subtle-fill rounded",children:e.jsx(ft,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),g&&e.jsx("div",{className:"flex items-center justify-center flex-1",children:e.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-sys-blue border-t-transparent"})}),!g&&e.jsxs("div",{className:R("flex-1 overflow-y-auto min-h-0",M?"px-0":"px-1.5"),style:{contain:"layout style paint"},children:[J.map(A=>{const z=A.icon;return e.jsxs(Re,{defaultOpen:!0,className:"mb-1",children:[e.jsxs(Ee,{className:R("px-2 py-1 flex items-center gap-1.5 w-full","text-left radius-inner hover:bg-subtle-fill-strong transition-colors"),children:[e.jsx(z,{className:R("w-3.5 h-3.5",A.color)}),!M&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:A.label}),e.jsx("span",{className:"type-data-xs text-fg-muted/50 ml-auto",children:A.items.length})]})]}),e.jsx(Pe,{children:e.jsx(ve,{initial:!1,mode:"popLayout",children:A.items.map(F=>e.jsx(Bo,{contact:F,isActive:B===F.public_key,unread:a.get(F.public_key)??0,lastMsg:(()=>{const W=r.get(F.public_key);return W&&W.length>0?W[W.length-1]:void 0})(),isFav:N.has(F.public_key),microContent:M,onSelect:i,onShowDetails:o,onShareContact:u,onResetPath:d,onRemoveContact:f,onPingContact:c,repeaterNeighborHashes:x,repeaterSignal:y==null?void 0:y.get(F.public_key),toggleFavorite:$},F.public_key))})})]},A.key)}),O.length===0&&e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-fg-muted",children:I?"No matches":"No contacts yet"})})]})]})}));function Go({open:s,onClose:t}){const n=ae(p=>p.discoverImportableChannels),a=ae(p=>p.getEmptyChannelSlots),r=ae(p=>p.importChannel),i=ae(p=>p.refreshChannels),[o,u]=l.useState("discover"),[d,f]=l.useState([]),[c,x]=l.useState([]),[y,g]=l.useState(null),m=l.useRef(!1);l.useEffect(()=>{if(!s)return;u("discover"),f([]),x([]),g(null),m.current=!1;let p=!1;return(async()=>{try{const[N,C]=await Promise.all([n(),a()]);if(p)return;if(x(C),N.length===0){g("No channels found in repeater history. Decoded messages may still be loading."),u("select");return}C.length===0&&g("No empty channel slots on device. Delete a channel first to make room."),f(N.map(v=>({name:v.name,alreadyOnDevice:v.alreadyOnDevice,selected:!v.alreadyOnDevice,status:"pending"}))),u("select")}catch(N){p||(g(N instanceof Error?N.message:"Discovery failed"),u("select"))}})(),()=>{p=!0}},[s,n,a]);const j=l.useCallback(p=>{f(N=>N.map(C=>C.name===p&&!C.alreadyOnDevice?{...C,selected:!C.selected}:C))},[]),k=l.useCallback(()=>{f(p=>p.map(N=>N.alreadyOnDevice?N:{...N,selected:!0}))},[]),h=l.useCallback(()=>{f(p=>p.map(N=>N.alreadyOnDevice?N:{...N,selected:!1}))},[]),w=l.useMemo(()=>d.filter(p=>!p.alreadyOnDevice).length,[d]),E=l.useMemo(()=>d.filter(p=>p.selected&&!p.alreadyOnDevice).length,[d]),M=l.useMemo(()=>d.filter(p=>p.status==="done").length,[d]),b=l.useMemo(()=>d.filter(p=>p.status==="failed").length,[d]),I=l.useCallback(async()=>{u("import"),m.current=!1;const p=d.filter(C=>C.selected&&!C.alreadyOnDevice),N=[...c];for(const C of p){if(m.current)break;const v=N.shift();if(v===void 0){f(S=>S.map(D=>D.name===C.name&&D.status==="pending"?{...D,status:"failed"}:D));continue}f(S=>S.map(D=>D.name===C.name?{...D,status:"sending"}:D)),await new Promise(S=>setTimeout(S,150));const L=await r(C.name,v);f(S=>S.map(D=>D.name===C.name?{...D,status:L?"done":"failed"}:D)),L||N.unshift(v),m.current||await new Promise(S=>setTimeout(S,300))}await i(),u("complete")},[d,c,r,i]),T=l.useCallback(()=>{m.current=!0},[]),_=p=>{switch(p){case"pending":return e.jsx(Fn,{className:"w-3.5 h-3.5 text-fg-muted"});case"sending":return e.jsx(ue,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"});case"done":return e.jsx(Ne,{className:"w-3.5 h-3.5 text-sys-green"});case"failed":return e.jsx(ft,{className:"w-3.5 h-3.5 text-sys-red"})}};return e.jsxs(Ce,{open:s,onClose:o==="import"?()=>{}:t,size:"sm",children:[e.jsx(Te,{icon:e.jsx(qe,{className:"w-5 h-5"}),title:"Import Channels",onClose:o==="import"?void 0:t}),e.jsxs(Se,{className:"!py-3 !px-0",children:[o==="discover"&&e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 px-6",children:[e.jsx(ue,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"text-sm text-fg-secondary",children:"Scanning repeater history…"}),e.jsx("p",{className:"text-[11px] text-fg-muted",children:"Waiting for decoded messages"})]}),o==="select"&&e.jsxs(e.Fragment,{children:[y&&e.jsxs("div",{className:"flex items-start gap-2 mx-4 mb-3 p-2.5 radius-inner bg-sys-amber/8 border border-sys-amber/20",children:[e.jsx(Ve,{className:"w-3.5 h-3.5 text-sys-amber flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-fg-secondary",children:y})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsxs("span",{className:"text-[11px] text-fg-muted",children:[w," discoverable · ",c.length," slot",c.length!==1?"s":""," free"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:k,className:"text-[11px] text-sys-blue hover:underline",children:"All"}),e.jsx("span",{className:"text-fg-muted/40",children:"·"}),e.jsx("button",{onClick:h,className:"text-[11px] text-sys-blue hover:underline",children:"None"})]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:d.map(p=>e.jsxs("button",{onClick:()=>j(p.name),disabled:p.alreadyOnDevice,className:R("w-full flex items-center gap-3 px-4 py-2 transition-colors",p.alreadyOnDevice?"opacity-40 cursor-default":"hover:bg-subtle-fill"),children:[e.jsx("div",{className:R("w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 transition-colors",p.alreadyOnDevice?"border-fg-muted/30 bg-fg-muted/10":p.selected?"border-sys-blue bg-sys-blue":"border-edge-subtle"),children:(p.selected||p.alreadyOnDevice)&&e.jsx(Ne,{className:"w-3 h-3 text-white"})}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-primary truncate",children:p.name})]}),p.alreadyOnDevice&&e.jsx("span",{className:"text-[10px] text-fg-muted bg-subtle-fill px-1.5 py-0.5 rounded flex-shrink-0",children:"on device"})]},p.name))})]})]}),(o==="import"||o==="complete")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsx("span",{className:"text-[11px] text-fg-muted",children:o==="import"?"Importing channels…":"Import complete"}),e.jsxs("span",{className:"text-[11px] tabular-nums text-fg-secondary",children:[M+b," / ",d.filter(p=>p.selected&&!p.alreadyOnDevice).length]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:d.filter(p=>p.selected&&!p.alreadyOnDevice).map(p=>e.jsxs("div",{className:R("flex items-center gap-3 px-4 py-2",p.status==="sending"&&"bg-sys-blue/5",p.status==="done"&&"bg-sys-green/5",p.status==="failed"&&"bg-sys-red/5"),children:[e.jsx("div",{className:"w-5 h-5 flex items-center justify-center flex-shrink-0",children:_(p.status)}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:R("text-sm truncate",p.status==="done"?"text-fg-primary":"text-fg-secondary"),children:p.name})]}),e.jsx("span",{className:R("text-[10px] flex-shrink-0",p.status==="sending"&&"text-sys-blue",p.status==="done"&&"text-sys-green",p.status==="failed"&&"text-sys-red",p.status==="pending"&&"text-fg-muted"),children:p.status==="sending"?"sending…":p.status==="done"?"added":p.status==="failed"?"failed":"waiting"})]},p.name))})]})]}),e.jsxs($e,{children:[o==="select"&&e.jsxs(e.Fragment,{children:[e.jsx(U,{plain:!0,onClick:t,children:"Cancel"}),e.jsxs(U,{color:"primary",onClick:I,disabled:E===0||c.length===0,children:[e.jsx(qe,{className:"w-4 h-4"}),"Import ",E," ",E===1?"Channel":"Channels"]})]}),o==="import"&&e.jsx(U,{plain:!0,onClick:T,children:"Stop"}),o==="complete"&&e.jsxs(e.Fragment,{children:[b>0&&e.jsxs("span",{className:"text-xs text-sys-red flex items-center gap-1 mr-auto",children:[e.jsx(Ve,{className:"w-3.5 h-3.5"}),b," failed"]}),e.jsxs(U,{color:"primary",onClick:t,children:[e.jsx(Al,{className:"w-4 h-4"}),"Done — ",M," imported"]})]})]})]})}const Ko=4e3;function qo(s){const t=s.frequency_hz/1e3,n=s.bandwidth_hz/1e3;return`${t} · SF${s.spreading_factor} · ${n}k`}const Vo=l.forwardRef(function({channel:t,isActive:n,unread:a,lastMsg:r,isLoadingMessages:i,selfInfo:o,onSelect:u,onDeleteChannel:d},f){const[c,x]=l.useState(!1),[y,g]=l.useState(!1),m=l.useRef(null),j=l.useCallback(()=>{x(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>x(!1),Ko)},[]),k=l.useCallback(()=>{x(!1),m.current&&clearTimeout(m.current)},[]),h=l.useCallback(async()=>{d&&(m.current&&clearTimeout(m.current),g(!0),await d(t.index),g(!1),x(!1))},[d,t.index]),w=t.name.toLowerCase()==="public",E=d&&!w;return e.jsx(oe.div,{ref:f,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ie.fade,className:R("group w-full flex items-center gap-2.5 px-2.5 py-1 radius-inner","transition-[background-color] duration-150",c?"":n?"bg-sys-blue":"hover:bg-subtle-fill-strong"),children:e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:R("flex items-center gap-2.5 min-w-0",c&&"invisible pointer-events-none"),children:[e.jsx("button",{onClick:()=>u({type:"channel",id:String(t.index)}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:R("text-sm flex-shrink-0",n?"text-white font-semibold":r?"text-fg-primary font-semibold":"text-fg-secondary font-normal"),children:t.name}),w&&o&&e.jsx("span",{className:R("text-[9px] font-medium px-1.5 py-px rounded-full whitespace-nowrap truncate",n?"text-white/80 bg-white/15":"text-fg-muted/70 bg-subtle-fill"),children:qo(o)})]}),r&&e.jsx("div",{className:R("text-[11px] truncate pl-2",n?"text-white/70":"text-fg-muted"),children:r.text})]})}),e.jsx("div",{className:"flex items-center flex-shrink-0",children:i?e.jsx("span",{className:"h-1.5 w-6 rounded-full bg-fg-muted/20 animate-pulse"}):E?e.jsxs("div",{className:"relative w-[18px] h-[18px] flex items-center justify-center",children:[a>0&&e.jsx("span",{className:"absolute inset-0 flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold leading-none group-hover:invisible transition-[visibility] duration-100",children:a>99?"99+":a}),e.jsx("button",{onClick:j,className:R("absolute inset-0 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 transition-[opacity,background-color] duration-100",n?"hover:bg-white/15":"hover:bg-subtle-fill"),title:"Remove channel",children:e.jsx(Qe,{className:R("w-3 h-3 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-red")})})]}):a>0?e.jsx("span",{className:"min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold flex items-center justify-center leading-none",children:a>99?"99+":a}):null})]}),e.jsx("div",{className:R("flex items-center gap-1.5 self-center",!c&&"invisible pointer-events-none"),children:y?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:k,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:h,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(Qe,{className:"w-4 h-4 text-white"})})]})})]})})}),Jo=l.memo(l.forwardRef(function({channels:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onAddChannel:o,onDeleteChannel:u,className:d},f){const c=wr(),x=gt(),[y,g]=l.useState(!1),m=l.useMemo(()=>{const k=new Set,h=t.filter(w=>k.has(w.index)?!1:(k.add(w.index),!0));return h.sort((w,E)=>{const M=w.name.toLowerCase()==="public",b=E.name.toLowerCase()==="public";if(M&&!b)return-1;if(!M&&b)return 1;const I=r.get(`ch:${w.index}`),T=I&&I.length>0?I[I.length-1].timestamp:0,_=r.get(`ch:${E.index}`),p=_&&_.length>0?_[_.length-1].timestamp:0;return T!==p?p-T:w.name.localeCompare(E.name)}),h},[t,r]),j=(n==null?void 0:n.type)==="channel"?n.id:null;return e.jsxs("div",{ref:f,className:R("flex-1 min-w-0 overflow-hidden flex flex-col h-full",d),children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-edge-subtle flex-shrink-0 overflow-hidden whitespace-nowrap",children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Channels"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>g(!0),className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Import channels from repeater history",children:e.jsx(qe,{className:"w-3.5 h-3.5 text-fg-muted"})}),o&&e.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Add channel",children:e.jsx(Xe,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]}),e.jsx(Go,{open:y,onClose:()=>g(!1)}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-1.5 py-1",style:{contain:"layout style paint"},children:m.length===0?e.jsxs("div",{className:"px-1.5 py-4 space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"No channels"}),o&&e.jsxs("button",{onClick:o,className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs font-medium text-sys-blue hover:bg-sys-blue/8 rounded transition-colors",children:[e.jsx(Xe,{className:"w-3.5 h-3.5"}),"Add Channel"]})]}):e.jsx(ve,{initial:!1,mode:"popLayout",children:m.map(k=>e.jsx(Vo,{channel:k,isActive:j===String(k.index),unread:a.get(`ch:${k.index}`)??0,lastMsg:(()=>{const h=r.get(`ch:${k.index}`);return h&&h.length>0?h[h.length-1]:void 0})(),isLoadingMessages:c,selfInfo:x,onSelect:i,onDeleteChannel:u},k.index))})})]})}));function Qo(s,t){const n=new Map;for(const[a,r]of s){const i=r.decoded;if(!(i!=null&&i.decrypted)||i.senderName!==t)continue;const o=i.timestamp??r.timestamp,u=Math.floor(o/30),d=`${i.text}:${u}`;n.has(d)||n.set(d,a)}return n}function Xo(s){const t=gt(),n=kr(),a=Cr(),r=t==null?void 0:t.node_name,i=l.useMemo(()=>r?Qo(n,r):new Map,[n,r]);return l.useMemo(()=>{const o=new Map;if(!r||i.size===0)return o;const u=new Map;for(const c of s){if(!c.is_outgoing||!c.is_channel)continue;const x=Math.floor(c.timestamp/30);let y=!1;for(const g of[x-1,x,x+1]){const m=i.get(`${c.text}:${g}`);if(m){const j=u.get(m)??[];j.push(c.id),u.set(m,j),y=!0;break}}}if(u.size===0)return o;const d=new Set(u.keys()),f=new Map;for(const c of a)d.has(c.packet_hash)&&f.set(c.packet_hash,(f.get(c.packet_hash)??0)+1);for(const[c,x]of u){const y=f.get(c)??0,g=Math.max(0,y-1);for(const m of x)o.set(m,g)}return o},[s,r,i,a])}const Z=l.memo(function({children:t,className:n,bgClassName:a,hideBadge:r,compact:i}){return e.jsxs("div",{className:R("relative max-w-full animate-bot-widget-in","rounded-2xl rounded-tl-md overflow-hidden","ring-1 ring-inset ring-edge-subtle",a||"bg-chat-incoming",i?"px-3 py-2":"px-3.5 py-3",n),children:[!r&&e.jsx("span",{className:"absolute top-1.5 right-2 text-[9px] text-sys-indigo/50 select-none pointer-events-none",children:"🤖"}),t]})}),Yo=new Set(["☀️","🌤","🌤️"]),Zo=new Set(["⛅","⛅️"]),ec=new Set(["☁️","🌫","🌫️"]),tc=new Set(["🌧","🌧️","🌦","🌦️","⛈","⛈️","🌩","🌩️"]),sc=new Set(["❄️","🌨","🌨️"]);function nc(s){return Yo.has(s)?"bg-gradient-to-br from-[var(--sys-blue)]/20 to-[var(--sys-indigo)]/10":Zo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-blue)]/15":ec.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60":tc.has(s)?"bg-gradient-to-br from-[var(--zinc-900)]/80 to-[var(--zinc-700)]/60":sc.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-cyan)]/10":"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60"}function Ue({label:s}){return e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-fg-primary/10 text-[10px] text-fg-primary/80 tabular-nums",children:s})}function ac({period:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted min-w-[56px]",children:s.label}),e.jsx("span",{className:"text-sm",children:s.conditionEmoji}),e.jsx("span",{className:"text-fg-primary/70",children:s.condition}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[s.temp,s.unit]}),s.wind&&e.jsx("span",{className:"text-fg-muted tabular-nums",children:s.wind})]})}const rc=l.memo(function({data:t}){const n=t.periods[0],a=t.periods.slice(1),r=nc(n.conditionEmoji);return e.jsxs(Z,{bgClassName:r,children:[e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:n.label}),e.jsxs("div",{className:"flex items-start gap-1.5 mb-2",children:[e.jsx("span",{className:"text-2xl leading-none",children:n.conditionEmoji}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-light text-fg-primary tabular-nums leading-none",children:[n.temp,"°"]}),e.jsx("span",{className:"text-xs text-fg-muted",children:n.unit.replace("°","")})]}),e.jsx("div",{className:"text-xs text-fg-primary/70 mt-0.5",children:n.condition})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[n.wind&&e.jsx(Ue,{label:`💨 ${n.wind}`}),n.humidity&&e.jsx(Ue,{label:`💧 ${n.humidity}`}),n.dewPoint&&e.jsx(Ue,{label:`💧 ${n.dewPoint}`}),n.visibility&&e.jsx(Ue,{label:`👁️ ${n.visibility}`}),n.pressure&&e.jsx(Ue,{label:`📊 ${n.pressure}`})]}),n.high!=null&&n.low!=null&&e.jsxs("div",{className:"flex items-center gap-2 text-[11px] mb-2",children:[e.jsxs("span",{className:"text-fg-muted tabular-nums",children:["L ",n.low,"°"]}),e.jsx("div",{className:"flex-1 h-1 rounded-full bg-fg-primary/15 relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-fg-primary/35",style:{width:n.high!==n.low?`${Math.max(0,Math.min(100,(n.temp-n.low)/(n.high-n.low)*100))}%`:"50%"}})}),e.jsxs("span",{className:"text-fg-primary/70 tabular-nums font-medium",children:["H ",n.high,"°"]})]}),a.length>0&&e.jsx("div",{className:"border-t border-edge-subtle pt-1.5 mt-1 space-y-0.5",children:a.map((i,o)=>e.jsx(ac,{period:i},o))})]})}),lc=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-1 flex-shrink-0 min-w-[52px]",children:[e.jsx("span",{className:"text-[11px] text-fg-muted font-medium",children:n.dayAbbrev}),e.jsx("span",{className:"text-lg leading-none",children:n.conditionEmoji}),e.jsx("span",{className:"text-[10px] text-fg-primary/70 text-center leading-tight",children:n.condition}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] tabular-nums",children:[n.high!=null&&e.jsxs("span",{className:"text-fg-primary font-medium",children:[n.high,"°"]}),n.low!=null&&e.jsxs("span",{className:"text-fg-muted",children:[n.low,"°"]})]})]},a))})})}),ic=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0 min-w-[44px]",children:[e.jsx("span",{className:"text-[10px] text-fg-muted font-medium tabular-nums",children:n.hour}),e.jsx("span",{className:"text-base leading-none",children:n.conditionEmoji}),e.jsxs("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:[n.temp,"°"]}),n.precipChance!=null&&n.precipChance>0&&e.jsxs("span",{className:R("text-[9px] tabular-nums font-medium",n.precipChance>=50?"text-sys-blue":"text-sys-blue/60"),children:[n.precipChance,"%"]})]},a))})})});function oc(s){if(!s)return"amber";const t=s.toUpperCase();return t.includes("EXTREME")||t.includes("TORNADO")||t.includes("HURRICANE")||t.includes("SEVERE")||t.includes("WARNING")?"red":"amber"}const cc={red:"border-l-sys-red",amber:"border-l-sys-amber"},dc={red:"text-sys-red",amber:"text-sys-amber"},uc=l.memo(function({data:t}){const n=oc(t.severity);return e.jsx(Z,{compact:!0,hideBadge:!0,children:e.jsxs("div",{className:R("border-l-[3px] pl-2.5 -ml-0.5",cc[n]),children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-sm leading-none",children:"⚠️"}),t.severity&&e.jsx("span",{className:R("text-[10px] font-bold uppercase tracking-wider",dc[n]),children:t.severity})]}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.headline}),t.body&&e.jsx("p",{className:"text-xs text-fg-muted mt-1 leading-relaxed whitespace-pre-wrap break-words",children:t.body})]})})}),mc={high:"🎯",medium:"📍",low:"❓"};function pc({hop:s}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] text-sys-blue font-bold tabular-nums min-w-[20px]",children:s.hex}),e.jsx("span",{className:"text-fg-muted/40 text-xs",children:"→"}),s.unknown?e.jsx("span",{className:"text-xs text-fg-muted/50 italic",children:"unknown"}):s.matchCount!=null?e.jsxs("span",{className:"text-xs text-sys-amber",children:[s.matchCount," matches"]}):e.jsxs("span",{className:R("text-xs font-medium truncate max-w-[140px]",s.confidence==="low"?"text-fg-muted":"text-fg-primary"),children:[s.name,s.confidence&&e.jsx("span",{className:"ml-0.5 text-[10px]",children:mc[s.confidence]})]})]})}const xc=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5 pr-6",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"🛤️ Path"}),e.jsxs("span",{className:"text-[10px] text-fg-muted/60 tabular-nums",children:[t.hops.length," hop",t.hops.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:t.hops.map((n,a)=>e.jsx(pc,{hop:n},a))})]})});function hc(s){return s>=10?5:s>=6?4:s>=3?3:s>=0?2:s>=-5?1:0}function fc(s){return s>=4?"bg-sys-green":s>=3?"bg-sys-amber":s>=2?"bg-sys-orange":"bg-sys-red"}function gc({bars:s}){const t=fc(s);return e.jsx("div",{className:"flex items-end gap-[2px] h-[20px]",children:[6,10,14,18,20].map((n,a)=>e.jsx("div",{className:R("w-[4px] rounded-sm transition-colors",a0?"+":"",t.snr.toFixed(1),e.jsx("span",{className:"text-[10px] text-fg-muted font-normal ml-0.5",children:"dB"})]}),t.rssi!=null&&e.jsxs("span",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.rssi," dBm"]})]})]}),(t.hops!=null||t.pathHops)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-1.5",children:[t.hops!=null&&e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-sys-blue/10 text-[10px] text-sys-blue font-semibold tabular-nums",children:[t.hops," hop",t.hops!==1?"s":""]}),t.pathHops&&t.pathHops.length>0&&e.jsx("div",{className:"flex items-center gap-0.5 text-[10px]",children:t.pathHops.map((a,r)=>e.jsxs("span",{className:"contents",children:[r>0&&e.jsx("span",{className:"text-fg-muted/40",children:"›"}),e.jsx("span",{className:"font-mono text-fg-muted",children:a})]},r))})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[10px] text-fg-muted",children:[t.distance&&e.jsx("span",{className:"tabular-nums",children:t.distance}),t.receivedAt&&e.jsxs("span",{className:"tabular-nums",children:["@ ",t.receivedAt]}),t.elapsed&&e.jsx("span",{className:"tabular-nums",children:t.elapsed}),t.phrase&&e.jsxs("span",{className:"text-fg-muted/60 italic truncate max-w-[120px]",children:['"',t.phrase,'"']})]})]})});function bc(s){return s<=50?{text:"text-sys-green",bg:"bg-sys-green/10"}:s<=100?{text:"text-sys-amber",bg:"bg-sys-amber/10"}:s<=150?{text:"text-sys-orange",bg:"bg-sys-orange/10"}:s<=200?{text:"text-sys-red",bg:"bg-sys-red/10"}:s<=300?{text:"text-sys-violet",bg:"bg-sys-violet/10"}:{text:"text-sys-red",bg:"bg-sys-red/10"}}const vc=l.memo(function({data:t}){const{text:n,bg:a}=bc(t.aqi);return e.jsxs(Z,{compact:!0,children:[t.location&&e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:t.location}),e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:R("flex items-center justify-center w-12 h-12 rounded-xl",a),children:e.jsx("span",{className:R("text-xl font-bold tabular-nums",n),children:t.aqi})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:t.colorEmoji}),e.jsx("span",{className:R("text-sm font-semibold",n),children:t.category})]}),e.jsx("span",{className:"text-[10px] text-fg-muted",children:"Air Quality Index"})]})]}),t.pollutants.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:t.pollutants.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-fg-primary/5 text-[10px] tabular-nums",children:[e.jsx("span",{className:"text-fg-muted font-medium",children:r.name}),e.jsx("span",{className:"text-fg-primary",children:r.value})]},r.name))})]})});function jc(s){return s<=3?"text-sys-green":s<=4?"text-sys-amber":s<=6?"text-sys-orange":"text-sys-red"}function Fe({label:s,value:t,className:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:s}),e.jsx("span",{className:R("text-sm font-semibold tabular-nums text-fg-primary",n),children:t})]})}const Nc=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"☀️"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Solar Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-x-4 gap-y-2",children:[t.aIndex!=null&&e.jsx(Fe,{label:"A-Index",value:t.aIndex}),t.kIndex!=null&&e.jsx(Fe,{label:"K-Index",value:t.kIndex,className:jc(t.kIndex)}),t.sunspots!=null&&e.jsx(Fe,{label:"Sunspots",value:t.sunspots}),t.xrayFlux!=null&&e.jsx(Fe,{label:"X-Ray",value:t.xrayFlux}),t.solarFlux!=null&&e.jsx(Fe,{label:"Flux",value:t.solarFlux}),t.signalNoise!=null&&e.jsx(Fe,{label:"Noise",value:t.signalNoise})]})]})});function wc(s){const t=s.toLowerCase();return t==="excellent"||t==="good"?"text-sys-green bg-sys-green/10":t==="fair"?"text-sys-amber bg-sys-amber/10":"text-sys-red bg-sys-red/10"}function qs({band:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-0.5",children:[e.jsx("span",{className:"text-[11px] text-fg-primary font-mono tabular-nums",children:s.name}),e.jsx("span",{className:R("text-[10px] font-semibold px-1.5 py-0.5 rounded",wc(s.condition)),children:s.condition})]})}const kc=l.memo(function({data:t}){const n=t.bands.filter(r=>r.time==="day"),a=t.bands.filter(r=>r.time==="night");return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"📻"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"HF Band Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Day"}),n.map((r,i)=>e.jsx(qs,{band:r},i))]}),a.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Night"}),a.map((r,i)=>e.jsx(qs,{band:r},i))]})]})]})});function Cc({progress:s}){if(s==null)return null;const t=Math.max(0,Math.min(1,s)),n=Math.PI*(1-t),a=50-40*Math.cos(n),r=45-40*Math.sin(n);return e.jsxs("svg",{viewBox:"0 0 100 50",className:"w-full h-8 mb-1","aria-hidden":"true",children:[e.jsx("line",{x1:"8",y1:"45",x2:"92",y2:"45",stroke:"var(--fg-muted)",strokeWidth:"0.5",opacity:"0.3"}),e.jsx("path",{d:"M 10 45 A 40 40 0 0 1 90 45",fill:"none",stroke:"var(--sys-amber)",strokeWidth:"1",opacity:"0.3",strokeDasharray:"3 2"}),e.jsx("circle",{cx:a,cy:r,r:"3.5",fill:"var(--sys-amber)"}),e.jsx("text",{x:"10",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↑"}),e.jsx("text",{x:"90",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↓"})]})}const Sc=l.memo(function({data:t}){let n=null;if(t.daylightHours!=null&&t.daylightMinutes!=null&&t.remainingHours!=null&&t.remainingMinutes!=null){const u=t.daylightHours*60+t.daylightMinutes,d=t.remainingHours*60+t.remainingMinutes;u>0&&(n=1-d/u)}const a=t.isEvening?t.setTime:t.riseTime,r=t.isEvening?t.riseTime:t.setTime,i=t.isEvening?"Sunset":"Sunrise",o=t.isEvening?"Sunrise":"Sunset";return e.jsxs(Z,{compact:!0,children:[e.jsx(Cc,{progress:n}),e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:i}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:a??"—"})]}),e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:o}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:r??"—"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[t.daylightHours!=null&&e.jsxs("span",{className:"text-fg-muted",children:["Daylight: ",e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.daylightHours,"h ",t.daylightMinutes,"m"]})]}),t.remainingHours!=null&&e.jsxs("span",{className:"text-sys-amber",children:["Remaining: ",e.jsxs("span",{className:"font-medium tabular-nums",children:[t.remainingHours,"h ",t.remainingMinutes,"m"]})]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),Ic=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("span",{className:"text-3xl leading-none",children:t.phaseEmoji}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-fg-primary font-medium",children:t.phaseName}),t.illumination!=null&&e.jsxs("div",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.illumination.toFixed(1),"% illuminated"]})]})]}),e.jsxs("div",{className:"flex gap-4 mb-1.5 text-[10px]",children:[t.riseTime&&e.jsxs("span",{className:"text-fg-muted",children:["Rise: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime})]}),t.setTime&&e.jsxs("span",{className:"text-fg-muted",children:["Set: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime})]})]}),(t.nextFullMoon||t.nextNewMoon)&&e.jsxs("div",{className:"flex gap-3 text-[10px] text-fg-muted",children:[t.nextFullMoon&&e.jsxs("span",{children:["🌕 ",t.nextFullMoon]}),t.nextNewMoon&&e.jsxs("span",{children:["🌑 ",t.nextNewMoon]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),_c=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"text-sm font-semibold text-fg-primary mb-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:"🛰"}),t.satName]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 text-[11px]",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Rise"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime}),e.jsx("div",{className:"text-fg-muted",children:t.startAz})]}),e.jsxs("div",{className:"flex flex-col items-center flex-1",children:[e.jsxs("div",{className:"text-[10px] font-semibold tabular-nums",style:{color:t.maxEl>=60?"var(--sys-green)":t.maxEl>=30?"var(--sys-amber)":"var(--sys-red)"},children:[t.maxEl,"° max"]}),e.jsx("div",{className:"w-full h-px my-0.5",style:{background:"var(--edge-subtle)"}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Set"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime}),e.jsx("div",{className:"text-fg-muted",children:t.endAz})]})]}),e.jsxs("div",{className:"text-[10px] text-fg-muted tabular-nums",children:["Duration: ",e.jsx("span",{className:"text-fg-primary font-medium",children:t.duration})]})]})});function Mc(s){return s<=1?"var(--sys-green)":s<=3?"var(--sys-lime)":s<=4?"var(--sys-amber)":s<=6?"var(--sys-orange)":"var(--sys-red)"}const Rc=l.memo(function({data:t}){const n=Mc(t.kpIndex);return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center text-lg font-bold",style:{background:n,color:"var(--zinc-950)"},children:t.kpIndex}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:t.status}),e.jsx("div",{className:"text-[10px] text-fg-muted",children:"Kp Index"})]})]}),t.probability!=null&&e.jsxs("div",{className:"mb-1.5",children:[e.jsxs("div",{className:"flex justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Probability"}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.probability,"%"]})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.min(t.probability,100)}%`,background:n}})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-fg-muted",children:[t.location&&e.jsx("span",{children:t.location}),t.timestamp&&e.jsx("span",{className:"tabular-nums",children:t.timestamp})]})]})}),Ec=l.memo(function({data:t}){return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-base leading-none",children:"🎲"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Dice Roll"})]}),e.jsx("div",{className:"space-y-1.5",children:t.rolls.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted font-mono w-8 shrink-0",children:n.count>1?`${n.count}${n.dieType}`:n.dieType}),n.results.length>1?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-primary tabular-nums",children:["[",n.results.join(", "),"]"]}),e.jsx("span",{className:"text-fg-muted",children:"="}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]}):e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]},a))}),t.grandTotal!=null&&t.rolls.length>1&&e.jsxs("div",{className:"mt-2 pt-1.5 flex items-center justify-between text-xs",style:{borderTop:"1px solid var(--edge-subtle)"},children:[e.jsx("span",{className:"text-fg-muted",children:"Total"}),e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:t.grandTotal})]})]})}),Vs=l.memo(function({data:t,isDadJoke:n}){const a=n?"🥸":"🎭";return e.jsx(Z,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:a}),e.jsx("div",{className:"min-w-0",children:t.isTwoPart?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.setup}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words mt-2 pt-2 italic",style:{borderTop:"1px solid var(--edge-subtle)"},children:t.delivery})]}):e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.text})})]})})}),Pc=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsx("div",{className:"space-y-1.5",children:t.games.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:a>0?{borderTop:"1px solid var(--edge-subtle)",paddingTop:"6px"}:void 0,children:[e.jsx("span",{className:"text-sm leading-none shrink-0",children:n.sportEmoji}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.away}),n.awayScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.awayScore})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.home}),n.homeScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.homeScore})]})]}),e.jsxs("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded shrink-0 tabular-nums",style:{color:n.isLive?"var(--sys-green)":n.isFinal?"var(--fg-muted)":"var(--sys-blue)",background:n.isLive?"color-mix(in srgb, var(--sys-green) 12%, transparent)":n.isFinal?"color-mix(in srgb, var(--fg-muted) 10%, transparent)":"color-mix(in srgb, var(--sys-blue) 12%, transparent)"},children:[n.isLive&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full mr-1 align-middle",style:{background:"var(--sys-green)",animation:"pulse 2s ease-in-out infinite"}}),n.status]})]},a))})})}),Tc=l.memo(function({data:t}){var n;return e.jsxs(Z,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-sm leading-none",children:"📊"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:t.title??"Bot Stats"})]}),t.type==="basic"?e.jsxs("div",{className:"space-y-1 text-[11px]",children:[t.commands!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Commands"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.commands})]}),t.replies!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Replies"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.replies})]}),t.topCommand&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top Cmd"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topCommand})]}),t.topUser&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top User"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topUser})]})]}):e.jsx("div",{className:"space-y-1",children:(n=t.entries)==null?void 0:n.map(a=>{const r=t.entries[0].value,i=r>0?a.value/r*100:0;return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsxs("span",{className:"text-fg-muted w-4 text-right tabular-nums shrink-0",children:[a.rank,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between mb-0.5",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:a.name}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums shrink-0 ml-2",children:a.value})]}),e.jsx("div",{className:"w-full h-1 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,background:"var(--sys-blue)"}})})]})]},a.rank)})})]})}),$c=l.memo(function({data:t}){return e.jsx(Z,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:"🐱"}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t})]})})});function Ac({text:s}){return e.jsx(Z,{compact:!0,children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:xl(s)})})}const Fc=l.memo(function({text:t,messageType:n}){const a=l.useMemo(()=>n?Mo(t,n):null,[t,n]);if(a)switch(n){case"weather":return e.jsx(rc,{data:a});case"weather-multiday":return e.jsx(lc,{data:a});case"weather-hourly":return e.jsx(ic,{data:a});case"weather-alert":return e.jsx(uc,{data:a});case"path":return e.jsx(xc,{data:a});case"test":return e.jsx(yc,{data:a});case"aqi":return e.jsx(vc,{data:a});case"solar":return e.jsx(Nc,{data:a});case"hfcond":return e.jsx(kc,{data:a});case"sun":return e.jsx(Sc,{data:a});case"moon":return e.jsx(Ic,{data:a});case"satpass":return e.jsx(_c,{data:a});case"aurora":return e.jsx(Rc,{data:a});case"dice":return e.jsx(Ec,{data:a});case"joke":return e.jsx(Vs,{data:a});case"dadjoke":return e.jsx(Vs,{data:a,isDadJoke:!0});case"sports":return e.jsx(Pc,{data:a});case"stats":return e.jsx(Tc,{data:a});case"catfact":return e.jsx($c,{data:a})}return e.jsx(Ac,{text:t})}),Oc=l.lazy(()=>yn(()=>import("./CompanionPathMap-r_W6gfQA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(s=>({default:s.CompanionPathMap}))),Dc=l.lazy(()=>yn(()=>import("./CompanionEchoMap-C048dCxi.js"),__vite__mapDeps([10,1,2,3,7,8,9])).then(s=>({default:s.CompanionEchoMap}))),Js=e.jsx("div",{className:"rounded-lg bg-elevated flex items-center justify-center",style:{aspectRatio:"16 / 10"},children:e.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})});function Lc(s){const t=new Date(s*1e3),a=Math.floor((new Date().getTime()-t.getTime())/864e5);return a===0?"Today":a===1?"Yesterday":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function zc(s){const t=new Date(s*1e3);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Hc(s){const t=new Map;for(const n of s)n.name&&t.set(n.public_key,n.name);return t}function Bc(s){const t=new Map;for(const n of s)t.set(n.public_key,n);return t}function Wc(s){if(!s)return[];const t=[];for(let n=0;na.public_key.startsWith(s));return(n==null?void 0:n.name)||null}function Qs(s,t){return s.is_outgoing?"You":s.sender_name?s.sender_name:t.get(s.sender_key)??s.sender_key.slice(0,8)}const Gc=new Set(["🎭","🥸"]);function Kc({senderName:s,timestamp:t,signed:n,children:a}){const{emoji:r,cleanName:i}=yt(s),o=bt(i),u=vt(s);return e.jsxs("div",{className:"group flex items-start gap-4 w-full p-2",children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:R("clay-avatar w-9 h-9",r?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":o},children:r||u}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:hl(t)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:i}),n&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]})]}),e.jsx("div",{className:"flex items-end gap-1.5 min-w-0",children:a})]})]})}const qc=l.memo(function({msg:t,contact:n,contacts:a,selfInfo:r,echoCount:i,channelName:o,allMessages:u,children:d}){const[f,c]=l.useState(!1),[x,y]=l.useState(!1),[g,m]=l.useState(0),j=l.useRef(null),k=t.path_len,h=!t.is_outgoing,w=h&&k!=null,E=t.is_outgoing&&t.is_channel&&(i??0)>0,M=(o==null?void 0:o.toLowerCase().includes("wardrive"))??!1,b=l.useMemo(()=>M&&h?Dl(t.text):null,[M,h,t.text]),I=w||E,T=l.useMemo(()=>{const S=[];if(t.path_hops&&t.path_hops.length>0)S.push({hops:t.path_hops,snr:t.path_snr,rssi:t.path_rssi});else if(h&&(n!=null&&n.out_path)){const D=Wc(n.out_path);D.length>0&&S.push({hops:D})}if(t.alternate_paths)for(const D of t.alternate_paths)S.push(D);return S},[t.path_hops,t.path_snr,t.path_rssi,t.alternate_paths,h,n==null?void 0:n.out_path]),_=g1,C=(p==null?void 0:p.snr)??t.msg_snr,v=()=>{y(!0),c(S=>!S)},L=l.useCallback(S=>{var D;S.propertyName==="grid-template-rows"&&(f?(D=j.current)==null||D.scrollIntoView({block:"nearest",behavior:"smooth"}):y(!1))},[f]);return e.jsxs("div",{ref:j,className:R("rounded-xl px-2 py-1 -mx-2 transition-colors duration-150",I&&"hover:bg-subtle-fill cursor-pointer"),onClick:()=>I&&v(),children:[d,I&&e.jsx("div",{className:"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.83,0,0.17,1)]",style:{gridTemplateRows:f?"1fr":"0fr"},onTransitionEnd:L,children:e.jsxs("div",{className:"overflow-hidden",children:[x&&w&&e.jsxs("div",{className:"mt-1.5 ml-13 space-y-1",children:[N&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap",onClick:S=>S.stopPropagation(),children:T.map((S,D)=>e.jsxs("button",{onClick:()=>m(D),className:R("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] transition-colors",D===_?"bg-sys-blue/15 text-sys-blue font-semibold":"bg-subtle-fill text-fg-muted hover:text-fg-secondary"),children:[e.jsx(Je,{className:"w-2.5 h-2.5"}),S.hops.length||k,S.snr!=null&&e.jsxs("span",{className:"ml-0.5 opacity-70",children:[S.snr>0?"+":"",S.snr.toFixed(1)]})]},D))}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(Je,{className:"w-3 h-3 text-fg-muted flex-shrink-0"}),k===0&&!p?e.jsx("span",{className:"text-[10px] text-fg-muted font-medium",children:"Direct"}):p&&p.hops.length>0?p.hops.map((S,D)=>{const $=Uc(S,a);return e.jsxs("span",{className:"contents",children:[D>0&&e.jsx(zl,{className:"w-2.5 h-2.5 text-fg-muted/50 flex-shrink-0"}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-subtle-fill text-[10px]",children:[e.jsx("span",{className:"font-mono text-fg-primary",children:S}),$&&e.jsxs("span",{className:"text-fg-muted",children:["(",$,")"]})]})]},D)}):e.jsxs("span",{className:"text-[10px] text-fg-muted font-medium",children:[k," hop",k>1?"s":""]}),C!=null&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-fg-muted ml-0.5",children:[e.jsx(gl,{className:"w-2.5 h-2.5"}),C>0?"+":"",C.toFixed(1),"dB"]}),(p==null?void 0:p.rssi)!=null&&e.jsxs("span",{className:"text-[10px] text-fg-muted",children:[p.rssi,"dBm"]})]}),p&&p.hops.length>=1&&e.jsx(l.Suspense,{fallback:Js,children:e.jsx(Oc,{hops:p.hops,contacts:a,selfInfo:r,snr:C,wardriveCoords:b??void 0,wardriveSenderName:t.sender_name,channelMessages:M?u:void 0,messageTimestamp:t.timestamp})})]}),x&&E&&e.jsx("div",{className:"mt-1.5",children:e.jsx(l.Suspense,{fallback:Js,children:e.jsx(Dc,{text:t.text,timestamp:t.timestamp,contacts:a})})})]})})]})}),Vc=l.memo(function({messages:t,contacts:n,className:a,conversationKey:r,onRetry:i,onRetryAsFlood:o,onMentionClick:u,historyLoading:d,historyExhausted:f,onLoadOlder:c,channelName:x,contactPubKey:y}){const g=l.useRef(null),m=l.useRef(null),[j,k]=l.useState(!1),h=l.useRef(t.length),w=l.useRef(0),E=l.useRef(r);l.useEffect(()=>{if(r!==E.current){E.current=r,h.current=t.length,w.current=0,k(!1);const $=g.current;$&&($.scrollTop=$.scrollHeight)}},[r,t.length]);const M=l.useMemo(()=>Hc(n),[n]),b=l.useMemo(()=>Bc(n),[n]),I=gt(),T=Xo(t),_=ca(y??""),p=y?b.get(y):void 0,N=l.useMemo(()=>{if(!p)return!1;const $=t.filter(G=>!G.is_outgoing).slice(-5).map(G=>G.text);return Ro(p.name,_,$)},[p,_,t]),{combinedTexts:C,skipIds:v}=l.useMemo(()=>{const $=new Map,G=new Set;for(let O=0;O3)continue;const B=[...q.text][0];if(!B||!Gc.has(B)||[...J.text][0]!==B)continue;const A=J.text.slice(B.length).trimStart();$.set(q.id,q.text+` `+A),G.add(J.id),O++}return{combinedTexts:$,skipIds:G}},[t]);l.useEffect(()=>{var G;const $=g.current;if($){if(t.length>h.current&&w.current>0){const O=$.scrollHeight-w.current;if(O>0&&$.scrollTop<200){$.scrollTop+=O,h.current=t.length,w.current=0;return}}h.current=t.length,j||(G=m.current)==null||G.scrollIntoView({behavior:"smooth"})}},[t.length,j]);const L=l.useCallback(()=>{const $=g.current;if(!$)return;const G=$.scrollHeight-$.scrollTop-$.clientHeight;k(G>100),$.scrollTop<80&&c&&!d&&!f&&(w.current=$.scrollHeight,c())},[c,d,f]),S=l.useCallback(()=>{var $;($=m.current)==null||$.scrollIntoView({behavior:"smooth"}),k(!1)},[]);let D="";return e.jsxs("div",{className:R("relative flex flex-col",a),children:[e.jsxs("div",{ref:g,onScroll:L,className:"flex-1 overflow-y-auto min-h-0 px-4 py-3",style:{contain:"layout style paint"},children:[d&&e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsx(ue,{className:"w-4 h-4 text-fg-muted animate-spin"})}),t.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-sm text-fg-muted",children:f?"No messages yet":"Loading messages…"})}):t.map($=>{if(v.has($.id))return null;const G=zc($.timestamp),O=G!==D;D=G;const q=$.unconfirmed&&$.is_channel&&(T.get($.id)??0)>0,J=$.is_outgoing?$.failed?"failed":$.confirmed||q?"confirmed":$.unconfirmed?"unconfirmed":($.retryAttempt??0)>0?"retrying":$.sent?"sent":"pending":void 0,B=$.is_channel&&$.channel_idx!=null?`ch:${$.channel_idx}`:$.sender_key;return e.jsxs("div",{children:[O&&e.jsx(Fl,{text:Lc($.timestamp)}),e.jsx(qc,{msg:$,contact:b.get($.sender_key),contacts:n,selfInfo:I,echoCount:T.get($.id),channelName:x,allMessages:x!=null&&x.toLowerCase().includes("wardrive")?t:void 0,children:(()=>{if(!$.is_outgoing){const A=Qs($,M);if($.is_channel?la(A):N){const F=C.get($.id)??$.text,W=aa(F);return e.jsx(Kc,{senderName:A,timestamp:$.timestamp,signed:$.txt_type===_s.SignedPlain,children:e.jsx(Fc,{text:F,messageType:W})})}}return e.jsx(Ol,{senderName:Qs($,M),text:$.text,timestamp:$.timestamp,isOutgoing:$.is_outgoing,status:J,onRetry:i&&$.failed?()=>i(B,$.id):void 0,onRetryAsFlood:o&&$.failed&&!$.is_channel?()=>o(B,$.id):void 0,retryAttempt:$.retryAttempt,maxRetries:$.maxRetries,echoCount:T.get($.id),signed:!$.is_outgoing&&$.txt_type===_s.SignedPlain,bubbleVariant:"subtle",onMentionClick:u})})()})]},$.id)}),e.jsx("div",{ref:m})]}),e.jsx("button",{onClick:S,className:R("absolute bottom-4 right-4 w-8 h-8 rounded-full bg-sys-blue flex items-center justify-center shadow-lg","hover:bg-sys-blue/90 transition-all duration-200",j?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:e.jsx(Ll,{className:"w-4 h-4 text-white"})})]})}),Jc=6,Qc=l.memo(function({onSend:t,disabled:n,placeholder:a="Type a message…",className:r,mentionNames:i=[]}){const[o,u]=l.useState(""),[d,f]=l.useState(!1),c=l.useRef(null),[x,y]=l.useState(null),[g,m]=l.useState(-1),[j,k]=l.useState(0),h=l.useMemo(()=>{if(x==null)return[];const _=x.toLowerCase();return i.filter(p=>p.toLowerCase().includes(_)).slice(0,Jc)},[x,i]),w=h.length>0;l.useEffect(()=>{k(0)},[h]);const E=l.useCallback(()=>{y(null),m(-1),k(0)},[]),M=l.useCallback(_=>{var S;if(g<0)return;const p=o.slice(0,g),N=((S=c.current)==null?void 0:S.selectionStart)??o.length,C=o.slice(N),v=`@[${_}] `,L=p+v+C;u(L),E(),requestAnimationFrame(()=>{var $,G;const D=p.length+v.length;($=c.current)==null||$.setSelectionRange(D,D),(G=c.current)==null||G.focus()})},[o,g,E]),b=l.useCallback(async()=>{var p;const _=o.trim();!_||d||n||(f(!0),E(),u(""),await t(_),f(!1),(p=c.current)==null||p.focus())},[o,d,n,t,E]),I=l.useCallback(_=>{const p=_.target.value;u(p);const N=_.target.selectionStart??p.length,C=p.slice(0,N),v=C.lastIndexOf("@");if(v>=0){const L=v>0?C[v-1]:" ";if(/\s/.test(L)||v===0){const S=C.slice(v+1);if(!S.includes(" ")&&!S.includes("[")){y(S),m(v);return}}}E()},[E]),T=l.useCallback(_=>{if(w){if(_.key==="ArrowDown"){_.preventDefault(),k(p=>(p+1)%h.length);return}if(_.key==="ArrowUp"){_.preventDefault(),k(p=>(p-1+h.length)%h.length);return}if(_.key==="Enter"||_.key==="Tab"){_.preventDefault(),M(h[j]);return}if(_.key==="Escape"){_.preventDefault(),E();return}}_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),b())},[b,w,h,j,M,E]);return e.jsxs("div",{className:R("relative flex items-center gap-2 p-3 border-t border-edge-subtle",r),children:[w&&e.jsx("div",{className:"absolute bottom-full left-3 right-3 mb-1 radius-inset surface-elevated depth-raised overflow-hidden z-50",children:h.map((_,p)=>{const N=bt(_),{emoji:C,cleanName:v}=yt(_),L=vt(_);return e.jsxs("button",{onMouseDown:S=>{S.preventDefault(),M(_)},className:R("w-full flex items-center gap-2.5 px-3 py-1.5 text-left transition-colors",p===j?"bg-sys-blue/10":"hover:bg-subtle-fill"),children:[e.jsx("div",{className:R("clay-avatar w-5 h-5",C?"text-xs":"text-white text-[9px] font-bold"),style:{"--avatar-color":N},children:C||L}),e.jsx("span",{className:"text-sm text-fg-primary truncate",children:v})]},_)})}),e.jsx("input",{ref:c,type:"text",value:o,onChange:I,onKeyDown:T,onBlur:()=>{setTimeout(E,150)},placeholder:a,disabled:n,className:"flex-1 min-w-0 w-full px-4 py-3 text-sm radius-inner bg-input-bg border border-input-border text-fg-primary placeholder:text-fg-muted/50 ring-focus-inset hover:border-edge-strong transition-colors"}),e.jsx("button",{onClick:b,disabled:!o.trim()||d||n,className:R("flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center transition-colors",o.trim()&&!n?"clay-send text-white":"bg-subtle-fill text-fg-muted cursor-not-allowed"),children:e.jsx(Sr,{className:"w-4.5 h-4.5 -translate-x-[0.5px] translate-y-[0.5px]",strokeWidth:2.5})})]})}),Kt="pymc_companion_room_pwd_";function Xc(s){try{return localStorage.getItem(`${Kt}${s}`)}catch{return null}}function Yc(s,t){try{localStorage.setItem(`${Kt}${s}`,t)}catch{}}function Xs(s){try{localStorage.removeItem(`${Kt}${s}`)}catch{}}const Zc=l.memo(function({contact:t,loginStatus:n,onLogin:a,className:r}){const[i,o]=l.useState(""),[u,d]=l.useState(!0),[f,c]=l.useState(null),[x,y]=l.useState(!1),g=l.useRef(null),m=l.useRef(!0),j=t.public_key,k=l.useRef(j);k.current!==j&&(k.current=j,y(!1),c(null),o("")),l.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]),l.useEffect(()=>{if(x||n==="success")return;const M=Xc(j);if(!M){y(!0);return}y(!0),(async()=>{const b=await a(j,M);m.current&&(b||(Xs(j),c("Saved password rejected — please re-enter.")))})()},[j,x,n,a]);const h=l.useCallback(async()=>{c(null);const M=await a(j,i);m.current&&(M?u&&i?Yc(j,i):Xs(j):c("Login failed — check your password and try again."))},[j,i,u,a]),w=l.useCallback(M=>{M.key==="Enter"&&(M.preventDefault(),h())},[h]),E=n==="pending";return E&&!i?e.jsxs("div",{className:R("flex-1 flex flex-col items-center justify-center gap-3",r),children:[e.jsx(ue,{className:"w-6 h-6 text-sys-pink animate-spin"}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Connecting to ",t.name||"room server","…"]})]}):e.jsx(oe.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2},className:R("flex-1 flex flex-col items-center justify-center px-6",r),children:e.jsxs("div",{className:"w-full max-w-xs space-y-5",children:[e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-pink bg-sys-pink/8",children:e.jsx(ht,{className:"size-7 text-sys-pink"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"type-body font-medium text-fg-primary",children:t.name||"Room Server"}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Enter the room password to join, or try logging in without one — some servers allow open access."})]})]}),(f||n==="failed")&&e.jsxs("div",{className:"flex items-start gap-2 p-2.5 rounded-lg bg-sys-red/8 border border-sys-red/15",children:[e.jsx(kn,{className:"w-3.5 h-3.5 text-sys-red flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[11px] text-sys-red leading-relaxed",children:f||"Login failed — check your password and try again."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("input",{ref:g,type:"password",value:i,onChange:M=>o(M.target.value),onKeyDown:w,placeholder:"Room password",disabled:E,autoFocus:!0,className:"w-full surface-input rounded-lg px-3 py-2.5 text-sm text-fg-primary placeholder:text-fg-muted/50 focus:outline-none focus:ring-1 focus:ring-sys-pink/40"}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:M=>d(M.target.checked),disabled:E,className:"surface-checkbox w-3.5 h-3.5 rounded accent-sys-pink"}),e.jsx("span",{className:"text-xs text-fg-muted",children:"Remember password"})]}),e.jsxs(U,{color:"pink",className:"w-full justify-center",disabled:E,onClick:h,children:[E?e.jsx(ue,{"data-slot":"icon",className:"animate-spin"}):e.jsx(Pt,{"data-slot":"icon"}),E?"Connecting…":"Login"]})]}),e.jsx("p",{className:"text-[10px] text-fg-muted/60 text-center leading-relaxed",children:"The server determines your permissions based on the password. Admin and guest passwords grant different access levels."})]})})});function Ys(s,t){return[s,t].sort().join("-")}function it(s){return s.substring(0,2)}function ed(s){var n,a;const t=(a=(n=s.traceQuality)==null?void 0:n.composite)==null?void 0:a.mean;return t!=null&&t!==0?Math.max(.1,t+20):Math.max(.1,s.strength*20)}function td(s,t,n,a){const{edgeMap:r}=n;if(r.size===0)return null;const i=new Map;for(const[,b]of r){const I=b.fromHash,T=b.toHash;i.has(I)||i.set(I,[]),i.has(T)||i.set(T,[]),i.get(I).push({neighbor:T,edge:b}),i.get(T).push({neighbor:I,edge:b})}const o=new Set(i.keys()),u=Zs(s,o),d=Zs(t,o);if(!u||!d||u===d)return null;const f=new Map,c=new Map,x=new Set,y=[];for(f.set(u,0),c.set(u,null),y.push({node:u,cost:0});y.length>0;){y.sort((T,_)=>T.cost-_.cost);const b=y.shift();if(x.has(b.node))continue;if(x.add(b.node),b.node===d)break;const I=i.get(b.node)??[];for(const{neighbor:T,edge:_}of I){if(x.has(T))continue;const p=ed(_),N=b.cost+1/p,C=f.get(T)??1/0;N{var L,S;const T=it(b),_=j.get(T);let p=0;const N=g[I],C=Ys(N,b),v=r.get(C);return(S=(L=v==null?void 0:v.traceQuality)==null?void 0:L.composite)!=null&&S.mean?p=v.traceQuality.composite.mean:(v==null?void 0:v.avgSnr)!=null&&(p=v.avgSnr),{hash:b,prefix:T,name:(_==null?void 0:_.name)||null,snr:p}});let w=0,E=0;for(let b=0;b0?w/E:0;return{hops:k.map(it),confidence:M,via:h}}function Zs(s,t){if(t.has(s))return s;const n=it(s);let a=null,r=0;for(const i of t)if(i.startsWith(n)||s.startsWith(i.substring(0,2))){let o=0;const u=Math.min(s.length,i.length);for(let d=0;dr&&(r=o,a=i)}return a}function en(s){switch(s&15){case 1:return"Companion";case 2:return"Repeater";case 3:return"Room Server";default:return"Unknown"}}function tn(s){switch(s&15){case 1:return"blue";case 2:return"green";case 3:return"indigo";default:return"zinc"}}function sd(s){return(s&15)===2}const sn=l.memo(function({contact:t,channel:n,contacts:a=[],selfPubKey:r,embedded:i=!1,onResetPath:o,onRequestStatus:u,onRequestTelemetry:d,onLoginToRepeater:f,onLogoutFromRepeater:c,onGetNeighbours:x,onTraceContactPath:y,onDiscoverPath:g,onExportContact:m,onSetContactPath:j,className:k}){const[h,w]=l.useState({}),E=(t==null?void 0:t.public_key)??null,[M,b]=l.useState(E);if(E!==M&&(b(E),w({})),!t&&!n)return i?null:e.jsx("div",{className:R("flex items-center justify-center h-full",k),children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Select a conversation"})});async function I(N,C){w(L=>({...L,[N]:"loading"}));const v=await C();w(L=>({...L,[N]:v?"done":"error"})),setTimeout(()=>w(L=>({...L,[N]:"idle"})),2e3)}const T=n?e.jsxs("div",{className:"space-y-4",children:[!i&&e.jsxs("div",{className:"flex flex-col items-center gap-2 pb-3 border-b border-edge-subtle",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-sys-indigo/15 flex items-center justify-center shadow-md",children:e.jsx(ze,{className:"size-7 text-sys-indigo"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"type-body font-medium text-fg-primary",children:n.name}),e.jsxs(Le,{color:"indigo",children:["Channel ",n.index]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted w-20",children:"Index"}),e.jsx("span",{className:"font-mono text-fg-primary",children:n.index})]}),e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted w-20",children:"Type"}),e.jsx("span",{className:"text-fg-primary",children:"Broadcast"})]})]}),e.jsx("div",{className:"pt-2 border-t border-edge-subtle",children:e.jsx("p",{className:"type-data-xs text-fg-muted/70",children:"Channel messages are broadcast-encrypted. Sender identity is not available due to MeshCore protocol limitations."})})]}):null,_=t?e.jsxs("div",{className:"space-y-4",children:[!i&&e.jsxs("div",{className:"flex flex-col items-center gap-2 pb-3 border-b border-edge-subtle",children:[e.jsx(id,{contact:t}),e.jsxs("div",{className:"text-center",children:[e.jsxs("h3",{className:"type-body font-medium text-fg-primary flex items-center justify-center gap-1",children:[t.name||"Unknown",e.jsx(an,{pubkey:t.public_key})]}),e.jsx(Le,{color:tn(t.adv_type),children:en(t.adv_type)})]})]}),i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{color:tn(t.adv_type),children:en(t.adv_type)}),e.jsx(an,{pubkey:t.public_key})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted w-20",children:"Public Key"}),e.jsx("span",{className:"font-mono text-fg-primary break-all text-[10px]",children:t.public_key})]}),e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx(Je,{className:"w-3.5 h-3.5 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted",children:"Path Length"}),e.jsx("span",{className:"text-fg-primary ml-auto",children:t.out_path_len})]}),(t.gps_lat!==0||t.gps_lon!==0)&&e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx(Nn,{className:"w-3.5 h-3.5 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted",children:"GPS"}),e.jsxs("span",{className:"text-fg-primary ml-auto font-mono text-[10px]",children:[t.gps_lat.toFixed(5),", ",t.gps_lon.toFixed(5)]})]}),(t.lastmod>0||t.last_advert_timestamp>0)&&e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx(Cn,{className:"w-3.5 h-3.5 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted",children:"Last Heard"}),e.jsx("span",{className:"text-fg-primary ml-auto",children:new Date((t.lastmod||t.last_advert_timestamp)*1e3).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),t.last_advert_timestamp>0&&e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted",children:"Last Advert"}),e.jsx("span",{className:"text-fg-primary ml-auto",children:new Date(t.last_advert_timestamp*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]}),e.jsx(cd,{contact:t,contacts:a,selfPubKey:r,onSetContactPath:j,onDiscoverPath:g,actionState:h,setActionState:w,runAction:I}),e.jsxs("div",{className:"space-y-2 pt-2 border-t border-edge-subtle",children:[e.jsxs(U,{color:h.reset==="done"?"success":h.reset==="error"?"danger":"primary",outline:!0,className:"w-full justify-center",disabled:h.reset==="loading",onClick:()=>I("reset",()=>o(t.public_key)),children:[e.jsx(wn,{"data-slot":"icon"}),h.reset==="loading"?"Resetting…":h.reset==="done"?"Reset!":"Reset Path"]}),e.jsxs(U,{color:h.status==="done"?"success":h.status==="error"?"danger":"primary",outline:!0,className:"w-full justify-center",disabled:h.status==="loading",onClick:()=>I("status",()=>u(t.public_key)),children:[e.jsx(Sn,{"data-slot":"icon"}),h.status==="loading"?"Requesting…":"Request Status"]}),e.jsxs(U,{color:h.telemetry==="done"?"success":h.telemetry==="error"?"danger":"primary",outline:!0,className:"w-full justify-center",disabled:h.telemetry==="loading",onClick:()=>I("telemetry",()=>d(t.public_key)),children:[e.jsx(In,{"data-slot":"icon"}),h.telemetry==="loading"?"Requesting…":"Request Telemetry"]})]}),m&&e.jsxs(U,{color:"primary",outline:!0,className:"w-full justify-center",onClick:()=>m(t.public_key),children:[e.jsx(Gt,{"data-slot":"icon"}),"Export Contact"]}),sd(t.adv_type)&&e.jsxs(e.Fragment,{children:[e.jsx(dd,{pubkey:t.public_key,onLogin:f,onLogout:c,actionState:h,runAction:I}),e.jsx(ud,{pubkey:t.public_key,onGetNeighbours:x,actionState:h,runAction:I}),e.jsx(md,{pubkey:t.public_key,contact:t,onTrace:y,actionState:h,runAction:I})]}),e.jsx(nd,{pubkey:t.public_key}),e.jsx(ld,{pubkey:t.public_key})]}):null,p=T??_;return i?e.jsx("div",{className:k,children:p}):e.jsx("div",{className:R("flex flex-col h-full overflow-y-auto",k),children:e.jsx(ve,{mode:"wait",children:n?e.jsx(oe.div,{variants:Hl,initial:"hidden",animate:"visible",exit:"exit",className:"p-4",children:T},`ch-${n.index}`):t?e.jsx(oe.div,{variants:Bl,initial:"hidden",animate:"visible",exit:"exit",className:"p-4",children:_},`contact-${t.public_key}`):null})})});function nn(s){const t=Math.floor(s/86400),n=Math.floor(s%86400/3600),a=Math.floor(s%3600/60);return t>0?`${t}d ${n}h`:n>0?`${n}h ${a}m`:`${a}m`}function nd({pubkey:s}){const t=Pr(s);return t?e.jsxs(Re,{defaultOpen:!0,className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Ee,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Sn,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Status"})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-1.5 py-1",children:[e.jsx(se,{label:"Battery",value:`${(t.battMilliVolts/1e3).toFixed(2)}V`}),e.jsx(se,{label:"Noise Floor",value:`${t.noiseFloor} dBm`}),e.jsx(se,{label:"Last RSSI",value:`${t.lastRssi} dBm`}),e.jsx(se,{label:"Last SNR",value:`${(t.lastSnr/4).toFixed(1)} dB`}),e.jsx(se,{label:"Uptime",value:nn(t.totalUpTimeSecs)}),e.jsx(se,{label:"Air Time",value:nn(t.totalAirTimeSecs)}),e.jsx(se,{label:"TX Queue",value:String(t.currTxQueueLen)}),e.jsx(se,{label:"Packets Rx",value:String(t.nPacketsRecv)}),e.jsx(se,{label:"Packets Tx",value:String(t.nPacketsSent)}),e.jsx(se,{label:"Flood Rx/Tx",value:`${t.nRecvFlood}/${t.nSentFlood}`}),e.jsx(se,{label:"Direct Rx/Tx",value:`${t.nRecvDirect}/${t.nSentDirect}`}),e.jsx(se,{label:"Dups (D/F)",value:`${t.nDirectDups}/${t.nFloodDups}`}),t.errEvents>0&&e.jsx(se,{label:"Errors",value:String(t.errEvents)})]})})]}):null}function se({label:s,value:t}){return e.jsxs("div",{className:"flex items-center justify-between type-data-xs",children:[e.jsx("span",{className:"text-fg-muted",children:s}),e.jsx("span",{className:"text-fg-primary font-mono text-[10px]",children:t})]})}function ad(s){switch(s){case 100:return"Generic";case 101:return"Luminosity";case 102:return"Presence";case 103:return"Temperature";case 104:return"Humidity";case 115:return"Pressure";case 116:return"Voltage";case 117:return"Current";case 120:return"Percentage";case 125:return"Concentration";case 128:return"Power";case 136:return"GPS";default:return`Type ${s}`}}function rd(s){switch(s){case 103:return"°C";case 104:return"%";case 115:return" hPa";case 116:return"V";case 117:return"A";case 120:return"%";case 125:return" ppm";case 128:return"W";default:return""}}function ld({pubkey:s}){const t=Tr(s);if(!t)return null;const n=jo(t.lppSensorData);return n.length===0?null:e.jsxs(Re,{defaultOpen:!0,className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Ee,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(In,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Telemetry"})]}),e.jsx(Pe,{children:e.jsx("div",{className:"space-y-1.5 py-1",children:n.map((a,r)=>typeof a.value=="object"?e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(se,{label:`Ch${a.channel} GPS Lat`,value:a.value.latitude.toFixed(5)}),e.jsx(se,{label:`Ch${a.channel} GPS Lon`,value:a.value.longitude.toFixed(5)}),e.jsx(se,{label:`Ch${a.channel} GPS Alt`,value:`${a.value.altitude.toFixed(1)}m`})]},r):e.jsx(se,{label:`Ch${a.channel} ${ad(a.type)}`,value:`${typeof a.value=="number"?a.value.toFixed(a.type===103||a.type===116?2:0):a.value}${rd(a.type)}`},r))})})]})}function id({contact:s}){const{emoji:t}=yt(s.name||""),n=bt(s.name||s.public_key),a=s.name?vt(s.name):s.public_key.slice(0,2).toUpperCase();return(s.adv_type&15)===2?e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center shadow-md ring-[1.5px] ring-sys-blue",children:e.jsx(Ke,{className:"size-7 text-sys-blue"})}):(s.adv_type&15)===3?e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center shadow-md ring-[1.5px] ring-sys-pink",children:e.jsx(ht,{className:"size-7 text-sys-pink"})}):e.jsx("div",{className:R("w-14 h-14 clay-avatar",t?"text-2xl":"text-white text-lg font-bold"),style:{"--avatar-color":n},children:t||a})}function an({pubkey:s}){return Ir().get(s)!==!0?null:e.jsx("span",{title:"Ed25519 verified identity",children:e.jsx(Gl,{className:"w-4 h-4 text-sys-green flex-shrink-0"})})}const It=64;function od(s){if(!s)return[];const t=[];for(let n=0;n0,b=od(s.out_path),I=l.useCallback(async()=>{if(!a)return;const p=c.split(",").map(v=>v.trim()).filter(Boolean);if(p.length===0){g("Enter at least one hop");return}if(p.length>It){g(`Max ${It} hops`);return}if(!p.every(v=>/^[0-9a-fA-F]{1,2}$/.test(v))){g("Each hop must be 1-2 hex characters");return}g(null),o(v=>({...v,path:"loading"}));const C=await a(s.public_key,p);o(v=>({...v,path:C?"done":"error"})),C&&f(!1),setTimeout(()=>o(v=>({...v,path:"idle"})),2e3)},[a,c,s.public_key,o]),T=l.useCallback(()=>{if(!n){h("Self identity not available");return}const p=td(n,s.public_key,w,t);p?(j(p),h(null)):(j(null),h("No route found in topology"))},[n,s.public_key,w,t]),_=l.useCallback(async()=>{if(!a||!m)return;o(N=>({...N,path:"loading"}));const p=await a(s.public_key,m.hops);o(N=>({...N,path:p?"done":"error"})),p&&(j(null),h(null)),setTimeout(()=>o(N=>({...N,path:"idle"})),2e3)},[a,m,s.public_key,o]);return e.jsxs(Re,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Ee,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Je,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Path"}),e.jsx("span",{className:"ml-auto text-[10px] text-fg-muted font-mono",children:M?`${E} hop${E>1?"s":""}`:"direct"})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-2 py-1",children:[b.length>0&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsx("span",{className:"text-fg-muted type-data-xs",children:"Route"}),b.map((p,N)=>e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill font-mono text-[10px] text-fg-primary",children:p},N))]}),m&&e.jsxs("div",{className:"space-y-1.5 p-2 rounded-md bg-sys-green/5 border border-sys-green/20",children:[e.jsxs("div",{className:"flex items-center gap-1 type-data-xs text-sys-green",children:[e.jsx(Fs,{className:"w-3 h-3"}),e.jsxs("span",{children:["Auto-route (",m.via.length," hop",m.via.length!==1?"s":"",", ",Math.round(m.confidence*100),"% confidence)"]})]}),e.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:m.via.map((p,N)=>e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1 py-0.5 rounded bg-subtle-fill text-[10px]",children:[e.jsx("span",{className:"font-mono text-fg-primary",children:p.prefix}),p.name&&e.jsxs("span",{className:"text-fg-muted",children:["(",p.name,")"]}),p.snr!==0&&e.jsx("span",{className:R("font-mono",ut(p.snr)),children:p.snr.toFixed(1)})]},N))}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(U,{color:i.path==="done"?"success":"primary",outline:!0,className:"flex-1 justify-center text-xs",disabled:i.path==="loading",onClick:_,children:[e.jsx(Ne,{"data-slot":"icon"}),i.path==="loading"?"Saving…":"Accept"]}),e.jsxs(U,{plain:!0,className:"text-xs",onClick:()=>{j(null),h(null)},children:[e.jsx(ft,{"data-slot":"icon"}),"Dismiss"]})]})]}),k&&!m&&e.jsx("p",{className:"text-[9px] text-sys-amber",children:k}),a&&!m&&e.jsx("div",{className:"flex items-center gap-2",children:d?e.jsxs("div",{className:"space-y-1.5 flex-1",children:[e.jsx("input",{type:"text",value:c,onChange:p=>{x(p.target.value),g(null)},placeholder:"e.g. a3, f7, 1b",className:"w-full surface-input rounded-md px-2 py-1 text-[10px] font-mono text-fg-primary placeholder:text-fg-muted/50"}),e.jsxs("p",{className:"text-[9px] text-fg-muted/60",children:["Comma-separated hex hop bytes (max ",It,")"]}),y&&e.jsx("p",{className:"text-[9px] text-sys-red",children:y}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(U,{color:i.path==="done"?"success":i.path==="error"?"danger":"primary",outline:!0,className:"flex-1 justify-center text-xs",disabled:i.path==="loading"||!c.trim(),onClick:I,children:[e.jsx(Xi,{"data-slot":"icon"}),i.path==="loading"?"Saving…":"Save"]}),e.jsx(U,{plain:!0,className:"text-xs",onClick:()=>{f(!1),g(null)},children:"Cancel"})]})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{f(!0),x(b.length>0?b.join(", "):""),g(null)},className:"text-[10px] text-sys-blue hover:text-sys-blue/80 transition-colors",children:"Edit path…"}),n&&w.edgeMap.size>0&&e.jsxs("button",{onClick:T,className:"inline-flex items-center gap-0.5 text-[10px] text-sys-indigo hover:text-sys-indigo/80 transition-colors",children:[e.jsx(Fs,{className:"w-3 h-3"}),"Auto-route"]}),r&&e.jsxs("button",{onClick:()=>u("discover",()=>r(s.public_key)),disabled:i.discover==="loading",className:R("inline-flex items-center gap-0.5 text-[10px] transition-colors disabled:opacity-50",i.discover==="error"?"text-sys-red":"text-sys-green hover:text-sys-green/80"),children:[e.jsx(Kl,{className:"w-3 h-3"}),i.discover==="loading"?"Discovering…":i.discover==="done"?"Discovered!":i.discover==="error"?"Failed":"Discover"]})]})})]})})]})}function dd({pubkey:s,onLogin:t,onLogout:n,actionState:a,runAction:r}){const[i,o]=l.useState(""),u=Ot(s);return t?e.jsxs(Re,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Ee,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Pt,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Login"}),u!=="idle"&&e.jsx(Le,{color:u==="success"?"green":u==="failed"?"red":"amber",className:"ml-auto text-[9px]",children:u})]}),e.jsx(Pe,{children:e.jsx("div",{className:"space-y-1.5 py-1",children:u==="success"&&n?e.jsxs(U,{color:a.logout==="done"?"success":a.logout==="error"?"danger":"primary",outline:!0,className:"w-full justify-center text-xs",disabled:a.logout==="loading",onClick:()=>r("logout",()=>n(s)),children:[e.jsx(Mr,{"data-slot":"icon"}),a.logout==="loading"?"Disconnecting…":"Disconnect"]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"password",value:i,onChange:d=>o(d.target.value),placeholder:"Repeater password",className:"w-full surface-input rounded-md px-2 py-1 text-[10px] text-fg-primary placeholder:text-fg-muted/50"}),e.jsxs(U,{color:u==="failed"?"danger":"primary",outline:!0,className:"w-full justify-center text-xs",disabled:a.login==="loading"||!i.trim(),onClick:()=>r("login",()=>t(s,i)),children:[e.jsx(Pt,{"data-slot":"icon"}),a.login==="loading"?"Logging in…":"Login"]})]})})})]}):null}function ud({pubkey:s,onGetNeighbours:t,actionState:n,runAction:a}){const r=Rr(s),i=Ot(s);return t?e.jsxs(Re,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Ee,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Rt,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Neighbours"}),r&&e.jsx("span",{className:"ml-auto text-[10px] text-fg-muted",children:r.total})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-1.5 py-1",children:[e.jsxs(U,{color:"primary",outline:!0,className:"w-full justify-center text-xs",disabled:n.neighbours==="loading"||i!=="success",onClick:()=>a("neighbours",()=>t(s)),children:[e.jsx(Rt,{"data-slot":"icon"}),n.neighbours==="loading"?"Loading…":"Get Neighbours"]}),i!=="success"&&e.jsx("p",{className:"text-[9px] text-fg-muted/60",children:"Login required to query neighbours"}),r&&r.neighbours.length>0&&e.jsx("div",{className:"space-y-1",children:[...r.neighbours].sort((o,u)=>u.snr-o.snr).map((o,u)=>e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-primary font-mono text-[10px] w-16 truncate",children:o.name||o.prefixHex.slice(0,8)}),e.jsx("span",{className:"text-fg-muted text-[9px]",children:xd(o.heardAgo)}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 ml-auto",children:[e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-subtle-fill overflow-hidden",children:e.jsx("div",{className:R("h-full rounded-full",pd(o.snr)),style:{width:`${Math.min(100,Math.max(5,(o.snr+20)/35*100))}%`}})}),e.jsx("span",{className:R("font-mono text-[9px] w-8 text-right",ut(o.snr)),children:o.snr.toFixed(1)})]})]},u))})]})})]}):null}function md({pubkey:s,contact:t,onTrace:n,actionState:a,runAction:r}){const i=Er(s);if(!n)return null;const o=t.out_path_len>0;return e.jsxs(Re,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Ee,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Os,{className:"w-3.5 h-3.5 text-sys-indigo"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Trace"}),i&&e.jsxs("span",{className:"ml-auto text-[10px] text-fg-muted",children:[i.pathLen," hops"]})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-1.5 py-1",children:[e.jsxs(U,{color:"primary",outline:!0,className:"w-full justify-center text-xs",disabled:a.trace==="loading"||!o,onClick:()=>r("trace",()=>n(s)),children:[e.jsx(Os,{"data-slot":"icon"}),a.trace==="loading"?"Tracing…":"Trace Path"]}),!o&&e.jsx("p",{className:"text-[9px] text-fg-muted/60",children:"Direct neighbour — no path to trace"}),i&&i.hops.length>0&&e.jsxs("div",{className:"space-y-1",children:[i.hops.map((u,d)=>e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted text-[9px] w-3",children:d+1}),e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill font-mono text-[10px] text-fg-primary",children:u.hash}),u.name&&e.jsx("span",{className:"text-fg-muted text-[10px] truncate",children:u.name}),e.jsxs("span",{className:R("font-mono text-[10px] ml-auto",ut(u.snr)),children:[u.snr.toFixed(1)," dB"]})]},d)),e.jsxs("div",{className:"flex items-center justify-between type-data-xs pt-1 border-t border-edge-subtle",children:[e.jsx("span",{className:"text-fg-muted",children:"Last SNR"}),e.jsxs("span",{className:R("font-mono text-[10px]",ut(i.lastSnr)),children:[i.lastSnr.toFixed(1)," dB"]})]})]})]})})]})}function ut(s){return s>5?"text-sys-green":s>0?"text-sys-amber":"text-sys-red"}function pd(s){return s>5?"bg-sys-green":s>0?"bg-sys-amber":"bg-sys-red"}function xd(s){return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}const rn=128,ln=/^[0-9a-fA-F]+$/;function hd({open:s,onClose:t}){const n=ae(S=>S.exportPrivateKey),a=ae(S=>S.importPrivateKey),[r,i]=l.useState("export"),[o,u]=l.useState(null),[d,f]=l.useState(!1),[c,x]=l.useState(!1),[y,g]=l.useState(""),[m,j]=l.useState(!1),[k,h]=l.useState(!1),[w,E]=l.useState(!1),[M,b]=l.useState(!1),[I,T]=l.useState(null),[_,p]=l.useState(!1);s!==_&&(p(s),s&&(i("export"),u(null),f(!1),x(!1),g(""),j(!1),h(!1),E(!1),b(!1),T(null)));const N=l.useCallback(async()=>{f(!0),T(null),b(!1);try{const S=await n();S==="disabled"?b(!0):u(S.hex)}catch(S){T(S instanceof Error?S.message:"Export failed")}finally{f(!1)}},[n]),C=l.useCallback(async()=>{if(o)try{await navigator.clipboard.writeText(o),x(!0),setTimeout(()=>x(!1),2e3)}catch{T("Failed to copy to clipboard")}},[o]),v=y.length===rn&&ln.test(y),L=l.useCallback(async()=>{h(!1),j(!0),T(null),b(!1);try{await a(y)==="disabled"?b(!0):E(!0)}catch(S){T(S instanceof Error?S.message:"Import failed")}finally{j(!1)}},[a,y]);return e.jsxs(e.Fragment,{children:[e.jsxs(Ce,{open:s,onClose:t,size:"md",children:[e.jsx(Te,{icon:e.jsx(Mn,{className:"w-5 h-5"}),title:"Key Management",onClose:t}),e.jsxs(Se,{children:[M&&e.jsxs("div",{className:"flex items-start gap-2.5 p-3 mb-4 rounded-lg bg-sys-amber/10 border border-sys-amber/20",children:[e.jsx($r,{className:"w-4 h-4 text-sys-amber flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"type-body-sm font-medium text-sys-amber",children:"Key operations disabled"}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-0.5",children:"This device's firmware has disabled private key export/import. This is a security setting configured at build time and cannot be changed remotely."})]})]}),e.jsx("div",{className:"flex gap-1 mb-4 p-0.5 rounded-lg bg-subtle-fill",children:["export","import"].map(S=>e.jsxs("button",{onClick:()=>{i(S),T(null)},className:R("flex-1 flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-md text-sm font-medium transition-colors",r===S?"bg-surface text-fg-primary shadow-sm":"text-fg-muted hover:text-fg-secondary"),children:[S==="export"?e.jsx(qe,{className:"w-3.5 h-3.5"}):e.jsx(Gt,{className:"w-3.5 h-3.5"}),S==="export"?"Export":"Import"]},S))}),r==="export"&&e.jsx("div",{className:"space-y-4",children:o?e.jsxs(ce,{children:[e.jsx(de,{children:"Private Key (64 bytes)"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"p-3 rounded-lg bg-subtle-fill border border-edge-subtle font-mono text-xs break-all select-all leading-relaxed",children:o}),e.jsx("button",{onClick:C,className:"absolute top-2 right-2 p-1.5 rounded-md hover:bg-subtle-fill-strong transition-colors",title:"Copy to clipboard",children:c?e.jsx(Ne,{className:"w-3.5 h-3.5 text-sys-green"}):e.jsx(Dt,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),e.jsx(Ie,{children:e.jsxs("span",{className:"flex items-start gap-1.5 mt-1",children:[e.jsx(Ve,{className:"w-3 h-3 text-sys-amber flex-shrink-0 mt-0.5"}),"This key controls your mesh identity. Never share it."]})})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx("p",{className:"type-body-sm text-fg-muted mb-3",children:"Export your device's private key for backup. Keep it secret — anyone with this key can impersonate your mesh identity."}),e.jsx(U,{color:"primary",onClick:N,disabled:d||M,children:d?"Exporting…":"Export Private Key"})]})}),r==="import"&&e.jsx("div",{className:"space-y-4",children:w?e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-sys-green/10 mx-auto mb-3 flex items-center justify-center",children:e.jsx(Ne,{className:"w-5 h-5 text-sys-green"})}),e.jsx("p",{className:"type-body-sm font-medium text-fg-primary",children:"Key imported successfully"}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:"The device identity has been updated. You may need to reconnect."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Private Key (128 hex characters)"}),e.jsx("textarea",{value:y,onChange:S=>g(S.target.value.replace(/\s/g,"")),placeholder:"Paste your 128-character hex private key here…",rows:3,className:"w-full p-3 rounded-lg bg-subtle-fill border border-edge-subtle font-mono text-xs resize-none focus:outline-none focus:ring-2 focus:ring-sys-blue/50 placeholder:text-fg-muted/40"}),e.jsxs(Ie,{children:[y.length>0&&!v&&e.jsx("span",{className:"text-sys-red",children:ln.test(y)?`${y.length}/${rn} characters`:"Invalid characters — hex only (0-9, a-f)"}),y.length>0&&v&&e.jsx("span",{className:"text-sys-green",children:"Valid key format ✓"})]})]}),e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-lg bg-sys-red/5 border border-sys-red/10",children:[e.jsx(Ve,{className:"w-4 h-4 text-sys-red flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"type-data-xs text-fg-muted",children:["Importing a key ",e.jsx("strong",{className:"text-fg-secondary",children:"permanently replaces"})," the device's current identity. All existing contacts will see you as a new node."]})]})]})}),I&&e.jsx("p",{className:"type-data-xs text-sys-red mt-3",children:I})]}),e.jsxs($e,{children:[e.jsx(U,{plain:!0,onClick:t,children:"Close"}),r==="import"&&!w&&e.jsx(U,{color:"danger",onClick:()=>h(!0),disabled:!v||m||M,children:m?"Importing…":"Import Key"})]})]}),e.jsx(_n,{isOpen:k,title:"Replace Device Identity?",message:"This will permanently replace the device's Ed25519 private key. The current identity cannot be recovered unless you have a backup. Continue?",confirmLabel:"Replace Key",cancelLabel:"Cancel",variant:"danger",onConfirm:L,onCancel:()=>h(!1)})]})}function ma(s){return s.settings??{}}const pa="pymc_companion_recent_regions",qt=8;function xa(){try{const s=localStorage.getItem(pa);return s?JSON.parse(s).slice(0,qt):[]}catch{return[]}}function fd(s){try{localStorage.setItem(pa,JSON.stringify(s.slice(0,qt)))}catch{}}function gd(s){const t=xa().filter(a=>a!==s);t.unshift(s);const n=t.slice(0,qt);return fd(n),n}function on(s){return s.toLowerCase().replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function yd({open:s,onClose:t,mode:n,identity:a,onSave:r}){const i=n==="edit"&&a,[o,u]=l.useState(""),[d,f]=l.useState(""),[c,x]=l.useState(""),[y,g]=l.useState(!1),[m,j]=l.useState(""),[k,h]=l.useState(5e3),[w,E]=l.useState("0.0.0.0"),[M,b]=l.useState(!1),[I,T]=l.useState(null),[_,p]=l.useState(""),N=`${s}-${(a==null?void 0:a.name)??""}-${n}`;if(N!==_)if(p(N),T(null),b(!1),g(!1),i){const v=ma(a);u(a.name),f(""),x(a.identity_key??""),j(v.node_name??a.name),h(v.tcp_port??5e3),E(v.bind_address??"0.0.0.0")}else u(""),f(""),x(""),j(""),h(5e3),E("0.0.0.0");const C=l.useCallback(async()=>{var v,L;if(!i&&!o.trim()){T("Name is required");return}b(!0),T(null);try{if(i){const S={name:a.name,new_name:d,identity_key:c,type:"companion",settings:{node_name:m,tcp_port:k,bind_address:w}},D=await Br(S);if(!D.success&&!((v=D.data)!=null&&v.message))throw new Error(D.error||"Failed")}else{const S={name:o.trim(),identity_key:c,type:"companion",settings:{node_name:m||o.trim(),tcp_port:k??5e3,bind_address:w||"0.0.0.0"}},D=await Wr(S);if(!D.success&&!((L=D.data)!=null&&L.message))throw new Error(D.error||"Failed")}await r(),t()}catch(S){T(S instanceof Error?S.message:"Operation failed")}finally{b(!1)}},[i,a,o,d,c,m,k,w,r,t]);return e.jsxs(Ce,{open:s,onClose:t,size:"md",children:[e.jsx(Te,{icon:i?void 0:e.jsx(je,{className:"w-5 h-5"}),title:i?"Edit Companion":"Add Companion",onClose:t}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-5",children:[i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{color:a.registered?"green":"red",children:a.registered?"Active":"Inactive"}),a.hash&&e.jsx("span",{className:"type-data-xs text-fg-muted",children:a.hash})]}),i?e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Current Name"}),e.jsx(he,{value:a.name,disabled:!0})]}),e.jsxs(ce,{children:[e.jsxs(de,{children:["New Name ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(Optional)"})]}),e.jsx(he,{value:d,onChange:v=>f(v.target.value),placeholder:"Leave empty to keep current name"})]})]}):e.jsxs(ce,{children:[e.jsx(de,{children:"Name"}),e.jsx(he,{value:o,onChange:v=>u(v.target.value),placeholder:"e.g., TestCompanion",autoFocus:!0})]}),e.jsxs(ce,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(de,{children:["Identity Key ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(Optional)"})]}),e.jsx("button",{type:"button",onClick:()=>g(v=>!v),className:"type-data-xs text-fg-muted underline hover:text-fg-secondary",children:y?"Hide":"Show"})]}),y&&e.jsxs(e.Fragment,{children:[e.jsx(he,{value:c,onChange:v=>x(v.target.value),placeholder:i?"Leave empty to keep current key":"Leave empty to auto-generate",className:"font-mono"}),e.jsx(Ie,{children:"32 or 64 bytes hex."})]})]}),e.jsxs(ce,{children:[e.jsx(de,{children:"Node Name"}),e.jsx(he,{value:m,onChange:v=>j(v.target.value),placeholder:"Display name"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"TCP Port"}),e.jsx(he,{type:"number",min:1,max:65535,value:k,onChange:v=>h(parseInt(v.target.value,10)||5e3)})]}),e.jsxs(ce,{children:[e.jsx(de,{children:"Bind Address"}),e.jsx(he,{value:w,onChange:v=>E(v.target.value),placeholder:"0.0.0.0"})]})]}),I&&e.jsx("p",{className:"type-data-xs text-sys-red",children:I})]})}),e.jsxs($e,{children:[e.jsx(U,{plain:!0,onClick:t,children:"Cancel"}),e.jsx(U,{color:"primary",onClick:C,disabled:M,children:M?"Saving…":i?"Save":"Create"})]})]})}function bd(){const s=zr(),t=vn(),{setFloodScope:n,clearFloodScope:a}=ae.getState(),[r,i]=l.useState(""),[o,u]=l.useState(!1),[d,f]=l.useState(xa),[c,x]=l.useState(null),y=l.useRef(null),g=r.trim()?on(r.trim()):"",m=l.useCallback(async h=>{const w=on(h);if(!w)return;u(!0),x(null),i(""),f(gd(w)),await n(w)||x("Failed to set transport key on device"),u(!1)},[n]),j=l.useCallback(async()=>{u(!0),x(null),await a()||x("Failed to clear transport key on device"),u(!1)},[a]),k=l.useCallback(h=>{h.key==="Enter"&&g&&(h.preventDefault(),m(g))},[g,m]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-lg bg-sys-blue/5 border border-sys-blue/10",children:[e.jsx(ct,{className:"w-4 h-4 text-sys-blue flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"type-data-xs text-fg-muted",children:["A transport key filters which flood packets the companion device forwards. Set a region name to derive a SHA-256 transport key from ",e.jsx("code",{className:"text-fg-secondary",children:"#name"}),". Only one transport key can be active at a time."]})]}),e.jsx("div",{className:"bg-subtle-fill radius-inner p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rn,{className:"w-4 h-4 text-fg-muted"}),e.jsx("span",{className:"type-body-sm text-fg-muted",children:"Active Transport Key"})]}),s?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-sys-green/10 text-sys-green type-data font-medium",children:[e.jsx(Nn,{className:"w-3.5 h-3.5"}),"#",s]}),e.jsx("button",{onClick:j,disabled:o||!t,className:"p-1.5 rounded-lg hover:bg-sys-red/10 transition-colors disabled:opacity-50",title:"Clear transport key",children:o?e.jsx(ue,{className:"w-3.5 h-3.5 text-fg-muted animate-spin"}):e.jsx(ft,{className:"w-3.5 h-3.5 text-fg-muted hover:text-sys-red"})})]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-subtle-fill-strong text-fg-muted type-data",children:[e.jsx(Hr,{className:"w-3.5 h-3.5"}),"Global (no filter)"]})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"type-label text-fg-muted block mb-2",children:"Set Region"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted/50 type-data",children:"#"}),e.jsx("input",{ref:y,type:"text",value:r,onChange:h=>i(h.target.value),onKeyDown:k,placeholder:"e.g., south-bay",disabled:!t,className:"w-full pl-7 pr-3 py-2 rounded-lg bg-subtle-fill border border-edge-subtle text-sm text-fg-primary placeholder:text-fg-muted/40 focus:outline-none focus:ring-2 focus:ring-sys-blue/50 disabled:opacity-50"})]}),e.jsxs(U,{color:"primary",onClick:()=>m(g),disabled:!g||o||!t,children:[o?e.jsx(ue,{"data-slot":"icon",className:"animate-spin"}):null,"Set"]})]}),g&&g!==r.trim().toLowerCase()&&e.jsxs("p",{className:"type-data-xs text-fg-muted mt-1",children:["Will set as ",e.jsxs("span",{className:"font-mono text-fg-secondary",children:["#",g]})]})]}),d.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Cn,{className:"w-3.5 h-3.5 text-fg-muted/50"}),e.jsx("span",{className:"type-label text-fg-muted",children:"Recent Regions"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.map(h=>e.jsx("button",{onClick:()=>m(h),disabled:o||!t,className:R("inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",h===s?"bg-sys-green/10 text-sys-green":"bg-subtle-fill hover:bg-subtle-fill-strong text-fg-secondary"),children:e.jsxs("span",{className:"font-mono",children:["#",h]})},h))})]}),!t&&e.jsx("p",{className:"type-data-xs text-sys-amber",children:"Companion device is not connected. Connect to a companion to manage transport keys."}),c&&e.jsx("p",{className:"type-data-xs text-sys-red",children:c})]})}function cn({open:s,onClose:t,onRefresh:n}){const[a,r]=l.useState("companions"),[i,o]=l.useState(null),[u,d]=l.useState(!0),[f,c]=l.useState(!1),[x,y]=l.useState("create"),[g,m]=l.useState(null),[j,k]=l.useState(null),[h,w]=l.useState(!1),[E,M]=l.useState(!1),b=l.useRef(!0);l.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]);const[I,T]=l.useState(!1);s!==I&&(T(s),s&&r("companions"));const _=l.useCallback(async()=>{d(!0);try{const B=await Ar();b.current&&B.success&&B.data&&o(B.data)}catch{}finally{b.current&&d(!1)}},[]);l.useEffect(()=>{s&&_()},[s,_]);const p=(i==null?void 0:i.configured_companions)??[],N=l.useCallback(async()=>{await _(),n==null||n()},[_,n]),C=l.useCallback(async()=>{if(j){w(!0);try{await Fr(j.name,"companion"),await N()}catch{}finally{b.current&&(w(!1),k(null))}}},[j,N]),v=Or(),L=bn(),{setCompanionPaused:S}=ae.getState(),[D,$]=l.useState({});l.useEffect(()=>{if(!(i!=null&&i.configured_companions))return;const B={};for(const A of i.configured_companions)B[A.name]=Dr(A.name);$(B)},[i]);const G=l.useCallback(B=>B===L?v:D[B]??!1,[L,v,D]),[O,q]=l.useState(null),J=l.useCallback(async(B,A)=>{q(B);try{await S(B,!A),$(z=>({...z,[B]:!A}))}finally{b.current&&q(null)}},[S]);return e.jsxs(e.Fragment,{children:[e.jsxs(Ce,{open:s,onClose:t,size:"md",children:[e.jsx(Te,{icon:e.jsx(je,{className:"w-5 h-5"}),title:"Companion Configuration",onClose:t}),e.jsxs(Se,{children:[e.jsx("div",{className:"flex gap-1 mb-4 p-0.5 rounded-lg bg-subtle-fill",children:[["companions","Companions",je],["transport","Transport Key",Rn]].map(([B,A,z])=>e.jsxs("button",{onClick:()=>r(B),className:R("flex-1 flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-md text-sm font-medium transition-colors",a===B?"bg-surface text-fg-primary shadow-sm":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(z,{className:"w-3.5 h-3.5"}),A]},B))}),a==="companions"&&e.jsx(e.Fragment,{children:u?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(ue,{className:"w-5 h-5 animate-spin text-sys-blue mr-2"}),e.jsx("span",{className:"text-sm text-fg-muted",children:"Loading…"})]}):p.length>0?e.jsx("div",{className:"space-y-3",children:p.map(B=>{const A=ma(B),z=G(B.name),F=!z&&B.registered,W=O===B.name;return e.jsxs("div",{className:R("bg-subtle-fill radius-inner p-3 hover:bg-subtle-fill-strong transition-base",z&&"opacity-60"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:R("h-2 w-2 rounded-full flex-shrink-0",F?"bg-sys-green":z?"bg-fg-muted":"bg-sys-red")}),e.jsx("h3",{className:"type-body-sm text-fg-primary font-medium truncate flex-1",children:B.name}),e.jsx(Le,{color:F?"green":z?"zinc":"red",children:z?"Paused":F?"Active":"Inactive"}),e.jsx(U,{color:"primary",plain:!0,onClick:()=>{m(B),y("edit"),c(!0)},children:e.jsx(ql,{"data-slot":"icon"})}),e.jsx(Lr,{enabled:!z,onChange:Q=>J(B.name,Q),size:"sm",disabled:W,status:W?"loading":"idle",tooltip:z?"Resume connection":"Pause connection",dangerOff:!0}),e.jsx(U,{color:"danger",plain:!0,onClick:()=>k(B),children:e.jsx(Qe,{"data-slot":"icon"})})]}),e.jsxs("div",{className:"mt-1.5 type-data-xs text-fg-muted pl-5",children:[A.node_name||B.name," · Port ",A.tcp_port??5e3," · ",A.bind_address||"0.0.0.0"]})]},B.name)})}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-subtle-fill mx-auto mb-3 flex items-center justify-center",children:e.jsx(je,{className:"w-5 h-5 text-fg-muted/50"})}),e.jsx("p",{className:"text-sm text-fg-muted",children:"No companions configured"})]})}),a==="transport"&&e.jsx(bd,{})]}),e.jsxs($e,{children:[a==="companions"&&e.jsx(U,{plain:!0,onClick:()=>M(!0),title:"Key Management",children:e.jsx(Mn,{"data-slot":"icon"})}),e.jsx("div",{className:"flex-1"}),e.jsx(U,{plain:!0,onClick:t,children:"Close"}),a==="companions"&&e.jsxs(U,{color:"primary",onClick:()=>{m(null),y("create"),c(!0)},children:[e.jsx(Xe,{"data-slot":"icon"})," Add Companion"]})]})]}),e.jsx(yd,{open:f,onClose:()=>c(!1),mode:x,identity:g,onSave:N}),e.jsx(_n,{isOpen:!!j,title:"Delete Companion",message:`Delete '${j==null?void 0:j.name}'? A service restart is required.`,confirmLabel:h?"Deleting…":"Delete",cancelLabel:"Cancel",variant:"danger",onConfirm:C,onCancel:()=>k(null)}),e.jsx(hd,{open:E,onClose:()=>M(!1)})]})}const vd=l.memo(function({companions:t,selected:n,onSelect:a}){return t.length<2?null:e.jsx("select",{value:n??"",onChange:r=>a(r.target.value),className:"px-2 py-1 text-sm bg-transparent border border-edge-subtle radius-inner text-fg-primary focus:outline-none focus:ring-1 focus:ring-sys-blue/40",children:t.map(r=>e.jsx("option",{value:r.companion_name,children:r.node_name||r.companion_name},r.companion_name))})}),Ge=[{value:"Chat Node",label:"Companions"},{value:"Room Server",label:"Room Servers"},{value:"Repeater",label:"Repeaters"}],jd=[{value:"all",label:"All time"},{value:"24h",label:"Last 24 hours"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"}];function Nd(s){switch(s){case"24h":return 24;case"7d":return 168;case"30d":return 720;default:return}}function wd({open:s,onClose:t,companionName:n,onImport:a}){const[r,i]=l.useState(()=>new Set(Ge.map(M=>M.value))),[o,u]=l.useState("all"),[d,f]=l.useState(""),[c,x]=l.useState(!1),[y,g]=l.useState(null),[m,j]=l.useState(s);s!==m&&(j(s),s&&(i(new Set(Ge.map(M=>M.value))),u("all"),f(""),x(!1),g(null)));const k=r.size===Ge.length;function h(M){i(b=>{const I=new Set(b);return I.has(M)?I.delete(M):I.add(M),I})}function w(){i(k?new Set:new Set(Ge.map(M=>M.value)))}const E=l.useCallback(async()=>{if(!(r.size===0||c)){x(!0),g(null);try{const M={types:[...r],hours:Nd(o)},b=parseInt(d,10);b>0&&(M.limit=b);const I=await a(M);g(I)}finally{x(!1)}}},[r,o,d,c,a]);return e.jsxs(Ce,{open:s,onClose:t,size:"sm",children:[e.jsx(Te,{title:"Import repeater contacts",onClose:t}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("p",{className:"text-sm text-fg-secondary",children:["Seed ",e.jsx("strong",{className:"text-fg-primary",children:n})," with contacts from the repeater's adverts. Results are ordered by most recent first."]}),e.jsxs(ce,{children:[e.jsx(de,{children:"Contact types"}),e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx(Ms,{checked:k,indeterminate:r.size>0&&!k,onChange:w,label:"All types",size:"sm"}),e.jsx("div",{className:"ml-6 space-y-1.5",children:Ge.map(M=>e.jsx(Ms,{checked:r.has(M.value),onChange:()=>h(M.value),label:M.label,size:"sm"},M.value))})]})]}),e.jsx(lo,{label:"Recency",value:o,onChange:u,options:jd,orientation:"horizontal",size:"sm"}),e.jsxs(ce,{children:[e.jsxs(de,{children:["Import at most ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(optional)"})]}),e.jsx(he,{type:"number",min:1,value:d,onChange:M=>f(M.target.value),placeholder:"No limit",className:"mt-1"}),e.jsx(Ie,{children:"Leave empty for no cap."})]}),y&&e.jsxs("p",{className:"text-sm text-sys-green font-medium",children:["Imported ",y.added," new contact",y.added!==1?"s":""," (",y.total," total)"]})]})}),e.jsxs($e,{children:[e.jsx(U,{plain:!0,onClick:t,children:"Cancel"}),e.jsx(U,{color:"primary",onClick:E,disabled:c||r.size===0,children:c?e.jsxs(e.Fragment,{children:[e.jsx(ue,{"data-slot":"icon",className:"animate-spin"}),"Importing…"]}):"Import"})]})]})}const kd=["alameda","alpine","amador","butte","calaveras","colusa","contracosta","contra-costa","delnorte","del-norte","eldorado","el-dorado","fresno","glenn","humboldt","imperial","inyo","kern","kings","lake","lassen","losangeles","los-angeles","la-county","madera","marin","mariposa","mendocino","merced","modoc","mono","monterey","napa","nevada","orange","oc","placer","plumas","riverside","sacramento","sac","sanbenito","san-benito","sanbernardino","san-bernardino","sandiego","san-diego","sd","sanfrancisco","san-francisco","sf","sanjoaquin","san-joaquin","sanluisobispo","san-luis-obispo","slo","sanmateo","san-mateo","santabarbara","santa-barbara","sb","santaclara","santa-clara","santacruz","santa-cruz","shasta","sierra","siskiyou","solano","sonoma","stanislaus","sutter","tehama","trinity","tulare","tuolumne","ventura","yolo","yuba","losangeles","los-angeles","la","hollywood","westhollywood","west-hollywood","weho","beverlyhills","beverly-hills","santamonica","santa-monica","culvercity","culver-city","marinadelrey","marina-del-rey","venice","venicebeach","venice-beach","malibu","palisades","pacificpalisades","pacific-palisades","brentwood","westwood","westla","west-la","dtla","downtown","downtownla","downtown-la","koreatown","ktown","silverlake","silver-lake","losfeliz","los-feliz","echopark","echo-park","eastla","east-la","boyleheights","boyle-heights","highlandpark","highland-park","eaglerock","eagle-rock","pasadena","southpasadena","south-pasadena","glendale","burbank","tolucalake","toluca-lake","studiocity","studio-city","shermanoaks","sherman-oaks","encino","tarzana","reseda","vannuys","van-nuys","northhollywood","north-hollywood","noho","woodlandhills","woodland-hills","calabasas","topanga","agourahills","agoura-hills","thousandoaks","thousand-oaks","simivalley","simi-valley","simi","moorpark","camarillo","oxnard","porthueneme","port-hueneme","ventura","ojai","sfv","sfvalley","sf-valley","thevalley","the-valley","sanfernando","san-fernando","sanfernandovalley","san-fernando-valley","pacoima","sylmar","sunland","tujunga","sunlandtujunga","lakeviewterrace","lakeview-terrace","shadowhills","shadow-hills","chatsworth","northridge","granadahills","granada-hills","missionhills","mission-hills","panoramacity","panorama-city","arleta","sunvalley","sun-valley","santaclarita","santa-clarita","scv","valencia","newhall","saugus","canyoncountry","canyon-country","castaic","stevenson","stevensonranch","stevenson-ranch","acton","agua-dulce","aguadulce","palmdale","lancaster","antelopevalley","antelope-valley","av","avmesh","av-mesh","quartz-hill","quartzhill","littlerock","little-rock","pearblossom","pear-blossom","lakelosangeles","lake-los-angeles","highdesert","high-desert","hd","hdmesh","hd-mesh","victorville","hesperia","applevalley","apple-valley","barstow","adelanto","phelan","pinon-hills","pinonhills","wrightwood","bigbear","big-bear","lakeisabella","lake-isabella","inlandempire","inland-empire","ie","riverside","corona","moreno-valley","morenovalley","fontana","ontario","rancho","ranchocucamonga","rancho-cucamonga","upland","claremont","pomona","azusa","glendora","covina","westcovina","west-covina","diamondbar","diamond-bar","chino","chinohills","chino-hills","sanbernardinocity","rialto","colton","redlands","yuciapa","yucaipa","beaumont","banning","hemet","perris","menifee","temecula","murrieta","wildomar","lakeland","lakeelsinore","lake-elsinore","orangecounty","orange-county","oc","anaheim","fullerton","santaana","santa-ana","irvine","costamesa","costa-mesa","newportbeach","newport-beach","newport","huntingtonbeach","huntington-beach","hb","surfcity","surf-city","lagunabeach","laguna-beach","lagunaniguel","laguna-niguel","sanclemente","san-clemente","danapoint","dana-point","missionviejo","mission-viejo","lakeforest","lake-forest","rsm","ranchosantamargarita","rancho-santa-margarita","alisoviejo","aliso-viejo","tustin","orange","yorbalinda","yorba-linda","brea","lahabra","la-habra","placentia","buenapark","buena-park","cypress","losalamitojos","sealbeach","seal-beach","gardengrove","garden-grove","westminster","stanton","fountainvalley","sandiego","san-diego","sd","sdmesh","sd-mesh","lajolla","la-jolla","pacificbeach","pacific-beach","pb","missionbeach","mission-beach","oceanbeach","ocean-beach","ob","pointloma","point-loma","coronado","hillcrest","northpark","north-park","southpark","south-park","normalheights","normal-heights","cityheights","city-heights","lamesa","la-mesa","elcajon","el-cajon","santee","lakeside","poway","ramona","julian","alpine","escondido","sanmarcos","san-marcos","vista","oceanside","carlsbad","encinitas","delmar","del-mar","solanabeanch","solana-beach","chulavista","chula-vista","nationalcity","national-city","imperialbeach","imperial-beach","ib","southbay","south-bay","torrance","gardena","hawthorne","lawndale","redondo","redondobeach","hermosa","hermosabeach","manhattan","manhattanbeach","manhattan-beach","elsegundo","el-segundo","palosverdes","palos-verdes","pv","ranchopalosverdes","rancho-palos-verdes","sanpedro","san-pedro","wilmington","carson","compton","longbeach","long-beach","lb","signalhill","signal-hill","lakewood","cerritos","artesia","lamirada","la-mirada","norwalk","whittier","lahabra","la-habra-heights","downey","bellflower","paramount","southgate","south-gate","lynwood","bellgardens","bell-gardens","cudahy","huntingtonpark","maywood","vernon","commerce","montebello","picorivera","pico-rivera","montereypark","monterey-park","alhambra","sanmarinno","san-marino","arcadia","monrovia","duarte","azusa","irwindale","baldwinpark","baldwin-park","elmonbte","el-monte","southelmonte","south-el-monte","rosemead","temple-city","templecity","sangabriel","san-gabriel","santabarbara","santa-barbara","sb","goleta","carpinteria","montecito","islavista","isla-vista","iv","ucsb","slo","sanluisobispo","san-luis-obispo","morrobay","morro-bay","pismobeach","pismo-beach","pismo","shellbeach","shell-beach","arroyogrande","arroyo-grande","groverbeach","grover-beach","oceano","santamaria","santa-maria","lompoc","vandenberg","solvang","buellton","losalamos","los-alamos","atascadero","pasorobles","paso-robles","paso","cambria","cayucos","sansiemon","san-simeon","hearst","fresno","clovis","visalia","tulare","hanford","porterville","bakersfield","bako","delano","wasco","shafter","taft","tehachapi","stockton","tracy","manteca","lodi","modesto","turlock","merced","madera","chowchilla","losabnos","los-banos","sacramento","sac","sactown","westsacramento","west-sacramento","westsac","elkgrove","elk-grove","folsom","ranchocordova","rancho-cordova","roseville","rocklin","lincoln","citrus-heights","citrusheights","fair-oaks","fairoaks","carmichael","orangevale","davis","woodland","dixon","vacaville","fairfield","vallejo","bayarea","bay-area","sfbay","sf-bay","sanfrancisco","san-francisco","sf","sfmesh","sf-mesh","oakland","eastbay","east-bay","berkeley","emeryville","alameda","sanleandro","san-leandro","hayward","fremont","unioncity","union-city","newark","milpitas","sanjose","san-jose","sj","campbell","saratoga","losgartos","los-gatos","sunnyvale","santaclara","santa-clara","cupertino","mountainview","mountain-view","paloalto","palo-alto","menlopark","menlo-park","atherton","redwoodcity","redwood-city","sancarlos","san-carlos","belmont","sanmateo","san-mateo","fostercity","foster-city","burlingame","sanbruno","san-bruno","southsanfrancisco","ssf","dalycity","daly-city","pacifica","halfmoonbay","half-moon-bay","hmb","santacruz","santa-cruz","capitola","scottsvalley","scotts-valley","watsonville","aptos","soquel","concord","walnutcreek","walnut-creek","pleasant-hill","pleasanthill","martinez","antioch","pittsburg","brentwood","oakley","discovery-bay","livermore","pleasanton","dublin","sanramon","san-ramon","danville","richmond","sanpablo","san-pablo","pinole","hercules","napa","sonoma","petaluma","santarosa","santa-rosa","rohnertpark","novato","sanrafael","san-rafael","sausalito","tiburon","millvalley","mill-valley","redding","chico","oroville","paradise","reddingbluff","redbluff","red-bluff","shasta","mtshasta","mt-shasta","eureka","arcata","fortuna","mckibleyville","ukiah","fortbragg","fort-bragg","willits","yreka","weed","dunsmuir","tahoe","laketahoe","lake-tahoe","southlaketahoe","south-lake-tahoe","truckee","squaw","squawvalley","squaw-valley","northstar","mammoth","mammothlakes","mammoth-lakes","bishopca","bishop","placerville","tahoe-city","tahoecity","kings-beach","kingsbeach","incline","inclinevillage","incline-village","maricopa","pima","pinal","yavapai","yuma","mohave","coconino","cochise","navajo","apache","gila","santacruzaz","graham","lapaz","la-paz","greenlee","arizona","az","azmesh","az-mesh","phoenix","phx","phoenixmesh","phoenix-mesh","scottsdale","tempe","mesa","gilbert","chandler","glendale","peoria","surprize","avondale","goodyear","buckeye","litchfieldpark","litchfield-park","tolleson","laveen","paradisevalley","paradise-valley","pv","carefree","cavekreek","cave-creek","fountainhills","fountain-hills","rioverde","rio-verde","queencreek","queen-creek","santan","san-tan","santanvalley","ahwatukee","southmountain","south-mountain","anthem","newriver","new-river","apachejunction","apache-junction","aj","goldcanyon","gold-canyon","tucson","tucsomesh","tucson-mesh","orovalley","oro-valley","marana","catalina","catalinafoothills","saddlebrooke","casagrande","casa-grande","eloy","coolidge","florence","sierravista","sierra-vista","bisbee","tombstone","benson","douglas","nogales","tubac","greenvalley","green-valley","sahuarita","flagstaff","flag","flagmesh","sedona","cottonwood","clarkdale","prescott","prescottvalley","prescott-valley","dewey","chino-valley","chinovalley","williams","grandcanyon","grand-canyon","tusayan","page","marble-canyon","showlow","show-low","pinetop","pinetoplakeside","lakeside","snowflake","taylor","payson","pine","strawberry","camp-verde","campverde","winslow","holbrook","stjohns","springerville","eagar","yuma","yumamesh","fortuna-foothills","sanluisaz","san-luis","lakehavasu","lake-havasu","havasu","havasucity","lake-havasu-city","bullheadcity","bullhead-city","bullhead","laughlin","kingman","goldenkvalley","golden-valley","parker","quartzsite","wickenburg","lasvegas","las-vegas","vegas","vegasmesh","vegas-mesh","lv","henderson","boulder-city","bouldercity","northlasvegas","north-las-vegas","nlv","summerlin","enterprise","pahrump","mesquite","reno","sparks","carsoncity","carson-city","incline","bajacalifornia","baja-california","baja","bajamesh","tijuana","tj","mexicali","ensenada","tecate","rosarito","sanfelipe","san-felipe","sanluis","sanluisriocoalorado","brabant","flevoland","gelderland","noordbrabant","noordholland","zuid-holland","zuidholland","zeeland","twente","alkmaar","almere","amsterdam","amstelland","capelleaandenijssel","denhaag","dordrecht","drechtsteden","eindhoven","haarlem","hellevoetsluis","hilversum","katwijk","lelystad","maassluis","middelburg","rijnmond","rotterdam","tilburg","utrecht","vlissingen","voorburg","voorne-putten","walcheren","west-friesland","zaandam","zaanstreek-waterland","024-bot","afrithonbot","ai","amradio","analyser","angrynerds","bemesh","bot","buch","burgernet","chat","chatgpt","dares","dekroeg","dtis","emergency","english","evenvroegopstaan","fosdem","gezellig","gmr","gmrbot","goedemorgen","gyverbot","haagscourant","hackerspacenijmegen","hamradio","hamradionederland","hetweerinjegemeente","hsnl","jokes","kanalen","koffie","linux","meshcore","nerd","nl-alert","nl-prio","noodkanaal","nsagov","pi4hm","pi4utr","pingbot","sensemakers","sports","survival","test","testing","uitdagingen","valleibot","valleirug","vleesboek","wardrive","weer","swl","qso","qrz","cq","dx","sstv","aprs","winlink","aredn","hamnet","emcomm","emcommplanning","races","ares","auxcomm","simplex","repeater","uhf","vhf","2m","70cm","440"],Cd=new Set(kd);function Sd(){return crypto.getRandomValues(new Uint8Array(16))}function dn(s){return Array.from(s).map(t=>t.toString(16).padStart(2,"0")).join("")}function _t(s){const t=s.replace(/\s/g,"");if(t.length!==32||!/^[0-9a-fA-F]+$/.test(t))return null;const n=new Uint8Array(16);for(let a=0;a<16;a++)n[a]=parseInt(t.slice(a*2,a*2+2),16);return n}async function Id(s){const n=`#${jn(s)}`,a=new TextEncoder().encode(n);return(await Ur(a)).slice(0,16)}const un=[{key:"create-private",label:"Create Private",icon:$l,desc:"Generate a new private channel with a random key"},{key:"join-private",label:"Join Private",icon:Hi,desc:"Join an existing private channel using a shared key"},{key:"join-hashtag",label:"Join Hashtag",icon:ze,desc:"Join a public hashtag channel (key derived from name)"}];function _d({open:s,onClose:t,channels:n,onAddChannel:a}){var C;const[r,i]=l.useState("join-hashtag"),[o,u]=l.useState(""),[d,f]=l.useState(""),[c,x]=l.useState(null),[y,g]=l.useState(!1),[m,j]=l.useState(""),[k,h]=l.useState(!1),[w,E]=l.useState(s);s!==w&&(E(s),s&&(i("join-hashtag"),u(""),f(""),x(null),g(!1),j(""),h(!1)));const M=l.useMemo(()=>n.length===0?0:Math.max(...n.map(v=>v.index))+1,[n]),b=l.useMemo(()=>r!=="join-hashtag"?"":jn(o),[r,o]),I=l.useMemo(()=>{if(!o.trim())return null;const v=r==="join-hashtag"&&b?`#${b}`:o.trim();return n.find(L=>L.name===v)??null},[o,r,b,n]),T=l.useMemo(()=>r==="join-hashtag"&&b?Cd.has(b):!1,[r,b]),_=l.useMemo(()=>{if(!o.trim()||I)return!1;switch(r){case"create-private":return o.trim().length>0&&o.trim().length<=32;case"join-private":return o.trim().length>0&&_t(d)!==null;case"join-hashtag":return b.length>0;default:return!1}},[r,o,d,b,I]),p=l.useCallback(async()=>{c&&(await navigator.clipboard.writeText(dn(c)),h(!0),setTimeout(()=>h(!1),2e3))},[c]),N=l.useCallback(async()=>{if(!(!_||y)){g(!0),j("");try{let v,L;switch(r){case"create-private":{v=Sd(),L=o.trim();break}case"join-private":{const D=_t(d);if(!D){j("Invalid hex key (must be 32 hex chars = 16 bytes)");return}v=D,L=o.trim();break}case"join-hashtag":{v=await Id(o),L=`#${b}`;break}default:return}if(await a(M,L,v)){if(r==="create-private"){x(v);return}t()}else j("Failed to add channel — device may be unreachable")}catch(v){j(v instanceof Error?v.message:"Unknown error")}finally{g(!1)}}},[_,y,r,o,d,b,M,a,t]);return e.jsxs(Ce,{open:s,onClose:t,size:"sm",children:[e.jsx(Te,{title:"Add Channel",onClose:t}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1 p-0.5 radius-inner bg-zinc-950/5",children:un.map(v=>{const L=v.icon,S=r===v.key;return e.jsxs("button",{onClick:()=>{i(v.key),j(""),x(null)},className:R("flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors",S?"bg-surface text-fg-primary shadow-sm":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(L,{className:"w-3.5 h-3.5"}),v.label]},v.key)})}),e.jsx("p",{className:"text-xs text-fg-muted",children:(C=un.find(v=>v.key===r))==null?void 0:C.desc}),c&&r==="create-private"&&e.jsxs("div",{className:"p-3 radius-inner bg-sys-green/8 border border-sys-green/20 space-y-2",children:[e.jsx("p",{className:"text-xs text-sys-green font-medium",children:"Channel created! Share this key with others:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 text-[11px] font-mono text-fg-primary bg-zinc-950/10 px-2 py-1 rounded break-all",children:dn(c)}),e.jsx("button",{onClick:p,className:"p-1.5 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Copy key",children:k?e.jsx(Ne,{className:"w-3.5 h-3.5 text-sys-green"}):e.jsx(Dt,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),e.jsx("p",{className:"text-[11px] text-fg-muted",children:"Save this key — it cannot be recovered later."})]}),e.jsxs(ce,{children:[e.jsx(de,{children:r==="join-hashtag"?"Hashtag name":"Channel name"}),e.jsx(he,{type:"text",value:o,onChange:v=>u(v.target.value),placeholder:r==="join-hashtag"?"e.g. south-bay":"e.g. My Channel",maxLength:32,className:"mt-1",disabled:!!c}),r==="join-hashtag"&&b&&b!==o&&e.jsxs(Ie,{className:"mt-1",children:["Will be registered as ",e.jsxs("code",{className:"text-fg-primary font-mono text-[11px]",children:["#",b]})]}),r==="join-hashtag"&&T&&e.jsx(Ie,{className:"mt-1 text-sys-green",children:"Known region channel"})]}),I&&e.jsxs("div",{className:"flex items-start gap-2 p-2.5 radius-inner bg-sys-red/8 border border-sys-red/20",children:[e.jsx(Ve,{className:"w-3.5 h-3.5 text-sys-red flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs text-fg-secondary",children:["Channel ",e.jsx("strong",{className:"text-fg-primary",children:I.name})," already exists at slot ",I.index,". Remove it first to re-add."]})]}),r==="join-private"&&e.jsxs(ce,{children:[e.jsxs(de,{children:["Channel key ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(32 hex chars)"})]}),e.jsx(he,{type:"text",value:d,onChange:v=>f(v.target.value),placeholder:"e.g. a1b2c3d4e5f6...",maxLength:32,className:"mt-1 font-mono text-xs"}),d&&!_t(d)&&e.jsx(Ie,{className:"mt-1 text-sys-red",children:"Must be exactly 32 hex characters (16 bytes)"})]}),e.jsxs("p",{className:"text-[11px] text-fg-muted",children:["Will be assigned to channel slot ",e.jsx("strong",{className:"text-fg-primary",children:M})]}),m&&e.jsx("p",{className:"text-xs text-sys-red font-medium",children:m})]})}),e.jsxs($e,{children:[e.jsx(U,{plain:!0,onClick:t,children:c?"Done":"Cancel"}),!c&&e.jsx(U,{color:"primary",onClick:N,disabled:!_||y,children:y?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 animate-spin"}),"Adding…"]}):r==="create-private"?"Create Channel":"Join Channel"})]})]})}const Md=202,Rd=/^[0-9a-fA-F]+$/;function Ed(s){const t=s.replace(/\s/g,"");return t.length>=Md&&t.length%2===0&&Rd.test(t)}const Pd=l.memo(function({open:t,onClose:n,contacts:a,exportPubKey:r,onExport:i,onImport:o}){const[u,d]=l.useState(r?"export":"import"),[f,c]=l.useState(r??""),[x,y]=l.useState(""),[g,m]=l.useState(""),[j,k]=l.useState(!1),[h,w]=l.useState(!1),[E,M]=l.useState(!1),[b,I]=l.useState(null),[T,_]=l.useState(!1),p=l.useRef(null);l.useEffect(()=>{t&&(d(r?"export":"import"),c(r??""),y(""),m(""),k(!1),w(!1),M(!1),I(null),_(!1))},[t,r]);const N=l.useCallback(()=>{n()},[n]),C=l.useCallback(async()=>{if(!f)return;k(!0),I(null),y("");const S=await i(f);k(!1),S?y(S):I("Failed to export contact advert")},[f,i]),v=l.useCallback(async()=>{if(x)try{await navigator.clipboard.writeText(x),M(!0),setTimeout(()=>M(!1),2e3)}catch{I("Failed to copy to clipboard")}},[x]),L=l.useCallback(async()=>{const S=g.replace(/\s/g,"");if(!Ed(S)){I("Invalid hex — must be at least 202 hex characters (101 bytes)");return}w(!0),I(null);const D=await o(S);w(!1),D?(_(!0),m(""),setTimeout(()=>N(),1500)):I("Import failed — check the hex string and try again")},[g,o,N]);return e.jsxs(Ce,{open:t,onClose:N,children:[e.jsx(Gr,{children:"Contact Import / Export"}),e.jsxs(Se,{children:[e.jsxs("div",{className:"flex gap-1 p-0.5 rounded-lg bg-subtle-fill mb-4",children:[e.jsxs("button",{onClick:()=>{d("export"),I(null)},className:R("flex-1 flex items-center justify-center gap-1.5 py-1.5 rounded-md text-xs font-medium transition-colors",u==="export"?"bg-surface shadow-sm text-fg-primary":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(Gt,{className:"w-3.5 h-3.5"}),"Export"]}),e.jsxs("button",{onClick:()=>{d("import"),I(null)},className:R("flex-1 flex items-center justify-center gap-1.5 py-1.5 rounded-md text-xs font-medium transition-colors",u==="import"?"bg-surface shadow-sm text-fg-primary":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(qe,{className:"w-3.5 h-3.5"}),"Import"]})]}),u==="export"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-fg-muted mb-1",children:"Select contact"}),e.jsxs("select",{value:f,onChange:S=>{c(S.target.value),y(""),I(null)},className:"w-full surface-input rounded-lg px-3 py-2 text-sm text-fg-primary",children:[e.jsx("option",{value:"",children:"Choose a contact…"}),a.map(S=>e.jsx("option",{value:S.public_key,children:S.name||S.public_key.slice(0,12)},S.public_key))]})]}),e.jsx(U,{color:"primary",outline:!0,className:"w-full justify-center",disabled:!f||j,onClick:C,children:j?"Exporting…":"Export Advert"}),x&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("textarea",{readOnly:!0,value:x,rows:4,className:"w-full surface-input rounded-lg px-3 py-2 text-[10px] font-mono text-fg-primary break-all resize-none"}),e.jsxs(U,{color:E?"success":"primary",outline:!0,className:"w-full justify-center",onClick:v,children:[E?e.jsx(Ne,{"data-slot":"icon"}):e.jsx(Dt,{"data-slot":"icon"}),E?"Copied!":"Copy to Clipboard"]})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-fg-muted mb-1",children:"Paste advert hex string"}),e.jsx("textarea",{ref:p,value:g,onChange:S=>{m(S.target.value),I(null),_(!1)},placeholder:"Paste exported advert hex here…",rows:4,className:"w-full surface-input rounded-lg px-3 py-2 text-[10px] font-mono text-fg-primary break-all resize-none placeholder:text-fg-muted/50"}),e.jsx("p",{className:"text-[10px] text-fg-muted/70 mt-1",children:"Minimum 101 bytes (202 hex characters): 32B pubkey + 4B timestamp + 64B signature + appData"})]}),T&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-sys-green/10 text-sys-green text-xs font-medium",children:[e.jsx(Ne,{className:"w-3.5 h-3.5"}),"Contact imported successfully"]}),e.jsx(U,{color:"primary",outline:!0,className:"w-full justify-center",disabled:!g.trim()||h,onClick:L,children:h?"Importing…":"Import Contact"})]}),b&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 mt-3 rounded-lg bg-sys-red/10 text-sys-red text-xs",children:[e.jsx(kn,{className:"w-3.5 h-3.5 flex-shrink-0"}),b]})]}),e.jsx($e,{children:e.jsx(U,{plain:!0,onClick:N,children:"Close"})})]})});function pu(){var gs,ys,bs,vs,js,Ns;const s=Kr(),t=bn(),n=qr(),a=Vr(),r=Jr(),i=Qr(),o=gt(),u=Xr(),d=Yr(),f=Zr(),c=el(),x=l.useMemo(()=>{if(r.length===0)return a;const P=new Set(a.map(H=>H.public_key));return[...a,...r.filter(H=>!P.has(H.public_key))]},[a,r]),y=l.useMemo(()=>{const P=new Set;if(!(c!=null&&c.neighbors))return P;const H=[];for(const[K,te]of Object.entries(c.neighbors))te.zero_hop&&H.push((K.startsWith("0x")?K.slice(2):K).toLowerCase());for(const K of x){const te=K.public_key.toLowerCase();for(const pe of H)if(te===pe||te.startsWith(pe)){P.add(K.public_key);break}}return P},[c==null?void 0:c.neighbors,x]),g=l.useMemo(()=>{const P=new Map;if(!(c!=null&&c.neighbors))return P;const H=[];for(const[K,te]of Object.entries(c.neighbors))te.zero_hop&&te.rssi!=null&&te.snr!=null&&te.rssi!==0&&H.push({hash:(K.startsWith("0x")?K.slice(2):K).toLowerCase(),rssi:te.rssi,snr:te.snr,advertCount:te.advert_count??1});if(H.length===0)return P;for(const K of x){const te=K.public_key.toLowerCase();for(const pe of H)if(te===pe.hash||te.startsWith(pe.hash)){P.set(K.public_key,{rssi:pe.rssi,snr:pe.snr,advertCount:pe.advertCount});break}}return P},[c==null?void 0:c.neighbors,x]),m=tl(),j=sl(),k=vn(),h=nl(),w=al(t),E=rl(),M=ll(),b=il(),I=ol(),T=cl(),[_,p]=dl(),[N,C]=l.useState(!1),[v,L]=l.useState(!1),[S,D]=l.useState(!1),[$,G]=l.useState(!1),[O,q]=l.useState(null),[J,B]=l.useState(!1),[A,z]=l.useState(!1),[F,W]=l.useState(!0),Q="pymc_companion_contacts_micro",me="pymc_companion_split",[be,He]=l.useState(()=>{try{return localStorage.getItem(Q)==="1"}catch{return!1}}),Vt=25,Jt=75,[wt,Qt]=l.useState(()=>{try{const P=Number(localStorage.getItem(me));return P>=Vt&&P<=Jt?P:50}catch{return 50}}),et=l.useRef(null),Be=l.useRef(null),Xt=l.useRef(null),tt=l.useRef(!1),We=l.useRef(wt);We.current=wt;const ha=l.useCallback(P=>{P.preventDefault(),P.target.setPointerCapture(P.pointerId),tt.current=!0},[]),fa=l.useCallback(P=>{if(!tt.current||!et.current)return;const H=et.current.getBoundingClientRect(),K=Math.round(Math.min(Jt,Math.max(Vt,(P.clientX-H.left)/H.width*100)));We.current=K,Be.current&&(Be.current.style.width=`${K}%`)},[]),Yt=l.useCallback(()=>{if(!tt.current)return;tt.current=!1;const P=We.current;Qt(P);try{localStorage.setItem(me,String(P))}catch{}},[]),ga=l.useCallback(()=>{We.current=50,Be.current&<(Be.current,{width:"50%"},ie.layoutResize),Qt(50);try{localStorage.setItem(me,String(50))}catch{}},[]),ya=l.useCallback(P=>{He(P);const H=et.current,K=Xt.current;if(!H)return;const te=H.getBoundingClientRect().width;H.style.width=P?"var(--companion-side-micro)":"var(--companion-side)";const pe=H.getBoundingClientRect().width;if(H.style.width=`${te}px`,K){const Ha=P?56:We.current/100*pe,Ba=K.offsetWidth,Wa=Math.max(0,pe-Ha-12);K.style.flex="none",K.style.width=`${Ba}px`,lt(K,{width:`${Wa}px`},{...ie.layoutResize,onComplete(){K.style.flex="",K.style.width=""}})}lt(H,{width:`${pe}px`},{...ie.layoutResize,onComplete(){H.style.width=P?"var(--companion-side-micro)":"var(--companion-side)"}})},[]),{selectCompanion:ba,selectConversation:we,sendMessage:Zt,sendChannelMessage:es,retryMessage:va,retryMessageAsFlood:ja,resetPath:kt,shareContact:Na,removeContact:wa,addChannel:ka,requestStatus:ts,requestTelemetry:ss,loginToRepeater:Ct,logoutFromRepeater:ns,getNeighbours:as,traceContactPath:rs,discoverPath:ls,pingContact:Ca,markAsRead:is,fetchCompanions:os,seedFromRepeater:Sa,exportContactAdvert:Ia,importContactAdvert:_a,setContactPath:cs,deleteChannel:Ma,loadOlderMessages:Ra}=ae.getState(),Ea=l.useCallback(P=>{we(P),window.innerWidth>=1280?B(!0):z(!0)},[we]),ds=ae(P=>P.messages),us=ae(P=>P.unreadMap);l.useEffect(()=>{is()},[m,is]),l.useEffect(()=>{const P=_.get("dm");P&&x.length>0&&x.find(K=>K.public_key===P)&&(we({type:"contact",id:P}),p({},{replace:!0}))},[_,x,we,p]);const Pa=l.useMemo(()=>{const P=new Set;for(const H of x)H.name&&P.add(H.name);for(const H of j)H.sender_name&&!H.is_outgoing&&P.add(H.sender_name);return[...P].sort((H,K)=>H.localeCompare(K))},[x,j]),ms=l.useMemo(()=>{const P=new Map;for(const H of x)H.name&&P.set(H.name.toLowerCase(),H.public_key);for(const H of j)if(H.sender_name&&H.sender_key&&H.sender_key!=="unknown"&&!H.is_outgoing){const K=H.sender_name.toLowerCase();P.has(K)||P.set(K,H.sender_key)}return P},[x,j]),Ta=l.useCallback(P=>{const H=ms.get(P.toLowerCase());H&&(we({type:"contact",id:H}),B(!0))},[ms,we]),$a=l.useCallback(async P=>m?m.type==="channel"?es(Number(m.id),P):Zt(m.id,P):!1,[m,Zt,es]),Aa=k&&!E,ps=b!=null&&(b.adv_type&15)===3,xs=Ot(ps?b.public_key:null),Fa=ps&&xs!=="success",hs=ul(),[xe,Ae]=l.useState("idle"),Oa=l.useCallback(async()=>{Ae("flood-sending");const P=await ae.getState().sendFloodAdvert();Ae(P?"flood-done":"idle"),P&&setTimeout(()=>Ae(H=>H==="flood-done"?"idle":H),2e3)},[]),Da=l.useCallback(async()=>{Ae("zero-sending");const P=await ae.getState().sendZeroHopAdvert();Ae(P?"zero-done":"idle"),P&&setTimeout(()=>Ae(H=>H==="zero-done"?"idle":H),2e3)},[]),La=e.jsxs("div",{className:"flex items-center gap-2",children:[k&&n&&e.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[e.jsxs("button",{onClick:Oa,disabled:xe!=="idle"&&xe!=="zero-done",className:R("inline-flex items-center gap-2 px-3.5 py-2 rounded-xl text-xs font-semibold transition-all duration-150","bg-surface depth-raised-soft hover:depth-raised active:depth-inset","disabled:opacity-50 disabled:cursor-not-allowed",xe==="flood-done"?"text-sys-green":"text-fg-secondary hover:text-fg-primary"),title:"A Flood Advert will announce your presence and broadcast your node ID and name anywhere a repeater will repeat it",children:[xe==="flood-sending"?e.jsx(ue,{className:"w-4 h-4 animate-spin"}):e.jsx(Ji,{className:"w-4 h-4"}),e.jsx("span",{children:xe==="flood-done"?"Sent!":"Flood Advert"})]}),e.jsxs("button",{onClick:Da,disabled:xe!=="idle"&&xe!=="flood-done",className:R("inline-flex items-center gap-2 px-3.5 py-2 rounded-xl text-xs font-semibold transition-all duration-150","bg-surface depth-raised-soft hover:depth-raised active:depth-inset","disabled:opacity-50 disabled:cursor-not-allowed",xe==="zero-done"?"text-sys-green":"text-fg-secondary hover:text-fg-primary"),title:"A Local Advert, or “Zero Hop” advert will not be repeated by local repeaters, but will be heard by those within range",children:[xe==="zero-sending"?e.jsx(ue,{className:"w-4 h-4 animate-spin"}):e.jsx(Fn,{className:"w-4 h-4"}),e.jsx("span",{children:xe==="zero-done"?"Sent!":"Local Advert"})]})]}),e.jsx("button",{onClick:()=>ml.getState().toggleFocusMode(),className:"hidden lg:flex p-1.5 hover:bg-subtle-fill rounded transition-colors",title:hs?"Collapse view":"Expand view",children:hs?e.jsx(Wl,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Ul,{className:"w-4 h-4 text-fg-muted"})})]}),za=e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 flex-shrink-0",children:[e.jsx(ve,{children:f.length>0&&e.jsx(oe.div,{layout:!0,initial:{opacity:0,scale:.9,width:0},animate:{opacity:1,scale:1,width:"auto"},exit:{opacity:0,scale:.9,width:0},transition:ie.fade,className:"flex items-center gap-1 overflow-hidden",children:f.map(P=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-sys-green/10 text-[11px] text-sys-green font-medium whitespace-nowrap",children:[e.jsx(Ke,{className:"w-2.5 h-2.5"}),P.name]},P.pubHex))},"advert-notifs")}),e.jsx(ve,{children:h?e.jsxs(oe.span,{initial:{opacity:0,scale:.9,width:0},animate:{opacity:1,scale:1,width:"auto"},exit:{opacity:0,scale:.9,width:0},transition:ie.fade,className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-sys-blue/10 text-[11px] text-sys-blue font-medium whitespace-nowrap overflow-hidden",title:w!=null&&w.clientIp?`Another client (${w.clientIp}) is attached to this companion. Connecting would evict them.`:"Another client is attached to this companion. Connecting would evict them.",children:[e.jsx("span",{className:"relative flex h-1.5 w-1.5 flex-shrink-0",children:e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-sys-blue"})}),"Another client connected",e.jsx("button",{onClick:()=>ae.getState().forceConnect(),className:"ml-1 px-1.5 py-0.5 rounded-full bg-sys-blue/20 hover:bg-sys-blue/30 transition-colors text-[10px] font-semibold",title:"Evict the other client and connect now",children:"Connect anyway"})]},"external-client"):k?null:e.jsxs(oe.span,{initial:{opacity:0,scale:.9,width:0},animate:{opacity:1,scale:1,width:"auto"},exit:{opacity:0,scale:.9,width:0},transition:ie.fade,className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-sys-amber/10 text-[11px] text-sys-amber font-medium whitespace-nowrap overflow-hidden",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5 flex-shrink-0",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sys-amber opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-sys-amber"})]}),"Reconnecting…"]},"disconnected")}),n&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>L(!0),disabled:u,className:"data-box flex items-center gap-1 cursor-pointer hover:bg-subtle-fill-strong transition-colors disabled:opacity-50",title:d>0?`${d} contacts seeded from repeater — click to refresh`:"Seed contacts from repeater adverts",children:[u?e.jsx(ue,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"}):e.jsx(so,{className:"w-3.5 h-3.5 text-sys-blue"}),d>0&&e.jsxs("span",{className:"text-sys-blue",children:["+",d]})]}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${x.length} contacts${d>0?` (${d} from repeater)`:""}`,children:[e.jsx(Rt,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:x.length})]}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${n.channels_count} channels`,children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:n.channels_count})]})]}),e.jsx(vd,{companions:s,selected:t,onSelect:ba}),e.jsx(U,{plain:!0,onClick:()=>C(!0),title:"Companion configuration",children:e.jsx(pl,{"data-slot":"icon"})})]});if(s.length===0&&!E)return e.jsxs(Rs,{children:[e.jsx(Es,{title:"Companion",icon:e.jsx(je,{}),controls:e.jsxs(U,{color:"primary",outline:!0,onClick:()=>C(!0),children:[e.jsx(Xe,{"data-slot":"icon"}),"Add Companion"]})}),e.jsx(Ps,{ready:!0,children:e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-subtle-fill mx-auto mb-4 flex items-center justify-center",children:e.jsx(je,{className:"w-7 h-7 text-fg-muted/50"})}),e.jsx("p",{className:"type-body text-fg-muted mb-1",children:"No companions configured"}),e.jsx("p",{className:"type-body-sm text-fg-muted/70 mb-4",children:"Add a companion to start messaging mesh contacts"}),e.jsxs(U,{color:"primary",outline:!0,onClick:()=>C(!0),children:[e.jsx(Xe,{"data-slot":"icon"}),"Add Companion"]})]})}),e.jsx(cn,{open:N,onClose:()=>C(!1),onRefresh:os})]});const fs=m?m.type==="channel"?((gs=i.find(P=>String(P.index)===m.id))==null?void 0:gs.name)??"Channel":((ys=x.find(P=>P.public_key===m.id))==null?void 0:ys.name)??m.id.slice(0,8):null;return e.jsxs(Rs,{children:[e.jsx(Es,{title:(o==null?void 0:o.node_name)||"Companion",icon:e.jsx(je,{}),leading:La,controls:za}),e.jsx(Ps,{children:e.jsxs("div",{className:"companion-layout flex gap-4",style:{height:"calc(100vh - 11rem)",minHeight:400},children:[e.jsxs("div",{ref:et,className:R("flex-shrink-0 flex h-full overflow-hidden radius-inner bg-surface/80 backdrop-blur-lg depth-raised",F?"":"hidden md:flex"),style:{width:be?"var(--companion-side-micro)":"var(--companion-side)"},children:[e.jsx(Uo,{ref:Be,contacts:x,selectedConversation:m,unreadMap:us,messages:ds,onSelect:P=>{we(P),window.innerWidth<768&&W(!1)},onShowDetails:Ea,onShareContact:Na,onResetPath:kt,onRemoveContact:wa,onPingContact:Ca,repeaterNeighborHashes:y,repeaterSignalMap:g,isLoading:E,splitPercent:wt,onMicroChange:ya}),e.jsx("div",{className:"group/divider flex-shrink-0 self-stretch flex items-center justify-center w-3 cursor-col-resize select-none touch-none",onPointerDown:ha,onPointerMove:fa,onPointerUp:Yt,onPointerCancel:Yt,onDoubleClick:ga,children:e.jsx("div",{className:"w-px h-full my-2 bg-edge-subtle/50 group-hover/divider:bg-sys-blue/50 group-active/divider:bg-sys-blue transition-colors"})}),e.jsx(Jo,{ref:Xt,channels:i,selectedConversation:m,unreadMap:us,messages:ds,onSelect:P=>{we(P),window.innerWidth<768&&W(!1)},onAddChannel:()=>D(!0),onDeleteChannel:Ma})]}),e.jsxs(Ts,{noPadding:!0,radius:"sm",className:"flex-1 flex flex-col min-w-0 overflow-hidden relative",children:[e.jsx(ve,{children:M&&e.jsxs(oe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:ie.fade,className:"flex items-center justify-center gap-2 px-3 py-1.5 bg-sys-red/10 border-b border-sys-red/20",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-sys-red flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-sys-red font-medium truncate",children:M})]},"error-banner")}),!F&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-edge-subtle md:hidden",children:[e.jsx("button",{onClick:()=>W(!0),className:"p-1 hover:bg-subtle-fill rounded transition-colors",children:e.jsx(Ei,{className:"w-4 h-4 text-fg-secondary"})}),e.jsx("span",{className:"text-sm text-fg-primary font-medium truncate flex-1",children:fs}),m&&e.jsx("button",{onClick:()=>z(!0),className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Details",children:e.jsx(ct,{className:"w-4 h-4 text-fg-muted"})})]}),e.jsxs("div",{className:"hidden md:flex items-center justify-between px-3 py-1.5 border-b border-edge-subtle",children:[e.jsx("span",{className:"text-sm text-fg-primary font-medium truncate",children:fs??"Select a conversation"}),e.jsx(ve,{children:m&&e.jsx(oe.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ie.fade,onClick:()=>{window.innerWidth>=1280?B(P=>!P):z(!0)},className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:J?"Hide detail panel":"Show details",children:J&&window.innerWidth>=1280?e.jsx(Hs,{className:"w-4 h-4 text-fg-muted"}):e.jsx(ct,{className:"w-4 h-4 text-fg-muted"})},"ctx-toggle")})]}),Fa&&b?e.jsx(Zc,{contact:b,loginStatus:xs,onLogin:Ct}):e.jsxs(e.Fragment,{children:[e.jsx(Vc,{messages:j,contacts:x,className:"flex-1 min-h-0",conversationKey:m?m.type==="channel"?`ch:${m.id}`:m.id:void 0,onRetry:va,onRetryAsFlood:ja,onMentionClick:Ta,historyLoading:I,historyExhausted:m?T.get(m.type==="channel"?`ch:${m.id}`:m.id)??!1:!0,onLoadOlder:m?()=>Ra(m.type==="channel"?`ch:${m.id}`:m.id):void 0,channelName:(m==null?void 0:m.type)==="channel"?(bs=i.find(P=>String(P.index)===m.id))==null?void 0:bs.name:void 0,contactPubKey:(m==null?void 0:m.type)==="contact"?m.id:void 0}),m&&e.jsx(Qc,{onSend:$a,disabled:!Aa,mentionNames:Pa,placeholder:m.type==="channel"?`Message ${((vs=i.find(P=>String(P.index)===m.id))==null?void 0:vs.name)??"channel"}`:`Message ${((js=x.find(P=>P.public_key===m.id))==null?void 0:js.name)??"contact"}`})]})]}),e.jsx(oe.div,{initial:!1,animate:{width:J&&m?"var(--companion-context)":"0px",opacity:J&&m?1:0},transition:ie.layoutResize,className:"hidden xl:block flex-shrink-0 overflow-hidden",style:{pointerEvents:J&&m?"auto":"none"},children:m&&e.jsxs(Ts,{neomorphic:!0,noPadding:!0,radius:"sm",className:"h-full relative",children:[e.jsx(ve,{children:J&&e.jsx(oe.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ie.fade,onClick:()=>B(!1),className:"absolute top-2 left-2 z-10 p-1 hover:bg-subtle-fill rounded-lg transition-colors",title:"Hide detail panel",children:e.jsx(Hs,{className:"w-4 h-4 text-fg-muted"})},"ctx-close")}),e.jsx(sn,{contact:m.type==="contact"?b:null,channel:m.type==="channel"?i.find(P=>String(P.index)===m.id)??null:null,contacts:x,selfPubKey:(o==null?void 0:o.public_key)??null,onResetPath:kt,onRequestStatus:ts,onRequestTelemetry:ss,onLoginToRepeater:Ct,onLogoutFromRepeater:ns,onGetNeighbours:as,onTraceContactPath:rs,onDiscoverPath:ls,onExportContact:P=>{q(P),G(!0)},onSetContactPath:cs})]})})]})}),e.jsx(cn,{open:N,onClose:()=>C(!1),onRefresh:os}),e.jsx(wd,{open:v,onClose:()=>L(!1),companionName:t??"companion",onImport:Sa}),e.jsx(Pd,{open:$,onClose:()=>{G(!1),q(null)},contacts:x,exportPubKey:O,onExport:Ia,onImport:_a}),e.jsx(_d,{open:S,onClose:()=>D(!1),channels:i,onAddChannel:ka}),e.jsxs(Ce,{open:A,onClose:()=>z(!1),size:"md",children:[e.jsx(Te,{icon:(m==null?void 0:m.type)==="channel"?e.jsx(ze,{className:"w-5 h-5"}):b&&(b.adv_type&15)===2?e.jsx(Ke,{className:"w-5 h-5"}):e.jsx(je,{className:"w-5 h-5"}),title:(m==null?void 0:m.type)==="channel"?((Ns=i.find(P=>String(P.index)===m.id))==null?void 0:Ns.name)??"Channel":(b==null?void 0:b.name)||"Contact Details",onClose:()=>z(!1)}),e.jsx(Se,{className:"max-h-[70vh] overflow-y-auto",children:e.jsx(sn,{embedded:!0,contact:(m==null?void 0:m.type)==="contact"?b:null,channel:(m==null?void 0:m.type)==="channel"?i.find(P=>String(P.index)===m.id)??null:null,contacts:x,selfPubKey:(o==null?void 0:o.public_key)??null,onResetPath:kt,onRequestStatus:ts,onRequestTelemetry:ss,onLoginToRepeater:Ct,onLogoutFromRepeater:ns,onGetNeighbours:as,onTraceContactPath:rs,onDiscoverPath:ls,onExportContact:P=>{q(P),G(!0)},onSetContactPath:cs})})]})]})}export{pu as default}; diff --git a/frontend/dist/assets/CompanionEchoMap-BLZcQnij.js b/frontend/dist/assets/CompanionEchoMap-C048dCxi.js similarity index 94% rename from frontend/dist/assets/CompanionEchoMap-BLZcQnij.js rename to frontend/dist/assets/CompanionEchoMap-C048dCxi.js index c558941c..33b7b4e8 100644 --- a/frontend/dist/assets/CompanionEchoMap-BLZcQnij.js +++ b/frontend/dist/assets/CompanionEchoMap-C048dCxi.js @@ -1 +1 @@ -import{r as i,d0 as K,a6 as T,Q as Y,fO as D,au as I,cC as J,g7 as Q,Z as q,O as X,j as a,c as V,V as C,cF as ee}from"./index-Bcr7MabU.js";import{M as te,S as ne,L as se,a as $}from"./maplibre-gl-CsF9Hmsz.js";import{useSrcHashResolverMap as ae,useDiscoveredNodes as oe}from"./usePipelineStore-nFeiBWWq.js";import{M as re}from"./map-pin-off-DbUyHIkr.js";import"./node-types-BFsObq9k.js";const le={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},A=X.amber,O=q[400],U=i.memo(function({prefix:c,name:o,isLocal:f,color:n}){const[r,u]=i.useState(!1);return a.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{pointerEvents:"auto"},children:a.jsxs(C,{color:n,filled:!0,className:V("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",r&&"relative z-50"),children:[f&&a.jsx(ee,{className:"w-2.5 h-2.5 mr-0.5"}),c&&a.jsx("span",{className:"font-mono",children:c}),r&&o&&a.jsx("span",{className:c?"ml-0.5 opacity-75":"",children:o})]})})});function N(p,c){return p==null||c==null?!1:p!==0||c!==0}function ie(p,c,o){var u;const f=p.toUpperCase(),n=c.find(l=>l.public_key.toUpperCase().startsWith(f));if(n&&N(n.gps_lat,n.gps_lon))return{name:n.name||null,lat:n.gps_lat,lng:n.gps_lon,hasGps:!0};if(o.neighbors){const l=Object.entries(o.neighbors).find(([t])=>t.toUpperCase().startsWith(f));if(l){const[,t]=l;if(N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}const r=o.srcHashMap.get(f);if(r){const l=o.discoveredNodes.get(r);if(l&&N(l.latitude,l.longitude))return{name:l.name||null,lat:l.latitude,lng:l.longitude,hasGps:!0};if(o.neighbors){const t=o.neighbors[r];if(t&&N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}return{name:(n==null?void 0:n.name)||(r?((u=o.discoveredNodes.get(r))==null?void 0:u.name)??null:null),lat:0,lng:0,hasGps:!1}}function ce(p,c,o,f){const n=Math.floor(c/30);for(const r of[n-1,n,n+1])for(const[u,l]of o){const t=l.decoded;if(!(t!=null&&t.decrypted)||t.senderName!==f)continue;const v=t.timestamp??l.timestamp;if(Math.floor(v/30)===r&&t.text===p)return u}return null}function ue(p,c){const o=new Set,f=[];for(const n of c){if(n.packet_hash!==p||n.packet_origin==="tx_local")continue;const r=n.original_path??n.forwarded_path;if(!r||r.length===0)continue;const u=r[r.length-1].toUpperCase();o.has(u)||(o.add(u),f.push({prefix:u,snr:n.snr}))}return f}function he({text:p,timestamp:c,contacts:o,className:f}){const n=i.useRef(null),r=K(),u=T(),l=Y(),[t,v]=i.useState(!1),m=D(),k=I(),z=u==null?void 0:u.neighbors,E=ae(),F=oe(),M=J(),g=Q(),w=(m==null?void 0:m.node_name)??(g==null?void 0:g.node_name)??null,B=i.useMemo(()=>({neighbors:z,srcHashMap:E,discoveredNodes:F}),[z,E,F]),d=i.useMemo(()=>{const e=(m==null?void 0:m.node_name)||(g==null?void 0:g.node_name)||(g==null?void 0:g.companion_name)||"Me";return m&&N(m.latitude,m.longitude)?{prefix:m.public_key.slice(0,2).toUpperCase(),name:e,lat:m.latitude,lng:m.longitude}:M&&N(M.latitude,M.longitude)?{prefix:"",name:e,lat:M.latitude,lng:M.longitude}:null},[m,g,M]),L=i.useMemo(()=>w?ce(p,c,k,w):null,[p,c,k,w]),G=i.useMemo(()=>L?ue(L,l):[],[L,l]),j=i.useMemo(()=>G.map(e=>{const s=ie(e.prefix,o,B);return{prefix:e.prefix,snr:e.snr,...s}}),[G,o,B]),y=i.useMemo(()=>j.filter(e=>e.hasGps),[j]),H=i.useMemo(()=>j.filter(e=>!e.hasGps),[j]),_=i.useMemo(()=>{if(!d||y.length===0)return[];const e=[d.lng,d.lat];return y.map(s=>{const h=[s.lng,s.lat];return{from:e,to:h,midpoint:[(e[0]+h[0])/2,(e[1]+h[1])/2]}})},[d,y]),W=i.useMemo(()=>_.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[_]),P=i.useMemo(()=>{if(typeof document>"u")return{amber:A,zinc:O};const e=getComputedStyle(document.documentElement),s=e.getPropertyValue("--sys-amber").trim(),h=e.getPropertyValue("--zinc-400").trim();return{amber:s.startsWith("#")?s:A,zinc:h.startsWith("#")?h:O}},[]),x=i.useMemo(()=>{if(!d||y.length===0)return null;let e=d.lat,s=d.lat,h=d.lng,S=d.lng;for(const b of y)b.lats&&(s=b.lat),b.lngS&&(S=b.lng);return[[h,e],[S,s]]},[d,y]),Z=i.useCallback(()=>{var s;const e=(s=n.current)==null?void 0:s.getMap();e&&x&&e.fitBounds(x,{padding:{top:40,bottom:44,left:56,right:56},maxZoom:14,duration:0}),v(!0)},[x]);if(!x||!d)return null;const R=[(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2];return a.jsxs("div",{className:V("relative rounded-lg overflow-hidden",f),style:{aspectRatio:"16 / 10"},children:[!t&&a.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:a.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),a.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:t?1:0},children:a.jsxs(te,{ref:n,initialViewState:{longitude:R[0],latitude:R[1],zoom:10},onLoad:Z,style:{height:"100%",width:"100%"},mapStyle:le[r],attributionControl:!1,interactive:!1,children:[_.map((e,s)=>a.jsx(ne,{id:`cecho-${s}`,type:"geojson",data:W[s],lineMetrics:!0,children:a.jsx(se,{id:`cecho-line-${s}`,type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,P.amber,1,P.zinc]},layout:{"line-cap":"round","line-join":"round"}})},`cecho-${s}`)),a.jsx($,{longitude:d.lng,latitude:d.lat,anchor:"center",children:a.jsx(U,{prefix:d.prefix,name:d.name,isLocal:!0,color:"amber"})}),y.map((e,s)=>a.jsx($,{longitude:e.lng,latitude:e.lat,anchor:"center",children:a.jsx(U,{prefix:e.prefix,name:e.name,isLocal:!1,color:"zinc"})},`cecho-node-${e.prefix}-${s}`))]})}),H.length>0&&a.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:H.map((e,s)=>a.jsxs(C,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[a.jsx(re,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&a.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cecho-unmap-${e.prefix}-${s}`))}),a.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:a.jsxs(C,{color:"green",className:"type-data-xs shadow-sm",children:[j.length," echo",j.length!==1?"es":""]})})]})}export{he as CompanionEchoMap}; +import{r as i,d0 as K,a6 as T,Q as Y,fO as D,au as I,cC as J,g7 as Q,Z as q,O as X,j as a,c as V,V as C,cF as ee}from"./index-CR6htdhJ.js";import{M as te,S as ne,L as se,a as $}from"./maplibre-gl-Df1NK1kQ.js";import{useSrcHashResolverMap as ae,useDiscoveredNodes as oe}from"./usePipelineStore-CyVtwxqQ.js";import{M as re}from"./map-pin-off-DzBgJ4-5.js";import"./node-types-BvQCDNK9.js";const le={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},A=X.amber,O=q[400],U=i.memo(function({prefix:c,name:o,isLocal:f,color:n}){const[r,u]=i.useState(!1);return a.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{pointerEvents:"auto"},children:a.jsxs(C,{color:n,filled:!0,className:V("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",r&&"relative z-50"),children:[f&&a.jsx(ee,{className:"w-2.5 h-2.5 mr-0.5"}),c&&a.jsx("span",{className:"font-mono",children:c}),r&&o&&a.jsx("span",{className:c?"ml-0.5 opacity-75":"",children:o})]})})});function N(p,c){return p==null||c==null?!1:p!==0||c!==0}function ie(p,c,o){var u;const f=p.toUpperCase(),n=c.find(l=>l.public_key.toUpperCase().startsWith(f));if(n&&N(n.gps_lat,n.gps_lon))return{name:n.name||null,lat:n.gps_lat,lng:n.gps_lon,hasGps:!0};if(o.neighbors){const l=Object.entries(o.neighbors).find(([t])=>t.toUpperCase().startsWith(f));if(l){const[,t]=l;if(N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}const r=o.srcHashMap.get(f);if(r){const l=o.discoveredNodes.get(r);if(l&&N(l.latitude,l.longitude))return{name:l.name||null,lat:l.latitude,lng:l.longitude,hasGps:!0};if(o.neighbors){const t=o.neighbors[r];if(t&&N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}return{name:(n==null?void 0:n.name)||(r?((u=o.discoveredNodes.get(r))==null?void 0:u.name)??null:null),lat:0,lng:0,hasGps:!1}}function ce(p,c,o,f){const n=Math.floor(c/30);for(const r of[n-1,n,n+1])for(const[u,l]of o){const t=l.decoded;if(!(t!=null&&t.decrypted)||t.senderName!==f)continue;const v=t.timestamp??l.timestamp;if(Math.floor(v/30)===r&&t.text===p)return u}return null}function ue(p,c){const o=new Set,f=[];for(const n of c){if(n.packet_hash!==p||n.packet_origin==="tx_local")continue;const r=n.original_path??n.forwarded_path;if(!r||r.length===0)continue;const u=r[r.length-1].toUpperCase();o.has(u)||(o.add(u),f.push({prefix:u,snr:n.snr}))}return f}function he({text:p,timestamp:c,contacts:o,className:f}){const n=i.useRef(null),r=K(),u=T(),l=Y(),[t,v]=i.useState(!1),m=D(),k=I(),z=u==null?void 0:u.neighbors,E=ae(),F=oe(),M=J(),g=Q(),w=(m==null?void 0:m.node_name)??(g==null?void 0:g.node_name)??null,B=i.useMemo(()=>({neighbors:z,srcHashMap:E,discoveredNodes:F}),[z,E,F]),d=i.useMemo(()=>{const e=(m==null?void 0:m.node_name)||(g==null?void 0:g.node_name)||(g==null?void 0:g.companion_name)||"Me";return m&&N(m.latitude,m.longitude)?{prefix:m.public_key.slice(0,2).toUpperCase(),name:e,lat:m.latitude,lng:m.longitude}:M&&N(M.latitude,M.longitude)?{prefix:"",name:e,lat:M.latitude,lng:M.longitude}:null},[m,g,M]),L=i.useMemo(()=>w?ce(p,c,k,w):null,[p,c,k,w]),G=i.useMemo(()=>L?ue(L,l):[],[L,l]),j=i.useMemo(()=>G.map(e=>{const s=ie(e.prefix,o,B);return{prefix:e.prefix,snr:e.snr,...s}}),[G,o,B]),y=i.useMemo(()=>j.filter(e=>e.hasGps),[j]),H=i.useMemo(()=>j.filter(e=>!e.hasGps),[j]),_=i.useMemo(()=>{if(!d||y.length===0)return[];const e=[d.lng,d.lat];return y.map(s=>{const h=[s.lng,s.lat];return{from:e,to:h,midpoint:[(e[0]+h[0])/2,(e[1]+h[1])/2]}})},[d,y]),W=i.useMemo(()=>_.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[_]),P=i.useMemo(()=>{if(typeof document>"u")return{amber:A,zinc:O};const e=getComputedStyle(document.documentElement),s=e.getPropertyValue("--sys-amber").trim(),h=e.getPropertyValue("--zinc-400").trim();return{amber:s.startsWith("#")?s:A,zinc:h.startsWith("#")?h:O}},[]),x=i.useMemo(()=>{if(!d||y.length===0)return null;let e=d.lat,s=d.lat,h=d.lng,S=d.lng;for(const b of y)b.lats&&(s=b.lat),b.lngS&&(S=b.lng);return[[h,e],[S,s]]},[d,y]),Z=i.useCallback(()=>{var s;const e=(s=n.current)==null?void 0:s.getMap();e&&x&&e.fitBounds(x,{padding:{top:40,bottom:44,left:56,right:56},maxZoom:14,duration:0}),v(!0)},[x]);if(!x||!d)return null;const R=[(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2];return a.jsxs("div",{className:V("relative rounded-lg overflow-hidden",f),style:{aspectRatio:"16 / 10"},children:[!t&&a.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:a.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),a.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:t?1:0},children:a.jsxs(te,{ref:n,initialViewState:{longitude:R[0],latitude:R[1],zoom:10},onLoad:Z,style:{height:"100%",width:"100%"},mapStyle:le[r],attributionControl:!1,interactive:!1,children:[_.map((e,s)=>a.jsx(ne,{id:`cecho-${s}`,type:"geojson",data:W[s],lineMetrics:!0,children:a.jsx(se,{id:`cecho-line-${s}`,type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,P.amber,1,P.zinc]},layout:{"line-cap":"round","line-join":"round"}})},`cecho-${s}`)),a.jsx($,{longitude:d.lng,latitude:d.lat,anchor:"center",children:a.jsx(U,{prefix:d.prefix,name:d.name,isLocal:!0,color:"amber"})}),y.map((e,s)=>a.jsx($,{longitude:e.lng,latitude:e.lat,anchor:"center",children:a.jsx(U,{prefix:e.prefix,name:e.name,isLocal:!1,color:"zinc"})},`cecho-node-${e.prefix}-${s}`))]})}),H.length>0&&a.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:H.map((e,s)=>a.jsxs(C,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[a.jsx(re,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&a.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cecho-unmap-${e.prefix}-${s}`))}),a.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:a.jsxs(C,{color:"green",className:"type-data-xs shadow-sm",children:[j.length," echo",j.length!==1?"es":""]})})]})}export{he as CompanionEchoMap}; diff --git a/frontend/dist/assets/CompanionPathMap-DAgjHpZ7.js b/frontend/dist/assets/CompanionPathMap-r_W6gfQA.js similarity index 96% rename from frontend/dist/assets/CompanionPathMap-DAgjHpZ7.js rename to frontend/dist/assets/CompanionPathMap-r_W6gfQA.js index b337982a..c8e07f2a 100644 --- a/frontend/dist/assets/CompanionPathMap-DAgjHpZ7.js +++ b/frontend/dist/assets/CompanionPathMap-r_W6gfQA.js @@ -1 +1 @@ -import{r as a,d0 as we,a6 as Le,cC as Re,g7 as ke,Z as de,O as T,j as t,c as J,bN as ve,dI as Pe,dJ as Ee,V as K,cF as _e}from"./index-Bcr7MabU.js";import{M as Ge,S as _,L as G,a as A}from"./maplibre-gl-CsF9Hmsz.js";import{useSrcHashResolverMap as Fe,useDiscoveredNodes as Ce}from"./usePipelineStore-nFeiBWWq.js";import{g as Oe,u as Ae,l as He,a as ze,m as $e,c as We,j as Be,k as Ie,p as De,r as Je,e as v,R as Ke}from"./useReplayTick-DfhG2SSf.js";import{C as re}from"./car-Cn7MZO12.js";import{M as Te}from"./map-pin-off-DbUyHIkr.js";import"./node-types-BFsObq9k.js";import"./payload-detail-jRk0k5AL.js";const Ve={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},Ue=de[500],ce=T.orange,ue=T.green,H=T.blue,D={type:"FeatureCollection",features:[]},Ye=a.memo(function({prefix:i,name:l,isLocal:p,color:o}){const[u,y]=a.useState(!1);return t.jsx("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),style:{pointerEvents:"auto"},children:t.jsxs(K,{color:o,filled:!0,className:J("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",u&&"relative z-50"),children:[p&&t.jsx(_e,{className:"w-2.5 h-2.5 mr-0.5"}),i&&t.jsx("span",{className:"font-mono",children:i}),u&&l&&t.jsx("span",{className:i?"ml-0.5 opacity-75":"",children:l})]})})});function P(f,i){return f==null||i==null?!1:f!==0||i!==0}function Ze(f,i,l){var o;const p=[];for(const u of f){const y=u.toUpperCase(),d=i.find(m=>m.public_key.toUpperCase().startsWith(y));if(d&&P(d.gps_lat,d.gps_lon)){p.push({prefix:u,name:d.name||null,lat:d.gps_lat,lng:d.gps_lon,isLocal:!1,hasGps:!0});continue}if(l.neighbors){const m=Object.entries(l.neighbors).find(([c])=>c.toUpperCase().startsWith(y));if(m){const[,c]=m;if(P(c.latitude,c.longitude)){p.push({prefix:u,name:c.node_name||c.name||null,lat:c.latitude,lng:c.longitude,isLocal:!1,hasGps:!0});continue}}}const M=l.srcHashMap.get(y);if(M){const m=l.discoveredNodes.get(M);if(m&&P(m.latitude,m.longitude)){p.push({prefix:u,name:m.name||null,lat:m.latitude,lng:m.longitude,isLocal:!1,hasGps:!0});continue}if(l.neighbors){const c=l.neighbors[M];if(c&&P(c.latitude,c.longitude)){p.push({prefix:u,name:c.node_name||c.name||null,lat:c.latitude,lng:c.longitude,isLocal:!1,hasGps:!0});continue}}}p.push({prefix:u,name:(d==null?void 0:d.name)||(M?((o=l.discoveredNodes.get(M))==null?void 0:o.name)??null:null),lat:0,lng:0,isLocal:!1,hasGps:!1})}return p}function Xe(f,i,l,p){const o=(i==null?void 0:i.node_name)||p||(l==null?void 0:l.name)||"Me";if(i&&P(i.latitude,i.longitude)){const u=i.public_key.slice(0,2).toUpperCase();return[...f,{prefix:u,name:o,lat:i.latitude,lng:i.longitude,isLocal:!0,hasGps:!0}]}return l&&P(l.latitude,l.longitude)?[...f,{prefix:"",name:o,lat:l.latitude,lng:l.longitude,isLocal:!0,hasGps:!0}]:f}function lt({hops:f,contacts:i,selfInfo:l,snr:p,wardriveCoords:o,wardriveSenderName:u,channelMessages:y,messageTimestamp:d,className:M}){const m=a.useRef(null),c=we(),z=Le(),[V,pe]=a.useState(!1),U=z==null?void 0:z.neighbors,Y=Fe(),Z=Ce(),X=Re(),L=ke(),q=a.useMemo(()=>({neighbors:U,srcHashMap:Y,discoveredNodes:Z}),[U,Y,Z]),R=a.useMemo(()=>{if(!(y!=null&&y.length)||!u||!d)return[];const e=Oe(y),n=d-86400;return e.filter(s=>s.senderName===u&&s.timestampS>=n&&s.timestampS<=d)},[y,u,d]),$=R.length>=2,E=a.useMemo(()=>`${u??"x"}-${d??0}`,[u,d]),me=Ae(),ge=He(),Q=ze(),w=$e(),fe=We(),x=Be();Ie();const g=me&&ge===E,W=g&&x.length>0?Math.round(Math.max(0,Math.min(x.length-1,w))):-1,ee=a.useMemo(()=>{var e;return W>=0?((e=x[W])==null?void 0:e.pathHops)??f:f},[W,x,f]),te=(L==null?void 0:L.node_name)??(L==null?void 0:L.companion_name)??null,N=a.useMemo(()=>{const e=Ze(ee,i,q);return Xe(e,l,X,te)},[ee,i,q,l,X,te]),h=a.useMemo(()=>N.filter(e=>e.hasGps),[N]),ne=a.useMemo(()=>N.filter(e=>!e.hasGps),[N]),F=a.useMemo(()=>{const e=[];if(h.length<2)return e;const n=[];for(let s=0;sF.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[F]),se=a.useMemo(()=>{if(typeof document>"u")return Ue;const e=getComputedStyle(document.documentElement).getPropertyValue("--zinc-400").trim();return e.startsWith("#")?e:de[400]},[]),C=a.useMemo(()=>{if(!o||h.length===0)return null;const e=[o.lon,o.lat],n=h[0];return{from:e,to:[n.lng,n.lat]}},[o,h]),oe=a.useMemo(()=>C?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[C.from,C.to]}}]}:null,[C]),ae=a.useMemo(()=>{if(typeof document>"u")return{orange:ce,green:ue};const e=getComputedStyle(document.documentElement),n=e.getPropertyValue("--sys-orange").trim(),s=e.getPropertyValue("--sys-green").trim();return{orange:n.startsWith("#")?n:ce,green:s.startsWith("#")?s:ue}},[]),k=a.useMemo(()=>g?De(x,w):null,[g,x,w]),ye=a.useMemo(()=>{if(!g)return D;const e=Je(x,w);return e.length<2?D:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}},[g,x,w]),xe=a.useMemo(()=>!g||x.length===0?D:{type:"FeatureCollection",features:x.map((e,n)=>({type:"Feature",properties:{index:n},geometry:{type:"Point",coordinates:[e.lon,e.lat]}}))},[g,x]);a.useEffect(()=>()=>{const e=v.getState();e.ownerKey===E&&e.stopRewind()},[E]);const be=x.length,O=Math.max(0,be-1),je=O>0?w/O:1,Ne=Math.round(O-w),S=a.useMemo(()=>{if(h.length+(o?1:0)+R.length<2)return null;let n=1/0,s=-1/0,b=1/0,j=-1/0;for(const r of h)r.lats&&(s=r.lat),r.lngj&&(j=r.lng);o&&(o.lats&&(s=o.lat),o.lonj&&(j=o.lon));for(const r of R)r.lats&&(s=r.lat),r.lonj&&(j=r.lon);return[[b,n],[j,s]]},[h,o,R]),Se=a.useCallback(()=>{v.getState().stopRewind()},[]),Me=a.useCallback(()=>{var n;const e=(n=m.current)==null?void 0:n.getMap();e&&S&&e.fitBounds(S,{padding:{top:40,bottom:$?52:44,left:56,right:56},maxZoom:14,duration:0}),pe(!0),$&&v.getState().startRewind(R,E)},[S,$,R,E]);if(!S)return null;const le=[(S[0][0]+S[1][0])/2,(S[0][1]+S[1][1])/2];return t.jsxs("div",{className:J("relative rounded-lg overflow-hidden",M),style:{aspectRatio:"16 / 10"},children:[!V&&t.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:t.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:V?1:0},children:t.jsxs(Ge,{ref:m,initialViewState:{longitude:le[0],latitude:le[1],zoom:10},onLoad:Me,style:{height:"100%",width:"100%"},mapStyle:Ve[c],attributionControl:!1,interactive:g,children:[oe&&!g&&t.jsx(_,{id:"cwd-edge",type:"geojson",data:oe,lineMetrics:!0,children:t.jsx(G,{id:"cwd-edge-line",type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,ae.orange,1,ae.green]},layout:{"line-cap":"round","line-join":"round"}})}),o&&!g&&t.jsx(A,{longitude:o.lon,latitude:o.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center",style:{pointerEvents:"auto"},children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(re,{className:"w-4 h-4",strokeWidth:2.5})})})}),F.map((e,n)=>t.jsx(_,{id:`cedge-${n}`,type:"geojson",data:he[n],children:t.jsx(G,{id:`cedge-line-${n}`,type:"line",paint:{"line-color":se,"line-width":2,"line-opacity":.85},layout:{"line-cap":"round","line-join":"round"}})},`cedge-${n}`)),F.map((e,n)=>t.jsx(A,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx("span",{className:"w-4.5 h-4.5 rounded-full flex items-center justify-center font-mono font-extrabold tabular-nums shadow-md pointer-events-none",style:{backgroundColor:se,color:"#fff",fontSize:"10px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:e.hopNumber})},`chop-${n}`)),h.map((e,n)=>{const s=n===0,b=n===h.length-1,j=e.isLocal?"amber":s?"green":b?"amber":"zinc";return t.jsx(A,{longitude:e.lng,latitude:e.lat,anchor:"center",children:t.jsx(Ye,{prefix:e.prefix,name:e.name,isLocal:e.isLocal,color:j})},`cnode-${e.prefix}-${n}`)}),g&&t.jsxs(t.Fragment,{children:[t.jsx(_,{id:"replay-dots",type:"geojson",data:xe,children:t.jsx(G,{id:"replay-dots-circle",type:"circle",paint:{"circle-radius":3,"circle-color":H,"circle-opacity":.35,"circle-stroke-width":1,"circle-stroke-color":H,"circle-stroke-opacity":.15}})}),t.jsx(_,{id:"replay-trail",type:"geojson",data:ye,children:t.jsx(G,{id:"replay-trail-line",type:"line",paint:{"line-color":H,"line-width":3,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"}})}),k&&h.length>0&&t.jsx(_,{id:"replay-path-link",type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[[k.lon,k.lat],[h[0].lng,h[0].lat]]}}]},children:t.jsx(G,{id:"replay-path-link-line",type:"line",paint:{"line-color":H,"line-width":1.5,"line-opacity":.5,"line-dasharray":[3,2]},layout:{"line-cap":"round"}})}),k&&t.jsx(A,{longitude:k.lon,latitude:k.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(re,{className:"w-4 h-4",strokeWidth:2.5})})})]})]})}),g&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 right-1.5 z-10",onClick:e=>e.stopPropagation(),children:t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 rounded-md bg-body/90 backdrop-blur-sm border border-edge-subtle shadow-lg",children:[t.jsx("button",{onClick:Se,className:"p-0.5 rounded text-fg-muted hover:text-fg-primary transition-colors shrink-0",title:"Stop rewind",children:t.jsx(ve,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>v.getState().togglePlay(),className:"p-1 rounded-full bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 transition-colors shrink-0",title:Q?"Pause":"Rewind",children:Q?t.jsx(Pe,{className:"w-3 h-3"}):t.jsx(Ee,{className:"w-3 h-3"})}),t.jsx("input",{type:"range",min:0,max:100,step:.1,value:je*100,onChange:e=>{const n=parseFloat(e.target.value)/100;v.getState().seek(n)},className:"flex-1 min-w-0 h-1 appearance-none bg-edge-subtle rounded-full cursor-pointer accent-sys-blue"}),t.jsxs("span",{className:"text-[9px] tabular-nums text-fg-muted whitespace-nowrap shrink-0",children:[Ne,"/",O," pkts"]}),t.jsx("div",{className:"flex items-center gap-px shrink-0",children:Ke.map(e=>t.jsxs("button",{onClick:()=>v.getState().setSpeed(e),className:J("px-1 py-0.5 rounded text-[9px] font-medium transition-colors",e===fe?"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary"),children:[e,"×"]},e))})]})}),!g&&ne.length>0&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:ne.map((e,n)=>t.jsxs(K,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[t.jsx(Te,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&t.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cunmap-${e.prefix}-${n}`))}),!g&&p!=null&&t.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:t.jsxs(K,{color:"zinc",className:"type-data-xs shadow-sm",children:[p>0?"+":"",p.toFixed(1)," dB"]})})]})}export{lt as CompanionPathMap}; +import{r as a,d0 as we,a6 as Le,cC as Re,g7 as ke,Z as de,O as T,j as t,c as J,bN as ve,dI as Pe,dJ as Ee,V as K,cF as _e}from"./index-CR6htdhJ.js";import{M as Ge,S as _,L as G,a as A}from"./maplibre-gl-Df1NK1kQ.js";import{useSrcHashResolverMap as Fe,useDiscoveredNodes as Ce}from"./usePipelineStore-CyVtwxqQ.js";import{g as Oe,u as Ae,l as He,a as ze,m as $e,c as We,j as Be,k as Ie,p as De,r as Je,e as v,R as Ke}from"./useReplayTick-DoGUoba6.js";import{C as re}from"./car-BDe4EgpC.js";import{M as Te}from"./map-pin-off-DzBgJ4-5.js";import"./node-types-BvQCDNK9.js";import"./payload-detail-B6eeo8Zi.js";const Ve={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},Ue=de[500],ce=T.orange,ue=T.green,H=T.blue,D={type:"FeatureCollection",features:[]},Ye=a.memo(function({prefix:i,name:l,isLocal:p,color:o}){const[u,y]=a.useState(!1);return t.jsx("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),style:{pointerEvents:"auto"},children:t.jsxs(K,{color:o,filled:!0,className:J("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",u&&"relative z-50"),children:[p&&t.jsx(_e,{className:"w-2.5 h-2.5 mr-0.5"}),i&&t.jsx("span",{className:"font-mono",children:i}),u&&l&&t.jsx("span",{className:i?"ml-0.5 opacity-75":"",children:l})]})})});function P(f,i){return f==null||i==null?!1:f!==0||i!==0}function Ze(f,i,l){var o;const p=[];for(const u of f){const y=u.toUpperCase(),d=i.find(m=>m.public_key.toUpperCase().startsWith(y));if(d&&P(d.gps_lat,d.gps_lon)){p.push({prefix:u,name:d.name||null,lat:d.gps_lat,lng:d.gps_lon,isLocal:!1,hasGps:!0});continue}if(l.neighbors){const m=Object.entries(l.neighbors).find(([c])=>c.toUpperCase().startsWith(y));if(m){const[,c]=m;if(P(c.latitude,c.longitude)){p.push({prefix:u,name:c.node_name||c.name||null,lat:c.latitude,lng:c.longitude,isLocal:!1,hasGps:!0});continue}}}const M=l.srcHashMap.get(y);if(M){const m=l.discoveredNodes.get(M);if(m&&P(m.latitude,m.longitude)){p.push({prefix:u,name:m.name||null,lat:m.latitude,lng:m.longitude,isLocal:!1,hasGps:!0});continue}if(l.neighbors){const c=l.neighbors[M];if(c&&P(c.latitude,c.longitude)){p.push({prefix:u,name:c.node_name||c.name||null,lat:c.latitude,lng:c.longitude,isLocal:!1,hasGps:!0});continue}}}p.push({prefix:u,name:(d==null?void 0:d.name)||(M?((o=l.discoveredNodes.get(M))==null?void 0:o.name)??null:null),lat:0,lng:0,isLocal:!1,hasGps:!1})}return p}function Xe(f,i,l,p){const o=(i==null?void 0:i.node_name)||p||(l==null?void 0:l.name)||"Me";if(i&&P(i.latitude,i.longitude)){const u=i.public_key.slice(0,2).toUpperCase();return[...f,{prefix:u,name:o,lat:i.latitude,lng:i.longitude,isLocal:!0,hasGps:!0}]}return l&&P(l.latitude,l.longitude)?[...f,{prefix:"",name:o,lat:l.latitude,lng:l.longitude,isLocal:!0,hasGps:!0}]:f}function lt({hops:f,contacts:i,selfInfo:l,snr:p,wardriveCoords:o,wardriveSenderName:u,channelMessages:y,messageTimestamp:d,className:M}){const m=a.useRef(null),c=we(),z=Le(),[V,pe]=a.useState(!1),U=z==null?void 0:z.neighbors,Y=Fe(),Z=Ce(),X=Re(),L=ke(),q=a.useMemo(()=>({neighbors:U,srcHashMap:Y,discoveredNodes:Z}),[U,Y,Z]),R=a.useMemo(()=>{if(!(y!=null&&y.length)||!u||!d)return[];const e=Oe(y),n=d-86400;return e.filter(s=>s.senderName===u&&s.timestampS>=n&&s.timestampS<=d)},[y,u,d]),$=R.length>=2,E=a.useMemo(()=>`${u??"x"}-${d??0}`,[u,d]),me=Ae(),ge=He(),Q=ze(),w=$e(),fe=We(),x=Be();Ie();const g=me&&ge===E,W=g&&x.length>0?Math.round(Math.max(0,Math.min(x.length-1,w))):-1,ee=a.useMemo(()=>{var e;return W>=0?((e=x[W])==null?void 0:e.pathHops)??f:f},[W,x,f]),te=(L==null?void 0:L.node_name)??(L==null?void 0:L.companion_name)??null,N=a.useMemo(()=>{const e=Ze(ee,i,q);return Xe(e,l,X,te)},[ee,i,q,l,X,te]),h=a.useMemo(()=>N.filter(e=>e.hasGps),[N]),ne=a.useMemo(()=>N.filter(e=>!e.hasGps),[N]),F=a.useMemo(()=>{const e=[];if(h.length<2)return e;const n=[];for(let s=0;sF.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[F]),se=a.useMemo(()=>{if(typeof document>"u")return Ue;const e=getComputedStyle(document.documentElement).getPropertyValue("--zinc-400").trim();return e.startsWith("#")?e:de[400]},[]),C=a.useMemo(()=>{if(!o||h.length===0)return null;const e=[o.lon,o.lat],n=h[0];return{from:e,to:[n.lng,n.lat]}},[o,h]),oe=a.useMemo(()=>C?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[C.from,C.to]}}]}:null,[C]),ae=a.useMemo(()=>{if(typeof document>"u")return{orange:ce,green:ue};const e=getComputedStyle(document.documentElement),n=e.getPropertyValue("--sys-orange").trim(),s=e.getPropertyValue("--sys-green").trim();return{orange:n.startsWith("#")?n:ce,green:s.startsWith("#")?s:ue}},[]),k=a.useMemo(()=>g?De(x,w):null,[g,x,w]),ye=a.useMemo(()=>{if(!g)return D;const e=Je(x,w);return e.length<2?D:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}},[g,x,w]),xe=a.useMemo(()=>!g||x.length===0?D:{type:"FeatureCollection",features:x.map((e,n)=>({type:"Feature",properties:{index:n},geometry:{type:"Point",coordinates:[e.lon,e.lat]}}))},[g,x]);a.useEffect(()=>()=>{const e=v.getState();e.ownerKey===E&&e.stopRewind()},[E]);const be=x.length,O=Math.max(0,be-1),je=O>0?w/O:1,Ne=Math.round(O-w),S=a.useMemo(()=>{if(h.length+(o?1:0)+R.length<2)return null;let n=1/0,s=-1/0,b=1/0,j=-1/0;for(const r of h)r.lats&&(s=r.lat),r.lngj&&(j=r.lng);o&&(o.lats&&(s=o.lat),o.lonj&&(j=o.lon));for(const r of R)r.lats&&(s=r.lat),r.lonj&&(j=r.lon);return[[b,n],[j,s]]},[h,o,R]),Se=a.useCallback(()=>{v.getState().stopRewind()},[]),Me=a.useCallback(()=>{var n;const e=(n=m.current)==null?void 0:n.getMap();e&&S&&e.fitBounds(S,{padding:{top:40,bottom:$?52:44,left:56,right:56},maxZoom:14,duration:0}),pe(!0),$&&v.getState().startRewind(R,E)},[S,$,R,E]);if(!S)return null;const le=[(S[0][0]+S[1][0])/2,(S[0][1]+S[1][1])/2];return t.jsxs("div",{className:J("relative rounded-lg overflow-hidden",M),style:{aspectRatio:"16 / 10"},children:[!V&&t.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:t.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:V?1:0},children:t.jsxs(Ge,{ref:m,initialViewState:{longitude:le[0],latitude:le[1],zoom:10},onLoad:Me,style:{height:"100%",width:"100%"},mapStyle:Ve[c],attributionControl:!1,interactive:g,children:[oe&&!g&&t.jsx(_,{id:"cwd-edge",type:"geojson",data:oe,lineMetrics:!0,children:t.jsx(G,{id:"cwd-edge-line",type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,ae.orange,1,ae.green]},layout:{"line-cap":"round","line-join":"round"}})}),o&&!g&&t.jsx(A,{longitude:o.lon,latitude:o.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center",style:{pointerEvents:"auto"},children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(re,{className:"w-4 h-4",strokeWidth:2.5})})})}),F.map((e,n)=>t.jsx(_,{id:`cedge-${n}`,type:"geojson",data:he[n],children:t.jsx(G,{id:`cedge-line-${n}`,type:"line",paint:{"line-color":se,"line-width":2,"line-opacity":.85},layout:{"line-cap":"round","line-join":"round"}})},`cedge-${n}`)),F.map((e,n)=>t.jsx(A,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx("span",{className:"w-4.5 h-4.5 rounded-full flex items-center justify-center font-mono font-extrabold tabular-nums shadow-md pointer-events-none",style:{backgroundColor:se,color:"#fff",fontSize:"10px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:e.hopNumber})},`chop-${n}`)),h.map((e,n)=>{const s=n===0,b=n===h.length-1,j=e.isLocal?"amber":s?"green":b?"amber":"zinc";return t.jsx(A,{longitude:e.lng,latitude:e.lat,anchor:"center",children:t.jsx(Ye,{prefix:e.prefix,name:e.name,isLocal:e.isLocal,color:j})},`cnode-${e.prefix}-${n}`)}),g&&t.jsxs(t.Fragment,{children:[t.jsx(_,{id:"replay-dots",type:"geojson",data:xe,children:t.jsx(G,{id:"replay-dots-circle",type:"circle",paint:{"circle-radius":3,"circle-color":H,"circle-opacity":.35,"circle-stroke-width":1,"circle-stroke-color":H,"circle-stroke-opacity":.15}})}),t.jsx(_,{id:"replay-trail",type:"geojson",data:ye,children:t.jsx(G,{id:"replay-trail-line",type:"line",paint:{"line-color":H,"line-width":3,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"}})}),k&&h.length>0&&t.jsx(_,{id:"replay-path-link",type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[[k.lon,k.lat],[h[0].lng,h[0].lat]]}}]},children:t.jsx(G,{id:"replay-path-link-line",type:"line",paint:{"line-color":H,"line-width":1.5,"line-opacity":.5,"line-dasharray":[3,2]},layout:{"line-cap":"round"}})}),k&&t.jsx(A,{longitude:k.lon,latitude:k.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(re,{className:"w-4 h-4",strokeWidth:2.5})})})]})]})}),g&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 right-1.5 z-10",onClick:e=>e.stopPropagation(),children:t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 rounded-md bg-body/90 backdrop-blur-sm border border-edge-subtle shadow-lg",children:[t.jsx("button",{onClick:Se,className:"p-0.5 rounded text-fg-muted hover:text-fg-primary transition-colors shrink-0",title:"Stop rewind",children:t.jsx(ve,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>v.getState().togglePlay(),className:"p-1 rounded-full bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 transition-colors shrink-0",title:Q?"Pause":"Rewind",children:Q?t.jsx(Pe,{className:"w-3 h-3"}):t.jsx(Ee,{className:"w-3 h-3"})}),t.jsx("input",{type:"range",min:0,max:100,step:.1,value:je*100,onChange:e=>{const n=parseFloat(e.target.value)/100;v.getState().seek(n)},className:"flex-1 min-w-0 h-1 appearance-none bg-edge-subtle rounded-full cursor-pointer accent-sys-blue"}),t.jsxs("span",{className:"text-[9px] tabular-nums text-fg-muted whitespace-nowrap shrink-0",children:[Ne,"/",O," pkts"]}),t.jsx("div",{className:"flex items-center gap-px shrink-0",children:Ke.map(e=>t.jsxs("button",{onClick:()=>v.getState().setSpeed(e),className:J("px-1 py-0.5 rounded text-[9px] font-medium transition-colors",e===fe?"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary"),children:[e,"×"]},e))})]})}),!g&&ne.length>0&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:ne.map((e,n)=>t.jsxs(K,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[t.jsx(Te,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&t.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cunmap-${e.prefix}-${n}`))}),!g&&p!=null&&t.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:t.jsxs(K,{color:"zinc",className:"type-data-xs shadow-sm",children:[p>0?"+":"",p.toFixed(1)," dB"]})})]})}export{lt as CompanionPathMap}; diff --git a/frontend/dist/assets/Configuration-B3NvfCFZ.js b/frontend/dist/assets/Configuration-CFIFEleu.js similarity index 98% rename from frontend/dist/assets/Configuration-B3NvfCFZ.js rename to frontend/dist/assets/Configuration-CFIFEleu.js index fa1ca87d..4a4f9548 100644 --- a/frontend/dist/assets/Configuration-B3NvfCFZ.js +++ b/frontend/dist/assets/Configuration-CFIFEleu.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/latin-400-BcR6IdUc.css","assets/latin-500-DCnAHIrw.css","assets/latin-600-CnkPk-vb.css","assets/latin-700-UC1i-VSI.css"])))=>i.map(i=>d[i]); -import{e as we,r as a,j as e,c as m,ev as Is,cU as ie,a2 as G,a0 as Y,bN as Z,aF as Ie,ew as Oe,ex as os,ey as as,_ as Me,a8 as fe,E as jt,S as vt,ez as Nt,a7 as W,cv as cs,eA as wt,B as L,V as ns,eB as Ks,bZ as Pe,X as Xs,eC as kt,a6 as _t,aE as Os,c4 as St,c8 as ls,dV as Ws,eD as Ct,eE as zs,eF as Tt,eG as Ft,eH as Et,aa as Rt,eI as Ye,I as Mt,a1 as Dt,a3 as At}from"./index-Bcr7MabU.js";import{g as Pt,a as Lt,c as It,r as Kt,s as Ot,b as zt,u as Vt,d as $t}from"./system-0ZU2C0Q5.js";import{C as Ht}from"./ConfirmModal-CvAkhuom.js";import{S as Ut,A as qt,a as Bt,N as Gt}from"./AutoConfigureDialog-nQzi_zPM.js";import{W as rs}from"./wand-sparkles-D_MagcvJ.js";import{P as is,F as Vs}from"./pencil-C-yivzpx.js";import{i as Xt,g as Wt,s as Jt,a as Yt,k as Qt}from"./keycap-sfx-ByZp-njj.js";import{C as J,P as Zt,a as ea,B as sa}from"./PageLayout-Bd1lZEvE.js";import{T as Js}from"./trash-2-Dyph4AYl.js";import{R as ta}from"./rotate-ccw-C1kT5MK1.js";import{S as aa}from"./shield-CcCTQoJ7.js";import{R as na}from"./repeat-BW0T0cvm.js";import{G as la}from"./git-branch-CzidlvuL.js";import{C as ra}from"./clock-vUFydv3d.js";import{C as Ys}from"./chevron-right-BrHsAUr1.js";import{R as se,C as ue}from"./Grid-ChpC-NJE.js";import{A as ia}from"./antenna-2HP9MLCI.js";import{P as $s}from"./plus-DZIbd-kZ.js";import{K as Hs}from"./key-round-CzmFaK7Z.js";import"./arrow-right-Bv8RdUpJ.js";/** +import{e as we,r as a,j as e,c as m,ev as Is,cU as ie,a2 as G,a0 as Y,bN as Z,aF as Ie,ew as Oe,ex as os,ey as as,_ as Me,a8 as fe,E as jt,S as vt,ez as Nt,a7 as W,cv as cs,eA as wt,B as L,V as ns,eB as Ks,bZ as Pe,X as Xs,eC as kt,a6 as _t,aE as Os,c4 as St,c8 as ls,dV as Ws,eD as Ct,eE as zs,eF as Tt,eG as Ft,eH as Et,aa as Rt,eI as Ye,I as Mt,a1 as Dt,a3 as At}from"./index-CR6htdhJ.js";import{g as Pt,a as Lt,c as It,r as Kt,s as Ot,b as zt,u as Vt,d as $t}from"./system-BR9AxlO1.js";import{C as Ht}from"./ConfirmModal-CijEsZrl.js";import{S as Ut,A as qt,a as Bt,N as Gt}from"./AutoConfigureDialog-BizEoaly.js";import{W as rs}from"./wand-sparkles-qgdZS22e.js";import{P as is,F as Vs}from"./pencil-JjdQp1l1.js";import{i as Xt,g as Wt,s as Jt,a as Yt,k as Qt}from"./keycap-sfx-ByZp-njj.js";import{C as J,P as Zt,a as ea,B as sa}from"./PageLayout-Dk902Dlo.js";import{T as Js}from"./trash-2-DDi3fVjz.js";import{R as ta}from"./rotate-ccw-D8J04SFo.js";import{S as aa}from"./shield-Bd_LbwYW.js";import{R as na}from"./repeat-5Hqru-wI.js";import{G as la}from"./git-branch-94MoMaKB.js";import{C as ra}from"./clock-BFNcreJN.js";import{C as Ys}from"./chevron-right-D2DgrpVm.js";import{R as se,C as ue}from"./Grid-D3Ix759E.js";import{A as ia}from"./antenna-Bv3MESsD.js";import{P as $s}from"./plus-CfHg5JLg.js";import{K as Hs}from"./key-round-CTDlyfAN.js";import"./arrow-right-3jiFJDYq.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConfirmModal-CvAkhuom.js b/frontend/dist/assets/ConfirmModal-CijEsZrl.js similarity index 91% rename from frontend/dist/assets/ConfirmModal-CvAkhuom.js rename to frontend/dist/assets/ConfirmModal-CijEsZrl.js index eb607f95..f892d56d 100644 --- a/frontend/dist/assets/ConfirmModal-CvAkhuom.js +++ b/frontend/dist/assets/ConfirmModal-CijEsZrl.js @@ -1 +1 @@ -import{r as d,j as s,aC as x,aL as m,bZ as g,c as C,aD as f,eJ as j,B as o}from"./index-Bcr7MabU.js";const u={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},p={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:a="default",onConfirm:c,onCancel:e}){return s.jsxs(x,{open:n,onClose:e,size:"sm",children:[s.jsx(m,{icon:s.jsx(g,{className:C("w-5 h-5",u[a])}),title:r,onClose:e}),s.jsx(f,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(j,{children:[s.jsx(o,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(o,{color:p[a],onClick:c,className:"flex-1",children:t})]})]})}const y=d.memo(N);export{y as C}; +import{r as d,j as s,aC as x,aL as m,bZ as g,c as C,aD as f,eJ as j,B as o}from"./index-CR6htdhJ.js";const u={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},p={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:a="default",onConfirm:c,onCancel:e}){return s.jsxs(x,{open:n,onClose:e,size:"sm",children:[s.jsx(m,{icon:s.jsx(g,{className:C("w-5 h-5",u[a])}),title:r,onClose:e}),s.jsx(f,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(j,{children:[s.jsx(o,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(o,{color:p[a],onClick:c,className:"flex-1",children:t})]})]})}const y=d.memo(N);export{y as C}; diff --git a/frontend/dist/assets/Contacts-DL1IltrR.js b/frontend/dist/assets/Contacts-BRAnAiI8.js similarity index 91% rename from frontend/dist/assets/Contacts-DL1IltrR.js rename to frontend/dist/assets/Contacts-BRAnAiI8.js index 683344c9..2da2b949 100644 --- a/frontend/dist/assets/Contacts-DL1IltrR.js +++ b/frontend/dist/assets/Contacts-BRAnAiI8.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-BDcZA1Ui.js","assets/index-Bcr7MabU.js","assets/consumer-registry-Dy-EEMxV.js","assets/link-scoring-BhS4yAyO.js","assets/ConfirmModal-CvAkhuom.js","assets/variants-Dh1uX6Aa.js","assets/git-branch-CzidlvuL.js","assets/database-DdKGqHhF.js","assets/useMapViewStore-DqjoQCEZ.js","assets/index-we8JTzK8.js","assets/index-BbwbpcoC.js","assets/target-3KNT7m1p.js","assets/funnel-DFQf6jmi.js","assets/plus-DZIbd-kZ.js","assets/compass-D-aH3UW_.js","assets/zap-D8PO3IgR.js","assets/max-3Pc3oKmC.js","assets/trash-2-Dyph4AYl.js","assets/wifi-off-B_wOGsPk.js","assets/wifi-D7y3h36J.js","assets/circle-alert-CbWxNnM7.js","assets/clock-vUFydv3d.js","assets/chevron-right-BrHsAUr1.js","assets/useReplayTick-DfhG2SSf.js","assets/payload-detail-jRk0k5AL.js","assets/LightSparkline-DI3I2Qod.js","assets/badge-colors-Dl76Mz8m.js","assets/map-pin-CmfqMW3N.js","assets/node-types-BFsObq9k.js","assets/BasemapLayer-A-p_Dr5u.js","assets/easing-CUJ3Hgok.js","assets/usePipelineStore-nFeiBWWq.js","assets/PageLayout-Bd1lZEvE.js","assets/listbox-D38oqfIZ.js","assets/element-movement-DUifCLY7.js","assets/use-text-value-B9WhdAMT.js","assets/frozen-Csgg4u-n.js","assets/MqttModeBadge-CrJ5xyVU.js","assets/chat-utils-lxurr5ix.js","assets/SignalIndicator-CYjIo_Mn.js","assets/CollisionExplorerModal-Y6S5TUlx.js","assets/share-2-CBcJN8r0.js","assets/circle-question-mark-CHrfUdMk.js","assets/map-pin-off-DbUyHIkr.js","assets/activity-BHsjc-ov.js","assets/search-D6EZ95nX.js","assets/index-7uzBcJ1E.css","assets/maplibre-gl-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); -import{e as xe,ar as cs,j as e,r as n,_ as is,cq as He,cr as Oe,ao as W,a0 as Ce,cs as ls,ct as me,aa as de,c4 as ds,az as Ie,cu as ye,a2 as ze,cv as ms,ac as xs,cw as us,cx as ps,cy as hs,ab as fs,cz as gs,cA as js,ad as bs,aA as ys,ae as Ne,cB as Ns,cC as vs,cD as ws,cE as Cs,bJ as ee,cF as $e,Y as ks,I as Ms,bN as Ss,c as we}from"./index-Bcr7MabU.js";import{useDiscoveredNodes as Ps}from"./usePipelineStore-nFeiBWWq.js";import{c as ke}from"./node-types-BFsObq9k.js";import{P as _s,a as Rs,B as Ls}from"./PageLayout-Bd1lZEvE.js";import{L as Ts,a as le}from"./listbox-D38oqfIZ.js";import{T as Fe,M as $s}from"./MqttModeBadge-CrJ5xyVU.js";import{u as Fs,e as Es,f as Hs,r as Os}from"./consumer-registry-Dy-EEMxV.js";import{e as Is,g as zs,a as Ds}from"./chat-utils-lxurr5ix.js";import{b as Bs}from"./SignalIndicator-CYjIo_Mn.js";import{C as As}from"./CollisionExplorerModal-Y6S5TUlx.js";import{E as qs,T as Vs}from"./target-3KNT7m1p.js";import{S as Us}from"./share-2-CBcJN8r0.js";import{C as De}from"./circle-question-mark-CHrfUdMk.js";import{M as Ws}from"./map-pin-off-DbUyHIkr.js";import{A as Be}from"./activity-BHsjc-ov.js";import{T as Gs}from"./trash-2-Dyph4AYl.js";import{C as Qs}from"./ConfirmModal-CvAkhuom.js";import{M as Js}from"./map-pin-CmfqMW3N.js";import{S as Xs}from"./search-D6EZ95nX.js";import{C as Ys}from"./clock-vUFydv3d.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-DQCbo0KF.js","assets/index-CR6htdhJ.js","assets/consumer-registry-7Hi_pNJ6.js","assets/link-scoring-D8OLMCQf.js","assets/ConfirmModal-CijEsZrl.js","assets/variants-B-xhsx06.js","assets/git-branch-94MoMaKB.js","assets/database-B1i3odU4.js","assets/useMapViewStore-Dst_TEXH.js","assets/index-BtT4gFCt.js","assets/index-CnoLcwbn.js","assets/target-Bmhgwg_g.js","assets/funnel-4oboVPXr.js","assets/plus-CfHg5JLg.js","assets/compass-fAtfJAIE.js","assets/zap-BpXirfUQ.js","assets/max-BHszoqgD.js","assets/trash-2-DDi3fVjz.js","assets/wifi-off-h3izwtpW.js","assets/wifi-DFzHXMz6.js","assets/circle-alert-BFYzxudo.js","assets/clock-BFNcreJN.js","assets/chevron-right-D2DgrpVm.js","assets/useReplayTick-DoGUoba6.js","assets/payload-detail-B6eeo8Zi.js","assets/LightSparkline-B480JOwC.js","assets/badge-colors-Dl76Mz8m.js","assets/map-pin-DLf5Z8nk.js","assets/node-types-BvQCDNK9.js","assets/BasemapLayer-B6qv9zHt.js","assets/easing-D4193t8J.js","assets/usePipelineStore-CyVtwxqQ.js","assets/PageLayout-Dk902Dlo.js","assets/listbox-DbdSXuSb.js","assets/element-movement-DIPTY4wV.js","assets/use-text-value-Ch4p-2-R.js","assets/frozen-i7Ib99V7.js","assets/MqttModeBadge-_nVkYyqI.js","assets/chat-utils-DHa6YwrS.js","assets/SignalIndicator-ClMJO5cF.js","assets/CollisionExplorerModal-BjNF8_2U.js","assets/share-2-Cm0TgUDc.js","assets/circle-question-mark-BTap0a_9.js","assets/map-pin-off-DzBgJ4-5.js","assets/activity-B1_-JLqt.js","assets/search-Djg1V5_Y.js","assets/index-7uzBcJ1E.css","assets/maplibre-gl-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); +import{e as xe,ar as cs,j as e,r as n,_ as is,cq as He,cr as Oe,ao as W,a0 as Ce,cs as ls,ct as me,aa as de,c4 as ds,az as Ie,cu as ye,a2 as ze,cv as ms,ac as xs,cw as us,cx as ps,cy as hs,ab as fs,cz as gs,cA as js,ad as bs,aA as ys,ae as Ne,cB as Ns,cC as vs,cD as ws,cE as Cs,bJ as ee,cF as $e,Y as ks,I as Ms,bN as Ss,c as we}from"./index-CR6htdhJ.js";import{useDiscoveredNodes as Ps}from"./usePipelineStore-CyVtwxqQ.js";import{c as ke}from"./node-types-BvQCDNK9.js";import{P as _s,a as Rs,B as Ls}from"./PageLayout-Dk902Dlo.js";import{L as Ts,a as le}from"./listbox-DbdSXuSb.js";import{T as Fe,M as $s}from"./MqttModeBadge-_nVkYyqI.js";import{u as Fs,e as Es,f as Hs,r as Os}from"./consumer-registry-7Hi_pNJ6.js";import{e as Is,g as zs,a as Ds}from"./chat-utils-DHa6YwrS.js";import{b as Bs}from"./SignalIndicator-ClMJO5cF.js";import{C as As}from"./CollisionExplorerModal-BjNF8_2U.js";import{E as qs,T as Vs}from"./target-Bmhgwg_g.js";import{S as Us}from"./share-2-Cm0TgUDc.js";import{C as De}from"./circle-question-mark-BTap0a_9.js";import{M as Ws}from"./map-pin-off-DzBgJ4-5.js";import{A as Be}from"./activity-B1_-JLqt.js";import{T as Gs}from"./trash-2-DDi3fVjz.js";import{C as Qs}from"./ConfirmModal-CijEsZrl.js";import{M as Js}from"./map-pin-DLf5Z8nk.js";import{S as Xs}from"./search-Djg1V5_Y.js";import{C as Ys}from"./clock-BFNcreJN.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -19,5 +19,5 @@ import{e as xe,ar as cs,j as e,r as n,_ as is,cq as He,cr as Oe,ao as W,a0 as Ce * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nt=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],Ae=xe("ruler",nt);class rt extends n.Component{constructor(l){super(l),this.state={hasError:!1}}static getDerivedStateFromError(l){return{hasError:!0,error:l}}render(){var l;return this.state.hasError?e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"alert","aria-live":"assertive",children:e.jsxs("div",{className:"text-center text-fg-muted p-4",children:[e.jsx("p",{className:"text-lg mb-2",children:"Map failed to load"}),e.jsx("p",{className:"text-sm text-fg-muted",children:((l=this.state.error)==null?void 0:l.message)||"Unknown error"}),e.jsx("p",{className:"text-xs text-fg-muted mt-2",children:"Try refreshing the page or check your browser's WebGL support."})]})}):this.props.children}}const ot=n.lazy(()=>is(()=>import("./ContactsMapMapLibre-BDcZA1Ui.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48]))),Ee=()=>e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"status","aria-live":"polite","aria-label":"Loading map",children:e.jsxs("div",{className:"text-fg-muted flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-sys-blue border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading map..."})]})});function ct({neighbors:o,localNode:l,localHash:g,onRemoveNode:u,selectedNodeHash:j,onNodeSelected:N,highlightedEdgeKey:c,highlightedGhost:T}){return cs()===!1?e.jsx(Ee,{}):e.jsx(rt,{children:e.jsx(n.Suspense,{fallback:e.jsx(Ee,{}),children:e.jsx(ot,{neighbors:o,localNode:l,localHash:g,onRemoveNode:u,selectedNodeHash:j,onNodeSelected:N,highlightedEdgeKey:c,highlightedGhost:T})})})}function it({hash:o,className:l="",size:g="sm",collisionInfo:u,isViterbiResolved:j}){const N=He(),c=Oe(),[T,$]=n.useState(!1),w=n.useMemo(()=>W(o),[o]),p=n.useMemo(()=>u!==void 0?u:w?N.find(P=>P.prefix===w)??null:null,[w,N,u]),C=j??(c.totalPaths>0&&c.avgPathConfidence>=.7),D=n.useCallback(P=>{P.preventDefault(),P.stopPropagation(),$(!0)},[]),B=n.useCallback(()=>{$(!1)},[]);if(!p)return null;const A=g==="sm"?"w-3.5 h-3.5":"w-4 h-4",q=C?"text-sys-cyan hover:text-sys-cyan hover:bg-sys-cyan/10 focus:ring-sys-cyan/50":"text-signal-fair hover:text-sys-indigo hover:bg-signal-fair/10 focus:ring-signal-fair/50",S=C?`Prefix conflict resolved by Viterbi HMM (${(c.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${p.candidateCount} nodes share prefix "${w}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:D,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${q} ${l}`,title:S,"aria-label":`View prefix conflict for ${w}${C?" (Viterbi resolved)":""}`,children:C?e.jsxs("span",{className:"relative",children:[e.jsx(qs,{className:A}),e.jsx(Ce,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(st,{className:A})}),T&&e.jsx(As,{isOpen:!0,prefix:p.prefix,candidateHashes:p.candidateHashes,onClose:B})]})}const lt=n.memo(it),qe=[{target:"Contacts",fn:"name",minStage:1,when:Es},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Hs}];Os(qe);function dt(o){return o<1e3?`${Math.round(o)}m`:`${(o/1e3).toFixed(1)}km`}function mt({hash:o,contact:l,isHub:g,isNeighbor:u,distance:j,centrality:N,neighborSignal:c,collisionInfo:T,isViterbiResolved:$,pingingHash:w,pingResult:p,pingError:C,isMobile:D,metaSummary:B,metaTooltip:A,onRowClick:q,onPing:S,onRemove:P}){Fs(qe);const _=l.latitude&&l.longitude&&l.latitude!==0&&l.longitude!==0,H=l.node_name||l.name||"Unknown",O=u&&c,se=ke(l),{isRepeater:v,isCompanion:G,isRoomServer:R,isClient:Q,label:b}=se,te=u?`${b} — Direct RF contact (zero-hop neighbor)`:`${b} — Flood routing (multi-hop via mesh)`,ae=n.useCallback(()=>q(o),[q,o]);return e.jsxs("div",{className:`contacts-grid-row ${g?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${_?"cursor-pointer":""}`,onClick:ae,children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[O&&(c==null?void 0:c.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${ls(c.avgSnr)}`}):e.jsx("div",{className:"w-2 flex-shrink-0"}),e.jsx("div",{className:"w-6 h-6 flex items-center justify-center flex-shrink-0",title:te,children:(()=>{if(R&&v)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(me,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(Us,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(R)return e.jsx(me,{className:"w-5 h-5 text-sys-pink"});if(v)return e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"w-3.5 h-3.5 text-sys-blue"})});if((G||Q)&&H!=="Unknown"){const{emoji:F,cleanName:ue}=Is(H);return e.jsx("div",{className:"w-6 h-6 clay-avatar",style:{"--avatar-color":zs(ue)},children:F?e.jsx("span",{className:"text-sm leading-none",children:F}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:Ds(H)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(De,{className:"w-3.5 h-3.5 text-sys-amber"})})})()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx("span",{className:"roster-title truncate",title:H,children:H}),u&&e.jsx("span",{className:"contact-tag contact-tag--nbr",children:"NBR"}),g&&e.jsx("span",{className:"contact-tag contact-tag--hub",children:"HUB"}),v&&e.jsx("span",{className:"contact-tag contact-tag--rpt",children:"RPT"}),R&&e.jsx("span",{className:"contact-tag contact-tag--room",children:"ROOM"}),G&&e.jsx("span",{className:"contact-tag contact-tag--comp",children:"COMP"}),Q&&e.jsx("span",{className:"contact-tag contact-tag--client",children:"CLIENT"}),D&&e.jsx("span",{className:"contact-tag contact-tag--mobile",children:"MOB"}),!_&&e.jsx(Ws,{className:"w-3 h-3 flex-shrink-0 text-fg-muted/50"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(ds,{copy:!0,size:"compact",truncate:[8,6],children:o}),e.jsx(lt,{hash:o,collisionInfo:T,isViterbiResolved:$}),B&&e.jsx("span",{className:"contact-meta",title:A,children:B})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[O&&(c==null?void 0:c.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Bs,{rssi:c.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(c.avgRssi)})]}),O&&(c==null?void 0:c.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[c.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:j!=null&&e.jsxs(e.Fragment,{children:[e.jsx(Ae,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:dt(j)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:N>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-3 h-3 text-sys-indigo"}),e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[(N*100).toFixed(0),"%"]})]})}),e.jsx("div",{className:"contacts-col-seen flex items-center justify-end",children:e.jsx("span",{className:"type-data-xs text-fg-primary whitespace-nowrap",children:l.last_seen?Ie(l.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[u&&e.jsx(e.Fragment,{children:p?e.jsxs("div",{className:`flex items-center gap-1 ${ye(p)?"text-sys-green":"text-fg-muted"}`,title:`RTT: ${p.rtt_ms.toFixed(0)}ms${ye(p)?` · SNR: ${p.snr_db.toFixed(1)}dB · RSSI: ${p.rssi}dBm`:""}`,children:[e.jsx(Ce,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs hidden sm:inline",children:ye(p)?`${p.snr_db.toFixed(1)}dB`:`${(p.rtt_ms/1e3).toFixed(1)}s`})]}):C?e.jsxs("span",{className:"text-sys-red text-xs font-medium",title:C,children:[e.jsx("span",{className:"hidden sm:inline",children:C}),e.jsx("span",{className:"sm:hidden",children:"✗"})]}):e.jsx("button",{onClick:F=>S(o,F),disabled:w!==null,className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-blue hover:bg-sys-blue/10 transition-base disabled:opacity-50 disabled:cursor-not-allowed",title:"Ping neighbor for updated signal info",children:w===o?e.jsx(ze,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Vs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:F=>{F.stopPropagation(),P(o,H)},className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-red hover:bg-sys-red/10 transition-base",title:"Remove contact",children:e.jsx(Gs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const xt=n.memo(mt),ut=6371e3,pt=[{field:"lastHeard",icon:Ys,label:"Recent"},{field:"distance",icon:Ae,label:"Distance"},{field:"centrality",icon:Be,label:"Centrality"}];function ht(o){switch(o){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function ft(o){const l=ke(o);return ht(l.type)}function ve(o,l){const{color:g="primary",border:u=!1}=l??{};return we("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",o?g==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",u&&(o?g==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function gt(o,l,g,u){const j=(g-o)*Math.PI/180,N=(u-l)*Math.PI/180,c=Math.sin(j/2)*Math.sin(j/2)+Math.cos(o*Math.PI/180)*Math.cos(g*Math.PI/180)*Math.sin(N/2)*Math.sin(N/2),T=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return ut*T}function jt(){var Le,Te;const{stats:o}=ms(),l=xs(),g=us(),u=ps(),j=hs(),N=fs(),c=gs(),T=js(),$=bs(),w=ys(),p=Ne[$],C=He(),D=Oe(),B=Ns(),A=D.totalPaths>0&&D.avgPathConfidence>=.7,q=n.useMemo(()=>{const s=new Map;for(const a of C)s.set(a.prefix,a);return s},[C]),[S,P]=n.useState(null),[_,H]=n.useState("lastHeard"),[O,se]=n.useState("desc"),[v,G]=n.useState(""),[R,Q]=n.useState(!1),[b,te]=n.useState(new Set),[ae,F]=n.useState(!1),[ue,Me]=n.useState(null),[pe,Se]=n.useState(null),[Ve,he]=n.useState(new Map),[Ue,J]=n.useState(new Map),[k,We]=n.useState(25),[V,ne]=n.useState(25),fe=n.useRef(null),X=n.useMemo(()=>(o==null?void 0:o.neighbors)??{},[o==null?void 0:o.neighbors]),ge=Ps(),re=n.useMemo(()=>{if(ge.size===0)return X;const s=new Set;for(const t of Object.keys(X))s.add((t.startsWith("0x")?t.slice(2):t).toLowerCase());let a=null;for(const[t,r]of ge){const i=(t.startsWith("0x")?t.slice(2):t).toLowerCase();s.has(i)||(a||(a={...X}),a[t]={last_seen:r.lastSeen,name:r.name??void 0,node_name:r.name??void 0,latitude:r.latitude,longitude:r.longitude,is_repeater:r.nodeType==="repeater",contact_type:r.nodeType==="repeater"?"Repeater":r.nodeType==="companion"?"Companion":r.nodeType==="room_server"?"Room Server":void 0})}return a??X},[X,ge]),I=n.useMemo(()=>{const a=Date.now()/1e3-p.minutes*60;return Object.fromEntries(Object.entries(re).filter(([t,r])=>l.has(t)?!1:(r.last_seen??0)>=a))},[re,l,p.minutes]),L=vs(),z=o==null?void 0:o.local_hash,Ge=n.useMemo(()=>{const s=new Map;if(!z||c.size===0)return s;for(const[a,t]of c)if(a.endsWith(`→${z}`)&&t.hops.length>1){const r=a.split("→")[0],i=t.hops[t.hops.length-1];s.set(r,i)}return s},[c,z]),Qe=n.useMemo(()=>{const s=new Map;if(!z||c.size===0)return s;const a=new Map;for(const[t,r]of Object.entries(re)){const i=(t.startsWith("0x")?t.slice(2):t).toLowerCase();a.set(i,r)}for(const[t,r]of c){if(!t.endsWith(`→${z}`)||r.hops.length===0)continue;const i=t.split("→")[0],d=r.hops[0];let h=null;for(const[f,y]of a)if(f.startsWith(d.toLowerCase())){h=y.node_name??y.name??null;break}s.set(i,{prefix:d,name:h,hopCount:r.hopCount})}return s},[c,z,re]),oe=n.useMemo(()=>{const s=new Map;if(!(L!=null&&L.latitude)||!(L!=null&&L.longitude))return s;for(const[a,t]of Object.entries(I))t.latitude&&t.longitude&&t.latitude!==0&&t.longitude!==0?s.set(a,gt(L.latitude,L.longitude,t.latitude,t.longitude)):s.set(a,null);return s},[I,L]),{neighborHashSet:ce,neighborSignalMap:Je}=n.useMemo(()=>{const s=new Set,a=new Map;for(const t of N)s.add(t.hash),a.set(t.hash,{avgRssi:t.avgRssi,avgSnr:t.avgSnr});return{neighborHashSet:s,neighborSignalMap:a}},[N]),Pe=n.useMemo(()=>{const s=v.toLowerCase().trim(),a=s==="neighbor"||s==="neighbors",t=R||a,r=b.size>0;return Object.fromEntries(Object.entries(I).filter(([i,d])=>{if(r){const y=ft(d);if(!b.has(y))return!1}if(t&&!ce.has(i))return!1;if(a||!s)return!0;const h=(d.node_name||d.name||"").toLowerCase(),f=W(i).toLowerCase();return h.includes(s)||f.includes(s)||i.toLowerCase().includes(s)}))},[I,v,R,ce,b]),x=n.useMemo(()=>{const s=Object.entries(Pe),a=v.toLowerCase().trim(),t=/^[0-9a-f]{2}(?:[0-9a-f]{2}){0,2}$/i.test(a);return s.sort(([r,i],[d,h])=>{if(t){const y=W(r).toLowerCase(),E=W(d).toLowerCase(),M=y===a,U=E===a;if(M&&!U)return-1;if(U&&!M)return 1}let f=0;switch(_){case"lastHeard":f=(i.last_seen||0)-(h.last_seen||0);break;case"distance":{const y=oe.get(r)??null,E=oe.get(d)??null;y===null&&E===null?f=0:y===null?f=1:E===null?f=-1:f=y-E;break}case"centrality":{const y=j.get(r)||0,E=j.get(d)||0;f=y-E;break}}return O==="desc"?-f:f})},[Pe,_,O,oe,j,v]),m=n.useMemo(()=>{let s=0,a=0,t=0,r=0,i=0;for(const[,d]of x){const h=ke(d),f=d.latitude&&d.longitude&&d.latitude!==0&&d.longitude!==0;switch(h.type){case"room_server":t++;break;case"repeater":a++;break;case"companion":s++;break;case"unknown":i++;break}f&&r++}return{companions:s,repeaters:a,roomServers:t,total:x.length,withLocation:r,unknown:i}},[x]),Xe=n.useMemo(()=>new Set(u),[u]),_e=n.useMemo(()=>k===0?x:x.slice(0,V),[x,V,k]);n.useEffect(()=>{ne(k||x.length)},[_,O,v,R,b,k,x.length]),n.useEffect(()=>{const s=a=>{a.target.closest("[data-dropdown]")||F(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),n.useEffect(()=>{if(k===0)return;const s=new IntersectionObserver(a=>{a[0].isIntersecting&&VMath.min(t+k,x.length))},{threshold:.1,rootMargin:"100px"});return fe.current&&s.observe(fe.current),()=>s.disconnect()},[k,V,x.length]);const Ye=n.useCallback(s=>{We(s),ne(s||x.length)},[x.length]),Ze=n.useCallback(s=>{_===s?se(a=>a==="desc"?"asc":"desc"):(H(s),se("desc"))},[_]),Ke=n.useCallback(s=>{const a=I[s];a!=null&&a.latitude&&(a!=null&&a.longitude)&&a.latitude!==0&&a.longitude!==0&&Me(s)},[I]),es=n.useCallback(()=>{Me(null)},[]),ss=n.useCallback((s,a)=>{P({hash:s,name:a})},[]),Re=ws((Te=(Le=o==null?void 0:o.config)==null?void 0:Le.mesh)==null?void 0:Te.path_hash_mode),ts=n.useCallback(async(s,a)=>{if(a.stopPropagation(),!pe){Se(s),he(t=>{const r=new Map(t);return r.delete(s),r}),J(t=>{const r=new Map(t);return r.delete(s),r});try{const r=`0x${W(s,Re)}`,i=await Cs(r,30);i.success&&i.data?(he(d=>new Map(d).set(s,i.data)),setTimeout(()=>{he(d=>{const h=new Map(d);return h.delete(s),h})},1e4)):(J(d=>new Map(d).set(s,i.error||"Ping failed")),setTimeout(()=>{J(d=>{const h=new Map(d);return h.delete(s),h})},5e3))}catch(t){const r=t instanceof Error?t.message:"Ping failed";J(i=>new Map(i).set(s,r)),setTimeout(()=>{J(i=>{const d=new Map(i);return d.delete(s),d})},5e3)}finally{Se(null)}}},[pe,Re]);return e.jsxs(_s,{children:[e.jsx(Rs,{title:"Contacts",icon:e.jsx(ee,{}),subtitle:e.jsx($s,{}),controls:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Total:"}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${m.total} discovered node${m.total!==1?"s":""} on the mesh network`,children:[e.jsx(ee,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:m.total})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Types:"}),m.repeaters>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Repeaters",children:[e.jsx(de,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Companions",children:[e.jsx($e,{className:"w-3.5 h-3.5 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Room Servers",children:[e.jsx(me,{className:"w-3.5 h-3.5 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),m.withLocation>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"With GPS location",children:[e.jsx(Js,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{children:m.withLocation})]}),m.unknown>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Unknown type",children:[e.jsx(De,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{children:m.unknown})]})]})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-1.5",children:[e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(ee,{className:"w-3 h-3 text-fg-secondary"}),e.jsx("span",{children:m.total})]}),m.repeaters>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(de,{className:"w-3 h-3 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx($e,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(me,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),e.jsx(Fe,{ranges:Ne,selectedIndex:$,onSelect:w,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(Fe,{ranges:Ne,selectedIndex:$,onSelect:w})})]})}),e.jsxs(Ls,{children:[e.jsx(ct,{neighbors:I,localNode:L??void 0,localHash:z,onRemoveNode:g,selectedNodeHash:ue,onNodeSelected:es}),e.jsxs(ks,{noPadding:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-2.5 border-b border-edge-subtle",children:[e.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title flex-shrink-0",children:e.jsx(ee,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(Ms,{type:"search",size:"sm",value:v,onChange:s=>G(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Xs,{className:"w-3.5 h-3.5"}),trailingIcon:v?e.jsx("button",{onClick:()=>{G(""),(v.toLowerCase().trim()==="neighbor"||v.toLowerCase().trim()==="neighbors")&&Q(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(Ss,{className:"w-3 h-3"})}):void 0,className:"w-24 sm:w-32 xl:w-44","aria-label":"Search contacts"}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsxs("div",{className:"relative","data-dropdown":!0,children:[e.jsxs("button",{onClick:()=>F(!ae),className:ve(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(at,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Filter"}),b.size>0&&e.jsx("span",{className:"tabular-nums text-xs bg-sys-blue/30 px-1 rounded",children:b.size})]}),ae&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 surface-elevated radius-inner py-1 min-w-[140px]",children:[[{key:"repeater",label:"Repeaters"},{key:"companion",label:"Companions"},{key:"room",label:"Rooms"}].map(({key:s,label:a})=>e.jsxs("button",{onClick:()=>{te(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},className:"w-full px-3 py-1.5 text-sm text-left hover-bg transition-base flex items-center gap-2",children:[e.jsx("span",{className:we("w-4 h-4 flex items-center justify-center radius-badge border",b.has(s)?"bg-sys-blue border-sys-blue text-white":"border-edge-subtle"),children:b.has(s)&&e.jsx(Ce,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:a})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>te(new Set),className:"w-full px-3 py-1.5 text-sm text-left text-fg-muted hover:text-fg-secondary hover-bg transition-base",children:"Clear filters"})]})]})]}),ce.size>0&&e.jsxs("button",{onClick:()=>Q(!R),className:ve(R,{color:"success",border:!0}),title:R?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(de,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Neighbors"})]})]}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[pt.map(({field:s,icon:a,label:t})=>e.jsxs("button",{onClick:()=>Ze(s),className:ve(_===s),title:`Sort by ${t.toLowerCase()}`,children:[e.jsx(a,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:t}),_===s&&e.jsx(Ks,{className:we("w-3 h-3",O==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Ts,{value:k,onChange:Ye,className:"w-auto min-w-[50px] [&_button]:py-1 [&_button]:px-2 [&_button]:text-xs [&_button]:min-h-0","aria-label":"Items per page",children:[e.jsx(le,{value:25,children:"25"}),e.jsx(le,{value:50,children:"50"}),e.jsx(le,{value:100,children:"100"}),e.jsx(le,{value:0,children:"All"})]})]})]}),x.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden sm:grid contacts-grid-header border-b border-edge-subtle/50 px-3 py-2 type-micro text-fg-muted",children:[e.jsx("div",{className:"contacts-col-node",children:"Node"}),e.jsx("div",{className:"contacts-col-signal text-right",children:"Signal"}),e.jsx("div",{className:"contacts-col-distance text-right",children:"Distance"}),e.jsx("div",{className:"contacts-col-centrality text-right",children:"Centrality"}),e.jsx("div",{className:"contacts-col-seen text-right",children:"Last Seen"}),e.jsx("div",{className:"contacts-col-actions"})]}),e.jsx("div",{className:"divide-y divide-edge-subtle/30",style:{contain:"layout paint"},children:_e.map(([s,a])=>{const t=W(s),r=Xe.has(s),i=ce.has(s),d=oe.get(s)??null,h=j.get(s)||0,f=i?Je.get(s):void 0,y=t?q.get(t)??null:null,E=T.has(s),M=i?null:Qe.get(s)??null,U=Ge.get(s)??null,je=B.get(s);let Y=null;if(je&&je.length>0){const ie=je.reduce((rs,os)=>rs+os.count,0);ie>0&&(Y=ie/24)}const be=a.first_seen?Ie(a.first_seen).replace(/ ago$/i,""):null,Z=[],K=[];if(M){const ie=M.name??M.prefix;Z.push(`→${ie} +${M.hopCount}`),K.push(`Gateway: ${M.name??M.prefix} (${M.hopCount} hop${M.hopCount!==1?"s":""})`)}U&&(Z.push(`↙${U}`),K.push(`Last forwarder: ${U}`)),Y!==null&&(Z.push(`${Y<1?"<1":Math.round(Y)}/hr`),K.push(`Packet rate: ${Y.toFixed(1)}/hr`)),be&&(Z.push(be),K.push(`First seen: ${be} ago`));const as=Z.join(" · "),ns=K.join(` + */const nt=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],Ae=xe("ruler",nt);class rt extends n.Component{constructor(l){super(l),this.state={hasError:!1}}static getDerivedStateFromError(l){return{hasError:!0,error:l}}render(){var l;return this.state.hasError?e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"alert","aria-live":"assertive",children:e.jsxs("div",{className:"text-center text-fg-muted p-4",children:[e.jsx("p",{className:"text-lg mb-2",children:"Map failed to load"}),e.jsx("p",{className:"text-sm text-fg-muted",children:((l=this.state.error)==null?void 0:l.message)||"Unknown error"}),e.jsx("p",{className:"text-xs text-fg-muted mt-2",children:"Try refreshing the page or check your browser's WebGL support."})]})}):this.props.children}}const ot=n.lazy(()=>is(()=>import("./ContactsMapMapLibre-DQCbo0KF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48]))),Ee=()=>e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"status","aria-live":"polite","aria-label":"Loading map",children:e.jsxs("div",{className:"text-fg-muted flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-sys-blue border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading map..."})]})});function ct({neighbors:o,localNode:l,localHash:g,onRemoveNode:u,selectedNodeHash:j,onNodeSelected:N,highlightedEdgeKey:c,highlightedGhost:T}){return cs()===!1?e.jsx(Ee,{}):e.jsx(rt,{children:e.jsx(n.Suspense,{fallback:e.jsx(Ee,{}),children:e.jsx(ot,{neighbors:o,localNode:l,localHash:g,onRemoveNode:u,selectedNodeHash:j,onNodeSelected:N,highlightedEdgeKey:c,highlightedGhost:T})})})}function it({hash:o,className:l="",size:g="sm",collisionInfo:u,isViterbiResolved:j}){const N=He(),c=Oe(),[T,$]=n.useState(!1),w=n.useMemo(()=>W(o),[o]),p=n.useMemo(()=>u!==void 0?u:w?N.find(P=>P.prefix===w)??null:null,[w,N,u]),C=j??(c.totalPaths>0&&c.avgPathConfidence>=.7),D=n.useCallback(P=>{P.preventDefault(),P.stopPropagation(),$(!0)},[]),B=n.useCallback(()=>{$(!1)},[]);if(!p)return null;const A=g==="sm"?"w-3.5 h-3.5":"w-4 h-4",q=C?"text-sys-cyan hover:text-sys-cyan hover:bg-sys-cyan/10 focus:ring-sys-cyan/50":"text-signal-fair hover:text-sys-indigo hover:bg-signal-fair/10 focus:ring-signal-fair/50",S=C?`Prefix conflict resolved by Viterbi HMM (${(c.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${p.candidateCount} nodes share prefix "${w}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:D,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${q} ${l}`,title:S,"aria-label":`View prefix conflict for ${w}${C?" (Viterbi resolved)":""}`,children:C?e.jsxs("span",{className:"relative",children:[e.jsx(qs,{className:A}),e.jsx(Ce,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(st,{className:A})}),T&&e.jsx(As,{isOpen:!0,prefix:p.prefix,candidateHashes:p.candidateHashes,onClose:B})]})}const lt=n.memo(it),qe=[{target:"Contacts",fn:"name",minStage:1,when:Es},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Hs}];Os(qe);function dt(o){return o<1e3?`${Math.round(o)}m`:`${(o/1e3).toFixed(1)}km`}function mt({hash:o,contact:l,isHub:g,isNeighbor:u,distance:j,centrality:N,neighborSignal:c,collisionInfo:T,isViterbiResolved:$,pingingHash:w,pingResult:p,pingError:C,isMobile:D,metaSummary:B,metaTooltip:A,onRowClick:q,onPing:S,onRemove:P}){Fs(qe);const _=l.latitude&&l.longitude&&l.latitude!==0&&l.longitude!==0,H=l.node_name||l.name||"Unknown",O=u&&c,se=ke(l),{isRepeater:v,isCompanion:G,isRoomServer:R,isClient:Q,label:b}=se,te=u?`${b} — Direct RF contact (zero-hop neighbor)`:`${b} — Flood routing (multi-hop via mesh)`,ae=n.useCallback(()=>q(o),[q,o]);return e.jsxs("div",{className:`contacts-grid-row ${g?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${_?"cursor-pointer":""}`,onClick:ae,children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[O&&(c==null?void 0:c.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${ls(c.avgSnr)}`}):e.jsx("div",{className:"w-2 flex-shrink-0"}),e.jsx("div",{className:"w-6 h-6 flex items-center justify-center flex-shrink-0",title:te,children:(()=>{if(R&&v)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(me,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(Us,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(R)return e.jsx(me,{className:"w-5 h-5 text-sys-pink"});if(v)return e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"w-3.5 h-3.5 text-sys-blue"})});if((G||Q)&&H!=="Unknown"){const{emoji:F,cleanName:ue}=Is(H);return e.jsx("div",{className:"w-6 h-6 clay-avatar",style:{"--avatar-color":zs(ue)},children:F?e.jsx("span",{className:"text-sm leading-none",children:F}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:Ds(H)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(De,{className:"w-3.5 h-3.5 text-sys-amber"})})})()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx("span",{className:"roster-title truncate",title:H,children:H}),u&&e.jsx("span",{className:"contact-tag contact-tag--nbr",children:"NBR"}),g&&e.jsx("span",{className:"contact-tag contact-tag--hub",children:"HUB"}),v&&e.jsx("span",{className:"contact-tag contact-tag--rpt",children:"RPT"}),R&&e.jsx("span",{className:"contact-tag contact-tag--room",children:"ROOM"}),G&&e.jsx("span",{className:"contact-tag contact-tag--comp",children:"COMP"}),Q&&e.jsx("span",{className:"contact-tag contact-tag--client",children:"CLIENT"}),D&&e.jsx("span",{className:"contact-tag contact-tag--mobile",children:"MOB"}),!_&&e.jsx(Ws,{className:"w-3 h-3 flex-shrink-0 text-fg-muted/50"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(ds,{copy:!0,size:"compact",truncate:[8,6],children:o}),e.jsx(lt,{hash:o,collisionInfo:T,isViterbiResolved:$}),B&&e.jsx("span",{className:"contact-meta",title:A,children:B})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[O&&(c==null?void 0:c.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Bs,{rssi:c.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(c.avgRssi)})]}),O&&(c==null?void 0:c.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[c.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:j!=null&&e.jsxs(e.Fragment,{children:[e.jsx(Ae,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:dt(j)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:N>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-3 h-3 text-sys-indigo"}),e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[(N*100).toFixed(0),"%"]})]})}),e.jsx("div",{className:"contacts-col-seen flex items-center justify-end",children:e.jsx("span",{className:"type-data-xs text-fg-primary whitespace-nowrap",children:l.last_seen?Ie(l.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[u&&e.jsx(e.Fragment,{children:p?e.jsxs("div",{className:`flex items-center gap-1 ${ye(p)?"text-sys-green":"text-fg-muted"}`,title:`RTT: ${p.rtt_ms.toFixed(0)}ms${ye(p)?` · SNR: ${p.snr_db.toFixed(1)}dB · RSSI: ${p.rssi}dBm`:""}`,children:[e.jsx(Ce,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs hidden sm:inline",children:ye(p)?`${p.snr_db.toFixed(1)}dB`:`${(p.rtt_ms/1e3).toFixed(1)}s`})]}):C?e.jsxs("span",{className:"text-sys-red text-xs font-medium",title:C,children:[e.jsx("span",{className:"hidden sm:inline",children:C}),e.jsx("span",{className:"sm:hidden",children:"✗"})]}):e.jsx("button",{onClick:F=>S(o,F),disabled:w!==null,className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-blue hover:bg-sys-blue/10 transition-base disabled:opacity-50 disabled:cursor-not-allowed",title:"Ping neighbor for updated signal info",children:w===o?e.jsx(ze,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Vs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:F=>{F.stopPropagation(),P(o,H)},className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-red hover:bg-sys-red/10 transition-base",title:"Remove contact",children:e.jsx(Gs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const xt=n.memo(mt),ut=6371e3,pt=[{field:"lastHeard",icon:Ys,label:"Recent"},{field:"distance",icon:Ae,label:"Distance"},{field:"centrality",icon:Be,label:"Centrality"}];function ht(o){switch(o){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function ft(o){const l=ke(o);return ht(l.type)}function ve(o,l){const{color:g="primary",border:u=!1}=l??{};return we("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",o?g==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",u&&(o?g==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function gt(o,l,g,u){const j=(g-o)*Math.PI/180,N=(u-l)*Math.PI/180,c=Math.sin(j/2)*Math.sin(j/2)+Math.cos(o*Math.PI/180)*Math.cos(g*Math.PI/180)*Math.sin(N/2)*Math.sin(N/2),T=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return ut*T}function jt(){var Le,Te;const{stats:o}=ms(),l=xs(),g=us(),u=ps(),j=hs(),N=fs(),c=gs(),T=js(),$=bs(),w=ys(),p=Ne[$],C=He(),D=Oe(),B=Ns(),A=D.totalPaths>0&&D.avgPathConfidence>=.7,q=n.useMemo(()=>{const s=new Map;for(const a of C)s.set(a.prefix,a);return s},[C]),[S,P]=n.useState(null),[_,H]=n.useState("lastHeard"),[O,se]=n.useState("desc"),[v,G]=n.useState(""),[R,Q]=n.useState(!1),[b,te]=n.useState(new Set),[ae,F]=n.useState(!1),[ue,Me]=n.useState(null),[pe,Se]=n.useState(null),[Ve,he]=n.useState(new Map),[Ue,J]=n.useState(new Map),[k,We]=n.useState(25),[V,ne]=n.useState(25),fe=n.useRef(null),X=n.useMemo(()=>(o==null?void 0:o.neighbors)??{},[o==null?void 0:o.neighbors]),ge=Ps(),re=n.useMemo(()=>{if(ge.size===0)return X;const s=new Set;for(const t of Object.keys(X))s.add((t.startsWith("0x")?t.slice(2):t).toLowerCase());let a=null;for(const[t,r]of ge){const i=(t.startsWith("0x")?t.slice(2):t).toLowerCase();s.has(i)||(a||(a={...X}),a[t]={last_seen:r.lastSeen,name:r.name??void 0,node_name:r.name??void 0,latitude:r.latitude,longitude:r.longitude,is_repeater:r.nodeType==="repeater",contact_type:r.nodeType==="repeater"?"Repeater":r.nodeType==="companion"?"Companion":r.nodeType==="room_server"?"Room Server":void 0})}return a??X},[X,ge]),I=n.useMemo(()=>{const a=Date.now()/1e3-p.minutes*60;return Object.fromEntries(Object.entries(re).filter(([t,r])=>l.has(t)?!1:(r.last_seen??0)>=a))},[re,l,p.minutes]),L=vs(),z=o==null?void 0:o.local_hash,Ge=n.useMemo(()=>{const s=new Map;if(!z||c.size===0)return s;for(const[a,t]of c)if(a.endsWith(`→${z}`)&&t.hops.length>1){const r=a.split("→")[0],i=t.hops[t.hops.length-1];s.set(r,i)}return s},[c,z]),Qe=n.useMemo(()=>{const s=new Map;if(!z||c.size===0)return s;const a=new Map;for(const[t,r]of Object.entries(re)){const i=(t.startsWith("0x")?t.slice(2):t).toLowerCase();a.set(i,r)}for(const[t,r]of c){if(!t.endsWith(`→${z}`)||r.hops.length===0)continue;const i=t.split("→")[0],d=r.hops[0];let h=null;for(const[f,y]of a)if(f.startsWith(d.toLowerCase())){h=y.node_name??y.name??null;break}s.set(i,{prefix:d,name:h,hopCount:r.hopCount})}return s},[c,z,re]),oe=n.useMemo(()=>{const s=new Map;if(!(L!=null&&L.latitude)||!(L!=null&&L.longitude))return s;for(const[a,t]of Object.entries(I))t.latitude&&t.longitude&&t.latitude!==0&&t.longitude!==0?s.set(a,gt(L.latitude,L.longitude,t.latitude,t.longitude)):s.set(a,null);return s},[I,L]),{neighborHashSet:ce,neighborSignalMap:Je}=n.useMemo(()=>{const s=new Set,a=new Map;for(const t of N)s.add(t.hash),a.set(t.hash,{avgRssi:t.avgRssi,avgSnr:t.avgSnr});return{neighborHashSet:s,neighborSignalMap:a}},[N]),Pe=n.useMemo(()=>{const s=v.toLowerCase().trim(),a=s==="neighbor"||s==="neighbors",t=R||a,r=b.size>0;return Object.fromEntries(Object.entries(I).filter(([i,d])=>{if(r){const y=ft(d);if(!b.has(y))return!1}if(t&&!ce.has(i))return!1;if(a||!s)return!0;const h=(d.node_name||d.name||"").toLowerCase(),f=W(i).toLowerCase();return h.includes(s)||f.includes(s)||i.toLowerCase().includes(s)}))},[I,v,R,ce,b]),x=n.useMemo(()=>{const s=Object.entries(Pe),a=v.toLowerCase().trim(),t=/^[0-9a-f]{2}(?:[0-9a-f]{2}){0,2}$/i.test(a);return s.sort(([r,i],[d,h])=>{if(t){const y=W(r).toLowerCase(),E=W(d).toLowerCase(),M=y===a,U=E===a;if(M&&!U)return-1;if(U&&!M)return 1}let f=0;switch(_){case"lastHeard":f=(i.last_seen||0)-(h.last_seen||0);break;case"distance":{const y=oe.get(r)??null,E=oe.get(d)??null;y===null&&E===null?f=0:y===null?f=1:E===null?f=-1:f=y-E;break}case"centrality":{const y=j.get(r)||0,E=j.get(d)||0;f=y-E;break}}return O==="desc"?-f:f})},[Pe,_,O,oe,j,v]),m=n.useMemo(()=>{let s=0,a=0,t=0,r=0,i=0;for(const[,d]of x){const h=ke(d),f=d.latitude&&d.longitude&&d.latitude!==0&&d.longitude!==0;switch(h.type){case"room_server":t++;break;case"repeater":a++;break;case"companion":s++;break;case"unknown":i++;break}f&&r++}return{companions:s,repeaters:a,roomServers:t,total:x.length,withLocation:r,unknown:i}},[x]),Xe=n.useMemo(()=>new Set(u),[u]),_e=n.useMemo(()=>k===0?x:x.slice(0,V),[x,V,k]);n.useEffect(()=>{ne(k||x.length)},[_,O,v,R,b,k,x.length]),n.useEffect(()=>{const s=a=>{a.target.closest("[data-dropdown]")||F(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),n.useEffect(()=>{if(k===0)return;const s=new IntersectionObserver(a=>{a[0].isIntersecting&&VMath.min(t+k,x.length))},{threshold:.1,rootMargin:"100px"});return fe.current&&s.observe(fe.current),()=>s.disconnect()},[k,V,x.length]);const Ye=n.useCallback(s=>{We(s),ne(s||x.length)},[x.length]),Ze=n.useCallback(s=>{_===s?se(a=>a==="desc"?"asc":"desc"):(H(s),se("desc"))},[_]),Ke=n.useCallback(s=>{const a=I[s];a!=null&&a.latitude&&(a!=null&&a.longitude)&&a.latitude!==0&&a.longitude!==0&&Me(s)},[I]),es=n.useCallback(()=>{Me(null)},[]),ss=n.useCallback((s,a)=>{P({hash:s,name:a})},[]),Re=ws((Te=(Le=o==null?void 0:o.config)==null?void 0:Le.mesh)==null?void 0:Te.path_hash_mode),ts=n.useCallback(async(s,a)=>{if(a.stopPropagation(),!pe){Se(s),he(t=>{const r=new Map(t);return r.delete(s),r}),J(t=>{const r=new Map(t);return r.delete(s),r});try{const r=`0x${W(s,Re)}`,i=await Cs(r,30);i.success&&i.data?(he(d=>new Map(d).set(s,i.data)),setTimeout(()=>{he(d=>{const h=new Map(d);return h.delete(s),h})},1e4)):(J(d=>new Map(d).set(s,i.error||"Ping failed")),setTimeout(()=>{J(d=>{const h=new Map(d);return h.delete(s),h})},5e3))}catch(t){const r=t instanceof Error?t.message:"Ping failed";J(i=>new Map(i).set(s,r)),setTimeout(()=>{J(i=>{const d=new Map(i);return d.delete(s),d})},5e3)}finally{Se(null)}}},[pe,Re]);return e.jsxs(_s,{children:[e.jsx(Rs,{title:"Contacts",icon:e.jsx(ee,{}),subtitle:e.jsx($s,{}),controls:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Total:"}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${m.total} discovered node${m.total!==1?"s":""} on the mesh network`,children:[e.jsx(ee,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:m.total})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Types:"}),m.repeaters>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Repeaters",children:[e.jsx(de,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Companions",children:[e.jsx($e,{className:"w-3.5 h-3.5 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Room Servers",children:[e.jsx(me,{className:"w-3.5 h-3.5 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),m.withLocation>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"With GPS location",children:[e.jsx(Js,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{children:m.withLocation})]}),m.unknown>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Unknown type",children:[e.jsx(De,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{children:m.unknown})]})]})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-1.5",children:[e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(ee,{className:"w-3 h-3 text-fg-secondary"}),e.jsx("span",{children:m.total})]}),m.repeaters>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(de,{className:"w-3 h-3 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx($e,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(me,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),e.jsx(Fe,{ranges:Ne,selectedIndex:$,onSelect:w,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(Fe,{ranges:Ne,selectedIndex:$,onSelect:w})})]})}),e.jsxs(Ls,{children:[e.jsx(ct,{neighbors:I,localNode:L??void 0,localHash:z,onRemoveNode:g,selectedNodeHash:ue,onNodeSelected:es}),e.jsxs(ks,{noPadding:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-2.5 border-b border-edge-subtle",children:[e.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title flex-shrink-0",children:e.jsx(ee,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(Ms,{type:"search",size:"sm",value:v,onChange:s=>G(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Xs,{className:"w-3.5 h-3.5"}),trailingIcon:v?e.jsx("button",{onClick:()=>{G(""),(v.toLowerCase().trim()==="neighbor"||v.toLowerCase().trim()==="neighbors")&&Q(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(Ss,{className:"w-3 h-3"})}):void 0,className:"w-24 sm:w-32 xl:w-44","aria-label":"Search contacts"}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsxs("div",{className:"relative","data-dropdown":!0,children:[e.jsxs("button",{onClick:()=>F(!ae),className:ve(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(at,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Filter"}),b.size>0&&e.jsx("span",{className:"tabular-nums text-xs bg-sys-blue/30 px-1 rounded",children:b.size})]}),ae&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 surface-elevated radius-inner py-1 min-w-[140px]",children:[[{key:"repeater",label:"Repeaters"},{key:"companion",label:"Companions"},{key:"room",label:"Rooms"}].map(({key:s,label:a})=>e.jsxs("button",{onClick:()=>{te(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},className:"w-full px-3 py-1.5 text-sm text-left hover-bg transition-base flex items-center gap-2",children:[e.jsx("span",{className:we("w-4 h-4 flex items-center justify-center radius-badge border",b.has(s)?"bg-sys-blue border-sys-blue text-white":"border-edge-subtle"),children:b.has(s)&&e.jsx(Ce,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:a})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>te(new Set),className:"w-full px-3 py-1.5 text-sm text-left text-fg-muted hover:text-fg-secondary hover-bg transition-base",children:"Clear filters"})]})]})]}),ce.size>0&&e.jsxs("button",{onClick:()=>Q(!R),className:ve(R,{color:"success",border:!0}),title:R?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(de,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Neighbors"})]})]}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[pt.map(({field:s,icon:a,label:t})=>e.jsxs("button",{onClick:()=>Ze(s),className:ve(_===s),title:`Sort by ${t.toLowerCase()}`,children:[e.jsx(a,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:t}),_===s&&e.jsx(Ks,{className:we("w-3 h-3",O==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Ts,{value:k,onChange:Ye,className:"w-auto min-w-[50px] [&_button]:py-1 [&_button]:px-2 [&_button]:text-xs [&_button]:min-h-0","aria-label":"Items per page",children:[e.jsx(le,{value:25,children:"25"}),e.jsx(le,{value:50,children:"50"}),e.jsx(le,{value:100,children:"100"}),e.jsx(le,{value:0,children:"All"})]})]})]}),x.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden sm:grid contacts-grid-header border-b border-edge-subtle/50 px-3 py-2 type-micro text-fg-muted",children:[e.jsx("div",{className:"contacts-col-node",children:"Node"}),e.jsx("div",{className:"contacts-col-signal text-right",children:"Signal"}),e.jsx("div",{className:"contacts-col-distance text-right",children:"Distance"}),e.jsx("div",{className:"contacts-col-centrality text-right",children:"Centrality"}),e.jsx("div",{className:"contacts-col-seen text-right",children:"Last Seen"}),e.jsx("div",{className:"contacts-col-actions"})]}),e.jsx("div",{className:"divide-y divide-edge-subtle/30",style:{contain:"layout paint"},children:_e.map(([s,a])=>{const t=W(s),r=Xe.has(s),i=ce.has(s),d=oe.get(s)??null,h=j.get(s)||0,f=i?Je.get(s):void 0,y=t?q.get(t)??null:null,E=T.has(s),M=i?null:Qe.get(s)??null,U=Ge.get(s)??null,je=B.get(s);let Y=null;if(je&&je.length>0){const ie=je.reduce((rs,os)=>rs+os.count,0);ie>0&&(Y=ie/24)}const be=a.first_seen?Ie(a.first_seen).replace(/ ago$/i,""):null,Z=[],K=[];if(M){const ie=M.name??M.prefix;Z.push(`→${ie} +${M.hopCount}`),K.push(`Gateway: ${M.name??M.prefix} (${M.hopCount} hop${M.hopCount!==1?"s":""})`)}U&&(Z.push(`↙${U}`),K.push(`Last forwarder: ${U}`)),Y!==null&&(Z.push(`${Y<1?"<1":Math.round(Y)}/hr`),K.push(`Packet rate: ${Y.toFixed(1)}/hr`)),be&&(Z.push(be),K.push(`First seen: ${be} ago`));const as=Z.join(" · "),ns=K.join(` `);return e.jsx(xt,{hash:s,contact:a,isHub:r,isNeighbor:i,distance:d,centrality:h,neighborSignal:f,collisionInfo:y,isViterbiResolved:A,pingingHash:pe,pingResult:Ve.get(s),pingError:Ue.get(s),isMobile:E,metaSummary:as,metaTooltip:ns,onRowClick:Ke,onPing:ts,onRemove:ss},s)})}),k>0&&V0&&Vne(s=>Math.min(s+k,x.length)),className:"text-sys-blue hover:text-sys-blue/80 transition-base",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(ee,{className:"roster-empty-icon"}),e.jsx("div",{className:"type-label text-fg-secondary",children:"No Contacts Discovered"}),e.jsx("div",{className:"type-data-xs text-fg-muted mt-1",children:"Contacts will appear here as they advertise on the mesh network."})]})]})]}),e.jsx(Qs,{isOpen:!!S,title:"Remove Contact",message:`Remove ${(S==null?void 0:S.name)||"this contact"} from the contacts list? The node will reappear if it advertises again.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{S&&g(S.hash),P(null)},onCancel:()=>P(null)})]})}const zt=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"}));export{zt as C,lt as P,Ae as R}; diff --git a/frontend/dist/assets/ContactsMapMapLibre-BDcZA1Ui.js b/frontend/dist/assets/ContactsMapMapLibre-DQCbo0KF.js similarity index 99% rename from frontend/dist/assets/ContactsMapMapLibre-BDcZA1Ui.js rename to frontend/dist/assets/ContactsMapMapLibre-DQCbo0KF.js index 0b3c20e9..96de5355 100644 --- a/frontend/dist/assets/ContactsMapMapLibre-BDcZA1Ui.js +++ b/frontend/dist/assets/ContactsMapMapLibre-DQCbo0KF.js @@ -1,4 +1,4 @@ -import{e as Sr,an as xa,r as R,gB as wa,cv as va,dq as ba,dr as ka,j as m,aC as Co,ds as Ca,aD as Eo,m as Jt,a0 as Wn,aE as So,c as Cn,a2 as Z0,O as lr,Z as vn,gC as q0,gD as Mo,gE as Ea,ck as Sa,cr as Ma,ct as Ba,dV as Bo,ap as Do,aF as _o,d as Cr,b as En,B as Nt,dH as Da,cm as ms,E as Gs,S as Us,dy as To,t as Ro,d0 as jo,aa as Io,bN as Sn,bJ as xi,gF as Lo,Q as _a,a6 as Ta,dG as Ra,gG as ja,az as No,bU as wi,bW as Ia,a1 as J0,a3 as X0,co as La,ba as Na,f1 as Fo,gH as Fa,gI as Pa,dI as Qa,dJ as Oa,gJ as za,gK as Ha,aS as Po,V as gt,gL as Ga,gM as Qo,gN as Ua,ao as Er,bQ as Oo,dx as Va,gO as zo,gP as Ho,cc as Wa,gz as Ya,cf as $a,dv as Go,dz as Ka,ab as Za,gQ as qa,fd as Ja,gR as ps,ga as Xa,fJ as Au,gS as eu}from"./index-Bcr7MabU.js";import{u as Or,S as Qr,L as qt,M as tu,b as ru}from"./maplibre-gl-CsF9Hmsz.js";import{u as Uo,r as Vo,e as vi,f as bi,g as nu}from"./consumer-registry-Dy-EEMxV.js";import{L as U0,c as su}from"./link-scoring-BhS4yAyO.js";import{C as iu}from"./ConfirmModal-CvAkhuom.js";import{s as ou,a as lu,M as au}from"./variants-Dh1uX6Aa.js";import{G as Ms}from"./git-branch-CzidlvuL.js";import{D as uu}from"./database-DdKGqHhF.js";import{H as cu,A as g0,D as ki,p as fu,c as hu,u as mn}from"./useMapViewStore-DqjoQCEZ.js";import{E as Wo}from"./target-3KNT7m1p.js";import{F as du}from"./funnel-DFQf6jmi.js";import{P as mu}from"./plus-DZIbd-kZ.js";import{C as pu}from"./compass-D-aH3UW_.js";import{Z as gu}from"./zap-D8PO3IgR.js";import{b as yu,e as xu,a as Yo,m as Ci,E as wu,u as vu,G as bu,g as ku,d as Cu,f as Eu}from"./max-3Pc3oKmC.js";import{T as Su}from"./trash-2-Dyph4AYl.js";import{W as Mu}from"./wifi-off-B_wOGsPk.js";import{W as Bu}from"./wifi-D7y3h36J.js";import{C as Du}from"./circle-alert-CbWxNnM7.js";import{C as $o}from"./clock-vUFydv3d.js";import{C as _u}from"./chevron-right-BrHsAUr1.js";import{u as Vs,a as Ko,b as Zo,c as Tu,d as Ru,e as Ws,f as Ei,R as ju,g as Iu,h as qo,t as Lu,i as Nu,j as Fu,k as Pu}from"./useReplayTick-DfhG2SSf.js";import{L as Qu}from"./LightSparkline-DI3I2Qod.js";import{P as Jo,R as Ou}from"./Contacts-DL1IltrR.js";import{H as Y0,C as ar,N as zu,a as Hu}from"./badge-colors-Dl76Mz8m.js";import{M as Gu}from"./map-pin-CmfqMW3N.js";import{c as Si}from"./node-types-BFsObq9k.js";import{B as Uu}from"./BasemapLayer-A-p_Dr5u.js";import{a as Xo,b as Bs,c as Vu}from"./easing-CUJ3Hgok.js";import"./index-we8JTzK8.js";import"./index-BbwbpcoC.js";import"./payload-detail-jRk0k5AL.js";import"./usePipelineStore-nFeiBWWq.js";import"./PageLayout-Bd1lZEvE.js";import"./listbox-D38oqfIZ.js";import"./element-movement-DUifCLY7.js";import"./use-text-value-B9WhdAMT.js";import"./frozen-Csgg4u-n.js";import"./MqttModeBadge-CrJ5xyVU.js";import"./chat-utils-lxurr5ix.js";import"./SignalIndicator-CYjIo_Mn.js";import"./CollisionExplorerModal-Y6S5TUlx.js";import"./share-2-CBcJN8r0.js";import"./circle-question-mark-CHrfUdMk.js";import"./map-pin-off-DbUyHIkr.js";import"./activity-BHsjc-ov.js";import"./search-D6EZ95nX.js";/** +import{e as Sr,an as xa,r as R,gB as wa,cv as va,dq as ba,dr as ka,j as m,aC as Co,ds as Ca,aD as Eo,m as Jt,a0 as Wn,aE as So,c as Cn,a2 as Z0,O as lr,Z as vn,gC as q0,gD as Mo,gE as Ea,ck as Sa,cr as Ma,ct as Ba,dV as Bo,ap as Do,aF as _o,d as Cr,b as En,B as Nt,dH as Da,cm as ms,E as Gs,S as Us,dy as To,t as Ro,d0 as jo,aa as Io,bN as Sn,bJ as xi,gF as Lo,Q as _a,a6 as Ta,dG as Ra,gG as ja,az as No,bU as wi,bW as Ia,a1 as J0,a3 as X0,co as La,ba as Na,f1 as Fo,gH as Fa,gI as Pa,dI as Qa,dJ as Oa,gJ as za,gK as Ha,aS as Po,V as gt,gL as Ga,gM as Qo,gN as Ua,ao as Er,bQ as Oo,dx as Va,gO as zo,gP as Ho,cc as Wa,gz as Ya,cf as $a,dv as Go,dz as Ka,ab as Za,gQ as qa,fd as Ja,gR as ps,ga as Xa,fJ as Au,gS as eu}from"./index-CR6htdhJ.js";import{u as Or,S as Qr,L as qt,M as tu,b as ru}from"./maplibre-gl-Df1NK1kQ.js";import{u as Uo,r as Vo,e as vi,f as bi,g as nu}from"./consumer-registry-7Hi_pNJ6.js";import{L as U0,c as su}from"./link-scoring-D8OLMCQf.js";import{C as iu}from"./ConfirmModal-CijEsZrl.js";import{s as ou,a as lu,M as au}from"./variants-B-xhsx06.js";import{G as Ms}from"./git-branch-94MoMaKB.js";import{D as uu}from"./database-B1i3odU4.js";import{H as cu,A as g0,D as ki,p as fu,c as hu,u as mn}from"./useMapViewStore-Dst_TEXH.js";import{E as Wo}from"./target-Bmhgwg_g.js";import{F as du}from"./funnel-4oboVPXr.js";import{P as mu}from"./plus-CfHg5JLg.js";import{C as pu}from"./compass-fAtfJAIE.js";import{Z as gu}from"./zap-BpXirfUQ.js";import{b as yu,e as xu,a as Yo,m as Ci,E as wu,u as vu,G as bu,g as ku,d as Cu,f as Eu}from"./max-BHszoqgD.js";import{T as Su}from"./trash-2-DDi3fVjz.js";import{W as Mu}from"./wifi-off-h3izwtpW.js";import{W as Bu}from"./wifi-DFzHXMz6.js";import{C as Du}from"./circle-alert-BFYzxudo.js";import{C as $o}from"./clock-BFNcreJN.js";import{C as _u}from"./chevron-right-D2DgrpVm.js";import{u as Vs,a as Ko,b as Zo,c as Tu,d as Ru,e as Ws,f as Ei,R as ju,g as Iu,h as qo,t as Lu,i as Nu,j as Fu,k as Pu}from"./useReplayTick-DoGUoba6.js";import{L as Qu}from"./LightSparkline-B480JOwC.js";import{P as Jo,R as Ou}from"./Contacts-BRAnAiI8.js";import{H as Y0,C as ar,N as zu,a as Hu}from"./badge-colors-Dl76Mz8m.js";import{M as Gu}from"./map-pin-DLf5Z8nk.js";import{c as Si}from"./node-types-BvQCDNK9.js";import{B as Uu}from"./BasemapLayer-B6qv9zHt.js";import{a as Xo,b as Bs,c as Vu}from"./easing-D4193t8J.js";import"./index-BtT4gFCt.js";import"./index-CnoLcwbn.js";import"./payload-detail-B6eeo8Zi.js";import"./usePipelineStore-CyVtwxqQ.js";import"./PageLayout-Dk902Dlo.js";import"./listbox-DbdSXuSb.js";import"./element-movement-DIPTY4wV.js";import"./use-text-value-Ch4p-2-R.js";import"./frozen-i7Ib99V7.js";import"./MqttModeBadge-_nVkYyqI.js";import"./chat-utils-DHa6YwrS.js";import"./SignalIndicator-ClMJO5cF.js";import"./CollisionExplorerModal-BjNF8_2U.js";import"./share-2-Cm0TgUDc.js";import"./circle-question-mark-BTap0a_9.js";import"./map-pin-off-DzBgJ4-5.js";import"./activity-B1_-JLqt.js";import"./search-Djg1V5_Y.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Dashboard-C-L5xhz4.js b/frontend/dist/assets/Dashboard-D6lUw9kd.js similarity index 98% rename from frontend/dist/assets/Dashboard-C-L5xhz4.js rename to frontend/dist/assets/Dashboard-D6lUw9kd.js index c7c2c9b5..6ae325b4 100644 --- a/frontend/dist/assets/Dashboard-C-L5xhz4.js +++ b/frontend/dist/assets/Dashboard-D6lUw9kd.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bcr7MabU.js","assets/index-7uzBcJ1E.css"])))=>i.map(i=>d[i]); -import{e as Z,f as bs,h as Dt,k as Rt,J as js,n as ws,o as Ns,p as Ee,q as vs,r as f,M as ks,t as Ms,_ as st,v as nt,w as At,x as Lt,y as Cs,z as te,D as Ts,j as t,d as Ke,m as ge,S as Pt,E as $t,U as Ss,F as _s,G as Le,P as Bs,H as Ds,K as Q,L as Rs,N as As,O as J,Q as we,R as Ft,T as Et,V as ne,W as Ls,X as Ps,Y as je,$ as $s,a0 as at,a1 as Fs,a2 as Pe,a3 as Es,a4 as Is,a5 as Hs,a6 as ie,a7 as It,a8 as Ht,a9 as zs,B as $e,aa as zt,ab as Ot,ac as Os,ad as Ne,ae as ee,af as Gt,ag as qt,ah as Gs,ai as qs,aj as Ws,ak as Us,al as Xs,am as Ie,u as Wt,an as Vs,ao as ot,ap as me,aq as Me,ar as Ut,as as Ys,at as Ce,au as Js,av as Zs,aw as Ks,ax as rt,ay as Qs,c as Y,az as en,aA as Xt,aB as it,aC as Vt,aD as Yt,aE as tn,aF as sn,aG as ve,aH as nn,aI as an,aJ as on,aK as Qe,aL as rn,aM as Jt,aN as Zt,aO as ln,aP as cn,Z as lt,aQ as dn,aR as un,aS as mn,aT as ct}from"./index-Bcr7MabU.js";import{C as dt,P as fn,a as pn,B as hn}from"./PageLayout-Bd1lZEvE.js";import{u as fe,r as pe,h as xn,a as gn,b as yn,i as bn}from"./consumer-registry-Dy-EEMxV.js";import{A as re,D as Ye}from"./DataValue-C0IxO0Ky.js";import{c as jn}from"./node-types-BFsObq9k.js";import{b as Kt,c as ye,a as wn,d as Nn,F as Te}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as vn,u as Je,P as kn,T as Mn,C as Qt}from"./PacketList-DmJjzUH5.js";import{useGetDecodedContent as Cn,useResolveSource as Tn}from"./usePipelineStore-nFeiBWWq.js";import{A as ut}from"./arrow-right-Bv8RdUpJ.js";import{T as es,M as Sn}from"./MqttModeBadge-CrJ5xyVU.js";import{L as ts}from"./LightSparkline-DI3I2Qod.js";import{c as _n}from"./link-scoring-BhS4yAyO.js";import{Z as Bn}from"./zap-D8PO3IgR.js";import{A as Dn,N as Rn}from"./AutoConfigureDialog-nQzi_zPM.js";import{g as An,e as He,a as Ln,f as Pn}from"./chat-utils-lxurr5ix.js";import{C as $n}from"./ChatBubble-BqSfRbsT.js";import{M as ss}from"./message-square-text-Cx7sNqKi.js";import{C as mt}from"./chevron-right-BrHsAUr1.js";import{H as Fn}from"./hash-DnbanjL5.js";import{M as En}from"./message-square-DfbrFBie.js";import{S as In}from"./shield-check-Bjhdd7t0.js";import{W as Hn}from"./wand-sparkles-D_MagcvJ.js";import{u as ue}from"./index-we8JTzK8.js";import{H as zn}from"./useMapViewStore-DqjoQCEZ.js";import{R as ft}from"./Grid-ChpC-NJE.js";import"./chevron-up-DDF7YpTU.js";import"./primitives-D7nwWFFF.js";import"./badge-colors-Dl76Mz8m.js";import"./SignalIndicator-CYjIo_Mn.js";import"./arrow-up-r11Chuf6.js";import"./arrow-down-DFZvzXIi.js";import"./payload-detail-jRk0k5AL.js";import"./map-pin-CmfqMW3N.js";import"./circle-question-mark-CHrfUdMk.js";import"./layers-D696eHgB.js";import"./clock-vUFydv3d.js";import"./route-DdD1xQhl.js";import"./activity-BHsjc-ov.js";import"./database-DdKGqHhF.js";import"./shield-CcCTQoJ7.js";import"./index-BbwbpcoC.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CR6htdhJ.js","assets/index-7uzBcJ1E.css"])))=>i.map(i=>d[i]); +import{e as Z,f as bs,h as Dt,k as Rt,J as js,n as ws,o as Ns,p as Ee,q as vs,r as f,M as ks,t as Ms,_ as st,v as nt,w as At,x as Lt,y as Cs,z as te,D as Ts,j as t,d as Ke,m as ge,S as Pt,E as $t,U as Ss,F as _s,G as Le,P as Bs,H as Ds,K as Q,L as Rs,N as As,O as J,Q as we,R as Ft,T as Et,V as ne,W as Ls,X as Ps,Y as je,$ as $s,a0 as at,a1 as Fs,a2 as Pe,a3 as Es,a4 as Is,a5 as Hs,a6 as ie,a7 as It,a8 as Ht,a9 as zs,B as $e,aa as zt,ab as Ot,ac as Os,ad as Ne,ae as ee,af as Gt,ag as qt,ah as Gs,ai as qs,aj as Ws,ak as Us,al as Xs,am as Ie,u as Wt,an as Vs,ao as ot,ap as me,aq as Me,ar as Ut,as as Ys,at as Ce,au as Js,av as Zs,aw as Ks,ax as rt,ay as Qs,c as Y,az as en,aA as Xt,aB as it,aC as Vt,aD as Yt,aE as tn,aF as sn,aG as ve,aH as nn,aI as an,aJ as on,aK as Qe,aL as rn,aM as Jt,aN as Zt,aO as ln,aP as cn,Z as lt,aQ as dn,aR as un,aS as mn,aT as ct}from"./index-CR6htdhJ.js";import{C as dt,P as fn,a as pn,B as hn}from"./PageLayout-Dk902Dlo.js";import{u as fe,r as pe,h as xn,a as gn,b as yn,i as bn}from"./consumer-registry-7Hi_pNJ6.js";import{A as re,D as Ye}from"./DataValue-CkLq2-xL.js";import{c as jn}from"./node-types-BvQCDNK9.js";import{b as Kt,c as ye,a as wn,d as Nn,F as Te}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as vn,u as Je,P as kn,T as Mn,C as Qt}from"./PacketList-DnOyjg3o.js";import{useGetDecodedContent as Cn,useResolveSource as Tn}from"./usePipelineStore-CyVtwxqQ.js";import{A as ut}from"./arrow-right-3jiFJDYq.js";import{T as es,M as Sn}from"./MqttModeBadge-_nVkYyqI.js";import{L as ts}from"./LightSparkline-B480JOwC.js";import{c as _n}from"./link-scoring-D8OLMCQf.js";import{Z as Bn}from"./zap-BpXirfUQ.js";import{A as Dn,N as Rn}from"./AutoConfigureDialog-BizEoaly.js";import{g as An,e as He,a as Ln,f as Pn}from"./chat-utils-DHa6YwrS.js";import{C as $n}from"./ChatBubble-CpAqiMRZ.js";import{M as ss}from"./message-square-text-DBY1d0D7.js";import{C as mt}from"./chevron-right-D2DgrpVm.js";import{H as Fn}from"./hash-D5cqF2Y_.js";import{M as En}from"./message-square-CNUTpjtG.js";import{S as In}from"./shield-check-CX3GhuSg.js";import{W as Hn}from"./wand-sparkles-qgdZS22e.js";import{u as ue}from"./index-BtT4gFCt.js";import{H as zn}from"./useMapViewStore-Dst_TEXH.js";import{R as ft}from"./Grid-D3Ix759E.js";import"./chevron-up-v1ZA2R-9.js";import"./primitives-EdDnh5-7.js";import"./badge-colors-Dl76Mz8m.js";import"./SignalIndicator-ClMJO5cF.js";import"./arrow-up-K4au-fHx.js";import"./arrow-down-DFhP0Q_b.js";import"./payload-detail-B6eeo8Zi.js";import"./map-pin-DLf5Z8nk.js";import"./circle-question-mark-BTap0a_9.js";import"./layers-sBqNiTGy.js";import"./clock-BFNcreJN.js";import"./route-BdG55Ep-.js";import"./activity-B1_-JLqt.js";import"./database-B1i3odU4.js";import"./shield-Bd_LbwYW.js";import"./index-CnoLcwbn.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -59,7 +59,7 @@ import{e as Z,f as bs,h as Dt,k as Rt,J as js,n as ws,o as Ns,p as Ee,q as vs,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oa=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],ra=Z("timer",oa);function ia(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],c=e[3+o],i=bs(r,a,c);return n?i(s):i}function la(e,n,o={}){const s=e.get();let r=null,a=s,c;const i=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,d=()=>{r&&(r.stop(),r=null)},u=()=>{d();const m=gt(e.get()),w=gt(a);m!==w&&(r=new js({keyframes:[m,w],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:c}))};if(e.attach((m,w)=>{a=m,c=l=>w(xt(l,i)),Dt.postRender(()=>{var l;u(),(l=e.events.animationStart)==null||l.notify(),r==null||r.then(()=>{var x;(x=e.events.animationComplete)==null||x.notify()})})},d),Rt(n)){const m=n.on("change",l=>e.set(xt(l,i))),w=e.on("destroy",m);return()=>{m(),w()}}return d}function xt(e,n){return n?e+n:e}function gt(e){return typeof e=="number"?e:parseFloat(e)}function rs(e,n){const o=ue(n()),s=()=>o.set(n());return s(),ws(()=>{const r=()=>Dt.preRender(s,!1,!0),a=e.map(c=>c.on("change",r));return()=>{a.forEach(c=>c()),Ns(s)}}),o}function ca(e){Ee.current=[],e();const n=rs(Ee.current,e);return Ee.current=void 0,n}function da(e,n,o,s){if(typeof e=="function")return ca(e);const a=ia(n,o,s);return Array.isArray(e)?yt(e,a):yt([e],([c])=>a(c))}function yt(e,n){const o=vs(()=>[]);return rs(e,()=>{o.length=0;const s=e.length;for(let r=0;rRt(e)?e.get():e;if(o)return da(s);const r=ue(s());return f.useInsertionEffect(()=>la(r,e,n),[r,JSON.stringify(n)]),r}function Se(e,n={}){return ua(e,{type:"spring",...n})}const oe=Ms(()=>({result:null,isComputing:!1})),ma=500,fa=300;let ce=null,_e=null;function pa(e){var o;const n=(o=e==null?void 0:e.config)==null?void 0:o.radio;return`${(n==null?void 0:n.spreading_factor)??7}:${(n==null?void 0:n.bandwidth)??125e3}:${(n==null?void 0:n.coding_rate)??5}:${(n==null?void 0:n.preamble_length)??8}`}function ha(){if(ce)return ce;if(typeof window>"u")return null;try{ce=new Worker(new URL("/assets/dashboard-bucketing.worker-BwrZMAuc.js",import.meta.url),{type:"module"}),ce.onmessage=e=>{if(e.data.type==="error"){console.error("[DashboardBucketing] Worker error:",e.data.error),oe.setState({isComputing:!1});return}oe.setState({result:e.data.payload,isComputing:!1})},ce.onerror=e=>{console.error("[DashboardBucketing] Worker error:",e),oe.setState({isComputing:!1})}}catch(e){console.error("[DashboardBucketing] Failed to init worker:",e)}return ce}function xa(e,n,o,s){const r=ha();if(!r)return;const a=e.length,c=new Float64Array(a),i=new Float64Array(a),d=new Uint16Array(a),u=new Uint8Array(a),m=new Uint8Array(a),w=new Uint8Array(a),l=new Uint8Array(a),x=new Float32Array(a),v=new Float32Array(a),h=new Uint32Array(a),g=new Map;let C=0;for(let A=0;AparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function ga(e,n,o){const s={...e,received:[...e.received],unique_received:[...e.unique_received],transmitted:[...e.transmitted],forwarded:[...e.forwarded],dropped:[...e.dropped],receivedBytesBuckets:e.receivedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:c,bucket_count:i}=e,d=new Set;for(const m of n){const w=m.timestamp??0;if(wa)continue;const l=Math.floor((w-r)/c);if(l<0||l>=i)continue;d.has(l)||(d.add(l),s.received[l]={...s.received[l]},s.unique_received[l]={...s.unique_received[l]},s.transmitted[l]={...s.transmitted[l]},s.forwarded[l]={...s.forwarded[l]},s.dropped[l]={...s.dropped[l]});const x=At(m,o),v=m.length??m.payload_length??0,h=m.type??m.payload_type??0,g=m.packet_origin;g==="tx_local"?(s.transmitted[l].count++,s.transmitted[l].airtime_ms+=x):g==="tx_forward"||m.transmitted?(s.forwarded[l].count++,s.forwarded[l].airtime_ms+=x,s.forwardedBytesBuckets[l].bytesByType[h]=(s.forwardedBytesBuckets[l].bytesByType[h]??0)+v,s.forwardedBytesBuckets[l].totalBytes+=v,s.forwardedBytesBuckets[l].countByType[h]=(s.forwardedBytesBuckets[l].countByType[h]??0)+1,s.forwardedBytesBuckets[l].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+v,s.totalForwardedCount++):m.drop_reason&&(s.dropped[l].count++,s.dropped[l].airtime_ms+=x,s.droppedBytesBuckets[l].bytesByType[h]=(s.droppedBytesBuckets[l].bytesByType[h]??0)+v,s.droppedBytesBuckets[l].totalBytes+=v,s.droppedBytesBuckets[l].countByType[h]=(s.droppedBytesBuckets[l].countByType[h]??0)+1,s.droppedBytesBuckets[l].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+v,s.totalDroppedCount++),g!=="tx_local"&&(s.received[l].count++,s.received[l].airtime_ms+=x,s.unique_received[l].count++,s.unique_received[l].airtime_ms+=x,s.receivedBytesBuckets[l].bytesByType[h]=(s.receivedBytesBuckets[l].bytesByType[h]??0)+v,s.receivedBytesBuckets[l].totalBytes+=v,s.receivedBytesBuckets[l].countByType[h]=(s.receivedBytesBuckets[l].countByType[h]??0)+1,s.receivedBytesBuckets[l].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+v,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=v)}const u=s.time_range_minutes/60;return s.kbPerHour=u>0?Math.round(s.totalReceivedBytes/1024/u):0,s.forwardedRatePerHour=u>0?Math.round(s.totalForwardedCount/u):0,s.droppedRatePerHour=u>0?Math.round(s.totalDroppedCount/u):0,s.receivedActiveTypes=ze(s.receivedTotalByType),s.forwardedActiveTypes=ze(s.forwardedTotalByType),s.droppedActiveTypes=ze(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([st(()=>import("./index-Bcr7MabU.js").then(e=>e.hq),__vite__mapDeps([0,1])),st(()=>import("./index-Bcr7MabU.js").then(e=>e.hp),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(c=>{const i=c.packets.length,d=c.globalTimeRangeIndex,u=pa(c.stats);if(i===s&&d===r&&u===a)return;const m=s,w=r,l=a;if(s=i,r=d,a=u,i===0)return;const x=o[d]??o[4],v=x.minutes,h=x.buckets,g=c.stats,C=nt(g),S=i-m,A=d!==w,k=u!==l,b=oe.getState().result;if(!A&&!k&&S>0&&S{_e=null;const p=e.useStore.getState();if(p.packets.length===0||!p.stats)return;const D=o[p.globalTimeRangeIndex]??o[4],T=nt(p.stats);xa(p.packets,D.minutes,D.buckets,T)},fa)})});const ya=()=>oe(e=>e.result),is=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:xn}];pe(is);function ba(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function bt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const he=32,Oe=20,ja=[.25,.5,.75,1];function wa({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){fe(is);const r=Lt(),[a,c]=f.useState(null),[i,d]=f.useState(null),[u,m]=f.useState(null),w=f.useCallback((k,b,j)=>{c(b),d(j)},[]),l=e.length>0&&n.length>0,x=a?ba(a.start):null,v=a?bt(a.start):"",h=u!==null&&x!==null&&u!==x;x!==u&&m(x);const g=f.useMemo(()=>Cs(e),[e]),C=s==="count"?te:Ts,S=f.useMemo(()=>g===0?[]:ja.map(k=>({pct:k,label:C(Math.round(g*k)),pos:(1-k)*100})),[g,C]),A=f.useMemo(()=>{if(e.length===0)return[];const k=e.length,b=Math.max(1,Math.floor(k/6)),j=[];for(let p=0;pt.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${j}%`,transform:k===1?"none":"translateY(-50%)",right:0},children:b},k))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:he,right:0,top:0,bottom:Oe},children:l&&t.jsx(Ss,{buckets:e,activeTypes:n,gridColor:r.grid,axisTickColor:r.axisTick,onHover:w,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:he,height:Oe},"aria-hidden":"true",children:A.map((k,b)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${k.pos}%`,transform:b===0?"none":b===A.length-1?"translateX(-100%)":"translateX(-50%)"},children:k.label},b))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:l&&t.jsx(_s,{activeTypes:n,totalByType:o,formatMode:s})})]})}const jt={top:8,right:8,bottom:28,left:48},wt={top:0,right:0,bottom:0,left:0};let Be=null,Nt=0;const Na=1e3;function va(){const e=performance.now();return Be&&e-Nth&&(h=y),L>g&&(g=L)}h===0&&g===0?(h=1,g=1):h===0?h=1:g===0&&(g=1);const C=h*1.05,S=g*1.05,A=C+S;let k=C/A;k=Math.max(Fe,Math.min(1-Fe,k));const b=i-m,j=k*b,p=(1-k)*b,D=a+j,T=a+j+m,R=a+j+m/2;for(let P=0;P0)for(const F of s){const N=_[F]??0;if(N===0)continue;const $=N/C*j,E=L-$;e.fillStyle=Le(F),e.fillRect(y,E,l,$),L=E}let B=T;const M=o[P].countByType;if(v[P]>0){const F=M[Q]??0;if(F>0){const N=F/S*p;e.fillStyle=Le(Q),e.fillRect(y,B,l,N),B+=N}for(const N of s){if(N===Q)continue;const $=M[N]??0;if($===0)continue;const E=$/S*p;e.fillStyle=Le(N),e.fillRect(y,B,l,E),B+=E}}}return{baselineY:R,fwdHalf:j,drpHalf:p,fwdCeil:C,drpCeil:S,gapPx:m}}function Ma(e,n,o,s,r,a,c,i,d,u,m=!1){if(n.length===0)return;const{baselineY:w,fwdHalf:l,drpHalf:x,fwdCeil:v,drpCeil:h,gapPx:g}=d,C=va(),S=w-Math.ceil(g/2),A=w+Math.floor(g/2);e.save(),e.strokeStyle=c,e.lineWidth=1*u,e.setLineDash([]);const k=[.5,1];for(const b of k){const j=Math.round(S-b*l)+.5;e.beginPath(),e.moveTo(o,j),e.lineTo(o+r,j),e.stroke();const p=Math.round(A+b*x)+.5;e.beginPath(),e.moveTo(o,p),e.lineTo(o+r,p),e.stroke()}if(e.restore(),e.clearRect(o,w-Math.ceil(g/2),r,g),!m){e.save(),e.font=`bold ${10*u}px ${C}`,e.textAlign="left";const b=4*u,j=2*u;for(const p of k){const D=Math.round(v*p),T=Math.round(h*p),R=p===1,P=S-p*l,y=A+p*x;D>0&&(e.fillStyle=J.green,e.globalAlpha=.7,R?(e.textBaseline="top",e.fillText(te(D),b,P+j)):(e.textBaseline="middle",e.fillText(te(D),b,P))),T>0&&(e.fillStyle=J.red,e.globalAlpha=.7,R?(e.textBaseline="bottom",e.fillText(te(T),b,y-j)):(e.textBaseline="middle",e.fillText(te(T),b,y)))}e.globalAlpha=1,e.restore()}if(!m){e.save(),e.font=`${12*u}px ${C}`,e.fillStyle=i,e.textBaseline="top",e.textAlign="center";const b=8*u,j=n.length,p=Math.max(1,Math.floor(j/6)),D=r/j;for(let T=0;T{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const c=s===Q?"CRC":Bs[s]??`TYPE_${s}`;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"shrink-0 w-3 h-3 rounded-xs",style:{backgroundColor:Le(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:c}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",te(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",te(a)]})]})]},s)})})}function Ta(e,n,o){const s=e.length;let r=0,a=0;for(let m=0;mr&&(r=w),l>a&&(a=l)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const c=r*1.05,i=a*1.05,d=c+i;let u=c/d;return u=Math.max(Fe,Math.min(1-Fe,u)),{fwdMax:Math.round(c),drpMax:Math.round(i),fwdFrac:u}}function Sa({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:c=!1}){const i=f.useRef(null),d=f.useRef(null),u=f.useRef(e),m=f.useRef(n),w=f.useRef(o),l=f.useRef(c);u.current=e,m.current=n,w.current=o,l.current=c;const x=c?wt:jt,v=typeof document<"u"&&document.documentElement.dataset.mode!=="light",h=r||(v?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),g=a||(v?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),C=f.useRef({gridColor:h,axisTickColor:g});C.current={gridColor:h,axisTickColor:g};const S=e.length,A=f.useMemo(()=>{const j=e.map(D=>D.start),p=e.map(()=>1);return[j,p]},[S]),k=f.useCallback(j=>{if(!i.current||e.length===0)return;const p=i.current.getBoundingClientRect(),D=j.clientX-p.left,T=c?wt:jt,R=T.left,P=p.width-T.left-T.right,L=(D-R)/P;if(L<0||L>1){s==null||s(null,null,null);return}const _=Math.min(e.length-1,Math.max(0,Math.floor(L*e.length)));s==null||s(_,e[_],L)},[e,s]),b=f.useCallback(()=>{s==null||s(null,null,null)},[s]);return f.useEffect(()=>{if(!i.current||S===0)return;const j=i.current;let p=null;const D=Ds(()=>{const T=j.getBoundingClientRect(),R=Math.floor(T.width)||400,P=Math.floor(T.height)||200,y={width:R,height:P,padding:[x.top,x.right,x.bottom,x.left],cursor:{show:!1},scales:{x:{time:!1},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],legend:{show:!1},hooks:{draw:[_=>{const B=_.ctx,{left:M,top:F,width:N,height:$}=_.bbox,E=window.devicePixelRatio||1,z=C.current,I=u.current;I.length>=2&&As(B,I[0].start,I[I.length-1].end,M,F,N,$);const G=ka(B,u.current,m.current,w.current,M,F,N,$);Ma(B,u.current,M,F,N,$,z.gridColor,z.axisTickColor,G,E,l.current)}]}},L=new Rs(y,A,j);d.current=L,p=new ResizeObserver(()=>{const _=j.getBoundingClientRect();_.width>0&&_.height>0&&d.current&&d.current.setSize({width:Math.floor(_.width),height:Math.floor(_.height)})}),p.observe(j)});return()=>{var T;D(),p==null||p.disconnect(),(T=d.current)==null||T.destroy(),d.current=null}},[S]),f.useEffect(()=>{d.current&&d.current.redraw()},[e,n,o]),e.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted",children:"No data available"}):t.jsx("div",{ref:i,className:"w-full h-full",onMouseMove:k,onMouseLeave:b})}const _a=f.memo(Sa),ls=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];pe(ls);function Ba(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function vt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const xe=32,Ge=20,Da=[.5,1];function Ra({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:c,crcHistory:i,receivedCount:d,forwardedTotalByType:u,droppedTotalByType:m,startTime:w,bucketDurationSeconds:l,bucketCount:x,timeRangeMinutes:v}){fe(ls);const h=Lt(),g=we(),[C,S]=f.useState(null),[A,k]=f.useState(null),[b,j]=f.useState(null),p=f.useCallback((q,H,X)=>{S(H),k(X)},[]),D=Math.max(1,v/60),T=f.useMemo(()=>Ft(g,D),[g,D]),R=f.useMemo(()=>T?Et(T):0,[T]),P=Math.round(R*10)/10,y=Math.round((T==null?void 0:T.avgBackoffMs)??0),{fwdMirror:L,drpMirror:_,allTypes:B,fwdTotals:M,drpTotals:F}=f.useMemo(()=>{const q=e.map(U=>({start:U.start,end:U.end,countByType:{...U.countByType}})),H=new Array(x).fill(0);for(const U of i){let K=Math.floor((U.timestamp-w)/l);K<0&&(K=0),!(K>=x)&&H[K]++}const X=n.map((U,K)=>({start:U.start,end:U.end,countByType:{...U.countByType,...H[K]>0?{[Q]:H[K]}:{}}})),V=new Set([...o,...s]);c>0&&V.add(Q);const se={...u},ae={...m};c>0&&(ae[Q]=c);const ke=[...V].sort((U,K)=>{const ys=(se[U]??0)+(ae[U]??0);return(se[K]??0)+(ae[K]??0)-ys});return{fwdMirror:q,drpMirror:X,allTypes:ke,fwdTotals:se,drpTotals:ae}},[e,n,o,s,i,c,w,l,x,u,m]),N=B.length>0&&L.length>0,$=C?Ba(C.start):null,E=C?vt(C.start):"",z=b!==null&&$!==null&&b!==$;$!==b&&j($);const I=f.useMemo(()=>N?Ta(L,_,B):null,[N,L,_,B]),G=f.useMemo(()=>{if(!I)return[];const{fwdMax:q,drpMax:H,fwdFrac:X}=I,V=[];for(const se of Da){const ae=Math.round(q*se);if(ae>0){const U=(1-se)*X*100;V.push({label:te(ae),pos:U,color:"green"})}const ke=Math.round(H*se);if(ke>0){const U=(X+se*(1-X))*100;V.push({label:te(ke),pos:U,color:"red"})}}return V},[I]),O=f.useMemo(()=>{if(L.length===0)return[];const q=L.length,H=Math.max(1,Math.floor(q/6)),X=[];for(let V=0;Vt.jsx("span",{className:`type-data-xs text-right pr-1.5 ${X==="green"?"text-sys-green/70":"text-sys-red/70"}`,style:{position:"absolute",top:`${H}%`,transform:H<=1?"none":H>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:q},V))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:Ge},children:[N&&I&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${I.fwdFrac*100}%`,background:"var(--sys-blue)",opacity:.1}}),N&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{top:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ht,{className:"w-3 h-3 text-sys-green"}),t.jsx("span",{children:"FWD"})]}),t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{bottom:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(pt,{className:"w-3 h-3 text-sys-red"}),t.jsx("span",{children:"DROP"})]})]}),t.jsx("div",{className:`absolute inset-0 flex items-center transition-opacity duration-300 ${N?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":N,children:t.jsx("div",{className:"w-full flex items-center gap-1",children:t.jsx("div",{className:"flex-1 flex items-end gap-1 h-1/2",children:[45,72,33,58,80,42,65,28,55,75,38,62].map((q,H)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${q}%`}},`u${H}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${N?"opacity-100":"opacity-0"}`,children:N&&t.jsx(_a,{forwardedBuckets:L,droppedBuckets:_,allTypes:B,gridColor:h.grid,axisTickColor:h.axisTick,onHover:p,externalAxes:!0})}),N&&I&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${I.fwdFrac*100}%`,background:"var(--sys-red)",opacity:.1}})]}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:xe,height:Ge},"aria-hidden":"true",children:O.map((q,H)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${q.pos}%`,transform:H===0?"none":H===O.length-1?"translateX(-100%)":"translateX(-50%)"},children:q.label},H))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:N&&t.jsx(Ca,{allTypes:B,forwardedTotalByType:M,droppedTotalByType:F})})]})}const Aa=2,La=1;function Pa(e,n,o){const s=d=>(d==null?void 0:d.reduce((u,m)=>u+m.count,0))??0,r=s(n),a=s(o),c=r||(e==null?void 0:e.rx_count)||1,i=a||(e==null?void 0:e.dropped_count)||0;return c>0?i/(c+i)*100:0}function $a(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,c)=>a+c.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,c=n.length*o*1e3;return a/c*100}if(e){const r=(e.uptime_seconds||1)*1e3;return(e.total_airtime_ms||e.airtime_used_ms||0)/r*100}return 0}function kt(e,n,o){return wn(Math.max(n,Math.min(o,e)))}function Fa(e,n,o,s,r){let a=Kt(e);n>20?a+=Te*2:n>12&&(a+=Te),o>8&&(a+=Te);const c=kt(a,0,Aa);let i=Nn(e);o>8&&(i+=Te);const d=kt(i,0,La),u=ye(c),m=ye(d),w=s!==null?ye(s):null;let l="stable";return w!==null&&(u>w?l="increase":u{if(u!=="applying"){m("applying");try{const H=await Ps({tx_delay_factor:O,direct_tx_delay_factor:q});H!=null&&H.success?(m("success"),setTimeout(()=>m("idle"),2e3)):(m("error"),setTimeout(()=>m("idle"),2500))}catch{m("error"),setTimeout(()=>m("idle"),2500)}}},[u]);if(!c)return t.jsx(je,{children:t.jsx($s,{})});const x=10080*60,h=Math.floor(Date.now()/1e3)-x,g=Object.values((e==null?void 0:e.neighbors)??{}).filter(O=>O.zero_hop&&O.last_seen>=h&&jn(O).isRepeater).length,C=w.filter(O=>O.status==="active"||O.lastSeen>=h).length,S=Math.max(g,C),A=Pa(e,n,o),k=$a(e,s,r),b=((z=(E=e==null?void 0:e.config)==null?void 0:E.delays)==null?void 0:z.tx_delay_factor)??null,j=((G=(I=e==null?void 0:e.config)==null?void 0:I.delays)==null?void 0:G.direct_tx_delay_factor)??null,p=Fa(S,A,k,b),D=S!==1,T=Kt(S),R=[`${S} repeater${D?"s":""} heard in the last 7 days (base ×${T.toFixed(1)}).`];p.floodFactor===T&&A<=12&&k<=8?R.push("No modifiers applied — network looks healthy."):(A>20?R.push(`High duplicate rate (${A.toFixed(1)}%) suggests frequent collisions — window widened.`):A>12&&R.push(`Elevated duplicate rate (${A.toFixed(1)}%) — window widened one step.`),k>8&&R.push(`Channel is busy (${k.toFixed(1)}% TX util) — extra spacing added.`));const P=[`Direct uses one forwarder — ×${p.directFactor.toFixed(1)} backoff for channel contention.`];k>8&&P.push("Busy channel — small extra backoff.");const y=[`Flood ×${p.floodFactor.toFixed(1)} (${p.floodSlots} slot${p.floodSlots!==1?"s":""})`,...R,"",`Direct ×${p.directFactor.toFixed(1)}`,...P,"","Click to copy CLI commands"].join(` + */const oa=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],ra=Z("timer",oa);function ia(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],c=e[3+o],i=bs(r,a,c);return n?i(s):i}function la(e,n,o={}){const s=e.get();let r=null,a=s,c;const i=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,d=()=>{r&&(r.stop(),r=null)},u=()=>{d();const m=gt(e.get()),w=gt(a);m!==w&&(r=new js({keyframes:[m,w],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:c}))};if(e.attach((m,w)=>{a=m,c=l=>w(xt(l,i)),Dt.postRender(()=>{var l;u(),(l=e.events.animationStart)==null||l.notify(),r==null||r.then(()=>{var x;(x=e.events.animationComplete)==null||x.notify()})})},d),Rt(n)){const m=n.on("change",l=>e.set(xt(l,i))),w=e.on("destroy",m);return()=>{m(),w()}}return d}function xt(e,n){return n?e+n:e}function gt(e){return typeof e=="number"?e:parseFloat(e)}function rs(e,n){const o=ue(n()),s=()=>o.set(n());return s(),ws(()=>{const r=()=>Dt.preRender(s,!1,!0),a=e.map(c=>c.on("change",r));return()=>{a.forEach(c=>c()),Ns(s)}}),o}function ca(e){Ee.current=[],e();const n=rs(Ee.current,e);return Ee.current=void 0,n}function da(e,n,o,s){if(typeof e=="function")return ca(e);const a=ia(n,o,s);return Array.isArray(e)?yt(e,a):yt([e],([c])=>a(c))}function yt(e,n){const o=vs(()=>[]);return rs(e,()=>{o.length=0;const s=e.length;for(let r=0;rRt(e)?e.get():e;if(o)return da(s);const r=ue(s());return f.useInsertionEffect(()=>la(r,e,n),[r,JSON.stringify(n)]),r}function Se(e,n={}){return ua(e,{type:"spring",...n})}const oe=Ms(()=>({result:null,isComputing:!1})),ma=500,fa=300;let ce=null,_e=null;function pa(e){var o;const n=(o=e==null?void 0:e.config)==null?void 0:o.radio;return`${(n==null?void 0:n.spreading_factor)??7}:${(n==null?void 0:n.bandwidth)??125e3}:${(n==null?void 0:n.coding_rate)??5}:${(n==null?void 0:n.preamble_length)??8}`}function ha(){if(ce)return ce;if(typeof window>"u")return null;try{ce=new Worker(new URL("/assets/dashboard-bucketing.worker-BwrZMAuc.js",import.meta.url),{type:"module"}),ce.onmessage=e=>{if(e.data.type==="error"){console.error("[DashboardBucketing] Worker error:",e.data.error),oe.setState({isComputing:!1});return}oe.setState({result:e.data.payload,isComputing:!1})},ce.onerror=e=>{console.error("[DashboardBucketing] Worker error:",e),oe.setState({isComputing:!1})}}catch(e){console.error("[DashboardBucketing] Failed to init worker:",e)}return ce}function xa(e,n,o,s){const r=ha();if(!r)return;const a=e.length,c=new Float64Array(a),i=new Float64Array(a),d=new Uint16Array(a),u=new Uint8Array(a),m=new Uint8Array(a),w=new Uint8Array(a),l=new Uint8Array(a),x=new Float32Array(a),v=new Float32Array(a),h=new Uint32Array(a),g=new Map;let C=0;for(let A=0;AparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function ga(e,n,o){const s={...e,received:[...e.received],unique_received:[...e.unique_received],transmitted:[...e.transmitted],forwarded:[...e.forwarded],dropped:[...e.dropped],receivedBytesBuckets:e.receivedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:c,bucket_count:i}=e,d=new Set;for(const m of n){const w=m.timestamp??0;if(wa)continue;const l=Math.floor((w-r)/c);if(l<0||l>=i)continue;d.has(l)||(d.add(l),s.received[l]={...s.received[l]},s.unique_received[l]={...s.unique_received[l]},s.transmitted[l]={...s.transmitted[l]},s.forwarded[l]={...s.forwarded[l]},s.dropped[l]={...s.dropped[l]});const x=At(m,o),v=m.length??m.payload_length??0,h=m.type??m.payload_type??0,g=m.packet_origin;g==="tx_local"?(s.transmitted[l].count++,s.transmitted[l].airtime_ms+=x):g==="tx_forward"||m.transmitted?(s.forwarded[l].count++,s.forwarded[l].airtime_ms+=x,s.forwardedBytesBuckets[l].bytesByType[h]=(s.forwardedBytesBuckets[l].bytesByType[h]??0)+v,s.forwardedBytesBuckets[l].totalBytes+=v,s.forwardedBytesBuckets[l].countByType[h]=(s.forwardedBytesBuckets[l].countByType[h]??0)+1,s.forwardedBytesBuckets[l].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+v,s.totalForwardedCount++):m.drop_reason&&(s.dropped[l].count++,s.dropped[l].airtime_ms+=x,s.droppedBytesBuckets[l].bytesByType[h]=(s.droppedBytesBuckets[l].bytesByType[h]??0)+v,s.droppedBytesBuckets[l].totalBytes+=v,s.droppedBytesBuckets[l].countByType[h]=(s.droppedBytesBuckets[l].countByType[h]??0)+1,s.droppedBytesBuckets[l].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+v,s.totalDroppedCount++),g!=="tx_local"&&(s.received[l].count++,s.received[l].airtime_ms+=x,s.unique_received[l].count++,s.unique_received[l].airtime_ms+=x,s.receivedBytesBuckets[l].bytesByType[h]=(s.receivedBytesBuckets[l].bytesByType[h]??0)+v,s.receivedBytesBuckets[l].totalBytes+=v,s.receivedBytesBuckets[l].countByType[h]=(s.receivedBytesBuckets[l].countByType[h]??0)+1,s.receivedBytesBuckets[l].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+v,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=v)}const u=s.time_range_minutes/60;return s.kbPerHour=u>0?Math.round(s.totalReceivedBytes/1024/u):0,s.forwardedRatePerHour=u>0?Math.round(s.totalForwardedCount/u):0,s.droppedRatePerHour=u>0?Math.round(s.totalDroppedCount/u):0,s.receivedActiveTypes=ze(s.receivedTotalByType),s.forwardedActiveTypes=ze(s.forwardedTotalByType),s.droppedActiveTypes=ze(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([st(()=>import("./index-CR6htdhJ.js").then(e=>e.hq),__vite__mapDeps([0,1])),st(()=>import("./index-CR6htdhJ.js").then(e=>e.hp),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(c=>{const i=c.packets.length,d=c.globalTimeRangeIndex,u=pa(c.stats);if(i===s&&d===r&&u===a)return;const m=s,w=r,l=a;if(s=i,r=d,a=u,i===0)return;const x=o[d]??o[4],v=x.minutes,h=x.buckets,g=c.stats,C=nt(g),S=i-m,A=d!==w,k=u!==l,b=oe.getState().result;if(!A&&!k&&S>0&&S{_e=null;const p=e.useStore.getState();if(p.packets.length===0||!p.stats)return;const D=o[p.globalTimeRangeIndex]??o[4],T=nt(p.stats);xa(p.packets,D.minutes,D.buckets,T)},fa)})});const ya=()=>oe(e=>e.result),is=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:xn}];pe(is);function ba(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function bt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const he=32,Oe=20,ja=[.25,.5,.75,1];function wa({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){fe(is);const r=Lt(),[a,c]=f.useState(null),[i,d]=f.useState(null),[u,m]=f.useState(null),w=f.useCallback((k,b,j)=>{c(b),d(j)},[]),l=e.length>0&&n.length>0,x=a?ba(a.start):null,v=a?bt(a.start):"",h=u!==null&&x!==null&&u!==x;x!==u&&m(x);const g=f.useMemo(()=>Cs(e),[e]),C=s==="count"?te:Ts,S=f.useMemo(()=>g===0?[]:ja.map(k=>({pct:k,label:C(Math.round(g*k)),pos:(1-k)*100})),[g,C]),A=f.useMemo(()=>{if(e.length===0)return[];const k=e.length,b=Math.max(1,Math.floor(k/6)),j=[];for(let p=0;pt.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${j}%`,transform:k===1?"none":"translateY(-50%)",right:0},children:b},k))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:he,right:0,top:0,bottom:Oe},children:l&&t.jsx(Ss,{buckets:e,activeTypes:n,gridColor:r.grid,axisTickColor:r.axisTick,onHover:w,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:he,height:Oe},"aria-hidden":"true",children:A.map((k,b)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${k.pos}%`,transform:b===0?"none":b===A.length-1?"translateX(-100%)":"translateX(-50%)"},children:k.label},b))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:l&&t.jsx(_s,{activeTypes:n,totalByType:o,formatMode:s})})]})}const jt={top:8,right:8,bottom:28,left:48},wt={top:0,right:0,bottom:0,left:0};let Be=null,Nt=0;const Na=1e3;function va(){const e=performance.now();return Be&&e-Nth&&(h=y),L>g&&(g=L)}h===0&&g===0?(h=1,g=1):h===0?h=1:g===0&&(g=1);const C=h*1.05,S=g*1.05,A=C+S;let k=C/A;k=Math.max(Fe,Math.min(1-Fe,k));const b=i-m,j=k*b,p=(1-k)*b,D=a+j,T=a+j+m,R=a+j+m/2;for(let P=0;P0)for(const F of s){const N=_[F]??0;if(N===0)continue;const $=N/C*j,E=L-$;e.fillStyle=Le(F),e.fillRect(y,E,l,$),L=E}let B=T;const M=o[P].countByType;if(v[P]>0){const F=M[Q]??0;if(F>0){const N=F/S*p;e.fillStyle=Le(Q),e.fillRect(y,B,l,N),B+=N}for(const N of s){if(N===Q)continue;const $=M[N]??0;if($===0)continue;const E=$/S*p;e.fillStyle=Le(N),e.fillRect(y,B,l,E),B+=E}}}return{baselineY:R,fwdHalf:j,drpHalf:p,fwdCeil:C,drpCeil:S,gapPx:m}}function Ma(e,n,o,s,r,a,c,i,d,u,m=!1){if(n.length===0)return;const{baselineY:w,fwdHalf:l,drpHalf:x,fwdCeil:v,drpCeil:h,gapPx:g}=d,C=va(),S=w-Math.ceil(g/2),A=w+Math.floor(g/2);e.save(),e.strokeStyle=c,e.lineWidth=1*u,e.setLineDash([]);const k=[.5,1];for(const b of k){const j=Math.round(S-b*l)+.5;e.beginPath(),e.moveTo(o,j),e.lineTo(o+r,j),e.stroke();const p=Math.round(A+b*x)+.5;e.beginPath(),e.moveTo(o,p),e.lineTo(o+r,p),e.stroke()}if(e.restore(),e.clearRect(o,w-Math.ceil(g/2),r,g),!m){e.save(),e.font=`bold ${10*u}px ${C}`,e.textAlign="left";const b=4*u,j=2*u;for(const p of k){const D=Math.round(v*p),T=Math.round(h*p),R=p===1,P=S-p*l,y=A+p*x;D>0&&(e.fillStyle=J.green,e.globalAlpha=.7,R?(e.textBaseline="top",e.fillText(te(D),b,P+j)):(e.textBaseline="middle",e.fillText(te(D),b,P))),T>0&&(e.fillStyle=J.red,e.globalAlpha=.7,R?(e.textBaseline="bottom",e.fillText(te(T),b,y-j)):(e.textBaseline="middle",e.fillText(te(T),b,y)))}e.globalAlpha=1,e.restore()}if(!m){e.save(),e.font=`${12*u}px ${C}`,e.fillStyle=i,e.textBaseline="top",e.textAlign="center";const b=8*u,j=n.length,p=Math.max(1,Math.floor(j/6)),D=r/j;for(let T=0;T{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const c=s===Q?"CRC":Bs[s]??`TYPE_${s}`;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"shrink-0 w-3 h-3 rounded-xs",style:{backgroundColor:Le(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:c}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",te(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",te(a)]})]})]},s)})})}function Ta(e,n,o){const s=e.length;let r=0,a=0;for(let m=0;mr&&(r=w),l>a&&(a=l)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const c=r*1.05,i=a*1.05,d=c+i;let u=c/d;return u=Math.max(Fe,Math.min(1-Fe,u)),{fwdMax:Math.round(c),drpMax:Math.round(i),fwdFrac:u}}function Sa({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:c=!1}){const i=f.useRef(null),d=f.useRef(null),u=f.useRef(e),m=f.useRef(n),w=f.useRef(o),l=f.useRef(c);u.current=e,m.current=n,w.current=o,l.current=c;const x=c?wt:jt,v=typeof document<"u"&&document.documentElement.dataset.mode!=="light",h=r||(v?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),g=a||(v?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),C=f.useRef({gridColor:h,axisTickColor:g});C.current={gridColor:h,axisTickColor:g};const S=e.length,A=f.useMemo(()=>{const j=e.map(D=>D.start),p=e.map(()=>1);return[j,p]},[S]),k=f.useCallback(j=>{if(!i.current||e.length===0)return;const p=i.current.getBoundingClientRect(),D=j.clientX-p.left,T=c?wt:jt,R=T.left,P=p.width-T.left-T.right,L=(D-R)/P;if(L<0||L>1){s==null||s(null,null,null);return}const _=Math.min(e.length-1,Math.max(0,Math.floor(L*e.length)));s==null||s(_,e[_],L)},[e,s]),b=f.useCallback(()=>{s==null||s(null,null,null)},[s]);return f.useEffect(()=>{if(!i.current||S===0)return;const j=i.current;let p=null;const D=Ds(()=>{const T=j.getBoundingClientRect(),R=Math.floor(T.width)||400,P=Math.floor(T.height)||200,y={width:R,height:P,padding:[x.top,x.right,x.bottom,x.left],cursor:{show:!1},scales:{x:{time:!1},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],legend:{show:!1},hooks:{draw:[_=>{const B=_.ctx,{left:M,top:F,width:N,height:$}=_.bbox,E=window.devicePixelRatio||1,z=C.current,I=u.current;I.length>=2&&As(B,I[0].start,I[I.length-1].end,M,F,N,$);const G=ka(B,u.current,m.current,w.current,M,F,N,$);Ma(B,u.current,M,F,N,$,z.gridColor,z.axisTickColor,G,E,l.current)}]}},L=new Rs(y,A,j);d.current=L,p=new ResizeObserver(()=>{const _=j.getBoundingClientRect();_.width>0&&_.height>0&&d.current&&d.current.setSize({width:Math.floor(_.width),height:Math.floor(_.height)})}),p.observe(j)});return()=>{var T;D(),p==null||p.disconnect(),(T=d.current)==null||T.destroy(),d.current=null}},[S]),f.useEffect(()=>{d.current&&d.current.redraw()},[e,n,o]),e.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted",children:"No data available"}):t.jsx("div",{ref:i,className:"w-full h-full",onMouseMove:k,onMouseLeave:b})}const _a=f.memo(Sa),ls=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];pe(ls);function Ba(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function vt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const xe=32,Ge=20,Da=[.5,1];function Ra({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:c,crcHistory:i,receivedCount:d,forwardedTotalByType:u,droppedTotalByType:m,startTime:w,bucketDurationSeconds:l,bucketCount:x,timeRangeMinutes:v}){fe(ls);const h=Lt(),g=we(),[C,S]=f.useState(null),[A,k]=f.useState(null),[b,j]=f.useState(null),p=f.useCallback((q,H,X)=>{S(H),k(X)},[]),D=Math.max(1,v/60),T=f.useMemo(()=>Ft(g,D),[g,D]),R=f.useMemo(()=>T?Et(T):0,[T]),P=Math.round(R*10)/10,y=Math.round((T==null?void 0:T.avgBackoffMs)??0),{fwdMirror:L,drpMirror:_,allTypes:B,fwdTotals:M,drpTotals:F}=f.useMemo(()=>{const q=e.map(U=>({start:U.start,end:U.end,countByType:{...U.countByType}})),H=new Array(x).fill(0);for(const U of i){let K=Math.floor((U.timestamp-w)/l);K<0&&(K=0),!(K>=x)&&H[K]++}const X=n.map((U,K)=>({start:U.start,end:U.end,countByType:{...U.countByType,...H[K]>0?{[Q]:H[K]}:{}}})),V=new Set([...o,...s]);c>0&&V.add(Q);const se={...u},ae={...m};c>0&&(ae[Q]=c);const ke=[...V].sort((U,K)=>{const ys=(se[U]??0)+(ae[U]??0);return(se[K]??0)+(ae[K]??0)-ys});return{fwdMirror:q,drpMirror:X,allTypes:ke,fwdTotals:se,drpTotals:ae}},[e,n,o,s,i,c,w,l,x,u,m]),N=B.length>0&&L.length>0,$=C?Ba(C.start):null,E=C?vt(C.start):"",z=b!==null&&$!==null&&b!==$;$!==b&&j($);const I=f.useMemo(()=>N?Ta(L,_,B):null,[N,L,_,B]),G=f.useMemo(()=>{if(!I)return[];const{fwdMax:q,drpMax:H,fwdFrac:X}=I,V=[];for(const se of Da){const ae=Math.round(q*se);if(ae>0){const U=(1-se)*X*100;V.push({label:te(ae),pos:U,color:"green"})}const ke=Math.round(H*se);if(ke>0){const U=(X+se*(1-X))*100;V.push({label:te(ke),pos:U,color:"red"})}}return V},[I]),O=f.useMemo(()=>{if(L.length===0)return[];const q=L.length,H=Math.max(1,Math.floor(q/6)),X=[];for(let V=0;Vt.jsx("span",{className:`type-data-xs text-right pr-1.5 ${X==="green"?"text-sys-green/70":"text-sys-red/70"}`,style:{position:"absolute",top:`${H}%`,transform:H<=1?"none":H>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:q},V))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:Ge},children:[N&&I&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${I.fwdFrac*100}%`,background:"var(--sys-blue)",opacity:.1}}),N&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{top:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ht,{className:"w-3 h-3 text-sys-green"}),t.jsx("span",{children:"FWD"})]}),t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{bottom:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(pt,{className:"w-3 h-3 text-sys-red"}),t.jsx("span",{children:"DROP"})]})]}),t.jsx("div",{className:`absolute inset-0 flex items-center transition-opacity duration-300 ${N?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":N,children:t.jsx("div",{className:"w-full flex items-center gap-1",children:t.jsx("div",{className:"flex-1 flex items-end gap-1 h-1/2",children:[45,72,33,58,80,42,65,28,55,75,38,62].map((q,H)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${q}%`}},`u${H}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${N?"opacity-100":"opacity-0"}`,children:N&&t.jsx(_a,{forwardedBuckets:L,droppedBuckets:_,allTypes:B,gridColor:h.grid,axisTickColor:h.axisTick,onHover:p,externalAxes:!0})}),N&&I&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${I.fwdFrac*100}%`,background:"var(--sys-red)",opacity:.1}})]}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:xe,height:Ge},"aria-hidden":"true",children:O.map((q,H)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${q.pos}%`,transform:H===0?"none":H===O.length-1?"translateX(-100%)":"translateX(-50%)"},children:q.label},H))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:N&&t.jsx(Ca,{allTypes:B,forwardedTotalByType:M,droppedTotalByType:F})})]})}const Aa=2,La=1;function Pa(e,n,o){const s=d=>(d==null?void 0:d.reduce((u,m)=>u+m.count,0))??0,r=s(n),a=s(o),c=r||(e==null?void 0:e.rx_count)||1,i=a||(e==null?void 0:e.dropped_count)||0;return c>0?i/(c+i)*100:0}function $a(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,c)=>a+c.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,c=n.length*o*1e3;return a/c*100}if(e){const r=(e.uptime_seconds||1)*1e3;return(e.total_airtime_ms||e.airtime_used_ms||0)/r*100}return 0}function kt(e,n,o){return wn(Math.max(n,Math.min(o,e)))}function Fa(e,n,o,s,r){let a=Kt(e);n>20?a+=Te*2:n>12&&(a+=Te),o>8&&(a+=Te);const c=kt(a,0,Aa);let i=Nn(e);o>8&&(i+=Te);const d=kt(i,0,La),u=ye(c),m=ye(d),w=s!==null?ye(s):null;let l="stable";return w!==null&&(u>w?l="increase":u{if(u!=="applying"){m("applying");try{const H=await Ps({tx_delay_factor:O,direct_tx_delay_factor:q});H!=null&&H.success?(m("success"),setTimeout(()=>m("idle"),2e3)):(m("error"),setTimeout(()=>m("idle"),2500))}catch{m("error"),setTimeout(()=>m("idle"),2500)}}},[u]);if(!c)return t.jsx(je,{children:t.jsx($s,{})});const x=10080*60,h=Math.floor(Date.now()/1e3)-x,g=Object.values((e==null?void 0:e.neighbors)??{}).filter(O=>O.zero_hop&&O.last_seen>=h&&jn(O).isRepeater).length,C=w.filter(O=>O.status==="active"||O.lastSeen>=h).length,S=Math.max(g,C),A=Pa(e,n,o),k=$a(e,s,r),b=((z=(E=e==null?void 0:e.config)==null?void 0:E.delays)==null?void 0:z.tx_delay_factor)??null,j=((G=(I=e==null?void 0:e.config)==null?void 0:I.delays)==null?void 0:G.direct_tx_delay_factor)??null,p=Fa(S,A,k,b),D=S!==1,T=Kt(S),R=[`${S} repeater${D?"s":""} heard in the last 7 days (base ×${T.toFixed(1)}).`];p.floodFactor===T&&A<=12&&k<=8?R.push("No modifiers applied — network looks healthy."):(A>20?R.push(`High duplicate rate (${A.toFixed(1)}%) suggests frequent collisions — window widened.`):A>12&&R.push(`Elevated duplicate rate (${A.toFixed(1)}%) — window widened one step.`),k>8&&R.push(`Channel is busy (${k.toFixed(1)}% TX util) — extra spacing added.`));const P=[`Direct uses one forwarder — ×${p.directFactor.toFixed(1)} backoff for channel contention.`];k>8&&P.push("Busy channel — small extra backoff.");const y=[`Flood ×${p.floodFactor.toFixed(1)} (${p.floodSlots} slot${p.floodSlots!==1?"s":""})`,...R,"",`Direct ×${p.directFactor.toFixed(1)}`,...P,"","Click to copy CLI commands"].join(` `),L=b!==null?ye(b):null,_=j!==null?ye(j):null,B=L!==null&&p.floodSlots!==L,M=_!==null&&p.directSlots!==_,F=B||M,N=async()=>{const O=`set txdelay ${p.floodFactor.toFixed(1)} set direct.txdelay ${p.directFactor.toFixed(1)}`;await Es(O),d(!0),setTimeout(()=>d(!1),1500)},$=()=>l(p.floodFactor,p.directFactor);return t.jsxs(je,{children:[t.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3 flex-wrap",children:[t.jsx(vn,{className:"w-4 h-4 text-icon-card-title flex-shrink-0"}),t.jsx("span",{className:"type-micro",children:"DELAY DOCTOR"}),a&&t.jsx(ne,{color:"zinc",className:"hidden sm:inline-flex",children:a})]}),t.jsxs("button",{onClick:N,className:"flex gap-3 mb-2 sm:mb-3 w-full text-left hover:bg-subtle-fill radius-inner transition-base p-1 -m-1 group",title:y,children:[t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-fg-primary",children:t.jsxs(Ye,{children:["×",p.floodFactor.toFixed(1)]})}),t.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Flood"})]}),t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-sys-blue",children:t.jsxs(Ye,{children:["×",p.directFactor.toFixed(1)]})}),t.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Direct"})]}),t.jsx("div",{className:"flex items-center self-center opacity-0 group-hover:opacity-100 transition-opacity",children:i?t.jsx(at,{className:"w-4 h-4 text-sys-green"}):t.jsx(Fs,{className:"w-4 h-4 text-fg-muted"})})]}),t.jsx("div",{className:"flex-1 py-2",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Dupe"}),t.jsxs("div",{className:`data-box data-box-fill data-box-left ${p.duplicateRate>8?"text-status-warning":""}`,children:[p.duplicateRate.toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"TX Util"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[p.txUtilization.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:"pt-2 mt-auto",children:t.jsxs("div",{className:"flex items-end justify-between gap-2",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"data-box-label",children:"Current"}),t.jsx("div",{className:"flex gap-2",children:b!==null?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:["×",b.toFixed(2)]})}),t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("div",{className:"data-box data-box-fill data-box-left",style:{color:"var(--sys-blue)"},children:["×",(j==null?void 0:j.toFixed(2))??"—"]})})]}):t.jsx("span",{className:"text-sm text-fg-muted",children:"No config"})})]}),F&&t.jsxs("button",{onClick:$,disabled:u==="applying"||u==="success",className:`flex items-center gap-1.5 px-2.5 py-1.5 radius-inner type-micro font-medium transition-base ${u==="success"?"bg-sys-green/15 text-sys-green":u==="error"?"bg-sys-red/15 text-sys-red":u==="applying"?"bg-subtle-fill text-fg-muted":"bg-sys-blue/10 text-sys-blue hover:bg-sys-blue/20"}`,title:`Apply ×${p.floodFactor.toFixed(1)} flood, ×${p.directFactor.toFixed(1)} direct`,children:[u==="success"?"Rx'd":u==="error"?"Failed":"Apply",u==="applying"?t.jsx(Pe,{className:"w-3.5 h-3.5 animate-spin"}):u==="success"?t.jsx(at,{className:"w-3.5 h-3.5"}):t.jsxs("span",{className:"relative inline-flex items-end w-6 h-3.5",children:[t.jsx(Qn,{className:"w-3.5 h-3.5 absolute left-0 bottom-0"}),t.jsx(aa,{className:"w-3 h-3 absolute right-0 bottom-0"})]})]})]})})]})}const cs=[{target:"RecentPackets",fn:"rssi",minStage:1},{target:"RecentPackets",fn:"snr",minStage:1}];pe(cs);const Ia=25;function Ha(){fe(cs);const e=we(),n=Is(),o=Hs(),s=ie(),r=Cn(),a=Je(x=>x.requestChannel),[c,i]=f.useState(!0),d=f.useCallback(x=>i(x),[]),u=f.useMemo(()=>[...e.length<=100?e:e.slice(-100)].sort((v,h)=>(h.timestamp??0)-(v.timestamp??0)),[e]),m=s==null?void 0:s.local_hash,w=s==null?void 0:s.neighbors,l=Tn();return t.jsxs(je,{noPadding:!0,className:"!overflow-visible",children:[t.jsx(It,{listHeader:!0,icon:t.jsx(zt,{}),title:"Recent Packets",actions:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ht,{enabled:c,onChange:d,label:"Hide Dupes",size:"sm"}),o&&t.jsx(zs,{showLabel:!0}),t.jsxs($e,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(ut,{"data-slot":"icon"})]})]})}),t.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-1",children:t.jsx(kn,{packets:u,allPackets:e,localHash:m,neighbors:w,resolveSource:l,getDecodedContent:r,onChannelClick:a,loading:n,maxPackets:Ia,showPagination:!1,flashNewest:!0,hideDupes:c,emptyMessage:"No packets received",footerAction:t.jsxs($e,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(ut,{"data-slot":"icon"})]})})})]})}const za={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function Oa({trend:e}){return t.jsx("span",{className:`mini-widget-trend ${e}`,children:t.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:za[e]})})})}function Ga(){return t.jsx("div",{className:"mini-widget-loading",children:t.jsx("div",{className:"mini-widget-loading-spinner"})})}function qa({message:e}){return t.jsx("div",{className:"mini-widget-error",children:t.jsx("span",{title:e,children:"No data"})})}function le({title:e,icon:n,value:o,unit:s,valueSize:r="md",status:a,subtitle:c,subtitleValue:i,trend:d,headerRight:u,children:m,isLoading:w=!1,error:l,className:x="",onClick:v,isLoaded:h}){const g=["mini-widget-value",r==="lg"&&"mini-widget-value-lg",r==="sm"&&"mini-widget-value-sm"].filter(Boolean).join(" "),C=["mini-widget",x].filter(Boolean).join(" ");return t.jsxs(je,{noPadding:!0,className:C,onClick:v,isLoaded:h,children:[t.jsxs("div",{className:"mini-widget-header",children:[n,t.jsx("span",{className:"mini-widget-title",children:e}),a&&a!=="unknown"&&t.jsx("div",{className:`mini-widget-status-dot ${a}`}),d&&t.jsx(Oa,{trend:d}),u&&t.jsx("span",{className:"ml-auto flex items-center",children:u})]}),w?t.jsx(Ga,{}):l?t.jsx(qa,{message:l}):t.jsxs("div",{className:"mini-widget-content",children:[(o!==void 0||c||i)&&t.jsxs("div",{className:"mini-widget-value-row",children:[o!==void 0&&t.jsxs("div",{className:g,children:[typeof o=="number"?t.jsx(re,{value:o,className:"font-mono tabular-nums",priority:"medium",format:Number.isInteger(o)?void 0:{minimumFractionDigits:1,maximumFractionDigits:1}}):t.jsx(Ye,{children:o}),s&&t.jsx("span",{className:"mini-widget-unit",children:s})]}),(c||i)&&t.jsxs("span",{className:"mini-widget-badge-group",children:[c&&!i&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:c}),c&&i&&t.jsx("span",{className:"mini-widget-subtitle truncate",children:c}),i&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:i})]})]}),m]})]})}const Wa={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},ds={baselineMedian:null,baselineP10:null,baselineP90:null,currentMedian:null,currentSampleCount:0,delta:0,slope:0,jitter:0,penalty:0,penaltyReason:null,computedAt:0,isReliable:!1};function Ze(e,n){if(e.length===0)return null;const o=[...e].sort((c,i)=>c-i),s=n/100*(o.length-1),r=Math.floor(s),a=Math.ceil(s);return r===a?o[r]:o[r]+(o[a]-o[r])*(s-r)}function Mt(e){return Ze(e,50)}function Ua(e){if(e.length<2)return 0;const n=e.reduce((r,a)=>r+a,0)/e.length,s=e.map(r=>Math.pow(r-n,2)).reduce((r,a)=>r+a,0)/e.length;return Math.sqrt(s)}function Xa(e){if(e.length<2)return 0;const n=e.length;let o=0,s=0,r=0,a=0;const c=e[0].timestamp;for(const d of e){const u=(d.timestamp-c)/3600,m=d.value;o+=u,s+=m,r+=u*m,a+=u*u}const i=n*a-o*o;return Math.abs(i)<1e-4?0:(n*r-o*s)/i}function Va(e,n,o){const s=Wa;return e>=s.DELTA_CRITICAL?[2,`Noise floor ${e.toFixed(1)} dB above baseline`]:n>=s.SLOPE_CRITICAL?[2,`Noise floor rising ${n.toFixed(1)} dB/hour`]:o>=s.JITTER_CRITICAL?[2,`Noise floor unstable (±${o.toFixed(1)} dB)`]:e>=s.DELTA_WARNING?[1,`Noise floor ${e.toFixed(1)} dB above baseline`]:n>=s.SLOPE_WARNING?[1,`Noise floor rising ${n.toFixed(1)} dB/hour`]:o>=s.JITTER_WARNING?[1,`Noise floor variable (±${o.toFixed(1)} dB)`]:[0,null]}function Ya(e){if(e.length===0)return{...ds,computedAt:Math.floor(Date.now()/1e3)};const n=Math.floor(Date.now()/1e3),o=e.filter(g=>Number.isFinite(g)),s=e.length>0?[e[e.length-1]]:[],r=e.slice(-4).filter(g=>Number.isFinite(g)),a=Mt(o),c=Ze(o,10),i=Ze(o,90),d=Mt(s),u=d!==null&&c!==null?d-c:0,m=r.map((g,C)=>({timestamp:n-(r.length-1-C)*3600,value:g})),w=Xa(m),l=Ua(r),x=o.length>=12,[v,h]=x?Va(u,w,l):[0,null];return{baselineMedian:a,baselineP10:c,baselineP90:i,currentMedian:d,currentSampleCount:s.length,delta:u,slope:w,jitter:l,penalty:v,penaltyReason:h,computedAt:n,isReliable:x}}const Ja={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],noiseFloorWindowHistory:[],linkQuality:null,channelHealth:null,nfTrend:ds,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},us=f.createContext(Ja);function Za({children:e}){var _;const n=ie(),o=we(),s=Ot(),r=Os(),a=Ne(),c=ee[a],i=Math.max(1,c.minutes/60),d=n===null,[u,m]=f.useState(null),w=f.useCallback(async()=>{try{const B=await Gt(Math.ceil(i));if(B.success&&B.data){m(B.data.history);return}const M=await qt(Math.ceil(i));M.success&&M.data&&M.data.count>0&&m(null)}catch{}},[i]);f.useEffect(()=>{w();const B=setInterval(w,6e4);return()=>clearInterval(B)},[w]);const l=f.useMemo(()=>Ft(o,i,u),[o,i,u]),x=(n==null?void 0:n.noise_floor_dbm)??null,v=f.useMemo(()=>Gs(x)?x:null,[x]),h=f.useMemo(()=>{var M;const B=(M=n==null?void 0:n.config)==null?void 0:M.radio;return B?{sf:B.spreading_factor??7,bwHz:B.bandwidth??125e3}:null},[(_=n==null?void 0:n.config)==null?void 0:_.radio]),g=qs(i),C=Ws(i),S=n==null?void 0:n.neighbors,A=f.useMemo(()=>Object.fromEntries(Object.entries(S??{}).filter(([M])=>!r.has(M))),[S,r]),k=f.useMemo(()=>s.filter(B=>!r.has(B.hash)),[s,r]),b=f.useMemo(()=>Ya(g),[g]),j=f.useMemo(()=>Us(k,A,h),[k,A,h]),p=f.useMemo(()=>Xs(l,v,j),[l,v,j]),[D,T]=f.useState({noiseFloor:null,networkScore:null,channelHealth:null}),R=f.useRef(0);f.useEffect(()=>{const B=()=>{const F=Date.now();F-R.current>3e4&&(R.current=F,T({noiseFloor:v,networkScore:(j==null?void 0:j.networkScore)??null,channelHealth:(p==null?void 0:p.score)??null}))};B();const M=setInterval(B,5e3);return()=>clearInterval(M)},[v,j==null?void 0:j.networkScore,p==null?void 0:p.score]);const P=f.useMemo(()=>({noiseFloor:{current:v,previous:D.noiseFloor,trend:v!==null?Ie(v,D.noiseFloor,2,!0):"stable"},networkScore:{current:(j==null?void 0:j.networkScore)??0,previous:D.networkScore,trend:Ie((j==null?void 0:j.networkScore)??0,D.networkScore,3,!1)},channelHealth:{current:(p==null?void 0:p.score)??0,previous:D.channelHealth,trend:Ie((p==null?void 0:p.score)??0,D.channelHealth,3,!1)}}),[v,j==null?void 0:j.networkScore,p==null?void 0:p.score,D]),L={lbtStats:l,noiseFloor:v,sparklineNoiseFloor:g,noiseFloorWindowHistory:C,linkQuality:j,channelHealth:p,nfTrend:b,radioConfig:h,trends:P,stats:n,recentPackets:o,quickNeighbors:s,isLoading:d,error:null,refresh:async()=>{}};return t.jsx(us.Provider,{value:L,children:e})}function et(){const e=f.useContext(us);if(e===void 0)throw new Error("useLBTData must be used within an LBTDataProvider");return e}function Ka(e){return e<100?"excellent":e<250?"good":e<500?"fair":e<1e3?"congested":"critical"}function Qa(e){return e===0?"No backoffs":"Retries"}function eo(e,n){return e===0?void 0:`${n.toFixed(0)}%`}function to(){const{lbtStats:e,isLoading:n,error:o}=et(),s=Wt(),r=(e==null?void 0:e.avgBackoffMs)??0,a=(e==null?void 0:e.retryRate)??0,c=e?Ka(r):"unknown",i=e==null?void 0:e.sparklineBackoff,d=f.useMemo(()=>!i||i.length<2?[]:i.map((u,m)=>({timestamp:Date.now()-(i.length-1-m)*36e5,count:u})),[i]);return t.jsx(le,{title:"LBT Backoff",icon:t.jsx(ra,{className:"mini-widget-icon"}),value:Math.round(r),unit:"ms",status:c,subtitle:e?Qa(r):void 0,subtitleValue:e?eo(r,a):void 0,isLoading:n,error:o,onClick:()=>s("/packets"),children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(ts,{data:d,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}const ms=[{target:"LinkLeaders",fn:"path",minStage:1,when:gn},{target:"LinkLeaders",fn:"src_hash",minStage:1,when:yn}];pe(ms);function so(){fe(ms);const e=Wt(),n=Ot(),o=we(),s=ie(),r=Ne(),c=ee[r].minutes*60,i=Vs(),d=f.useMemo(()=>{if(i===0)return o;const p=i-c;return o.filter(D=>D.timestamp>=p)},[o,c,i]),u=s===null,m=s!=null&&s.local_hash?ot(s.local_hash):"",w=(s==null?void 0:s.neighbors)??{},{neighborHashes:l,neighborNames:x}=f.useMemo(()=>{const p=new Set,D=new Map;for(const T of n){p.add(T.hash);const R=w[T.hash],P=(R==null?void 0:R.name)||(R==null?void 0:R.node_name)||T.prefix;D.set(T.hash,P)}return{neighborHashes:p,neighborNames:D}},[n,w]),v=f.useMemo(()=>{if(l.size===0||d.length===0||!m)return{champion:null,listener:null,loudest:null};const{scores:p}=_n(d,l,m),D=[];for(const[y,L]of p)L.blendedScore!==0&&D.push({...L,name:x.get(y)??ot(y)});let T=null,R=null,P=null;for(const y of D)(!T||y.blendedScore>T.blendedScore)&&(T=y),(!R||y.listenerScore>R.listenerScore)&&(R=y),(!P||y.loudScore>P.loudScore)&&(P=y);return{champion:T,listener:R,loudest:P}},[d,l,m,x]),h=p=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",p.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Blended Score: ",p.blendedScore,t.jsx("span",{className:"text-fg-muted/60 ml-1",children:"(Listener + Loud)"})]}),t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5",children:[t.jsxs("div",{children:["Listener: ",p.listenerScore,"/100 (",p.listenerCount," shared paths)"]}),t.jsxs("div",{children:["Loud: ",p.loudScore,"/100 (",p.loudCount," packets relayed)"]})]})]}),g=p=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",p.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",p.listenerScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[p.listenerCount," packets where they heard your transmissions"]})})]}),C=p=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",p.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",p.loudScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[p.loudCount," packets they relayed directly to you"]})})]}),{champion:S,listener:A,loudest:k}=v,j=S||A||k?t.jsxs("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:[S&&t.jsx(me,{content:h(S),children:t.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[t.jsx(Mn,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-map-neighbor-color flex-shrink-0"}),t.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:S.name}),t.jsx("span",{className:"text-map-neighbor-color pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:S.blendedScore})]})}),A&&t.jsx(me,{content:g(A),children:t.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[t.jsx(as,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),t.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:A.name}),t.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:A.listenerScore})]})}),k&&t.jsx(me,{content:C(k),children:t.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[t.jsx(Zn,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),t.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:k.name}),t.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:k.loudScore})]})})]}):n.length===0?t.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No direct neighbors"}):t.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No routing data yet"});return t.jsx(le,{title:"Link Leaders",icon:t.jsx(ta,{className:"mini-widget-icon"}),isLoading:u,onClick:()=>e("/contacts"),children:j})}function no(e){return e<15?"excellent":e<30?"good":e<45?"fair":e<60?"congested":"critical"}function ao(e){return e<15?"Clear channel":e<30?"Light traffic":e<45?"Moderate traffic":e<60?"Heavy traffic":e<75?"Congested":"Severe congestion"}function oo(){const{lbtStats:e,isLoading:n,error:o}=et(),s=e?Et(e):0,r=e?no(s):"unknown",a=(e==null?void 0:e.maxBackoffMs)??0,c=e?a>200?"Peak":ao(s):void 0,i=e&&a>200?`${Math.round(a)}ms`:void 0,d=e==null?void 0:e.sparklineCollisionRisk,u=f.useMemo(()=>!d||d.length<2?[]:d.map((w,l)=>({timestamp:Date.now()-(d.length-1-l)*36e5,count:w})),[d]),m=Math.round(s*10)/10;return t.jsx(le,{title:"Collision Risk",icon:t.jsx(Bn,{className:"mini-widget-icon"}),value:m,unit:"%",status:r,subtitle:c,subtitleValue:i,isLoading:n,error:o,children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(ts,{data:u,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function ro(e){return e<30?"excellent":e<50?"good":e<70?"fair":e<90?"congested":"critical"}function io(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function lo(){var h,g;const[e,n]=f.useState(!1),[o]=f.useState(0),{stats:s,lbtStats:r,isLoading:a}=et(),c=((g=(h=s==null?void 0:s.config)==null?void 0:h.duty_cycle)==null?void 0:g.enforcement_enabled)??!1,i=f.useMemo(()=>{if(!s)return null;if(!c){const b=s.airtime_used_ms??0,j=s.max_airtime_ms??1,p=j>0?b/j*100:0;return{usedMs:b,maxMs:j,remainingMs:Math.max(0,j-b),utilizationPercent:p}}const C=s.airtime_used_ms??0,S=s.max_airtime_ms??1,A=s.airtime_remaining_ms??0,k=s.utilization_percent??(S>0?C/S*100:0);return{usedMs:C,maxMs:S,remainingMs:A,utilizationPercent:k}},[s,c]),d=f.useMemo(()=>{if(!r||r.totalPacketsWithLBT===0)return 100;const C=r.totalPacketsWithLBT-r.packetsWithRetries,S=r.totalPacketsWithLBT;return C/S*100},[r]),u=(i==null?void 0:i.utilizationPercent)??0,m=ro(u),w=(i==null?void 0:i.remainingMs)??0,l=d<95?"1st Try":"Remaining",x=d<95?`${d.toFixed(0)}%`:io(w),v=i?t.jsx("div",{className:"mini-widget-progress mt-auto",children:t.jsx("div",{className:`mini-widget-progress-bar ${m}`,style:{width:`${Math.min(u,100)}%`}})}):null;return t.jsx(le,{title:"Duty Cycle",icon:t.jsx(zt,{className:"mini-widget-icon"}),value:u.toFixed(1),unit:"%",status:m,subtitle:l,subtitleValue:x,isLoading:a,children:v})}function co(){return t.jsxs("div",{className:"mini-widget",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(Me,{className:"w-4 h-4"}),t.jsx(Me,{className:"h-3 w-16"})]}),t.jsx(Me,{className:"h-7 w-12 mt-2"}),t.jsx(Me,{className:"h-3 w-20 mt-2"})]})}function uo(){return t.jsx("div",{className:"widget-row",children:Array.from({length:5}).map((e,n)=>t.jsx(co,{},n))})}const fs=[{target:"MeshHealth",fn:"type",minStage:1}];pe(fs);function mo({className:e="",isLoaded:n,leading:o}){fe(fs);const s=Ut(),r=n??s??!0;return t.jsxs("div",{className:`mesh-health-container relative ${e}`,children:[t.jsxs("div",{className:"mesh-health-header",children:[t.jsx(Ys,{className:"w-4 h-4 text-sys-blue"}),t.jsx("span",{className:"type-label text-fg-muted",children:"MESH HEALTH"})]}),r?t.jsx(Za,{children:t.jsxs("div",{className:"widget-row",children:[o&&t.jsx("div",{className:"widget-leading",children:o}),t.jsx(to,{}),t.jsx(oo,{}),t.jsx(lo,{}),t.jsx(so,{})]})}):t.jsx(uo,{})]})}const ps=[{target:"PublicChannel",fn:"decrypt",minStage:2,when:bn}];pe(ps);let hs="",xs="",Ct="";function fo(){const e=new Date,n=e.toDateString();if(n!==Ct){Ct=n,hs=n;const o=new Date(e);o.setDate(o.getDate()-1),xs=o.toDateString()}}function po(e){fo();const n=new Date(e*1e3).toDateString();return n===hs?"Today":n===xs?"Yesterday":new Date(e*1e3).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})}function ho(e,n,o){return`${e||""}|${n}|${o}`}function xo(e,n){const o=e.message,s=n.message;return o.timestamp===s.timestamp&&o.text===s.text&&o.senderName===s.senderName&&o.channelHash===s.channelHash&&o.channelName===s.channelName&&e.isChannelSelected===n.isChannelSelected&&e.onChannelClick===n.onChannelClick}const go=f.memo(function({message:n,onChannelClick:o,isChannelSelected:s}){const r=n.channelName||n.channelHash.slice(0,6);return t.jsx("div",{style:{transform:"translateZ(0)",willChange:"transform"},children:t.jsx($n,{senderName:n.senderName||"Unknown",text:n.text,timestamp:n.timestamp,bubbleVariant:"subtle",nameAccessory:t.jsx(Qt,{channelName:r,active:s,onClick:()=>o==null?void 0:o(n.channelHash)})})})},xo);function yo({open:e,onClose:n,messages:o,onLoadMore:s,hasMoreToLoad:r,isDecoding:a,initialChannel:c}){const i=f.useRef(null),d=f.useRef(!0),u=Ne(),m=Xt(),w=f.useRef(!1);f.useEffect(()=>{e?(w.current=!0,it.resume()):w.current&&it.pause()},[e]);const l=f.useMemo(()=>{const y=Date.now()/1e3,L=ee[u].minutes,_=y-L*60;return[...o].filter(B=>B.timestamp>=_).sort((B,M)=>B.timestamp-M.timestamp)},[o,u]),x=f.useCallback(()=>{const y=i.current;y&&(d.current=y.scrollTop>=-50)},[]),v=f.useMemo(()=>{const y=new Map;for(const L of l){const _=L.channelHash,B=y.get(_);B?B.count++:y.set(_,{name:L.channelName||L.channelHash.slice(0,6),hash:L.channelHash,count:1})}return Array.from(y.values()).sort((L,_)=>_.count-L.count)},[l]),h=v.length,[g,C]=f.useState(null),[S,A]=f.useState(!1);f.useEffect(()=>{e&&c&&C(c)},[e,c]);const k=f.useCallback(()=>{s(g,v)},[s,g,v]),b=f.useMemo(()=>g?l.filter(y=>y.channelHash===g):l,[l,g]),j=f.useMemo(()=>{const y=[];let L="";for(const _ of b){const B=po(_.timestamp);B!==L&&(y.push({type:"date",date:B}),L=B),y.push({type:"message",message:_})}return y},[b]);f.useLayoutEffect(()=>{const y=i.current;y&&d.current&&(y.scrollTop=0)},[b.length]);const p=f.useCallback(()=>{if(b.length===0)return;const y=[...b].sort(($,E)=>$.timestamp-E.timestamp),L=v.find($=>$.hash===g),_=(L==null?void 0:L.name)??"All_Channels";let B=`Chat Export - ${_} diff --git a/frontend/dist/assets/DataValue-C0IxO0Ky.js b/frontend/dist/assets/DataValue-CkLq2-xL.js similarity index 87% rename from frontend/dist/assets/DataValue-C0IxO0Ky.js rename to frontend/dist/assets/DataValue-CkLq2-xL.js index db59bbc4..003cb74b 100644 --- a/frontend/dist/assets/DataValue-C0IxO0Ky.js +++ b/frontend/dist/assets/DataValue-CkLq2-xL.js @@ -1 +1 @@ -import{r as a,cZ as d,j as o,c_ as N}from"./index-Bcr7MabU.js";import{A as g}from"./index-we8JTzK8.js";const I=a.memo(function({value:t,format:e,prefix:r,suffix:s,className:n,priority:m="medium"}){const[u,p]=a.useState(!1),[f,l]=a.useState(t);a.useEffect(()=>d(()=>{p(!0),l(0)},m),[m]),a.useEffect(()=>{u&&l(t)},[u,t]);const A=`${r??""}${t.toLocaleString(void 0,e)}${s??""}`;return u?o.jsx(g,{className:`${n??""} overflow-hidden`,format:e,prefix:r,suffix:s,transition:N.numberTicker,children:f}):o.jsx("span",{className:n,children:A})}),x={",":"punc",".":"punc-period",":":"punc-colon","/":"punc-slash"},c=/([,\.:\/])/g;function j(i){return i.split(c).map((e,r)=>{const s=x[e];return s?o.jsx("span",{className:s,children:e},r):e})}const S=a.memo(function({children:t,className:e="",as:r="span"}){const s=a.useMemo(()=>{let n;return typeof t=="number"?n=t.toLocaleString():Array.isArray(t)?n=t.join(""):n=String(t??""),c.test(n)?(c.lastIndex=0,j(n)):n},[t]);return o.jsx(r,{className:`data-tight ${e}`.trim(),children:s})});export{I as A,S as D}; +import{r as a,cZ as d,j as o,c_ as N}from"./index-CR6htdhJ.js";import{A as g}from"./index-BtT4gFCt.js";const I=a.memo(function({value:t,format:e,prefix:r,suffix:s,className:n,priority:m="medium"}){const[u,p]=a.useState(!1),[f,l]=a.useState(t);a.useEffect(()=>d(()=>{p(!0),l(0)},m),[m]),a.useEffect(()=>{u&&l(t)},[u,t]);const A=`${r??""}${t.toLocaleString(void 0,e)}${s??""}`;return u?o.jsx(g,{className:`${n??""} overflow-hidden`,format:e,prefix:r,suffix:s,transition:N.numberTicker,children:f}):o.jsx("span",{className:n,children:A})}),x={",":"punc",".":"punc-period",":":"punc-colon","/":"punc-slash"},c=/([,\.:\/])/g;function j(i){return i.split(c).map((e,r)=>{const s=x[e];return s?o.jsx("span",{className:s,children:e},r):e})}const S=a.memo(function({children:t,className:e="",as:r="span"}){const s=a.useMemo(()=>{let n;return typeof t=="number"?n=t.toLocaleString():Array.isArray(t)?n=t.join(""):n=String(t??""),c.test(n)?(c.lastIndex=0,j(n)):n},[t]);return o.jsx(r,{className:`data-tight ${e}`.trim(),children:s})});export{I as A,S as D}; diff --git a/frontend/dist/assets/Grid-ChpC-NJE.js b/frontend/dist/assets/Grid-D3Ix759E.js similarity index 95% rename from frontend/dist/assets/Grid-ChpC-NJE.js rename to frontend/dist/assets/Grid-D3Ix759E.js index 0b235eb3..bc4e4ac3 100644 --- a/frontend/dist/assets/Grid-ChpC-NJE.js +++ b/frontend/dist/assets/Grid-D3Ix759E.js @@ -1 +1 @@ -import{r as b,j as c,c as d}from"./index-Bcr7MabU.js";const g={hero:{mobile:12},"hero-tall":{mobile:12},"hero-auto":{mobile:12},panel:{mobile:12,md:6},feature:{mobile:12,md:6,lg:4},standard:{mobile:12,sm:6,lg:4,xl:3},compact:{mobile:6,lg:3},widget:{mobile:6,sm:4,md:3,lg:2},auto:{mobile:12}},p={hero:"bento-row-hero","hero-tall":"bento-row-hero-tall","hero-auto":"bento-row-hero-auto",panel:"bento-row-panel",feature:"bento-row-feature",standard:"bento-row-standard",compact:"bento-row-compact",widget:"bento-row-widget",auto:"bento-row-auto"};function w({template:o,children:r,className:e,gap:n}){const t=g[o],m=p[o],a=n==="none"?"gap-0":n==="sm"?"bento-gap-sm":n==="lg"?"bento-gap-lg":"bento-gap",i=b.Children.map(r,l=>!b.isValidElement(l)||l.type===u?l:c.jsx(u,{span:t.mobile,sm:t.sm,md:t.md,lg:t.lg,xl:t.xl,children:l}));return c.jsx("div",{className:d("bento-row",m,a,e),children:i})}function s(o,r=""){const e=r?`${r}:`:"";return o==="full"?`${e}col-span-full`:o==="auto"?`${e}col-auto`:o===1.5?`${e}bento-col-1-5`:`${e}bento-col-${o}`}function u({children:o,span:r,sm:e,md:n,lg:t,xl:m,ratio:a,className:i}){const l=d("bento-cell",s(r),e&&s(e,"sm"),n&&s(n,"md"),t&&s(t,"lg"),m&&s(m,"xl"),i);return c.jsx("div",{className:l,"data-ratio":a??void 0,style:a?{"--cell-ratio":a}:void 0,children:o})}export{u as C,w as R}; +import{r as b,j as c,c as d}from"./index-CR6htdhJ.js";const g={hero:{mobile:12},"hero-tall":{mobile:12},"hero-auto":{mobile:12},panel:{mobile:12,md:6},feature:{mobile:12,md:6,lg:4},standard:{mobile:12,sm:6,lg:4,xl:3},compact:{mobile:6,lg:3},widget:{mobile:6,sm:4,md:3,lg:2},auto:{mobile:12}},p={hero:"bento-row-hero","hero-tall":"bento-row-hero-tall","hero-auto":"bento-row-hero-auto",panel:"bento-row-panel",feature:"bento-row-feature",standard:"bento-row-standard",compact:"bento-row-compact",widget:"bento-row-widget",auto:"bento-row-auto"};function w({template:o,children:r,className:e,gap:n}){const t=g[o],m=p[o],a=n==="none"?"gap-0":n==="sm"?"bento-gap-sm":n==="lg"?"bento-gap-lg":"bento-gap",i=b.Children.map(r,l=>!b.isValidElement(l)||l.type===u?l:c.jsx(u,{span:t.mobile,sm:t.sm,md:t.md,lg:t.lg,xl:t.xl,children:l}));return c.jsx("div",{className:d("bento-row",m,a,e),children:i})}function s(o,r=""){const e=r?`${r}:`:"";return o==="full"?`${e}col-span-full`:o==="auto"?`${e}col-auto`:o===1.5?`${e}bento-col-1-5`:`${e}bento-col-${o}`}function u({children:o,span:r,sm:e,md:n,lg:t,xl:m,ratio:a,className:i}){const l=d("bento-cell",s(r),e&&s(e,"sm"),n&&s(n,"md"),t&&s(t,"lg"),m&&s(m,"xl"),i);return c.jsx("div",{className:l,"data-ratio":a??void 0,style:a?{"--cell-ratio":a}:void 0,children:o})}export{u as C,w as R}; diff --git a/frontend/dist/assets/KeycapButton-DO0xfq38.js b/frontend/dist/assets/KeycapButton-DiVOyEmR.js similarity index 98% rename from frontend/dist/assets/KeycapButton-DO0xfq38.js rename to frontend/dist/assets/KeycapButton-DiVOyEmR.js index 47f29e40..3fd9418d 100644 --- a/frontend/dist/assets/KeycapButton-DO0xfq38.js +++ b/frontend/dist/assets/KeycapButton-DiVOyEmR.js @@ -1 +1 @@ -import{r as l,j as t,Z as O}from"./index-Bcr7MabU.js";import{b as F,c as x}from"./keycap-sfx-ByZp-njj.js";const R={a:"24,3 76,3 83,7 76,11 24,11 17,7",b:"88,22 93,27 93,71 88,76 83,71 83,27",c:"88,106 93,111 93,155 88,160 83,155 83,111",d:"24,171 76,171 83,175 76,179 24,179 17,175",e:"12,106 17,111 17,155 12,160 7,155 7,111",f:"12,22 17,27 17,71 12,76 7,71 7,27",g:"24,86 76,86 83,91 76,96 24,96 17,91"},w=Object.keys(R),N={0:"abcdef",1:"bc",2:"abdeg",3:"abcdg",4:"bcfg",5:"acdfg",6:"acdefg",7:"abc",8:"abcdefg",9:"abcdfg",A:"abcefg",B:"cdefg",C:"adef",D:"bcdeg",E:"adefg",F:"aefg",G:"acdef",H:"bcefg",I:"ef",J:"bcde",L:"def",M:"abcefg",N:"ceg",O:"abcdef",P:"abefg",Q:"abcfg",R:"eg",S:"acdfg",T:"defg",U:"bcdef",V:"cde",Y:"bcdfg",Z:"abdeg",a:"abcefg",b:"cdefg",c:"deg",d:"bcdeg",e:"adefg",f:"aefg",g:"abcdfg",h:"cefg",i:"c",j:"bcde",l:"def",m:"abcef",n:"ceg",o:"cdeg",p:"abefg",r:"eg",s:"acdfg",t:"defg",u:"cde",v:"cde",y:"bcdfg"," ":"",_:"d","-":"g","=":"dg","°":"abfg",'"':"bf","'":"f","(":"adef",")":"abcd","[":"adef","]":"abcd","!":"bc",".":"d"},C=6,D=56,L=2;function B(){return w.filter(()=>Math.random()>.45).join("")}function $(r,i){const n=Array.from(r).map(a=>N[a.toUpperCase()]??N[a]??""),d=Math.max(0,(i??0)-r.length);for(let a=0;a{if(a)return;const e=$(r,d),o=e.length,g=C+(o-1)*L;let y=0,b,E=!1;const k=()=>{if(!E){if(y++,y>=g){f(null);return}f(e.map((j,_)=>{const v=C+_*L;return y>=v?j:B()})),b=setTimeout(k,D)}};return k(),()=>{E=!0,clearTimeout(b)}},[r,d,a]);const c=(e,o)=>t.jsx("svg",{viewBox:"0 0 100 182",width:h,height:n,className:"seven-seg__char","aria-hidden":"true",children:w.map(g=>t.jsx("polygon",{points:R[g],fill:i,stroke:i,strokeWidth:4,strokeLinejoin:"round",opacity:e.includes(g)?1:M},g))},o),s=$(r,d),u=T??s;return t.jsxs("span",{className:`seven-seg${S?` ${S}`:""}`,children:[u.map((e,o)=>c(e,`${o}-${e}`)),t.jsx("span",{className:"sr-only",children:r})]})}const G={grey:"/assets/keycap.svg",red:"/assets/keycap-red.svg"},I=O[900],P="#FFDEB0";function Z({icon:r,variant:i="grey",onClick:n,onPress:d,sentDuration:a=2e3,title:S,disabled:h=!1,className:m,iconColor:M=I,iconActiveColor:T=P,indicators:f}){const c=!!d,[s,u]=l.useState("idle"),[e,o]=l.useState(!1),g=l.useRef(),y=c?s==="held":e,b=c&&(s==="sending"||s==="sent"),E=c?s==="held"||s==="sending":e;l.useEffect(()=>()=>clearTimeout(g.current),[]);const k=l.useCallback(()=>{h||b||(F(),c?u("held"):o(!0))},[h,b,c]),j=l.useCallback(async()=>{if(c){if(s!=="held")return;x(),u("sending");const p=await d();u(p?"sent":"idle"),p&&(g.current=setTimeout(()=>u("idle"),a))}else{if(!e)return;o(!1),x(),n==null||n()}},[c,s,d,a,e,n]),_=l.useCallback(()=>{c?s==="held"&&(x(),u("idle")):(e&&x(),o(!1))},[c,s,e]),v=t.jsx("button",{onMouseDown:k,onMouseUp:j,onMouseLeave:_,onTouchStart:k,onTouchEnd:j,onTouchCancel:_,disabled:h||b,className:`keycap-btn${i==="red"?" keycap-btn--red-cap":""}${E?" keycap-btn--pressed":""}${m&&!f?` ${m}`:""}`,title:S,children:t.jsxs("div",{className:"keycap-wrap",children:[t.jsx("img",{src:G[i],alt:"",className:"keycap-btn__img",draggable:!1}),t.jsx("span",{className:"keycap-icon-overlay",style:{color:y||s==="sending"?T:M},children:r})]})});return f!=null&&f.length?t.jsxs("div",{className:`keycap-group${m?` ${m}`:""}`,children:[v,t.jsx("div",{className:"indicator-key-pair",children:f.map(p=>{const A=p.trackPress?s:p.active?"active":"idle";return t.jsxs("div",{className:`indicator-key${A!=="idle"?` indicator-key--${A}`:""}`,children:[t.jsx("span",{className:"indicator-key__label",children:p.label}),t.jsx("span",{className:"indicator-key__led"})]},p.label)})})]}):v}export{Z as K,Y as S}; +import{r as l,j as t,Z as O}from"./index-CR6htdhJ.js";import{b as F,c as x}from"./keycap-sfx-ByZp-njj.js";const R={a:"24,3 76,3 83,7 76,11 24,11 17,7",b:"88,22 93,27 93,71 88,76 83,71 83,27",c:"88,106 93,111 93,155 88,160 83,155 83,111",d:"24,171 76,171 83,175 76,179 24,179 17,175",e:"12,106 17,111 17,155 12,160 7,155 7,111",f:"12,22 17,27 17,71 12,76 7,71 7,27",g:"24,86 76,86 83,91 76,96 24,96 17,91"},w=Object.keys(R),N={0:"abcdef",1:"bc",2:"abdeg",3:"abcdg",4:"bcfg",5:"acdfg",6:"acdefg",7:"abc",8:"abcdefg",9:"abcdfg",A:"abcefg",B:"cdefg",C:"adef",D:"bcdeg",E:"adefg",F:"aefg",G:"acdef",H:"bcefg",I:"ef",J:"bcde",L:"def",M:"abcefg",N:"ceg",O:"abcdef",P:"abefg",Q:"abcfg",R:"eg",S:"acdfg",T:"defg",U:"bcdef",V:"cde",Y:"bcdfg",Z:"abdeg",a:"abcefg",b:"cdefg",c:"deg",d:"bcdeg",e:"adefg",f:"aefg",g:"abcdfg",h:"cefg",i:"c",j:"bcde",l:"def",m:"abcef",n:"ceg",o:"cdeg",p:"abefg",r:"eg",s:"acdfg",t:"defg",u:"cde",v:"cde",y:"bcdfg"," ":"",_:"d","-":"g","=":"dg","°":"abfg",'"':"bf","'":"f","(":"adef",")":"abcd","[":"adef","]":"abcd","!":"bc",".":"d"},C=6,D=56,L=2;function B(){return w.filter(()=>Math.random()>.45).join("")}function $(r,i){const n=Array.from(r).map(a=>N[a.toUpperCase()]??N[a]??""),d=Math.max(0,(i??0)-r.length);for(let a=0;a{if(a)return;const e=$(r,d),o=e.length,g=C+(o-1)*L;let y=0,b,E=!1;const k=()=>{if(!E){if(y++,y>=g){f(null);return}f(e.map((j,_)=>{const v=C+_*L;return y>=v?j:B()})),b=setTimeout(k,D)}};return k(),()=>{E=!0,clearTimeout(b)}},[r,d,a]);const c=(e,o)=>t.jsx("svg",{viewBox:"0 0 100 182",width:h,height:n,className:"seven-seg__char","aria-hidden":"true",children:w.map(g=>t.jsx("polygon",{points:R[g],fill:i,stroke:i,strokeWidth:4,strokeLinejoin:"round",opacity:e.includes(g)?1:M},g))},o),s=$(r,d),u=T??s;return t.jsxs("span",{className:`seven-seg${S?` ${S}`:""}`,children:[u.map((e,o)=>c(e,`${o}-${e}`)),t.jsx("span",{className:"sr-only",children:r})]})}const G={grey:"/assets/keycap.svg",red:"/assets/keycap-red.svg"},I=O[900],P="#FFDEB0";function Z({icon:r,variant:i="grey",onClick:n,onPress:d,sentDuration:a=2e3,title:S,disabled:h=!1,className:m,iconColor:M=I,iconActiveColor:T=P,indicators:f}){const c=!!d,[s,u]=l.useState("idle"),[e,o]=l.useState(!1),g=l.useRef(),y=c?s==="held":e,b=c&&(s==="sending"||s==="sent"),E=c?s==="held"||s==="sending":e;l.useEffect(()=>()=>clearTimeout(g.current),[]);const k=l.useCallback(()=>{h||b||(F(),c?u("held"):o(!0))},[h,b,c]),j=l.useCallback(async()=>{if(c){if(s!=="held")return;x(),u("sending");const p=await d();u(p?"sent":"idle"),p&&(g.current=setTimeout(()=>u("idle"),a))}else{if(!e)return;o(!1),x(),n==null||n()}},[c,s,d,a,e,n]),_=l.useCallback(()=>{c?s==="held"&&(x(),u("idle")):(e&&x(),o(!1))},[c,s,e]),v=t.jsx("button",{onMouseDown:k,onMouseUp:j,onMouseLeave:_,onTouchStart:k,onTouchEnd:j,onTouchCancel:_,disabled:h||b,className:`keycap-btn${i==="red"?" keycap-btn--red-cap":""}${E?" keycap-btn--pressed":""}${m&&!f?` ${m}`:""}`,title:S,children:t.jsxs("div",{className:"keycap-wrap",children:[t.jsx("img",{src:G[i],alt:"",className:"keycap-btn__img",draggable:!1}),t.jsx("span",{className:"keycap-icon-overlay",style:{color:y||s==="sending"?T:M},children:r})]})});return f!=null&&f.length?t.jsxs("div",{className:`keycap-group${m?` ${m}`:""}`,children:[v,t.jsx("div",{className:"indicator-key-pair",children:f.map(p=>{const A=p.trackPress?s:p.active?"active":"idle";return t.jsxs("div",{className:`indicator-key${A!=="idle"?` indicator-key--${A}`:""}`,children:[t.jsx("span",{className:"indicator-key__label",children:p.label}),t.jsx("span",{className:"indicator-key__led"})]},p.label)})})]}):v}export{Z as K,Y as S}; diff --git a/frontend/dist/assets/LightSparkline-DI3I2Qod.js b/frontend/dist/assets/LightSparkline-B480JOwC.js similarity index 96% rename from frontend/dist/assets/LightSparkline-DI3I2Qod.js rename to frontend/dist/assets/LightSparkline-B480JOwC.js index 2127d572..4991711e 100644 --- a/frontend/dist/assets/LightSparkline-DI3I2Qod.js +++ b/frontend/dist/assets/LightSparkline-B480JOwC.js @@ -1 +1 @@ -import{r as y,j as t}from"./index-Bcr7MabU.js";const m="var(--sys-cyan)",k="var(--sys-blue)",v="var(--sys-indigo)",I="var(--sparkline-critical)",g="var(--fg-muted)";function C(d,o,e,s=2){if(d.length<2)return"";const r=d.map(n=>n.count),u=Math.max(...r,1),p=Math.min(...r),l=u-p||1,j=o-s*2,a=e-s*2,i=r.map((n,c)=>({x:s+c/(r.length-1)*j,y:s+a-(n-p)/l*a}));let x=`M ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)}`;for(let n=1;nC(o,e,s),[o,e,s]),x=!r&&o.length>=2,n=r??(x?`url(#${a})`:g),c=l.includes("w-");return p&&o.length<2?t.jsx("div",{className:`flex items-center justify-center ${l}`,style:c?{height:s}:{width:e,height:s},children:t.jsx("div",{className:"rounded animate-pulse bg-subtle-fill-hover",style:c?{width:"100%",height:s-6}:{width:e-8,height:s-6}})}):o.length<2?t.jsx("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,className:l,"aria-hidden":"true",children:t.jsx("line",{x1:4,y1:s/2,x2:e-4,y2:s/2,stroke:I,strokeWidth:1.5,strokeDasharray:"3,2"})}):t.jsxs("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,preserveAspectRatio:"none",className:l,"aria-hidden":"true",style:{maxWidth:"100%"},children:[x&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,gradientUnits:"userSpaceOnUse",x1:0,y1:2,x2:0,y2:s-2,children:[t.jsx("stop",{offset:"0%",stopColor:u?v:m}),t.jsx("stop",{offset:"50%",stopColor:k}),t.jsx("stop",{offset:"100%",stopColor:u?m:v})]})}),t.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})});export{L}; +import{r as y,j as t}from"./index-CR6htdhJ.js";const m="var(--sys-cyan)",k="var(--sys-blue)",v="var(--sys-indigo)",I="var(--sparkline-critical)",g="var(--fg-muted)";function C(d,o,e,s=2){if(d.length<2)return"";const r=d.map(n=>n.count),u=Math.max(...r,1),p=Math.min(...r),l=u-p||1,j=o-s*2,a=e-s*2,i=r.map((n,c)=>({x:s+c/(r.length-1)*j,y:s+a-(n-p)/l*a}));let x=`M ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)}`;for(let n=1;nC(o,e,s),[o,e,s]),x=!r&&o.length>=2,n=r??(x?`url(#${a})`:g),c=l.includes("w-");return p&&o.length<2?t.jsx("div",{className:`flex items-center justify-center ${l}`,style:c?{height:s}:{width:e,height:s},children:t.jsx("div",{className:"rounded animate-pulse bg-subtle-fill-hover",style:c?{width:"100%",height:s-6}:{width:e-8,height:s-6}})}):o.length<2?t.jsx("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,className:l,"aria-hidden":"true",children:t.jsx("line",{x1:4,y1:s/2,x2:e-4,y2:s/2,stroke:I,strokeWidth:1.5,strokeDasharray:"3,2"})}):t.jsxs("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,preserveAspectRatio:"none",className:l,"aria-hidden":"true",style:{maxWidth:"100%"},children:[x&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,gradientUnits:"userSpaceOnUse",x1:0,y1:2,x2:0,y2:s-2,children:[t.jsx("stop",{offset:"0%",stopColor:u?v:m}),t.jsx("stop",{offset:"50%",stopColor:k}),t.jsx("stop",{offset:"100%",stopColor:u?m:v})]})}),t.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})});export{L}; diff --git a/frontend/dist/assets/Login-Br5YhO2e.js b/frontend/dist/assets/Login-B9QEg4ZX.js similarity index 99% rename from frontend/dist/assets/Login-Br5YhO2e.js rename to frontend/dist/assets/Login-B9QEg4ZX.js index 8715f572..1849cf4b 100644 --- a/frontend/dist/assets/Login-Br5YhO2e.js +++ b/frontend/dist/assets/Login-B9QEg4ZX.js @@ -1 +1 @@ -import{r as s,j as e,u as _,g as Z,i as B,s as E,l as I,m as r,a as T,b as u,A,c as f,I as j,C as W,d as z,B as F,Z as D}from"./index-Bcr7MabU.js";function U({width:i,height:n,className:d="",fill:a="currentColor"}){return e.jsxs("svg",{viewBox:"0 0 134 15",width:i,height:n,className:d,role:"img","aria-label":"MeshCore",style:{fillRule:"evenodd",clipRule:"evenodd"},children:[e.jsx("path",{fill:a,d:"M3.277,0.053C2.829,0.053 2.401,0.41 2.321,0.851L0.013,13.623C-0.067,14.064 0.232,14.421 0.681,14.421L3.13,14.421C3.578,14.421 4.006,14.064 4.086,13.623L5.004,8.54L6.684,13.957C6.766,14.239 7.02,14.421 7.337,14.421L10.58,14.421C10.897,14.421 11.217,14.239 11.401,13.957L15.043,8.513L14.119,13.623C14.038,14.064 14.338,14.421 14.787,14.421L17.236,14.421C17.684,14.421 18.112,14.064 18.192,13.623L20.5,0.851C20.582,0.41 20.283,0.053 19.834,0.053L16.69,0.053C16.373,0.053 16.053,0.235 15.87,0.517L9.897,9.473C9.803,9.616 9.578,9.578 9.528,9.41L7.074,0.517C6.992,0.235 6.738,0.053 6.421,0.053L3.277,0.053Z"}),e.jsx("path",{fill:a,d:"M21.146,14.421C21.146,14.421 33.257,14.421 33.257,14.421C33.526,14.421 33.784,14.205 33.831,13.942L34.337,11.128C34.385,10.863 34.206,10.649 33.936,10.649L25.519,10.649C25.429,10.649 25.37,10.576 25.385,10.488L25.635,9.105C25.65,9.017 25.736,8.944 25.826,8.944L32.596,8.944C32.865,8.944 33.123,8.728 33.171,8.465L33.621,5.974C33.669,5.709 33.49,5.495 33.221,5.495L26.45,5.495C26.361,5.495 26.301,5.423 26.317,5.335L26.584,3.852C26.599,3.764 26.685,3.691 26.775,3.691L35.192,3.691C35.462,3.691 35.719,3.476 35.767,3.21L36.258,0.498C36.306,0.235 36.126,0.019 35.857,0.019L23.746,0.019C23.297,0.019 22.867,0.378 22.788,0.819L20.474,13.621C20.396,14.062 20.695,14.421 21.146,14.421Z"}),e.jsx("path",{fill:a,d:"M45.926,14.419L45.926,14.421L46.346,14.421C48.453,14.421 50.465,12.742 50.839,10.67L51.081,9.327C51.456,7.256 50.05,5.576 47.943,5.576L41.455,5.576C41.186,5.576 41.007,5.363 41.054,5.097L41.218,4.192C41.266,3.927 41.524,3.713 41.793,3.713L50.569,3.713C51.018,3.713 51.446,3.356 51.526,2.915L51.9,0.85C51.98,0.407 51.68,0.05 51.232,0.05L41.638,0.05C39.531,0.05 37.519,1.73 37.145,3.801L36.88,5.267C36.505,7.339 37.91,9.018 40.018,9.018L46.506,9.018C46.775,9.018 46.954,9.231 46.907,9.497L46.785,10.176C46.737,10.441 46.479,10.655 46.21,10.655L37.189,10.655C36.741,10.655 36.313,11.012 36.233,11.453L35.841,13.621C35.761,14.062 36.061,14.419 36.51,14.419L45.926,14.419Z"}),e.jsx("path",{fill:a,d:"M68.008,0.046C68.008,0.046 65.296,0.046 65.296,0.046C64.847,0.046 64.42,0.403 64.34,0.844L63.532,5.31C63.517,5.398 63.431,5.469 63.341,5.469L58.085,5.469C57.995,5.469 57.936,5.398 57.951,5.31L58.758,0.844C58.837,0.403 58.539,0.046 58.09,0.046L55.378,0.046C54.93,0.046 54.502,0.403 54.422,0.844L52.112,13.623C52.032,14.064 52.331,14.421 52.78,14.421L55.492,14.421C55.941,14.421 56.369,14.064 56.449,13.623L57.272,9.074C57.287,8.986 57.373,8.914 57.462,8.914L62.719,8.914C62.809,8.914 62.868,8.985 62.853,9.074L62.032,13.623C61.952,14.064 62.252,14.421 62.7,14.421L65.413,14.421C65.861,14.421 66.289,14.064 66.369,13.623L68.678,0.844C68.755,0.403 68.457,0.046 68.008,0.046Z"}),e.jsx("path",{fill:a,d:"M72.099,14.421C72.099,14.421 80.066,14.421 80.066,14.421C80.515,14.421 80.943,14.064 81.022,13.623L81.414,11.453C81.494,11.012 81.194,10.655 80.746,10.655L73.828,10.655C73.559,10.655 73.38,10.441 73.427,10.176L74.51,4.215C74.558,3.951 74.815,3.736 75.082,3.736L82,3.736C82.448,3.736 82.876,3.379 82.956,2.938L83.34,0.817C83.42,0.376 83.12,0.019 82.672,0.019L74.724,0.019C72.622,0.019 70.614,1.691 70.236,3.757L68.965,10.665C68.587,12.738 69.99,14.421 72.099,14.421Z"}),e.jsx("path",{fill:a,d:"M97.176,-0C97.176,0 88.882,0 88.882,0C86.775,0 84.763,1.68 84.389,3.751L83.139,10.67C82.765,12.741 84.169,14.421 86.277,14.421L94.571,14.421C96.678,14.421 98.69,12.741 99.064,10.67L100.314,3.751C100.689,1.68 99.284,-0 97.176,-0ZM94.798,10.178C94.75,10.443 94.492,10.657 94.223,10.657L87.978,10.657C87.709,10.657 87.529,10.443 87.577,10.178L88.659,4.192C88.707,3.927 88.964,3.713 89.234,3.713L95.477,3.713C95.747,3.713 95.926,3.927 95.878,4.192L94.798,10.178Z"}),e.jsx("path",{fill:a,d:"M101.284,14.421L103.995,14.421C104.443,14.421 104.871,14.065 104.951,13.624L105.43,10.97C105.446,10.882 105.531,10.81 105.621,10.81L108.902,10.806C109.064,10.806 109.2,10.886 109.267,11.018L110.813,14.035C110.992,14.392 111.319,14.434 112.303,14.419C112.88,14.426 113.756,14.382 115.169,14.382C115.623,14.382 115.902,13.907 115.678,13.51L113.989,10.569C113.945,10.491 113.993,10.386 114.086,10.34C115.39,9.707 116.423,8.477 116.681,7.055L117.27,3.785C117.646,1.713 116.242,0.033 114.134,0.033L103.884,0.033C103.436,0.033 103.008,0.39 102.928,0.831L100.616,13.623C100.536,14.064 100.836,14.421 101.284,14.421L101.284,14.421ZM106.73,3.791C106.745,3.703 106.831,3.631 106.921,3.631L112.225,3.631C112.626,3.631 112.891,3.949 112.821,4.343L112.431,6.494C112.359,6.885 111.979,7.204 111.58,7.204L106.276,7.204C106.186,7.204 106.127,7.133 106.142,7.043L106.73,3.791Z"}),e.jsx("path",{fill:a,d:"M118.277,14.421C118.277,14.421 130.388,14.421 130.388,14.421C130.657,14.421 130.915,14.205 130.963,13.942L131.468,11.128C131.516,10.863 131.337,10.649 131.068,10.649L122.65,10.649C122.56,10.649 122.501,10.576 122.516,10.488L122.766,9.105C122.781,9.017 122.867,8.944 122.957,8.944L129.728,8.944C129.997,8.944 130.254,8.728 130.302,8.465L130.753,5.974C130.801,5.709 130.621,5.495 130.352,5.495L123.581,5.495C123.492,5.495 123.432,5.423 123.448,5.335L123.715,3.852C123.73,3.764 123.816,3.691 123.906,3.691L132.324,3.691C132.593,3.691 132.851,3.476 132.898,3.21L133.389,0.498C133.437,0.235 133.257,0.019 132.988,0.019L120.877,0.019C120.428,0.019 119.999,0.378 119.919,0.819L117.605,13.621C117.527,14.062 117.827,14.421 118.277,14.421Z"})]})}const q=s.memo(U),H="/assets/WCM_Waves-RN-_ocPH.gif",K="/assets/pyMC-logo-CaIkLXHc.svg",l={container:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:T.normal,delayChildren:.1}}},item:{hidden:{opacity:0,y:12},visible:{opacity:1,y:0,transition:u.smooth}},footer:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{...u.gentle,delay:.4}}},error:{hidden:{opacity:0,height:0,marginTop:0},visible:{opacity:1,height:"auto",marginTop:24,transition:u.snappy},exit:{opacity:0,height:0,marginTop:0,transition:{duration:.15}}}},b=f("block type-badge text-fg-secondary"),X=s.memo(function({className:n}){return e.jsxs("svg",{className:f("animate-spin",n),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),p=s.memo(function({href:n,children:d}){return e.jsx(r.a,{href:n,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.98},className:"inline-flex items-center gap-1.5 opacity-60 hover:opacity-100 transition-opacity",children:d})}),v=()=>e.jsx("span",{className:"text-white/20 text-xs","aria-hidden":"true",children:"•"}),Y=s.memo(function(){return e.jsx("div",{className:"fixed inset-0 -z-10",style:{backgroundColor:D[950]},"aria-hidden":"true"})}),O=s.memo(function(){return e.jsxs(r.footer,{variants:l.footer,initial:"hidden",animate:"visible",className:"fixed bottom-0 inset-x-0 px-4 py-6",children:[e.jsx("p",{className:"text-center type-badge text-white/40 mb-3",children:"Powered By"}),e.jsx("div",{className:"mx-auto max-w-xs",children:e.jsxs("div",{className:"flex items-center justify-center gap-4",children:[e.jsx(p,{href:"https://github.com/rightup/pyMC_Repeater",children:e.jsx("img",{src:K,alt:"pyMC",className:"h-14"})}),e.jsx(v,{}),e.jsx(p,{href:"https://meshcore.co.uk",children:e.jsx(q,{height:12,className:"text-white"})}),e.jsx(v,{}),e.jsxs(p,{href:"https://wcmesh.com",children:[e.jsx("div",{className:"size-14 overflow-hidden radius-badge border border-white/10 -translate-y-1",children:e.jsx("img",{src:H,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),V={session_expired:"Your session has expired. Please sign in again.",no_token:"Authentication required. Please sign in.",token_expired_away:"Your session expired while you were away."};function J(){const i=_(),[n,d]=s.useState("admin"),[a,N]=s.useState(""),[C,w]=s.useState(Z),[L,g]=s.useState(!1),[o,h]=s.useState(null),[y]=s.useState(()=>{try{const t=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),t?V[t]??null:null}catch{return null}}),c=n.length>0&&a.length>0&&!L;s.useEffect(()=>{B()&&i("/",{replace:!0})},[i]);const m=s.useCallback(()=>h(null),[]),M=s.useCallback(t=>{d(t.target.value),o&&m()},[o,m]),k=s.useCallback(t=>{N(t.target.value),o&&m()},[o,m]),S=s.useCallback(t=>{w(t),E(t)},[]),R=s.useCallback(async t=>{if(t.preventDefault(),!c)return;g(!0),h(null);const x=await I(n,a,C);g(!1),x.success?window.location.href="/":h(x.error??"Login failed")},[c,n,a,C]),P=s.useCallback(t=>{t.key==="Enter"&&c&&t.target.tagName==="INPUT"&&(t.preventDefault(),t.currentTarget.requestSubmit())},[c]);return e.jsxs(e.Fragment,{children:[e.jsx(Y,{}),e.jsx("main",{className:"flex min-h-svh items-center justify-center px-4 py-6 sm:px-6 lg:px-8 -mt-6",children:e.jsxs(r.div,{variants:l.container,initial:"hidden",animate:"visible",className:"w-full max-w-sm space-y-10",children:[e.jsx(r.div,{variants:l.item,className:"flex justify-center",children:e.jsx(A,{})}),y&&!o&&e.jsx(r.div,{variants:l.item,className:"rounded-md bg-sys-amber/10 px-3 py-2.5 text-center",children:e.jsx("p",{className:"text-sm text-sys-amber",children:y})}),e.jsxs(r.form,{variants:l.item,onSubmit:R,onKeyDown:P,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:b,children:"Username"}),e.jsx("div",{className:"mt-2",children:e.jsx(j,{id:"username",name:"username",type:"text",value:n,onChange:M,required:!0,autoComplete:"username",className:"font-mono text-sm font-semibold"})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:b,children:"Password"}),e.jsx("div",{className:"mt-2",children:e.jsx(j,{id:"password",name:"password",type:"password",value:a,onChange:k,required:!0,autoComplete:"current-password",autoFocus:!0,className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(W,{checked:C,onChange:S,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(z,{mode:"wait",children:o&&e.jsx(r.div,{variants:l.error,initial:"hidden",animate:"visible",exit:"exit",role:"alert",className:"rounded-md bg-sys-red/10 p-3 overflow-hidden",children:e.jsx("p",{className:"text-sm text-sys-red text-center",children:o})},"error")}),e.jsx(r.div,{whileTap:c?{scale:.98}:void 0,children:e.jsx(F,{type:"submit",disabled:!c,className:"w-full py-3 radius-pill font-mono text-sm font-semibold uppercase tracking-wide text-white bg-sys-indigo hover:bg-sys-blue shadow-sm transition-colors",children:L?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"size-4"}),"Signing in…"]}):"Sign in"})})]}),e.jsxs(r.p,{variants:l.item,className:"text-center text-sm/6 text-fg-muted",children:["A ",e.jsx("span",{className:"text-sys-blue",children:"@RightUp"})," X"," ",e.jsx("span",{className:"text-sys-blue",children:"@Treehouse⚡"})," Collab"]})]})}),e.jsx(O,{})]})}export{J as default}; +import{r as s,j as e,u as _,g as Z,i as B,s as E,l as I,m as r,a as T,b as u,A,c as f,I as j,C as W,d as z,B as F,Z as D}from"./index-CR6htdhJ.js";function U({width:i,height:n,className:d="",fill:a="currentColor"}){return e.jsxs("svg",{viewBox:"0 0 134 15",width:i,height:n,className:d,role:"img","aria-label":"MeshCore",style:{fillRule:"evenodd",clipRule:"evenodd"},children:[e.jsx("path",{fill:a,d:"M3.277,0.053C2.829,0.053 2.401,0.41 2.321,0.851L0.013,13.623C-0.067,14.064 0.232,14.421 0.681,14.421L3.13,14.421C3.578,14.421 4.006,14.064 4.086,13.623L5.004,8.54L6.684,13.957C6.766,14.239 7.02,14.421 7.337,14.421L10.58,14.421C10.897,14.421 11.217,14.239 11.401,13.957L15.043,8.513L14.119,13.623C14.038,14.064 14.338,14.421 14.787,14.421L17.236,14.421C17.684,14.421 18.112,14.064 18.192,13.623L20.5,0.851C20.582,0.41 20.283,0.053 19.834,0.053L16.69,0.053C16.373,0.053 16.053,0.235 15.87,0.517L9.897,9.473C9.803,9.616 9.578,9.578 9.528,9.41L7.074,0.517C6.992,0.235 6.738,0.053 6.421,0.053L3.277,0.053Z"}),e.jsx("path",{fill:a,d:"M21.146,14.421C21.146,14.421 33.257,14.421 33.257,14.421C33.526,14.421 33.784,14.205 33.831,13.942L34.337,11.128C34.385,10.863 34.206,10.649 33.936,10.649L25.519,10.649C25.429,10.649 25.37,10.576 25.385,10.488L25.635,9.105C25.65,9.017 25.736,8.944 25.826,8.944L32.596,8.944C32.865,8.944 33.123,8.728 33.171,8.465L33.621,5.974C33.669,5.709 33.49,5.495 33.221,5.495L26.45,5.495C26.361,5.495 26.301,5.423 26.317,5.335L26.584,3.852C26.599,3.764 26.685,3.691 26.775,3.691L35.192,3.691C35.462,3.691 35.719,3.476 35.767,3.21L36.258,0.498C36.306,0.235 36.126,0.019 35.857,0.019L23.746,0.019C23.297,0.019 22.867,0.378 22.788,0.819L20.474,13.621C20.396,14.062 20.695,14.421 21.146,14.421Z"}),e.jsx("path",{fill:a,d:"M45.926,14.419L45.926,14.421L46.346,14.421C48.453,14.421 50.465,12.742 50.839,10.67L51.081,9.327C51.456,7.256 50.05,5.576 47.943,5.576L41.455,5.576C41.186,5.576 41.007,5.363 41.054,5.097L41.218,4.192C41.266,3.927 41.524,3.713 41.793,3.713L50.569,3.713C51.018,3.713 51.446,3.356 51.526,2.915L51.9,0.85C51.98,0.407 51.68,0.05 51.232,0.05L41.638,0.05C39.531,0.05 37.519,1.73 37.145,3.801L36.88,5.267C36.505,7.339 37.91,9.018 40.018,9.018L46.506,9.018C46.775,9.018 46.954,9.231 46.907,9.497L46.785,10.176C46.737,10.441 46.479,10.655 46.21,10.655L37.189,10.655C36.741,10.655 36.313,11.012 36.233,11.453L35.841,13.621C35.761,14.062 36.061,14.419 36.51,14.419L45.926,14.419Z"}),e.jsx("path",{fill:a,d:"M68.008,0.046C68.008,0.046 65.296,0.046 65.296,0.046C64.847,0.046 64.42,0.403 64.34,0.844L63.532,5.31C63.517,5.398 63.431,5.469 63.341,5.469L58.085,5.469C57.995,5.469 57.936,5.398 57.951,5.31L58.758,0.844C58.837,0.403 58.539,0.046 58.09,0.046L55.378,0.046C54.93,0.046 54.502,0.403 54.422,0.844L52.112,13.623C52.032,14.064 52.331,14.421 52.78,14.421L55.492,14.421C55.941,14.421 56.369,14.064 56.449,13.623L57.272,9.074C57.287,8.986 57.373,8.914 57.462,8.914L62.719,8.914C62.809,8.914 62.868,8.985 62.853,9.074L62.032,13.623C61.952,14.064 62.252,14.421 62.7,14.421L65.413,14.421C65.861,14.421 66.289,14.064 66.369,13.623L68.678,0.844C68.755,0.403 68.457,0.046 68.008,0.046Z"}),e.jsx("path",{fill:a,d:"M72.099,14.421C72.099,14.421 80.066,14.421 80.066,14.421C80.515,14.421 80.943,14.064 81.022,13.623L81.414,11.453C81.494,11.012 81.194,10.655 80.746,10.655L73.828,10.655C73.559,10.655 73.38,10.441 73.427,10.176L74.51,4.215C74.558,3.951 74.815,3.736 75.082,3.736L82,3.736C82.448,3.736 82.876,3.379 82.956,2.938L83.34,0.817C83.42,0.376 83.12,0.019 82.672,0.019L74.724,0.019C72.622,0.019 70.614,1.691 70.236,3.757L68.965,10.665C68.587,12.738 69.99,14.421 72.099,14.421Z"}),e.jsx("path",{fill:a,d:"M97.176,-0C97.176,0 88.882,0 88.882,0C86.775,0 84.763,1.68 84.389,3.751L83.139,10.67C82.765,12.741 84.169,14.421 86.277,14.421L94.571,14.421C96.678,14.421 98.69,12.741 99.064,10.67L100.314,3.751C100.689,1.68 99.284,-0 97.176,-0ZM94.798,10.178C94.75,10.443 94.492,10.657 94.223,10.657L87.978,10.657C87.709,10.657 87.529,10.443 87.577,10.178L88.659,4.192C88.707,3.927 88.964,3.713 89.234,3.713L95.477,3.713C95.747,3.713 95.926,3.927 95.878,4.192L94.798,10.178Z"}),e.jsx("path",{fill:a,d:"M101.284,14.421L103.995,14.421C104.443,14.421 104.871,14.065 104.951,13.624L105.43,10.97C105.446,10.882 105.531,10.81 105.621,10.81L108.902,10.806C109.064,10.806 109.2,10.886 109.267,11.018L110.813,14.035C110.992,14.392 111.319,14.434 112.303,14.419C112.88,14.426 113.756,14.382 115.169,14.382C115.623,14.382 115.902,13.907 115.678,13.51L113.989,10.569C113.945,10.491 113.993,10.386 114.086,10.34C115.39,9.707 116.423,8.477 116.681,7.055L117.27,3.785C117.646,1.713 116.242,0.033 114.134,0.033L103.884,0.033C103.436,0.033 103.008,0.39 102.928,0.831L100.616,13.623C100.536,14.064 100.836,14.421 101.284,14.421L101.284,14.421ZM106.73,3.791C106.745,3.703 106.831,3.631 106.921,3.631L112.225,3.631C112.626,3.631 112.891,3.949 112.821,4.343L112.431,6.494C112.359,6.885 111.979,7.204 111.58,7.204L106.276,7.204C106.186,7.204 106.127,7.133 106.142,7.043L106.73,3.791Z"}),e.jsx("path",{fill:a,d:"M118.277,14.421C118.277,14.421 130.388,14.421 130.388,14.421C130.657,14.421 130.915,14.205 130.963,13.942L131.468,11.128C131.516,10.863 131.337,10.649 131.068,10.649L122.65,10.649C122.56,10.649 122.501,10.576 122.516,10.488L122.766,9.105C122.781,9.017 122.867,8.944 122.957,8.944L129.728,8.944C129.997,8.944 130.254,8.728 130.302,8.465L130.753,5.974C130.801,5.709 130.621,5.495 130.352,5.495L123.581,5.495C123.492,5.495 123.432,5.423 123.448,5.335L123.715,3.852C123.73,3.764 123.816,3.691 123.906,3.691L132.324,3.691C132.593,3.691 132.851,3.476 132.898,3.21L133.389,0.498C133.437,0.235 133.257,0.019 132.988,0.019L120.877,0.019C120.428,0.019 119.999,0.378 119.919,0.819L117.605,13.621C117.527,14.062 117.827,14.421 118.277,14.421Z"})]})}const q=s.memo(U),H="/assets/WCM_Waves-RN-_ocPH.gif",K="/assets/pyMC-logo-CaIkLXHc.svg",l={container:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:T.normal,delayChildren:.1}}},item:{hidden:{opacity:0,y:12},visible:{opacity:1,y:0,transition:u.smooth}},footer:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{...u.gentle,delay:.4}}},error:{hidden:{opacity:0,height:0,marginTop:0},visible:{opacity:1,height:"auto",marginTop:24,transition:u.snappy},exit:{opacity:0,height:0,marginTop:0,transition:{duration:.15}}}},b=f("block type-badge text-fg-secondary"),X=s.memo(function({className:n}){return e.jsxs("svg",{className:f("animate-spin",n),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),p=s.memo(function({href:n,children:d}){return e.jsx(r.a,{href:n,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.98},className:"inline-flex items-center gap-1.5 opacity-60 hover:opacity-100 transition-opacity",children:d})}),v=()=>e.jsx("span",{className:"text-white/20 text-xs","aria-hidden":"true",children:"•"}),Y=s.memo(function(){return e.jsx("div",{className:"fixed inset-0 -z-10",style:{backgroundColor:D[950]},"aria-hidden":"true"})}),O=s.memo(function(){return e.jsxs(r.footer,{variants:l.footer,initial:"hidden",animate:"visible",className:"fixed bottom-0 inset-x-0 px-4 py-6",children:[e.jsx("p",{className:"text-center type-badge text-white/40 mb-3",children:"Powered By"}),e.jsx("div",{className:"mx-auto max-w-xs",children:e.jsxs("div",{className:"flex items-center justify-center gap-4",children:[e.jsx(p,{href:"https://github.com/rightup/pyMC_Repeater",children:e.jsx("img",{src:K,alt:"pyMC",className:"h-14"})}),e.jsx(v,{}),e.jsx(p,{href:"https://meshcore.co.uk",children:e.jsx(q,{height:12,className:"text-white"})}),e.jsx(v,{}),e.jsxs(p,{href:"https://wcmesh.com",children:[e.jsx("div",{className:"size-14 overflow-hidden radius-badge border border-white/10 -translate-y-1",children:e.jsx("img",{src:H,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),V={session_expired:"Your session has expired. Please sign in again.",no_token:"Authentication required. Please sign in.",token_expired_away:"Your session expired while you were away."};function J(){const i=_(),[n,d]=s.useState("admin"),[a,N]=s.useState(""),[C,w]=s.useState(Z),[L,g]=s.useState(!1),[o,h]=s.useState(null),[y]=s.useState(()=>{try{const t=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),t?V[t]??null:null}catch{return null}}),c=n.length>0&&a.length>0&&!L;s.useEffect(()=>{B()&&i("/",{replace:!0})},[i]);const m=s.useCallback(()=>h(null),[]),M=s.useCallback(t=>{d(t.target.value),o&&m()},[o,m]),k=s.useCallback(t=>{N(t.target.value),o&&m()},[o,m]),S=s.useCallback(t=>{w(t),E(t)},[]),R=s.useCallback(async t=>{if(t.preventDefault(),!c)return;g(!0),h(null);const x=await I(n,a,C);g(!1),x.success?window.location.href="/":h(x.error??"Login failed")},[c,n,a,C]),P=s.useCallback(t=>{t.key==="Enter"&&c&&t.target.tagName==="INPUT"&&(t.preventDefault(),t.currentTarget.requestSubmit())},[c]);return e.jsxs(e.Fragment,{children:[e.jsx(Y,{}),e.jsx("main",{className:"flex min-h-svh items-center justify-center px-4 py-6 sm:px-6 lg:px-8 -mt-6",children:e.jsxs(r.div,{variants:l.container,initial:"hidden",animate:"visible",className:"w-full max-w-sm space-y-10",children:[e.jsx(r.div,{variants:l.item,className:"flex justify-center",children:e.jsx(A,{})}),y&&!o&&e.jsx(r.div,{variants:l.item,className:"rounded-md bg-sys-amber/10 px-3 py-2.5 text-center",children:e.jsx("p",{className:"text-sm text-sys-amber",children:y})}),e.jsxs(r.form,{variants:l.item,onSubmit:R,onKeyDown:P,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:b,children:"Username"}),e.jsx("div",{className:"mt-2",children:e.jsx(j,{id:"username",name:"username",type:"text",value:n,onChange:M,required:!0,autoComplete:"username",className:"font-mono text-sm font-semibold"})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:b,children:"Password"}),e.jsx("div",{className:"mt-2",children:e.jsx(j,{id:"password",name:"password",type:"password",value:a,onChange:k,required:!0,autoComplete:"current-password",autoFocus:!0,className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(W,{checked:C,onChange:S,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(z,{mode:"wait",children:o&&e.jsx(r.div,{variants:l.error,initial:"hidden",animate:"visible",exit:"exit",role:"alert",className:"rounded-md bg-sys-red/10 p-3 overflow-hidden",children:e.jsx("p",{className:"text-sm text-sys-red text-center",children:o})},"error")}),e.jsx(r.div,{whileTap:c?{scale:.98}:void 0,children:e.jsx(F,{type:"submit",disabled:!c,className:"w-full py-3 radius-pill font-mono text-sm font-semibold uppercase tracking-wide text-white bg-sys-indigo hover:bg-sys-blue shadow-sm transition-colors",children:L?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"size-4"}),"Signing in…"]}):"Sign in"})})]}),e.jsxs(r.p,{variants:l.item,className:"text-center text-sm/6 text-fg-muted",children:["A ",e.jsx("span",{className:"text-sys-blue",children:"@RightUp"})," X"," ",e.jsx("span",{className:"text-sys-blue",children:"@Treehouse⚡"})," Collab"]})]})}),e.jsx(O,{})]})}export{J as default}; diff --git a/frontend/dist/assets/Logs-C_jpyZwT.js b/frontend/dist/assets/Logs-1xtkFUfl.js similarity index 92% rename from frontend/dist/assets/Logs-C_jpyZwT.js rename to frontend/dist/assets/Logs-1xtkFUfl.js index d141bec8..0307a07e 100644 --- a/frontend/dist/assets/Logs-C_jpyZwT.js +++ b/frontend/dist/assets/Logs-1xtkFUfl.js @@ -1 +1 @@ -import{dY as h,dZ as f,a5 as j,d_ as L,d$ as v,r as l,e0 as N,j as e,e1 as m,a7 as y,B as w,c as i,e2 as b,dN as C,m as S,e3 as E}from"./index-Bcr7MabU.js";import{P,a as R,B as k,C as B}from"./PageLayout-Bd1lZEvE.js";import{C as I,a as T}from"./circle-stop-DyHSKXzf.js";const D=l.memo(function({log:a}){return e.jsx(S.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:i("type-data-sm w-14 shrink-0",E(a.level)),children:a.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:a.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(a.timestamp).toLocaleString()})]})]})})});function M({showDebug:s,onToggle:a}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:i("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(C,{enabled:s,onChange:a,size:"sm"})]})}function O(){const s=h(),a=f(),o=j(),r=L(),g=v(),[c,x]=l.useState(!1),u=l.useCallback(()=>{x(t=>!t)},[]),d=c?s:s.filter(t=>t.level!=="DEBUG"),n=l.useRef(r);return n.current=r,l.useEffect(()=>{if(!o)return;n.current();const t=setInterval(()=>n.current(),N.logs);return()=>clearInterval(t)},[o]),e.jsxs(P,{children:[e.jsx(R,{title:"System Logs",icon:e.jsx(m,{}),controls:e.jsx(M,{showDebug:c,onToggle:u})}),e.jsx(k,{ready:!0,children:e.jsxs(B,{neomorphic:!0,noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(w,{plain:!0,color:o?"danger":"primary",onClick:()=>g(!o),title:o?"Pause":"Resume",className:i(!o&&"animate-pulse-slow"),children:o?e.jsx(I,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(T,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:a&&s.length===0?e.jsx(b,{count:10}):d.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:s.length===0?"No logs available":"No logs match selected filters"}):d.map((t,p)=>e.jsx(D,{log:t},`${t.timestamp}-${p}`))})]})})]})}export{O as default}; +import{dY as h,dZ as f,a5 as j,d_ as L,d$ as v,r as l,e0 as N,j as e,e1 as m,a7 as y,B as w,c as i,e2 as b,dN as C,m as S,e3 as E}from"./index-CR6htdhJ.js";import{P,a as R,B as k,C as B}from"./PageLayout-Dk902Dlo.js";import{C as I,a as T}from"./circle-stop-PRJBjCmt.js";const D=l.memo(function({log:a}){return e.jsx(S.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:i("type-data-sm w-14 shrink-0",E(a.level)),children:a.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:a.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(a.timestamp).toLocaleString()})]})]})})});function M({showDebug:s,onToggle:a}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:i("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(C,{enabled:s,onChange:a,size:"sm"})]})}function O(){const s=h(),a=f(),o=j(),r=L(),g=v(),[c,x]=l.useState(!1),u=l.useCallback(()=>{x(t=>!t)},[]),d=c?s:s.filter(t=>t.level!=="DEBUG"),n=l.useRef(r);return n.current=r,l.useEffect(()=>{if(!o)return;n.current();const t=setInterval(()=>n.current(),N.logs);return()=>clearInterval(t)},[o]),e.jsxs(P,{children:[e.jsx(R,{title:"System Logs",icon:e.jsx(m,{}),controls:e.jsx(M,{showDebug:c,onToggle:u})}),e.jsx(k,{ready:!0,children:e.jsxs(B,{neomorphic:!0,noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(w,{plain:!0,color:o?"danger":"primary",onClick:()=>g(!o),title:o?"Pause":"Resume",className:i(!o&&"animate-pulse-slow"),children:o?e.jsx(I,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(T,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:a&&s.length===0?e.jsx(b,{count:10}):d.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:s.length===0?"No logs available":"No logs match selected filters"}):d.map((t,p)=>e.jsx(D,{log:t},`${t.timestamp}-${p}`))})]})})]})}export{O as default}; diff --git a/frontend/dist/assets/MeshGraph-hbIFphfn.js b/frontend/dist/assets/MeshGraph-BI-UzBT5.js similarity index 99% rename from frontend/dist/assets/MeshGraph-hbIFphfn.js rename to frontend/dist/assets/MeshGraph-BI-UzBT5.js index f7800606..ccaed4f5 100644 --- a/frontend/dist/assets/MeshGraph-hbIFphfn.js +++ b/frontend/dist/assets/MeshGraph-BI-UzBT5.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-CamuNnA4.js","assets/index-Bcr7MabU.js","assets/max-3Pc3oKmC.js","assets/consumer-registry-Dy-EEMxV.js","assets/variants-Dh1uX6Aa.js","assets/git-branch-CzidlvuL.js","assets/clock-vUFydv3d.js","assets/database-DdKGqHhF.js","assets/badge-colors-Dl76Mz8m.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/target-3KNT7m1p.js","assets/layers-D696eHgB.js","assets/search-D6EZ95nX.js","assets/settings-2-Warn9Z6j.js","assets/rotate-ccw-C1kT5MK1.js","assets/chevron-right-BrHsAUr1.js","assets/network-Bga26A1_.js","assets/index-7uzBcJ1E.css"])))=>i.map(i=>d[i]); -var cL=Object.defineProperty;var uL=(i,e,t)=>e in i?cL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var b=(i,e,t)=>uL(i,typeof e!="symbol"?e+"":e,t);import{e as rp,r as U,_ as m0,bv as un,cv as mg,dq as dL,dr as hL,j as f,aC as fL,aD as g0,bN as Vl,c as oh,bZ as pL,ds as mL,m as ma,a0 as ey,a2 as gg,dt as PS,du as jh,dv as NS,ao as hd,dw as gL,dx as _L,d as Jc,dy as yL,aR as bL,dz as vL,dA as xL,dB as wL,dC as SL,dD as EL,dE as CL,dF as TL,a6 as kL,cQ as AL,dG as IL,O as Ge,Z as Xt,dH as _0,V as Oi,ap as be,dI as LL,dJ as RL,aa as _g,dK as fd,aE as y0,dL as PL,aF as Pc,dM as NL,b3 as DL,dN as ML,dO as OL,B as ty,c4 as BL,a1 as FL,a3 as zL,dP as UL}from"./index-Bcr7MabU.js";import{m as b0,t as yg,a as $L,b as jL,e as Rn,u as HL,G as VL,c as GL,E as WL}from"./max-3Pc3oKmC.js";import{u as YL,r as qL,f as v0,g as XL,e as KL}from"./consumer-registry-Dy-EEMxV.js";import{s as ZL,M as DS,a as x0,b as iy}from"./variants-Dh1uX6Aa.js";import{G as Wp}from"./git-branch-CzidlvuL.js";import{C as QL}from"./clock-vUFydv3d.js";import{D as JL}from"./database-DdKGqHhF.js";import{N as eR,a as tR}from"./badge-colors-Dl76Mz8m.js";import{e as iR,f as w0,g as nR}from"./meshcore-tx-constants-DgpFTAmf.js";import{E as sR,T as rR}from"./target-3KNT7m1p.js";import{L as S0}from"./layers-D696eHgB.js";import{S as E0}from"./search-D6EZ95nX.js";import{S as C0}from"./settings-2-Warn9Z6j.js";import{R as T0}from"./rotate-ccw-C1kT5MK1.js";import{C as Yp}from"./chevron-right-BrHsAUr1.js";import{N as MS}from"./network-Bga26A1_.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-BEU5HehP.js","assets/index-CR6htdhJ.js","assets/max-BHszoqgD.js","assets/consumer-registry-7Hi_pNJ6.js","assets/variants-B-xhsx06.js","assets/git-branch-94MoMaKB.js","assets/clock-BFNcreJN.js","assets/database-B1i3odU4.js","assets/badge-colors-Dl76Mz8m.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/target-Bmhgwg_g.js","assets/layers-sBqNiTGy.js","assets/search-Djg1V5_Y.js","assets/settings-2-CKRrmjMw.js","assets/rotate-ccw-D8J04SFo.js","assets/chevron-right-D2DgrpVm.js","assets/network-BdCm-DdC.js","assets/index-7uzBcJ1E.css"])))=>i.map(i=>d[i]); +var cL=Object.defineProperty;var uL=(i,e,t)=>e in i?cL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var b=(i,e,t)=>uL(i,typeof e!="symbol"?e+"":e,t);import{e as rp,r as U,_ as m0,bv as un,cv as mg,dq as dL,dr as hL,j as f,aC as fL,aD as g0,bN as Vl,c as oh,bZ as pL,ds as mL,m as ma,a0 as ey,a2 as gg,dt as PS,du as jh,dv as NS,ao as hd,dw as gL,dx as _L,d as Jc,dy as yL,aR as bL,dz as vL,dA as xL,dB as wL,dC as SL,dD as EL,dE as CL,dF as TL,a6 as kL,cQ as AL,dG as IL,O as Ge,Z as Xt,dH as _0,V as Oi,ap as be,dI as LL,dJ as RL,aa as _g,dK as fd,aE as y0,dL as PL,aF as Pc,dM as NL,b3 as DL,dN as ML,dO as OL,B as ty,c4 as BL,a1 as FL,a3 as zL,dP as UL}from"./index-CR6htdhJ.js";import{m as b0,t as yg,a as $L,b as jL,e as Rn,u as HL,G as VL,c as GL,E as WL}from"./max-BHszoqgD.js";import{u as YL,r as qL,f as v0,g as XL,e as KL}from"./consumer-registry-7Hi_pNJ6.js";import{s as ZL,M as DS,a as x0,b as iy}from"./variants-B-xhsx06.js";import{G as Wp}from"./git-branch-94MoMaKB.js";import{C as QL}from"./clock-BFNcreJN.js";import{D as JL}from"./database-B1i3odU4.js";import{N as eR,a as tR}from"./badge-colors-Dl76Mz8m.js";import{e as iR,f as w0,g as nR}from"./meshcore-tx-constants-DgpFTAmf.js";import{E as sR,T as rR}from"./target-Bmhgwg_g.js";import{L as S0}from"./layers-sBqNiTGy.js";import{S as E0}from"./search-Djg1V5_Y.js";import{S as C0}from"./settings-2-CKRrmjMw.js";import{R as T0}from"./rotate-ccw-D8J04SFo.js";import{C as Yp}from"./chevron-right-D2DgrpVm.js";import{N as MS}from"./network-BdCm-DdC.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -29,7 +29,7 @@ ${r}${o}${i.type.toUpperCase()}: ${i.message}

Compilation error in ${r}



 ${o}
-
`,l.style.top="10px",l.style.left="10px",l.style.position="absolute",l.style.zIndex="9999",l.style.width="100%",l.style.textAlign="left",document.body.appendChild(l),(n=document.getElementsByClassName("luma-compiler-log-error")[0])==null||n.scrollIntoView(),l.onclick=()=>{const c=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(c)}}};$(w2,"defaultProps",{...yn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let MN=w2;function ON(i){return BN(i.source)||i.id||fy(`unnamed ${i.stage}-shader`)}function BN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const E2=class C2 extends yn{constructor(e,t){super(e,t,C2.defaultProps),$(this,"shaderLayout"),$(this,"bufferLayout"),$(this,"linkStatus","pending"),$(this,"hash",""),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}get[Symbol.toStringTag](){return"RenderPipeline"}};$(E2,"defaultProps",{...yn.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",colorAttachmentFormats:void 0,depthStencilAttachmentFormat:void 0,parameters:{},bindings:{},uniforms:{}});let Zh=E2;const T2=class k2 extends yn{constructor(e,t){super(e,t,k2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(T2,"defaultProps",{...yn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Q0=T2;function FN(i){return jN[i]}function zN(i){const[e,t]=$N[i],n=e==="i32"||e==="u32",s=e!=="u32",r=UN[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const UN={f32:4,f16:2,i32:4,u32:4},$N={f32:["f32",1],"vec2":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},jN={f32:{type:"f32",components:1},f16:{type:"f16",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"f16",components:2},"vec3":{type:"f16",components:3},"vec4":{type:"f16",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16},"mat2x2":{type:"f16",components:4},"mat2x3":{type:"f16",components:6},"mat2x4":{type:"f16",components:8},"mat3x2":{type:"f16",components:6},"mat3x3":{type:"f16",components:9},"mat3x4":{type:"f16",components:12},"mat4x2":{type:"f16",components:8},"mat4x3":{type:"f16",components:12},"mat4x4":{type:"f16",components:16},"mat2x2":{type:"i32",components:4},"mat2x3":{type:"i32",components:6},"mat2x4":{type:"i32",components:8},"mat3x2":{type:"i32",components:6},"mat3x3":{type:"i32",components:9},"mat3x4":{type:"i32",components:12},"mat4x2":{type:"i32",components:8},"mat4x3":{type:"i32",components:12},"mat4x4":{type:"i32",components:16},"mat2x2":{type:"u32",components:4},"mat2x3":{type:"u32",components:6},"mat2x4":{type:"u32",components:8},"mat3x2":{type:"u32",components:6},"mat3x3":{type:"u32",components:9},"mat3x4":{type:"u32",components:12},"mat4x2":{type:"u32",components:8},"mat4x3":{type:"u32",components:12},"mat4x4":{type:"u32",components:16}};function A2(i,e){const t={};for(const n of i.attributes){const s=HN(i,e,n.name);s&&(t[n.name]=s)}return t}function Nte(i,e,t=16){const n=A2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function HN(i,e,t){const n=VN(i,t),s=GN(e,t);if(!n)return null;const r=zN(n.type),o=cN(r),a=(s==null?void 0:s.vertexFormat)||o,l=my(a);return{attributeName:(s==null?void 0:s.attributeName)||n.name,bufferName:(s==null?void 0:s.bufferName)||n.name,location:n.location,shaderType:n.type,primitiveType:r.primitiveType,shaderComponents:r.components,vertexFormat:a,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:r.integer,stepMode:(s==null?void 0:s.stepMode)||n.stepMode||"vertex",byteOffset:(s==null?void 0:s.byteOffset)||0,byteStride:(s==null?void 0:s.byteStride)||0}}function VN(i,e){const t=i.attributes.find(n=>n.name===e);return t||le.warn(`shader layout attribute "${e}" not present in shader`),t||null}function GN(i,e){WN(i);let t=YN(i,e);return t||(t=qN(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function WN(i){for(const e of i)(e.attributes&&e.format||!e.attributes&&!e.format)&&le.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function YN(i,e){for(const t of i)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function qN(i,e){var t;for(const n of i){let s=n.byteStride;if(typeof n.byteStride!="number")for(const o of n.attributes||[]){const a=my(o.format);s+=a.byteLength}const r=(t=n.attributes)==null?void 0:t.find(o=>o.attribute===e);if(r)return{attributeName:r.attribute,bufferName:n.name,stepMode:n.stepMode,vertexFormat:r.format,byteOffset:r.byteOffset,byteStride:s}}return null}let wd;function I2(i){return(!wd||wd.byteLengthr.type==="uniform"&&r.name===(e==null?void 0:e.name));if(!n)throw new Error(e==null?void 0:e.name);const s=n;for(const r of s.uniforms||[])this.bindingLayout[r.name]=r}}setUniforms(e){for(const[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){QN(this.uniforms[e],t)||(this.uniforms[e]=JN(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ai=class{constructor(e){$(this,"uniformBlocks",new Map),$(this,"uniformBufferLayouts",new Map),$(this,"uniformBuffers",new Map);for(const[t,n]of Object.entries(e)){const s=t,r=new ZN(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new eD({name:t});o.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(s,o)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var t;for(const[n,s]of Object.entries(e))(t=this.uniformBlocks.get(n))==null||t.setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){var t;return((t=this.uniformBufferLayouts.get(e))==null?void 0:t.byteLength)||0}getUniformBufferData(e){var t,n;const s=((t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms())||{};return(n=this.uniformBufferLayouts.get(e))==null?void 0:n.getData(s)}createUniformBuffer(e,t,n){n&&this.setUniforms(n);const s=this.getUniformBufferByteLength(t),r=e.createBuffer({usage:me.UNIFORM|me.COPY_DST,byteLength:s}),o=this.getUniformBufferData(t);return r.write(o),r}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){const n=this.getUniformBufferByteLength(t),s=e.createBuffer({usage:me.UNIFORM|me.COPY_DST,byteLength:n});this.uniformBuffers.set(t,s)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(const t of this.uniformBlocks.keys()){const n=this.updateUniformBuffer(t);e||(e=n)}return e&&le.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var t;const n=this.uniformBlocks.get(e);let s=this.uniformBuffers.get(e),r=!1;if(s&&n!=null&&n.needsRedraw){r||(r=n.needsRedraw);const o=this.getUniformBufferData(e);s=this.uniformBuffers.get(e),s==null||s.write(o);const a=(t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms();le.log(4,`Writing to uniform buffer ${String(e)}`,o,a)()}return r}};var Oo;(function(i){i[i.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",i[i.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",i[i.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i[i.ZERO=0]="ZERO",i[i.ONE=1]="ONE",i[i.SRC_COLOR=768]="SRC_COLOR",i[i.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",i[i.SRC_ALPHA=770]="SRC_ALPHA",i[i.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",i[i.DST_ALPHA=772]="DST_ALPHA",i[i.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",i[i.DST_COLOR=774]="DST_COLOR",i[i.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",i[i.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",i[i.CONSTANT_COLOR=32769]="CONSTANT_COLOR",i[i.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",i[i.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",i[i.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",i[i.FUNC_ADD=32774]="FUNC_ADD",i[i.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",i[i.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",i[i.BLEND_EQUATION=32777]="BLEND_EQUATION",i[i.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",i[i.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",i[i.BLEND_DST_RGB=32968]="BLEND_DST_RGB",i[i.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",i[i.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",i[i.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",i[i.BLEND_COLOR=32773]="BLEND_COLOR",i[i.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",i[i.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",i[i.LINE_WIDTH=2849]="LINE_WIDTH",i[i.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",i[i.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",i[i.CULL_FACE_MODE=2885]="CULL_FACE_MODE",i[i.FRONT_FACE=2886]="FRONT_FACE",i[i.DEPTH_RANGE=2928]="DEPTH_RANGE",i[i.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",i[i.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",i[i.DEPTH_FUNC=2932]="DEPTH_FUNC",i[i.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",i[i.STENCIL_FUNC=2962]="STENCIL_FUNC",i[i.STENCIL_FAIL=2964]="STENCIL_FAIL",i[i.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",i[i.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",i[i.STENCIL_REF=2967]="STENCIL_REF",i[i.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",i[i.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",i[i.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",i[i.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",i[i.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",i[i.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",i[i.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",i[i.VIEWPORT=2978]="VIEWPORT",i[i.SCISSOR_BOX=3088]="SCISSOR_BOX",i[i.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",i[i.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",i[i.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",i[i.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",i[i.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",i[i.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",i[i.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",i[i.RED_BITS=3410]="RED_BITS",i[i.GREEN_BITS=3411]="GREEN_BITS",i[i.BLUE_BITS=3412]="BLUE_BITS",i[i.ALPHA_BITS=3413]="ALPHA_BITS",i[i.DEPTH_BITS=3414]="DEPTH_BITS",i[i.STENCIL_BITS=3415]="STENCIL_BITS",i[i.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",i[i.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",i[i.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",i[i.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",i[i.SAMPLES=32937]="SAMPLES",i[i.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",i[i.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",i[i.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",i[i.VENDOR=7936]="VENDOR",i[i.RENDERER=7937]="RENDERER",i[i.VERSION=7938]="VERSION",i[i.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",i[i.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",i[i.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",i[i.STATIC_DRAW=35044]="STATIC_DRAW",i[i.STREAM_DRAW=35040]="STREAM_DRAW",i[i.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.BUFFER_SIZE=34660]="BUFFER_SIZE",i[i.BUFFER_USAGE=34661]="BUFFER_USAGE",i[i.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",i[i.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",i[i.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",i[i.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",i[i.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",i[i.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",i[i.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",i[i.CULL_FACE=2884]="CULL_FACE",i[i.FRONT=1028]="FRONT",i[i.BACK=1029]="BACK",i[i.FRONT_AND_BACK=1032]="FRONT_AND_BACK",i[i.BLEND=3042]="BLEND",i[i.DEPTH_TEST=2929]="DEPTH_TEST",i[i.DITHER=3024]="DITHER",i[i.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",i[i.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",i[i.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",i[i.SCISSOR_TEST=3089]="SCISSOR_TEST",i[i.STENCIL_TEST=2960]="STENCIL_TEST",i[i.NO_ERROR=0]="NO_ERROR",i[i.INVALID_ENUM=1280]="INVALID_ENUM",i[i.INVALID_VALUE=1281]="INVALID_VALUE",i[i.INVALID_OPERATION=1282]="INVALID_OPERATION",i[i.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",i[i.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",i[i.CW=2304]="CW",i[i.CCW=2305]="CCW",i[i.DONT_CARE=4352]="DONT_CARE",i[i.FASTEST=4353]="FASTEST",i[i.NICEST=4354]="NICEST",i[i.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.INT=5124]="INT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.FLOAT=5126]="FLOAT",i[i.DOUBLE=5130]="DOUBLE",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.ALPHA=6406]="ALPHA",i[i.RGB=6407]="RGB",i[i.RGBA=6408]="RGBA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",i[i.VERTEX_SHADER=35633]="VERTEX_SHADER",i[i.COMPILE_STATUS=35713]="COMPILE_STATUS",i[i.DELETE_STATUS=35712]="DELETE_STATUS",i[i.LINK_STATUS=35714]="LINK_STATUS",i[i.VALIDATE_STATUS=35715]="VALIDATE_STATUS",i[i.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",i[i.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",i[i.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",i[i.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",i[i.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",i[i.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",i[i.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",i[i.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",i[i.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",i[i.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",i[i.SHADER_TYPE=35663]="SHADER_TYPE",i[i.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",i[i.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",i[i.NEVER=512]="NEVER",i[i.LESS=513]="LESS",i[i.EQUAL=514]="EQUAL",i[i.LEQUAL=515]="LEQUAL",i[i.GREATER=516]="GREATER",i[i.NOTEQUAL=517]="NOTEQUAL",i[i.GEQUAL=518]="GEQUAL",i[i.ALWAYS=519]="ALWAYS",i[i.KEEP=7680]="KEEP",i[i.REPLACE=7681]="REPLACE",i[i.INCR=7682]="INCR",i[i.DECR=7683]="DECR",i[i.INVERT=5386]="INVERT",i[i.INCR_WRAP=34055]="INCR_WRAP",i[i.DECR_WRAP=34056]="DECR_WRAP",i[i.NEAREST=9728]="NEAREST",i[i.LINEAR=9729]="LINEAR",i[i.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",i[i.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",i[i.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",i[i.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",i[i.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",i[i.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",i[i.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",i[i.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE=5890]="TEXTURE",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i[i.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",i[i.TEXTURE0=33984]="TEXTURE0",i[i.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",i[i.REPEAT=10497]="REPEAT",i[i.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i[i.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",i[i.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",i[i.FLOAT_VEC2=35664]="FLOAT_VEC2",i[i.FLOAT_VEC3=35665]="FLOAT_VEC3",i[i.FLOAT_VEC4=35666]="FLOAT_VEC4",i[i.INT_VEC2=35667]="INT_VEC2",i[i.INT_VEC3=35668]="INT_VEC3",i[i.INT_VEC4=35669]="INT_VEC4",i[i.BOOL=35670]="BOOL",i[i.BOOL_VEC2=35671]="BOOL_VEC2",i[i.BOOL_VEC3=35672]="BOOL_VEC3",i[i.BOOL_VEC4=35673]="BOOL_VEC4",i[i.FLOAT_MAT2=35674]="FLOAT_MAT2",i[i.FLOAT_MAT3=35675]="FLOAT_MAT3",i[i.FLOAT_MAT4=35676]="FLOAT_MAT4",i[i.SAMPLER_2D=35678]="SAMPLER_2D",i[i.SAMPLER_CUBE=35680]="SAMPLER_CUBE",i[i.LOW_FLOAT=36336]="LOW_FLOAT",i[i.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",i[i.HIGH_FLOAT=36338]="HIGH_FLOAT",i[i.LOW_INT=36339]="LOW_INT",i[i.MEDIUM_INT=36340]="MEDIUM_INT",i[i.HIGH_INT=36341]="HIGH_INT",i[i.FRAMEBUFFER=36160]="FRAMEBUFFER",i[i.RENDERBUFFER=36161]="RENDERBUFFER",i[i.RGBA4=32854]="RGBA4",i[i.RGB5_A1=32855]="RGB5_A1",i[i.RGB565=36194]="RGB565",i[i.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",i[i.STENCIL_INDEX=6401]="STENCIL_INDEX",i[i.STENCIL_INDEX8=36168]="STENCIL_INDEX8",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",i[i.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",i[i.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",i[i.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",i[i.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",i[i.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",i[i.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",i[i.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",i[i.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",i[i.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",i[i.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",i[i.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",i[i.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",i[i.NONE=0]="NONE",i[i.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",i[i.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",i[i.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",i[i.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",i[i.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",i[i.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",i[i.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",i[i.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",i[i.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",i[i.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",i[i.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",i[i.READ_BUFFER=3074]="READ_BUFFER",i[i.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",i[i.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",i[i.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",i[i.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",i[i.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",i[i.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",i[i.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",i[i.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",i[i.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",i[i.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",i[i.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",i[i.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",i[i.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",i[i.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",i[i.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",i[i.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",i[i.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",i[i.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",i[i.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",i[i.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",i[i.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",i[i.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",i[i.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",i[i.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",i[i.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",i[i.RED=6403]="RED",i[i.RGB8=32849]="RGB8",i[i.RGBA8=32856]="RGBA8",i[i.RGB10_A2=32857]="RGB10_A2",i[i.TEXTURE_3D=32879]="TEXTURE_3D",i[i.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",i[i.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",i[i.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",i[i.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",i[i.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",i[i.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",i[i.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",i[i.SRGB=35904]="SRGB",i[i.SRGB8=35905]="SRGB8",i[i.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",i[i.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",i[i.RGBA32F=34836]="RGBA32F",i[i.RGB32F=34837]="RGB32F",i[i.RGBA16F=34842]="RGBA16F",i[i.RGB16F=34843]="RGB16F",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",i[i.R11F_G11F_B10F=35898]="R11F_G11F_B10F",i[i.RGB9_E5=35901]="RGB9_E5",i[i.RGBA32UI=36208]="RGBA32UI",i[i.RGB32UI=36209]="RGB32UI",i[i.RGBA16UI=36214]="RGBA16UI",i[i.RGB16UI=36215]="RGB16UI",i[i.RGBA8UI=36220]="RGBA8UI",i[i.RGB8UI=36221]="RGB8UI",i[i.RGBA32I=36226]="RGBA32I",i[i.RGB32I=36227]="RGB32I",i[i.RGBA16I=36232]="RGBA16I",i[i.RGB16I=36233]="RGB16I",i[i.RGBA8I=36238]="RGBA8I",i[i.RGB8I=36239]="RGB8I",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.R8=33321]="R8",i[i.RG8=33323]="RG8",i[i.R16F=33325]="R16F",i[i.R32F=33326]="R32F",i[i.RG16F=33327]="RG16F",i[i.RG32F=33328]="RG32F",i[i.R8I=33329]="R8I",i[i.R8UI=33330]="R8UI",i[i.R16I=33331]="R16I",i[i.R16UI=33332]="R16UI",i[i.R32I=33333]="R32I",i[i.R32UI=33334]="R32UI",i[i.RG8I=33335]="RG8I",i[i.RG8UI=33336]="RG8UI",i[i.RG16I=33337]="RG16I",i[i.RG16UI=33338]="RG16UI",i[i.RG32I=33339]="RG32I",i[i.RG32UI=33340]="RG32UI",i[i.R8_SNORM=36756]="R8_SNORM",i[i.RG8_SNORM=36757]="RG8_SNORM",i[i.RGB8_SNORM=36758]="RGB8_SNORM",i[i.RGBA8_SNORM=36759]="RGBA8_SNORM",i[i.RGB10_A2UI=36975]="RGB10_A2UI",i[i.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",i[i.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.HALF_FLOAT=5131]="HALF_FLOAT",i[i.RG=33319]="RG",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",i[i.CURRENT_QUERY=34917]="CURRENT_QUERY",i[i.QUERY_RESULT=34918]="QUERY_RESULT",i[i.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",i[i.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",i[i.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",i[i.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",i[i.DRAW_BUFFER0=34853]="DRAW_BUFFER0",i[i.DRAW_BUFFER1=34854]="DRAW_BUFFER1",i[i.DRAW_BUFFER2=34855]="DRAW_BUFFER2",i[i.DRAW_BUFFER3=34856]="DRAW_BUFFER3",i[i.DRAW_BUFFER4=34857]="DRAW_BUFFER4",i[i.DRAW_BUFFER5=34858]="DRAW_BUFFER5",i[i.DRAW_BUFFER6=34859]="DRAW_BUFFER6",i[i.DRAW_BUFFER7=34860]="DRAW_BUFFER7",i[i.DRAW_BUFFER8=34861]="DRAW_BUFFER8",i[i.DRAW_BUFFER9=34862]="DRAW_BUFFER9",i[i.DRAW_BUFFER10=34863]="DRAW_BUFFER10",i[i.DRAW_BUFFER11=34864]="DRAW_BUFFER11",i[i.DRAW_BUFFER12=34865]="DRAW_BUFFER12",i[i.DRAW_BUFFER13=34866]="DRAW_BUFFER13",i[i.DRAW_BUFFER14=34867]="DRAW_BUFFER14",i[i.DRAW_BUFFER15=34868]="DRAW_BUFFER15",i[i.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",i[i.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",i[i.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",i[i.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",i[i.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",i[i.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",i[i.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",i[i.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",i[i.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",i[i.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",i[i.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",i[i.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",i[i.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",i[i.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",i[i.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",i[i.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",i[i.SAMPLER_3D=35679]="SAMPLER_3D",i[i.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",i[i.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",i[i.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",i[i.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",i[i.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",i[i.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",i[i.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",i[i.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",i[i.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",i[i.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",i[i.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",i[i.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",i[i.MAX_SAMPLES=36183]="MAX_SAMPLES",i[i.SAMPLER_BINDING=35097]="SAMPLER_BINDING",i[i.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",i[i.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",i[i.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",i[i.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",i[i.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",i[i.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",i[i.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",i[i.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",i[i.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",i[i.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",i[i.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",i[i.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",i[i.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",i[i.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",i[i.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",i[i.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",i[i.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",i[i.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",i[i.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",i[i.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",i[i.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",i[i.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",i[i.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",i[i.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",i[i.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",i[i.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",i[i.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",i[i.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",i[i.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",i[i.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",i[i.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",i[i.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",i[i.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",i[i.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",i[i.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",i[i.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",i[i.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",i[i.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",i[i.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i[i.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",i[i.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",i[i.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",i[i.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",i[i.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",i[i.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",i[i.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",i[i.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",i[i.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",i[i.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",i[i.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",i[i.UNIFORM_TYPE=35383]="UNIFORM_TYPE",i[i.UNIFORM_SIZE=35384]="UNIFORM_SIZE",i[i.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",i[i.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",i[i.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",i[i.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",i[i.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",i[i.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",i[i.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",i[i.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",i[i.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",i[i.OBJECT_TYPE=37138]="OBJECT_TYPE",i[i.SYNC_CONDITION=37139]="SYNC_CONDITION",i[i.SYNC_STATUS=37140]="SYNC_STATUS",i[i.SYNC_FLAGS=37141]="SYNC_FLAGS",i[i.SYNC_FENCE=37142]="SYNC_FENCE",i[i.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",i[i.UNSIGNALED=37144]="UNSIGNALED",i[i.SIGNALED=37145]="SIGNALED",i[i.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",i[i.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",i[i.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",i[i.WAIT_FAILED=37149]="WAIT_FAILED",i[i.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",i[i.COLOR=6144]="COLOR",i[i.DEPTH=6145]="DEPTH",i[i.STENCIL=6146]="STENCIL",i[i.MIN=32775]="MIN",i[i.MAX=32776]="MAX",i[i.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",i[i.STREAM_READ=35041]="STREAM_READ",i[i.STREAM_COPY=35042]="STREAM_COPY",i[i.STATIC_READ=35045]="STATIC_READ",i[i.STATIC_COPY=35046]="STATIC_COPY",i[i.DYNAMIC_READ=35049]="DYNAMIC_READ",i[i.DYNAMIC_COPY=35050]="DYNAMIC_COPY",i[i.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",i[i.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",i[i.INVALID_INDEX=4294967295]="INVALID_INDEX",i[i.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",i[i.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",i[i.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",i[i.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",i[i.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",i[i.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",i[i.R16_EXT=33322]="R16_EXT",i[i.RG16_EXT=33324]="RG16_EXT",i[i.RGB16_EXT=32852]="RGB16_EXT",i[i.RGBA16_EXT=32859]="RGBA16_EXT",i[i.R16_SNORM_EXT=36760]="R16_SNORM_EXT",i[i.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",i[i.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",i[i.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",i[i.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",i[i.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",i[i.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",i[i.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",i[i.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",i[i.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",i[i.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",i[i.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",i[i.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",i[i.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",i[i.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",i[i.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",i[i.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",i[i.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",i[i.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",i[i.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",i[i.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",i[i.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",i[i.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",i[i.LINE_WEBGL=6913]="LINE_WEBGL",i[i.FILL_WEBGL=6914]="FILL_WEBGL",i[i.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",i[i.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",i[i.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",i[i.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",i[i.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",i[i.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",i[i.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",i[i.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",i[i.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",i[i.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",i[i.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",i[i.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",i[i.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",i[i.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",i[i.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",i[i.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",i[i.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",i[i.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",i[i.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",i[i.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",i[i.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",i[i.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",i[i.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",i[i.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Oo||(Oo={}));const tD={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},iD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),nD=i=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return i.createVertexArray()},deleteVertexArrayOES(e){return i.deleteVertexArray(e)},isVertexArrayOES(e){return i.isVertexArray(e)},bindVertexArrayOES(e){return i.bindVertexArray(e)}}),sD=i=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return i.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return i.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return i.vertexAttribDivisor(...e)}});function rD(i=!0){const e=HTMLCanvasElement.prototype;if(!i&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(t,n){if(t==="webgl"||t==="experimental-webgl"){const s=this.originalGetContext("webgl2",n);return s instanceof HTMLElement&&oD(s),s}return this.originalGetContext(t,n)}}function oD(i){i.getExtension("EXT_color_buffer_float");const e={...tD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:iD(i),OES_vertex_array_object:nD(i),ANGLE_instanced_arrays:sD(i)},t=i.getExtension;i.getExtension=function(s){return t.call(i,s)||(s in e?e[s]:null)};const n=i.getSupportedExtensions;i.getSupportedExtensions=function(){const s=n.apply(i)||[];return s==null?void 0:s.concat(Object.keys(e))}}async function L2(i,e){const t=document.getElementsByTagName("head")[0];if(!t)throw new Error("loadScript");const n=document.createElement("script");return n.setAttribute("type","text/javascript"),n.setAttribute("src",i),new Promise((s,r)=>{n.onload=s,n.onerror=o=>r(new Error(`Unable to load script '${i}': ${o}`)),t.appendChild(n)})}const aD=1;let fi=null,J0=!1;const _y={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function lD(i){if(!globalThis.SPECTOR)try{await L2(i.debugSpectorJSUrl||_y.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Ote(i){var e;if(i={..._y,...i},!i.debugSpectorJS)return null;if(!fi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(aD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;fi=new t,globalThis.luma&&(globalThis.luma.spector=fi)}if(!fi)return null;if(J0||(J0=!0,fi.spyCanvases(),fi==null||fi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),fi==null||fi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),fi==null||fi.getResultUI(),fi==null||fi.resultView.display(),fi==null||fi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;fi==null||fi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),fi==null||fi.stopCapture()})}return fi}const cD="https://unpkg.com/webgl-debug@2.0.1/index.js";function R2(i){return i.luma=i.luma||{},i.luma}async function uD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await L2(cD))}function Bte(i,e={}){return e.debugWebGL||e.traceWebGL?hD(i,e):dD(i)}function dD(i){const e=R2(i);return e.realContext?e.realContext:i}function hD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=R2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Oo,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,fD.bind(null,e),pD.bind(null,e));for(const o in Oo)!(o in n)&&typeof Oo[o]=="number"&&(n[o]=Oo[o]);class s{}Object.setPrototypeOf(n,Object.getPrototypeOf(i)),Object.setPrototypeOf(s,n);const r=Object.create(s);return t.realContext=i,t.debugContext=r,r.debug=!0,r}function ex(i,e){e=Array.from(e).map(n=>n===void 0?"undefined":n);let t=globalThis.WebGLDebugUtils.glFunctionArgsToString(i,e);return t=`${t.slice(0,100)}${t.length>100?"...":""}`,`gl.${i}(${t})`}function fD(i,e,t,n){n=Array.from(n).map(a=>a===void 0?"undefined":a);const s=globalThis.WebGLDebugUtils.glEnumToString(e),r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,n),o=`${s} in gl.${t}(${r})`;le.error(o)();debugger}function pD(i,e,t){let n="";le.level>=1&&(n=ex(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||ex(e,t);debugger}}const Sd=1;class mD extends CN{constructor(){super(),$(this,"type","webgl"),Cg.defaultProps={...Cg.defaultProps,..._y}}enforceWebGL2(e){rD(e)}isSupported(){return typeof WebGL2RenderingContext<"u"}isDeviceHandle(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:(typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext&&le.warn("WebGL1 is not supported",e)(),!1)}async attach(e,t={}){const{WebGLDevice:n}=await m0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-CamuNnA4.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!gD(e))throw new Error("Invalid WebGL2RenderingContext");const s=t.createCanvasContext===!0?{}:t.createCanvasContext;return new n({...t,_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1,...s}})}async create(e={}){const{WebGLDevice:t}=await m0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-CamuNnA4.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));le.groupCollapsed(Sd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(uD()),e.debugSpectorJS&&n.push(lD(e));const s=await Promise.allSettled(n);for(const a of s)a.status==="rejected"&&le.error(`Failed to initialize debug libraries ${a.reason}`)();const r=new t(e),o=`${r._reused?"Reusing":"Created"} device with WebGL2 ${r.props.debug?"debug ":""}context: ${r.info.vendor}, ${r.info.renderer} for canvas: ${r.canvasContext.id}`;return le.probe(Sd,o)(),le.table(Sd,r.info)(),r}finally{le.groupEnd(Sd)()}}}function gD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const _D=new mD,yD="#b3b3b3",bD=void 0,Ag=void 0,vD=1,xD=4,wD="#666666",SD=.1,ED=1,CD=1,P2="#222222",fe={enableSimulation:!0,spaceSize:8192,pointSizeScale:1,linkWidthScale:1,linkArrowsSizeScale:1,renderLinks:!0,curvedLinks:!1,curvedLinkSegments:19,curvedLinkWeight:.8,curvedLinkControlPointDistance:.5,linkArrows:!1,linkVisibilityDistanceRange:[50,150],linkVisibilityMinTransparency:.25,hoveredPointCursor:"auto",hoveredLinkCursor:"auto",renderHoveredPointRing:!1,hoveredPointRingColor:"white",hoveredLinkColor:void 0,hoveredLinkWidthIncrease:5,focusedPointRingColor:"white",focusedPointIndex:void 0,simulation:{decay:5e3,gravity:.25,center:0,repulsion:1,repulsionTheta:1.15,linkSpring:1,linkDistance:10,linkDistRandomVariationRange:[1,1.2],repulsionFromMouse:2,friction:.85,cluster:.1},showFPSMonitor:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||2,scalePointsOnZoom:!1,scaleLinksOnZoom:!1,enableZoom:!0,enableSimulationDuringZoom:!1,enableDrag:!1,fitViewOnInit:!0,fitViewDelay:250,fitViewPadding:.1,fitViewDuration:250,pointSamplingDistance:150,attribution:"",rescalePositions:void 0,enableRightClickRepulsion:!1},TD=.7,kD=.95,AD=3;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:N2,setPrototypeOf:tx,isFrozen:ID,getPrototypeOf:LD,getOwnPropertyDescriptor:RD}=Object;let{freeze:fn,seal:gs,create:D2}=Object,{apply:Ig,construct:Lg}=typeof Reflect<"u"&&Reflect;fn||(fn=function(i){return i});gs||(gs=function(i){return i});Ig||(Ig=function(i,e,t){return i.apply(e,t)});Lg||(Lg=function(i,e){return new i(...e)});const Ed=pn(Array.prototype.forEach),PD=pn(Array.prototype.lastIndexOf),ix=pn(Array.prototype.pop),lc=pn(Array.prototype.push),ND=pn(Array.prototype.splice),hh=pn(String.prototype.toLowerCase),nm=pn(String.prototype.toString),nx=pn(String.prototype.match),cc=pn(String.prototype.replace),DD=pn(String.prototype.indexOf),MD=pn(String.prototype.trim),Ms=pn(Object.prototype.hasOwnProperty),rn=pn(RegExp.prototype.test),uc=OD(TypeError);function pn(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:hh;tx&&tx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(ID(e)||(e[n]=r),s=r)}i[s]=!0}return i}function BD(i){for(let e=0;e/gm),jD=gs(/\$\{[\w\W]*/gm),HD=gs(/^data-[\-\w.\u00B7-\uFFFF]+$/),VD=gs(/^aria-[\-\w]+$/),M2=gs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),GD=gs(/^(?:\w+script|data):/i),WD=gs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),O2=gs(/^html$/i),YD=gs(/^[a-z][.\w]*(-[.\w]+)+$/i);var lx=Object.freeze({__proto__:null,ARIA_ATTR:VD,ATTR_WHITESPACE:WD,CUSTOM_ELEMENT:YD,DATA_ATTR:HD,DOCTYPE_NAME:O2,ERB_EXPR:$D,IS_ALLOWED_URI:M2,IS_SCRIPT_OR_DATA:GD,MUSTACHE_EXPR:UD,TMPLIT_EXPR:jD});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},qD=function(){return typeof window>"u"?null:window},XD=function(i,e){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let t=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(t=e.getAttribute(n));const s="dompurify"+(t?"#"+t:"");try{return i.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},cx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function B2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qD();const e=L=>B2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==hc.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=i,m=l.prototype,y=dc(m,"cloneNode"),g=dc(m,"remove"),_=dc(m,"nextSibling"),S=dc(m,"childNodes"),E=dc(m,"parentNode");if(typeof o=="function"){const L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let x,T="";const{implementation:I,createNodeIterator:B,createDocumentFragment:H,getElementsByTagName:Q}=t,{importNode:re}=n;let D=cx();e.isSupported=typeof N2=="function"&&typeof E=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:de,ERB_EXPR:se,TMPLIT_EXPR:R,DATA_ATTR:ee,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:Z}=lx;let{IS_ALLOWED_URI:ae}=lx,J=null;const Se=rt({},[...sx,...sm,...rm,...om,...rx]);let xe=null;const et=rt({},[...ox,...am,...ax,...Cd]);let he=Object.seal(D2(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yt=null,Xe=null,dt=!0,ie=!0,Ce=!1,Pe=!0,X=!1,We=!0,He=!1,bt=!1,Vt=!1,pe=!1,it=!1,si=!1,yi=!0,Zs=!1;const Zn="user-content-";let wo=!0,On=!1,di={},tn=null;const bi=rt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Qn=null;const Ss=rt({},["audio","video","img","source","image","track"]);let Qs=null;const Bn=rt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Es="http://www.w3.org/1998/Math/MathML",nn="http://www.w3.org/2000/svg",Ti="http://www.w3.org/1999/xhtml";let Qt=Ti,$i=!1,vn=null;const So=rt({},[Es,nn,Ti],nm);let Mr=rt({},["mi","mo","mn","ms","mtext"]),ji=rt({},["annotation-xml"]);const Or=rt({},["title","style","font","a","script"]);let Cs=null;const Js=["application/xhtml+xml","text/html"],ic="text/html";let Jt=null,At=null;const Jn=t.createElement("form"),Ut=function(L){return L instanceof RegExp||L instanceof Function},Ts=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(At&&At===L)){if((!L||typeof L!="object")&&(L={}),L=Gr(L),Cs=Js.indexOf(L.PARSER_MEDIA_TYPE)===-1?ic:L.PARSER_MEDIA_TYPE,Jt=Cs==="application/xhtml+xml"?nm:hh,J=Ms(L,"ALLOWED_TAGS")?rt({},L.ALLOWED_TAGS,Jt):Se,xe=Ms(L,"ALLOWED_ATTR")?rt({},L.ALLOWED_ATTR,Jt):et,vn=Ms(L,"ALLOWED_NAMESPACES")?rt({},L.ALLOWED_NAMESPACES,nm):So,Qs=Ms(L,"ADD_URI_SAFE_ATTR")?rt(Gr(Bn),L.ADD_URI_SAFE_ATTR,Jt):Bn,Qn=Ms(L,"ADD_DATA_URI_TAGS")?rt(Gr(Ss),L.ADD_DATA_URI_TAGS,Jt):Ss,tn=Ms(L,"FORBID_CONTENTS")?rt({},L.FORBID_CONTENTS,Jt):bi,yt=Ms(L,"FORBID_TAGS")?rt({},L.FORBID_TAGS,Jt):Gr({}),Xe=Ms(L,"FORBID_ATTR")?rt({},L.FORBID_ATTR,Jt):Gr({}),di=Ms(L,"USE_PROFILES")?L.USE_PROFILES:!1,dt=L.ALLOW_ARIA_ATTR!==!1,ie=L.ALLOW_DATA_ATTR!==!1,Ce=L.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,X=L.SAFE_FOR_TEMPLATES||!1,We=L.SAFE_FOR_XML!==!1,He=L.WHOLE_DOCUMENT||!1,pe=L.RETURN_DOM||!1,it=L.RETURN_DOM_FRAGMENT||!1,si=L.RETURN_TRUSTED_TYPE||!1,Vt=L.FORCE_BODY||!1,yi=L.SANITIZE_DOM!==!1,Zs=L.SANITIZE_NAMED_PROPS||!1,wo=L.KEEP_CONTENT!==!1,On=L.IN_PLACE||!1,ae=L.ALLOWED_URI_REGEXP||M2,Qt=L.NAMESPACE||Ti,Mr=L.MATHML_TEXT_INTEGRATION_POINTS||Mr,ji=L.HTML_INTEGRATION_POINTS||ji,he=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&Ut(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&Ut(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(ie=!1),it&&(pe=!0),di&&(J=rt({},rx),xe=[],di.html===!0&&(rt(J,sx),rt(xe,ox)),di.svg===!0&&(rt(J,sm),rt(xe,am),rt(xe,Cd)),di.svgFilters===!0&&(rt(J,rm),rt(xe,am),rt(xe,Cd)),di.mathMl===!0&&(rt(J,om),rt(xe,ax),rt(xe,Cd))),L.ADD_TAGS&&(J===Se&&(J=Gr(J)),rt(J,L.ADD_TAGS,Jt)),L.ADD_ATTR&&(xe===et&&(xe=Gr(xe)),rt(xe,L.ADD_ATTR,Jt)),L.ADD_URI_SAFE_ATTR&&rt(Qs,L.ADD_URI_SAFE_ATTR,Jt),L.FORBID_CONTENTS&&(tn===bi&&(tn=Gr(tn)),rt(tn,L.FORBID_CONTENTS,Jt)),wo&&(J["#text"]=!0),He&&rt(J,["html","head","body"]),J.table&&(rt(J,["tbody"]),delete yt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,T=x.createHTML("")}else x===void 0&&(x=XD(p,s)),x!==null&&typeof T=="string"&&(T=x.createHTML(""));fn&&fn(L),At=L}},er=rt({},[...sm,...rm,...FD]),Br=rt({},[...om,...zD]),Eo=function(L){let V=E(L);(!V||!V.tagName)&&(V={namespaceURI:Qt,tagName:"template"});const C=hh(L.tagName),G=hh(V.tagName);return vn[L.namespaceURI]?L.namespaceURI===nn?V.namespaceURI===Ti?C==="svg":V.namespaceURI===Es?C==="svg"&&(G==="annotation-xml"||Mr[G]):!!er[C]:L.namespaceURI===Es?V.namespaceURI===Ti?C==="math":V.namespaceURI===nn?C==="math"&&ji[G]:!!Br[C]:L.namespaceURI===Ti?V.namespaceURI===nn&&!ji[G]||V.namespaceURI===Es&&!Mr[G]?!1:!Br[C]&&(Or[C]||!er[C]):!!(Cs==="application/xhtml+xml"&&vn[L.namespaceURI]):!1},es=function(L){lc(e.removed,{element:L});try{E(L).removeChild(L)}catch{g(L)}},hi=function(L,V){try{lc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{lc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(L),L==="is")if(pe||it)try{es(V)}catch{}else try{V.setAttribute(L,"")}catch{}},xn=function(L){let V=null,C=null;if(Vt)L=""+L;else{const Te=nx(L,/^[\r\n\t ]+/);C=Te&&Te[0]}Cs==="application/xhtml+xml"&&Qt===Ti&&(L=''+L+"");const G=x?x.createHTML(L):L;if(Qt===Ti)try{V=new h().parseFromString(G,Cs)}catch{}if(!V||!V.documentElement){V=I.createDocument(Qt,"template",null);try{V.documentElement.innerHTML=$i?T:G}catch{}}const ne=V.body||V.documentElement;return L&&C&&ne.insertBefore(t.createTextNode(C),ne.childNodes[0]||null),Qt===Ti?Q.call(V,He?"html":"body")[0]:He?V.documentElement:ne},ks=function(L){return B.call(L.ownerDocument||L,L,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ct=function(L){return L instanceof d&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},Fr=function(L){return typeof a=="function"&&L instanceof a};function nt(L,V,C){Ed(L,G=>{G.call(e,V,C,At)})}const wn=function(L){let V=null;if(nt(D.beforeSanitizeElements,L,null),ct(L))return es(L),!0;const C=Jt(L.nodeName);if(nt(D.uponSanitizeElement,L,{tagName:C,allowedTags:J}),We&&L.hasChildNodes()&&!Fr(L.firstElementChild)&&rn(/<[/\w!]/g,L.innerHTML)&&rn(/<[/\w!]/g,L.textContent)||L.nodeType===hc.progressingInstruction||We&&L.nodeType===hc.comment&&rn(/<[/\w]/g,L.data))return es(L),!0;if(!J[C]||yt[C]){if(!yt[C]&&tr(C)&&(he.tagNameCheck instanceof RegExp&&rn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C)))return!1;if(wo&&!tn[C]){const G=E(L)||L.parentNode,ne=S(L)||L.childNodes;if(ne&&G){const Te=ne.length;for(let It=Te-1;It>=0;--It){const st=y(ne[It],!0);st.__removalCount=(L.__removalCount||0)+1,G.insertBefore(st,_(L))}}}return es(L),!0}return L instanceof l&&!Eo(L)||(C==="noscript"||C==="noembed"||C==="noframes")&&rn(/<\/no(script|embed|frames)/i,L.innerHTML)?(es(L),!0):(X&&L.nodeType===hc.text&&(V=L.textContent,Ed([de,se,R],G=>{V=cc(V,G," ")}),L.textContent!==V&&(lc(e.removed,{element:L.cloneNode()}),L.textContent=V)),nt(D.afterSanitizeElements,L,null),!1)},zr=function(L,V,C){if(yi&&(V==="id"||V==="name")&&(C in t||C in Jn))return!1;if(!(ie&&!Xe[V]&&rn(ee,V))&&!(dt&&rn(F,V))){if(!xe[V]||Xe[V]){if(!(tr(L)&&(he.tagNameCheck instanceof RegExp&&rn(he.tagNameCheck,L)||he.tagNameCheck instanceof Function&&he.tagNameCheck(L))&&(he.attributeNameCheck instanceof RegExp&&rn(he.attributeNameCheck,V)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(V))||V==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&rn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C))))return!1}else if(!Qs[V]&&!rn(ae,cc(C,te,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&DD(C,"data:")===0&&Qn[L])&&!(Ce&&!rn(q,cc(C,te,"")))&&C)return!1}return!0},tr=function(L){return L!=="annotation-xml"&&nx(L,Z)},Fn=function(L){nt(D.beforeSanitizeAttributes,L,null);const{attributes:V}=L;if(!V||ct(L))return;const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const ne=V[G],{name:Te,namespaceURI:It,value:st}=ne,Je=Jt(Te),vi=st;let ht=Te==="value"?vi:MD(vi);if(C.attrName=Je,C.attrValue=ht,C.keepAttr=!0,C.forceKeepAttr=void 0,nt(D.uponSanitizeAttribute,L,C),ht=C.attrValue,Zs&&(Je==="id"||Je==="name")&&(hi(Te,L),ht=Zn+ht),We&&rn(/((--!?|])>)|<\/(style|title)/i,ht)){hi(Te,L);continue}if(C.forceKeepAttr)continue;if(!C.keepAttr){hi(Te,L);continue}if(!Pe&&rn(/\/>/i,ht)){hi(Te,L);continue}X&&Ed([de,se,R],Lt=>{ht=cc(ht,Lt," ")});const ir=Jt(L.nodeName);if(!zr(ir,Je,ht)){hi(Te,L);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!It)switch(p.getAttributeType(ir,Je)){case"TrustedHTML":{ht=x.createHTML(ht);break}case"TrustedScriptURL":{ht=x.createScriptURL(ht);break}}if(ht!==vi)try{It?L.setAttributeNS(It,Te,ht):L.setAttribute(Te,ht),ct(L)?es(L):ix(e.removed)}catch{hi(Te,L)}}nt(D.afterSanitizeAttributes,L,null)},sn=function L(V){let C=null;const G=ks(V);for(nt(D.beforeSanitizeShadowDOM,V,null);C=G.nextNode();)nt(D.uponSanitizeShadowNode,C,null),wn(C),Fn(C),C.content instanceof r&&L(C.content);nt(D.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(L){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,G=null,ne=null,Te=null;if($i=!L,$i&&(L=""),typeof L!="string"&&!Fr(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return L;if(bt||Ts(V),e.removed=[],typeof L=="string"&&(On=!1),On){if(L.nodeName){const Je=Jt(L.nodeName);if(!J[Je]||yt[Je])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)C=xn(""),G=C.ownerDocument.importNode(L,!0),G.nodeType===hc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?C=G:C.appendChild(G);else{if(!pe&&!X&&!He&&L.indexOf("<")===-1)return x&&si?x.createHTML(L):L;if(C=xn(L),!C)return pe?null:si?T:""}C&&Vt&&es(C.firstChild);const It=ks(On?L:C);for(;ne=It.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&sn(ne.content);if(On)return L;if(pe){if(it)for(Te=H.call(C.ownerDocument);C.firstChild;)Te.appendChild(C.firstChild);else Te=C;return(xe.shadowroot||xe.shadowrootmode)&&(Te=re.call(n,Te,!0)),Te}let st=He?C.outerHTML:C.innerHTML;return He&&J["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&rn(O2,C.ownerDocument.doctype.name)&&(st=" +`,l.style.top="10px",l.style.left="10px",l.style.position="absolute",l.style.zIndex="9999",l.style.width="100%",l.style.textAlign="left",document.body.appendChild(l),(n=document.getElementsByClassName("luma-compiler-log-error")[0])==null||n.scrollIntoView(),l.onclick=()=>{const c=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(c)}}};$(w2,"defaultProps",{...yn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let MN=w2;function ON(i){return BN(i.source)||i.id||fy(`unnamed ${i.stage}-shader`)}function BN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const E2=class C2 extends yn{constructor(e,t){super(e,t,C2.defaultProps),$(this,"shaderLayout"),$(this,"bufferLayout"),$(this,"linkStatus","pending"),$(this,"hash",""),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}get[Symbol.toStringTag](){return"RenderPipeline"}};$(E2,"defaultProps",{...yn.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",colorAttachmentFormats:void 0,depthStencilAttachmentFormat:void 0,parameters:{},bindings:{},uniforms:{}});let Zh=E2;const T2=class k2 extends yn{constructor(e,t){super(e,t,k2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(T2,"defaultProps",{...yn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Q0=T2;function FN(i){return jN[i]}function zN(i){const[e,t]=$N[i],n=e==="i32"||e==="u32",s=e!=="u32",r=UN[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const UN={f32:4,f16:2,i32:4,u32:4},$N={f32:["f32",1],"vec2":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},jN={f32:{type:"f32",components:1},f16:{type:"f16",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"f16",components:2},"vec3":{type:"f16",components:3},"vec4":{type:"f16",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16},"mat2x2":{type:"f16",components:4},"mat2x3":{type:"f16",components:6},"mat2x4":{type:"f16",components:8},"mat3x2":{type:"f16",components:6},"mat3x3":{type:"f16",components:9},"mat3x4":{type:"f16",components:12},"mat4x2":{type:"f16",components:8},"mat4x3":{type:"f16",components:12},"mat4x4":{type:"f16",components:16},"mat2x2":{type:"i32",components:4},"mat2x3":{type:"i32",components:6},"mat2x4":{type:"i32",components:8},"mat3x2":{type:"i32",components:6},"mat3x3":{type:"i32",components:9},"mat3x4":{type:"i32",components:12},"mat4x2":{type:"i32",components:8},"mat4x3":{type:"i32",components:12},"mat4x4":{type:"i32",components:16},"mat2x2":{type:"u32",components:4},"mat2x3":{type:"u32",components:6},"mat2x4":{type:"u32",components:8},"mat3x2":{type:"u32",components:6},"mat3x3":{type:"u32",components:9},"mat3x4":{type:"u32",components:12},"mat4x2":{type:"u32",components:8},"mat4x3":{type:"u32",components:12},"mat4x4":{type:"u32",components:16}};function A2(i,e){const t={};for(const n of i.attributes){const s=HN(i,e,n.name);s&&(t[n.name]=s)}return t}function Nte(i,e,t=16){const n=A2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function HN(i,e,t){const n=VN(i,t),s=GN(e,t);if(!n)return null;const r=zN(n.type),o=cN(r),a=(s==null?void 0:s.vertexFormat)||o,l=my(a);return{attributeName:(s==null?void 0:s.attributeName)||n.name,bufferName:(s==null?void 0:s.bufferName)||n.name,location:n.location,shaderType:n.type,primitiveType:r.primitiveType,shaderComponents:r.components,vertexFormat:a,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:r.integer,stepMode:(s==null?void 0:s.stepMode)||n.stepMode||"vertex",byteOffset:(s==null?void 0:s.byteOffset)||0,byteStride:(s==null?void 0:s.byteStride)||0}}function VN(i,e){const t=i.attributes.find(n=>n.name===e);return t||le.warn(`shader layout attribute "${e}" not present in shader`),t||null}function GN(i,e){WN(i);let t=YN(i,e);return t||(t=qN(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function WN(i){for(const e of i)(e.attributes&&e.format||!e.attributes&&!e.format)&&le.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function YN(i,e){for(const t of i)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function qN(i,e){var t;for(const n of i){let s=n.byteStride;if(typeof n.byteStride!="number")for(const o of n.attributes||[]){const a=my(o.format);s+=a.byteLength}const r=(t=n.attributes)==null?void 0:t.find(o=>o.attribute===e);if(r)return{attributeName:r.attribute,bufferName:n.name,stepMode:n.stepMode,vertexFormat:r.format,byteOffset:r.byteOffset,byteStride:s}}return null}let wd;function I2(i){return(!wd||wd.byteLengthr.type==="uniform"&&r.name===(e==null?void 0:e.name));if(!n)throw new Error(e==null?void 0:e.name);const s=n;for(const r of s.uniforms||[])this.bindingLayout[r.name]=r}}setUniforms(e){for(const[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){QN(this.uniforms[e],t)||(this.uniforms[e]=JN(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ai=class{constructor(e){$(this,"uniformBlocks",new Map),$(this,"uniformBufferLayouts",new Map),$(this,"uniformBuffers",new Map);for(const[t,n]of Object.entries(e)){const s=t,r=new ZN(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new eD({name:t});o.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(s,o)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var t;for(const[n,s]of Object.entries(e))(t=this.uniformBlocks.get(n))==null||t.setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){var t;return((t=this.uniformBufferLayouts.get(e))==null?void 0:t.byteLength)||0}getUniformBufferData(e){var t,n;const s=((t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms())||{};return(n=this.uniformBufferLayouts.get(e))==null?void 0:n.getData(s)}createUniformBuffer(e,t,n){n&&this.setUniforms(n);const s=this.getUniformBufferByteLength(t),r=e.createBuffer({usage:me.UNIFORM|me.COPY_DST,byteLength:s}),o=this.getUniformBufferData(t);return r.write(o),r}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){const n=this.getUniformBufferByteLength(t),s=e.createBuffer({usage:me.UNIFORM|me.COPY_DST,byteLength:n});this.uniformBuffers.set(t,s)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(const t of this.uniformBlocks.keys()){const n=this.updateUniformBuffer(t);e||(e=n)}return e&&le.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var t;const n=this.uniformBlocks.get(e);let s=this.uniformBuffers.get(e),r=!1;if(s&&n!=null&&n.needsRedraw){r||(r=n.needsRedraw);const o=this.getUniformBufferData(e);s=this.uniformBuffers.get(e),s==null||s.write(o);const a=(t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms();le.log(4,`Writing to uniform buffer ${String(e)}`,o,a)()}return r}};var Oo;(function(i){i[i.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",i[i.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",i[i.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i[i.ZERO=0]="ZERO",i[i.ONE=1]="ONE",i[i.SRC_COLOR=768]="SRC_COLOR",i[i.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",i[i.SRC_ALPHA=770]="SRC_ALPHA",i[i.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",i[i.DST_ALPHA=772]="DST_ALPHA",i[i.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",i[i.DST_COLOR=774]="DST_COLOR",i[i.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",i[i.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",i[i.CONSTANT_COLOR=32769]="CONSTANT_COLOR",i[i.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",i[i.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",i[i.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",i[i.FUNC_ADD=32774]="FUNC_ADD",i[i.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",i[i.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",i[i.BLEND_EQUATION=32777]="BLEND_EQUATION",i[i.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",i[i.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",i[i.BLEND_DST_RGB=32968]="BLEND_DST_RGB",i[i.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",i[i.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",i[i.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",i[i.BLEND_COLOR=32773]="BLEND_COLOR",i[i.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",i[i.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",i[i.LINE_WIDTH=2849]="LINE_WIDTH",i[i.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",i[i.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",i[i.CULL_FACE_MODE=2885]="CULL_FACE_MODE",i[i.FRONT_FACE=2886]="FRONT_FACE",i[i.DEPTH_RANGE=2928]="DEPTH_RANGE",i[i.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",i[i.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",i[i.DEPTH_FUNC=2932]="DEPTH_FUNC",i[i.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",i[i.STENCIL_FUNC=2962]="STENCIL_FUNC",i[i.STENCIL_FAIL=2964]="STENCIL_FAIL",i[i.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",i[i.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",i[i.STENCIL_REF=2967]="STENCIL_REF",i[i.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",i[i.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",i[i.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",i[i.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",i[i.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",i[i.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",i[i.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",i[i.VIEWPORT=2978]="VIEWPORT",i[i.SCISSOR_BOX=3088]="SCISSOR_BOX",i[i.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",i[i.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",i[i.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",i[i.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",i[i.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",i[i.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",i[i.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",i[i.RED_BITS=3410]="RED_BITS",i[i.GREEN_BITS=3411]="GREEN_BITS",i[i.BLUE_BITS=3412]="BLUE_BITS",i[i.ALPHA_BITS=3413]="ALPHA_BITS",i[i.DEPTH_BITS=3414]="DEPTH_BITS",i[i.STENCIL_BITS=3415]="STENCIL_BITS",i[i.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",i[i.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",i[i.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",i[i.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",i[i.SAMPLES=32937]="SAMPLES",i[i.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",i[i.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",i[i.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",i[i.VENDOR=7936]="VENDOR",i[i.RENDERER=7937]="RENDERER",i[i.VERSION=7938]="VERSION",i[i.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",i[i.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",i[i.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",i[i.STATIC_DRAW=35044]="STATIC_DRAW",i[i.STREAM_DRAW=35040]="STREAM_DRAW",i[i.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.BUFFER_SIZE=34660]="BUFFER_SIZE",i[i.BUFFER_USAGE=34661]="BUFFER_USAGE",i[i.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",i[i.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",i[i.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",i[i.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",i[i.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",i[i.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",i[i.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",i[i.CULL_FACE=2884]="CULL_FACE",i[i.FRONT=1028]="FRONT",i[i.BACK=1029]="BACK",i[i.FRONT_AND_BACK=1032]="FRONT_AND_BACK",i[i.BLEND=3042]="BLEND",i[i.DEPTH_TEST=2929]="DEPTH_TEST",i[i.DITHER=3024]="DITHER",i[i.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",i[i.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",i[i.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",i[i.SCISSOR_TEST=3089]="SCISSOR_TEST",i[i.STENCIL_TEST=2960]="STENCIL_TEST",i[i.NO_ERROR=0]="NO_ERROR",i[i.INVALID_ENUM=1280]="INVALID_ENUM",i[i.INVALID_VALUE=1281]="INVALID_VALUE",i[i.INVALID_OPERATION=1282]="INVALID_OPERATION",i[i.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",i[i.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",i[i.CW=2304]="CW",i[i.CCW=2305]="CCW",i[i.DONT_CARE=4352]="DONT_CARE",i[i.FASTEST=4353]="FASTEST",i[i.NICEST=4354]="NICEST",i[i.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.INT=5124]="INT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.FLOAT=5126]="FLOAT",i[i.DOUBLE=5130]="DOUBLE",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.ALPHA=6406]="ALPHA",i[i.RGB=6407]="RGB",i[i.RGBA=6408]="RGBA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",i[i.VERTEX_SHADER=35633]="VERTEX_SHADER",i[i.COMPILE_STATUS=35713]="COMPILE_STATUS",i[i.DELETE_STATUS=35712]="DELETE_STATUS",i[i.LINK_STATUS=35714]="LINK_STATUS",i[i.VALIDATE_STATUS=35715]="VALIDATE_STATUS",i[i.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",i[i.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",i[i.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",i[i.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",i[i.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",i[i.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",i[i.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",i[i.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",i[i.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",i[i.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",i[i.SHADER_TYPE=35663]="SHADER_TYPE",i[i.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",i[i.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",i[i.NEVER=512]="NEVER",i[i.LESS=513]="LESS",i[i.EQUAL=514]="EQUAL",i[i.LEQUAL=515]="LEQUAL",i[i.GREATER=516]="GREATER",i[i.NOTEQUAL=517]="NOTEQUAL",i[i.GEQUAL=518]="GEQUAL",i[i.ALWAYS=519]="ALWAYS",i[i.KEEP=7680]="KEEP",i[i.REPLACE=7681]="REPLACE",i[i.INCR=7682]="INCR",i[i.DECR=7683]="DECR",i[i.INVERT=5386]="INVERT",i[i.INCR_WRAP=34055]="INCR_WRAP",i[i.DECR_WRAP=34056]="DECR_WRAP",i[i.NEAREST=9728]="NEAREST",i[i.LINEAR=9729]="LINEAR",i[i.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",i[i.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",i[i.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",i[i.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",i[i.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",i[i.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",i[i.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",i[i.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE=5890]="TEXTURE",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i[i.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",i[i.TEXTURE0=33984]="TEXTURE0",i[i.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",i[i.REPEAT=10497]="REPEAT",i[i.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i[i.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",i[i.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",i[i.FLOAT_VEC2=35664]="FLOAT_VEC2",i[i.FLOAT_VEC3=35665]="FLOAT_VEC3",i[i.FLOAT_VEC4=35666]="FLOAT_VEC4",i[i.INT_VEC2=35667]="INT_VEC2",i[i.INT_VEC3=35668]="INT_VEC3",i[i.INT_VEC4=35669]="INT_VEC4",i[i.BOOL=35670]="BOOL",i[i.BOOL_VEC2=35671]="BOOL_VEC2",i[i.BOOL_VEC3=35672]="BOOL_VEC3",i[i.BOOL_VEC4=35673]="BOOL_VEC4",i[i.FLOAT_MAT2=35674]="FLOAT_MAT2",i[i.FLOAT_MAT3=35675]="FLOAT_MAT3",i[i.FLOAT_MAT4=35676]="FLOAT_MAT4",i[i.SAMPLER_2D=35678]="SAMPLER_2D",i[i.SAMPLER_CUBE=35680]="SAMPLER_CUBE",i[i.LOW_FLOAT=36336]="LOW_FLOAT",i[i.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",i[i.HIGH_FLOAT=36338]="HIGH_FLOAT",i[i.LOW_INT=36339]="LOW_INT",i[i.MEDIUM_INT=36340]="MEDIUM_INT",i[i.HIGH_INT=36341]="HIGH_INT",i[i.FRAMEBUFFER=36160]="FRAMEBUFFER",i[i.RENDERBUFFER=36161]="RENDERBUFFER",i[i.RGBA4=32854]="RGBA4",i[i.RGB5_A1=32855]="RGB5_A1",i[i.RGB565=36194]="RGB565",i[i.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",i[i.STENCIL_INDEX=6401]="STENCIL_INDEX",i[i.STENCIL_INDEX8=36168]="STENCIL_INDEX8",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",i[i.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",i[i.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",i[i.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",i[i.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",i[i.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",i[i.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",i[i.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",i[i.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",i[i.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",i[i.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",i[i.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",i[i.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",i[i.NONE=0]="NONE",i[i.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",i[i.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",i[i.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",i[i.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",i[i.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",i[i.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",i[i.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",i[i.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",i[i.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",i[i.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",i[i.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",i[i.READ_BUFFER=3074]="READ_BUFFER",i[i.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",i[i.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",i[i.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",i[i.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",i[i.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",i[i.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",i[i.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",i[i.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",i[i.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",i[i.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",i[i.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",i[i.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",i[i.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",i[i.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",i[i.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",i[i.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",i[i.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",i[i.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",i[i.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",i[i.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",i[i.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",i[i.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",i[i.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",i[i.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",i[i.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",i[i.RED=6403]="RED",i[i.RGB8=32849]="RGB8",i[i.RGBA8=32856]="RGBA8",i[i.RGB10_A2=32857]="RGB10_A2",i[i.TEXTURE_3D=32879]="TEXTURE_3D",i[i.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",i[i.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",i[i.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",i[i.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",i[i.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",i[i.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",i[i.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",i[i.SRGB=35904]="SRGB",i[i.SRGB8=35905]="SRGB8",i[i.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",i[i.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",i[i.RGBA32F=34836]="RGBA32F",i[i.RGB32F=34837]="RGB32F",i[i.RGBA16F=34842]="RGBA16F",i[i.RGB16F=34843]="RGB16F",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",i[i.R11F_G11F_B10F=35898]="R11F_G11F_B10F",i[i.RGB9_E5=35901]="RGB9_E5",i[i.RGBA32UI=36208]="RGBA32UI",i[i.RGB32UI=36209]="RGB32UI",i[i.RGBA16UI=36214]="RGBA16UI",i[i.RGB16UI=36215]="RGB16UI",i[i.RGBA8UI=36220]="RGBA8UI",i[i.RGB8UI=36221]="RGB8UI",i[i.RGBA32I=36226]="RGBA32I",i[i.RGB32I=36227]="RGB32I",i[i.RGBA16I=36232]="RGBA16I",i[i.RGB16I=36233]="RGB16I",i[i.RGBA8I=36238]="RGBA8I",i[i.RGB8I=36239]="RGB8I",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.R8=33321]="R8",i[i.RG8=33323]="RG8",i[i.R16F=33325]="R16F",i[i.R32F=33326]="R32F",i[i.RG16F=33327]="RG16F",i[i.RG32F=33328]="RG32F",i[i.R8I=33329]="R8I",i[i.R8UI=33330]="R8UI",i[i.R16I=33331]="R16I",i[i.R16UI=33332]="R16UI",i[i.R32I=33333]="R32I",i[i.R32UI=33334]="R32UI",i[i.RG8I=33335]="RG8I",i[i.RG8UI=33336]="RG8UI",i[i.RG16I=33337]="RG16I",i[i.RG16UI=33338]="RG16UI",i[i.RG32I=33339]="RG32I",i[i.RG32UI=33340]="RG32UI",i[i.R8_SNORM=36756]="R8_SNORM",i[i.RG8_SNORM=36757]="RG8_SNORM",i[i.RGB8_SNORM=36758]="RGB8_SNORM",i[i.RGBA8_SNORM=36759]="RGBA8_SNORM",i[i.RGB10_A2UI=36975]="RGB10_A2UI",i[i.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",i[i.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.HALF_FLOAT=5131]="HALF_FLOAT",i[i.RG=33319]="RG",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",i[i.CURRENT_QUERY=34917]="CURRENT_QUERY",i[i.QUERY_RESULT=34918]="QUERY_RESULT",i[i.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",i[i.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",i[i.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",i[i.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",i[i.DRAW_BUFFER0=34853]="DRAW_BUFFER0",i[i.DRAW_BUFFER1=34854]="DRAW_BUFFER1",i[i.DRAW_BUFFER2=34855]="DRAW_BUFFER2",i[i.DRAW_BUFFER3=34856]="DRAW_BUFFER3",i[i.DRAW_BUFFER4=34857]="DRAW_BUFFER4",i[i.DRAW_BUFFER5=34858]="DRAW_BUFFER5",i[i.DRAW_BUFFER6=34859]="DRAW_BUFFER6",i[i.DRAW_BUFFER7=34860]="DRAW_BUFFER7",i[i.DRAW_BUFFER8=34861]="DRAW_BUFFER8",i[i.DRAW_BUFFER9=34862]="DRAW_BUFFER9",i[i.DRAW_BUFFER10=34863]="DRAW_BUFFER10",i[i.DRAW_BUFFER11=34864]="DRAW_BUFFER11",i[i.DRAW_BUFFER12=34865]="DRAW_BUFFER12",i[i.DRAW_BUFFER13=34866]="DRAW_BUFFER13",i[i.DRAW_BUFFER14=34867]="DRAW_BUFFER14",i[i.DRAW_BUFFER15=34868]="DRAW_BUFFER15",i[i.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",i[i.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",i[i.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",i[i.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",i[i.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",i[i.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",i[i.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",i[i.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",i[i.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",i[i.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",i[i.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",i[i.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",i[i.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",i[i.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",i[i.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",i[i.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",i[i.SAMPLER_3D=35679]="SAMPLER_3D",i[i.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",i[i.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",i[i.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",i[i.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",i[i.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",i[i.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",i[i.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",i[i.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",i[i.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",i[i.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",i[i.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",i[i.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",i[i.MAX_SAMPLES=36183]="MAX_SAMPLES",i[i.SAMPLER_BINDING=35097]="SAMPLER_BINDING",i[i.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",i[i.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",i[i.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",i[i.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",i[i.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",i[i.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",i[i.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",i[i.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",i[i.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",i[i.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",i[i.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",i[i.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",i[i.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",i[i.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",i[i.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",i[i.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",i[i.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",i[i.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",i[i.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",i[i.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",i[i.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",i[i.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",i[i.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",i[i.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",i[i.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",i[i.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",i[i.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",i[i.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",i[i.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",i[i.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",i[i.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",i[i.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",i[i.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",i[i.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",i[i.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",i[i.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",i[i.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",i[i.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",i[i.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i[i.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",i[i.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",i[i.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",i[i.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",i[i.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",i[i.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",i[i.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",i[i.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",i[i.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",i[i.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",i[i.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",i[i.UNIFORM_TYPE=35383]="UNIFORM_TYPE",i[i.UNIFORM_SIZE=35384]="UNIFORM_SIZE",i[i.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",i[i.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",i[i.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",i[i.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",i[i.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",i[i.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",i[i.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",i[i.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",i[i.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",i[i.OBJECT_TYPE=37138]="OBJECT_TYPE",i[i.SYNC_CONDITION=37139]="SYNC_CONDITION",i[i.SYNC_STATUS=37140]="SYNC_STATUS",i[i.SYNC_FLAGS=37141]="SYNC_FLAGS",i[i.SYNC_FENCE=37142]="SYNC_FENCE",i[i.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",i[i.UNSIGNALED=37144]="UNSIGNALED",i[i.SIGNALED=37145]="SIGNALED",i[i.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",i[i.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",i[i.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",i[i.WAIT_FAILED=37149]="WAIT_FAILED",i[i.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",i[i.COLOR=6144]="COLOR",i[i.DEPTH=6145]="DEPTH",i[i.STENCIL=6146]="STENCIL",i[i.MIN=32775]="MIN",i[i.MAX=32776]="MAX",i[i.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",i[i.STREAM_READ=35041]="STREAM_READ",i[i.STREAM_COPY=35042]="STREAM_COPY",i[i.STATIC_READ=35045]="STATIC_READ",i[i.STATIC_COPY=35046]="STATIC_COPY",i[i.DYNAMIC_READ=35049]="DYNAMIC_READ",i[i.DYNAMIC_COPY=35050]="DYNAMIC_COPY",i[i.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",i[i.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",i[i.INVALID_INDEX=4294967295]="INVALID_INDEX",i[i.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",i[i.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",i[i.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",i[i.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",i[i.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",i[i.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",i[i.R16_EXT=33322]="R16_EXT",i[i.RG16_EXT=33324]="RG16_EXT",i[i.RGB16_EXT=32852]="RGB16_EXT",i[i.RGBA16_EXT=32859]="RGBA16_EXT",i[i.R16_SNORM_EXT=36760]="R16_SNORM_EXT",i[i.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",i[i.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",i[i.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",i[i.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",i[i.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",i[i.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",i[i.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",i[i.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",i[i.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",i[i.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",i[i.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",i[i.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",i[i.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",i[i.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",i[i.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",i[i.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",i[i.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",i[i.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",i[i.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",i[i.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",i[i.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",i[i.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",i[i.LINE_WEBGL=6913]="LINE_WEBGL",i[i.FILL_WEBGL=6914]="FILL_WEBGL",i[i.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",i[i.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",i[i.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",i[i.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",i[i.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",i[i.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",i[i.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",i[i.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",i[i.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",i[i.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",i[i.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",i[i.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",i[i.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",i[i.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",i[i.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",i[i.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",i[i.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",i[i.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",i[i.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",i[i.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",i[i.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",i[i.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",i[i.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",i[i.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Oo||(Oo={}));const tD={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},iD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),nD=i=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return i.createVertexArray()},deleteVertexArrayOES(e){return i.deleteVertexArray(e)},isVertexArrayOES(e){return i.isVertexArray(e)},bindVertexArrayOES(e){return i.bindVertexArray(e)}}),sD=i=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return i.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return i.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return i.vertexAttribDivisor(...e)}});function rD(i=!0){const e=HTMLCanvasElement.prototype;if(!i&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(t,n){if(t==="webgl"||t==="experimental-webgl"){const s=this.originalGetContext("webgl2",n);return s instanceof HTMLElement&&oD(s),s}return this.originalGetContext(t,n)}}function oD(i){i.getExtension("EXT_color_buffer_float");const e={...tD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:iD(i),OES_vertex_array_object:nD(i),ANGLE_instanced_arrays:sD(i)},t=i.getExtension;i.getExtension=function(s){return t.call(i,s)||(s in e?e[s]:null)};const n=i.getSupportedExtensions;i.getSupportedExtensions=function(){const s=n.apply(i)||[];return s==null?void 0:s.concat(Object.keys(e))}}async function L2(i,e){const t=document.getElementsByTagName("head")[0];if(!t)throw new Error("loadScript");const n=document.createElement("script");return n.setAttribute("type","text/javascript"),n.setAttribute("src",i),new Promise((s,r)=>{n.onload=s,n.onerror=o=>r(new Error(`Unable to load script '${i}': ${o}`)),t.appendChild(n)})}const aD=1;let fi=null,J0=!1;const _y={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function lD(i){if(!globalThis.SPECTOR)try{await L2(i.debugSpectorJSUrl||_y.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Ote(i){var e;if(i={..._y,...i},!i.debugSpectorJS)return null;if(!fi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(aD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;fi=new t,globalThis.luma&&(globalThis.luma.spector=fi)}if(!fi)return null;if(J0||(J0=!0,fi.spyCanvases(),fi==null||fi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),fi==null||fi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),fi==null||fi.getResultUI(),fi==null||fi.resultView.display(),fi==null||fi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;fi==null||fi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),fi==null||fi.stopCapture()})}return fi}const cD="https://unpkg.com/webgl-debug@2.0.1/index.js";function R2(i){return i.luma=i.luma||{},i.luma}async function uD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await L2(cD))}function Bte(i,e={}){return e.debugWebGL||e.traceWebGL?hD(i,e):dD(i)}function dD(i){const e=R2(i);return e.realContext?e.realContext:i}function hD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=R2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Oo,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,fD.bind(null,e),pD.bind(null,e));for(const o in Oo)!(o in n)&&typeof Oo[o]=="number"&&(n[o]=Oo[o]);class s{}Object.setPrototypeOf(n,Object.getPrototypeOf(i)),Object.setPrototypeOf(s,n);const r=Object.create(s);return t.realContext=i,t.debugContext=r,r.debug=!0,r}function ex(i,e){e=Array.from(e).map(n=>n===void 0?"undefined":n);let t=globalThis.WebGLDebugUtils.glFunctionArgsToString(i,e);return t=`${t.slice(0,100)}${t.length>100?"...":""}`,`gl.${i}(${t})`}function fD(i,e,t,n){n=Array.from(n).map(a=>a===void 0?"undefined":a);const s=globalThis.WebGLDebugUtils.glEnumToString(e),r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,n),o=`${s} in gl.${t}(${r})`;le.error(o)();debugger}function pD(i,e,t){let n="";le.level>=1&&(n=ex(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||ex(e,t);debugger}}const Sd=1;class mD extends CN{constructor(){super(),$(this,"type","webgl"),Cg.defaultProps={...Cg.defaultProps,..._y}}enforceWebGL2(e){rD(e)}isSupported(){return typeof WebGL2RenderingContext<"u"}isDeviceHandle(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:(typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext&&le.warn("WebGL1 is not supported",e)(),!1)}async attach(e,t={}){const{WebGLDevice:n}=await m0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-BEU5HehP.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!gD(e))throw new Error("Invalid WebGL2RenderingContext");const s=t.createCanvasContext===!0?{}:t.createCanvasContext;return new n({...t,_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1,...s}})}async create(e={}){const{WebGLDevice:t}=await m0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-BEU5HehP.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));le.groupCollapsed(Sd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(uD()),e.debugSpectorJS&&n.push(lD(e));const s=await Promise.allSettled(n);for(const a of s)a.status==="rejected"&&le.error(`Failed to initialize debug libraries ${a.reason}`)();const r=new t(e),o=`${r._reused?"Reusing":"Created"} device with WebGL2 ${r.props.debug?"debug ":""}context: ${r.info.vendor}, ${r.info.renderer} for canvas: ${r.canvasContext.id}`;return le.probe(Sd,o)(),le.table(Sd,r.info)(),r}finally{le.groupEnd(Sd)()}}}function gD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const _D=new mD,yD="#b3b3b3",bD=void 0,Ag=void 0,vD=1,xD=4,wD="#666666",SD=.1,ED=1,CD=1,P2="#222222",fe={enableSimulation:!0,spaceSize:8192,pointSizeScale:1,linkWidthScale:1,linkArrowsSizeScale:1,renderLinks:!0,curvedLinks:!1,curvedLinkSegments:19,curvedLinkWeight:.8,curvedLinkControlPointDistance:.5,linkArrows:!1,linkVisibilityDistanceRange:[50,150],linkVisibilityMinTransparency:.25,hoveredPointCursor:"auto",hoveredLinkCursor:"auto",renderHoveredPointRing:!1,hoveredPointRingColor:"white",hoveredLinkColor:void 0,hoveredLinkWidthIncrease:5,focusedPointRingColor:"white",focusedPointIndex:void 0,simulation:{decay:5e3,gravity:.25,center:0,repulsion:1,repulsionTheta:1.15,linkSpring:1,linkDistance:10,linkDistRandomVariationRange:[1,1.2],repulsionFromMouse:2,friction:.85,cluster:.1},showFPSMonitor:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||2,scalePointsOnZoom:!1,scaleLinksOnZoom:!1,enableZoom:!0,enableSimulationDuringZoom:!1,enableDrag:!1,fitViewOnInit:!0,fitViewDelay:250,fitViewPadding:.1,fitViewDuration:250,pointSamplingDistance:150,attribution:"",rescalePositions:void 0,enableRightClickRepulsion:!1},TD=.7,kD=.95,AD=3;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:N2,setPrototypeOf:tx,isFrozen:ID,getPrototypeOf:LD,getOwnPropertyDescriptor:RD}=Object;let{freeze:fn,seal:gs,create:D2}=Object,{apply:Ig,construct:Lg}=typeof Reflect<"u"&&Reflect;fn||(fn=function(i){return i});gs||(gs=function(i){return i});Ig||(Ig=function(i,e,t){return i.apply(e,t)});Lg||(Lg=function(i,e){return new i(...e)});const Ed=pn(Array.prototype.forEach),PD=pn(Array.prototype.lastIndexOf),ix=pn(Array.prototype.pop),lc=pn(Array.prototype.push),ND=pn(Array.prototype.splice),hh=pn(String.prototype.toLowerCase),nm=pn(String.prototype.toString),nx=pn(String.prototype.match),cc=pn(String.prototype.replace),DD=pn(String.prototype.indexOf),MD=pn(String.prototype.trim),Ms=pn(Object.prototype.hasOwnProperty),rn=pn(RegExp.prototype.test),uc=OD(TypeError);function pn(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:hh;tx&&tx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(ID(e)||(e[n]=r),s=r)}i[s]=!0}return i}function BD(i){for(let e=0;e/gm),jD=gs(/\$\{[\w\W]*/gm),HD=gs(/^data-[\-\w.\u00B7-\uFFFF]+$/),VD=gs(/^aria-[\-\w]+$/),M2=gs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),GD=gs(/^(?:\w+script|data):/i),WD=gs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),O2=gs(/^html$/i),YD=gs(/^[a-z][.\w]*(-[.\w]+)+$/i);var lx=Object.freeze({__proto__:null,ARIA_ATTR:VD,ATTR_WHITESPACE:WD,CUSTOM_ELEMENT:YD,DATA_ATTR:HD,DOCTYPE_NAME:O2,ERB_EXPR:$D,IS_ALLOWED_URI:M2,IS_SCRIPT_OR_DATA:GD,MUSTACHE_EXPR:UD,TMPLIT_EXPR:jD});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},qD=function(){return typeof window>"u"?null:window},XD=function(i,e){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let t=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(t=e.getAttribute(n));const s="dompurify"+(t?"#"+t:"");try{return i.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},cx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function B2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qD();const e=L=>B2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==hc.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=i,m=l.prototype,y=dc(m,"cloneNode"),g=dc(m,"remove"),_=dc(m,"nextSibling"),S=dc(m,"childNodes"),E=dc(m,"parentNode");if(typeof o=="function"){const L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let x,T="";const{implementation:I,createNodeIterator:B,createDocumentFragment:H,getElementsByTagName:Q}=t,{importNode:re}=n;let D=cx();e.isSupported=typeof N2=="function"&&typeof E=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:de,ERB_EXPR:se,TMPLIT_EXPR:R,DATA_ATTR:ee,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:Z}=lx;let{IS_ALLOWED_URI:ae}=lx,J=null;const Se=rt({},[...sx,...sm,...rm,...om,...rx]);let xe=null;const et=rt({},[...ox,...am,...ax,...Cd]);let he=Object.seal(D2(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yt=null,Xe=null,dt=!0,ie=!0,Ce=!1,Pe=!0,X=!1,We=!0,He=!1,bt=!1,Vt=!1,pe=!1,it=!1,si=!1,yi=!0,Zs=!1;const Zn="user-content-";let wo=!0,On=!1,di={},tn=null;const bi=rt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Qn=null;const Ss=rt({},["audio","video","img","source","image","track"]);let Qs=null;const Bn=rt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Es="http://www.w3.org/1998/Math/MathML",nn="http://www.w3.org/2000/svg",Ti="http://www.w3.org/1999/xhtml";let Qt=Ti,$i=!1,vn=null;const So=rt({},[Es,nn,Ti],nm);let Mr=rt({},["mi","mo","mn","ms","mtext"]),ji=rt({},["annotation-xml"]);const Or=rt({},["title","style","font","a","script"]);let Cs=null;const Js=["application/xhtml+xml","text/html"],ic="text/html";let Jt=null,At=null;const Jn=t.createElement("form"),Ut=function(L){return L instanceof RegExp||L instanceof Function},Ts=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(At&&At===L)){if((!L||typeof L!="object")&&(L={}),L=Gr(L),Cs=Js.indexOf(L.PARSER_MEDIA_TYPE)===-1?ic:L.PARSER_MEDIA_TYPE,Jt=Cs==="application/xhtml+xml"?nm:hh,J=Ms(L,"ALLOWED_TAGS")?rt({},L.ALLOWED_TAGS,Jt):Se,xe=Ms(L,"ALLOWED_ATTR")?rt({},L.ALLOWED_ATTR,Jt):et,vn=Ms(L,"ALLOWED_NAMESPACES")?rt({},L.ALLOWED_NAMESPACES,nm):So,Qs=Ms(L,"ADD_URI_SAFE_ATTR")?rt(Gr(Bn),L.ADD_URI_SAFE_ATTR,Jt):Bn,Qn=Ms(L,"ADD_DATA_URI_TAGS")?rt(Gr(Ss),L.ADD_DATA_URI_TAGS,Jt):Ss,tn=Ms(L,"FORBID_CONTENTS")?rt({},L.FORBID_CONTENTS,Jt):bi,yt=Ms(L,"FORBID_TAGS")?rt({},L.FORBID_TAGS,Jt):Gr({}),Xe=Ms(L,"FORBID_ATTR")?rt({},L.FORBID_ATTR,Jt):Gr({}),di=Ms(L,"USE_PROFILES")?L.USE_PROFILES:!1,dt=L.ALLOW_ARIA_ATTR!==!1,ie=L.ALLOW_DATA_ATTR!==!1,Ce=L.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,X=L.SAFE_FOR_TEMPLATES||!1,We=L.SAFE_FOR_XML!==!1,He=L.WHOLE_DOCUMENT||!1,pe=L.RETURN_DOM||!1,it=L.RETURN_DOM_FRAGMENT||!1,si=L.RETURN_TRUSTED_TYPE||!1,Vt=L.FORCE_BODY||!1,yi=L.SANITIZE_DOM!==!1,Zs=L.SANITIZE_NAMED_PROPS||!1,wo=L.KEEP_CONTENT!==!1,On=L.IN_PLACE||!1,ae=L.ALLOWED_URI_REGEXP||M2,Qt=L.NAMESPACE||Ti,Mr=L.MATHML_TEXT_INTEGRATION_POINTS||Mr,ji=L.HTML_INTEGRATION_POINTS||ji,he=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&Ut(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&Ut(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(ie=!1),it&&(pe=!0),di&&(J=rt({},rx),xe=[],di.html===!0&&(rt(J,sx),rt(xe,ox)),di.svg===!0&&(rt(J,sm),rt(xe,am),rt(xe,Cd)),di.svgFilters===!0&&(rt(J,rm),rt(xe,am),rt(xe,Cd)),di.mathMl===!0&&(rt(J,om),rt(xe,ax),rt(xe,Cd))),L.ADD_TAGS&&(J===Se&&(J=Gr(J)),rt(J,L.ADD_TAGS,Jt)),L.ADD_ATTR&&(xe===et&&(xe=Gr(xe)),rt(xe,L.ADD_ATTR,Jt)),L.ADD_URI_SAFE_ATTR&&rt(Qs,L.ADD_URI_SAFE_ATTR,Jt),L.FORBID_CONTENTS&&(tn===bi&&(tn=Gr(tn)),rt(tn,L.FORBID_CONTENTS,Jt)),wo&&(J["#text"]=!0),He&&rt(J,["html","head","body"]),J.table&&(rt(J,["tbody"]),delete yt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,T=x.createHTML("")}else x===void 0&&(x=XD(p,s)),x!==null&&typeof T=="string"&&(T=x.createHTML(""));fn&&fn(L),At=L}},er=rt({},[...sm,...rm,...FD]),Br=rt({},[...om,...zD]),Eo=function(L){let V=E(L);(!V||!V.tagName)&&(V={namespaceURI:Qt,tagName:"template"});const C=hh(L.tagName),G=hh(V.tagName);return vn[L.namespaceURI]?L.namespaceURI===nn?V.namespaceURI===Ti?C==="svg":V.namespaceURI===Es?C==="svg"&&(G==="annotation-xml"||Mr[G]):!!er[C]:L.namespaceURI===Es?V.namespaceURI===Ti?C==="math":V.namespaceURI===nn?C==="math"&&ji[G]:!!Br[C]:L.namespaceURI===Ti?V.namespaceURI===nn&&!ji[G]||V.namespaceURI===Es&&!Mr[G]?!1:!Br[C]&&(Or[C]||!er[C]):!!(Cs==="application/xhtml+xml"&&vn[L.namespaceURI]):!1},es=function(L){lc(e.removed,{element:L});try{E(L).removeChild(L)}catch{g(L)}},hi=function(L,V){try{lc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{lc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(L),L==="is")if(pe||it)try{es(V)}catch{}else try{V.setAttribute(L,"")}catch{}},xn=function(L){let V=null,C=null;if(Vt)L=""+L;else{const Te=nx(L,/^[\r\n\t ]+/);C=Te&&Te[0]}Cs==="application/xhtml+xml"&&Qt===Ti&&(L=''+L+"");const G=x?x.createHTML(L):L;if(Qt===Ti)try{V=new h().parseFromString(G,Cs)}catch{}if(!V||!V.documentElement){V=I.createDocument(Qt,"template",null);try{V.documentElement.innerHTML=$i?T:G}catch{}}const ne=V.body||V.documentElement;return L&&C&&ne.insertBefore(t.createTextNode(C),ne.childNodes[0]||null),Qt===Ti?Q.call(V,He?"html":"body")[0]:He?V.documentElement:ne},ks=function(L){return B.call(L.ownerDocument||L,L,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ct=function(L){return L instanceof d&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},Fr=function(L){return typeof a=="function"&&L instanceof a};function nt(L,V,C){Ed(L,G=>{G.call(e,V,C,At)})}const wn=function(L){let V=null;if(nt(D.beforeSanitizeElements,L,null),ct(L))return es(L),!0;const C=Jt(L.nodeName);if(nt(D.uponSanitizeElement,L,{tagName:C,allowedTags:J}),We&&L.hasChildNodes()&&!Fr(L.firstElementChild)&&rn(/<[/\w!]/g,L.innerHTML)&&rn(/<[/\w!]/g,L.textContent)||L.nodeType===hc.progressingInstruction||We&&L.nodeType===hc.comment&&rn(/<[/\w]/g,L.data))return es(L),!0;if(!J[C]||yt[C]){if(!yt[C]&&tr(C)&&(he.tagNameCheck instanceof RegExp&&rn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C)))return!1;if(wo&&!tn[C]){const G=E(L)||L.parentNode,ne=S(L)||L.childNodes;if(ne&&G){const Te=ne.length;for(let It=Te-1;It>=0;--It){const st=y(ne[It],!0);st.__removalCount=(L.__removalCount||0)+1,G.insertBefore(st,_(L))}}}return es(L),!0}return L instanceof l&&!Eo(L)||(C==="noscript"||C==="noembed"||C==="noframes")&&rn(/<\/no(script|embed|frames)/i,L.innerHTML)?(es(L),!0):(X&&L.nodeType===hc.text&&(V=L.textContent,Ed([de,se,R],G=>{V=cc(V,G," ")}),L.textContent!==V&&(lc(e.removed,{element:L.cloneNode()}),L.textContent=V)),nt(D.afterSanitizeElements,L,null),!1)},zr=function(L,V,C){if(yi&&(V==="id"||V==="name")&&(C in t||C in Jn))return!1;if(!(ie&&!Xe[V]&&rn(ee,V))&&!(dt&&rn(F,V))){if(!xe[V]||Xe[V]){if(!(tr(L)&&(he.tagNameCheck instanceof RegExp&&rn(he.tagNameCheck,L)||he.tagNameCheck instanceof Function&&he.tagNameCheck(L))&&(he.attributeNameCheck instanceof RegExp&&rn(he.attributeNameCheck,V)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(V))||V==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&rn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C))))return!1}else if(!Qs[V]&&!rn(ae,cc(C,te,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&DD(C,"data:")===0&&Qn[L])&&!(Ce&&!rn(q,cc(C,te,"")))&&C)return!1}return!0},tr=function(L){return L!=="annotation-xml"&&nx(L,Z)},Fn=function(L){nt(D.beforeSanitizeAttributes,L,null);const{attributes:V}=L;if(!V||ct(L))return;const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const ne=V[G],{name:Te,namespaceURI:It,value:st}=ne,Je=Jt(Te),vi=st;let ht=Te==="value"?vi:MD(vi);if(C.attrName=Je,C.attrValue=ht,C.keepAttr=!0,C.forceKeepAttr=void 0,nt(D.uponSanitizeAttribute,L,C),ht=C.attrValue,Zs&&(Je==="id"||Je==="name")&&(hi(Te,L),ht=Zn+ht),We&&rn(/((--!?|])>)|<\/(style|title)/i,ht)){hi(Te,L);continue}if(C.forceKeepAttr)continue;if(!C.keepAttr){hi(Te,L);continue}if(!Pe&&rn(/\/>/i,ht)){hi(Te,L);continue}X&&Ed([de,se,R],Lt=>{ht=cc(ht,Lt," ")});const ir=Jt(L.nodeName);if(!zr(ir,Je,ht)){hi(Te,L);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!It)switch(p.getAttributeType(ir,Je)){case"TrustedHTML":{ht=x.createHTML(ht);break}case"TrustedScriptURL":{ht=x.createScriptURL(ht);break}}if(ht!==vi)try{It?L.setAttributeNS(It,Te,ht):L.setAttribute(Te,ht),ct(L)?es(L):ix(e.removed)}catch{hi(Te,L)}}nt(D.afterSanitizeAttributes,L,null)},sn=function L(V){let C=null;const G=ks(V);for(nt(D.beforeSanitizeShadowDOM,V,null);C=G.nextNode();)nt(D.uponSanitizeShadowNode,C,null),wn(C),Fn(C),C.content instanceof r&&L(C.content);nt(D.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(L){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,G=null,ne=null,Te=null;if($i=!L,$i&&(L=""),typeof L!="string"&&!Fr(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return L;if(bt||Ts(V),e.removed=[],typeof L=="string"&&(On=!1),On){if(L.nodeName){const Je=Jt(L.nodeName);if(!J[Je]||yt[Je])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)C=xn(""),G=C.ownerDocument.importNode(L,!0),G.nodeType===hc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?C=G:C.appendChild(G);else{if(!pe&&!X&&!He&&L.indexOf("<")===-1)return x&&si?x.createHTML(L):L;if(C=xn(L),!C)return pe?null:si?T:""}C&&Vt&&es(C.firstChild);const It=ks(On?L:C);for(;ne=It.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&sn(ne.content);if(On)return L;if(pe){if(it)for(Te=H.call(C.ownerDocument);C.firstChild;)Te.appendChild(C.firstChild);else Te=C;return(xe.shadowroot||xe.shadowrootmode)&&(Te=re.call(n,Te,!0)),Te}let st=He?C.outerHTML:C.innerHTML;return He&&J["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&rn(O2,C.ownerDocument.doctype.name)&&(st=" `+st),X&&Ed([de,se,R],Je=>{st=cc(st,Je," ")}),x&&si?x.createHTML(st):st},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ts(L),bt=!0},e.clearConfig=function(){At=null,bt=!1},e.isValidAttribute=function(L,V,C){At||Ts({});const G=Jt(L),ne=Jt(V);return zr(G,ne,C)},e.addHook=function(L,V){typeof V=="function"&&lc(D[L],V)},e.removeHook=function(L,V){if(V!==void 0){const C=PD(D[L],V);return C===-1?void 0:ND(D[L],C,1)[0]}return ix(D[L])},e.removeHooks=function(L){D[L]=[]},e.removeAllHooks=function(){D=cx()},e}var KD=B2();const ZD=i=>typeof i=="function",F2=i=>Array.isArray(i),QD=i=>i instanceof Object,JD=i=>i instanceof Object?i.constructor.name!=="Function"&&i.constructor.name!=="Object":!1,ux=i=>QD(i)&&!F2(i)&&!ZD(i)&&!JD(i);function Bo(i){let e;if(F2(i))e=i;else{const t=jo(i),n=t==null?void 0:t.rgb();e=[(n==null?void 0:n.r)||0,(n==null?void 0:n.g)||0,(n==null?void 0:n.b)||0,(t==null?void 0:t.opacity)??1]}return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function eM(i,e,t){return .2126*i+.7152*e+.0722*t}function jn(i,e,t=0,n=0,s,r){return i.readPixelsToArrayWebGL(e,{sourceX:t,sourceY:n,sourceWidth:s,sourceHeight:r})}function tM(i,e,t){return Math.min(Math.max(i,e),t)}function ss(i){return i!=null&&!Number.isNaN(i)}function iM(i,e){return KD.sanitize(i,{ALLOWED_TAGS:["a","b","i","em","strong","span","div","p","br"],ALLOWED_ATTR:["href","target","class","id","style"],ALLOW_DATA_ATTR:!1,...e})}class nM{constructor(){this.enableSimulation=fe.enableSimulation,this.backgroundColor=P2,this.spaceSize=fe.spaceSize,this.pointColor=yD,this.pointDefaultColor=void 0,this.pointGreyoutOpacity=bD,this.pointGreyoutColor=Ag,this.pointSize=xD,this.pointDefaultSize=void 0,this.pointOpacity=vD,this.pointSizeScale=fe.pointSizeScale,this.hoveredPointCursor=fe.hoveredPointCursor,this.hoveredLinkCursor=fe.hoveredLinkCursor,this.renderHoveredPointRing=fe.renderHoveredPointRing,this.hoveredPointRingColor=fe.hoveredPointRingColor,this.focusedPointRingColor=fe.focusedPointRingColor,this.focusedPointIndex=fe.focusedPointIndex,this.linkColor=wD,this.linkDefaultColor=void 0,this.linkOpacity=ED,this.linkGreyoutOpacity=SD,this.linkWidth=CD,this.linkDefaultWidth=void 0,this.linkWidthScale=fe.linkWidthScale,this.hoveredLinkColor=fe.hoveredLinkColor,this.hoveredLinkWidthIncrease=fe.hoveredLinkWidthIncrease,this.renderLinks=fe.renderLinks,this.curvedLinks=fe.curvedLinks,this.curvedLinkSegments=fe.curvedLinkSegments,this.curvedLinkWeight=fe.curvedLinkWeight,this.curvedLinkControlPointDistance=fe.curvedLinkControlPointDistance,this.linkArrows=fe.linkArrows,this.linkDefaultArrows=void 0,this.linkArrowsSizeScale=fe.linkArrowsSizeScale,this.scaleLinksOnZoom=fe.scaleLinksOnZoom,this.linkVisibilityDistanceRange=fe.linkVisibilityDistanceRange,this.linkVisibilityMinTransparency=fe.linkVisibilityMinTransparency,this.simulationDecay=fe.simulation.decay,this.simulationGravity=fe.simulation.gravity,this.simulationCenter=fe.simulation.center,this.simulationRepulsion=fe.simulation.repulsion,this.simulationRepulsionTheta=fe.simulation.repulsionTheta,this.simulationLinkSpring=fe.simulation.linkSpring,this.simulationLinkDistance=fe.simulation.linkDistance,this.simulationLinkDistRandomVariationRange=fe.simulation.linkDistRandomVariationRange,this.simulationRepulsionFromMouse=fe.simulation.repulsionFromMouse,this.enableRightClickRepulsion=fe.enableRightClickRepulsion,this.simulationFriction=fe.simulation.friction,this.simulationCluster=fe.simulation.cluster,this.onSimulationStart=void 0,this.onSimulationTick=void 0,this.onSimulationEnd=void 0,this.onSimulationPause=void 0,this.onSimulationRestart=void 0,this.onSimulationUnpause=void 0,this.onClick=void 0,this.onPointClick=void 0,this.onLinkClick=void 0,this.onBackgroundClick=void 0,this.onMouseMove=void 0,this.onPointMouseOver=void 0,this.onPointMouseOut=void 0,this.onLinkMouseOver=void 0,this.onLinkMouseOut=void 0,this.onZoomStart=void 0,this.onZoom=void 0,this.onZoomEnd=void 0,this.onDragStart=void 0,this.onDrag=void 0,this.onDragEnd=void 0,this.showFPSMonitor=fe.showFPSMonitor,this.pixelRatio=fe.pixelRatio,this.scalePointsOnZoom=fe.scalePointsOnZoom,this.initialZoomLevel=void 0,this.enableZoom=fe.enableZoom,this.enableSimulationDuringZoom=fe.enableSimulationDuringZoom,this.enableDrag=fe.enableDrag,this.fitViewOnInit=fe.fitViewOnInit,this.fitViewDelay=fe.fitViewDelay,this.fitViewPadding=fe.fitViewPadding,this.fitViewDuration=fe.fitViewDuration,this.fitViewByPointsInRect=void 0,this.fitViewByPointIndices=void 0,this.randomSeed=void 0,this.pointSamplingDistance=fe.pointSamplingDistance,this.attribution=fe.attribution,this.rescalePositions=fe.rescalePositions}init(e){Object.keys(e).forEach(t=>{this.deepMergeConfig(this.getConfig(),e,t)})}deepMergeConfig(e,t,n){ux(e[n])&&ux(t[n])?Object.keys(t[n]).forEach(s=>{this.deepMergeConfig(e[n],t[n],s)}):e[n]=t[n]}getConfig(){return this}}function yy(i,e){if(!i)throw new Error(e||"shadertools: assertion failed.")}const lm={number:{type:"number",validate(i,e){return Number.isFinite(i)&&typeof e=="object"&&(e.max===void 0||i<=e.max)&&(e.min===void 0||i>=e.min)}},array:{type:"array",validate(i,e){return Array.isArray(i)||ArrayBuffer.isView(i)}}};function sM(i){const e={};for(const[t,n]of Object.entries(i))e[t]=rM(n);return e}function rM(i){let e=dx(i);if(e!=="object")return{value:i,...lm[e],type:e};if(typeof i=="object")return i?i.type!==void 0?{...i,...lm[i.type],type:i.type}:i.value===void 0?{type:"object",value:i}:(e=dx(i.value),{...i,...lm[e],type:e}):{type:"object",value:null};throw new Error("props")}function dx(i){return Array.isArray(i)||ArrayBuffer.isView(i)?"array":typeof i}const oM=`#ifdef MODULE_LOGDEPTH logdepth_adjustPosition(gl_Position); #endif diff --git a/frontend/dist/assets/Mqtt-_qQp7dyO.js b/frontend/dist/assets/Mqtt-2KIa8-95.js similarity index 98% rename from frontend/dist/assets/Mqtt-_qQp7dyO.js rename to frontend/dist/assets/Mqtt-2KIa8-95.js index aeb810da..74836094 100644 --- a/frontend/dist/assets/Mqtt-_qQp7dyO.js +++ b/frontend/dist/assets/Mqtt-2KIa8-95.js @@ -1,4 +1,4 @@ -import{e as Se,fm as N,fn as Ke,r as d,j as e,I as K,B as te,c as C,f2 as Fe,f3 as ze,aF as be,f4 as Ve,a8 as pe,V as I,a0 as ne,bN as xe,fo as ye,dp as Ce,fp as Le,fq as me,bI as We,fr as $e,aa as le,a7 as Pe,fs as O,ft as Ze,fu as Ye,fv as Me,fw as Je,fx as Xe,fy as _e,a2 as je,fz as qe,cL as ke,fA as Qe,bZ as et}from"./index-Bcr7MabU.js";import{C as Q,P as tt,a as st,B as at}from"./PageLayout-Bd1lZEvE.js";import{L as Re,a as fe}from"./listbox-D38oqfIZ.js";import{S as nt}from"./settings-2-Warn9Z6j.js";import{P as re}from"./plus-DZIbd-kZ.js";import{M as rt}from"./map-pin-CmfqMW3N.js";import{C as lt}from"./check-check-XzEYoNqt.js";import{Z as se}from"./zap-D8PO3IgR.js";import{S as Te}from"./search-D6EZ95nX.js";import{C as de}from"./chevron-right-BrHsAUr1.js";import{H as ot}from"./hash-DnbanjL5.js";import{u as it,C as ct}from"./chevron-up-DDF7YpTU.js";import{F as dt}from"./funnel-DFQf6jmi.js";import{a as ut,C as mt}from"./circle-stop-DyHSKXzf.js";import{T as ht}from"./trash-2-Dyph4AYl.js";import{M as pt}from"./message-square-DfbrFBie.js";import{C as xt}from"./cpu-CnyGw0WC.js";import{R as ue,C as ge}from"./Grid-ChpC-NJE.js";import{W as ft}from"./wifi-D7y3h36J.js";import{W as gt}from"./wifi-off-B_wOGsPk.js";import{D as Ne}from"./database-DdKGqHhF.js";import{C as Nt}from"./clock-vUFydv3d.js";import"./element-movement-DUifCLY7.js";import"./use-text-value-B9WhdAMT.js";import"./frozen-Csgg4u-n.js";/** +import{e as Se,fm as N,fn as Ke,r as d,j as e,I as K,B as te,c as C,f2 as Fe,f3 as ze,aF as be,f4 as Ve,a8 as pe,V as I,a0 as ne,bN as xe,fo as ye,dp as Ce,fp as Le,fq as me,bI as We,fr as $e,aa as le,a7 as Pe,fs as O,ft as Ze,fu as Ye,fv as Me,fw as Je,fx as Xe,fy as _e,a2 as je,fz as qe,cL as ke,fA as Qe,bZ as et}from"./index-CR6htdhJ.js";import{C as Q,P as tt,a as st,B as at}from"./PageLayout-Dk902Dlo.js";import{L as Re,a as fe}from"./listbox-DbdSXuSb.js";import{S as nt}from"./settings-2-CKRrmjMw.js";import{P as re}from"./plus-CfHg5JLg.js";import{M as rt}from"./map-pin-DLf5Z8nk.js";import{C as lt}from"./check-check-TgoebkD3.js";import{Z as se}from"./zap-BpXirfUQ.js";import{S as Te}from"./search-Djg1V5_Y.js";import{C as de}from"./chevron-right-D2DgrpVm.js";import{H as ot}from"./hash-D5cqF2Y_.js";import{u as it,C as ct}from"./chevron-up-v1ZA2R-9.js";import{F as dt}from"./funnel-4oboVPXr.js";import{a as ut,C as mt}from"./circle-stop-PRJBjCmt.js";import{T as ht}from"./trash-2-DDi3fVjz.js";import{M as pt}from"./message-square-CNUTpjtG.js";import{C as xt}from"./cpu-dVpC8VDl.js";import{R as ue,C as ge}from"./Grid-D3Ix759E.js";import{W as ft}from"./wifi-DFzHXMz6.js";import{W as gt}from"./wifi-off-h3izwtpW.js";import{D as Ne}from"./database-B1i3odU4.js";import{C as Nt}from"./clock-BFNcreJN.js";import"./element-movement-DIPTY4wV.js";import"./use-text-value-Ch4p-2-R.js";import"./frozen-i7Ib99V7.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MqttModeBadge-CrJ5xyVU.js b/frontend/dist/assets/MqttModeBadge-_nVkYyqI.js similarity index 98% rename from frontend/dist/assets/MqttModeBadge-CrJ5xyVU.js rename to frontend/dist/assets/MqttModeBadge-_nVkYyqI.js index 92c75587..45efb7a5 100644 --- a/frontend/dist/assets/MqttModeBadge-CrJ5xyVU.js +++ b/frontend/dist/assets/MqttModeBadge-_nVkYyqI.js @@ -1,4 +1,4 @@ -import{aY as Le,bj as ve,d1 as qe,d2 as ge,a_ as Ve,aZ as Z,r as l,b1 as He,b2 as ee,b6 as U,b5 as z,aU as I,b9 as V,d3 as se,d4 as _e,be as Qe,bf as Ye,bk as Ke,bg as re,bl as We,bh as me,d5 as je,d6 as H,d7 as A,d8 as G,d9 as he,da as Pe,bi as le,bv as C,db as ye,dc as xe,bm as we,bt as Xe,bn as Fe,bo as Oe,bp as J,bq as Ze,br as Ue,bu as Te,dd as ze,de as Ee,bw as Je,df as et,dg as tt,bx as ke,dh as nt,di as at,dj as ot,aV as st,dk as rt,bD as lt,dl as ut,dm as it,dn as Ne,bF as ct,bH as ce,e as dt,j as g,c as M,d as pt,m as ft,c_ as bt,dp as vt,u as mt,V as ht,aa as Ie}from"./index-Bcr7MabU.js";import{C as yt}from"./chevron-right-BrHsAUr1.js";import{F as xt,y as gt,R as Pt,T as $t,w as St,A as Ct}from"./map-pin-CmfqMW3N.js";var wt=Object.defineProperty,kt=(e,n,t)=>n in e?wt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Be=(e,n,t)=>(kt(e,typeof n!="symbol"?n+"":n,t),t),P=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(P||{}),It=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(It||{});let Bt={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,n){return e.button===n.button?e:{...e,button:n.button}},3(e,n){return e.buttonId===n.buttonId?e:{...e,buttonId:n.buttonId}},4(e,n){return e.panel===n.panel?e:{...e,panel:n.panel}},5(e,n){return e.panelId===n.panelId?e:{...e,panelId:n.panelId}}};class $e extends Le{constructor(n){super(n),Be(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let f=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;f==null||f.focus()},open:()=>this.send({type:0}),setButtonId:t=>this.send({type:3,buttonId:t}),setButton:t=>this.send({type:2,button:t}),setPanelId:t=>this.send({type:5,panelId:t}),setPanel:t=>this.send({type:4,panel:t})}),Be(this,"selectors",{isPortalled:t=>{var f;if(!t.button||!t.panel)return!1;let m=(f=qe(t.button))!=null?f:document;for(let $ of m.querySelectorAll("body > *"))if(Number($==null?void 0:$.contains(t.button))^Number($==null?void 0:$.contains(t.panel)))return!0;let i=ge(m),r=i.indexOf(t.button),a=(r+i.length-1)%i.length,S=(r+1)%i.length,y=i[a],s=i[S];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,f=Ve.get(null);this.on(0,()=>f.actions.push(t)),this.on(1,()=>f.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new $e({id:n,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(n,t){return Z(t.type,Bt,n,t)}}const Me=l.createContext(null);function de(e){let n=l.useContext(Me);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function _t({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>$e.new({id:e,__demoMode:n}),[]);return He(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function De(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function jt(){return l.useContext(pe)}let Ft="div";function Ot(e,n){var t;let f=l.useId(),{__demoMode:m=!1,...i}=e,r=_t({id:f,__demoMode:m}),a=l.useRef(null),S=z(n,et(u=>{a.current=u})),[y,s,$,w,B]=U(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),k=tt((t=a.current)!=null?t:s),b=ke(w),p=ke(B),v=l.useMemo(()=>({buttonId:b,panelId:p,close:r.actions.close}),[b,p,r]),x=De(),c=x==null?void 0:x.registerPopover,_=I(()=>{var u,j;let O=se((u=a.current)!=null?u:s);return(j=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?j:O&&((s==null?void 0:s.contains(O))||($==null?void 0:$.contains(O)))});l.useEffect(()=>c==null?void 0:c(v),[c,v]);let[te,ne]=nt(),L=at(s),D=ot({mainTreeNode:L,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});st(k,"focus",u=>{var j,O,E,W,N,X;u.target!==window&&rt(u.target)&&r.state.popoverState===P.Open&&(_()||r.state.button&&r.state.panel&&(D.contains(u.target)||(O=(j=r.state.beforePanelSentinel.current)==null?void 0:j.contains)!=null&&O.call(j,u.target)||(W=(E=r.state.afterPanelSentinel.current)==null?void 0:E.contains)!=null&&W.call(E,u.target)||(X=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&X.call(N,u.target)||r.actions.close()))},!0);let Q=y===P.Open;lt(Q,D.resolveContainers,(u,j)=>{r.actions.close(),ut(j,it.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===P.Open,close:r.actions.refocusableClose}),oe=U(r,l.useCallback(u=>Z(u.popoverState,{[P.Open]:J.Open,[P.Closed]:J.Closed}),[])),Y={ref:S},K=le();return C.createElement(Ne,{node:L},C.createElement(Ct,null,C.createElement(pe.Provider,{value:null},C.createElement(Me.Provider,{value:r},C.createElement(Ee,{value:r.actions.refocusableClose},C.createElement(ct,{value:oe},C.createElement(ne,null,K({ourProps:Y,theirProps:i,slot:ae,defaultTag:Ft,name:"Popover"}))))))))}let Tt="button";function Et(e,n){let t=l.useId(),{id:f=`headlessui-popover-button-${t}`,disabled:m=!1,autoFocus:i=!1,...r}=e,a=de("Popover.Button"),[S,y,s,$,w,B,k]=U(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),b=l.useRef(null),p=`headlessui-focus-sentinel-${l.useId()}`,v=De(),x=v==null?void 0:v.closeOthers,c=jt()!==null;l.useEffect(()=>{if(!c)return a.actions.setButtonId(f),()=>a.actions.setButtonId(null)},[c,f,a]);let[_]=l.useState(()=>Symbol()),te=z(b,n,xt(),I(o=>{if(!c){if(o)a.state.buttons.current.push(_);else{let d=a.state.buttons.current.indexOf(_);d!==-1&&a.state.buttons.current.splice(d,1)}a.state.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),o&&a.actions.setButton(o)}})),ne=z(b,n),L=I(o=>{var d,F,T;if(c){if(a.state.popoverState===P.Closed)return;switch(o.key){case V.Space:case V.Enter:o.preventDefault(),(F=(d=o.target).click)==null||F.call(d),a.actions.close(),(T=a.state.button)==null||T.focus();break}}else switch(o.key){case V.Space:case V.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===P.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close();break;case V.Escape:if(a.state.popoverState!==P.Open)return x==null?void 0:x(a.state.buttonId);if(!b.current)return;let R=se(b.current);if(R&&!b.current.contains(R))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),D=I(o=>{c||o.key===V.Space&&o.preventDefault()}),Q=I(o=>{var d,F;_e(o.currentTarget)||m||(c?(a.actions.close(),(d=a.state.button)==null||d.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===P.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close(),(F=a.state.button)==null||F.focus()))}),ae=I(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Y}=Qe({autoFocus:i}),{isHovered:K,hoverProps:u}=Ye({isDisabled:m}),{pressed:j,pressProps:O}=Ke({disabled:m}),E=S===P.Open,W=re({open:E,active:j||E,disabled:m,hover:K,focus:oe,autofocus:i}),N=We(e,s),X=c?me({ref:ne,type:N,onKeyDown:L,onClick:Q,disabled:m||void 0,autoFocus:i},Y,u,O):me({ref:te,id:$,type:N,"aria-expanded":S===P.Open,"aria-controls":w?B:void 0,disabled:m||void 0,autoFocus:i,onKeyDown:L,onKeyUp:D,onClick:Q,onMouseDown:ae},Y,u,O),ue=je(),fe=I(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function d(){Z(ue.current,{[A.Forwards]:()=>H(o,G.First),[A.Backwards]:()=>H(o,G.Last)})===he.Error&&H(ge(Pe(a.state.button)).filter(F=>F.dataset.headlessuiFocusGuard!=="true"),Z(ue.current,{[A.Forwards]:G.Next,[A.Backwards]:G.Previous}),{relativeTo:a.state.button})}d()}),h=le();return C.createElement(C.Fragment,null,h({ourProps:X,theirProps:r,slot:W,defaultTag:Tt,name:"Popover.Button"}),E&&!c&&y&&C.createElement(ye,{id:p,ref:k,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Nt="div",Mt=ce.RenderStrategy|ce.Static;function Re(e,n){let t=l.useId(),{id:f=`headlessui-popover-backdrop-${t}`,transition:m=!1,...i}=e,r=de("Popover.Backdrop"),a=U(r,l.useCallback(v=>v.popoverState,[])),[S,y]=l.useState(null),s=z(n,y),$=Fe(),[w,B]=Oe(m,S,$!==null?($&J.Open)===J.Open:a===P.Open),k=I(v=>{if(_e(v.currentTarget))return v.preventDefault();r.actions.close()}),b=re({open:a===P.Open}),p={ref:s,id:f,"aria-hidden":!0,onClick:k,...Te(B)};return le()({ourProps:p,theirProps:i,slot:b,defaultTag:Nt,features:Mt,visible:w,name:"Popover.Backdrop"})}let Dt="div",Rt=ce.RenderStrategy|ce.Static;function At(e,n){let t=l.useId(),{id:f=`headlessui-popover-panel-${t}`,focus:m=!1,anchor:i,portal:r=!1,modal:a=!1,transition:S=!1,...y}=e,s=de("Popover.Panel"),$=U(s,s.selectors.isPortalled),[w,B,k,b,p]=U(s,l.useCallback(h=>[h.popoverState,h.button,h.__demoMode,h.beforePanelSentinel,h.afterPanelSentinel],[])),v=`headlessui-focus-sentinel-before-${t}`,x=`headlessui-focus-sentinel-after-${t}`,c=l.useRef(null),_=gt(i),[te,ne]=Pt(_),L=$t();_&&(r=!0);let[D,Q]=l.useState(null),ae=z(c,n,_?te:null,s.actions.setPanel,Q),oe=we(B),Y=we(c.current);Xe(()=>(s.actions.setPanelId(f),()=>s.actions.setPanelId(null)),[f,s]);let K=Fe(),[u,j]=Oe(S,D,K!==null?(K&J.Open)===J.Open:w===P.Open);Ze(u,B,s.actions.close),Ue(k?!1:a&&u,Y);let O=I(h=>{var o;switch(h.key){case V.Escape:if(s.state.popoverState!==P.Open||!c.current)return;let d=se(c.current);if(d&&!c.current.contains(d))return;h.preventDefault(),h.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var h;e.static||w===P.Closed&&((h=e.unmount)==null||h)&&s.actions.setPanel(null)},[w,e.unmount,e.static,s]),l.useEffect(()=>{if(k||!m||w!==P.Open||!c.current)return;let h=se(c.current);c.current.contains(h)||H(c.current,G.First)},[k,m,c.current,w]);let E=re({open:w===P.Open,close:s.actions.refocusableClose}),W=me(_?L():{},{ref:ae,id:f,onKeyDown:O,onBlur:m&&w===P.Open?h=>{var o,d,F,T,R;let q=h.relatedTarget;q&&c.current&&((o=c.current)!=null&&o.contains(q)||(s.actions.close(),((F=(d=b.current)==null?void 0:d.contains)!=null&&F.call(d,q)||(R=(T=p.current)==null?void 0:T.contains)!=null&&R.call(T,q))&&q.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":St(u,B,!0).width},...Te(j)}),N=je(),X=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;H(h,G.First)===he.Error&&((d=s.state.afterPanelSentinel.current)==null||d.focus())},[A.Backwards]:()=>{var d;(d=s.state.button)==null||d.focus({preventScroll:!0})}})}o()}),ue=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;if(!s.state.button)return;let F=(d=Pe(s.state.button))!=null?d:document.body,T=ge(F),R=T.indexOf(s.state.button),q=T.slice(0,R+1),ie=[...T.slice(R+1),...q];for(let be of ie.slice())if(be.dataset.headlessuiFocusGuard==="true"||D!=null&&D.contains(be)){let Ce=ie.indexOf(be);Ce!==-1&&ie.splice(Ce,1)}H(ie,G.First,{sorted:!1})},[A.Backwards]:()=>{var d;H(h,G.Previous)===he.Error&&((d=s.state.button)==null||d.focus())}})}o()}),fe=le();return C.createElement(ze,null,C.createElement(pe.Provider,{value:f},C.createElement(Ee,{value:s.actions.refocusableClose},C.createElement(Je,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&$&&C.createElement(ye,{id:v,ref:b,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:X}),fe({ourProps:W,theirProps:y,slot:E,defaultTag:Dt,features:Rt,visible:u,name:"Popover.Panel"}),u&&$&&C.createElement(ye,{id:x,ref:p,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Gt="div";function Lt(e,n){let t=l.useRef(null),f=z(t,n),[m,i]=l.useState([]),r=I(b=>{i(p=>{let v=p.indexOf(b);if(v!==-1){let x=p.slice();return x.splice(v,1),x}return p})}),a=I(b=>(i(p=>[...p,b]),()=>r(b))),S=I(()=>{var b;let p=Pe(t.current);if(!p)return!1;let v=se(t.current);return(b=t.current)!=null&&b.contains(v)?!0:m.some(x=>{var c,_;return((c=p.getElementById(x.buttonId.current))==null?void 0:c.contains(v))||((_=p.getElementById(x.panelId.current))==null?void 0:_.contains(v))})}),y=I(b=>{for(let p of m)p.buttonId.current!==b&&p.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:S,closeOthers:y}),[a,r,S,y]),$=re({}),w=e,B={ref:f},k=le();return C.createElement(Ne,null,C.createElement(Se.Provider,{value:s},k({ourProps:B,theirProps:w,slot:$,defaultTag:Gt,name:"Popover.Group"})))}let qt=ee(Ot),Ae=ee(Et),Vt=ee(Re),Ht=ee(Re),Ge=ee(At),Qt=ee(Lt),Yt=Object.assign(qt,{Button:Ae,Backdrop:Ht,Overlay:Vt,Panel:Ge,Group:Qt});/** +import{aY as Le,bj as ve,d1 as qe,d2 as ge,a_ as Ve,aZ as Z,r as l,b1 as He,b2 as ee,b6 as U,b5 as z,aU as I,b9 as V,d3 as se,d4 as _e,be as Qe,bf as Ye,bk as Ke,bg as re,bl as We,bh as me,d5 as je,d6 as H,d7 as A,d8 as G,d9 as he,da as Pe,bi as le,bv as C,db as ye,dc as xe,bm as we,bt as Xe,bn as Fe,bo as Oe,bp as J,bq as Ze,br as Ue,bu as Te,dd as ze,de as Ee,bw as Je,df as et,dg as tt,bx as ke,dh as nt,di as at,dj as ot,aV as st,dk as rt,bD as lt,dl as ut,dm as it,dn as Ne,bF as ct,bH as ce,e as dt,j as g,c as M,d as pt,m as ft,c_ as bt,dp as vt,u as mt,V as ht,aa as Ie}from"./index-CR6htdhJ.js";import{C as yt}from"./chevron-right-D2DgrpVm.js";import{F as xt,y as gt,R as Pt,T as $t,w as St,A as Ct}from"./map-pin-DLf5Z8nk.js";var wt=Object.defineProperty,kt=(e,n,t)=>n in e?wt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Be=(e,n,t)=>(kt(e,typeof n!="symbol"?n+"":n,t),t),P=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(P||{}),It=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(It||{});let Bt={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,n){return e.button===n.button?e:{...e,button:n.button}},3(e,n){return e.buttonId===n.buttonId?e:{...e,buttonId:n.buttonId}},4(e,n){return e.panel===n.panel?e:{...e,panel:n.panel}},5(e,n){return e.panelId===n.panelId?e:{...e,panelId:n.panelId}}};class $e extends Le{constructor(n){super(n),Be(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let f=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;f==null||f.focus()},open:()=>this.send({type:0}),setButtonId:t=>this.send({type:3,buttonId:t}),setButton:t=>this.send({type:2,button:t}),setPanelId:t=>this.send({type:5,panelId:t}),setPanel:t=>this.send({type:4,panel:t})}),Be(this,"selectors",{isPortalled:t=>{var f;if(!t.button||!t.panel)return!1;let m=(f=qe(t.button))!=null?f:document;for(let $ of m.querySelectorAll("body > *"))if(Number($==null?void 0:$.contains(t.button))^Number($==null?void 0:$.contains(t.panel)))return!0;let i=ge(m),r=i.indexOf(t.button),a=(r+i.length-1)%i.length,S=(r+1)%i.length,y=i[a],s=i[S];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,f=Ve.get(null);this.on(0,()=>f.actions.push(t)),this.on(1,()=>f.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new $e({id:n,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(n,t){return Z(t.type,Bt,n,t)}}const Me=l.createContext(null);function de(e){let n=l.useContext(Me);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function _t({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>$e.new({id:e,__demoMode:n}),[]);return He(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function De(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function jt(){return l.useContext(pe)}let Ft="div";function Ot(e,n){var t;let f=l.useId(),{__demoMode:m=!1,...i}=e,r=_t({id:f,__demoMode:m}),a=l.useRef(null),S=z(n,et(u=>{a.current=u})),[y,s,$,w,B]=U(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),k=tt((t=a.current)!=null?t:s),b=ke(w),p=ke(B),v=l.useMemo(()=>({buttonId:b,panelId:p,close:r.actions.close}),[b,p,r]),x=De(),c=x==null?void 0:x.registerPopover,_=I(()=>{var u,j;let O=se((u=a.current)!=null?u:s);return(j=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?j:O&&((s==null?void 0:s.contains(O))||($==null?void 0:$.contains(O)))});l.useEffect(()=>c==null?void 0:c(v),[c,v]);let[te,ne]=nt(),L=at(s),D=ot({mainTreeNode:L,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});st(k,"focus",u=>{var j,O,E,W,N,X;u.target!==window&&rt(u.target)&&r.state.popoverState===P.Open&&(_()||r.state.button&&r.state.panel&&(D.contains(u.target)||(O=(j=r.state.beforePanelSentinel.current)==null?void 0:j.contains)!=null&&O.call(j,u.target)||(W=(E=r.state.afterPanelSentinel.current)==null?void 0:E.contains)!=null&&W.call(E,u.target)||(X=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&X.call(N,u.target)||r.actions.close()))},!0);let Q=y===P.Open;lt(Q,D.resolveContainers,(u,j)=>{r.actions.close(),ut(j,it.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===P.Open,close:r.actions.refocusableClose}),oe=U(r,l.useCallback(u=>Z(u.popoverState,{[P.Open]:J.Open,[P.Closed]:J.Closed}),[])),Y={ref:S},K=le();return C.createElement(Ne,{node:L},C.createElement(Ct,null,C.createElement(pe.Provider,{value:null},C.createElement(Me.Provider,{value:r},C.createElement(Ee,{value:r.actions.refocusableClose},C.createElement(ct,{value:oe},C.createElement(ne,null,K({ourProps:Y,theirProps:i,slot:ae,defaultTag:Ft,name:"Popover"}))))))))}let Tt="button";function Et(e,n){let t=l.useId(),{id:f=`headlessui-popover-button-${t}`,disabled:m=!1,autoFocus:i=!1,...r}=e,a=de("Popover.Button"),[S,y,s,$,w,B,k]=U(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),b=l.useRef(null),p=`headlessui-focus-sentinel-${l.useId()}`,v=De(),x=v==null?void 0:v.closeOthers,c=jt()!==null;l.useEffect(()=>{if(!c)return a.actions.setButtonId(f),()=>a.actions.setButtonId(null)},[c,f,a]);let[_]=l.useState(()=>Symbol()),te=z(b,n,xt(),I(o=>{if(!c){if(o)a.state.buttons.current.push(_);else{let d=a.state.buttons.current.indexOf(_);d!==-1&&a.state.buttons.current.splice(d,1)}a.state.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),o&&a.actions.setButton(o)}})),ne=z(b,n),L=I(o=>{var d,F,T;if(c){if(a.state.popoverState===P.Closed)return;switch(o.key){case V.Space:case V.Enter:o.preventDefault(),(F=(d=o.target).click)==null||F.call(d),a.actions.close(),(T=a.state.button)==null||T.focus();break}}else switch(o.key){case V.Space:case V.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===P.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close();break;case V.Escape:if(a.state.popoverState!==P.Open)return x==null?void 0:x(a.state.buttonId);if(!b.current)return;let R=se(b.current);if(R&&!b.current.contains(R))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),D=I(o=>{c||o.key===V.Space&&o.preventDefault()}),Q=I(o=>{var d,F;_e(o.currentTarget)||m||(c?(a.actions.close(),(d=a.state.button)==null||d.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===P.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close(),(F=a.state.button)==null||F.focus()))}),ae=I(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Y}=Qe({autoFocus:i}),{isHovered:K,hoverProps:u}=Ye({isDisabled:m}),{pressed:j,pressProps:O}=Ke({disabled:m}),E=S===P.Open,W=re({open:E,active:j||E,disabled:m,hover:K,focus:oe,autofocus:i}),N=We(e,s),X=c?me({ref:ne,type:N,onKeyDown:L,onClick:Q,disabled:m||void 0,autoFocus:i},Y,u,O):me({ref:te,id:$,type:N,"aria-expanded":S===P.Open,"aria-controls":w?B:void 0,disabled:m||void 0,autoFocus:i,onKeyDown:L,onKeyUp:D,onClick:Q,onMouseDown:ae},Y,u,O),ue=je(),fe=I(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function d(){Z(ue.current,{[A.Forwards]:()=>H(o,G.First),[A.Backwards]:()=>H(o,G.Last)})===he.Error&&H(ge(Pe(a.state.button)).filter(F=>F.dataset.headlessuiFocusGuard!=="true"),Z(ue.current,{[A.Forwards]:G.Next,[A.Backwards]:G.Previous}),{relativeTo:a.state.button})}d()}),h=le();return C.createElement(C.Fragment,null,h({ourProps:X,theirProps:r,slot:W,defaultTag:Tt,name:"Popover.Button"}),E&&!c&&y&&C.createElement(ye,{id:p,ref:k,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Nt="div",Mt=ce.RenderStrategy|ce.Static;function Re(e,n){let t=l.useId(),{id:f=`headlessui-popover-backdrop-${t}`,transition:m=!1,...i}=e,r=de("Popover.Backdrop"),a=U(r,l.useCallback(v=>v.popoverState,[])),[S,y]=l.useState(null),s=z(n,y),$=Fe(),[w,B]=Oe(m,S,$!==null?($&J.Open)===J.Open:a===P.Open),k=I(v=>{if(_e(v.currentTarget))return v.preventDefault();r.actions.close()}),b=re({open:a===P.Open}),p={ref:s,id:f,"aria-hidden":!0,onClick:k,...Te(B)};return le()({ourProps:p,theirProps:i,slot:b,defaultTag:Nt,features:Mt,visible:w,name:"Popover.Backdrop"})}let Dt="div",Rt=ce.RenderStrategy|ce.Static;function At(e,n){let t=l.useId(),{id:f=`headlessui-popover-panel-${t}`,focus:m=!1,anchor:i,portal:r=!1,modal:a=!1,transition:S=!1,...y}=e,s=de("Popover.Panel"),$=U(s,s.selectors.isPortalled),[w,B,k,b,p]=U(s,l.useCallback(h=>[h.popoverState,h.button,h.__demoMode,h.beforePanelSentinel,h.afterPanelSentinel],[])),v=`headlessui-focus-sentinel-before-${t}`,x=`headlessui-focus-sentinel-after-${t}`,c=l.useRef(null),_=gt(i),[te,ne]=Pt(_),L=$t();_&&(r=!0);let[D,Q]=l.useState(null),ae=z(c,n,_?te:null,s.actions.setPanel,Q),oe=we(B),Y=we(c.current);Xe(()=>(s.actions.setPanelId(f),()=>s.actions.setPanelId(null)),[f,s]);let K=Fe(),[u,j]=Oe(S,D,K!==null?(K&J.Open)===J.Open:w===P.Open);Ze(u,B,s.actions.close),Ue(k?!1:a&&u,Y);let O=I(h=>{var o;switch(h.key){case V.Escape:if(s.state.popoverState!==P.Open||!c.current)return;let d=se(c.current);if(d&&!c.current.contains(d))return;h.preventDefault(),h.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var h;e.static||w===P.Closed&&((h=e.unmount)==null||h)&&s.actions.setPanel(null)},[w,e.unmount,e.static,s]),l.useEffect(()=>{if(k||!m||w!==P.Open||!c.current)return;let h=se(c.current);c.current.contains(h)||H(c.current,G.First)},[k,m,c.current,w]);let E=re({open:w===P.Open,close:s.actions.refocusableClose}),W=me(_?L():{},{ref:ae,id:f,onKeyDown:O,onBlur:m&&w===P.Open?h=>{var o,d,F,T,R;let q=h.relatedTarget;q&&c.current&&((o=c.current)!=null&&o.contains(q)||(s.actions.close(),((F=(d=b.current)==null?void 0:d.contains)!=null&&F.call(d,q)||(R=(T=p.current)==null?void 0:T.contains)!=null&&R.call(T,q))&&q.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":St(u,B,!0).width},...Te(j)}),N=je(),X=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;H(h,G.First)===he.Error&&((d=s.state.afterPanelSentinel.current)==null||d.focus())},[A.Backwards]:()=>{var d;(d=s.state.button)==null||d.focus({preventScroll:!0})}})}o()}),ue=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;if(!s.state.button)return;let F=(d=Pe(s.state.button))!=null?d:document.body,T=ge(F),R=T.indexOf(s.state.button),q=T.slice(0,R+1),ie=[...T.slice(R+1),...q];for(let be of ie.slice())if(be.dataset.headlessuiFocusGuard==="true"||D!=null&&D.contains(be)){let Ce=ie.indexOf(be);Ce!==-1&&ie.splice(Ce,1)}H(ie,G.First,{sorted:!1})},[A.Backwards]:()=>{var d;H(h,G.Previous)===he.Error&&((d=s.state.button)==null||d.focus())}})}o()}),fe=le();return C.createElement(ze,null,C.createElement(pe.Provider,{value:f},C.createElement(Ee,{value:s.actions.refocusableClose},C.createElement(Je,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&$&&C.createElement(ye,{id:v,ref:b,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:X}),fe({ourProps:W,theirProps:y,slot:E,defaultTag:Dt,features:Rt,visible:u,name:"Popover.Panel"}),u&&$&&C.createElement(ye,{id:x,ref:p,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Gt="div";function Lt(e,n){let t=l.useRef(null),f=z(t,n),[m,i]=l.useState([]),r=I(b=>{i(p=>{let v=p.indexOf(b);if(v!==-1){let x=p.slice();return x.splice(v,1),x}return p})}),a=I(b=>(i(p=>[...p,b]),()=>r(b))),S=I(()=>{var b;let p=Pe(t.current);if(!p)return!1;let v=se(t.current);return(b=t.current)!=null&&b.contains(v)?!0:m.some(x=>{var c,_;return((c=p.getElementById(x.buttonId.current))==null?void 0:c.contains(v))||((_=p.getElementById(x.panelId.current))==null?void 0:_.contains(v))})}),y=I(b=>{for(let p of m)p.buttonId.current!==b&&p.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:S,closeOthers:y}),[a,r,S,y]),$=re({}),w=e,B={ref:f},k=le();return C.createElement(Ne,null,C.createElement(Se.Provider,{value:s},k({ourProps:B,theirProps:w,slot:$,defaultTag:Gt,name:"Popover.Group"})))}let qt=ee(Ot),Ae=ee(Et),Vt=ee(Re),Ht=ee(Re),Ge=ee(At),Qt=ee(Lt),Yt=Object.assign(qt,{Button:Ae,Backdrop:Ht,Overlay:Vt,Panel:Ge,Group:Qt});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PacketList-DmJjzUH5.js b/frontend/dist/assets/PacketList-DnOyjg3o.js similarity index 98% rename from frontend/dist/assets/PacketList-DmJjzUH5.js rename to frontend/dist/assets/PacketList-DnOyjg3o.js index f7b1257f..ffa8248b 100644 --- a/frontend/dist/assets/PacketList-DmJjzUH5.js +++ b/frontend/dist/assets/PacketList-DnOyjg3o.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-AlEhVgKC.js","assets/index-Bcr7MabU.js","assets/BasemapLayer-A-p_Dr5u.js","assets/car-Cn7MZO12.js","assets/useMapViewStore-DqjoQCEZ.js","assets/index-we8JTzK8.js","assets/index-BbwbpcoC.js","assets/index-7uzBcJ1E.css","assets/maplibre-gl-B1CfjdFi.css"])))=>i.map(i=>d[i]); -import{e as Se,bO as nt,bP as Ps,q as rt,n as lt,j as e,c as H,B as ns,t as it,r as m,a1 as rs,V as B,ao as je,bQ as ct,bR as Bs,bS as Ms,bT as Ls,aa as oe,bU as Rs,bV as Hs,bW as Fs,bX as me,bY as Xe,bZ as Ze,_ as ot,b_ as dt,b$ as xt,c0 as mt,c1 as ht,c2 as ut,c3 as pt,m as ce,ax as le,a3 as ft,a0 as gt,c4 as J,c5 as yt,c6 as ie,c7 as jt,c8 as bt,c9 as hs,ca as Nt,cb as vt,cc as wt,cd as kt,ce as Ct,cf as _t,cg as Je,ch as St,at as Tt,a6 as Ds,ci as Pt,cj as Bt,ck as Mt,cl as Lt,aC as As,aD as zs,d as We,cm as Rt,aF as Ht,cn as Ft,co as ls,cp as Dt}from"./index-Bcr7MabU.js";import{C as At,u as zt}from"./chevron-up-DDF7YpTU.js";import{p as Et,e as Es,g as It,b as $t}from"./primitives-D7nwWFFF.js";import{u as Ut,r as Ot,a as Vt,b as Gt,c as Qt,d as qt,i as Wt}from"./consumer-registry-Dy-EEMxV.js";import{D as Pe,R as Ie,P as Be,g as Kt}from"./badge-colors-Dl76Mz8m.js";import{g as Is,e as Ce,a as $s}from"./chat-utils-lxurr5ix.js";import{S as $e,i as Ue,a as Yt,g as us}from"./SignalIndicator-CYjIo_Mn.js";import{A as Xt}from"./arrow-up-r11Chuf6.js";import{A as he}from"./arrow-right-Bv8RdUpJ.js";import{A as Us}from"./arrow-down-DFZvzXIi.js";import{C as is}from"./chevron-right-BrHsAUr1.js";import{d as Zt}from"./payload-detail-jRk0k5AL.js";import{M as Oe}from"./map-pin-CmfqMW3N.js";import{C as Jt}from"./circle-question-mark-CHrfUdMk.js";import{L as ea}from"./layers-D696eHgB.js";import{H as Os}from"./hash-DnbanjL5.js";import{C as de}from"./clock-vUFydv3d.js";import{L as cs,R as sa}from"./route-DdD1xQhl.js";import{A as ta}from"./activity-BHsjc-ov.js";import{D as aa}from"./database-DdKGqHhF.js";import{H as na,D as es,u as ra}from"./useMapViewStore-DqjoQCEZ.js";import{S as ve}from"./shield-CcCTQoJ7.js";import{C as Vs}from"./MqttModeBadge-CrJ5xyVU.js";import{Z as ps}from"./zap-D8PO3IgR.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-S3pSbLw3.js","assets/index-CR6htdhJ.js","assets/BasemapLayer-B6qv9zHt.js","assets/car-BDe4EgpC.js","assets/useMapViewStore-Dst_TEXH.js","assets/index-BtT4gFCt.js","assets/index-CnoLcwbn.js","assets/index-7uzBcJ1E.css","assets/maplibre-gl-B1CfjdFi.css"])))=>i.map(i=>d[i]); +import{e as Se,bO as nt,bP as Ps,q as rt,n as lt,j as e,c as H,B as ns,t as it,r as m,a1 as rs,V as B,ao as je,bQ as ct,bR as Bs,bS as Ms,bT as Ls,aa as oe,bU as Rs,bV as Hs,bW as Fs,bX as me,bY as Xe,bZ as Ze,_ as ot,b_ as dt,b$ as xt,c0 as mt,c1 as ht,c2 as ut,c3 as pt,m as ce,ax as le,a3 as ft,a0 as gt,c4 as J,c5 as yt,c6 as ie,c7 as jt,c8 as bt,c9 as hs,ca as Nt,cb as vt,cc as wt,cd as kt,ce as Ct,cf as _t,cg as Je,ch as St,at as Tt,a6 as Ds,ci as Pt,cj as Bt,ck as Mt,cl as Lt,aC as As,aD as zs,d as We,cm as Rt,aF as Ht,cn as Ft,co as ls,cp as Dt}from"./index-CR6htdhJ.js";import{C as At,u as zt}from"./chevron-up-v1ZA2R-9.js";import{p as Et,e as Es,g as It,b as $t}from"./primitives-EdDnh5-7.js";import{u as Ut,r as Ot,a as Vt,b as Gt,c as Qt,d as qt,i as Wt}from"./consumer-registry-7Hi_pNJ6.js";import{D as Pe,R as Ie,P as Be,g as Kt}from"./badge-colors-Dl76Mz8m.js";import{g as Is,e as Ce,a as $s}from"./chat-utils-DHa6YwrS.js";import{S as $e,i as Ue,a as Yt,g as us}from"./SignalIndicator-ClMJO5cF.js";import{A as Xt}from"./arrow-up-K4au-fHx.js";import{A as he}from"./arrow-right-3jiFJDYq.js";import{A as Us}from"./arrow-down-DFhP0Q_b.js";import{C as is}from"./chevron-right-D2DgrpVm.js";import{d as Zt}from"./payload-detail-B6eeo8Zi.js";import{M as Oe}from"./map-pin-DLf5Z8nk.js";import{C as Jt}from"./circle-question-mark-BTap0a_9.js";import{L as ea}from"./layers-sBqNiTGy.js";import{H as Os}from"./hash-D5cqF2Y_.js";import{C as de}from"./clock-BFNcreJN.js";import{L as cs,R as sa}from"./route-BdG55Ep-.js";import{A as ta}from"./activity-B1_-JLqt.js";import{D as aa}from"./database-B1i3odU4.js";import{H as na,D as es,u as ra}from"./useMapViewStore-Dst_TEXH.js";import{S as ve}from"./shield-Bd_LbwYW.js";import{C as Vs}from"./MqttModeBadge-_nVkYyqI.js";import{Z as ps}from"./zap-BpXirfUQ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -29,7 +29,7 @@ import{e as Se,bO as nt,bP as Ps,q as rt,n as lt,j as e,c as H,B as ns,t as it,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ha=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],we=Se("user",ha);function ua(s){s.values.forEach(a=>a.stop())}function ss(s,a){[...a].reverse().forEach(n=>{const i=s.getVariant(n);i&&Ps(s,i),s.variantChildren&&s.variantChildren.forEach(l=>{ss(l,a)})})}function pa(s,a){if(Array.isArray(a))return ss(s,a);if(typeof a=="string")return ss(s,[a]);Ps(s,a)}function fa(){const s=new Set,a={subscribe(t){return s.add(t),()=>void s.delete(t)},start(t,n){const i=[];return s.forEach(l=>{i.push(nt(l,t,{transitionOverride:n}))}),Promise.all(i)},set(t){return s.forEach(n=>{pa(n,t)})},stop(){s.forEach(t=>{ua(t)})},mount(){return()=>{a.stop()}}};return a}function ga(){const s=rt(fa);return lt(s.mount,[]),s}function ya({"aria-label":s="Page navigation",className:a,...t}){return e.jsx("nav",{"aria-label":s,...t,className:H("flex gap-x-2",a)})}function ja({onClick:s,disabled:a=!1,className:t,children:n="Previous"}){return e.jsx("span",{className:H("grow basis-0",t),children:e.jsxs(ns,{plain:!0,onClick:s,disabled:a,"aria-label":"Previous page",className:H("gap-1",a&&"invisible"),children:[e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2.75 8H13.25M2.75 8L5.25 5.5M2.75 8L5.25 10.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),n]})})}function ba({onClick:s,disabled:a=!1,className:t,children:n="Next"}){return e.jsx("span",{className:H("flex grow basis-0 justify-end",t),children:e.jsxs(ns,{plain:!0,onClick:s,disabled:a,"aria-label":"Next page",className:H("gap-1",a&&"invisible"),children:[n,e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M13.25 8L2.75 8M13.25 8L10.75 10.5M13.25 8L10.75 5.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})]})})}function Na({className:s,...a}){return e.jsx("span",{...a,className:H("hidden items-baseline gap-x-2 sm:flex",s)})}function va({page:s,current:a=!1,onClick:t,className:n,children:i}){return e.jsx(ns,{plain:!a,outline:a,onClick:()=>t==null?void 0:t(s),"aria-label":`Page ${s}`,"aria-current":a?"page":void 0,className:H("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:i??s})}function wa({className:s,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:H("w-[2.25rem] select-none text-center text-sm text-fg-muted",s),children:"…"})}function ka(s,a,t=1){if(a<=7)return Array.from({length:a},(x,g)=>g+1);const n=Math.max(s-t,1),i=Math.min(s+t,a),l=n>2,r=iy+1),"gap",a]}if(l&&!r){const x=3+2*t;return[1,"gap",...Array.from({length:x},(u,y)=>a-x+y+1)]}return[1,"gap",...Array.from({length:i-n+1},(x,g)=>n+g),"gap",a]}const ur=it(s=>({requestedHash:null,requestChannel:a=>s({requestedHash:a}),clearRequest:()=>s({requestedHash:null})}));function Ca(s){if(s.length===0)return[];const a=[];let t=0;for(;t{const r=l===s.length-1,c=n!==null&&ct(i.toUpperCase(),n);return e.jsxs("span",{className:"flex items-center flex-shrink-0",children:[c?e.jsx("span",{className:"px-1 py-0.5 rounded bg-sys-amber/20 text-sys-amber text-[9px] font-medium",children:"You"}):e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill-hover text-fg-secondary",children:i.toUpperCase()}),!r&&e.jsx(is,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${i}-${l}`)})})}const qs=m.memo(Ba);function Ws({channelName:s,onClick:a,active:t,compact:n,className:i}){const l=s.startsWith("#")?s:`#${s}`,r=H("inline-flex items-center flex-shrink-0","font-medium",n?"px-1.5 h-4 leading-4 rounded text-[10px]":"px-2 h-5 leading-5 rounded text-xs",t?"bg-sys-blue/20 text-sys-blue":"bg-sys-blue/10 text-sys-blue",a&&!t&&"hover:bg-sys-blue/20 cursor-pointer",i);return a?e.jsx("button",{type:"button",onClick:a,className:r,children:l}):e.jsx("span",{className:r,children:l})}function Ks({packet:s}){return s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("teal"),children:"HTTP"}):s._mqttSource&&!s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("purple"),children:"MQTT"}):null}function ge(s){return{"--data-box-accent":me[s]}}function Ys(s){const a=s.payload_type_name||Hs(s.payload_type??s.type),t=s.route_type_name||Fs(s.route_type??s.route),n=Be[a]??"zinc",i=Ie[t]??"zinc";return{payloadType:a,routeType:t,payloadColor:n,routeColor:i}}function Ve(s){if(!s)return[];if(Array.isArray(s))return s;try{const a=JSON.parse(s);return Array.isArray(a)?a:[]}catch{return[]}}function Xs(s,a){if(a){const t=a(s);return{name:t.name,isCompanion:t.isCompanion,isRepeater:t.isRepeater}}return{name:null,isCompanion:!1,isRepeater:!1}}function Ma({packet:s,onClick:a,localHash:t,neighbors:n,resolveSource:i,isFlashing:l=!1,isTraceHighlighted:r,onTraceHover:c,traceTag:x,onViewTraceReport:g,dupeGroupPosition:u,isDupeGroupHovered:y=!1,onDupeGroupHover:k,dupeCount:b,getDecodedContent:d,onChannelClick:C}){const M=b?!1:Bs(s.is_duplicate),o=u!==void 0,{payloadType:N,routeType:f,payloadColor:_,routeColor:v}=Ys(s),p=s.packet_origin==="tx_local",I=N==="TRACE",V=Ve(s.original_path),q=Ve(s.forwarded_path),Y=q.length>0?q:V,z=s.src_hash?je(s.src_hash):null,{name:X,isRepeater:F}=Xs(s,i);let D=null,W=null,Z=null,O=null;if(N==="GRP_TXT"&&d){const E=d(s);E!=null&&E.decrypted&&(W=E.senderName,Z=E.channelName,O=E.channelHash,E.text&&(D=E.text))}else if(N==="TXT_MSG"&&s.raw_packet)try{const E=Ms.fromHex(s.raw_packet);if(E.success&&E.packet){const L=Ls(E.packet.payload);L&&!L.encrypted&&(D=L.text)}}catch{}const T=W||(F?null:X),$=!!T,ee=!$&&F&&!!X,ne=!$&&!ee&&N==="GRP_TXT"&&!D,P=s.payload_length??s.length??0;s.lbt_attempts;const h=m.useCallback(()=>{I&&x&&g?g(x):a(s)},[I,x,g,a,s]),se=m.useCallback(()=>{I&&x&&c&&c(x),o&&k&&s.packet_hash&&k(s.packet_hash)},[I,x,c,o,k,s.packet_hash]),te=m.useCallback(()=>{c&&c(null),k&&k(null)},[c,k]),R=me[_]||me.zinc,U=y,G=()=>{const E={pointerEvents:"none"};return u==="first"?{...E,borderTop:`2px solid ${R}`,borderLeft:`2px solid ${R}`,borderRight:`2px solid ${R}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:u==="middle"?{...E,borderTop:"none",borderLeft:`2px solid ${R}`,borderRight:`2px solid ${R}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:u==="last"?{...E,borderTop:"none",borderLeft:`2px solid ${R}`,borderRight:`2px solid ${R}`,borderBottom:`2px solid ${R}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...E,border:`2px solid ${R}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:h,onMouseEnter:se,onMouseLeave:te,className:H("group relative cursor-pointer","hover:bg-subtle-fill",M&&!y&&"opacity-40",l&&"flash-row",p&&"bg-sys-indigo/5",r&&"bg-sys-teal/10"),children:[e.jsx("div",{className:H("absolute pointer-events-none transition-opacity duration-75",o?U?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:G()}),e.jsxs("div",{className:"relative flex items-center gap-2 min-[600px]:gap-3 px-2 py-2 min-[600px]:px-3 min-[600px]:py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("div",{className:"relative flex-shrink-0",children:$?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:Is(Ce(T).cleanName)},children:Ce(T).emoji?e.jsx("span",{className:"text-base leading-none",children:Ce(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$s(T)})}):ee?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(oe,{className:"size-5 text-sys-blue"})}):ne?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gs,{className:"size-4 text-fg-muted"})}):e.jsx(Qs,{packet:s,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:$?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:T}),z&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:z})]}):ee?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:X}),z&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:z})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:z||"—"}),X&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate max-w-[70px]",children:X})]})})]}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 min-[600px]:gap-1.5 min-[900px]:gap-2 min-w-0",children:[e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(_),children:N}),p&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("indigo"),children:"LOCAL"}),e.jsx(Ks,{packet:s}),b&&b>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",b]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(v),children:f}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[P,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:D||Z?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[Z&&e.jsx(Ws,{channelName:Z,compact:!0,onClick:C&&O?E=>{E.stopPropagation(),C(O)}:void 0}),D&&e.jsx("span",{className:"italic truncate",children:D})]}):e.jsx(qs,{path:Y,localHash:t})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"data-box data-box-compact",children:Rs(s.timestamp)}),e.jsx($e,{rssi:s.rssi,snr:s.snr,compact:!0,showValues:!0,validated:Ue(s)})]})]})]})}function La({packet:s,onClick:a,localHash:t,neighbors:n,resolveSource:i,isFlashing:l=!1,isTraceHighlighted:r,traceTag:c,onViewTraceReport:x,dupeGroupPosition:g,isDupeGroupHovered:u=!1,onDupeGroupHover:y,dupeCount:k,getDecodedContent:b,onChannelClick:d}){const{payloadType:C,routeType:M,payloadColor:o,routeColor:N}=Ys(s),f=s.packet_origin==="tx_local",_=C==="TRACE",v=k?!1:Bs(s.is_duplicate),p=Ve(s.original_path),I=Ve(s.forwarded_path),V=I.length>0?I:p,q=s._hopCount??V.length,Y=s.src_hash?je(s.src_hash):null,{name:z,isRepeater:X}=Xs(s,i);let F=null,D=null,W=null,Z=null;if(C==="GRP_TXT"&&b){const R=b(s);R!=null&&R.decrypted&&(D=R.senderName,W=R.channelName,Z=R.channelHash,R.text&&(F=R.text))}else if(C==="TXT_MSG"&&s.raw_packet)try{const R=Ms.fromHex(s.raw_packet);if(R.success&&R.packet){const U=Ls(R.packet.payload);U&&!U.encrypted&&(F=U.text)}}catch{}const O=D||(X?null:z),T=!!O,$=!T&&X&&!!z,ee=!T&&!$&&C==="GRP_TXT"&&!F,ne=s.payload_length??s.length??0,P=s.lbt_attempts??0,h=()=>{_&&c&&x?x(c):a(s)},se=me[o]||me.zinc,te=()=>{if(!g)return{opacity:0};const R=u?1:.4,U=u?"3px":"2px";return g==="first"?{backgroundColor:se,opacity:R,width:U,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:g==="middle"?{backgroundColor:se,opacity:R,width:U,top:0,bottom:0,borderRadius:0}:g==="last"?{backgroundColor:se,opacity:R,width:U,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:se,opacity:R,width:U,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:h,className:H("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",v&&"opacity-40",l&&"flash-row",f&&"bg-sys-indigo/5",r&&"bg-sys-teal/10"),children:[e.jsx("div",{className:"absolute left-0 transition-all",style:te()}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"relative flex-shrink-0 mt-0.5",children:T?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:Is(Ce(O).cleanName)},children:Ce(O).emoji?e.jsx("span",{className:"text-base leading-none",children:Ce(O).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$s(O)})}):$?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(oe,{className:"size-5 text-sys-blue"})}):ee?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gs,{className:"size-4 text-fg-muted"})}):e.jsx(Qs,{packet:s,variant:"avatar",size:"sm"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[T?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:O}):$?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:z}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:Y||"—"}),z&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:z})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(o),children:C}),f&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("indigo"),children:"LOCAL"}),e.jsx(Ks,{packet:s}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(N),children:M}),k&&k>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",k]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("span",{className:"type-data-xs text-fg-muted w-[28px] text-right",children:s.rssi}),e.jsx($e,{rssi:s.rssi,compact:!0,showValues:!1,validated:Ue(s)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 type-data-xs text-fg-muted",children:[e.jsx("span",{className:"data-box data-box-compact flex-shrink-0",children:Rs(s.timestamp)}),ne>0&&e.jsxs("span",{children:[ne,"B"]}),P>0&&e.jsxs("span",{className:P>1?"text-sys-amber/60":void 0,children:["LBT:",P]}),s.snr!=null&&e.jsxs("span",{children:[s.snr.toFixed(0),"dB"]}),F||W?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[W&&e.jsx(Ws,{channelName:W,compact:!0,onClick:d&&Z?R=>{R.stopPropagation(),d(Z)}:void 0}),F&&e.jsx("span",{className:"italic truncate",children:F})]}):q>0?e.jsx(qs,{path:V,localHash:t}):null]})]})]})]})}const Ra=m.memo(Ma),Ha=m.memo(La);function Fa(s,a,t,n,i=!1){const l=s.toUpperCase(),r=[],c=t&&Xe(l,t);c&&r.push(t);for(const b of Object.keys(a))Xe(l,b)&&r.push(b);if(i&&c&&t&&r.length===1)return{matches:r,probability:1,bestMatch:t};if(i&&c&&r.length>1){const b=r.filter(d=>d!==t);if(b.length===1)return{matches:r,probability:1,bestMatch:b[0]}}const x=r.length>0?1/r.length:0,g=[...r].sort();let u=null,y=-1;if(g.length===1)u=g[0];else if(g.length>1&&n){for(const b of g){const d=n.get(b),C=d?typeof d=="number"?d:d.combinedScore:0;C>y&&(y=C,u=b)}u||(u=g[0])}else g.length>0&&(u=g[0]);let k=x;if(r.length>1&&n&&y>0){let b=0;for(const d of r){const C=n.get(d);b+=C?typeof C=="number"?C:C.combinedScore:0}b>0&&(k=Math.min(.95,y/b))}return{matches:r,probability:k,bestMatch:u}}function Da(s,a,t,n){const l=(t-s)*Math.PI/180,r=(n-a)*Math.PI/180,c=Math.sin(l/2)*Math.sin(l/2)+Math.cos(s*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}function Aa(s){return s<100?1:s<500?.9:s<1e3?.7:s<5e3?.5:s<1e4?.3:.1}const za=m.lazy(()=>ot(()=>import("./PathMapMapLibre-AlEhVgKC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])));function Ea(s,a,t,n,i=!1,l,r,c){const x=dt(a);let g;r&&(g=xt(r,s,{position:c,isLastHop:i}).confidence);const{matches:u,probability:y}=Fa(s,x,n,l,i),k=u.length,b=[],d=s.toUpperCase(),C=t&&t.latitude!==void 0&&t.longitude!==void 0&&(t.latitude!==0||t.longitude!==0);for(const o of u){if(n&&Xe(d,n)&&o===n&&C&&t){b.push({hash:o,name:t.name||"Local Node",latitude:t.latitude,longitude:t.longitude,probability:i?1:y,isLocal:!0});continue}const N=x[o];N!=null&&N.latitude&&(N!=null&&N.longitude)&&!(N.latitude===0&&N.longitude===0)&&b.push({hash:o,name:N.node_name||N.name||"Unknown",latitude:N.latitude,longitude:N.longitude,probability:y,isLocal:!1,isDirectNeighbor:N.zero_hop===!0})}const M=b.length;if(M===1)b[0].probability=g??1;else if(M>1)if(g!==void 0&&g>0){const o=b[0];o.probability=g;const N=1-g,f=M-1;b.slice(1).forEach(_=>{_.probability=N/f})}else{let o=0;const N=b.map(f=>{if(f.isLocal)return{candidate:f,score:1};const _=l==null?void 0:l.get(f.hash);let v=.5;if(C&&t){const I=Da(t.latitude,t.longitude,f.latitude,f.longitude);v=Aa(I)}let p;return _?p=v*.3+_.hopConsistencyScore*.3+_.frequencyScore*.4:(p=v,f.isDirectNeighbor&&(p=Math.max(p,.8))),o+=p,{candidate:f,score:p}});if(o>0)N.forEach(({candidate:f,score:_})=>{f.probability=Math.min(.95,_/o)});else{const f=1/M;b.forEach(_=>_.probability=f)}}return{candidates:b,totalMatches:k}}function Ia(s,a,t,n,i,l){if(!s||s.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const r=s.length-1,c=s.map((u,y)=>{const k=y===r,b=s.length-y,{candidates:d,totalMatches:C}=Ea(u,a,t,n,k,i,l,b),M=d.length>0?Math.max(...d.map(o=>o.probability)):0;return{prefix:u,candidates:d,confidence:M,totalMatches:C}}),x=c.reduce((u,y)=>y.confidence===0?0:u*y.confidence,1),g=c.some(u=>u.candidates.length>0);return{hops:c,overallConfidence:x,hasValidPath:g}}function $a(s){return`${(s*100).toFixed(0)}%`}function Ua(s){return s>=1?"text-sys-green":s>=.5?"text-sys-indigo":s>=.25?"text-signal-poor":s>0?"text-sys-red":"text-fg-muted"}function Oa(s,a,t){let n;return a===0?n=t.muted:s>=1?n=t.success:s>=.5?n=t.secondary:s>=.25?n=t.poor:s>0?n=t.danger:n=t.muted,{color:n}}class Va extends m.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?e.jsxs("div",{className:"h-[200px] flex items-center justify-center text-fg-muted",children:[e.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function Ge({path:s,neighbors:a,localNode:t,localHash:n,srcHash:i,dstHash:l,neighborAffinity:r,prefixLookup:c,hubNodes:x,traceSnr:g,advertiserSource:u}){const[y,k]=m.useState(null),b=m.useMemo(()=>{if(!u)return null;const f=u.nodeType==="wardrive";return{prefix:u.prefix||"??",candidates:[{hash:u.publicKey||u.prefix||"source",name:u.name,latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isWardrive:f}],confidence:1,totalMatches:1,isSource:!0}},[u]),d=m.useMemo(()=>{if(u||!i)return null;const f=je(i),_=a[i];if((_==null?void 0:_.latitude)&&(_==null?void 0:_.longitude)&&!(_.latitude===0&&_.longitude===0))return{prefix:f,candidates:[{hash:i,name:_.node_name||_.name||"Source",latitude:_.latitude,longitude:_.longitude,probability:1,isLocal:!1,isDirectNeighbor:_.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const p=(_==null?void 0:_.node_name)||(_==null?void 0:_.name)||i.slice(0,8);return{prefix:f,candidates:[{hash:i,name:p,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[u,i,a]),C=m.useMemo(()=>{const f=l!=null&&l.startsWith("0x")?l.slice(2):l;if((!f||f==="00"||f==="0000000000000000")&&t&&n){const q=je(n),Y=t.latitude!==0||t.longitude!==0;return{prefix:q,candidates:[{hash:n,name:t.name||"Local Node",latitude:Y?t.latitude:0,longitude:Y?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!l)return null;const v=je(l);if(n&&l===n&&t){const q=t.latitude!==0||t.longitude!==0;return{prefix:v,candidates:[{hash:l,name:t.name||"Local Node",latitude:q?t.latitude:0,longitude:q?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const p=a[l];if((p==null?void 0:p.latitude)&&(p==null?void 0:p.longitude)&&!(p.latitude===0&&p.longitude===0))return{prefix:v,candidates:[{hash:l,name:p.node_name||p.name||"Destination",latitude:p.latitude,longitude:p.longitude,probability:1,isLocal:!1,isDirectNeighbor:p.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const V=(p==null?void 0:p.node_name)||(p==null?void 0:p.name)||l.slice(0,8);return{prefix:v,candidates:[{hash:l,name:V,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[l,a,t,n]),M=m.useMemo(()=>Ia(s,a,t,n,r,c),[s,a,t,n,r,c]),o=m.useMemo(()=>{const f=[];b?f.push(b):d&&f.push(d),f.push(...M.hops),C&&f.push(C);const _=f.reduce((p,I)=>I.confidence===0?0:p*I.confidence,1),v=f.some(p=>p.candidates.some(I=>I.latitude!==0||I.longitude!==0));return{hops:f,overallConfidence:_,hasValidPath:v}},[b,d,M,C]),N=m.useMemo(()=>{const f=getComputedStyle(document.documentElement);return{success:f.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:f.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:f.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:f.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:f.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return o.hasValidPath?e.jsxs("div",{className:"h-full flex flex-col space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Path Confidence:"}),e.jsx("span",{className:Ua(o.overallConfidence),children:$a(o.overallConfidence)}),e.jsx("button",{className:"text-fg-muted hover:text-fg-secondary transition-colors",title:"Confidence is calculated based on how many known nodes match each path prefix. Multiple matches reduce confidence due to collision probability.",children:e.jsx(Jt,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-green"}),e.jsx("span",{className:"text-fg-muted",children:"Exact"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-indigo"}),e.jsx("span",{className:"text-fg-muted",children:"Multi"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-fg-muted"}),e.jsx("span",{className:"text-fg-muted",children:"Unknown"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(Va,{children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"h-full bg-elevated flex items-center justify-center text-fg-muted text-sm",children:"Loading map..."}),children:e.jsx(za,{resolvedPath:o,localNode:t,hubNodes:x,hoveredHopIndex:y,onHoverHop:k,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:o.hops.map((f,_)=>{var q,Y,z;const v=f.isSource===!0,p=f.isDestination===!0,I=y===_;let V;return v?V=`Source: ${((q=f.candidates[0])==null?void 0:q.name)||"Unknown"}`:p?V=`Destination: ${((Y=f.candidates[0])==null?void 0:Y.name)||"Unknown"}`:f.totalMatches===0?V="No matching nodes found":f.totalMatches===1?V=`Exact match: ${((z=f.candidates[0])==null?void 0:z.name)||"Unknown"}`:V=`${f.totalMatches} possible matches (${(f.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:H("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",I?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",v&&"border border-sys-green/30",p&&"border border-sys-blue/30"),title:V,onMouseEnter:()=>k(_),onMouseLeave:()=>k(null),children:[v&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),p&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:Oa(f.confidence,f.totalMatches,N),children:f.prefix}),!v&&!p&&f.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",f.totalMatches]}),!v&&!p&&f.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},_)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(Oe,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const Ke=16;function Qe(s){return s.match(/.{1,2}/g)||[]}function ye(s){return s!==null&&s.startsWith("payload:")}const _e={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` + */const ha=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],we=Se("user",ha);function ua(s){s.values.forEach(a=>a.stop())}function ss(s,a){[...a].reverse().forEach(n=>{const i=s.getVariant(n);i&&Ps(s,i),s.variantChildren&&s.variantChildren.forEach(l=>{ss(l,a)})})}function pa(s,a){if(Array.isArray(a))return ss(s,a);if(typeof a=="string")return ss(s,[a]);Ps(s,a)}function fa(){const s=new Set,a={subscribe(t){return s.add(t),()=>void s.delete(t)},start(t,n){const i=[];return s.forEach(l=>{i.push(nt(l,t,{transitionOverride:n}))}),Promise.all(i)},set(t){return s.forEach(n=>{pa(n,t)})},stop(){s.forEach(t=>{ua(t)})},mount(){return()=>{a.stop()}}};return a}function ga(){const s=rt(fa);return lt(s.mount,[]),s}function ya({"aria-label":s="Page navigation",className:a,...t}){return e.jsx("nav",{"aria-label":s,...t,className:H("flex gap-x-2",a)})}function ja({onClick:s,disabled:a=!1,className:t,children:n="Previous"}){return e.jsx("span",{className:H("grow basis-0",t),children:e.jsxs(ns,{plain:!0,onClick:s,disabled:a,"aria-label":"Previous page",className:H("gap-1",a&&"invisible"),children:[e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2.75 8H13.25M2.75 8L5.25 5.5M2.75 8L5.25 10.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),n]})})}function ba({onClick:s,disabled:a=!1,className:t,children:n="Next"}){return e.jsx("span",{className:H("flex grow basis-0 justify-end",t),children:e.jsxs(ns,{plain:!0,onClick:s,disabled:a,"aria-label":"Next page",className:H("gap-1",a&&"invisible"),children:[n,e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M13.25 8L2.75 8M13.25 8L10.75 10.5M13.25 8L10.75 5.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})]})})}function Na({className:s,...a}){return e.jsx("span",{...a,className:H("hidden items-baseline gap-x-2 sm:flex",s)})}function va({page:s,current:a=!1,onClick:t,className:n,children:i}){return e.jsx(ns,{plain:!a,outline:a,onClick:()=>t==null?void 0:t(s),"aria-label":`Page ${s}`,"aria-current":a?"page":void 0,className:H("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:i??s})}function wa({className:s,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:H("w-[2.25rem] select-none text-center text-sm text-fg-muted",s),children:"…"})}function ka(s,a,t=1){if(a<=7)return Array.from({length:a},(x,g)=>g+1);const n=Math.max(s-t,1),i=Math.min(s+t,a),l=n>2,r=iy+1),"gap",a]}if(l&&!r){const x=3+2*t;return[1,"gap",...Array.from({length:x},(u,y)=>a-x+y+1)]}return[1,"gap",...Array.from({length:i-n+1},(x,g)=>n+g),"gap",a]}const ur=it(s=>({requestedHash:null,requestChannel:a=>s({requestedHash:a}),clearRequest:()=>s({requestedHash:null})}));function Ca(s){if(s.length===0)return[];const a=[];let t=0;for(;t{const r=l===s.length-1,c=n!==null&&ct(i.toUpperCase(),n);return e.jsxs("span",{className:"flex items-center flex-shrink-0",children:[c?e.jsx("span",{className:"px-1 py-0.5 rounded bg-sys-amber/20 text-sys-amber text-[9px] font-medium",children:"You"}):e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill-hover text-fg-secondary",children:i.toUpperCase()}),!r&&e.jsx(is,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${i}-${l}`)})})}const qs=m.memo(Ba);function Ws({channelName:s,onClick:a,active:t,compact:n,className:i}){const l=s.startsWith("#")?s:`#${s}`,r=H("inline-flex items-center flex-shrink-0","font-medium",n?"px-1.5 h-4 leading-4 rounded text-[10px]":"px-2 h-5 leading-5 rounded text-xs",t?"bg-sys-blue/20 text-sys-blue":"bg-sys-blue/10 text-sys-blue",a&&!t&&"hover:bg-sys-blue/20 cursor-pointer",i);return a?e.jsx("button",{type:"button",onClick:a,className:r,children:l}):e.jsx("span",{className:r,children:l})}function Ks({packet:s}){return s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("teal"),children:"HTTP"}):s._mqttSource&&!s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("purple"),children:"MQTT"}):null}function ge(s){return{"--data-box-accent":me[s]}}function Ys(s){const a=s.payload_type_name||Hs(s.payload_type??s.type),t=s.route_type_name||Fs(s.route_type??s.route),n=Be[a]??"zinc",i=Ie[t]??"zinc";return{payloadType:a,routeType:t,payloadColor:n,routeColor:i}}function Ve(s){if(!s)return[];if(Array.isArray(s))return s;try{const a=JSON.parse(s);return Array.isArray(a)?a:[]}catch{return[]}}function Xs(s,a){if(a){const t=a(s);return{name:t.name,isCompanion:t.isCompanion,isRepeater:t.isRepeater}}return{name:null,isCompanion:!1,isRepeater:!1}}function Ma({packet:s,onClick:a,localHash:t,neighbors:n,resolveSource:i,isFlashing:l=!1,isTraceHighlighted:r,onTraceHover:c,traceTag:x,onViewTraceReport:g,dupeGroupPosition:u,isDupeGroupHovered:y=!1,onDupeGroupHover:k,dupeCount:b,getDecodedContent:d,onChannelClick:C}){const M=b?!1:Bs(s.is_duplicate),o=u!==void 0,{payloadType:N,routeType:f,payloadColor:_,routeColor:v}=Ys(s),p=s.packet_origin==="tx_local",I=N==="TRACE",V=Ve(s.original_path),q=Ve(s.forwarded_path),Y=q.length>0?q:V,z=s.src_hash?je(s.src_hash):null,{name:X,isRepeater:F}=Xs(s,i);let D=null,W=null,Z=null,O=null;if(N==="GRP_TXT"&&d){const E=d(s);E!=null&&E.decrypted&&(W=E.senderName,Z=E.channelName,O=E.channelHash,E.text&&(D=E.text))}else if(N==="TXT_MSG"&&s.raw_packet)try{const E=Ms.fromHex(s.raw_packet);if(E.success&&E.packet){const L=Ls(E.packet.payload);L&&!L.encrypted&&(D=L.text)}}catch{}const T=W||(F?null:X),$=!!T,ee=!$&&F&&!!X,ne=!$&&!ee&&N==="GRP_TXT"&&!D,P=s.payload_length??s.length??0;s.lbt_attempts;const h=m.useCallback(()=>{I&&x&&g?g(x):a(s)},[I,x,g,a,s]),se=m.useCallback(()=>{I&&x&&c&&c(x),o&&k&&s.packet_hash&&k(s.packet_hash)},[I,x,c,o,k,s.packet_hash]),te=m.useCallback(()=>{c&&c(null),k&&k(null)},[c,k]),R=me[_]||me.zinc,U=y,G=()=>{const E={pointerEvents:"none"};return u==="first"?{...E,borderTop:`2px solid ${R}`,borderLeft:`2px solid ${R}`,borderRight:`2px solid ${R}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:u==="middle"?{...E,borderTop:"none",borderLeft:`2px solid ${R}`,borderRight:`2px solid ${R}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:u==="last"?{...E,borderTop:"none",borderLeft:`2px solid ${R}`,borderRight:`2px solid ${R}`,borderBottom:`2px solid ${R}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...E,border:`2px solid ${R}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:h,onMouseEnter:se,onMouseLeave:te,className:H("group relative cursor-pointer","hover:bg-subtle-fill",M&&!y&&"opacity-40",l&&"flash-row",p&&"bg-sys-indigo/5",r&&"bg-sys-teal/10"),children:[e.jsx("div",{className:H("absolute pointer-events-none transition-opacity duration-75",o?U?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:G()}),e.jsxs("div",{className:"relative flex items-center gap-2 min-[600px]:gap-3 px-2 py-2 min-[600px]:px-3 min-[600px]:py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("div",{className:"relative flex-shrink-0",children:$?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:Is(Ce(T).cleanName)},children:Ce(T).emoji?e.jsx("span",{className:"text-base leading-none",children:Ce(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$s(T)})}):ee?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(oe,{className:"size-5 text-sys-blue"})}):ne?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gs,{className:"size-4 text-fg-muted"})}):e.jsx(Qs,{packet:s,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:$?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:T}),z&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:z})]}):ee?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:X}),z&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:z})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:z||"—"}),X&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate max-w-[70px]",children:X})]})})]}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 min-[600px]:gap-1.5 min-[900px]:gap-2 min-w-0",children:[e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(_),children:N}),p&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("indigo"),children:"LOCAL"}),e.jsx(Ks,{packet:s}),b&&b>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",b]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(v),children:f}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[P,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:D||Z?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[Z&&e.jsx(Ws,{channelName:Z,compact:!0,onClick:C&&O?E=>{E.stopPropagation(),C(O)}:void 0}),D&&e.jsx("span",{className:"italic truncate",children:D})]}):e.jsx(qs,{path:Y,localHash:t})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"data-box data-box-compact",children:Rs(s.timestamp)}),e.jsx($e,{rssi:s.rssi,snr:s.snr,compact:!0,showValues:!0,validated:Ue(s)})]})]})]})}function La({packet:s,onClick:a,localHash:t,neighbors:n,resolveSource:i,isFlashing:l=!1,isTraceHighlighted:r,traceTag:c,onViewTraceReport:x,dupeGroupPosition:g,isDupeGroupHovered:u=!1,onDupeGroupHover:y,dupeCount:k,getDecodedContent:b,onChannelClick:d}){const{payloadType:C,routeType:M,payloadColor:o,routeColor:N}=Ys(s),f=s.packet_origin==="tx_local",_=C==="TRACE",v=k?!1:Bs(s.is_duplicate),p=Ve(s.original_path),I=Ve(s.forwarded_path),V=I.length>0?I:p,q=s._hopCount??V.length,Y=s.src_hash?je(s.src_hash):null,{name:z,isRepeater:X}=Xs(s,i);let F=null,D=null,W=null,Z=null;if(C==="GRP_TXT"&&b){const R=b(s);R!=null&&R.decrypted&&(D=R.senderName,W=R.channelName,Z=R.channelHash,R.text&&(F=R.text))}else if(C==="TXT_MSG"&&s.raw_packet)try{const R=Ms.fromHex(s.raw_packet);if(R.success&&R.packet){const U=Ls(R.packet.payload);U&&!U.encrypted&&(F=U.text)}}catch{}const O=D||(X?null:z),T=!!O,$=!T&&X&&!!z,ee=!T&&!$&&C==="GRP_TXT"&&!F,ne=s.payload_length??s.length??0,P=s.lbt_attempts??0,h=()=>{_&&c&&x?x(c):a(s)},se=me[o]||me.zinc,te=()=>{if(!g)return{opacity:0};const R=u?1:.4,U=u?"3px":"2px";return g==="first"?{backgroundColor:se,opacity:R,width:U,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:g==="middle"?{backgroundColor:se,opacity:R,width:U,top:0,bottom:0,borderRadius:0}:g==="last"?{backgroundColor:se,opacity:R,width:U,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:se,opacity:R,width:U,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:h,className:H("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",v&&"opacity-40",l&&"flash-row",f&&"bg-sys-indigo/5",r&&"bg-sys-teal/10"),children:[e.jsx("div",{className:"absolute left-0 transition-all",style:te()}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"relative flex-shrink-0 mt-0.5",children:T?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:Is(Ce(O).cleanName)},children:Ce(O).emoji?e.jsx("span",{className:"text-base leading-none",children:Ce(O).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$s(O)})}):$?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(oe,{className:"size-5 text-sys-blue"})}):ee?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gs,{className:"size-4 text-fg-muted"})}):e.jsx(Qs,{packet:s,variant:"avatar",size:"sm"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[T?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:O}):$?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:z}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:Y||"—"}),z&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:z})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(o),children:C}),f&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge("indigo"),children:"LOCAL"}),e.jsx(Ks,{packet:s}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ge(N),children:M}),k&&k>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",k]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("span",{className:"type-data-xs text-fg-muted w-[28px] text-right",children:s.rssi}),e.jsx($e,{rssi:s.rssi,compact:!0,showValues:!1,validated:Ue(s)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 type-data-xs text-fg-muted",children:[e.jsx("span",{className:"data-box data-box-compact flex-shrink-0",children:Rs(s.timestamp)}),ne>0&&e.jsxs("span",{children:[ne,"B"]}),P>0&&e.jsxs("span",{className:P>1?"text-sys-amber/60":void 0,children:["LBT:",P]}),s.snr!=null&&e.jsxs("span",{children:[s.snr.toFixed(0),"dB"]}),F||W?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[W&&e.jsx(Ws,{channelName:W,compact:!0,onClick:d&&Z?R=>{R.stopPropagation(),d(Z)}:void 0}),F&&e.jsx("span",{className:"italic truncate",children:F})]}):q>0?e.jsx(qs,{path:V,localHash:t}):null]})]})]})]})}const Ra=m.memo(Ma),Ha=m.memo(La);function Fa(s,a,t,n,i=!1){const l=s.toUpperCase(),r=[],c=t&&Xe(l,t);c&&r.push(t);for(const b of Object.keys(a))Xe(l,b)&&r.push(b);if(i&&c&&t&&r.length===1)return{matches:r,probability:1,bestMatch:t};if(i&&c&&r.length>1){const b=r.filter(d=>d!==t);if(b.length===1)return{matches:r,probability:1,bestMatch:b[0]}}const x=r.length>0?1/r.length:0,g=[...r].sort();let u=null,y=-1;if(g.length===1)u=g[0];else if(g.length>1&&n){for(const b of g){const d=n.get(b),C=d?typeof d=="number"?d:d.combinedScore:0;C>y&&(y=C,u=b)}u||(u=g[0])}else g.length>0&&(u=g[0]);let k=x;if(r.length>1&&n&&y>0){let b=0;for(const d of r){const C=n.get(d);b+=C?typeof C=="number"?C:C.combinedScore:0}b>0&&(k=Math.min(.95,y/b))}return{matches:r,probability:k,bestMatch:u}}function Da(s,a,t,n){const l=(t-s)*Math.PI/180,r=(n-a)*Math.PI/180,c=Math.sin(l/2)*Math.sin(l/2)+Math.cos(s*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}function Aa(s){return s<100?1:s<500?.9:s<1e3?.7:s<5e3?.5:s<1e4?.3:.1}const za=m.lazy(()=>ot(()=>import("./PathMapMapLibre-S3pSbLw3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])));function Ea(s,a,t,n,i=!1,l,r,c){const x=dt(a);let g;r&&(g=xt(r,s,{position:c,isLastHop:i}).confidence);const{matches:u,probability:y}=Fa(s,x,n,l,i),k=u.length,b=[],d=s.toUpperCase(),C=t&&t.latitude!==void 0&&t.longitude!==void 0&&(t.latitude!==0||t.longitude!==0);for(const o of u){if(n&&Xe(d,n)&&o===n&&C&&t){b.push({hash:o,name:t.name||"Local Node",latitude:t.latitude,longitude:t.longitude,probability:i?1:y,isLocal:!0});continue}const N=x[o];N!=null&&N.latitude&&(N!=null&&N.longitude)&&!(N.latitude===0&&N.longitude===0)&&b.push({hash:o,name:N.node_name||N.name||"Unknown",latitude:N.latitude,longitude:N.longitude,probability:y,isLocal:!1,isDirectNeighbor:N.zero_hop===!0})}const M=b.length;if(M===1)b[0].probability=g??1;else if(M>1)if(g!==void 0&&g>0){const o=b[0];o.probability=g;const N=1-g,f=M-1;b.slice(1).forEach(_=>{_.probability=N/f})}else{let o=0;const N=b.map(f=>{if(f.isLocal)return{candidate:f,score:1};const _=l==null?void 0:l.get(f.hash);let v=.5;if(C&&t){const I=Da(t.latitude,t.longitude,f.latitude,f.longitude);v=Aa(I)}let p;return _?p=v*.3+_.hopConsistencyScore*.3+_.frequencyScore*.4:(p=v,f.isDirectNeighbor&&(p=Math.max(p,.8))),o+=p,{candidate:f,score:p}});if(o>0)N.forEach(({candidate:f,score:_})=>{f.probability=Math.min(.95,_/o)});else{const f=1/M;b.forEach(_=>_.probability=f)}}return{candidates:b,totalMatches:k}}function Ia(s,a,t,n,i,l){if(!s||s.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const r=s.length-1,c=s.map((u,y)=>{const k=y===r,b=s.length-y,{candidates:d,totalMatches:C}=Ea(u,a,t,n,k,i,l,b),M=d.length>0?Math.max(...d.map(o=>o.probability)):0;return{prefix:u,candidates:d,confidence:M,totalMatches:C}}),x=c.reduce((u,y)=>y.confidence===0?0:u*y.confidence,1),g=c.some(u=>u.candidates.length>0);return{hops:c,overallConfidence:x,hasValidPath:g}}function $a(s){return`${(s*100).toFixed(0)}%`}function Ua(s){return s>=1?"text-sys-green":s>=.5?"text-sys-indigo":s>=.25?"text-signal-poor":s>0?"text-sys-red":"text-fg-muted"}function Oa(s,a,t){let n;return a===0?n=t.muted:s>=1?n=t.success:s>=.5?n=t.secondary:s>=.25?n=t.poor:s>0?n=t.danger:n=t.muted,{color:n}}class Va extends m.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?e.jsxs("div",{className:"h-[200px] flex items-center justify-center text-fg-muted",children:[e.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function Ge({path:s,neighbors:a,localNode:t,localHash:n,srcHash:i,dstHash:l,neighborAffinity:r,prefixLookup:c,hubNodes:x,traceSnr:g,advertiserSource:u}){const[y,k]=m.useState(null),b=m.useMemo(()=>{if(!u)return null;const f=u.nodeType==="wardrive";return{prefix:u.prefix||"??",candidates:[{hash:u.publicKey||u.prefix||"source",name:u.name,latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isWardrive:f}],confidence:1,totalMatches:1,isSource:!0}},[u]),d=m.useMemo(()=>{if(u||!i)return null;const f=je(i),_=a[i];if((_==null?void 0:_.latitude)&&(_==null?void 0:_.longitude)&&!(_.latitude===0&&_.longitude===0))return{prefix:f,candidates:[{hash:i,name:_.node_name||_.name||"Source",latitude:_.latitude,longitude:_.longitude,probability:1,isLocal:!1,isDirectNeighbor:_.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const p=(_==null?void 0:_.node_name)||(_==null?void 0:_.name)||i.slice(0,8);return{prefix:f,candidates:[{hash:i,name:p,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[u,i,a]),C=m.useMemo(()=>{const f=l!=null&&l.startsWith("0x")?l.slice(2):l;if((!f||f==="00"||f==="0000000000000000")&&t&&n){const q=je(n),Y=t.latitude!==0||t.longitude!==0;return{prefix:q,candidates:[{hash:n,name:t.name||"Local Node",latitude:Y?t.latitude:0,longitude:Y?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!l)return null;const v=je(l);if(n&&l===n&&t){const q=t.latitude!==0||t.longitude!==0;return{prefix:v,candidates:[{hash:l,name:t.name||"Local Node",latitude:q?t.latitude:0,longitude:q?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const p=a[l];if((p==null?void 0:p.latitude)&&(p==null?void 0:p.longitude)&&!(p.latitude===0&&p.longitude===0))return{prefix:v,candidates:[{hash:l,name:p.node_name||p.name||"Destination",latitude:p.latitude,longitude:p.longitude,probability:1,isLocal:!1,isDirectNeighbor:p.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const V=(p==null?void 0:p.node_name)||(p==null?void 0:p.name)||l.slice(0,8);return{prefix:v,candidates:[{hash:l,name:V,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[l,a,t,n]),M=m.useMemo(()=>Ia(s,a,t,n,r,c),[s,a,t,n,r,c]),o=m.useMemo(()=>{const f=[];b?f.push(b):d&&f.push(d),f.push(...M.hops),C&&f.push(C);const _=f.reduce((p,I)=>I.confidence===0?0:p*I.confidence,1),v=f.some(p=>p.candidates.some(I=>I.latitude!==0||I.longitude!==0));return{hops:f,overallConfidence:_,hasValidPath:v}},[b,d,M,C]),N=m.useMemo(()=>{const f=getComputedStyle(document.documentElement);return{success:f.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:f.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:f.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:f.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:f.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return o.hasValidPath?e.jsxs("div",{className:"h-full flex flex-col space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Path Confidence:"}),e.jsx("span",{className:Ua(o.overallConfidence),children:$a(o.overallConfidence)}),e.jsx("button",{className:"text-fg-muted hover:text-fg-secondary transition-colors",title:"Confidence is calculated based on how many known nodes match each path prefix. Multiple matches reduce confidence due to collision probability.",children:e.jsx(Jt,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-green"}),e.jsx("span",{className:"text-fg-muted",children:"Exact"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-indigo"}),e.jsx("span",{className:"text-fg-muted",children:"Multi"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-fg-muted"}),e.jsx("span",{className:"text-fg-muted",children:"Unknown"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(Va,{children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"h-full bg-elevated flex items-center justify-center text-fg-muted text-sm",children:"Loading map..."}),children:e.jsx(za,{resolvedPath:o,localNode:t,hubNodes:x,hoveredHopIndex:y,onHoverHop:k,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:o.hops.map((f,_)=>{var q,Y,z;const v=f.isSource===!0,p=f.isDestination===!0,I=y===_;let V;return v?V=`Source: ${((q=f.candidates[0])==null?void 0:q.name)||"Unknown"}`:p?V=`Destination: ${((Y=f.candidates[0])==null?void 0:Y.name)||"Unknown"}`:f.totalMatches===0?V="No matching nodes found":f.totalMatches===1?V=`Exact match: ${((z=f.candidates[0])==null?void 0:z.name)||"Unknown"}`:V=`${f.totalMatches} possible matches (${(f.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:H("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",I?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",v&&"border border-sys-green/30",p&&"border border-sys-blue/30"),title:V,onMouseEnter:()=>k(_),onMouseLeave:()=>k(null),children:[v&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),p&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:Oa(f.confidence,f.totalMatches,N),children:f.prefix}),!v&&!p&&f.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",f.totalMatches]}),!v&&!p&&f.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},_)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(Oe,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const Ke=16;function Qe(s){return s.match(/.{1,2}/g)||[]}function ye(s){return s!==null&&s.startsWith("payload:")}const _e={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` var(--depth-stroke-tl), var(--depth-stroke-br) `,selectionBorderWidth:2},ts={type:"tween",duration:.25,ease:[.25,.1,.25,1]};function Ga(s,a){return s?`inset 0 0 0 ${_e.selectionBorderWidth}px ${me[a]}`:_e.cardRestShadow}function Qa(s,a){return s?a:`color-mix(in srgb, ${a} ${_e.hexRestOpacity}%, transparent)`}function qa({segments:s,selectedSegment:a,onSegmentClick:t}){const[n,i]=m.useState(null),[l,r]=m.useState(null),c=s.some(u=>u.id!==void 0)&&t,x=[];for(const u of s){const y=Qe(u.hex);for(const k of y)x.push({byte:k.toUpperCase(),color:u.color,id:u.id})}const g=[];for(let u=0;u{const k=u.length{const o=M===u.length-1,N=k&&o,f=me[d],p=(C?n===C:l===d)||!!(C&&a===C);return e.jsx("span",{className:`w-[1.75rem] text-xs text-center py-0.5 font-mono select-text ${c?"cursor-pointer":""}`,style:{backgroundColor:Qa(p,f),color:p?"rgba(255,255,255,0.95)":f,transition:p?"none":"background-color 0.15s ease-out, color 0.15s ease-out",touchAction:"manipulation",...N?{borderRadius:"0 0.375rem 0.375rem 0"}:{}},onMouseEnter:()=>{C?i(C):r(d)},onMouseLeave:()=>{i(null),r(null)},onClick:()=>C&&(t==null?void 0:t(C)),onTouchStart:()=>{C?i(C):r(d)},onTouchEnd:()=>{i(null),r(null)},children:b},M)})},y)})})}function Wa({rawHex:s,hexSegments:a,selectedSegment:t,onSegmentClick:n}){const[i,l]=m.useState(!1),r=m.useCallback(async()=>{await ft(s.toUpperCase()),l(!0),setTimeout(()=>l(!1),2e3)},[s]);return e.jsxs("div",{className:"bg-inset radius-inner p-6 relative depth-stroke-inset",children:[e.jsx(qa,{segments:a,selectedSegment:t,onSegmentClick:n}),e.jsx("button",{onClick:r,className:"absolute bottom-3 right-3 flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-subtle-fill-hover hover:bg-subtle-fill-strong text-fg-muted hover:text-fg-secondary transition-all text-xs font-sans",title:"Copy raw packet hex",children:i?e.jsxs(e.Fragment,{children:[e.jsx(gt,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{className:"text-sys-green",children:"Copied"})]}):e.jsxs(e.Fragment,{children:[e.jsx(rs,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Copy"})]})})]})}function Ka(s,a){const t=[];let n=0;const i=a.slice(0,64);t.push({id:"payload:publicKey",title:"Public Key",color:"pink",hex:i,startByte:n,endByte:n+31,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:s.publicKey.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Ed25519 public key (32 bytes)"})]})}),n+=32;const l=a.slice(64,72);t.push({id:"payload:timestamp",title:"Timestamp",color:"orange",hex:l,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:l.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[s.timestamp," (",ie(s.timestamp),")"]})]})}),n+=4;const r=a.slice(72,200);t.push({id:"payload:signature",title:"Signature",color:"teal",hex:r,startByte:n,endByte:n+63,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:s.signature.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Ed25519 signature (64 bytes)"})]})}),n+=64;const c=a.slice(200,202);if(t.push({id:"payload:flags",title:"Flags",color:"blue",hex:c,startByte:n,endByte:n,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(J,{size:"standard",copy:!0,children:["0x",s.flags.toString(16).padStart(2,"0").toUpperCase()]}),e.jsx("p",{className:"text-xs text-fg-primary mt-1",children:s.flagsDescription}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Node Type: ",s.nodeType]})]})}),n+=1,s.latitude!==void 0){const x=a.slice(n*2,n*2+8);t.push({id:"payload:latitude",title:"Latitude",color:"green",hex:x,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:x.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[s.latitude.toFixed(6),"°"]})]})}),n+=4}if(s.longitude!==void 0){const x=a.slice(n*2,n*2+8);t.push({id:"payload:longitude",title:"Longitude",color:"indigo",hex:x,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:x.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[s.longitude.toFixed(6),"°"]})]})}),n+=4}if(s.name){const x=a.slice(n*2),g=x.length/2;t.push({id:"payload:name",title:"Name",color:"amber",hex:x,startByte:n,endByte:n+g-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:x.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:['"',s.name,'"']})]})})}return t}function Ya(s,a){return[{id:"payload:crc",title:"CRC",color:"green",hex:a.slice(0,8),startByte:0,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(J,{size:"standard",copy:!0,children:["0x",s.crc]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"CRC32 of acknowledged packet"})]})}]}function Xa(s,a){const t=[];t.push({id:"payload:channelHash",title:"Channel Hash",color:"blue",hex:a.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(J,{size:"standard",copy:!0,children:["0x",s.channelHash]}),s.channelName&&e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:["Channel: ",s.channelName]})]})}),s.macHex&&t.push({id:"payload:mac",title:"MAC",color:"indigo",hex:a.slice(2,6),startByte:1,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:s.macHex.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Truncated HMAC-SHA256"})]})});const n=a.slice(6);return n&&t.push({id:"payload:ciphertext",title:s.decrypted?"Message":"Ciphertext",color:s.decrypted?"green":"zinc",hex:n,startByte:3,endByte:3+n.length/2-1,decoded:s.decrypted?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-fg-primary",children:['"',s.text,'"']}),s.senderName&&e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:["From: ",s.senderName]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:n.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"AES-128-ECB encrypted"})]})}),t}function Za(s,a){const t=[];t.push({id:"payload:channelHash",title:"Channel Hash",color:"blue",hex:a.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(J,{size:"standard",copy:!0,children:["0x",s.channelHash]}),s.channelName&&e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:["Channel: ",s.channelName]})]})}),s.macHex&&t.push({id:"payload:mac",title:"MAC",color:"indigo",hex:a.slice(2,6),startByte:1,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:s.macHex.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Truncated HMAC-SHA256"})]})});const n=a.slice(6);return n&&t.push({id:"payload:ciphertext",title:s.decrypted?"Decrypted Data":"Encrypted Data",color:s.decrypted?"green":"zinc",hex:n,startByte:3,endByte:3+n.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:(s.decryptedHex||n).toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[s.dataLength," bytes",s.decrypted?"":" (AES-128-ECB encrypted)"]})]})}),t}function Ja(s,a){const t=[],n=parseInt(a.slice(0,2),16),i=isNaN(n)?{hashSize:1,hopCount:s.pathLength}:jt(n),l=i.hopCount*i.hashSize;if(t.push({id:"payload:pathLength",title:"Path Length",color:"blue",hex:a.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",children:i.hopCount}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[i.hopCount," hop",i.hopCount!==1?"s":"",i.hashSize>1&&` × ${i.hashSize}B hashes`]})]})}),s.path.length>0){const r=a.slice(2,2+l*2);t.push({id:"payload:path",title:"Path Hops",color:"amber",hex:r,startByte:1,endByte:l,decoded:e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:s.path.map((c,x)=>e.jsxs("span",{className:"flex items-center gap-1",children:[x>0&&e.jsx(he,{className:"w-3 h-3 text-fg-muted"}),e.jsx(B,{color:"amber",className:"font-mono",children:c})]},x))})})})}if(s.extraType!=null){const r=1+l;t.push({id:"payload:extraType",title:"Extra Type",color:"indigo",hex:a.slice(r*2,r*2+2),startByte:r,endByte:r,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",children:s.extraTypeName??`0x${s.extraType.toString(16).padStart(2,"0")}`}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Bundled payload type"})]})})}if(s.extraData){const r=1+l+1,c=a.slice(r*2);c&&t.push({id:"payload:extraData",title:"Extra Data",color:"indigo",hex:c,startByte:r,endByte:r+c.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:c.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[c.length/2," bytes"]})]})})}return t}function en(s,a){const t=[];t.push({id:"payload:crc",title:"Trace Tag",color:"blue",hex:a.slice(0,8),startByte:0,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(J,{size:"standard",copy:!0,children:["0x",s.traceTag]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique trace request identifier"})]})}),t.push({id:"payload:mac",title:"Auth Code",color:"indigo",hex:a.slice(8,16),startByte:4,endByte:7,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:s.authCode}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Authentication/verification code"})]})});const n=1<<(s.flags&3);t.push({id:"payload:flags",title:"Flags",color:"amber",hex:a.slice(16,18),startByte:8,endByte:8,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(J,{size:"standard",copy:!0,children:["0x",s.flags.toString(16).toUpperCase().padStart(2,"0")]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:s.flags===0?"No flags set (1B hashes)":`Bits 0-1: ${n}B per hash • ${s.flags.toString(2).padStart(8,"0")}b`})]})});const i=a.slice(18);return i&&t.push({id:"payload:path",title:"Target Path",color:"indigo",hex:i,startByte:9,endByte:9+i.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:s.pathHashes.map((l,r)=>{const c=s.snrValues[r],x=c!==void 0?Kt(c):"zinc";return e.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&e.jsx(he,{className:"w-3 h-3 text-fg-muted"}),e.jsx(B,{color:"indigo",className:"font-mono",children:l}),c!==void 0&&e.jsxs(B,{color:x,className:"font-mono",children:[c>=0?"+":"",Number.isInteger(c)?c:c.toFixed(1),"dB"]})]},r)})}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[s.pathHashes.length," target ",s.pathHashes.length===1?"hop":"hops",n>1&&` × ${n}B hashes`,s.snrValues.length>0&&` • ${s.snrValues.length} SNR ${s.snrValues.length===1?"value":"values"} collected`,s.isComplete&&" • ✓ Complete"]})]})}),t}function sn(s,a){const t=[];t.push({id:"payload:msgId",title:"Message ID",color:"blue",hex:a.slice(0,4),startByte:0,endByte:1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:s.messageId.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique message identifier"})]})}),t.push({id:"payload:partNum",title:"Part Number",color:"amber",hex:a.slice(4,6),startByte:2,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:s.partNumber}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"0-indexed part number"})]})}),t.push({id:"payload:totalParts",title:"Total Parts",color:"orange",hex:a.slice(6,8),startByte:3,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(J,{size:"standard",copy:!0,children:s.totalParts}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:["Part ",s.partNumber+1," of ",s.totalParts]})]})});const n=a.slice(8);return n&&t.push({id:"payload:partData",title:"Part Data",color:"cyan",hex:n,startByte:4,endByte:4+n.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:n.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[n.length/2," bytes"]})]})}),t}function tn(s,a){switch(s.type){case"advert":return Ka(s,a);case"ack":return Ya(s,a);case"grp_txt":return Xa(s,a);case"grp_data":return Za(s,a);case"path":return Ja(s,a);case"trace":return en(s,a);case"multipart":return sn(s,a);default:return[{id:"payload:ciphertext",title:"Raw Data",color:"zinc",hex:a,startByte:0,endByte:a.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:a.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[a.length/2," bytes"]})]})}]}}function an(s){return s.map(a=>({id:a.id,hex:a.hex,color:a.color}))}function nn({bits:s,field:a,value:t,binary:n}){const i=()=>{if(a==="Payload Type"){const l=Be[t]||"zinc";return e.jsx(B,{color:l,children:t})}if(a==="Route Type"){const l=Ie[t]||"zinc";return e.jsx(B,{color:l,children:t})}return e.jsx("span",{className:"text-sm text-fg-primary",children:t})};return e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 text-xs text-fg-muted tabular-nums",children:s}),e.jsx("td",{className:"py-1.5 text-sm text-fg-secondary",children:a}),e.jsx("td",{className:"py-1.5",children:i()}),e.jsx("td",{className:"py-1.5 type-data-xs text-sys-cyan",children:n})]})}function js({id:s,title:a,color:t,hexBytes:n,startByte:i,endByte:l,isSelected:r,children:c}){const x=n?Qe(n):[];return e.jsxs(ce.div,{layout:"position",layoutId:s,transition:ts,className:"w-full min-w-0 overflow-hidden radius-inner p-4 sm:p-5 space-y-4",style:{backgroundColor:_e.cardRestBg,boxShadow:Ga(r,t)},children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 min-w-0",children:[e.jsx(B,{color:t,children:a}),x.length>0&&x.length<=16&&x.map((g,u)=>e.jsx(B,{color:t,className:"font-mono",children:g.toUpperCase()},u))]}),e.jsxs("span",{className:"type-data-xs text-fg-muted flex-shrink-0",children:["Bytes ",i,"-",l]})]}),e.jsx("div",{className:"min-w-0 overflow-hidden",children:c})]})}function rn({advert:s,timestamp:a}){const t=a?ie(a):ie(s.timestamp);return e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"rounded-2xl overflow-hidden bg-sys-indigo/10",style:{backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[e.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shadow-lg",style:{background:"linear-gradient(135deg, var(--sys-indigo) 0%, var(--sys-blue) 100%)"},children:e.jsx(oe,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-semibold text-fg-primary font-sans truncate leading-tight",children:s.name||"Unknown Node"}),e.jsx("p",{className:"text-sm text-fg-muted font-sans mt-0.5",children:s.nodeType})]})]}),e.jsx("div",{className:"mx-4 border-t border-edge-subtle"}),e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[s.latitude!==void 0&&s.longitude!==void 0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Oe,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-fg-secondary font-mono",children:[s.latitude.toFixed(5),"°, ",s.longitude.toFixed(5),"°"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:t})]})]})]})})}function ln({decoded:s,timestamp:a}){const t=a?ie(a):"Unknown";return e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"rounded-2xl overflow-hidden bg-sys-teal/10",style:{backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[e.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shadow-lg",style:{background:"linear-gradient(135deg, var(--sys-teal) 0%, var(--sys-cyan) 100%)"},children:e.jsx(aa,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-semibold text-fg-primary font-sans truncate leading-tight",children:s.channelName||"Channel Data"}),e.jsxs("p",{className:"text-sm text-fg-muted font-sans mt-0.5",children:[s.dataLength," bytes • ",s.decrypted?"Decrypted":"Encrypted"]})]})]}),e.jsx("div",{className:"mx-4 border-t border-edge-subtle"}),e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Os,{className:"w-4 h-4 text-sys-teal flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-fg-secondary font-sans",children:["Channel: ",e.jsxs("span",{className:"font-mono",children:["0x",s.channelHash]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{className:"w-4 h-4 text-sys-teal flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:t})]}),s.decrypted&&s.decryptedHex&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle",children:[e.jsx("p",{className:"type-micro text-fg-muted mb-1 font-sans",children:"Decrypted Data"}),e.jsx("div",{className:"max-w-full overflow-x-auto",children:e.jsx(J,{size:"compact",copy:!0,className:"inline-block",children:e.jsx("span",{className:"break-all text-xs",children:s.decryptedHex.toUpperCase()})})})]})]})]})})}function cn({decoded:s,timestamp:a,isLoading:t=!1,onDecrypted:n}){const i=a?ie(a):"Unknown",[l,r]=m.useState(""),[c,x]=m.useState(!1),[g,u]=m.useState(null),[y,k]=m.useState(!1),b=m.useCallback(async()=>{if(!(!l.trim()||!s.ciphertextHex||!s.macHex)){x(!0),u(null);try{const d=parseInt(s.channelHash,16),C=hs(s.macHex),M=hs(s.ciphertextHex),o=await Nt(l.trim(),d,C,M);if(o.success){const N=o.result.plaintext,f=new TextDecoder("utf-8",{fatal:!1}).decode(N.slice(5)),_=f.indexOf(": "),v={...s,channelName:o.result.channelName,decrypted:!0,timestamp:N[0]|N[1]<<8|N[2]<<16|N[3]<<24,flags:N[4],senderName:_>0?f.slice(0,_):void 0,text:_>0?f.slice(_+2):f};n==null||n(v),r(""),k(!1)}else u(o.error)}catch(d){u(d instanceof Error?d.message:"Unknown error")}finally{x(!1)}}},[l,s,n]);return t?e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"rounded-xl p-4 sm:p-5",style:{backgroundColor:"color-mix(in srgb, var(--elevated) 60%, var(--body))",boxShadow:` diff --git a/frontend/dist/assets/PacketObservatory-BbrNfYq0.js b/frontend/dist/assets/PacketObservatory-CLDnc4JJ.js similarity index 99% rename from frontend/dist/assets/PacketObservatory-BbrNfYq0.js rename to frontend/dist/assets/PacketObservatory-CLDnc4JJ.js index 46a0150d..1cd32ea9 100644 --- a/frontend/dist/assets/PacketObservatory-BbrNfYq0.js +++ b/frontend/dist/assets/PacketObservatory-CLDnc4JJ.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-nFeiBWWq.js","assets/index-Bcr7MabU.js","assets/node-types-BFsObq9k.js","assets/index-7uzBcJ1E.css"])))=>i.map(i=>d[i]); -import{co as O,r as T,eU as Fe,eV as Ee,eW as Oe,eX as ze,bW as Be,eY as Ie,eZ as Ge,e_ as Ke,e$ as Ve,bV as Ne,_ as ue,f0 as Ue,f1 as we,b$ as pe,j as e,f2 as G,f3 as K,f4 as V,eu as xe,f5 as qe,V as M,ca as We,cl as Ce,cv as Ye,f6 as Ze,f7 as Xe,f8 as Qe,f9 as Je,fa as et,fb as J,fc as tt,fd as st,fe as nt,ff as he,at as me,ao as Se,bQ as rt,t as at,fg as lt,Q as ot,a6 as ct,fh as it,P as dt,dL as ut}from"./index-Bcr7MabU.js";import{usePipelineStore as Y}from"./usePipelineStore-nFeiBWWq.js";import{e as Te,p as pt,A as I,S as U,a as se,c as E,K as i,H as A,B as xt,R as F,T as d,P as re,d as ht,f as S,C as _e,s as ee,h as mt}from"./primitives-D7nwWFFF.js";import{m as ke,i as gt}from"./node-types-BFsObq9k.js";import{a as ft}from"./payload-detail-jRk0k5AL.js";function bt(t){const s=t.type??t.payload_type,r=t.duplicates??[],c=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const x=[t.rssi,...r.map(g=>g.rssi).filter(g=>g!=null)],m=[t.snr,...r.map(g=>g.snr).filter(g=>g!=null)];x.length>1&&(n=[Math.min(...x),Math.max(...x)]),m.length>1&&(l=[Math.min(...m),Math.max(...m)])}const o=s===O.TRACE;return{isDuplicate:c,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:o}}function yt(t,s,r){const c={traceTag:null,siblingCount:0,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:[],thisPathLen:0,minPathLen:0,firstHopPrefix:null};let a=t._traceTag;if(!a&&t.payload&&(a=Te(t.payload)),!a)return{...c,evidence:["no traceTag — cannot correlate"]};const n=s.get(a)??[],l=N=>N.path_length!=null?N.path_length:Array.isArray(N.original_path)?N.original_path.length:0,o=l(t),x=n.length>0?Math.min(...n.map(l)):o,m=t.payload?t.payload.slice(18):"",g=m.length>=2?m.slice(0,2).toUpperCase():null,u=[];if(u.push(`traceTag: ${a}`),u.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return u.push("packet_origin = tx_local → we initiated this trace"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return u.push(`sibling (hash ${v.packet_hash}) has packet_origin = tx_local`),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),g){if(u.push(`first hop in target path: ${g}`),o===0)return u.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),u.push("initiator is a direct RF neighbor"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"min_path_len",confidence:"speculative",inferredSrc:null,inferredName:null,evidence:[...u,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:o,minPathLen:x,firstHopPrefix:g};const f=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===g);if(f.length===1){const[k,$]=f[0],h=$.name||$.node_name||null;return u.push(`first hop ${g} → unique neighbor: ${h??k}`),u.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:g,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}else f.length>1?u.push(`first hop ${g} matches ${f.length} neighbors (ambiguous)`):u.push(`first hop ${g} is not a known neighbor`)}return u.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-nFeiBWWq.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-Bcr7MabU.js").then(t=>t.hq),__vite__mapDeps([1,3])).then(t=>{ce=t})},0);const He={advertSender:null,advertNodeType:null,advertFlags:null,advertHasLocation:null,advertHasName:null,advertName:null,advertLatitude:null,advertLongitude:null,channelHash:null,byteLength:void 0,hopCount:0,isZeroHop:!0,preComputed:!1};function jt(t,s){const r=t.type??t.payload_type,c=Ne(r),a=Be(t.route),n=r===O.ADVERT,l=r===O.TRACE,o=r===O.PATH,x=r===O.GRP_TXT||r===O.GRP_DATA,m=Ie(t.snr,t.rssi),g=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ve(t.route),f=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${f}`:f,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=gt(r),p=s.advertNodeType!=null?ke(s.advertNodeType):"unknown",_=y!=="unknown"?y:p,H=t.packet_origin??"rx",C=Math.floor(Date.now()/1e3)-t.timestamp,D=C<10?"live":C<300?"recent":C<3600?"warm":C<86400?"stale":"historic",L=t.path_length??(Array.isArray(t.original_path)?t.original_path.length:void 0),P=Array.isArray(t.original_path)&&t.original_path.length>0,R=L??0,b=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),w=bt(t);return{pType:r,payloadTypeName:c,routeTypeName:a,isAdvert:n,isTrace:l,isPath:o,isGrp:x,signalClass:g,routeClass:k,isFlood:u,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:$,inferredType:y,advertType:p,effectiveType:_,origin:H,age:D,pathLen:L,pathAvail:P,pathHopCount:R,byteLen:b,dupeAnalysis:w}}function vt(t){var f,k,$,h,y,p;const s=ft(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:c}=s;if(r.length<2||!ne||!ce)return null;const a=ne.usePipelineStore.getState().srcHashResolverMap,n=ne.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,o=ce.useStore.getState().stats,x=(o==null?void 0:o.neighbors)??{},m=o==null?void 0:o.local_hash,g=(k=(f=o==null?void 0:o.config)==null?void 0:f.repeater)==null?void 0:k.latitude,u=(h=($=o==null?void 0:o.config)==null?void 0:$.repeater)==null?void 0:h.longitude,v=Object.keys(x).length>0?Ue([],x,m,g,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=ge(H,_,L,a,v),R=[H,..._+20?N:null}function ge(t,s,r,c,a){if(s===0){const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.8};if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}}else{if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function Nt(t){var l;const s=t.raw_packet;if(!s||s.length<2)return null;const r=s.replace(/\s/g,""),c=Math.floor(r.length/2),a=((l=r.match(/.{1,2}/g))==null?void 0:l.join(" "))??"";let n="";for(let o=0;o=32&&x<=126?String.fromCharCode(x):"·"}return{hexBytes:a,utf8:n,byteCount:c}}function wt(t){const s=new Map;let r=0,c="";for(const a of t){if((a.type??a.payload_type)!==O.TRACE)continue;r++,c=a.packet_hash;const l=a._traceTag??(a.payload?Te(a.payload):null);if(!l)continue;let o=s.get(l);o||(o=[],s.set(l,o)),o.push(a)}return{index:s,fingerprint:`${r}:${c}`}}function Ct(t,s,r){const c=T.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=T.useMemo(()=>t?Nt(t):null,[t]),n=T.useMemo(()=>{if(!s||s.length<4)return c.current.parse=0,c.current.decode=0,null;const h=performance.now(),y=pt(s),p=performance.now()-h;return y?(c.current.parse=p,c.current.decode=0,{protocolPacket:y.packet,display:{headerFields:y.headerFields,transportCodesHex:y.transportCodesHex,pathLengthHex:y.pathLengthHex,pathDataHex:y.pathDataHex,payloadHex:y.payloadHex,payloadByteOffset:y.payloadStartByte,pathByteOffset:y.pathByteOffset,pathLenByteOffset:y.pathLenByteOffset},decoded:y.decoded,error:null}):(c.current.parse=p,c.current.decode=0,{protocolPacket:null,display:null,decoded:null,error:"Packet.fromHex() returned failure"})},[s]),l=T.useMemo(()=>{if(!t)return c.current.enrich=0,He;const h=performance.now();if(t._advertSender!==void 0)return c.current.enrich=performance.now()-h,{advertSender:t._advertSender??null,advertNodeType:t._advertNodeType??null,advertFlags:t._advertFlags??null,advertHasLocation:t._advertHasLocation??null,advertHasName:t._advertHasName??null,advertName:t._advertName??null,advertLatitude:t._advertLatitude??null,advertLongitude:t._advertLongitude??null,channelHash:t._channelHash??null,byteLength:t._byteLength,hopCount:t._hopCount??0,isZeroHop:t._isZeroHop??!0,preComputed:!0};const y=t.type??t.payload_type,p=Fe(s,y),_=Ee(s,y),H=Oe(s,t),C=ze(t);return c.current.enrich=performance.now()-h,{...p,channelHash:_,byteLength:H,...C,preComputed:!1}},[t,s]),o=T.useRef({fingerprint:"",index:new Map}),x=T.useMemo(()=>{const h=performance.now(),{index:y,fingerprint:p}=wt(r);return c.current.traceIndex=performance.now()-h,p===o.current.fingerprint?o.current.index:(o.current={fingerprint:p,index:y},y)},[r]),m=T.useMemo(()=>{const h=c.current;return{parse:h.parse,decode:h.decode,enrich:h.enrich,traceIndex:h.traceIndex,total:h.parse+h.decode+h.enrich+h.traceIndex}},[n,l,x]);if(!t)return null;const g=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",u=(n==null?void 0:n.protocolPacket)??null,v=u?u.payloadVersion:null,N=v===0,f=v===1,k=jt(t,l);let $=null;return k.isTrace&&($=vt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:g,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:f,enrichment:l,traceTagIndex:x,analysis:k,traceHopDetail:$,timing:m}}function ae({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:`w-16 shrink-0 font-medium ${l.active?"text-fg-primary":"text-fg-muted"}`,children:l.label}),l.detail&&e.jsx("span",{className:l.active?"text-fg-primary/70":"text-fg-muted",children:l.detail})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}function St({tokens:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-muted shrink-0",children:l.fn}),e.jsxs("span",{className:l.active?"text-fg-primary":"text-fg-muted",children:["(",l.value??"",")"]})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}const Tt={0:"border-l-sys-green",1:"border-l-sys-blue",2:"border-l-sys-teal",3:"border-l-sys-purple"};function le({stage:t,name:s,fn:r,verdict:c,timeMs:a,skipped:n,skipReason:l,children:o}){const x=Tt[t]??"";return e.jsx(e.Fragment,{children:e.jsx(G,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${x}`,children:[e.jsxs(K,{className:"px-3 py-2 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-sys-blue shrink-0",children:t}),e.jsx("span",{className:"font-mono text-xs font-medium text-fg-primary truncate",children:s}),r&&!c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-zinc-500/20 text-fg-muted",children:"N/A"}),a!=null&&!n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})]})]}),e.jsx(V,{children:e.jsx("div",{className:"px-3 pb-3 font-mono text-xs",children:n?e.jsx("p",{className:"text-fg-muted italic",children:l??"Not applicable for this packet type"}):o})})]})})})}function _t(t,s){return s?"manual":t._stripped?"bulk-tier":qe.isConnected()?"ws-push":"rest-poll"}const kt={connected:"green",degraded:"amber",offline:"red"};function Ht({packet:t,isSynthetic:s}){const r=xe(g=>g.wsState),c=xe(g=>g.health),a=_t(t,s),l=!!t._stripped?"WARM":"HOT",o=[{label:"ws-push",detail:"wsConnected && onPacket()",active:a==="ws-push",color:"green"},{label:"rest-poll",detail:"!wsConnected, 3s interval",active:a==="rest-poll",color:"amber"},{label:"catchup",detail:"wsReconnected, delta > 50",active:a==="catchup",color:"amber"},{label:"bulk-tier",detail:"user extends time range → gzip",active:a==="bulk-tier",color:"blue"},{label:"manual",detail:"hex input — no transport",active:a==="manual",color:"zinc"}],x=[{fn:"transport",value:a,group:"transport",color:a==="ws-push"?"green":a==="bulk-tier"?"blue":"amber"},{fn:"tier",value:l,group:"transport",color:"blue"},{fn:"wsState",value:r,group:"transport",color:r==="connected"?"green":"amber"},{fn:"health",value:c,group:"transport",color:kt[c]}],m=s?"manual hex input":`${a} (${c})`;return e.jsx(le,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:m,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(U,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(ae,{options:o,nextFn:"ingest()"}),e.jsx(se,{tokens:x})]})})})}function q({start:t,end:s}){const r=s!=null&&s!==t?`[${t}..${s}]`:`[${t}]`;return e.jsx("span",{className:"text-fg-muted text-[9px] font-mono mr-1 select-none",children:r})}const $t={advert:"decodeAdvert()",ack:"decodeAck()",path:"decodePath()",trace:"decodeTraceWithSnr()",txt_msg:"decodeTextMessage()",grp_txt:"decodeGroupText()",grp_data:"decodeGroupData()",multipart:"decodeMultipart()",control:"decodeControl()",req:"decodeRequest()",response:"decodeResponse()",anon_req:"decodeAnonReq()",generic:"decodeGeneric()"};function Dt({rawHex:t,display:s,protocolPacket:r,parseError:c,parseTimeMs:a,payloadVersion:n,isV1:l,isV2:o}){return e.jsx("dl",{className:"space-y-0.5",children:s&&r&&t?e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse — Packet.fromHex()"}),a>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})}),e.jsxs(i,{label:"header byte",children:[e.jsx(q,{start:0}),e.jsx(A,{value:t.slice(0,2)})," ",e.jsx(xt,{value:parseInt(t.slice(0,2),16)})]}),s.headerFields.map(x=>e.jsx(i,{label:` ${x.field}`,children:e.jsx(F,{raw:e.jsxs("span",{className:"text-[10px]",children:["bits[",x.bits,"] = ",x.binary]}),children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:x.value})})},x.field)),e.jsx(i,{label:" version",children:n!=null?e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(d,{fn:"payloadVer",value:`${n}`,color:"amber"}),e.jsx(M,{color:l?"green":o?"blue":"zinc",children:l?"v1":o?"v2":`v${n}`}),l&&e.jsx("span",{className:"text-fg-muted text-[10px]",children:"1-byte hashes, 2-byte MAC"}),o&&e.jsx("span",{className:"text-sys-blue text-[10px]",children:"2-byte hashes, 4-byte MAC (speculative)"})]}):e.jsx("span",{className:"text-fg-muted",children:"unknown"})}),e.jsx(E,{title:"Wire Framing"}),e.jsx(i,{label:"transportCodes",children:s.transportCodesHex?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:1,end:4}),e.jsx(d,{fn:"transport",value:s.transportCodesHex,color:"amber"})]}):e.jsx("span",{className:"text-fg-muted",children:"N/A (non-transport route)"})}),e.jsx(i,{label:"pathLen",children:e.jsx(F,{raw:e.jsxs(e.Fragment,{children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(A,{value:s.pathLengthHex})]}),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(d,{fn:"pathLen",value:`${r.pathLen} hop${r.pathLen!==1?"s":""}`,color:"amber"})]})})}),e.jsx(i,{label:"path",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.pathLen>0&&e.jsx(q,{start:s.pathByteOffset,end:s.pathByteOffset+r.pathLen-1}),e.jsx(re,{hops:r.pathHexArray,hexPrefix:s.pathDataHex||void 0})]})}),e.jsx(i,{label:"payloadLen",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.payloadByteOffset,end:s.payloadByteOffset+s.payloadHex.length/2-1}),e.jsx(d,{fn:"payloadLen",value:`${s.payloadHex.length/2} bytes`,color:"amber"})]})}),e.jsx(i,{label:"payloadHex",children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber break-all",children:s.payloadHex})})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse"}),e.jsxs(i,{label:"result",children:[e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:"Skipped"}),e.jsx("span",{className:"ml-1 text-fg-muted",children:c??"No raw_packet (warm-tier)"})]})]})})}function Lt({decoded:t,packet:s}){if(!t)return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode"}),e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:"No decoded payload"})]});const r=$t[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode — decodePayload()"}),e.jsx(U,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(E,{}),e.jsx(Pt,{decoded:t,packet:s})]})})]})}function Pt({decoded:t,packet:s}){var r;switch(t.type){case"advert":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"publicKey",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px] break-all",children:t.publicKey}),children:e.jsx(d,{fn:"publicKey",value:t.publicKey,color:"green"})})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(F,{raw:e.jsx(A,{value:t.flags}),children:e.jsx(d,{fn:"flags",value:t.flagsDescription,color:"green"})})}),e.jsx(i,{label:"nodeType",children:e.jsx(d,{fn:"nodeType",value:t.nodeType,color:"green"})}),t.latitude!=null&&e.jsx(i,{label:"latitude",children:e.jsx(d,{fn:"lat",value:t.latitude.toFixed(6),color:"green"})}),t.longitude!=null&&e.jsx(i,{label:"longitude",children:e.jsx(d,{fn:"lon",value:t.longitude.toFixed(6),color:"green"})}),t.name&&e.jsx(i,{label:"name",children:e.jsx(d,{fn:"name",value:t.name,color:"green"})})]});case"ack":return e.jsx(i,{label:"crc",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const c=s!=null&&s.src_hash?s.src_hash.replace(/^0x/i,"").slice(0,2).toUpperCase():null;return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"traceTag",children:e.jsx(d,{fn:"traceTag",value:t.traceTag,color:"green"})}),e.jsx(i,{label:"authCode",children:e.jsx(d,{fn:"authCode",value:String(t.authCode),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(A,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(re,{hops:t.pathHashes.map(a=>a.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),e.jsx(i,{label:"complete",children:t.isComplete?e.jsxs("span",{className:"text-sys-green",children:["✓ all ",t.pathHashes.length," hops reported SNR"]}):e.jsxs("span",{className:"text-sys-amber",children:["✗ ",t.snrValues.length,"/",t.pathHashes.length," hops reported"]})}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1 text-[10px]",children:"Directional Edge SNR — per-hop link quality"}),t.snrValues.length===0?e.jsx("p",{className:"text-fg-muted italic text-[11px] ml-2",children:"No SNR values in path field"}):e.jsx("div",{className:"space-y-0.5 ml-2",children:t.snrValues.map((a,n)=>{var g,u,v,N,f;const l=((g=t.pathHashes[n])==null?void 0:g.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(f=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:f.spreading_factor,m=we(a,x);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted w-3 text-right",children:n}),e.jsx("span",{className:"text-fg-primary",children:o}),e.jsx("span",{className:"text-fg-muted",children:"→"}),e.jsx("span",{className:"text-fg-primary",children:l}),e.jsx("span",{className:"text-fg-muted",children:"@"}),e.jsxs("span",{className:"font-bold text-sys-green",children:[a>0?"+":"",a.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:m})]},n)})})]})]})}case"path":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"pathLength",children:e.jsx(d,{fn:"pathLength",value:String(t.pathLength),color:"green"})}),e.jsx(i,{label:"path",children:t.path&&t.path.length>0?e.jsx(re,{hops:t.path.map(c=>c.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),t.extraType!=null&&e.jsx(i,{label:"extraType",children:e.jsx(d,{fn:"extraType",value:t.extraTypeName??String(t.extraType),color:"purple"})}),t.extraData&&e.jsxs(i,{label:"extraData",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.extraData}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.extraData.length/2,"B)"]})]})]});case"txt_msg":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),e.jsx(i,{label:"encrypted",children:e.jsx(d,{fn:"encrypted",value:String(t.encrypted),color:"green"})})]});case"grp_txt":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),t.channelName&&e.jsx(i,{label:"channelName",children:e.jsx(d,{fn:"channel",value:t.channelName,color:"green"})}),e.jsx(i,{label:"decrypted",children:e.jsx(d,{fn:"decrypted",value:String(t.decrypted),color:"green"})}),t.text&&e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),t.senderName&&e.jsx(i,{label:"senderName",children:e.jsx(d,{fn:"sender",value:t.senderName,color:"green"})}),t.macCorrupted&&e.jsx(i,{label:"macCorrupted",children:e.jsx(d,{fn:"macCorrupted",value:"true",color:"green"})})]});case"grp_data":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),e.jsx(i,{label:"dataLength",children:t.dataLength}),e.jsx(i,{label:"decrypted",children:String(t.decrypted)})]});case"multipart":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"messageId",children:t.messageId}),e.jsxs(i,{label:"part",children:[t.partNumber+1," / ",t.totalParts]})]});case"control":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"controlType",children:e.jsx(F,{raw:e.jsx(A,{value:t.controlType}),children:e.jsx(d,{fn:"controlType",value:t.subtypeName,color:"green"})})}),e.jsx(i,{label:"subtype",children:e.jsx(d,{fn:"subtype",value:`0x${t.subtype.toString(16).padStart(2,"0")}`,color:"green"})}),t.nodeTypeName&&e.jsxs(i,{label:"nodeType",children:[e.jsx(d,{fn:"nodeType",value:t.nodeTypeName,color:"green"}),e.jsxs("span",{className:"text-fg-muted text-[10px] ml-1",children:["(flags & 0x0F = 0x",(r=t.nodeType)==null?void 0:r.toString(16).padStart(2,"0"),")"]})]}),t.snrDb!=null&&e.jsxs(i,{label:"snr",children:[e.jsxs("span",{className:"font-bold text-sys-green",children:[t.snrDb>0?"+":"",t.snrDb.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:t.snrDb>=5?"strong":t.snrDb>=0?"fair":"weak"})]}),t.tag&&e.jsx(i,{label:"tag",children:e.jsx(d,{fn:"tag",value:t.tag,color:"green"})}),t.publicKey&&e.jsxs(i,{label:"publicKey",children:[e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.publicKey}),e.jsx(M,{color:t.publicKeyFull?"green":"amber",children:t.publicKeyFull?"32B full":`${t.publicKey.length/2}B prefix`})]}),t.typeFilter!=null&&e.jsx(i,{label:"typeFilter",children:e.jsx(F,{raw:e.jsx(A,{value:t.typeFilter}),children:e.jsx(d,{fn:"typeFilter",value:t.typeFilterDescription??"none",color:"green"})})}),t.prefixOnly!=null&&e.jsx(i,{label:"prefixOnly",children:e.jsx(d,{fn:"prefixOnly",value:String(t.prefixOnly),color:"green"})}),t.since!=null&&e.jsx(i,{label:"since",children:e.jsx(d,{fn:"since",value:t.since===0?"all (0)":String(t.since),color:"green"})}),!t.nodeTypeName&&t.typeFilter==null&&t.dataLength>0&&e.jsxs(i,{label:"data",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.dataHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.dataLength,"B)"]})]})]});case"req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"response":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"anon_req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"senderPubKey",children:e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.senderPublicKey})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"generic":return e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"payloadType",children:[e.jsx(ht,{value:t.payloadType})," (",t.payloadTypeName,")"]}),e.jsx(i,{label:"length",children:t.length}),e.jsx(i,{label:"rawHex",children:e.jsx("span",{className:"break-all",children:t.rawHex})})]});default:return e.jsx("p",{className:"text-fg-muted",children:"Unknown decoded type"})}}function Mt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,c=r===Ze||r===Xe,a=T.useMemo(()=>{if(!c||!t)return null;const p=t.payload;return p.length<4?null:{channelHash:p[0],mac:p.slice(1,3),ciphertext:p.slice(3)}},[t,c]),[n,l]=T.useState("pending"),[o,x]=T.useState([]),[m,g]=T.useState(0);T.useEffect(()=>{if(!a){l(null);return}let p=!1;return(async()=>{const H=performance.now(),C=await Qe(a.channelHash,a.mac,a.ciphertext);p||(l(C),g(performance.now()-H));const D=await Je(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,f]=T.useState(null),[k,$]=T.useState(!1),h=T.useCallback(async()=>{if(!(!a||!u.trim())){$(!0);try{const p=await We(u.trim(),a.channelHash,a.mac,a.ciphertext);if(p.success){const _=new TextDecoder("utf-8",{fatal:!1}).decode(p.result.plaintext.slice(5));f({success:!0,text:_})}else f({success:!1,error:p.error})}catch(p){f({success:!1,error:String(p)})}finally{$(!1)}}},[a,u]),y=Ce(s);return!c||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"C. Decrypt — tryDecryptGroupMessage()"}),m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:m<1?`${(m*1e3).toFixed(0)}µs`:`${m.toFixed(2)}ms`})}),e.jsx(U,{prefix:"tryDecryptGroupMessage",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"channelHash",children:e.jsx(d,{fn:"channelHash",value:`0x${a.channelHash.toString(16).toUpperCase().padStart(2,"0")}`,color:"teal"})}),e.jsx(i,{label:"mac",children:e.jsx(d,{fn:"mac",value:Array.from(a.mac).map(p=>p.toString(16).padStart(2,"0")).join(""),color:"teal"})}),e.jsx(i,{label:"cipherLen",children:e.jsx(d,{fn:"cipherLen",value:`${a.ciphertext.length}B`,color:"teal"})}),e.jsx(i,{label:"candidates",children:e.jsx(d,{fn:"candidates",value:o.length>0?`${o.length} names`:"0",color:o.length>0?"teal":"zinc"})}),o.length>0&&e.jsxs("details",{className:"mt-1",children:[e.jsx("summary",{className:"text-fg-muted cursor-pointer hover:text-fg-primary text-[10px]",children:"show candidate names"}),e.jsx("div",{className:"mt-1 text-[10px] text-fg-muted break-all max-h-24 overflow-y-auto",children:o.join(", ")})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"Result:"}),n==="pending"?e.jsx("p",{className:"text-fg-muted italic",children:"decrypting…"}):n?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:n.channelName,color:"teal"})}),e.jsx(i,{label:"plaintext",children:e.jsx(d,{fn:"plaintext",value:new TextDecoder("utf-8",{fatal:!1}).decode(n.plaintext.slice(5)).trim()||"(empty)",color:"teal"})}),e.jsx(i,{label:"macValid",children:e.jsx(d,{fn:"macValid",value:n.macCorrupted?"false":"true",color:"teal"})})]}):e.jsxs(i,{label:"decrypt",children:[e.jsx(d,{fn:"decrypt",value:"failed",color:"red"}),e.jsx("span",{className:"text-fg-muted ml-1",children:"channel not in known list"})]})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"testChannelName() — manual test:"}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("input",{type:"text",value:u,onChange:p=>{v(p.target.value),f(null)},onKeyDown:p=>p.key==="Enter"&&h(),placeholder:"channel name",className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-40"}),e.jsx("button",{onClick:h,disabled:k||!u.trim(),className:"px-2 py-1 rounded text-[10px] font-mono bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 disabled:opacity-40 transition-colors",children:k?"…":"Try"})]}),N&&e.jsx("div",{className:"mt-1",children:N.success?e.jsx(i,{label:"result",children:e.jsx(d,{fn:"plaintext",value:N.text??"(empty)",color:"teal"})}):e.jsx(i,{label:"error",children:e.jsx(d,{fn:"error",value:N.error??"unknown",color:"red"})})})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"useDecodedMessage() store result:"}),y?y.decoded?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:y.decoded.channelName??"?",color:"teal"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:y.decoded.text,color:"teal"})})]}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"failed",color:"red"})}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"pending",color:"zinc"})})]})]})})]})}function Rt(t){const{rawHex:s,display:r,protocolPacket:c,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m,packetHash:g,packet:u}=t,v=!!s&&s.length>=4;return e.jsxs(G,{children:[e.jsx(K,{className:"w-full mt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-mono text-fg-muted",children:"🔬"}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-fg-muted",children:"Wire Inspection"}),e.jsx("span",{className:"text-[9px] text-fg-muted/50",children:"observatory diagnostic — not a runtime stage"})]})}),e.jsx(V,{children:e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-lg p-3 space-y-1 bg-surface/30",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/50 mb-2",children:"The backend parsed these fields server-side. This panel verifies the wire-level encoding client-side."}),v?e.jsxs(e.Fragment,{children:[e.jsx(Dt,{rawHex:s,display:r,protocolPacket:c,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m}),e.jsx(Lt,{decoded:a,packet:u}),e.jsx(Mt,{protocolPacket:c,packetHash:g})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function fe(t){if(!t)return[{fn:"decode",value:"no raw_packet",group:"decode",color:"zinc"}];switch(t.type){case"advert":{const s=t,r=[{fn:"decode.nodeType",value:s.nodeType,group:"decode",color:"blue"}];return s.name&&r.push({fn:"decode.name",value:s.name,group:"decode",color:"blue"}),s.latitude!=null&&s.longitude!=null&&r.push({fn:"decode.location",value:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`,group:"decode",color:"blue"}),r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:"blue"}),r}case"trace":{const s=t;return[{fn:"decode.traceTag",value:s.traceTag,group:"decode",color:"blue"},{fn:"decode.hops",value:s.pathHashes.length>0?s.pathString:"empty",group:"decode",color:"blue"},{fn:"decode.snr",value:s.snrValues.length>0?`${s.snrValues.length} values`:"none",group:"decode",color:s.snrValues.length>0?"blue":"zinc"},{fn:"decode.complete",value:s.isComplete?"yes":"partial",group:"decode",color:s.isComplete?"green":"amber"}]}case"path":{const s=t,r=[{fn:"decode.pathLength",value:String(s.pathLength),group:"decode",color:"blue"},{fn:"decode.path",value:s.path.length>0?s.pathString:"empty",group:"decode",color:"blue"}];return s.extraType!=null&&r.push({fn:"decode.extraType",value:s.extraTypeName??String(s.extraType),group:"decode",color:"purple"}),s.extraData&&r.push({fn:"decode.extraData",value:`${s.extraData.length/2}B`,group:"decode",color:"purple"}),r}case"ack":return[{fn:"decode.crc",value:t.crc,group:"decode",color:"blue"}];case"grp_txt":return[{fn:"decode.channelHash",value:t.channelHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:"true — decrypt at cascade",group:"decode",color:"zinc"}];case"grp_data":{const s=t;return[{fn:"decode.channelHash",value:s.channelHash,group:"decode",color:"blue"},{fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"}]}case"txt_msg":{const s=t;return[{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:s.encrypted?"true":"false",group:"decode",color:s.encrypted?"zinc":"green"},...s.encrypted?[]:[{fn:"decode.text",value:s.text,group:"decode",color:"blue"}]]}case"multipart":{const s=t;return[{fn:"decode.part",value:`${s.partNumber+1}/${s.totalParts}`,group:"decode",color:"blue"},{fn:"decode.msgId",value:s.messageId,group:"decode",color:"blue"}]}case"control":{const s=t,r=[{fn:"decode.subtype",value:s.subtypeName,group:"decode",color:"blue"}];return s.nodeTypeName&&r.push({fn:"decode.nodeType",value:s.nodeTypeName,group:"decode",color:"blue"}),s.snrDb!=null&&r.push({fn:"decode.snr",value:`${s.snrDb>0?"+":""}${s.snrDb.toFixed(1)} dB`,group:"decode",color:"blue"}),s.tag&&r.push({fn:"decode.tag",value:s.tag,group:"decode",color:"blue"}),s.publicKey&&r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:s.publicKeyFull?"green":"blue"}),s.typeFilter!=null&&r.push({fn:"decode.typeFilter",value:s.typeFilterDescription??`0x${s.typeFilter.toString(16)}`,group:"decode",color:"blue"}),s.prefixOnly!=null&&r.push({fn:"decode.prefixOnly",value:String(s.prefixOnly),group:"decode",color:"blue"}),!s.nodeTypeName&&!s.tag&&(r.push({fn:"decode.subtypeFlags",value:`0x${s.subtypeFlags.toString(16)}`,group:"decode",color:"blue"}),r.push({fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"})),r}case"req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"response":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"anon_req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.senderPubKey",value:s.senderPublicKey,group:"decode",color:"green"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"generic":return[{fn:"decode.raw",value:`${t.length}B`,group:"decode",color:"zinc"}];default:return[]}}function At({packet:t,pipeline:s,rawHex:r,traceTagIndex:c,neighbors:a}){const{enrichment:n,timing:l,display:o,protocolPacket:x,decoded:m,parseError:g,payloadVersion:u,isV1:v,isV2:N,analysis:f}=s,$=(t.type??t.payload_type)===et,h=f.dupeAnalysis,y=T.useRef(0),p=T.useMemo(()=>{if(!$)return null;const D=performance.now(),L=yt(t,c,a);return y.current=performance.now()-D,L},[t,c,a,$]),_=l.enrich+y.current,H=[];f.byteLen&&H.push(`${f.byteLen}B`),H.push(f.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):f.pathHopCount>0&&H.push(`${f.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const C=H.join(" — ");return e.jsxs(le,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:C,timeMs:_,children:[e.jsx(Rt,{rawHex:r,display:o,protocolPacket:x,decoded:m,parseError:g,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(U,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(M,{color:"green",children:"PacketCache"}):e.jsx(M,{color:"amber",children:"computed"}),e.jsx("span",{className:"text-[10px] text-fg-muted ml-1.5",children:n.preComputed?"pre-enriched by real pipeline":"synthetic — computed on the fly"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 mb-1",children:[e.jsx(d,{fn:"_byteLength",value:n.byteLength!=null?`${n.byteLength}B`:void 0,color:"blue"}),e.jsx(d,{fn:"_hopCount",value:String(n.hopCount),color:"blue"}),e.jsx(d,{fn:"_isZeroHop",value:String(n.isZeroHop),color:n.isZeroHop?"green":"blue"}),n.isZeroHop&&e.jsx(M,{color:"blue",children:"direct"}),n.channelHash!=null&&e.jsx(d,{fn:"_channelHash",value:n.channelHash,color:"blue"}),$&&t._traceTag&&e.jsx(d,{fn:"_traceTag",value:t._traceTag,color:"blue"})]}),n.advertSender||n.advertNodeType!=null||n.advertName!=null?e.jsxs("div",{className:"mt-1 mb-1",children:[e.jsx("p",{className:"text-[10px] text-sys-blue font-medium mb-0.5",children:"ADVERT Enrichment"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1",children:[n.advertSender&&e.jsx(d,{fn:"_advertSender",value:n.advertSender.slice(0,16)+"…",color:"blue"}),n.advertNodeType!=null&&e.jsx(d,{fn:"_advertNodeType",value:ke(n.advertNodeType),color:"blue"}),n.advertName!=null&&e.jsx(d,{fn:"_advertName",value:n.advertName,color:"blue"}),n.advertFlags!=null&&e.jsx(d,{fn:"_advertFlags",value:`0x${n.advertFlags.toString(16).padStart(2,"0")}`,color:"blue"}),n.advertHasLocation!=null&&e.jsx(d,{fn:"_advertHasLocation",value:String(n.advertHasLocation),color:"blue"}),n.advertHasName!=null&&e.jsx(d,{fn:"_advertHasName",value:String(n.advertHasName),color:"blue"}),n.advertLatitude!=null&&n.advertLongitude!=null&&e.jsx(d,{fn:"location",value:`${n.advertLatitude.toFixed(4)}, ${n.advertLongitude.toFixed(4)}`,color:"blue"})]})]}):e.jsx("p",{className:"text-[10px] text-fg-muted/30 mb-1",children:"ADVERT fields: N/A (non-ADVERT packet)"}),e.jsx(E,{title:"Payload Decode"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${m?"bg-sys-blue":"bg-zinc-500/40"}`}),e.jsx("span",{className:"font-mono text-[10px] font-medium text-fg-primary",children:"decodePayload()"}),e.jsx("span",{className:"text-[9px] text-fg-muted",children:"sync — wire data only, no crypto"})]}),e.jsx("div",{className:"ml-3",children:m?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:fe(m).map((D,L)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:D.fn,value:D.value,color:D.color})},L))}):e.jsx(S,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"dupe:"}),h.isDuplicate?e.jsx(d,{fn:"is_duplicate",value:"true",color:"purple"}):e.jsx(S,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(S,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"TRACE SRC:"}),p.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:p.inferredSrc,color:"purple"}),p.inferredName&&e.jsx(d,{fn:"name",value:p.inferredName,color:"purple"})]}):e.jsx(S,{children:"unresolvable"}),e.jsx(_e,{color:"purple",children:p.method}),e.jsxs(S,{children:["(",p.confidence,")"]}),e.jsxs(S,{children:["siblings=",p.siblingCount]})]})]}),(()=>{const D=f.pType!=null?`0x${f.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,L=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=fe(m),R=f.signalClass==="excellent"||f.signalClass==="good"?"green":f.signalClass==="fair"?"amber":"red",b=f.senderTier==="pubkey"?"green":f.senderTier==="prefix"?"amber":f.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:f.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:f.routeTypeName,raw:L,group:"wire",color:"blue"},{fn:"src_hash",value:t.src_hash||void 0,group:"wire",color:"blue"},{fn:"rssi",value:`${t.rssi}dBm`,group:"wire",color:"blue"},{fn:"snr",value:`${t.snr}dB`,group:"wire",color:"blue"},{fn:"_byteLength",value:f.byteLen?`${f.byteLen}B`:void 0,group:"enrichment",color:"blue"},{fn:"_hopCount",value:String(n.hopCount),group:"enrichment",color:"blue"},{fn:"_isZeroHop",value:String(n.isZeroHop),group:"enrichment",color:"blue"},{fn:"_advertSender",value:n.advertSender||void 0,group:"enrichment",color:"blue"},{fn:"_advertNodeType",value:f.advertType!=="unknown"?f.advertType:void 0,group:"enrichment",color:"blue"},{fn:"_advertName",value:n.advertName||void 0,group:"enrichment",color:"blue"},{fn:"_channelHash",value:n.channelHash||void 0,group:"enrichment",color:"blue"},...P,{fn:"is_duplicate",value:String(h.isDuplicate),group:"analysis",color:"purple"},p!=null&&p.inferredSrc?{fn:"traceSrc",value:p.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:f.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:f.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:f.senderTier,group:"analysis",color:b},{fn:"_origin",value:f.origin,group:"analysis",color:f.origin==="tx_local"?"green":f.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:f.pathAvail?`${f.pathHopCount} hops`:"none",group:"analysis",color:f.pathAvail?"green":"zinc"},{fn:"_age",value:f.age,group:"analysis",color:f.age==="live"||f.age==="recent"?"green":"zinc"},...h.dupeCount>0?[{fn:"_dupeCount",value:`×${h.dupeCount}`,group:"analysis",color:"purple"},...h.rssiRange?[{fn:"_multipath",value:`Δ${Math.abs(h.rssiRange[1]-h.rssiRange[0])}dB`,group:"analysis",color:Math.abs(h.rssiRange[1]-h.rssiRange[0])>6?"amber":"green"}]:[]]:[],...t.lbt_attempts!=null?[{fn:"_lbt",value:`${t.lbt_attempts} attempt${t.lbt_attempts!==1?"s":""}`,group:"analysis",color:(t.lbt_attempts??0)>1?"amber":"green"}]:[],...t.drop_reason?[{fn:"_dropReason",value:t.drop_reason,group:"analysis",color:"red"}]:[]];return e.jsx(se,{tokens:w})})()]})})]})}function be(t){switch(t){case"excellent":return"green";case"good":return"green";case"fair":return"amber";case"poor":return"red";case"critical":return"red";default:return"zinc"}}function ye(t){return`${Math.round(t*100)}%`}function je(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function Ft({hops:t}){return t.length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle/40",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/40 uppercase tracking-widest font-mono mb-1.5",children:"per-hop trace inspection"}),e.jsx("div",{className:"space-y-1",children:t.map(s=>e.jsx(U,{prefix:`trace.hop[${s.hopIndex}]`,children:e.jsxs("div",{className:"border border-edge-subtle/40 rounded px-2 py-1.5",children:[e.jsxs(i,{label:"link",children:[e.jsx(re,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(_e,{color:be(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(F,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:be(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:je(s.fromName,s.fromHash,s.fromPrefix),color:s.fromHash?s.fromConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:je(s.toName,s.toHash,s.toPrefix),color:s.toHash?s.toConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(se,{label:"trace contributes",tokens:Et(t)})]})}function Et(t){const s=t.reduce((n,l)=>n+(l.fromHash?1:0)+(l.toHash?1:0),0),r=t.length*2,c=r-s,a=t.length>0?t.reduce((n,l)=>n+l.snrRaw,0)/t.length:0;return[{fn:"hops",value:String(t.length),group:"wire",color:"blue"},{fn:"resolved",value:`${s}/${r}`,group:"worker",color:"green"},...c>0?[{fn:"ghosts",value:String(c),group:"worker",color:"purple"}]:[],{fn:"avgSnr",value:`${a.toFixed(1)} dB`,group:"analysis",color:a>=5?"green":a>=0?"amber":"red"}]}function Ot(t){if(!t)return"never";const s=Math.floor((Date.now()-t)/1e3);return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`}function zt(t){if(!t)return[];const s=t.decoded;if(!s)return[{fn:"decrypt.result",value:"failed",group:"crypto",color:"red"}];if(!s.decrypted)return[{fn:"decrypt.result",value:"no key match",group:"crypto",color:"zinc"}];const r=[];return s.channelName&&r.push({fn:"decrypt.channelName",value:s.channelName,group:"crypto",color:"teal"}),s.senderName&&r.push({fn:"decrypt.senderName",value:s.senderName,group:"crypto",color:"teal"}),s.text&&r.push({fn:"decrypt.text",value:s.text,group:"crypto",color:"teal"}),s.timestamp&&r.push({fn:"decrypt.timestamp",value:new Date(s.timestamp*1e3).toISOString().slice(11,19),group:"crypto",color:"teal"}),s.macCorrupted&&r.push({fn:"decrypt.macCorrupted",value:"true",group:"crypto",color:"amber"}),r}function Bt({packet:t,decrypted:s,pipeline:r}){var b;const c=J(w=>w.isComputing),a=J(w=>w.lastUpdated),n=J(w=>w.lastComputeTimeMs),l=J(w=>w.topology.edges.length),o=J(w=>w.topology.discoveredNodes.length),x=tt(),m=st(),g=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),f=me(w=>w.initialDecodeComplete),k=t.type??t.payload_type,$=k===O.GRP_TXT||k===O.GRP_DATA,h=k===O.TRACE,y=k===O.PATH,p=$,_=[{label:"full",detail:"all GRP_TXT → decryption worker",active:p&&f,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!f,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!p,color:"zinc"}],H=zt(s),C=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,D=c?"running":`${l}e ${o}g`,L=u?"running":`${v}n`,P=p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A",R=`topo ${c?"○":"✓"} ${D} · spark ${u?"○":"✓"} ${L} · decrypt ${P}`;return e.jsx(le,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:R,children:e.jsx(U,{prefix:"cascade",children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 py-1.5 text-[11px] font-mono",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"topology"}),e.jsxs("span",{className:"text-fg-muted",children:[l,"e ",o,"g"]}),(h||y)&&e.jsx("span",{className:"text-sys-green text-[9px]",children:"↑signal"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"sparkline"}),e.jsxs("span",{className:"text-fg-muted",children:[v,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.isDecoding?"bg-sys-amber animate-pulse":p?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:p?"text-sys-teal":"text-fg-muted",children:p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A"})]})]}),e.jsxs(G,{defaultOpen:h||y,children:[e.jsx(K,{className:"text-[10px] w-full border-t border-edge-subtle pt-1.5",children:e.jsx("span",{className:"font-mono text-fg-muted/50",children:"topology detail…"})}),e.jsx(V,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:c?"running":"idle",color:c?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Ot(a),color:"zinc"}),n>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",n<1e3?`${n.toFixed(0)}ms`:`${(n/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(l),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(o),color:"purple"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(x.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(x.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(x.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${x.meanSnr.toFixed(1)} dB`,color:x.meanSnr>=5?"green":x.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${x.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(x.avgConfidence*100)}%`,color:"zinc"})]}),h&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(x.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(x.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(x.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(x.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(x.qualityCounts.critical),color:"red"})]}),g.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(g.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(g.confirmedLinks.length),color:"teal"})]})]}),h&&(r==null?void 0:r.traceHopDetail)&&e.jsx(Ft,{hops:r.traceHopDetail})]})})]}),p&&e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"mode",children:e.jsx(ae,{options:_,nextFn:"queueDecryption()"})}),e.jsx(i,{label:"result",children:e.jsx(d,{fn:"decrypt",value:C?"decrypted":s?"failed":"pending",color:C?"teal":s?"red":"zinc"})}),C&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-1",children:H.map((w,oe)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:w.fn,value:w.value,color:w.color})},oe))})]})}),(()=>{const w=[{fn:"topology.edges",value:String(l),group:"worker",color:"green"},{fn:"topology.ghostNodes",value:String(o),group:"worker",color:"purple"},{fn:"sparkline.nodes",value:`${v}`,group:"worker",color:"green"},...m?[{fn:"trace.directedLinks",value:String(x.totalDirectedLinks),group:"worker",color:"teal"},{fn:"trace.meanSnr",value:`${x.meanSnr.toFixed(1)} dB`,group:"worker",color:"teal"}]:[],...H];return e.jsx(se,{tokens:w})})()]})})})}function It(t,s,r,c){var n;const a=t.src_hash?Se(t.src_hash):"";if(t._advertSender&&s.hash&&s.confident)return{tier:1,label:"_advertSender → pubkey",detail:"ADVERT carried full 32-byte public key — definitive match"};if(c&&s.confident&&((n=s.name)==null?void 0:n.toLowerCase())===c.toLowerCase())return{tier:1.5,label:"decrypt.senderName → nameToHash",detail:`Decrypted sender name “${c}” matched neighbor — high-confidence`};if(a&&r.crossClassPrefixes.has(a))return{tier:2,label:"cross-class prefix",detail:"Prefix has mixed types (repeater + non-repeater); payload type narrows to one class"};if(s.confident){const l=r.prefixIndex.get(a);return(l==null?void 0:l.length)===1?{tier:3,label:"single candidate",detail:"Only one node matches this prefix — unambiguous"}:{tier:3,label:"resolver",detail:"Multi-signal scoring selected best candidate from collision set"}}return{tier:4,label:"ambiguous",detail:"Cannot confidently resolve — multiple same-class candidates, insufficient scoring separation"}}function Gt(t,s){const r=t.original_path??t.forwarded_path,c=new Set;if(r&&Array.isArray(r))for(const a of r){const n=String(a).toUpperCase();n.length>=2&&!rt(n,s)&&c.add(n)}return c}function Kt(t,s,r,c,a,n,l){const o=Math.floor(Date.now()/1e3),x=new Map(r.map(m=>[m.hash,m]));return t.map(m=>{const g=s[m.hash],u=x.get(m.hash);let v=!0,N="";c!=="unknown"?m.type!=="unknown"&&m.type!==c?(v=!1,N=`${m.type} ≠ required ${c}`):m.type===c?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const f=!!(g!=null&&g.zero_hop),k=(g==null?void 0:g.last_seen)??0;let $=0;if(f&&k>0){const b=(o-k)/3600;$=50*Math.exp(-b/l)}let h=0;if(k>0){const b=(o-k)/3600;h=Math.exp(-b/n)}const y=h*20,p=!!(g!=null&&g.latitude&&(g!=null&&g.longitude)&&(g.latitude!==0||g.longitude!==0)),_=p?5:0,H=(u==null?void 0:u.advertCount)??0,C=Math.min(H*2,30),D=(u==null?void 0:u.forwarderPrefixes.size)??0,L=Math.min(D*3,15);let P=0;if(u&&u.totalForwarderObservations>0&&a.size>0){let b=0;for(const w of a)u.forwarderPrefixes.has(w)&&b++;P=b/a.size}const R=$+y+_+C+L;return{hash:m.hash,name:m.name,type:m.type,roleCompatible:v,roleReason:N,zeroHop:f,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,g)=>g.total-m.total)}function Vt({packet:t,pipeline:s,resolved:r,resolveTimeMs:c,advertName:a,neighbors:n,decrypted:l}){var ie,de;const o=Y(j=>j.neighborContext),x=Y(j=>j.topologyProfiles),m=Y(j=>j.config),{analysis:g}=s,u=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Se(t.src_hash):"",N=v?o.prefixIndex.get(v)??[]:[],f=v?x.get(v)??[]:[],k=g.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=g.inferredType,y=g.advertType,p=g.effectiveType,_=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((ie=l==null?void 0:l.decoded)==null?void 0:ie.senderName)??null,C=It(t,u,o,H),D=T.useMemo(()=>Gt(t,v),[t,v]),L=g.pathLen,P=T.useMemo(()=>Kt(N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours]),R=P.filter(j=>!j.roleCompatible),b=P.filter(j=>j.roleCompatible),w=t._advertSender?o.pubKeyMap.get(t._advertSender)??null:null,oe=C.tier===1,De=[{fn:"src_hash",value:v||"",active:!!v,color:"blue"},{fn:"_advertSender",value:t._advertSender?t._advertSender.slice(0,12)+"…":"",active:!!t._advertSender,color:"blue"},{fn:"_advertNodeType",value:_?`0x${_}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:L!=null?L===0?"zero-hop":String(L):"",active:L!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!w,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!w,color:"zinc"}],Pe=[{label:"payload",detail:`inferDeviceType(0x${$}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:_?`mapAdvertTypeCode(0x${_}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:p==="unknown",color:"zinc"}],Me=u.name??((de=u.hash)==null?void 0:de.slice(0,12))??"?",Re=u.confident?"confident":"ambiguous",Ae=`→ ${Me} (${Re}, Tier ${C.tier})`;return e.jsx(le,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Ae,timeMs:c,children:e.jsx(U,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(St,{tokens:De,nextFn:"resolvePacketSource()"})}),t.src_hash?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(ae,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:w?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:w,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),u.name&&a===u.name&&e.jsx(S,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(M,{color:"green",children:"Tier 1"}),e.jsx(S,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(S,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(S,{children:"no _advertSender — skip to prefix resolution"})})})]}),oe?e.jsx("div",{className:"border-t border-edge-subtle py-2",children:e.jsx("p",{className:"text-[11px] text-fg-muted/40 font-mono ml-3",children:"Steps 2–5 bypassed — pubkey definitive"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"2"})," ","CANDIDATE POOL — ",N.length," node",N.length!==1?"s":"",' match "',v,'"']}),e.jsxs("div",{className:"space-y-0.5 ml-3",children:[P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"break-all text-[10px]",children:j.hash}),e.jsx(M,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]},j.hash)),N.length===0&&e.jsx(S,{children:"no known nodes for this prefix"})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(ae,{options:Pe,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:p,color:p!=="unknown"?h!=="unknown"?"amber":"green":"zinc"})})})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"4"})," ","ROLE-TYPE SCRUB"]}),e.jsx("div",{className:"space-y-0.5 ml-3",children:P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:j.roleCompatible?"text-sys-green":"text-sys-red",children:j.roleCompatible?"✓":"✗"}),e.jsx("span",{className:`break-all text-[10px] ${j.roleCompatible?"":"line-through text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(S,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),R.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[R.length," eliminated, ",b.length," surviving"]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),b.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):b.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(S,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:b[0].hash}),b[0].name&&e.jsx(S,{c:"text-fg-muted ml-1",children:b[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[b.length," candidates scored…"]})}),e.jsx(V,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:b.map(j=>{const Q=j.hash===u.hash;return e.jsxs("div",{className:`text-[11px] leading-relaxed rounded px-2 py-1 ${Q?"bg-sys-green/8 border border-sys-green/20":"bg-zinc-500/5"}`,children:[e.jsxs("div",{className:"flex gap-2 items-center mb-0.5",children:[e.jsx(S,{c:Q?"text-sys-green":"text-fg-muted",children:Q?"→":" "}),e.jsx("span",{className:`break-all text-[10px] ${Q?"text-fg-primary":"text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:Q?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]}),e.jsxs("div",{className:"ml-4 flex flex-wrap gap-x-3 gap-y-0.5",children:[e.jsxs("span",{children:[e.jsx(S,{children:"zero_hop:"})," ",e.jsx(S,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"recency:"})," ",e.jsx(S,{c:"text-fg-primary",children:mt(j.lastSeen)})," ",e.jsxs(M,{color:ee(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"gps:"})," ",e.jsx(S,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"adverts:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(M,{color:ee(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"topo:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(M,{color:ee(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(S,{children:"score ≈"})," ",e.jsx(S,{c:"text-fg-primary font-bold",children:j.total.toFixed(1)})]})]},j.hash)})})})]})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:u.hash?e.jsx(d,{fn:"resolved.hash",value:u.hash,color:"green"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:u.type,color:u.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:u.name?e.jsx(d,{fn:"resolved.name",value:u.name,color:u.confident?"green":"amber"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(S,{c:u.confident?"text-sys-green":"text-sys-red",children:String(u.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(M,{color:C.tier<=2?"green":C.tier===3?"amber":"red",children:C.tier}),e.jsx(S,{c:"text-fg-primary ml-1",children:C.label})]})]})]})]}):e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx(S,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),u.confident?e.jsxs(S,{c:"text-sys-green",children:["→ resolved via ",C.label]}):e.jsx(S,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:u.hash??"null",group:"resolution",color:u.confident?"green":"zinc"},{fn:"resolved.type",value:u.type,group:"resolution",color:u.type!=="unknown"?u.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:u.name??"null",group:"resolution",color:u.confident?"green":u.name?"amber":"zinc"},{fn:"resolved.confident",value:String(u.confident),group:"resolution",color:u.confident?"green":"red"}];return e.jsx(se,{tokens:j})})()]})})})}const Ut={id:"packet-parse",label:"Packet Parse",inputs:["rawPacket"],outputs:["parsedPacket","decoded","headerFields"],emits:[{fn:"routeType",group:"wire",color:"blue"},{fn:"payloadType",group:"wire",color:"blue"},{fn:"pathLength",group:"wire",color:"blue"},{fn:"version",group:"wire",color:"blue"}],async:!1,observatoryStage:0},qt={id:"enrichment",label:"Ingestion Enrichment",inputs:["parsedPacket"],outputs:["advertSender","channelHash","hopData","byteLength"],emits:[{fn:"_advertSender",group:"enrichment",color:"blue"},{fn:"_advertNodeType",group:"enrichment",color:"blue"},{fn:"_channelHash",group:"enrichment",color:"blue"},{fn:"_hopCount",group:"enrichment",color:"blue"},{fn:"_isZeroHop",group:"enrichment",color:"blue"},{fn:"_byteLength",group:"enrichment",color:"blue"}],async:!1,observatoryStage:1},Wt={id:"topology",label:"Topology Analysis",inputs:["packets","neighbors","srcHashResolver"],outputs:["edges","nodeMetrics","pathHealth","ghostNodes","centrality","loops"],emits:[{fn:"edges",group:"worker",color:"green"},{fn:"ghostNodes",group:"worker",color:"purple"},{fn:"loops",group:"analysis",color:"amber"},{fn:"nodeMetrics",group:"worker",color:"green"},{fn:"pathHealth",group:"worker",color:"green"},{fn:"centrality",group:"worker",color:"green"}],async:!0,worker:"topology.worker.ts",observatoryStage:2},Yt={id:"trace-enrichment",label:"Trace Link Quality",inputs:["packets","prefixLookup","srcHashResolver","edges","pathHealth","nodeMetrics"],outputs:["traceLinks","traceLinkSummary","traceDisambiguationFeedback"],emits:[{fn:"traceLinks.directed",group:"worker",color:"teal"},{fn:"traceLinks.bidir",group:"worker",color:"teal"},{fn:"traceSummary.meanSnr",group:"analysis",color:"green"},{fn:"traceSummary.medianSnr",group:"analysis",color:"zinc"},{fn:"traceSummary.confidence",group:"analysis",color:"zinc"},{fn:"feedback.confirmed",group:"worker",color:"teal"},{fn:"feedback.links",group:"worker",color:"teal"}],async:!1,observatoryStage:2},Zt={id:"disambiguation",label:"Source Disambiguation",inputs:["packets","neighbors","decodedMessages"],outputs:["srcHashResolverMap","neighborContext"],emits:[{fn:"resolvedHash",group:"resolution",color:"purple"},{fn:"resolvedName",group:"resolution",color:"purple"},{fn:"resolvedType",group:"resolution",color:"purple"},{fn:"confidence",group:"resolution",color:"green"}],async:!1,observatoryStage:3},Xt={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},Qt={id:"decryption",label:"Channel Decryption",inputs:["packets","channelKeys"],outputs:["decodedMessages"],emits:[{fn:"decrypt.text",group:"crypto",color:"teal"},{fn:"decrypt.senderName",group:"crypto",color:"teal"},{fn:"decrypt.channelName",group:"crypto",color:"teal"},{fn:"decrypt.macCorrupted",group:"crypto",color:"amber"}],async:!0,worker:"decryption.worker.ts",observatoryStage:2},Jt={id:"decoded-content",label:"Decoded Content Policy",inputs:["decodedMessages","packets"],outputs:["decodedContent","contentInheritance"],emits:[{fn:"content.senderName",group:"crypto",color:"teal"},{fn:"content.text",group:"crypto",color:"teal"},{fn:"content.channelName",group:"crypto",color:"teal"},{fn:"content.corrupted",group:"crypto",color:"amber"},{fn:"content.inherited",group:"analysis",color:"purple"}],async:!1},Z=[Ut,qt,Wt,Yt,Zt,Xt,Qt,Jt],es=new Map(Z.map(t=>[t.id,t])),ts=new Map;for(const t of Z)for(const s of t.emits)ts.set(s.fn,t);const $e=new Map;for(const t of Z)for(const s of t.outputs)$e.set(s,t);function ss(){const t=new Map,s=new Map;for(const a of Z)t.has(a.id)||t.set(a.id,0),s.has(a.id)||s.set(a.id,new Set);for(const a of Z)for(const n of a.inputs){const l=$e.get(n);if(l&&l.id!==a.id){const o=s.get(l.id);o.has(a.id)||(o.add(a.id),t.set(a.id,(t.get(a.id)??0)+1))}}const r=[];for(const[a,n]of t)n===0&&r.push(a);const c=[];for(;r.length>0;){const a=r.shift(),n=es.get(a);n&&c.push(n);for(const l of s.get(a)??[]){const o=(t.get(l)??1)-1;t.set(l,o),o===0&&r.push(l)}}for(const a of Z)c.includes(a)||c.push(a);return c}const ns={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function rs({stage:t,isActive:s,onClick:r}){const c=t.observatoryStage!=null?ns[t.observatoryStage]??"text-fg-muted":"text-fg-muted/40";return e.jsxs("button",{type:"button",onClick:r,className:` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-CyVtwxqQ.js","assets/index-CR6htdhJ.js","assets/node-types-BvQCDNK9.js","assets/index-7uzBcJ1E.css"])))=>i.map(i=>d[i]); +import{co as O,r as T,eU as Fe,eV as Ee,eW as Oe,eX as ze,bW as Be,eY as Ie,eZ as Ge,e_ as Ke,e$ as Ve,bV as Ne,_ as ue,f0 as Ue,f1 as we,b$ as pe,j as e,f2 as G,f3 as K,f4 as V,eu as xe,f5 as qe,V as M,ca as We,cl as Ce,cv as Ye,f6 as Ze,f7 as Xe,f8 as Qe,f9 as Je,fa as et,fb as J,fc as tt,fd as st,fe as nt,ff as he,at as me,ao as Se,bQ as rt,t as at,fg as lt,Q as ot,a6 as ct,fh as it,P as dt,dL as ut}from"./index-CR6htdhJ.js";import{usePipelineStore as Y}from"./usePipelineStore-CyVtwxqQ.js";import{e as Te,p as pt,A as I,S as U,a as se,c as E,K as i,H as A,B as xt,R as F,T as d,P as re,d as ht,f as S,C as _e,s as ee,h as mt}from"./primitives-EdDnh5-7.js";import{m as ke,i as gt}from"./node-types-BvQCDNK9.js";import{a as ft}from"./payload-detail-B6eeo8Zi.js";function bt(t){const s=t.type??t.payload_type,r=t.duplicates??[],c=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const x=[t.rssi,...r.map(g=>g.rssi).filter(g=>g!=null)],m=[t.snr,...r.map(g=>g.snr).filter(g=>g!=null)];x.length>1&&(n=[Math.min(...x),Math.max(...x)]),m.length>1&&(l=[Math.min(...m),Math.max(...m)])}const o=s===O.TRACE;return{isDuplicate:c,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:o}}function yt(t,s,r){const c={traceTag:null,siblingCount:0,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:[],thisPathLen:0,minPathLen:0,firstHopPrefix:null};let a=t._traceTag;if(!a&&t.payload&&(a=Te(t.payload)),!a)return{...c,evidence:["no traceTag — cannot correlate"]};const n=s.get(a)??[],l=N=>N.path_length!=null?N.path_length:Array.isArray(N.original_path)?N.original_path.length:0,o=l(t),x=n.length>0?Math.min(...n.map(l)):o,m=t.payload?t.payload.slice(18):"",g=m.length>=2?m.slice(0,2).toUpperCase():null,u=[];if(u.push(`traceTag: ${a}`),u.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return u.push("packet_origin = tx_local → we initiated this trace"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return u.push(`sibling (hash ${v.packet_hash}) has packet_origin = tx_local`),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),g){if(u.push(`first hop in target path: ${g}`),o===0)return u.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),u.push("initiator is a direct RF neighbor"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"min_path_len",confidence:"speculative",inferredSrc:null,inferredName:null,evidence:[...u,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:o,minPathLen:x,firstHopPrefix:g};const f=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===g);if(f.length===1){const[k,$]=f[0],h=$.name||$.node_name||null;return u.push(`first hop ${g} → unique neighbor: ${h??k}`),u.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:g,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}else f.length>1?u.push(`first hop ${g} matches ${f.length} neighbors (ambiguous)`):u.push(`first hop ${g} is not a known neighbor`)}return u.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-CyVtwxqQ.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-CR6htdhJ.js").then(t=>t.hq),__vite__mapDeps([1,3])).then(t=>{ce=t})},0);const He={advertSender:null,advertNodeType:null,advertFlags:null,advertHasLocation:null,advertHasName:null,advertName:null,advertLatitude:null,advertLongitude:null,channelHash:null,byteLength:void 0,hopCount:0,isZeroHop:!0,preComputed:!1};function jt(t,s){const r=t.type??t.payload_type,c=Ne(r),a=Be(t.route),n=r===O.ADVERT,l=r===O.TRACE,o=r===O.PATH,x=r===O.GRP_TXT||r===O.GRP_DATA,m=Ie(t.snr,t.rssi),g=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ve(t.route),f=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${f}`:f,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=gt(r),p=s.advertNodeType!=null?ke(s.advertNodeType):"unknown",_=y!=="unknown"?y:p,H=t.packet_origin??"rx",C=Math.floor(Date.now()/1e3)-t.timestamp,D=C<10?"live":C<300?"recent":C<3600?"warm":C<86400?"stale":"historic",L=t.path_length??(Array.isArray(t.original_path)?t.original_path.length:void 0),P=Array.isArray(t.original_path)&&t.original_path.length>0,R=L??0,b=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),w=bt(t);return{pType:r,payloadTypeName:c,routeTypeName:a,isAdvert:n,isTrace:l,isPath:o,isGrp:x,signalClass:g,routeClass:k,isFlood:u,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:$,inferredType:y,advertType:p,effectiveType:_,origin:H,age:D,pathLen:L,pathAvail:P,pathHopCount:R,byteLen:b,dupeAnalysis:w}}function vt(t){var f,k,$,h,y,p;const s=ft(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:c}=s;if(r.length<2||!ne||!ce)return null;const a=ne.usePipelineStore.getState().srcHashResolverMap,n=ne.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,o=ce.useStore.getState().stats,x=(o==null?void 0:o.neighbors)??{},m=o==null?void 0:o.local_hash,g=(k=(f=o==null?void 0:o.config)==null?void 0:f.repeater)==null?void 0:k.latitude,u=(h=($=o==null?void 0:o.config)==null?void 0:$.repeater)==null?void 0:h.longitude,v=Object.keys(x).length>0?Ue([],x,m,g,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=ge(H,_,L,a,v),R=[H,..._+20?N:null}function ge(t,s,r,c,a){if(s===0){const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.8};if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}}else{if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function Nt(t){var l;const s=t.raw_packet;if(!s||s.length<2)return null;const r=s.replace(/\s/g,""),c=Math.floor(r.length/2),a=((l=r.match(/.{1,2}/g))==null?void 0:l.join(" "))??"";let n="";for(let o=0;o=32&&x<=126?String.fromCharCode(x):"·"}return{hexBytes:a,utf8:n,byteCount:c}}function wt(t){const s=new Map;let r=0,c="";for(const a of t){if((a.type??a.payload_type)!==O.TRACE)continue;r++,c=a.packet_hash;const l=a._traceTag??(a.payload?Te(a.payload):null);if(!l)continue;let o=s.get(l);o||(o=[],s.set(l,o)),o.push(a)}return{index:s,fingerprint:`${r}:${c}`}}function Ct(t,s,r){const c=T.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=T.useMemo(()=>t?Nt(t):null,[t]),n=T.useMemo(()=>{if(!s||s.length<4)return c.current.parse=0,c.current.decode=0,null;const h=performance.now(),y=pt(s),p=performance.now()-h;return y?(c.current.parse=p,c.current.decode=0,{protocolPacket:y.packet,display:{headerFields:y.headerFields,transportCodesHex:y.transportCodesHex,pathLengthHex:y.pathLengthHex,pathDataHex:y.pathDataHex,payloadHex:y.payloadHex,payloadByteOffset:y.payloadStartByte,pathByteOffset:y.pathByteOffset,pathLenByteOffset:y.pathLenByteOffset},decoded:y.decoded,error:null}):(c.current.parse=p,c.current.decode=0,{protocolPacket:null,display:null,decoded:null,error:"Packet.fromHex() returned failure"})},[s]),l=T.useMemo(()=>{if(!t)return c.current.enrich=0,He;const h=performance.now();if(t._advertSender!==void 0)return c.current.enrich=performance.now()-h,{advertSender:t._advertSender??null,advertNodeType:t._advertNodeType??null,advertFlags:t._advertFlags??null,advertHasLocation:t._advertHasLocation??null,advertHasName:t._advertHasName??null,advertName:t._advertName??null,advertLatitude:t._advertLatitude??null,advertLongitude:t._advertLongitude??null,channelHash:t._channelHash??null,byteLength:t._byteLength,hopCount:t._hopCount??0,isZeroHop:t._isZeroHop??!0,preComputed:!0};const y=t.type??t.payload_type,p=Fe(s,y),_=Ee(s,y),H=Oe(s,t),C=ze(t);return c.current.enrich=performance.now()-h,{...p,channelHash:_,byteLength:H,...C,preComputed:!1}},[t,s]),o=T.useRef({fingerprint:"",index:new Map}),x=T.useMemo(()=>{const h=performance.now(),{index:y,fingerprint:p}=wt(r);return c.current.traceIndex=performance.now()-h,p===o.current.fingerprint?o.current.index:(o.current={fingerprint:p,index:y},y)},[r]),m=T.useMemo(()=>{const h=c.current;return{parse:h.parse,decode:h.decode,enrich:h.enrich,traceIndex:h.traceIndex,total:h.parse+h.decode+h.enrich+h.traceIndex}},[n,l,x]);if(!t)return null;const g=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",u=(n==null?void 0:n.protocolPacket)??null,v=u?u.payloadVersion:null,N=v===0,f=v===1,k=jt(t,l);let $=null;return k.isTrace&&($=vt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:g,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:f,enrichment:l,traceTagIndex:x,analysis:k,traceHopDetail:$,timing:m}}function ae({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:`w-16 shrink-0 font-medium ${l.active?"text-fg-primary":"text-fg-muted"}`,children:l.label}),l.detail&&e.jsx("span",{className:l.active?"text-fg-primary/70":"text-fg-muted",children:l.detail})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}function St({tokens:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-muted shrink-0",children:l.fn}),e.jsxs("span",{className:l.active?"text-fg-primary":"text-fg-muted",children:["(",l.value??"",")"]})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}const Tt={0:"border-l-sys-green",1:"border-l-sys-blue",2:"border-l-sys-teal",3:"border-l-sys-purple"};function le({stage:t,name:s,fn:r,verdict:c,timeMs:a,skipped:n,skipReason:l,children:o}){const x=Tt[t]??"";return e.jsx(e.Fragment,{children:e.jsx(G,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${x}`,children:[e.jsxs(K,{className:"px-3 py-2 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-sys-blue shrink-0",children:t}),e.jsx("span",{className:"font-mono text-xs font-medium text-fg-primary truncate",children:s}),r&&!c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-zinc-500/20 text-fg-muted",children:"N/A"}),a!=null&&!n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})]})]}),e.jsx(V,{children:e.jsx("div",{className:"px-3 pb-3 font-mono text-xs",children:n?e.jsx("p",{className:"text-fg-muted italic",children:l??"Not applicable for this packet type"}):o})})]})})})}function _t(t,s){return s?"manual":t._stripped?"bulk-tier":qe.isConnected()?"ws-push":"rest-poll"}const kt={connected:"green",degraded:"amber",offline:"red"};function Ht({packet:t,isSynthetic:s}){const r=xe(g=>g.wsState),c=xe(g=>g.health),a=_t(t,s),l=!!t._stripped?"WARM":"HOT",o=[{label:"ws-push",detail:"wsConnected && onPacket()",active:a==="ws-push",color:"green"},{label:"rest-poll",detail:"!wsConnected, 3s interval",active:a==="rest-poll",color:"amber"},{label:"catchup",detail:"wsReconnected, delta > 50",active:a==="catchup",color:"amber"},{label:"bulk-tier",detail:"user extends time range → gzip",active:a==="bulk-tier",color:"blue"},{label:"manual",detail:"hex input — no transport",active:a==="manual",color:"zinc"}],x=[{fn:"transport",value:a,group:"transport",color:a==="ws-push"?"green":a==="bulk-tier"?"blue":"amber"},{fn:"tier",value:l,group:"transport",color:"blue"},{fn:"wsState",value:r,group:"transport",color:r==="connected"?"green":"amber"},{fn:"health",value:c,group:"transport",color:kt[c]}],m=s?"manual hex input":`${a} (${c})`;return e.jsx(le,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:m,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(U,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(ae,{options:o,nextFn:"ingest()"}),e.jsx(se,{tokens:x})]})})})}function q({start:t,end:s}){const r=s!=null&&s!==t?`[${t}..${s}]`:`[${t}]`;return e.jsx("span",{className:"text-fg-muted text-[9px] font-mono mr-1 select-none",children:r})}const $t={advert:"decodeAdvert()",ack:"decodeAck()",path:"decodePath()",trace:"decodeTraceWithSnr()",txt_msg:"decodeTextMessage()",grp_txt:"decodeGroupText()",grp_data:"decodeGroupData()",multipart:"decodeMultipart()",control:"decodeControl()",req:"decodeRequest()",response:"decodeResponse()",anon_req:"decodeAnonReq()",generic:"decodeGeneric()"};function Dt({rawHex:t,display:s,protocolPacket:r,parseError:c,parseTimeMs:a,payloadVersion:n,isV1:l,isV2:o}){return e.jsx("dl",{className:"space-y-0.5",children:s&&r&&t?e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse — Packet.fromHex()"}),a>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})}),e.jsxs(i,{label:"header byte",children:[e.jsx(q,{start:0}),e.jsx(A,{value:t.slice(0,2)})," ",e.jsx(xt,{value:parseInt(t.slice(0,2),16)})]}),s.headerFields.map(x=>e.jsx(i,{label:` ${x.field}`,children:e.jsx(F,{raw:e.jsxs("span",{className:"text-[10px]",children:["bits[",x.bits,"] = ",x.binary]}),children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:x.value})})},x.field)),e.jsx(i,{label:" version",children:n!=null?e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(d,{fn:"payloadVer",value:`${n}`,color:"amber"}),e.jsx(M,{color:l?"green":o?"blue":"zinc",children:l?"v1":o?"v2":`v${n}`}),l&&e.jsx("span",{className:"text-fg-muted text-[10px]",children:"1-byte hashes, 2-byte MAC"}),o&&e.jsx("span",{className:"text-sys-blue text-[10px]",children:"2-byte hashes, 4-byte MAC (speculative)"})]}):e.jsx("span",{className:"text-fg-muted",children:"unknown"})}),e.jsx(E,{title:"Wire Framing"}),e.jsx(i,{label:"transportCodes",children:s.transportCodesHex?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:1,end:4}),e.jsx(d,{fn:"transport",value:s.transportCodesHex,color:"amber"})]}):e.jsx("span",{className:"text-fg-muted",children:"N/A (non-transport route)"})}),e.jsx(i,{label:"pathLen",children:e.jsx(F,{raw:e.jsxs(e.Fragment,{children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(A,{value:s.pathLengthHex})]}),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(d,{fn:"pathLen",value:`${r.pathLen} hop${r.pathLen!==1?"s":""}`,color:"amber"})]})})}),e.jsx(i,{label:"path",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.pathLen>0&&e.jsx(q,{start:s.pathByteOffset,end:s.pathByteOffset+r.pathLen-1}),e.jsx(re,{hops:r.pathHexArray,hexPrefix:s.pathDataHex||void 0})]})}),e.jsx(i,{label:"payloadLen",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.payloadByteOffset,end:s.payloadByteOffset+s.payloadHex.length/2-1}),e.jsx(d,{fn:"payloadLen",value:`${s.payloadHex.length/2} bytes`,color:"amber"})]})}),e.jsx(i,{label:"payloadHex",children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber break-all",children:s.payloadHex})})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse"}),e.jsxs(i,{label:"result",children:[e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:"Skipped"}),e.jsx("span",{className:"ml-1 text-fg-muted",children:c??"No raw_packet (warm-tier)"})]})]})})}function Lt({decoded:t,packet:s}){if(!t)return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode"}),e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:"No decoded payload"})]});const r=$t[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode — decodePayload()"}),e.jsx(U,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(E,{}),e.jsx(Pt,{decoded:t,packet:s})]})})]})}function Pt({decoded:t,packet:s}){var r;switch(t.type){case"advert":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"publicKey",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px] break-all",children:t.publicKey}),children:e.jsx(d,{fn:"publicKey",value:t.publicKey,color:"green"})})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(F,{raw:e.jsx(A,{value:t.flags}),children:e.jsx(d,{fn:"flags",value:t.flagsDescription,color:"green"})})}),e.jsx(i,{label:"nodeType",children:e.jsx(d,{fn:"nodeType",value:t.nodeType,color:"green"})}),t.latitude!=null&&e.jsx(i,{label:"latitude",children:e.jsx(d,{fn:"lat",value:t.latitude.toFixed(6),color:"green"})}),t.longitude!=null&&e.jsx(i,{label:"longitude",children:e.jsx(d,{fn:"lon",value:t.longitude.toFixed(6),color:"green"})}),t.name&&e.jsx(i,{label:"name",children:e.jsx(d,{fn:"name",value:t.name,color:"green"})})]});case"ack":return e.jsx(i,{label:"crc",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const c=s!=null&&s.src_hash?s.src_hash.replace(/^0x/i,"").slice(0,2).toUpperCase():null;return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"traceTag",children:e.jsx(d,{fn:"traceTag",value:t.traceTag,color:"green"})}),e.jsx(i,{label:"authCode",children:e.jsx(d,{fn:"authCode",value:String(t.authCode),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(A,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(re,{hops:t.pathHashes.map(a=>a.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),e.jsx(i,{label:"complete",children:t.isComplete?e.jsxs("span",{className:"text-sys-green",children:["✓ all ",t.pathHashes.length," hops reported SNR"]}):e.jsxs("span",{className:"text-sys-amber",children:["✗ ",t.snrValues.length,"/",t.pathHashes.length," hops reported"]})}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1 text-[10px]",children:"Directional Edge SNR — per-hop link quality"}),t.snrValues.length===0?e.jsx("p",{className:"text-fg-muted italic text-[11px] ml-2",children:"No SNR values in path field"}):e.jsx("div",{className:"space-y-0.5 ml-2",children:t.snrValues.map((a,n)=>{var g,u,v,N,f;const l=((g=t.pathHashes[n])==null?void 0:g.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(f=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:f.spreading_factor,m=we(a,x);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted w-3 text-right",children:n}),e.jsx("span",{className:"text-fg-primary",children:o}),e.jsx("span",{className:"text-fg-muted",children:"→"}),e.jsx("span",{className:"text-fg-primary",children:l}),e.jsx("span",{className:"text-fg-muted",children:"@"}),e.jsxs("span",{className:"font-bold text-sys-green",children:[a>0?"+":"",a.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:m})]},n)})})]})]})}case"path":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"pathLength",children:e.jsx(d,{fn:"pathLength",value:String(t.pathLength),color:"green"})}),e.jsx(i,{label:"path",children:t.path&&t.path.length>0?e.jsx(re,{hops:t.path.map(c=>c.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),t.extraType!=null&&e.jsx(i,{label:"extraType",children:e.jsx(d,{fn:"extraType",value:t.extraTypeName??String(t.extraType),color:"purple"})}),t.extraData&&e.jsxs(i,{label:"extraData",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.extraData}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.extraData.length/2,"B)"]})]})]});case"txt_msg":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),e.jsx(i,{label:"encrypted",children:e.jsx(d,{fn:"encrypted",value:String(t.encrypted),color:"green"})})]});case"grp_txt":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),t.channelName&&e.jsx(i,{label:"channelName",children:e.jsx(d,{fn:"channel",value:t.channelName,color:"green"})}),e.jsx(i,{label:"decrypted",children:e.jsx(d,{fn:"decrypted",value:String(t.decrypted),color:"green"})}),t.text&&e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),t.senderName&&e.jsx(i,{label:"senderName",children:e.jsx(d,{fn:"sender",value:t.senderName,color:"green"})}),t.macCorrupted&&e.jsx(i,{label:"macCorrupted",children:e.jsx(d,{fn:"macCorrupted",value:"true",color:"green"})})]});case"grp_data":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),e.jsx(i,{label:"dataLength",children:t.dataLength}),e.jsx(i,{label:"decrypted",children:String(t.decrypted)})]});case"multipart":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"messageId",children:t.messageId}),e.jsxs(i,{label:"part",children:[t.partNumber+1," / ",t.totalParts]})]});case"control":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"controlType",children:e.jsx(F,{raw:e.jsx(A,{value:t.controlType}),children:e.jsx(d,{fn:"controlType",value:t.subtypeName,color:"green"})})}),e.jsx(i,{label:"subtype",children:e.jsx(d,{fn:"subtype",value:`0x${t.subtype.toString(16).padStart(2,"0")}`,color:"green"})}),t.nodeTypeName&&e.jsxs(i,{label:"nodeType",children:[e.jsx(d,{fn:"nodeType",value:t.nodeTypeName,color:"green"}),e.jsxs("span",{className:"text-fg-muted text-[10px] ml-1",children:["(flags & 0x0F = 0x",(r=t.nodeType)==null?void 0:r.toString(16).padStart(2,"0"),")"]})]}),t.snrDb!=null&&e.jsxs(i,{label:"snr",children:[e.jsxs("span",{className:"font-bold text-sys-green",children:[t.snrDb>0?"+":"",t.snrDb.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:t.snrDb>=5?"strong":t.snrDb>=0?"fair":"weak"})]}),t.tag&&e.jsx(i,{label:"tag",children:e.jsx(d,{fn:"tag",value:t.tag,color:"green"})}),t.publicKey&&e.jsxs(i,{label:"publicKey",children:[e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.publicKey}),e.jsx(M,{color:t.publicKeyFull?"green":"amber",children:t.publicKeyFull?"32B full":`${t.publicKey.length/2}B prefix`})]}),t.typeFilter!=null&&e.jsx(i,{label:"typeFilter",children:e.jsx(F,{raw:e.jsx(A,{value:t.typeFilter}),children:e.jsx(d,{fn:"typeFilter",value:t.typeFilterDescription??"none",color:"green"})})}),t.prefixOnly!=null&&e.jsx(i,{label:"prefixOnly",children:e.jsx(d,{fn:"prefixOnly",value:String(t.prefixOnly),color:"green"})}),t.since!=null&&e.jsx(i,{label:"since",children:e.jsx(d,{fn:"since",value:t.since===0?"all (0)":String(t.since),color:"green"})}),!t.nodeTypeName&&t.typeFilter==null&&t.dataLength>0&&e.jsxs(i,{label:"data",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.dataHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.dataLength,"B)"]})]})]});case"req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"response":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"anon_req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"senderPubKey",children:e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.senderPublicKey})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"generic":return e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"payloadType",children:[e.jsx(ht,{value:t.payloadType})," (",t.payloadTypeName,")"]}),e.jsx(i,{label:"length",children:t.length}),e.jsx(i,{label:"rawHex",children:e.jsx("span",{className:"break-all",children:t.rawHex})})]});default:return e.jsx("p",{className:"text-fg-muted",children:"Unknown decoded type"})}}function Mt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,c=r===Ze||r===Xe,a=T.useMemo(()=>{if(!c||!t)return null;const p=t.payload;return p.length<4?null:{channelHash:p[0],mac:p.slice(1,3),ciphertext:p.slice(3)}},[t,c]),[n,l]=T.useState("pending"),[o,x]=T.useState([]),[m,g]=T.useState(0);T.useEffect(()=>{if(!a){l(null);return}let p=!1;return(async()=>{const H=performance.now(),C=await Qe(a.channelHash,a.mac,a.ciphertext);p||(l(C),g(performance.now()-H));const D=await Je(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,f]=T.useState(null),[k,$]=T.useState(!1),h=T.useCallback(async()=>{if(!(!a||!u.trim())){$(!0);try{const p=await We(u.trim(),a.channelHash,a.mac,a.ciphertext);if(p.success){const _=new TextDecoder("utf-8",{fatal:!1}).decode(p.result.plaintext.slice(5));f({success:!0,text:_})}else f({success:!1,error:p.error})}catch(p){f({success:!1,error:String(p)})}finally{$(!1)}}},[a,u]),y=Ce(s);return!c||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"C. Decrypt — tryDecryptGroupMessage()"}),m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:m<1?`${(m*1e3).toFixed(0)}µs`:`${m.toFixed(2)}ms`})}),e.jsx(U,{prefix:"tryDecryptGroupMessage",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"channelHash",children:e.jsx(d,{fn:"channelHash",value:`0x${a.channelHash.toString(16).toUpperCase().padStart(2,"0")}`,color:"teal"})}),e.jsx(i,{label:"mac",children:e.jsx(d,{fn:"mac",value:Array.from(a.mac).map(p=>p.toString(16).padStart(2,"0")).join(""),color:"teal"})}),e.jsx(i,{label:"cipherLen",children:e.jsx(d,{fn:"cipherLen",value:`${a.ciphertext.length}B`,color:"teal"})}),e.jsx(i,{label:"candidates",children:e.jsx(d,{fn:"candidates",value:o.length>0?`${o.length} names`:"0",color:o.length>0?"teal":"zinc"})}),o.length>0&&e.jsxs("details",{className:"mt-1",children:[e.jsx("summary",{className:"text-fg-muted cursor-pointer hover:text-fg-primary text-[10px]",children:"show candidate names"}),e.jsx("div",{className:"mt-1 text-[10px] text-fg-muted break-all max-h-24 overflow-y-auto",children:o.join(", ")})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"Result:"}),n==="pending"?e.jsx("p",{className:"text-fg-muted italic",children:"decrypting…"}):n?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:n.channelName,color:"teal"})}),e.jsx(i,{label:"plaintext",children:e.jsx(d,{fn:"plaintext",value:new TextDecoder("utf-8",{fatal:!1}).decode(n.plaintext.slice(5)).trim()||"(empty)",color:"teal"})}),e.jsx(i,{label:"macValid",children:e.jsx(d,{fn:"macValid",value:n.macCorrupted?"false":"true",color:"teal"})})]}):e.jsxs(i,{label:"decrypt",children:[e.jsx(d,{fn:"decrypt",value:"failed",color:"red"}),e.jsx("span",{className:"text-fg-muted ml-1",children:"channel not in known list"})]})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"testChannelName() — manual test:"}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("input",{type:"text",value:u,onChange:p=>{v(p.target.value),f(null)},onKeyDown:p=>p.key==="Enter"&&h(),placeholder:"channel name",className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-40"}),e.jsx("button",{onClick:h,disabled:k||!u.trim(),className:"px-2 py-1 rounded text-[10px] font-mono bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 disabled:opacity-40 transition-colors",children:k?"…":"Try"})]}),N&&e.jsx("div",{className:"mt-1",children:N.success?e.jsx(i,{label:"result",children:e.jsx(d,{fn:"plaintext",value:N.text??"(empty)",color:"teal"})}):e.jsx(i,{label:"error",children:e.jsx(d,{fn:"error",value:N.error??"unknown",color:"red"})})})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"useDecodedMessage() store result:"}),y?y.decoded?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:y.decoded.channelName??"?",color:"teal"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:y.decoded.text,color:"teal"})})]}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"failed",color:"red"})}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"pending",color:"zinc"})})]})]})})]})}function Rt(t){const{rawHex:s,display:r,protocolPacket:c,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m,packetHash:g,packet:u}=t,v=!!s&&s.length>=4;return e.jsxs(G,{children:[e.jsx(K,{className:"w-full mt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-mono text-fg-muted",children:"🔬"}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-fg-muted",children:"Wire Inspection"}),e.jsx("span",{className:"text-[9px] text-fg-muted/50",children:"observatory diagnostic — not a runtime stage"})]})}),e.jsx(V,{children:e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-lg p-3 space-y-1 bg-surface/30",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/50 mb-2",children:"The backend parsed these fields server-side. This panel verifies the wire-level encoding client-side."}),v?e.jsxs(e.Fragment,{children:[e.jsx(Dt,{rawHex:s,display:r,protocolPacket:c,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m}),e.jsx(Lt,{decoded:a,packet:u}),e.jsx(Mt,{protocolPacket:c,packetHash:g})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function fe(t){if(!t)return[{fn:"decode",value:"no raw_packet",group:"decode",color:"zinc"}];switch(t.type){case"advert":{const s=t,r=[{fn:"decode.nodeType",value:s.nodeType,group:"decode",color:"blue"}];return s.name&&r.push({fn:"decode.name",value:s.name,group:"decode",color:"blue"}),s.latitude!=null&&s.longitude!=null&&r.push({fn:"decode.location",value:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`,group:"decode",color:"blue"}),r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:"blue"}),r}case"trace":{const s=t;return[{fn:"decode.traceTag",value:s.traceTag,group:"decode",color:"blue"},{fn:"decode.hops",value:s.pathHashes.length>0?s.pathString:"empty",group:"decode",color:"blue"},{fn:"decode.snr",value:s.snrValues.length>0?`${s.snrValues.length} values`:"none",group:"decode",color:s.snrValues.length>0?"blue":"zinc"},{fn:"decode.complete",value:s.isComplete?"yes":"partial",group:"decode",color:s.isComplete?"green":"amber"}]}case"path":{const s=t,r=[{fn:"decode.pathLength",value:String(s.pathLength),group:"decode",color:"blue"},{fn:"decode.path",value:s.path.length>0?s.pathString:"empty",group:"decode",color:"blue"}];return s.extraType!=null&&r.push({fn:"decode.extraType",value:s.extraTypeName??String(s.extraType),group:"decode",color:"purple"}),s.extraData&&r.push({fn:"decode.extraData",value:`${s.extraData.length/2}B`,group:"decode",color:"purple"}),r}case"ack":return[{fn:"decode.crc",value:t.crc,group:"decode",color:"blue"}];case"grp_txt":return[{fn:"decode.channelHash",value:t.channelHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:"true — decrypt at cascade",group:"decode",color:"zinc"}];case"grp_data":{const s=t;return[{fn:"decode.channelHash",value:s.channelHash,group:"decode",color:"blue"},{fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"}]}case"txt_msg":{const s=t;return[{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:s.encrypted?"true":"false",group:"decode",color:s.encrypted?"zinc":"green"},...s.encrypted?[]:[{fn:"decode.text",value:s.text,group:"decode",color:"blue"}]]}case"multipart":{const s=t;return[{fn:"decode.part",value:`${s.partNumber+1}/${s.totalParts}`,group:"decode",color:"blue"},{fn:"decode.msgId",value:s.messageId,group:"decode",color:"blue"}]}case"control":{const s=t,r=[{fn:"decode.subtype",value:s.subtypeName,group:"decode",color:"blue"}];return s.nodeTypeName&&r.push({fn:"decode.nodeType",value:s.nodeTypeName,group:"decode",color:"blue"}),s.snrDb!=null&&r.push({fn:"decode.snr",value:`${s.snrDb>0?"+":""}${s.snrDb.toFixed(1)} dB`,group:"decode",color:"blue"}),s.tag&&r.push({fn:"decode.tag",value:s.tag,group:"decode",color:"blue"}),s.publicKey&&r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:s.publicKeyFull?"green":"blue"}),s.typeFilter!=null&&r.push({fn:"decode.typeFilter",value:s.typeFilterDescription??`0x${s.typeFilter.toString(16)}`,group:"decode",color:"blue"}),s.prefixOnly!=null&&r.push({fn:"decode.prefixOnly",value:String(s.prefixOnly),group:"decode",color:"blue"}),!s.nodeTypeName&&!s.tag&&(r.push({fn:"decode.subtypeFlags",value:`0x${s.subtypeFlags.toString(16)}`,group:"decode",color:"blue"}),r.push({fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"})),r}case"req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"response":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"anon_req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.senderPubKey",value:s.senderPublicKey,group:"decode",color:"green"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"generic":return[{fn:"decode.raw",value:`${t.length}B`,group:"decode",color:"zinc"}];default:return[]}}function At({packet:t,pipeline:s,rawHex:r,traceTagIndex:c,neighbors:a}){const{enrichment:n,timing:l,display:o,protocolPacket:x,decoded:m,parseError:g,payloadVersion:u,isV1:v,isV2:N,analysis:f}=s,$=(t.type??t.payload_type)===et,h=f.dupeAnalysis,y=T.useRef(0),p=T.useMemo(()=>{if(!$)return null;const D=performance.now(),L=yt(t,c,a);return y.current=performance.now()-D,L},[t,c,a,$]),_=l.enrich+y.current,H=[];f.byteLen&&H.push(`${f.byteLen}B`),H.push(f.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):f.pathHopCount>0&&H.push(`${f.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const C=H.join(" — ");return e.jsxs(le,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:C,timeMs:_,children:[e.jsx(Rt,{rawHex:r,display:o,protocolPacket:x,decoded:m,parseError:g,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(U,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(M,{color:"green",children:"PacketCache"}):e.jsx(M,{color:"amber",children:"computed"}),e.jsx("span",{className:"text-[10px] text-fg-muted ml-1.5",children:n.preComputed?"pre-enriched by real pipeline":"synthetic — computed on the fly"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 mb-1",children:[e.jsx(d,{fn:"_byteLength",value:n.byteLength!=null?`${n.byteLength}B`:void 0,color:"blue"}),e.jsx(d,{fn:"_hopCount",value:String(n.hopCount),color:"blue"}),e.jsx(d,{fn:"_isZeroHop",value:String(n.isZeroHop),color:n.isZeroHop?"green":"blue"}),n.isZeroHop&&e.jsx(M,{color:"blue",children:"direct"}),n.channelHash!=null&&e.jsx(d,{fn:"_channelHash",value:n.channelHash,color:"blue"}),$&&t._traceTag&&e.jsx(d,{fn:"_traceTag",value:t._traceTag,color:"blue"})]}),n.advertSender||n.advertNodeType!=null||n.advertName!=null?e.jsxs("div",{className:"mt-1 mb-1",children:[e.jsx("p",{className:"text-[10px] text-sys-blue font-medium mb-0.5",children:"ADVERT Enrichment"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1",children:[n.advertSender&&e.jsx(d,{fn:"_advertSender",value:n.advertSender.slice(0,16)+"…",color:"blue"}),n.advertNodeType!=null&&e.jsx(d,{fn:"_advertNodeType",value:ke(n.advertNodeType),color:"blue"}),n.advertName!=null&&e.jsx(d,{fn:"_advertName",value:n.advertName,color:"blue"}),n.advertFlags!=null&&e.jsx(d,{fn:"_advertFlags",value:`0x${n.advertFlags.toString(16).padStart(2,"0")}`,color:"blue"}),n.advertHasLocation!=null&&e.jsx(d,{fn:"_advertHasLocation",value:String(n.advertHasLocation),color:"blue"}),n.advertHasName!=null&&e.jsx(d,{fn:"_advertHasName",value:String(n.advertHasName),color:"blue"}),n.advertLatitude!=null&&n.advertLongitude!=null&&e.jsx(d,{fn:"location",value:`${n.advertLatitude.toFixed(4)}, ${n.advertLongitude.toFixed(4)}`,color:"blue"})]})]}):e.jsx("p",{className:"text-[10px] text-fg-muted/30 mb-1",children:"ADVERT fields: N/A (non-ADVERT packet)"}),e.jsx(E,{title:"Payload Decode"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${m?"bg-sys-blue":"bg-zinc-500/40"}`}),e.jsx("span",{className:"font-mono text-[10px] font-medium text-fg-primary",children:"decodePayload()"}),e.jsx("span",{className:"text-[9px] text-fg-muted",children:"sync — wire data only, no crypto"})]}),e.jsx("div",{className:"ml-3",children:m?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:fe(m).map((D,L)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:D.fn,value:D.value,color:D.color})},L))}):e.jsx(S,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"dupe:"}),h.isDuplicate?e.jsx(d,{fn:"is_duplicate",value:"true",color:"purple"}):e.jsx(S,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(S,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"TRACE SRC:"}),p.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:p.inferredSrc,color:"purple"}),p.inferredName&&e.jsx(d,{fn:"name",value:p.inferredName,color:"purple"})]}):e.jsx(S,{children:"unresolvable"}),e.jsx(_e,{color:"purple",children:p.method}),e.jsxs(S,{children:["(",p.confidence,")"]}),e.jsxs(S,{children:["siblings=",p.siblingCount]})]})]}),(()=>{const D=f.pType!=null?`0x${f.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,L=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=fe(m),R=f.signalClass==="excellent"||f.signalClass==="good"?"green":f.signalClass==="fair"?"amber":"red",b=f.senderTier==="pubkey"?"green":f.senderTier==="prefix"?"amber":f.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:f.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:f.routeTypeName,raw:L,group:"wire",color:"blue"},{fn:"src_hash",value:t.src_hash||void 0,group:"wire",color:"blue"},{fn:"rssi",value:`${t.rssi}dBm`,group:"wire",color:"blue"},{fn:"snr",value:`${t.snr}dB`,group:"wire",color:"blue"},{fn:"_byteLength",value:f.byteLen?`${f.byteLen}B`:void 0,group:"enrichment",color:"blue"},{fn:"_hopCount",value:String(n.hopCount),group:"enrichment",color:"blue"},{fn:"_isZeroHop",value:String(n.isZeroHop),group:"enrichment",color:"blue"},{fn:"_advertSender",value:n.advertSender||void 0,group:"enrichment",color:"blue"},{fn:"_advertNodeType",value:f.advertType!=="unknown"?f.advertType:void 0,group:"enrichment",color:"blue"},{fn:"_advertName",value:n.advertName||void 0,group:"enrichment",color:"blue"},{fn:"_channelHash",value:n.channelHash||void 0,group:"enrichment",color:"blue"},...P,{fn:"is_duplicate",value:String(h.isDuplicate),group:"analysis",color:"purple"},p!=null&&p.inferredSrc?{fn:"traceSrc",value:p.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:f.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:f.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:f.senderTier,group:"analysis",color:b},{fn:"_origin",value:f.origin,group:"analysis",color:f.origin==="tx_local"?"green":f.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:f.pathAvail?`${f.pathHopCount} hops`:"none",group:"analysis",color:f.pathAvail?"green":"zinc"},{fn:"_age",value:f.age,group:"analysis",color:f.age==="live"||f.age==="recent"?"green":"zinc"},...h.dupeCount>0?[{fn:"_dupeCount",value:`×${h.dupeCount}`,group:"analysis",color:"purple"},...h.rssiRange?[{fn:"_multipath",value:`Δ${Math.abs(h.rssiRange[1]-h.rssiRange[0])}dB`,group:"analysis",color:Math.abs(h.rssiRange[1]-h.rssiRange[0])>6?"amber":"green"}]:[]]:[],...t.lbt_attempts!=null?[{fn:"_lbt",value:`${t.lbt_attempts} attempt${t.lbt_attempts!==1?"s":""}`,group:"analysis",color:(t.lbt_attempts??0)>1?"amber":"green"}]:[],...t.drop_reason?[{fn:"_dropReason",value:t.drop_reason,group:"analysis",color:"red"}]:[]];return e.jsx(se,{tokens:w})})()]})})]})}function be(t){switch(t){case"excellent":return"green";case"good":return"green";case"fair":return"amber";case"poor":return"red";case"critical":return"red";default:return"zinc"}}function ye(t){return`${Math.round(t*100)}%`}function je(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function Ft({hops:t}){return t.length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle/40",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/40 uppercase tracking-widest font-mono mb-1.5",children:"per-hop trace inspection"}),e.jsx("div",{className:"space-y-1",children:t.map(s=>e.jsx(U,{prefix:`trace.hop[${s.hopIndex}]`,children:e.jsxs("div",{className:"border border-edge-subtle/40 rounded px-2 py-1.5",children:[e.jsxs(i,{label:"link",children:[e.jsx(re,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(_e,{color:be(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(F,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:be(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:je(s.fromName,s.fromHash,s.fromPrefix),color:s.fromHash?s.fromConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:je(s.toName,s.toHash,s.toPrefix),color:s.toHash?s.toConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(se,{label:"trace contributes",tokens:Et(t)})]})}function Et(t){const s=t.reduce((n,l)=>n+(l.fromHash?1:0)+(l.toHash?1:0),0),r=t.length*2,c=r-s,a=t.length>0?t.reduce((n,l)=>n+l.snrRaw,0)/t.length:0;return[{fn:"hops",value:String(t.length),group:"wire",color:"blue"},{fn:"resolved",value:`${s}/${r}`,group:"worker",color:"green"},...c>0?[{fn:"ghosts",value:String(c),group:"worker",color:"purple"}]:[],{fn:"avgSnr",value:`${a.toFixed(1)} dB`,group:"analysis",color:a>=5?"green":a>=0?"amber":"red"}]}function Ot(t){if(!t)return"never";const s=Math.floor((Date.now()-t)/1e3);return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`}function zt(t){if(!t)return[];const s=t.decoded;if(!s)return[{fn:"decrypt.result",value:"failed",group:"crypto",color:"red"}];if(!s.decrypted)return[{fn:"decrypt.result",value:"no key match",group:"crypto",color:"zinc"}];const r=[];return s.channelName&&r.push({fn:"decrypt.channelName",value:s.channelName,group:"crypto",color:"teal"}),s.senderName&&r.push({fn:"decrypt.senderName",value:s.senderName,group:"crypto",color:"teal"}),s.text&&r.push({fn:"decrypt.text",value:s.text,group:"crypto",color:"teal"}),s.timestamp&&r.push({fn:"decrypt.timestamp",value:new Date(s.timestamp*1e3).toISOString().slice(11,19),group:"crypto",color:"teal"}),s.macCorrupted&&r.push({fn:"decrypt.macCorrupted",value:"true",group:"crypto",color:"amber"}),r}function Bt({packet:t,decrypted:s,pipeline:r}){var b;const c=J(w=>w.isComputing),a=J(w=>w.lastUpdated),n=J(w=>w.lastComputeTimeMs),l=J(w=>w.topology.edges.length),o=J(w=>w.topology.discoveredNodes.length),x=tt(),m=st(),g=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),f=me(w=>w.initialDecodeComplete),k=t.type??t.payload_type,$=k===O.GRP_TXT||k===O.GRP_DATA,h=k===O.TRACE,y=k===O.PATH,p=$,_=[{label:"full",detail:"all GRP_TXT → decryption worker",active:p&&f,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!f,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!p,color:"zinc"}],H=zt(s),C=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,D=c?"running":`${l}e ${o}g`,L=u?"running":`${v}n`,P=p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A",R=`topo ${c?"○":"✓"} ${D} · spark ${u?"○":"✓"} ${L} · decrypt ${P}`;return e.jsx(le,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:R,children:e.jsx(U,{prefix:"cascade",children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 py-1.5 text-[11px] font-mono",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"topology"}),e.jsxs("span",{className:"text-fg-muted",children:[l,"e ",o,"g"]}),(h||y)&&e.jsx("span",{className:"text-sys-green text-[9px]",children:"↑signal"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"sparkline"}),e.jsxs("span",{className:"text-fg-muted",children:[v,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.isDecoding?"bg-sys-amber animate-pulse":p?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:p?"text-sys-teal":"text-fg-muted",children:p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A"})]})]}),e.jsxs(G,{defaultOpen:h||y,children:[e.jsx(K,{className:"text-[10px] w-full border-t border-edge-subtle pt-1.5",children:e.jsx("span",{className:"font-mono text-fg-muted/50",children:"topology detail…"})}),e.jsx(V,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:c?"running":"idle",color:c?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Ot(a),color:"zinc"}),n>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",n<1e3?`${n.toFixed(0)}ms`:`${(n/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(l),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(o),color:"purple"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(x.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(x.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(x.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${x.meanSnr.toFixed(1)} dB`,color:x.meanSnr>=5?"green":x.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${x.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(x.avgConfidence*100)}%`,color:"zinc"})]}),h&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(x.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(x.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(x.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(x.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(x.qualityCounts.critical),color:"red"})]}),g.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(g.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(g.confirmedLinks.length),color:"teal"})]})]}),h&&(r==null?void 0:r.traceHopDetail)&&e.jsx(Ft,{hops:r.traceHopDetail})]})})]}),p&&e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"mode",children:e.jsx(ae,{options:_,nextFn:"queueDecryption()"})}),e.jsx(i,{label:"result",children:e.jsx(d,{fn:"decrypt",value:C?"decrypted":s?"failed":"pending",color:C?"teal":s?"red":"zinc"})}),C&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-1",children:H.map((w,oe)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:w.fn,value:w.value,color:w.color})},oe))})]})}),(()=>{const w=[{fn:"topology.edges",value:String(l),group:"worker",color:"green"},{fn:"topology.ghostNodes",value:String(o),group:"worker",color:"purple"},{fn:"sparkline.nodes",value:`${v}`,group:"worker",color:"green"},...m?[{fn:"trace.directedLinks",value:String(x.totalDirectedLinks),group:"worker",color:"teal"},{fn:"trace.meanSnr",value:`${x.meanSnr.toFixed(1)} dB`,group:"worker",color:"teal"}]:[],...H];return e.jsx(se,{tokens:w})})()]})})})}function It(t,s,r,c){var n;const a=t.src_hash?Se(t.src_hash):"";if(t._advertSender&&s.hash&&s.confident)return{tier:1,label:"_advertSender → pubkey",detail:"ADVERT carried full 32-byte public key — definitive match"};if(c&&s.confident&&((n=s.name)==null?void 0:n.toLowerCase())===c.toLowerCase())return{tier:1.5,label:"decrypt.senderName → nameToHash",detail:`Decrypted sender name “${c}” matched neighbor — high-confidence`};if(a&&r.crossClassPrefixes.has(a))return{tier:2,label:"cross-class prefix",detail:"Prefix has mixed types (repeater + non-repeater); payload type narrows to one class"};if(s.confident){const l=r.prefixIndex.get(a);return(l==null?void 0:l.length)===1?{tier:3,label:"single candidate",detail:"Only one node matches this prefix — unambiguous"}:{tier:3,label:"resolver",detail:"Multi-signal scoring selected best candidate from collision set"}}return{tier:4,label:"ambiguous",detail:"Cannot confidently resolve — multiple same-class candidates, insufficient scoring separation"}}function Gt(t,s){const r=t.original_path??t.forwarded_path,c=new Set;if(r&&Array.isArray(r))for(const a of r){const n=String(a).toUpperCase();n.length>=2&&!rt(n,s)&&c.add(n)}return c}function Kt(t,s,r,c,a,n,l){const o=Math.floor(Date.now()/1e3),x=new Map(r.map(m=>[m.hash,m]));return t.map(m=>{const g=s[m.hash],u=x.get(m.hash);let v=!0,N="";c!=="unknown"?m.type!=="unknown"&&m.type!==c?(v=!1,N=`${m.type} ≠ required ${c}`):m.type===c?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const f=!!(g!=null&&g.zero_hop),k=(g==null?void 0:g.last_seen)??0;let $=0;if(f&&k>0){const b=(o-k)/3600;$=50*Math.exp(-b/l)}let h=0;if(k>0){const b=(o-k)/3600;h=Math.exp(-b/n)}const y=h*20,p=!!(g!=null&&g.latitude&&(g!=null&&g.longitude)&&(g.latitude!==0||g.longitude!==0)),_=p?5:0,H=(u==null?void 0:u.advertCount)??0,C=Math.min(H*2,30),D=(u==null?void 0:u.forwarderPrefixes.size)??0,L=Math.min(D*3,15);let P=0;if(u&&u.totalForwarderObservations>0&&a.size>0){let b=0;for(const w of a)u.forwarderPrefixes.has(w)&&b++;P=b/a.size}const R=$+y+_+C+L;return{hash:m.hash,name:m.name,type:m.type,roleCompatible:v,roleReason:N,zeroHop:f,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,g)=>g.total-m.total)}function Vt({packet:t,pipeline:s,resolved:r,resolveTimeMs:c,advertName:a,neighbors:n,decrypted:l}){var ie,de;const o=Y(j=>j.neighborContext),x=Y(j=>j.topologyProfiles),m=Y(j=>j.config),{analysis:g}=s,u=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Se(t.src_hash):"",N=v?o.prefixIndex.get(v)??[]:[],f=v?x.get(v)??[]:[],k=g.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=g.inferredType,y=g.advertType,p=g.effectiveType,_=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((ie=l==null?void 0:l.decoded)==null?void 0:ie.senderName)??null,C=It(t,u,o,H),D=T.useMemo(()=>Gt(t,v),[t,v]),L=g.pathLen,P=T.useMemo(()=>Kt(N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours]),R=P.filter(j=>!j.roleCompatible),b=P.filter(j=>j.roleCompatible),w=t._advertSender?o.pubKeyMap.get(t._advertSender)??null:null,oe=C.tier===1,De=[{fn:"src_hash",value:v||"",active:!!v,color:"blue"},{fn:"_advertSender",value:t._advertSender?t._advertSender.slice(0,12)+"…":"",active:!!t._advertSender,color:"blue"},{fn:"_advertNodeType",value:_?`0x${_}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:L!=null?L===0?"zero-hop":String(L):"",active:L!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!w,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!w,color:"zinc"}],Pe=[{label:"payload",detail:`inferDeviceType(0x${$}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:_?`mapAdvertTypeCode(0x${_}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:p==="unknown",color:"zinc"}],Me=u.name??((de=u.hash)==null?void 0:de.slice(0,12))??"?",Re=u.confident?"confident":"ambiguous",Ae=`→ ${Me} (${Re}, Tier ${C.tier})`;return e.jsx(le,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Ae,timeMs:c,children:e.jsx(U,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(St,{tokens:De,nextFn:"resolvePacketSource()"})}),t.src_hash?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(ae,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:w?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:w,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),u.name&&a===u.name&&e.jsx(S,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(M,{color:"green",children:"Tier 1"}),e.jsx(S,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(S,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(S,{children:"no _advertSender — skip to prefix resolution"})})})]}),oe?e.jsx("div",{className:"border-t border-edge-subtle py-2",children:e.jsx("p",{className:"text-[11px] text-fg-muted/40 font-mono ml-3",children:"Steps 2–5 bypassed — pubkey definitive"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"2"})," ","CANDIDATE POOL — ",N.length," node",N.length!==1?"s":"",' match "',v,'"']}),e.jsxs("div",{className:"space-y-0.5 ml-3",children:[P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"break-all text-[10px]",children:j.hash}),e.jsx(M,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]},j.hash)),N.length===0&&e.jsx(S,{children:"no known nodes for this prefix"})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(ae,{options:Pe,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:p,color:p!=="unknown"?h!=="unknown"?"amber":"green":"zinc"})})})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"4"})," ","ROLE-TYPE SCRUB"]}),e.jsx("div",{className:"space-y-0.5 ml-3",children:P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:j.roleCompatible?"text-sys-green":"text-sys-red",children:j.roleCompatible?"✓":"✗"}),e.jsx("span",{className:`break-all text-[10px] ${j.roleCompatible?"":"line-through text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(S,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),R.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[R.length," eliminated, ",b.length," surviving"]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),b.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):b.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(S,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:b[0].hash}),b[0].name&&e.jsx(S,{c:"text-fg-muted ml-1",children:b[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[b.length," candidates scored…"]})}),e.jsx(V,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:b.map(j=>{const Q=j.hash===u.hash;return e.jsxs("div",{className:`text-[11px] leading-relaxed rounded px-2 py-1 ${Q?"bg-sys-green/8 border border-sys-green/20":"bg-zinc-500/5"}`,children:[e.jsxs("div",{className:"flex gap-2 items-center mb-0.5",children:[e.jsx(S,{c:Q?"text-sys-green":"text-fg-muted",children:Q?"→":" "}),e.jsx("span",{className:`break-all text-[10px] ${Q?"text-fg-primary":"text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:Q?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]}),e.jsxs("div",{className:"ml-4 flex flex-wrap gap-x-3 gap-y-0.5",children:[e.jsxs("span",{children:[e.jsx(S,{children:"zero_hop:"})," ",e.jsx(S,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"recency:"})," ",e.jsx(S,{c:"text-fg-primary",children:mt(j.lastSeen)})," ",e.jsxs(M,{color:ee(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"gps:"})," ",e.jsx(S,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"adverts:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(M,{color:ee(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"topo:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(M,{color:ee(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(S,{children:"score ≈"})," ",e.jsx(S,{c:"text-fg-primary font-bold",children:j.total.toFixed(1)})]})]},j.hash)})})})]})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:u.hash?e.jsx(d,{fn:"resolved.hash",value:u.hash,color:"green"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:u.type,color:u.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:u.name?e.jsx(d,{fn:"resolved.name",value:u.name,color:u.confident?"green":"amber"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(S,{c:u.confident?"text-sys-green":"text-sys-red",children:String(u.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(M,{color:C.tier<=2?"green":C.tier===3?"amber":"red",children:C.tier}),e.jsx(S,{c:"text-fg-primary ml-1",children:C.label})]})]})]})]}):e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx(S,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),u.confident?e.jsxs(S,{c:"text-sys-green",children:["→ resolved via ",C.label]}):e.jsx(S,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:u.hash??"null",group:"resolution",color:u.confident?"green":"zinc"},{fn:"resolved.type",value:u.type,group:"resolution",color:u.type!=="unknown"?u.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:u.name??"null",group:"resolution",color:u.confident?"green":u.name?"amber":"zinc"},{fn:"resolved.confident",value:String(u.confident),group:"resolution",color:u.confident?"green":"red"}];return e.jsx(se,{tokens:j})})()]})})})}const Ut={id:"packet-parse",label:"Packet Parse",inputs:["rawPacket"],outputs:["parsedPacket","decoded","headerFields"],emits:[{fn:"routeType",group:"wire",color:"blue"},{fn:"payloadType",group:"wire",color:"blue"},{fn:"pathLength",group:"wire",color:"blue"},{fn:"version",group:"wire",color:"blue"}],async:!1,observatoryStage:0},qt={id:"enrichment",label:"Ingestion Enrichment",inputs:["parsedPacket"],outputs:["advertSender","channelHash","hopData","byteLength"],emits:[{fn:"_advertSender",group:"enrichment",color:"blue"},{fn:"_advertNodeType",group:"enrichment",color:"blue"},{fn:"_channelHash",group:"enrichment",color:"blue"},{fn:"_hopCount",group:"enrichment",color:"blue"},{fn:"_isZeroHop",group:"enrichment",color:"blue"},{fn:"_byteLength",group:"enrichment",color:"blue"}],async:!1,observatoryStage:1},Wt={id:"topology",label:"Topology Analysis",inputs:["packets","neighbors","srcHashResolver"],outputs:["edges","nodeMetrics","pathHealth","ghostNodes","centrality","loops"],emits:[{fn:"edges",group:"worker",color:"green"},{fn:"ghostNodes",group:"worker",color:"purple"},{fn:"loops",group:"analysis",color:"amber"},{fn:"nodeMetrics",group:"worker",color:"green"},{fn:"pathHealth",group:"worker",color:"green"},{fn:"centrality",group:"worker",color:"green"}],async:!0,worker:"topology.worker.ts",observatoryStage:2},Yt={id:"trace-enrichment",label:"Trace Link Quality",inputs:["packets","prefixLookup","srcHashResolver","edges","pathHealth","nodeMetrics"],outputs:["traceLinks","traceLinkSummary","traceDisambiguationFeedback"],emits:[{fn:"traceLinks.directed",group:"worker",color:"teal"},{fn:"traceLinks.bidir",group:"worker",color:"teal"},{fn:"traceSummary.meanSnr",group:"analysis",color:"green"},{fn:"traceSummary.medianSnr",group:"analysis",color:"zinc"},{fn:"traceSummary.confidence",group:"analysis",color:"zinc"},{fn:"feedback.confirmed",group:"worker",color:"teal"},{fn:"feedback.links",group:"worker",color:"teal"}],async:!1,observatoryStage:2},Zt={id:"disambiguation",label:"Source Disambiguation",inputs:["packets","neighbors","decodedMessages"],outputs:["srcHashResolverMap","neighborContext"],emits:[{fn:"resolvedHash",group:"resolution",color:"purple"},{fn:"resolvedName",group:"resolution",color:"purple"},{fn:"resolvedType",group:"resolution",color:"purple"},{fn:"confidence",group:"resolution",color:"green"}],async:!1,observatoryStage:3},Xt={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},Qt={id:"decryption",label:"Channel Decryption",inputs:["packets","channelKeys"],outputs:["decodedMessages"],emits:[{fn:"decrypt.text",group:"crypto",color:"teal"},{fn:"decrypt.senderName",group:"crypto",color:"teal"},{fn:"decrypt.channelName",group:"crypto",color:"teal"},{fn:"decrypt.macCorrupted",group:"crypto",color:"amber"}],async:!0,worker:"decryption.worker.ts",observatoryStage:2},Jt={id:"decoded-content",label:"Decoded Content Policy",inputs:["decodedMessages","packets"],outputs:["decodedContent","contentInheritance"],emits:[{fn:"content.senderName",group:"crypto",color:"teal"},{fn:"content.text",group:"crypto",color:"teal"},{fn:"content.channelName",group:"crypto",color:"teal"},{fn:"content.corrupted",group:"crypto",color:"amber"},{fn:"content.inherited",group:"analysis",color:"purple"}],async:!1},Z=[Ut,qt,Wt,Yt,Zt,Xt,Qt,Jt],es=new Map(Z.map(t=>[t.id,t])),ts=new Map;for(const t of Z)for(const s of t.emits)ts.set(s.fn,t);const $e=new Map;for(const t of Z)for(const s of t.outputs)$e.set(s,t);function ss(){const t=new Map,s=new Map;for(const a of Z)t.has(a.id)||t.set(a.id,0),s.has(a.id)||s.set(a.id,new Set);for(const a of Z)for(const n of a.inputs){const l=$e.get(n);if(l&&l.id!==a.id){const o=s.get(l.id);o.has(a.id)||(o.add(a.id),t.set(a.id,(t.get(a.id)??0)+1))}}const r=[];for(const[a,n]of t)n===0&&r.push(a);const c=[];for(;r.length>0;){const a=r.shift(),n=es.get(a);n&&c.push(n);for(const l of s.get(a)??[]){const o=(t.get(l)??1)-1;t.set(l,o),o===0&&r.push(l)}}for(const a of Z)c.includes(a)||c.push(a);return c}const ns={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function rs({stage:t,isActive:s,onClick:r}){const c=t.observatoryStage!=null?ns[t.observatoryStage]??"text-fg-muted":"text-fg-muted/40";return e.jsxs("button",{type:"button",onClick:r,className:` flex items-center gap-1.5 w-full px-1.5 py-1 rounded transition-base text-left ${s?"bg-sys-blue/10 ring-1 ring-sys-blue/30":"hover:bg-zinc-500/5"} `,children:[e.jsx("span",{className:`font-mono text-[9px] font-bold w-3 shrink-0 text-center ${c}`,children:t.observatoryStage??"·"}),e.jsx("span",{className:"font-mono text-[9px] text-fg-primary truncate flex-1",children:t.label}),t.async&&e.jsx("span",{className:"font-mono text-[7px] px-1 py-px rounded bg-sys-amber/15 text-sys-amber shrink-0 leading-tight",children:"⚡"}),t.emits.length>0&&e.jsxs("span",{className:"flex items-center gap-px shrink-0",children:[t.emits.slice(0,6).map(a=>{var n;return e.jsx("span",{className:`inline-block w-1 h-1 rounded-full ${((n=I[a.color])==null?void 0:n.dot)??"bg-zinc-500"}`,title:`${a.fn} [${a.group}]`},a.fn)}),t.emits.length>6&&e.jsxs("span",{className:"font-mono text-[7px] text-fg-muted/40 ml-0.5",children:["+",t.emits.length-6]})]})]})}function as({activeStageId:t,onStageClick:s}){const r=T.useMemo(()=>ss(),[]),c=T.useMemo(()=>{const a=new Map;for(const l of r){const o=l.observatoryStage??"other";let x=a.get(o);x||(x=[],a.set(o,x)),x.push(l)}const n=[];for(const l of[0,1,2,3,"other"]){const o=a.get(l);o!=null&&o.length&&n.push({key:l,stages:o})}return n},[r]);return e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-mono text-[8px] text-fg-muted/40 uppercase tracking-widest",children:"Pipeline DAG"}),e.jsxs("span",{className:"font-mono text-[8px] text-fg-muted/30",children:[r.length," stages"]})]}),e.jsx("div",{className:"space-y-px",children:c.map((a,n)=>e.jsxs("div",{children:[n>0&&e.jsx("div",{className:"flex items-center pl-2.5 py-px",children:e.jsx("svg",{width:"6",height:"8",viewBox:"0 0 6 8",className:"text-fg-muted/20",children:e.jsx("path",{d:"M3 0 L3 6 M1 4 L3 6 L5 4",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),a.stages.map(l=>e.jsx(rs,{stage:l,isActive:t===l.id,onClick:s?()=>s(l.id):void 0},l.id))]},String(a.key)))})]})}const ve=200,z={status:"idle",lastDurationMs:null,lastTs:null,runCount:0};function ls(t,s,r){var c,a,n;switch(t.type){case"transport:ws:state":s.wsState=((c=t.data)==null?void 0:c.state)??r.wsState;break;case"transport:ws:packet":s.wsPacketCount=(s.wsPacketCount??r.wsPacketCount)+1;break;case"transport:ws:stats":s.wsStatsCount=(s.wsStatsCount??r.wsStatsCount)+1;break;case"transport:rest:stats":s.restStatsCount=(s.restStatsCount??r.restStatsCount)+1;break;case"transport:rest:packets":s.restPacketsCount=(s.restPacketsCount??r.restPacketsCount)+1;break;case"store:packets:ws-merge":s.wsMergeCount=(s.wsMergeCount??r.wsMergeCount)+1;break;case"cascade:hydrate":s.lastHydrateTs=t.ts,s.hydrateCount=(s.hydrateCount??r.hydrateCount)+1;break;case"worker:topology:start":case"worker:sparkline:start":{const l=t.type.split(":")[1],o=s.workers??r.workers,x=o[l]??{...z};s.workers={...o,[l]:{...x,status:"running",lastTs:t.ts}}}break;case"worker:topology:done":case"worker:sparkline:done":{const l=t.type.split(":")[1],o=s.workers??r.workers,x=o[l]??{...z},m=((a=t.data)==null?void 0:a.ms)??null;s.workers={...o,[l]:{...x,status:"done",lastDurationMs:m,lastTs:t.ts,runCount:x.runCount+1}}}break;case"worker:decryption:batch":{const l=s.workers??r.workers,o=l.decryption??{...z},x=((n=t.data)==null?void 0:n.ms)??null;s.workers={...l,decryption:{...o,status:"done",lastDurationMs:x,lastTs:t.ts,runCount:o.runCount+1}}}break;case"pipeline:disambig:recompute":s.disambigCount=(s.disambigCount??r.disambigCount)+1;break}}const te=at(t=>({events:[],eventCount:0,wsState:"disconnected",wsPacketCount:0,wsStatsCount:0,restStatsCount:0,restPacketsCount:0,workers:{topology:{...z},sparkline:{...z},decryption:{...z}},wsMergeCount:0,lastHydrateTs:null,hydrateCount:0,disambigCount:0,lastDisambigMs:null,_pushBatch:s=>t(r=>{if(s.length===0)return r;let c=[...r.events,...s];c.length>ve&&(c=c.slice(c.length-ve));const a={events:c,eventCount:r.eventCount+s.length};for(const n of s)ls(n,a,r);return a}),clear:()=>t({events:[],eventCount:0,wsState:"disconnected",wsPacketCount:0,wsStatsCount:0,restStatsCount:0,restPacketsCount:0,workers:{topology:{...z},sparkline:{...z},decryption:{...z}},wsMergeCount:0,lastHydrateTs:null,hydrateCount:0,disambigCount:0,lastDisambigMs:null})}));let W=null,B=[],X=null;function os(){if(X=null,B.length===0)return;const t=B;B=[],te.getState()._pushBatch(t)}function cs(){W||(B=[],W=lt.subscribe(t=>{B.push(t),X===null&&(X=requestAnimationFrame(os))}))}function is(){if(W==null||W(),W=null,X!==null&&(cancelAnimationFrame(X),X=null),B.length>0){const t=B;B=[],te.getState()._pushBatch(t)}}function ds(t){switch(t){case"active":return"●";case"skipped":return"○";case"inferred":return"◌"}}function us(t){switch(t){case"active":return"text-sys-green";case"skipped":return"text-fg-muted/30";case"inferred":return"text-sys-amber"}}function ps(t){switch(t){case"transport":return"text-sys-blue";case"store":return"text-sys-amber";case"worker":return"text-sys-violet";case"pipeline":return"text-sys-green";case"consumer":return"text-sys-teal"}}function xs(t,s,r,c,a){var m,g;const n=[];if(a?n.push({label:"Hex Input",detail:"Manual hex — no transport",status:"skipped",lane:"transport"}):s.age==="live"||s.age==="recent"?n.push({label:"WebSocket",detail:"ws:packet → real-time push",status:"active",lane:"transport"}):n.push({label:"REST Poll",detail:"fetchPackets → packetCache.poll()",status:"inferred",lane:"transport"}),!a){n.push({label:"Cache Merge",detail:"packetCache.mergePacketsDirectly()",status:"active",lane:"store"});const u=s.age==="live"||s.age==="recent";n.push({label:"Flash",detail:u?"flashReceived++ → sidebar blink":"Not newest — no flash",status:u?"active":"skipped",lane:"store"}),n.push({label:"Hydrate Cascade",detail:"hydrateDownstream() → schedule workers",status:"active",lane:"store"})}const l=s.pathAvail||s.pathHopCount>0;n.push({label:"Topology Worker",detail:l?`Path data (${s.pathHopCount} hops) → edge extraction`:"No path data — still included in batch recompute",status:"active",lane:"worker"}),n.push({label:"Sparkline Worker",detail:`Contributes to sparkline for src ${((m=t.src_hash)==null?void 0:m.slice(0,4))??"??"}`,status:"active",lane:"worker"});const o=s.isGrp;n.push({label:"Decryption Worker",detail:o?`GRP_TXT → queued for channel key search${c?" → decrypted ✓":""}`:`${s.payloadTypeName} — not encrypted, skipped`,status:o?"active":"skipped",lane:"worker"}),n.push({label:"Source Disambiguation",detail:r?`→ ${r.name??((g=r.hash)==null?void 0:g.slice(0,8))??"?"} (${r.type}${r.confident?", confident":", ambiguous"})`:"Pending recompute",status:r?"active":"inferred",lane:"pipeline"}),s.isAdvert&&n.push({label:"ADVERT Discovery",detail:"pubkey → extended hash-to-type + name extraction",status:"active",lane:"pipeline"}),o&&(c!=null&&c.decoded)&&n.push({label:"Decoded Content Policy",detail:`macCorrupted=${c.decoded.macCorrupted?"true":"false"} → cross-hash inheritance`,status:"active",lane:"pipeline"});const x=["Packets","Dashboard","Statistics"];return l&&x.push("Map","Graph"),s.isTrace&&x.push("Trace Detail"),n.push({label:"Page Hydration",detail:x.join(", "),status:"active",lane:"consumer"}),n}const hs=[],ms=["transport","store","worker","pipeline","consumer"],gs={transport:"Transport",store:"Store",worker:"Workers",pipeline:"Pipeline",consumer:"Consumers"};function fs(t){return t.replace("transport:","").replace("store:packets:","").replace("cascade:","").replace("worker:","w:").replace("pipeline:","p:").replace("packet","pkt").replace("sparkline","spark").replace("topology","topo").replace("decryption","dec").replace("disambig","dis").replace("recompute","recomp")}function bs(t){return t.startsWith("transport:")?"text-sys-blue":t.startsWith("store:")||t.startsWith("cascade:")?"text-sys-amber":t.startsWith("worker:")?"text-sys-violet":t.startsWith("pipeline:")?"text-sys-green":"text-fg-muted"}const ys=T.memo(function({event:s}){const r=`${(s.ts/1e3).toFixed(1)}s`,c=s.data?Object.entries(s.data).map(([a,n])=>{var l;return`${a}=${typeof n=="number"?((l=n.toFixed)==null?void 0:l.call(n,1))??n:n}`}).join(" "):"";return e.jsxs("div",{className:"flex gap-2 text-[9px] font-mono leading-tight",children:[e.jsx("span",{className:"text-fg-muted/40 w-12 shrink-0 text-right",children:r}),e.jsx("span",{className:`w-20 shrink-0 ${bs(s.type)}`,children:fs(s.type)}),e.jsx("span",{className:"text-fg-muted/60 truncate",children:c})]})});function js({packet:t,pipeline:s,resolved:r,decrypted:c,isSynthetic:a,liveMode:n}){const[l,o]=T.useState(!1);T.useEffect(()=>{if(l)return cs(),()=>{is()}},[l]);const x=s==null?void 0:s.analysis,m=T.useMemo(()=>!t||!x?null:xs(t,x,r,c,a),[t,x,r,c,a]),g=T.useMemo(()=>{if(!m)return null;const h=new Map;for(const y of m){let p=h.get(y.lane);p||(p=[],h.set(y.lane,p)),p.push(y)}return h},[m]),u=te(h=>l?h.events:hs),v=te(h=>l?h.eventCount:0),N=te(h=>h.clear),f=T.useRef(null);T.useEffect(()=>{l&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[v,l]);const k=(m==null?void 0:m.filter(h=>h.status==="active").length)??0,$=(m==null?void 0:m.length)??0;return e.jsxs(G,{defaultOpen:!0,children:[e.jsx(K,{className:"text-[10px]",children:e.jsxs("span",{className:"flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-sys-green",children:"CFT"}),e.jsx("span",{className:"text-fg-muted/40",children:"Control Flow Trace"}),t&&e.jsxs("span",{className:"text-fg-muted/30",children:["— ",k,"/",$," stages active"]})]})}),e.jsx(V,{children:e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 space-y-3",children:[t?g?e.jsx("div",{className:"space-y-2",children:ms.map(h=>{const y=g.get(h);return y?e.jsxs("div",{children:[e.jsx("div",{className:`text-[8px] uppercase tracking-widest font-mono mb-0.5 ${ps(h)}`,children:gs[h]}),y.map((p,_)=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[10px] font-mono leading-snug ml-1",children:[e.jsx("span",{className:`shrink-0 ${us(p.status)}`,children:ds(p.status)}),e.jsx("span",{className:"text-fg-primary",children:p.label}),e.jsx("span",{className:"text-fg-muted/50 truncate",children:p.detail})]},_))]},h):null})}):null:e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-2 text-center",children:"Select a packet to trace its flow"}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>o(h=>!h),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${l?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:l?"● LIVE":"○ LIVE"}),e.jsx("span",{className:"text-[9px] text-fg-muted/40 font-mono",children:l?`${v} events`:"Subscribe to all pipeline events"}),l&&e.jsx("button",{onClick:N,className:"text-[9px] text-fg-muted/40 hover:text-fg-muted font-mono transition-colors ml-auto",children:"clear"})]}),l&&e.jsx("div",{ref:f,className:"max-h-32 overflow-y-auto space-y-px",children:u.length===0?e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-1 text-center",children:"Waiting for events…"}):u.map((h,y)=>e.jsx(ys,{event:h},`${h.ts}-${y}`))})]})})]})}function vs(t){const s=Ne(t.type??t.payload_type??-1).padEnd(7),r=t.packet_hash.slice(0,8),c=(t.src_hash??"—").replace(/^0x/i,"").slice(0,4).toUpperCase(),a=t._hopCount!=null?`${t._hopCount}h`:"",n=ut(t.timestamp);return`${r} ${s} ←${c} ${t.rssi}dBm ${a} ${n}`}function _s(){const t=ot(),s=ct(),r=it(),c=(s==null?void 0:s.neighbors)??{},a=Y(b=>b.resolveSource),n=Y(b=>b.config),l=Y(b=>b.setConfig),[o,x]=T.useState(-1),m=T.useMemo(()=>{let b=t;return o!==-1&&(b=t.filter(w=>(w.type??w.payload_type)===o)),b.slice(-50).reverse()},[t,o]),[g,u]=T.useState(""),[v,N]=T.useState(""),[f,k]=T.useState(!1),$=T.useRef(r);T.useEffect(()=>{f&&r!==$.current&&m.length>0&&(u(m[0].packet_hash),N("")),$.current=r},[r,f,m]),T.useEffect(()=>{!g&&m.length>0&&!v&&u(m[0].packet_hash)},[g,m,v]);const h=T.useMemo(()=>v.trim()?null:m.find(b=>b.packet_hash===g)??null,[g,m,v]),y=T.useMemo(()=>{const b=v.replace(/\s+/g,"").trim();return b?{packet_hash:"manual-hex-input",timestamp:0,rssi:0,snr:0,transmitted:!1,drop_reason:null,is_duplicate:!1,raw_packet:b}:null},[v]),p=h??y,_=!!v.trim(),H=v.trim().replace(/\s+/g,"")||(p==null?void 0:p.raw_packet),C=Ct(p,H,t),D=(C==null?void 0:C.enrichment)??He,L=Ce((p==null?void 0:p.packet_hash)??""),P=T.useRef(0),R=T.useMemo(()=>{if(!p)return null;const b=performance.now(),w=a(p);return P.current=performance.now()-b,w},[p,a]);return e.jsxs("div",{className:"max-w-[960px] mx-auto",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h1",{className:"text-sm font-bold text-fg-primary tracking-wide font-mono",children:"PACKET OBSERVATORY"}),e.jsx("p",{className:"text-[11px] text-fg-muted font-mono",children:"Pipeline introspection — select a packet to trace its journey"})]}),e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 mb-3",children:[e.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[e.jsxs("select",{value:o,onChange:b=>{x(Number(b.target.value)),u("")},className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-36",children:[e.jsx("option",{value:-1,children:"ALL TYPES"}),Object.entries(dt).map(([b,w])=>e.jsxs("option",{value:Number(b),children:["0x",Number(b).toString(16).toUpperCase().padStart(2,"0")," ",w]},b))]}),e.jsxs("select",{value:g,onChange:b=>{u(b.target.value),N("")},className:"surface-input flex-1 min-w-0 px-2 py-1 rounded text-[11px] font-mono text-fg-primary truncate",children:[m.map((b,w)=>e.jsx("option",{value:b.packet_hash,children:vs(b)},`${b.packet_hash}-${w}`)),m.length===0&&e.jsxs("option",{value:"",children:["No packets",o!==-1?" matching filter":" loaded"]})]}),e.jsx("button",{onClick:()=>k(b=>!b),className:`px-2 py-1 rounded text-[11px] font-mono transition-colors shrink-0 ${f?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:f?"● LIVE":"○ LIVE"})]}),e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] text-fg-muted/50 hover:text-fg-muted mt-1.5",children:e.jsx("span",{className:"font-mono",children:"Paste hex…"})}),e.jsx(V,{children:e.jsx("textarea",{value:v,onChange:b=>N(b.target.value),placeholder:"Paste raw packet hex (overrides dropdown)",rows:2,className:"surface-input w-full mt-1 px-2 py-1 rounded text-[11px] font-mono text-fg-primary resize-y"})})]})]}),e.jsxs(G,{children:[e.jsx(K,{className:"text-[11px] mb-3 w-full",children:e.jsxs("span",{className:"flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-fg-muted/50",children:"⚙"}),e.jsx("span",{className:"text-fg-muted/50",children:"Pipeline Config & Dev Tools"}),e.jsxs("span",{className:"text-fg-muted/30 text-[10px]",children:["disambig=",n.disambiguationEnabled?"on":"off"," mac=",n.macCorruptedPolicy," decay=",n.recencyDecayHours,"h"]})]})}),e.jsx(V,{children:e.jsxs("div",{className:"space-y-3 mb-4",children:[e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3",children:[e.jsx("h2",{className:"text-[10px] text-fg-muted/50 uppercase tracking-widest font-mono mb-2",children:"Pipeline Config"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Disambiguation"}),e.jsx("button",{onClick:()=>l({disambiguationEnabled:!n.disambiguationEnabled}),className:`px-2 py-0.5 rounded text-[11px] font-mono transition-colors ${n.disambiguationEnabled?"bg-sys-green/20 text-sys-green":"bg-sys-red/20 text-sys-red"}`,children:n.disambiguationEnabled?"● ON":"○ OFF"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"MAC policy"}),e.jsxs("select",{value:n.macCorruptedPolicy,onChange:b=>l({macCorruptedPolicy:b.target.value}),className:"surface-input px-1.5 py-0.5 rounded text-[11px] font-mono text-fg-primary",children:[e.jsx("option",{value:"strict",children:"strict (drop)"}),e.jsx("option",{value:"name-only",children:"name-only"}),e.jsx("option",{value:"permissive",children:"permissive"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Recency decay"}),e.jsx("input",{type:"range",min:1,max:48,step:1,value:n.recencyDecayHours,onChange:b=>l({recencyDecayHours:Number(b.target.value)}),className:"flex-1 h-1 accent-sys-blue"}),e.jsxs("span",{className:"text-[11px] font-mono text-fg-primary w-8 text-right",children:[n.recencyDecayHours,"h"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Zero-hop decay"}),e.jsx("input",{type:"range",min:12,max:168,step:6,value:n.zeroHopDecayHours,onChange:b=>l({zeroHopDecayHours:Number(b.target.value)}),className:"flex-1 h-1 accent-sys-blue"}),e.jsxs("span",{className:"text-[11px] font-mono text-fg-primary w-10 text-right",children:[n.zeroHopDecayHours,"h"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx(js,{packet:p,pipeline:C,resolved:R,decrypted:L??null,isSynthetic:_,liveMode:f}),e.jsx(as,{})]})]})})]}),p?e.jsxs("div",{className:"space-y-1",children:[e.jsx(Ht,{packet:p,isSynthetic:_}),e.jsx(At,{packet:p,pipeline:C,rawHex:H,traceTagIndex:(C==null?void 0:C.traceTagIndex)??new Map,neighbors:c}),e.jsx(Bt,{packet:p,decrypted:L??void 0,pipeline:C}),e.jsx(Vt,{packet:p,pipeline:C,resolved:R,decrypted:L??void 0,resolveTimeMs:P.current,neighbors:c,advertName:D.advertName})]}):e.jsx("div",{className:"surface-base rounded-lg border border-edge-subtle p-8 text-center",children:e.jsx("p",{className:"text-fg-muted text-xs",children:"Select a packet from the dropdown or paste hex above"})})]})}export{_s as default}; diff --git a/frontend/dist/assets/Packets-D313r9wr.js b/frontend/dist/assets/Packets-BjpKkMEN.js similarity index 96% rename from frontend/dist/assets/Packets-D313r9wr.js rename to frontend/dist/assets/Packets-BjpKkMEN.js index 87fff05e..9ba25e66 100644 --- a/frontend/dist/assets/Packets-D313r9wr.js +++ b/frontend/dist/assets/Packets-BjpKkMEN.js @@ -1,4 +1,4 @@ -import{r as c,aU as _,aV as dt,aW as Te,aX as We,aY as ut,aZ as ce,a_ as Ye,a$ as pt,b0 as mt,b1 as bt,b2 as ge,b3 as ft,b4 as vt,b5 as Oe,b6 as U,b7 as xt,b8 as ke,b9 as X,ba as re,bb as $e,bc as Ee,bd as gt,be as Xe,bf as Je,bg as he,bh as Pe,bi as ye,bj as ht,bk as yt,bl as St,bm as Re,bn as Ct,bo as Ot,bp as Ce,bq as wt,br as Nt,bs as jt,bt as ie,bu as Et,bv as W,bw as Pt,bx as It,by as Tt,bz as kt,bA as $t,bB as Rt,bC as Mt,bD as Ft,bE as Dt,bF as _t,bG as At,bH as Me,e as Vt,j as a,c as J,aF as Lt,a0 as zt,bI as Bt,a1 as Ht,bJ as Ut,Q as Gt,a6 as qt,ac as Kt,ad as Wt,aA as Yt,aS as Xt,ae as Fe,P as De,bK as _e,bL as Ae,B as Ne,bM as Ve,a7 as Le,bN as ze,a8 as Jt}from"./index-Bcr7MabU.js";import{c as Qt}from"./node-types-BFsObq9k.js";import{u as Zt}from"./chevron-up-DDF7YpTU.js";import{c as H,p as eo,a as ve,f as Be,b as to,L as oo,S as me,s as so,g as no,u as ao,d as lo}from"./element-movement-DUifCLY7.js";import{F as io,y as ro,R as co,T as uo,w as He,A as po}from"./map-pin-CmfqMW3N.js";import{F as mo}from"./use-tree-walker-DFaznB-R.js";import{u as Ue,s as bo}from"./frozen-Csgg4u-n.js";import{g as Qe,u as fo,P as vo}from"./PacketList-DmJjzUH5.js";import{useGetDecodedContent as xo,useResolveSource as go}from"./usePipelineStore-nFeiBWWq.js";import{c as ho,a as yo,D as So,b as Co}from"./AnalyzerFilterPanel-Dspm437W.js";import{u as Oo,r as wo}from"./consumer-registry-Dy-EEMxV.js";import{A as No}from"./arrow-down-DFZvzXIi.js";import{A as jo}from"./arrow-right-Bv8RdUpJ.js";import{P as Eo,a as Po,B as Io,C as Ge}from"./PageLayout-Bd1lZEvE.js";import{T as To,M as ko}from"./MqttModeBadge-CrJ5xyVU.js";import{F as qe}from"./funnel-DFQf6jmi.js";import{R as $o}from"./route-DdD1xQhl.js";import{S as Ro}from"./search-D6EZ95nX.js";import"./primitives-D7nwWFFF.js";import"./badge-colors-Dl76Mz8m.js";import"./chat-utils-lxurr5ix.js";import"./SignalIndicator-CYjIo_Mn.js";import"./arrow-up-r11Chuf6.js";import"./chevron-right-BrHsAUr1.js";import"./payload-detail-jRk0k5AL.js";import"./circle-question-mark-CHrfUdMk.js";import"./layers-D696eHgB.js";import"./hash-DnbanjL5.js";import"./clock-vUFydv3d.js";import"./activity-BHsjc-ov.js";import"./database-DdKGqHhF.js";import"./useMapViewStore-DqjoQCEZ.js";import"./index-we8JTzK8.js";import"./index-BbwbpcoC.js";import"./shield-CcCTQoJ7.js";import"./zap-D8PO3IgR.js";function Ze(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return dt(e,"blur",t=>{let l=t.target;Te(l)&&(o.current={value:l.value,selectionStart:l.selectionStart,selectionEnd:l.selectionEnd})}),_(()=>{if(!We(e)&&Te(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==o.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:l}=o.current;t!==null&&l!==null&&e.setSelectionRange(t,l)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}var Mo=Object.defineProperty,Fo=(e,o,t)=>o in e?Mo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Ke=(e,o,t)=>(Fo(e,typeof o!="symbol"?o+"":o,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),Q=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Q||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oe||{}),et=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.DefaultToFirstOption=6]="DefaultToFirstOption",e[e.SetActivationTrigger=7]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",e[e.SetInputElement=9]="SetInputElement",e[e.SetButtonElement=10]="SetButtonElement",e[e.SetOptionsElement=11]="SetOptionsElement",e[e.MarkInputAsMoved=12]="MarkInputAsMoved",e))(et||{});function je(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,l=o(e.options.slice()),n=l.length>0&&l[0].dataRef.current.order!==null?l.sort((d,x)=>d.dataRef.current.order-x.dataRef.current.order):mt(l,d=>d.dataRef.current.domRef.current),i=t?n.indexOf(t):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}let Do={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?ve.Tracked(to(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:t,__demoMode:!1}},0(e){var o,t;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let l=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(l!==-1)return{...e,activeOptionIndex:l,comboboxState:0,__demoMode:!1,inputPositionState:ve.Idle}}return{...e,comboboxState:0,inputPositionState:ve.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,l,n,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((l=e.dataRef.current)!=null&&l.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:f,disabled:y}=e.virtual,N=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>f,resolveActiveIndex:()=>{var b,m;return(m=(b=e.activeOptionIndex)!=null?b:f.findIndex(P=>!y(P)))!=null?m:null},resolveDisabled:y,resolveId(){throw new Error("Function not implemented.")}}),C=(n=o.trigger)!=null?n:2;return e.activeOptionIndex===N&&e.activationTrigger===C?e:{...e,activeOptionIndex:N,activationTrigger:C,isTyping:!1,__demoMode:!1}}let d=je(e);if(d.activeOptionIndex===null){let f=d.options.findIndex(y=>!y.dataRef.current.disabled);f!==-1&&(d.activeOptionIndex=f)}let x=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>d.options,resolveActiveIndex:()=>d.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled}),p=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===x&&e.activationTrigger===p?e:{...e,...d,isTyping:!1,activeOptionIndex:x,activationTrigger:p,__demoMode:!1}},4:(e,o)=>{var t,l,n,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let d=o.payload,x=je(e,f=>(f.push(d),f));e.activeOptionIndex===null&&(n=(l=e.dataRef.current).isSelected)!=null&&n.call(l,o.payload.dataRef.current.value)&&(x.activeOptionIndex=x.options.indexOf(d));let p={...e,...x,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(p.activeOptionIndex=0),p},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(n=>n.id!==o.id)};let l=je(e,n=>{let i=n.findIndex(d=>d.id===o.id);return i!==-1&&n.splice(i,1),n});return{...e,...l,activationTrigger:2}},6:(e,o)=>e.defaultToFirstOption===o.value?e:{...e,defaultToFirstOption:o.value},7:(e,o)=>e.activationTrigger===o.trigger?e:{...e,activationTrigger:o.trigger},8:(e,o)=>{var t,l;if(e.virtual===null)return{...e,virtual:{options:o.options,disabled:(t=o.disabled)!=null?t:()=>!1}};if(e.virtual.options===o.options&&e.virtual.disabled===o.disabled)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?n=i:n=null}return{...e,activeOptionIndex:n,virtual:{options:o.options,disabled:(l=o.disabled)!=null?l:()=>!1}}},9:(e,o)=>e.inputElement===o.element?e:{...e,inputElement:o.element},10:(e,o)=>e.buttonElement===o.element?e:{...e,buttonElement:o.element},11:(e,o)=>e.optionsElement===o.element?e:{...e,optionsElement:o.element},12(e){return e.inputPositionState.kind!=="Tracked"?e:{...e,inputPositionState:ve.Moved}}};class Ie extends ut{constructor(o){super(o),Ke(this,"actions",{onChange:t=>{let{onChange:l,compare:n,mode:i,value:d}=this.state.dataRef.current;return ce(i,{0:()=>l==null?void 0:l(t),1:()=>{let x=d.slice(),p=x.findIndex(f=>n(f,t));return p===-1?x.push(t):x.splice(p,1),l==null?void 0:l(x)}})},registerOption:(t,l)=>(this.send({type:4,payload:{id:t,dataRef:l}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(l.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,l)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:l})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,l;this.send({type:1}),this.send({type:6,value:!1}),(l=(t=this.state.dataRef.current).onClose)==null||l.call(t)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:t=>{this.send({type:7,trigger:t})},selectActiveOption:()=>{let t=this.selectors.activeOptionIndex(this.state);if(t!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[t]);else{let{dataRef:l}=this.state.options[t];this.actions.onChange(l.current.value)}this.actions.goToOption({focus:H.Specific,idx:t})}},setInputElement:t=>{this.send({type:9,element:t})},setButtonElement:t=>{this.send({type:10,element:t})},setOptionsElement:t=>{this.send({type:11,element:t})}}),Ke(this,"selectors",{activeDescendantId:t=>{var l,n;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(n=t.options.find(d=>!d.dataRef.current.disabled&&t.dataRef.current.compare(d.dataRef.current.value,t.virtual.options[i])))==null?void 0:n.id:(l=t.options[i])==null?void 0:l.id},activeOptionIndex:t=>{if(t.defaultToFirstOption&&t.activeOptionIndex===null&&(t.virtual?t.virtual.options.length>0:t.options.length>0)){if(t.virtual){let{options:n,disabled:i}=t.virtual,d=n.findIndex(x=>{var p;return!((p=i==null?void 0:i(x))!=null&&p)});if(d!==-1)return d}let l=t.options.findIndex(n=>!n.dataRef.current.disabled);if(l!==-1)return l}return t.activeOptionIndex},activeOption:t=>{var l,n;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(n=(l=t.options[i])==null?void 0:l.dataRef.current.value)!=null?n:null},isActive:(t,l,n)=>{var i;let d=this.selectors.activeOptionIndex(t);return d===null?!1:t.virtual?d===t.dataRef.current.calculateIndex(l):((i=t.options[d])==null?void 0:i.id)===n},shouldScrollIntoView:(t,l,n)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,l,n)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,l=Ye.get(null);this.disposables.add(l.on(pt.Push,n=>{!l.selectors.isTop(n,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>l.actions.push(t)),this.on(1,()=>l.actions.pop(t))}this.disposables.group(t=>{this.on(1,l=>{l.inputElement&&(t.dispose(),t.add(eo(l.inputElement,l.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:l=!1}){var n;return new Ie({id:o,dataRef:{current:{}},comboboxState:l?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:l,inputPositionState:ve.Idle})}reduce(o,t){return ce(t.type,Do,o,t)}}const tt=c.createContext(null);function Se(e){let o=c.useContext(tt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ot),t}return o}function ot({id:e,virtual:o=null,__demoMode:t=!1}){let l=c.useMemo(()=>Ie.new({id:e,virtual:o,__demoMode:t}),[]);return bt(()=>l.dispose()),l}let xe=c.createContext(null);xe.displayName="ComboboxDataContext";function de(e){let o=c.useContext(xe);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return o}let st=c.createContext(null);function _o(e){let o=Se("VirtualProvider"),t=de("VirtualProvider"),{options:l}=t.virtual,n=U(o,b=>b.optionsElement),[i,d]=c.useMemo(()=>{let b=n;if(!b)return[0,0];let m=window.getComputedStyle(b);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[n]),x=Zt({enabled:l.length!==0,scrollPaddingStart:i,scrollPaddingEnd:d,count:l.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[p,f]=c.useState(0);ie(()=>{f(b=>b+1)},[l]);let y=x.getVirtualItems(),N=U(o,b=>b.activationTrigger===oe.Pointer),C=U(o,o.selectors.activeOptionIndex);return y.length===0?null:W.createElement(st.Provider,{value:x},W.createElement("div",{style:{position:"relative",width:"100%",height:`${x.getTotalSize()}px`},ref:b=>{b&&(N||C!==null&&l.length>C&&x.scrollToIndex(C))}},y.map(b=>{var m;return W.createElement(c.Fragment,{key:b.key},W.cloneElement((m=e.children)==null?void 0:m.call(e,{...e.slot,option:l[b.index]}),{key:`${p}-${b.key}`,"data-index":b.index,"aria-setsize":l.length,"aria-posinset":b.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${b.start}px)`,overflowAnchor:"none"}}))})))}let Ao=c.Fragment;function Vo(e,o){let t=c.useId(),l=$t(),{value:n,defaultValue:i,onChange:d,form:x,name:p,by:f,invalid:y=!1,disabled:N=l||!1,onClose:C,__demoMode:b=!1,multiple:m=!1,immediate:P=!1,virtual:u=null,nullable:M,...h}=e,O=Rt(i),[T=m?[]:void 0,L]=Mt(n,d,O),j=ot({id:t,virtual:u,__demoMode:b}),A=c.useRef({static:!1,hold:!1}),$=lo(f),F=_(I=>u?f===null?u.options.indexOf(I):u.options.findIndex(ae=>$(ae,I)):j.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),G=c.useCallback(I=>ce(V.mode,{[Q.Multi]:()=>T.some(ae=>$(ae,I)),[Q.Single]:()=>$(T,I)}),[T]),q=U(j,I=>I.virtual),E=_(()=>C==null?void 0:C()),V=c.useMemo(()=>({__demoMode:b,immediate:P,optionsPropsRef:A,value:T,defaultValue:O,disabled:N,invalid:y,mode:m?Q.Multi:Q.Single,virtual:u?q:null,onChange:L,isSelected:G,calculateIndex:F,compare:$,onClose:E}),[b,P,A,T,O,N,y,m,u,q,L,G,F,$,E]);ie(()=>{var I;u&&j.send({type:et.UpdateVirtualConfiguration,options:u.options,disabled:(I=u.disabled)!=null?I:null})},[u,u==null?void 0:u.options,u==null?void 0:u.disabled]),ie(()=>{j.state.dataRef.current=V},[V]);let[z,w,Y,le]=U(j,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),Z=Ye.get(null),ee=U(Z,c.useCallback(I=>Z.selectors.isTop(I,t),[Z,t]));Ft(ee,[w,Y,le],()=>j.actions.closeCombobox());let se=U(j,j.selectors.activeOptionIndex),ne=U(j,j.selectors.activeOption),v=he({open:z===S.Open,disabled:N,invalid:y,activeIndex:se,activeOption:ne,value:T}),[K,R]=Dt(),D=o===null?{}:{ref:o},k=c.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),B=ye();return W.createElement(R,{value:K,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:z===S.Open,disabled:N}},W.createElement(po,null,W.createElement(xe.Provider,{value:V},W.createElement(tt.Provider,{value:j},W.createElement(_t,{value:ce(z,{[S.Open]:Ce.Open,[S.Closed]:Ce.Closed})},p!=null&&W.createElement(At,{disabled:N,data:T!=null?{[p]:T}:{},form:x,onReset:k}),B({ourProps:D,theirProps:h,slot:v,defaultTag:Ao,name:"Combobox"}))))))}let Lo="input";function zo(e,o){var t,l;let n=Se("Combobox.Input"),i=de("Combobox.Input"),d=c.useId(),x=vt(),{id:p=x||`headlessui-combobox-input-${d}`,onChange:f,displayValue:y,disabled:N=i.disabled||!1,autoFocus:C=!1,type:b="text",...m}=e,P=c.useRef(null),u=Oe(P,o,io(),n.actions.setInputElement),[M,h]=U(n,v=>[v.comboboxState,v.isTyping]),O=xt(),T=_(()=>{n.actions.onChange(null),n.state.optionsElement&&(n.state.optionsElement.scrollTop=0),n.actions.goToOption({focus:H.Nothing})}),L=c.useMemo(()=>{var v;return typeof y=="function"&&i.value!==void 0?(v=y(i.value))!=null?v:"":typeof i.value=="string"?i.value:""},[i.value,y]);ke(([v,K],[R,D])=>{if(n.state.isTyping)return;let k=P.current;k&&((D===S.Open&&K===S.Closed||v!==R)&&(k.value=v),requestAnimationFrame(()=>{if(n.state.isTyping||!k||We(k))return;let{selectionStart:B,selectionEnd:I}=k;Math.abs((I??0)-(B??0))===0&&B===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[L,M,h]),ke(([v],[K])=>{if(v===S.Open&&K===S.Closed){if(n.state.isTyping)return;let R=P.current;if(!R)return;let D=R.value,{selectionStart:k,selectionEnd:B,selectionDirection:I}=R;R.value="",R.value=D,I!==null?R.setSelectionRange(k,B,I):R.setSelectionRange(k,B)}},[M]);let j=c.useRef(!1),A=_(()=>{j.current=!0}),$=_(()=>{O.nextFrame(()=>{j.current=!1})}),F=_(v=>{switch(n.actions.setIsTyping(!0),v.key){case X.Enter:if(n.state.comboboxState!==S.Open||j.current)return;if(v.preventDefault(),v.stopPropagation(),n.selectors.activeOptionIndex(n.state)===null){n.actions.closeCombobox();return}n.actions.selectActiveOption(),i.mode===Q.Single&&n.actions.closeCombobox();break;case X.ArrowDown:return v.preventDefault(),v.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Next}),[S.Closed]:()=>n.actions.openCombobox()});case X.ArrowUp:return v.preventDefault(),v.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Previous}),[S.Closed]:()=>{re.flushSync(()=>n.actions.openCombobox()),i.value||n.actions.goToOption({focus:H.Last})}});case X.Home:if(n.state.comboboxState===S.Closed||v.shiftKey)break;return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.First});case X.PageUp:return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.First});case X.End:if(n.state.comboboxState===S.Closed||v.shiftKey)break;return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.PageDown:return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.Escape:return n.state.comboboxState!==S.Open?void 0:(v.preventDefault(),n.state.optionsElement&&!i.optionsPropsRef.current.static&&v.stopPropagation(),i.mode===Q.Single&&i.value===null&&T(),n.actions.closeCombobox());case X.Tab:if(n.actions.setIsTyping(!1),n.state.comboboxState!==S.Open)return;i.mode===Q.Single&&n.state.activationTrigger!==oe.Focus&&n.actions.selectActiveOption(),n.actions.closeCombobox();break}}),G=_(v=>{f==null||f(v),i.mode===Q.Single&&v.target.value===""&&T(),n.actions.openCombobox()}),q=_(v=>{var K,R,D;let k=(K=v.relatedTarget)!=null?K:$e.find(B=>B!==v.currentTarget);if(!((R=n.state.optionsElement)!=null&&R.contains(k))&&!((D=n.state.buttonElement)!=null&&D.contains(k))&&n.state.comboboxState===S.Open)return v.preventDefault(),i.mode===Q.Single&&i.value===null&&T(),n.actions.closeCombobox()}),E=_(v=>{var K,R,D;let k=(K=v.relatedTarget)!=null?K:$e.find(B=>B!==v.currentTarget);(R=n.state.buttonElement)!=null&&R.contains(k)||(D=n.state.optionsElement)!=null&&D.contains(k)||i.disabled||i.immediate&&n.state.comboboxState!==S.Open&&O.microTask(()=>{re.flushSync(()=>n.actions.openCombobox()),n.actions.setActivationTrigger(oe.Focus)})}),V=Ee(),z=gt(),{isFocused:w,focusProps:Y}=Xe({autoFocus:C}),{isHovered:le,hoverProps:Z}=Je({isDisabled:N}),ee=U(n,v=>v.optionsElement),se=he({open:M===S.Open,disabled:N,invalid:i.invalid,hover:le,focus:w,autofocus:C}),ne=Pe({ref:u,id:p,role:"combobox",type:b,"aria-controls":ee==null?void 0:ee.id,"aria-expanded":M===S.Open,"aria-activedescendant":U(n,n.selectors.activeDescendantId),"aria-labelledby":V,"aria-describedby":z,"aria-autocomplete":"list",defaultValue:(l=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?y==null?void 0:y(i.defaultValue):null)!=null?l:i.defaultValue,disabled:N||void 0,autoFocus:C,onCompositionStart:A,onCompositionEnd:$,onKeyDown:F,onChange:G,onFocus:E,onBlur:q},Y,Z);return ye()({ourProps:ne,theirProps:m,slot:se,defaultTag:Lo,name:"Combobox.Input"})}let Bo="button";function Ho(e,o){let t=Se("Combobox.Button"),l=de("Combobox.Button"),[n,i]=c.useState(null),d=Oe(o,i,t.actions.setButtonElement),x=c.useId(),{id:p=`headlessui-combobox-button-${x}`,disabled:f=l.disabled||!1,autoFocus:y=!1,...N}=e,[C,b,m]=U(t,E=>[E.comboboxState,E.inputElement,E.optionsElement]),P=Ze(b),u=C===S.Open;oo(u,{trigger:n,action:c.useCallback(E=>{if(n!=null&&n.contains(E.target))return me.Ignore;if(b!=null&&b.contains(E.target))return me.Ignore;let V=E.target.closest('[role="option"]:not([data-disabled])');return ht(V)?me.Select(V):m!=null&&m.contains(E.target)?me.Ignore:me.Close},[n,b,m]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let M=_(E=>{switch(E.key){case X.Space:case X.Enter:E.preventDefault(),E.stopPropagation(),t.state.comboboxState===S.Closed&&re.flushSync(()=>t.actions.openCombobox()),P();return;case X.ArrowDown:E.preventDefault(),E.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.First})),P();return;case X.ArrowUp:E.preventDefault(),E.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.Last})),P();return;case X.Escape:if(t.state.comboboxState!==S.Open)return;E.preventDefault(),t.state.optionsElement&&!l.optionsPropsRef.current.static&&E.stopPropagation(),re.flushSync(()=>t.actions.closeCombobox()),P();return;default:return}}),h=so(()=>{t.state.comboboxState===S.Open?t.actions.closeCombobox():t.actions.openCombobox(),P()}),O=Ee([p]),{isFocusVisible:T,focusProps:L}=Xe({autoFocus:y}),{isHovered:j,hoverProps:A}=Je({isDisabled:f}),{pressed:$,pressProps:F}=yt({disabled:f}),G=he({open:C===S.Open,active:$||C===S.Open,disabled:f,invalid:l.invalid,value:l.value,hover:j,focus:T}),q=Pe({ref:d,id:p,type:St(e,n),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":C===S.Open,"aria-labelledby":O,disabled:f||void 0,autoFocus:y,onKeyDown:M},h,L,A,F);return ye()({ourProps:q,theirProps:N,slot:G,defaultTag:Bo,name:"Combobox.Button"})}let Uo="div",Go=Me.RenderStrategy|Me.Static;function qo(e,o){var t,l,n;let i=c.useId(),{id:d=`headlessui-combobox-options-${i}`,hold:x=!1,anchor:p,portal:f=!1,modal:y=!0,transition:N=!1,...C}=e,b=Se("Combobox.Options"),m=de("Combobox.Options"),P=ro(p);P&&(f=!0);let[u,M]=co(P),[h,O]=c.useState(null),T=uo(),L=Oe(o,P?u:null,b.actions.setOptionsElement,O),[j,A,$,F,G]=U(b,s=>[s.comboboxState,s.inputElement,s.buttonElement,s.optionsElement,s.activationTrigger]),q=Re(A||$),E=Re(F),V=Ct(),[z,w]=Ot(N,h,V!==null?(V&Ce.Open)===Ce.Open:j===S.Open);wt(z,A,b.actions.closeCombobox);let Y=m.__demoMode?!1:y&&j===S.Open;Nt(Y,E);let le=m.__demoMode?!1:y&&j===S.Open;jt(le,{allowed:c.useCallback(()=>[A,$,F],[A,$,F])});let Z=U(b,b.selectors.didInputMove)?!1:z;ie(()=>{var s;m.optionsPropsRef.current.static=(s=e.static)!=null?s:!1},[m.optionsPropsRef,e.static]),ie(()=>{m.optionsPropsRef.current.hold=x},[m.optionsPropsRef,x]),mo(j===S.Open,{container:F,accept(s){return s.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:s.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(s){s.setAttribute("role","none")}});let ee=Ee([$==null?void 0:$.id]),se=he({open:j===S.Open,option:void 0}),ne=_(()=>{b.actions.setActivationTrigger(oe.Pointer)}),v=_(s=>{s.preventDefault(),b.actions.setActivationTrigger(oe.Pointer)}),K=Pe(P?T():{},{"aria-labelledby":ee,role:"listbox","aria-multiselectable":m.mode===Q.Multi?!0:void 0,id:d,ref:L,style:{...C.style,...M,"--input-width":He(z,A,!0).width,"--button-width":He(z,$,!0).width},onWheel:G===oe.Pointer?void 0:ne,onMouseDown:v,...Et(w)}),R=z&&j===S.Closed&&!e.static,D=Ue(R,(t=m.virtual)==null?void 0:t.options),k=Ue(R,m.value),B=c.useCallback(s=>m.compare(k,s),[m.compare,k]),I=c.useMemo(()=>{if(!m.virtual)return m;if(D===void 0)throw new Error("Missing `options` in virtual mode");return D!==m.virtual.options?{...m,virtual:{...m.virtual,options:D}}:m},[m,D,(l=m.virtual)==null?void 0:l.options]);m.virtual&&Object.assign(C,{children:W.createElement(xe.Provider,{value:I},W.createElement(_o,{slot:se},C.children))});let ae=ye(),we=c.useMemo(()=>m.mode===Q.Multi?m:{...m,isSelected:B},[m,B]);return W.createElement(Pt,{enabled:f?e.static||z:!1,ownerDocument:q},W.createElement(xe.Provider,{value:we},ae({ourProps:K,theirProps:{...C,children:W.createElement(bo,{freeze:R},typeof C.children=="function"?(n=C.children)==null?void 0:n.call(C,se):C.children)},slot:se,defaultTag:Uo,features:Go,visible:Z,name:"Combobox.Options"})))}let Ko="div";function Wo(e,o){var t,l,n;let i=de("Combobox.Option"),d=Se("Combobox.Option"),x=c.useId(),{id:p=`headlessui-combobox-option-${x}`,value:f,disabled:y=(n=(l=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:l.call(t,f))!=null?n:!1,order:N=null,...C}=e,[b]=U(d,w=>[w.inputElement]),m=Ze(b),P=U(d,c.useCallback(w=>d.selectors.isActive(w,f,p),[f,p])),u=i.isSelected(f),M=c.useRef(null),h=It({disabled:y,value:f,domRef:M,order:N}),O=c.useContext(st),T=Oe(o,M,O?O.measureElement:null),L=_(()=>{d.actions.setIsTyping(!1),d.actions.onChange(f)});ie(()=>d.actions.registerOption(p,h),[h,p]);let j=U(d,c.useCallback(w=>d.selectors.shouldScrollIntoView(w,f,p),[f,p]));ie(()=>{if(j)return Tt().requestAnimationFrame(()=>{var w,Y;(Y=(w=M.current)==null?void 0:w.scrollIntoView)==null||Y.call(w,{block:"nearest"})})},[j,M]);let A=_(w=>{w.preventDefault(),w.button===no.Left&&(y||(L(),kt()||requestAnimationFrame(()=>m()),i.mode===Q.Single&&d.actions.closeCombobox()))}),$=_(()=>{if(y)return d.actions.goToOption({focus:H.Nothing});let w=i.calculateIndex(f);d.actions.goToOption({focus:H.Specific,idx:w})}),F=ao(),G=_(w=>F.update(w)),q=_(w=>{if(!F.wasMoved(w)||y||P&&d.state.activationTrigger===oe.Pointer)return;let Y=i.calculateIndex(f);d.actions.goToOption({focus:H.Specific,idx:Y},oe.Pointer)}),E=_(w=>{F.wasMoved(w)&&(y||P&&(i.optionsPropsRef.current.hold||d.state.activationTrigger===oe.Pointer&&d.actions.goToOption({focus:H.Nothing})))}),V=he({active:P,focus:P,selected:u,disabled:y}),z={id:p,ref:T,role:"option",tabIndex:y===!0?void 0:-1,"aria-disabled":y===!0?!0:void 0,"aria-selected":u,disabled:void 0,onMouseDown:A,onFocus:$,onPointerEnter:G,onMouseEnter:G,onPointerMove:q,onMouseMove:q,onPointerLeave:E,onMouseLeave:E};return ye()({ourProps:z,theirProps:C,slot:V,defaultTag:Ko,name:"Combobox.Option"})}let Yo=ge(Vo),nt=ge(Ho),at=ge(zo),Xo=ft,lt=ge(qo),it=ge(Wo),Jo=Object.assign(Yo,{Input:at,Button:nt,Label:Xo,Options:lt,Option:it});/** +import{r as c,aU as _,aV as dt,aW as Te,aX as We,aY as ut,aZ as ce,a_ as Ye,a$ as pt,b0 as mt,b1 as bt,b2 as ge,b3 as ft,b4 as vt,b5 as Oe,b6 as U,b7 as xt,b8 as ke,b9 as X,ba as re,bb as $e,bc as Ee,bd as gt,be as Xe,bf as Je,bg as he,bh as Pe,bi as ye,bj as ht,bk as yt,bl as St,bm as Re,bn as Ct,bo as Ot,bp as Ce,bq as wt,br as Nt,bs as jt,bt as ie,bu as Et,bv as W,bw as Pt,bx as It,by as Tt,bz as kt,bA as $t,bB as Rt,bC as Mt,bD as Ft,bE as Dt,bF as _t,bG as At,bH as Me,e as Vt,j as a,c as J,aF as Lt,a0 as zt,bI as Bt,a1 as Ht,bJ as Ut,Q as Gt,a6 as qt,ac as Kt,ad as Wt,aA as Yt,aS as Xt,ae as Fe,P as De,bK as _e,bL as Ae,B as Ne,bM as Ve,a7 as Le,bN as ze,a8 as Jt}from"./index-CR6htdhJ.js";import{c as Qt}from"./node-types-BvQCDNK9.js";import{u as Zt}from"./chevron-up-v1ZA2R-9.js";import{c as H,p as eo,a as ve,f as Be,b as to,L as oo,S as me,s as so,g as no,u as ao,d as lo}from"./element-movement-DIPTY4wV.js";import{F as io,y as ro,R as co,T as uo,w as He,A as po}from"./map-pin-DLf5Z8nk.js";import{F as mo}from"./use-tree-walker-BLvCEoIh.js";import{u as Ue,s as bo}from"./frozen-i7Ib99V7.js";import{g as Qe,u as fo,P as vo}from"./PacketList-DnOyjg3o.js";import{useGetDecodedContent as xo,useResolveSource as go}from"./usePipelineStore-CyVtwxqQ.js";import{c as ho,a as yo,D as So,b as Co}from"./AnalyzerFilterPanel-C99KUEiV.js";import{u as Oo,r as wo}from"./consumer-registry-7Hi_pNJ6.js";import{A as No}from"./arrow-down-DFhP0Q_b.js";import{A as jo}from"./arrow-right-3jiFJDYq.js";import{P as Eo,a as Po,B as Io,C as Ge}from"./PageLayout-Dk902Dlo.js";import{T as To,M as ko}from"./MqttModeBadge-_nVkYyqI.js";import{F as qe}from"./funnel-4oboVPXr.js";import{R as $o}from"./route-BdG55Ep-.js";import{S as Ro}from"./search-Djg1V5_Y.js";import"./primitives-EdDnh5-7.js";import"./badge-colors-Dl76Mz8m.js";import"./chat-utils-DHa6YwrS.js";import"./SignalIndicator-ClMJO5cF.js";import"./arrow-up-K4au-fHx.js";import"./chevron-right-D2DgrpVm.js";import"./payload-detail-B6eeo8Zi.js";import"./circle-question-mark-BTap0a_9.js";import"./layers-sBqNiTGy.js";import"./hash-D5cqF2Y_.js";import"./clock-BFNcreJN.js";import"./activity-B1_-JLqt.js";import"./database-B1i3odU4.js";import"./useMapViewStore-Dst_TEXH.js";import"./index-BtT4gFCt.js";import"./index-CnoLcwbn.js";import"./shield-Bd_LbwYW.js";import"./zap-BpXirfUQ.js";function Ze(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return dt(e,"blur",t=>{let l=t.target;Te(l)&&(o.current={value:l.value,selectionStart:l.selectionStart,selectionEnd:l.selectionEnd})}),_(()=>{if(!We(e)&&Te(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==o.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:l}=o.current;t!==null&&l!==null&&e.setSelectionRange(t,l)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}var Mo=Object.defineProperty,Fo=(e,o,t)=>o in e?Mo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Ke=(e,o,t)=>(Fo(e,typeof o!="symbol"?o+"":o,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),Q=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Q||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oe||{}),et=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.DefaultToFirstOption=6]="DefaultToFirstOption",e[e.SetActivationTrigger=7]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",e[e.SetInputElement=9]="SetInputElement",e[e.SetButtonElement=10]="SetButtonElement",e[e.SetOptionsElement=11]="SetOptionsElement",e[e.MarkInputAsMoved=12]="MarkInputAsMoved",e))(et||{});function je(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,l=o(e.options.slice()),n=l.length>0&&l[0].dataRef.current.order!==null?l.sort((d,x)=>d.dataRef.current.order-x.dataRef.current.order):mt(l,d=>d.dataRef.current.domRef.current),i=t?n.indexOf(t):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}let Do={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?ve.Tracked(to(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:t,__demoMode:!1}},0(e){var o,t;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let l=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(l!==-1)return{...e,activeOptionIndex:l,comboboxState:0,__demoMode:!1,inputPositionState:ve.Idle}}return{...e,comboboxState:0,inputPositionState:ve.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,l,n,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((l=e.dataRef.current)!=null&&l.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:f,disabled:y}=e.virtual,N=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>f,resolveActiveIndex:()=>{var b,m;return(m=(b=e.activeOptionIndex)!=null?b:f.findIndex(P=>!y(P)))!=null?m:null},resolveDisabled:y,resolveId(){throw new Error("Function not implemented.")}}),C=(n=o.trigger)!=null?n:2;return e.activeOptionIndex===N&&e.activationTrigger===C?e:{...e,activeOptionIndex:N,activationTrigger:C,isTyping:!1,__demoMode:!1}}let d=je(e);if(d.activeOptionIndex===null){let f=d.options.findIndex(y=>!y.dataRef.current.disabled);f!==-1&&(d.activeOptionIndex=f)}let x=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>d.options,resolveActiveIndex:()=>d.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled}),p=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===x&&e.activationTrigger===p?e:{...e,...d,isTyping:!1,activeOptionIndex:x,activationTrigger:p,__demoMode:!1}},4:(e,o)=>{var t,l,n,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let d=o.payload,x=je(e,f=>(f.push(d),f));e.activeOptionIndex===null&&(n=(l=e.dataRef.current).isSelected)!=null&&n.call(l,o.payload.dataRef.current.value)&&(x.activeOptionIndex=x.options.indexOf(d));let p={...e,...x,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(p.activeOptionIndex=0),p},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(n=>n.id!==o.id)};let l=je(e,n=>{let i=n.findIndex(d=>d.id===o.id);return i!==-1&&n.splice(i,1),n});return{...e,...l,activationTrigger:2}},6:(e,o)=>e.defaultToFirstOption===o.value?e:{...e,defaultToFirstOption:o.value},7:(e,o)=>e.activationTrigger===o.trigger?e:{...e,activationTrigger:o.trigger},8:(e,o)=>{var t,l;if(e.virtual===null)return{...e,virtual:{options:o.options,disabled:(t=o.disabled)!=null?t:()=>!1}};if(e.virtual.options===o.options&&e.virtual.disabled===o.disabled)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?n=i:n=null}return{...e,activeOptionIndex:n,virtual:{options:o.options,disabled:(l=o.disabled)!=null?l:()=>!1}}},9:(e,o)=>e.inputElement===o.element?e:{...e,inputElement:o.element},10:(e,o)=>e.buttonElement===o.element?e:{...e,buttonElement:o.element},11:(e,o)=>e.optionsElement===o.element?e:{...e,optionsElement:o.element},12(e){return e.inputPositionState.kind!=="Tracked"?e:{...e,inputPositionState:ve.Moved}}};class Ie extends ut{constructor(o){super(o),Ke(this,"actions",{onChange:t=>{let{onChange:l,compare:n,mode:i,value:d}=this.state.dataRef.current;return ce(i,{0:()=>l==null?void 0:l(t),1:()=>{let x=d.slice(),p=x.findIndex(f=>n(f,t));return p===-1?x.push(t):x.splice(p,1),l==null?void 0:l(x)}})},registerOption:(t,l)=>(this.send({type:4,payload:{id:t,dataRef:l}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(l.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,l)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:l})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,l;this.send({type:1}),this.send({type:6,value:!1}),(l=(t=this.state.dataRef.current).onClose)==null||l.call(t)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:t=>{this.send({type:7,trigger:t})},selectActiveOption:()=>{let t=this.selectors.activeOptionIndex(this.state);if(t!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[t]);else{let{dataRef:l}=this.state.options[t];this.actions.onChange(l.current.value)}this.actions.goToOption({focus:H.Specific,idx:t})}},setInputElement:t=>{this.send({type:9,element:t})},setButtonElement:t=>{this.send({type:10,element:t})},setOptionsElement:t=>{this.send({type:11,element:t})}}),Ke(this,"selectors",{activeDescendantId:t=>{var l,n;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(n=t.options.find(d=>!d.dataRef.current.disabled&&t.dataRef.current.compare(d.dataRef.current.value,t.virtual.options[i])))==null?void 0:n.id:(l=t.options[i])==null?void 0:l.id},activeOptionIndex:t=>{if(t.defaultToFirstOption&&t.activeOptionIndex===null&&(t.virtual?t.virtual.options.length>0:t.options.length>0)){if(t.virtual){let{options:n,disabled:i}=t.virtual,d=n.findIndex(x=>{var p;return!((p=i==null?void 0:i(x))!=null&&p)});if(d!==-1)return d}let l=t.options.findIndex(n=>!n.dataRef.current.disabled);if(l!==-1)return l}return t.activeOptionIndex},activeOption:t=>{var l,n;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(n=(l=t.options[i])==null?void 0:l.dataRef.current.value)!=null?n:null},isActive:(t,l,n)=>{var i;let d=this.selectors.activeOptionIndex(t);return d===null?!1:t.virtual?d===t.dataRef.current.calculateIndex(l):((i=t.options[d])==null?void 0:i.id)===n},shouldScrollIntoView:(t,l,n)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,l,n)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,l=Ye.get(null);this.disposables.add(l.on(pt.Push,n=>{!l.selectors.isTop(n,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>l.actions.push(t)),this.on(1,()=>l.actions.pop(t))}this.disposables.group(t=>{this.on(1,l=>{l.inputElement&&(t.dispose(),t.add(eo(l.inputElement,l.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:l=!1}){var n;return new Ie({id:o,dataRef:{current:{}},comboboxState:l?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:l,inputPositionState:ve.Idle})}reduce(o,t){return ce(t.type,Do,o,t)}}const tt=c.createContext(null);function Se(e){let o=c.useContext(tt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ot),t}return o}function ot({id:e,virtual:o=null,__demoMode:t=!1}){let l=c.useMemo(()=>Ie.new({id:e,virtual:o,__demoMode:t}),[]);return bt(()=>l.dispose()),l}let xe=c.createContext(null);xe.displayName="ComboboxDataContext";function de(e){let o=c.useContext(xe);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return o}let st=c.createContext(null);function _o(e){let o=Se("VirtualProvider"),t=de("VirtualProvider"),{options:l}=t.virtual,n=U(o,b=>b.optionsElement),[i,d]=c.useMemo(()=>{let b=n;if(!b)return[0,0];let m=window.getComputedStyle(b);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[n]),x=Zt({enabled:l.length!==0,scrollPaddingStart:i,scrollPaddingEnd:d,count:l.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[p,f]=c.useState(0);ie(()=>{f(b=>b+1)},[l]);let y=x.getVirtualItems(),N=U(o,b=>b.activationTrigger===oe.Pointer),C=U(o,o.selectors.activeOptionIndex);return y.length===0?null:W.createElement(st.Provider,{value:x},W.createElement("div",{style:{position:"relative",width:"100%",height:`${x.getTotalSize()}px`},ref:b=>{b&&(N||C!==null&&l.length>C&&x.scrollToIndex(C))}},y.map(b=>{var m;return W.createElement(c.Fragment,{key:b.key},W.cloneElement((m=e.children)==null?void 0:m.call(e,{...e.slot,option:l[b.index]}),{key:`${p}-${b.key}`,"data-index":b.index,"aria-setsize":l.length,"aria-posinset":b.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${b.start}px)`,overflowAnchor:"none"}}))})))}let Ao=c.Fragment;function Vo(e,o){let t=c.useId(),l=$t(),{value:n,defaultValue:i,onChange:d,form:x,name:p,by:f,invalid:y=!1,disabled:N=l||!1,onClose:C,__demoMode:b=!1,multiple:m=!1,immediate:P=!1,virtual:u=null,nullable:M,...h}=e,O=Rt(i),[T=m?[]:void 0,L]=Mt(n,d,O),j=ot({id:t,virtual:u,__demoMode:b}),A=c.useRef({static:!1,hold:!1}),$=lo(f),F=_(I=>u?f===null?u.options.indexOf(I):u.options.findIndex(ae=>$(ae,I)):j.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),G=c.useCallback(I=>ce(V.mode,{[Q.Multi]:()=>T.some(ae=>$(ae,I)),[Q.Single]:()=>$(T,I)}),[T]),q=U(j,I=>I.virtual),E=_(()=>C==null?void 0:C()),V=c.useMemo(()=>({__demoMode:b,immediate:P,optionsPropsRef:A,value:T,defaultValue:O,disabled:N,invalid:y,mode:m?Q.Multi:Q.Single,virtual:u?q:null,onChange:L,isSelected:G,calculateIndex:F,compare:$,onClose:E}),[b,P,A,T,O,N,y,m,u,q,L,G,F,$,E]);ie(()=>{var I;u&&j.send({type:et.UpdateVirtualConfiguration,options:u.options,disabled:(I=u.disabled)!=null?I:null})},[u,u==null?void 0:u.options,u==null?void 0:u.disabled]),ie(()=>{j.state.dataRef.current=V},[V]);let[z,w,Y,le]=U(j,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),Z=Ye.get(null),ee=U(Z,c.useCallback(I=>Z.selectors.isTop(I,t),[Z,t]));Ft(ee,[w,Y,le],()=>j.actions.closeCombobox());let se=U(j,j.selectors.activeOptionIndex),ne=U(j,j.selectors.activeOption),v=he({open:z===S.Open,disabled:N,invalid:y,activeIndex:se,activeOption:ne,value:T}),[K,R]=Dt(),D=o===null?{}:{ref:o},k=c.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),B=ye();return W.createElement(R,{value:K,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:z===S.Open,disabled:N}},W.createElement(po,null,W.createElement(xe.Provider,{value:V},W.createElement(tt.Provider,{value:j},W.createElement(_t,{value:ce(z,{[S.Open]:Ce.Open,[S.Closed]:Ce.Closed})},p!=null&&W.createElement(At,{disabled:N,data:T!=null?{[p]:T}:{},form:x,onReset:k}),B({ourProps:D,theirProps:h,slot:v,defaultTag:Ao,name:"Combobox"}))))))}let Lo="input";function zo(e,o){var t,l;let n=Se("Combobox.Input"),i=de("Combobox.Input"),d=c.useId(),x=vt(),{id:p=x||`headlessui-combobox-input-${d}`,onChange:f,displayValue:y,disabled:N=i.disabled||!1,autoFocus:C=!1,type:b="text",...m}=e,P=c.useRef(null),u=Oe(P,o,io(),n.actions.setInputElement),[M,h]=U(n,v=>[v.comboboxState,v.isTyping]),O=xt(),T=_(()=>{n.actions.onChange(null),n.state.optionsElement&&(n.state.optionsElement.scrollTop=0),n.actions.goToOption({focus:H.Nothing})}),L=c.useMemo(()=>{var v;return typeof y=="function"&&i.value!==void 0?(v=y(i.value))!=null?v:"":typeof i.value=="string"?i.value:""},[i.value,y]);ke(([v,K],[R,D])=>{if(n.state.isTyping)return;let k=P.current;k&&((D===S.Open&&K===S.Closed||v!==R)&&(k.value=v),requestAnimationFrame(()=>{if(n.state.isTyping||!k||We(k))return;let{selectionStart:B,selectionEnd:I}=k;Math.abs((I??0)-(B??0))===0&&B===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[L,M,h]),ke(([v],[K])=>{if(v===S.Open&&K===S.Closed){if(n.state.isTyping)return;let R=P.current;if(!R)return;let D=R.value,{selectionStart:k,selectionEnd:B,selectionDirection:I}=R;R.value="",R.value=D,I!==null?R.setSelectionRange(k,B,I):R.setSelectionRange(k,B)}},[M]);let j=c.useRef(!1),A=_(()=>{j.current=!0}),$=_(()=>{O.nextFrame(()=>{j.current=!1})}),F=_(v=>{switch(n.actions.setIsTyping(!0),v.key){case X.Enter:if(n.state.comboboxState!==S.Open||j.current)return;if(v.preventDefault(),v.stopPropagation(),n.selectors.activeOptionIndex(n.state)===null){n.actions.closeCombobox();return}n.actions.selectActiveOption(),i.mode===Q.Single&&n.actions.closeCombobox();break;case X.ArrowDown:return v.preventDefault(),v.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Next}),[S.Closed]:()=>n.actions.openCombobox()});case X.ArrowUp:return v.preventDefault(),v.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Previous}),[S.Closed]:()=>{re.flushSync(()=>n.actions.openCombobox()),i.value||n.actions.goToOption({focus:H.Last})}});case X.Home:if(n.state.comboboxState===S.Closed||v.shiftKey)break;return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.First});case X.PageUp:return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.First});case X.End:if(n.state.comboboxState===S.Closed||v.shiftKey)break;return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.PageDown:return v.preventDefault(),v.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.Escape:return n.state.comboboxState!==S.Open?void 0:(v.preventDefault(),n.state.optionsElement&&!i.optionsPropsRef.current.static&&v.stopPropagation(),i.mode===Q.Single&&i.value===null&&T(),n.actions.closeCombobox());case X.Tab:if(n.actions.setIsTyping(!1),n.state.comboboxState!==S.Open)return;i.mode===Q.Single&&n.state.activationTrigger!==oe.Focus&&n.actions.selectActiveOption(),n.actions.closeCombobox();break}}),G=_(v=>{f==null||f(v),i.mode===Q.Single&&v.target.value===""&&T(),n.actions.openCombobox()}),q=_(v=>{var K,R,D;let k=(K=v.relatedTarget)!=null?K:$e.find(B=>B!==v.currentTarget);if(!((R=n.state.optionsElement)!=null&&R.contains(k))&&!((D=n.state.buttonElement)!=null&&D.contains(k))&&n.state.comboboxState===S.Open)return v.preventDefault(),i.mode===Q.Single&&i.value===null&&T(),n.actions.closeCombobox()}),E=_(v=>{var K,R,D;let k=(K=v.relatedTarget)!=null?K:$e.find(B=>B!==v.currentTarget);(R=n.state.buttonElement)!=null&&R.contains(k)||(D=n.state.optionsElement)!=null&&D.contains(k)||i.disabled||i.immediate&&n.state.comboboxState!==S.Open&&O.microTask(()=>{re.flushSync(()=>n.actions.openCombobox()),n.actions.setActivationTrigger(oe.Focus)})}),V=Ee(),z=gt(),{isFocused:w,focusProps:Y}=Xe({autoFocus:C}),{isHovered:le,hoverProps:Z}=Je({isDisabled:N}),ee=U(n,v=>v.optionsElement),se=he({open:M===S.Open,disabled:N,invalid:i.invalid,hover:le,focus:w,autofocus:C}),ne=Pe({ref:u,id:p,role:"combobox",type:b,"aria-controls":ee==null?void 0:ee.id,"aria-expanded":M===S.Open,"aria-activedescendant":U(n,n.selectors.activeDescendantId),"aria-labelledby":V,"aria-describedby":z,"aria-autocomplete":"list",defaultValue:(l=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?y==null?void 0:y(i.defaultValue):null)!=null?l:i.defaultValue,disabled:N||void 0,autoFocus:C,onCompositionStart:A,onCompositionEnd:$,onKeyDown:F,onChange:G,onFocus:E,onBlur:q},Y,Z);return ye()({ourProps:ne,theirProps:m,slot:se,defaultTag:Lo,name:"Combobox.Input"})}let Bo="button";function Ho(e,o){let t=Se("Combobox.Button"),l=de("Combobox.Button"),[n,i]=c.useState(null),d=Oe(o,i,t.actions.setButtonElement),x=c.useId(),{id:p=`headlessui-combobox-button-${x}`,disabled:f=l.disabled||!1,autoFocus:y=!1,...N}=e,[C,b,m]=U(t,E=>[E.comboboxState,E.inputElement,E.optionsElement]),P=Ze(b),u=C===S.Open;oo(u,{trigger:n,action:c.useCallback(E=>{if(n!=null&&n.contains(E.target))return me.Ignore;if(b!=null&&b.contains(E.target))return me.Ignore;let V=E.target.closest('[role="option"]:not([data-disabled])');return ht(V)?me.Select(V):m!=null&&m.contains(E.target)?me.Ignore:me.Close},[n,b,m]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let M=_(E=>{switch(E.key){case X.Space:case X.Enter:E.preventDefault(),E.stopPropagation(),t.state.comboboxState===S.Closed&&re.flushSync(()=>t.actions.openCombobox()),P();return;case X.ArrowDown:E.preventDefault(),E.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.First})),P();return;case X.ArrowUp:E.preventDefault(),E.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.Last})),P();return;case X.Escape:if(t.state.comboboxState!==S.Open)return;E.preventDefault(),t.state.optionsElement&&!l.optionsPropsRef.current.static&&E.stopPropagation(),re.flushSync(()=>t.actions.closeCombobox()),P();return;default:return}}),h=so(()=>{t.state.comboboxState===S.Open?t.actions.closeCombobox():t.actions.openCombobox(),P()}),O=Ee([p]),{isFocusVisible:T,focusProps:L}=Xe({autoFocus:y}),{isHovered:j,hoverProps:A}=Je({isDisabled:f}),{pressed:$,pressProps:F}=yt({disabled:f}),G=he({open:C===S.Open,active:$||C===S.Open,disabled:f,invalid:l.invalid,value:l.value,hover:j,focus:T}),q=Pe({ref:d,id:p,type:St(e,n),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":C===S.Open,"aria-labelledby":O,disabled:f||void 0,autoFocus:y,onKeyDown:M},h,L,A,F);return ye()({ourProps:q,theirProps:N,slot:G,defaultTag:Bo,name:"Combobox.Button"})}let Uo="div",Go=Me.RenderStrategy|Me.Static;function qo(e,o){var t,l,n;let i=c.useId(),{id:d=`headlessui-combobox-options-${i}`,hold:x=!1,anchor:p,portal:f=!1,modal:y=!0,transition:N=!1,...C}=e,b=Se("Combobox.Options"),m=de("Combobox.Options"),P=ro(p);P&&(f=!0);let[u,M]=co(P),[h,O]=c.useState(null),T=uo(),L=Oe(o,P?u:null,b.actions.setOptionsElement,O),[j,A,$,F,G]=U(b,s=>[s.comboboxState,s.inputElement,s.buttonElement,s.optionsElement,s.activationTrigger]),q=Re(A||$),E=Re(F),V=Ct(),[z,w]=Ot(N,h,V!==null?(V&Ce.Open)===Ce.Open:j===S.Open);wt(z,A,b.actions.closeCombobox);let Y=m.__demoMode?!1:y&&j===S.Open;Nt(Y,E);let le=m.__demoMode?!1:y&&j===S.Open;jt(le,{allowed:c.useCallback(()=>[A,$,F],[A,$,F])});let Z=U(b,b.selectors.didInputMove)?!1:z;ie(()=>{var s;m.optionsPropsRef.current.static=(s=e.static)!=null?s:!1},[m.optionsPropsRef,e.static]),ie(()=>{m.optionsPropsRef.current.hold=x},[m.optionsPropsRef,x]),mo(j===S.Open,{container:F,accept(s){return s.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:s.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(s){s.setAttribute("role","none")}});let ee=Ee([$==null?void 0:$.id]),se=he({open:j===S.Open,option:void 0}),ne=_(()=>{b.actions.setActivationTrigger(oe.Pointer)}),v=_(s=>{s.preventDefault(),b.actions.setActivationTrigger(oe.Pointer)}),K=Pe(P?T():{},{"aria-labelledby":ee,role:"listbox","aria-multiselectable":m.mode===Q.Multi?!0:void 0,id:d,ref:L,style:{...C.style,...M,"--input-width":He(z,A,!0).width,"--button-width":He(z,$,!0).width},onWheel:G===oe.Pointer?void 0:ne,onMouseDown:v,...Et(w)}),R=z&&j===S.Closed&&!e.static,D=Ue(R,(t=m.virtual)==null?void 0:t.options),k=Ue(R,m.value),B=c.useCallback(s=>m.compare(k,s),[m.compare,k]),I=c.useMemo(()=>{if(!m.virtual)return m;if(D===void 0)throw new Error("Missing `options` in virtual mode");return D!==m.virtual.options?{...m,virtual:{...m.virtual,options:D}}:m},[m,D,(l=m.virtual)==null?void 0:l.options]);m.virtual&&Object.assign(C,{children:W.createElement(xe.Provider,{value:I},W.createElement(_o,{slot:se},C.children))});let ae=ye(),we=c.useMemo(()=>m.mode===Q.Multi?m:{...m,isSelected:B},[m,B]);return W.createElement(Pt,{enabled:f?e.static||z:!1,ownerDocument:q},W.createElement(xe.Provider,{value:we},ae({ourProps:K,theirProps:{...C,children:W.createElement(bo,{freeze:R},typeof C.children=="function"?(n=C.children)==null?void 0:n.call(C,se):C.children)},slot:se,defaultTag:Uo,features:Go,visible:Z,name:"Combobox.Options"})))}let Ko="div";function Wo(e,o){var t,l,n;let i=de("Combobox.Option"),d=Se("Combobox.Option"),x=c.useId(),{id:p=`headlessui-combobox-option-${x}`,value:f,disabled:y=(n=(l=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:l.call(t,f))!=null?n:!1,order:N=null,...C}=e,[b]=U(d,w=>[w.inputElement]),m=Ze(b),P=U(d,c.useCallback(w=>d.selectors.isActive(w,f,p),[f,p])),u=i.isSelected(f),M=c.useRef(null),h=It({disabled:y,value:f,domRef:M,order:N}),O=c.useContext(st),T=Oe(o,M,O?O.measureElement:null),L=_(()=>{d.actions.setIsTyping(!1),d.actions.onChange(f)});ie(()=>d.actions.registerOption(p,h),[h,p]);let j=U(d,c.useCallback(w=>d.selectors.shouldScrollIntoView(w,f,p),[f,p]));ie(()=>{if(j)return Tt().requestAnimationFrame(()=>{var w,Y;(Y=(w=M.current)==null?void 0:w.scrollIntoView)==null||Y.call(w,{block:"nearest"})})},[j,M]);let A=_(w=>{w.preventDefault(),w.button===no.Left&&(y||(L(),kt()||requestAnimationFrame(()=>m()),i.mode===Q.Single&&d.actions.closeCombobox()))}),$=_(()=>{if(y)return d.actions.goToOption({focus:H.Nothing});let w=i.calculateIndex(f);d.actions.goToOption({focus:H.Specific,idx:w})}),F=ao(),G=_(w=>F.update(w)),q=_(w=>{if(!F.wasMoved(w)||y||P&&d.state.activationTrigger===oe.Pointer)return;let Y=i.calculateIndex(f);d.actions.goToOption({focus:H.Specific,idx:Y},oe.Pointer)}),E=_(w=>{F.wasMoved(w)&&(y||P&&(i.optionsPropsRef.current.hold||d.state.activationTrigger===oe.Pointer&&d.actions.goToOption({focus:H.Nothing})))}),V=he({active:P,focus:P,selected:u,disabled:y}),z={id:p,ref:T,role:"option",tabIndex:y===!0?void 0:-1,"aria-disabled":y===!0?!0:void 0,"aria-selected":u,disabled:void 0,onMouseDown:A,onFocus:$,onPointerEnter:G,onMouseEnter:G,onPointerMove:q,onMouseMove:q,onPointerLeave:E,onMouseLeave:E};return ye()({ourProps:z,theirProps:C,slot:V,defaultTag:Ko,name:"Combobox.Option"})}let Yo=ge(Vo),nt=ge(Ho),at=ge(zo),Xo=ft,lt=ge(qo),it=ge(Wo),Jo=Object.assign(Yo,{Input:at,Button:nt,Label:Xo,Options:lt,Option:it});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PageLayout-Bd1lZEvE.js b/frontend/dist/assets/PageLayout-Dk902Dlo.js similarity index 95% rename from frontend/dist/assets/PageLayout-Bd1lZEvE.js rename to frontend/dist/assets/PageLayout-Dk902Dlo.js index d0b76b5d..25fd04d9 100644 --- a/frontend/dist/assets/PageLayout-Bd1lZEvE.js +++ b/frontend/dist/assets/PageLayout-Dk902Dlo.js @@ -1 +1 @@ -import{j as e,Y as d,c as m,aR as o,r as i,gy as f}from"./index-Bcr7MabU.js";function p({children:a,className:s}){return e.jsx("div",{className:m("section-gap",s),children:a})}function g({children:a,className:s,ready:n}){const r=o(),t=n??r,[x,c]=i.useState(!1);return i.useEffect(()=>{if(!t){c(!1);return}let l=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{l||i.startTransition(()=>c(!0))})}),()=>{l=!0}},[t]),e.jsx(f.Provider,{value:x,children:e.jsx("div",{className:m("bento-section",s),children:a})})}function j({title:a,icon:s,controls:n,leading:r,subtitle:t}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsxs("h1",{className:"type-title text-fg-primary flex items-baseline gap-2 sm:gap-3 min-w-0",children:[s&&e.jsx("span",{className:"text-icon-page-title flex-shrink-0 translate-y-[0.1em] [&>svg]:h-[1em] [&>svg]:w-[1em] [&>svg]:stroke-[1.5]",children:s}),e.jsx("span",{className:"truncate",children:a})]}),r]}),n&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:n})]}),t&&e.jsx("div",{children:t})]})}function h({size:a,...s}){return e.jsx(d,{...s})}export{g as B,h as C,p as P,j as a}; +import{j as e,Y as d,c as m,aR as o,r as i,gy as f}from"./index-CR6htdhJ.js";function p({children:a,className:s}){return e.jsx("div",{className:m("section-gap",s),children:a})}function g({children:a,className:s,ready:n}){const r=o(),t=n??r,[x,c]=i.useState(!1);return i.useEffect(()=>{if(!t){c(!1);return}let l=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{l||i.startTransition(()=>c(!0))})}),()=>{l=!0}},[t]),e.jsx(f.Provider,{value:x,children:e.jsx("div",{className:m("bento-section",s),children:a})})}function j({title:a,icon:s,controls:n,leading:r,subtitle:t}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsxs("h1",{className:"type-title text-fg-primary flex items-baseline gap-2 sm:gap-3 min-w-0",children:[s&&e.jsx("span",{className:"text-icon-page-title flex-shrink-0 translate-y-[0.1em] [&>svg]:h-[1em] [&>svg]:w-[1em] [&>svg]:stroke-[1.5]",children:s}),e.jsx("span",{className:"truncate",children:a})]}),r]}),n&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:n})]}),t&&e.jsx("div",{children:t})]})}function h({size:a,...s}){return e.jsx(d,{...s})}export{g as B,h as C,p as P,j as a}; diff --git a/frontend/dist/assets/PathMapMapLibre-AlEhVgKC.js b/frontend/dist/assets/PathMapMapLibre-S3pSbLw3.js similarity index 96% rename from frontend/dist/assets/PathMapMapLibre-AlEhVgKC.js rename to frontend/dist/assets/PathMapMapLibre-S3pSbLw3.js index f0aeb74d..212a1f2f 100644 --- a/frontend/dist/assets/PathMapMapLibre-AlEhVgKC.js +++ b/frontend/dist/assets/PathMapMapLibre-S3pSbLw3.js @@ -1 +1 @@ -import{r as a,d0 as ae,cc as ie,c0 as le,gz as de,Z as J,cf as ce,j as t,V as K,c as z,gA as ue}from"./index-Bcr7MabU.js";import{M as pe,S as me,L as fe,a as _,P as ge}from"./maplibre-gl-CsF9Hmsz.js";import{B as xe}from"./BasemapLayer-A-p_Dr5u.js";import{C as he}from"./car-Cn7MZO12.js";import{H as ye}from"./useMapViewStore-DqjoQCEZ.js";import"./index-we8JTzK8.js";import"./index-BbwbpcoC.js";const be={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},h={nodeColor:"#4338CA",localColor:"#4F46E5",hubColor:"#6366F1",edgeColor:"#3B3F4A",ambiguousColor:"#F9D26F",highlightColor:"#B49DFF",sourceColor:"#39D98A",destinationColor:"#B49DFF"};function C(c,r){if(!c)return r;if(c.startsWith("#"))return c;const m=ue(c);return m?`#${m.r.toString(16).padStart(2,"0")}${m.g.toString(16).padStart(2,"0")}${m.b.toString(16).padStart(2,"0")}`:r}function G(){if(typeof document>"u")return h;const c=document.documentElement,r=getComputedStyle(c);return{nodeColor:C(r.getPropertyValue("--map-node-stroke").trim(),h.nodeColor),localColor:C(r.getPropertyValue("--map-local-color").trim(),h.localColor),hubColor:C(r.getPropertyValue("--map-hub-color").trim(),h.hubColor),edgeColor:C(r.getPropertyValue("--map-edge-rest").trim(),h.edgeColor),ambiguousColor:C(r.getPropertyValue("--sys-indigo").trim(),h.ambiguousColor),highlightColor:C(r.getPropertyValue("--sys-blue").trim(),h.highlightColor),sourceColor:C(r.getPropertyValue("--sys-green").trim(),h.sourceColor),destinationColor:C(r.getPropertyValue("--sys-blue").trim(),h.destinationColor)}}function Ce({prefix:c,isLocal:r,isSource:m,isDestination:W,isLastHop:y,isHighlighted:g,isWardrive:k,candidate:x,onHover:E,onLeave:N,onClick:S}){const[n,w]=a.useState(!1),P=a.useCallback(()=>{w(!0),E()},[E]),j=a.useCallback(()=>{w(!1),N()},[N]),D=()=>k?"orange":r?"amber":m?"green":y?"amber":W?"purple":"blue";return k?t.jsxs("div",{className:z("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded-full",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:[t.jsx("div",{className:z("flex items-center justify-center","w-7 h-7 rounded-full","bg-sys-orange text-white","shadow-lg border-2 border-sys-orange/50","transition-transform duration-150",n&&"scale-110"),children:t.jsx(he,{className:"w-4 h-4",strokeWidth:2.5})}),n&&t.jsxs(K,{color:"orange",filled:!0,className:"ml-1 type-data-xs shadow-lg",children:[c,x.name&&t.jsx("span",{className:"ml-1 opacity-75",children:x.name})]})]}):t.jsx("div",{className:z("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:t.jsxs(K,{color:D(),filled:!0,className:"type-data-xs shadow-lg border border-current/30",children:[r&&t.jsx(ye,{className:"w-2.5 h-2.5 mr-1"}),c,n&&x.name&&t.jsx("span",{className:"ml-1 opacity-75",children:x.name})]})})}function je({hopNumber:c,snr:r,edgeColor:m}){return t.jsxs("div",{className:"flex flex-col items-center gap-0.5 pointer-events-none",children:[t.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center font-mono font-bold tabular-nums shadow-md",style:{backgroundColor:m||J[500],color:"#fff",fontSize:"8px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:c}),r!==void 0&&t.jsx(K,{color:"zinc",compact:!0,className:"!text-[9px] font-mono tabular-nums shadow-sm",children:r.toFixed(1)})]})}function Ee({resolvedPath:c,localNode:r,hubNodes:m=[],hoveredHopIndex:W,onHoverHop:y,traceSnr:g}){const k=g!==void 0&&g.length>0,x=a.useRef(null),E=ae(),N=ie(),S=a.useMemo(()=>new Set(m),[m]),[n,w]=a.useState(null),P=le(),[j,D]=a.useState(!1),[Z,U]=a.useState(0);a.useEffect(()=>{var f;const e=(f=x.current)==null?void 0:f.getMap();if(!e)return;const o=e.getCanvas();if(!o)return;const s=l=>{l.preventDefault(),console.warn("[PathMapMapLibre] WebGL context lost")},i=()=>{console.warn("[PathMapMapLibre] WebGL context restored, remounting..."),U(l=>l+1)};return o.addEventListener("webglcontextlost",s),o.addEventListener("webglcontextrestored",i),()=>{o.removeEventListener("webglcontextlost",s),o.removeEventListener("webglcontextrestored",i)}},[Z]);const{positions:v,markers:$,edges:I}=a.useMemo(()=>{const e=[],o=[],s=[],i=[],f=(p,V)=>p!==0||V!==0;let l=0,b=!1;return c.hops.forEach((p,V)=>{const Y=p.candidates.filter(d=>f(d.latitude,d.longitude));if(Y.length===0)return;const R=[...Y].sort((d,F)=>F.probability-d.probability),A=R[0],L=[A.longitude,A.latitude];if(i.push(L),i.length>=2){const d=i[i.length-2],F=i.length-2,M=g==null?void 0:g[F],T=L[0]-d[0],se=L[1]-d[1],ne=Math.atan2(T,se)*(180/Math.PI),re=G();let B;b?B="#F97316":M!==void 0?B=de()[ce(M,N)]||J[500]:B=re.edgeColor,s.push({from:d,to:L,snrFwd:M,midpoint:[(d[0]+L[0])/2,(d[1]+L[1])/2],bearing:ne,color:B,isFromWardrive:b})}const te=p.isSource===!0,oe=p.isDestination===!0;b=A.isWardrive===!0,R.forEach((d,F)=>{const M=[d.latitude,d.longitude];e.push(M);const T=F===0;o.push({position:M,prefix:p.prefix,confidence:p.confidence,candidateCount:R.length,hopIndex:V,candidate:d,isHub:S.has(d.hash),isPrimary:T,isSource:te,isDestination:oe,validIndex:l})}),l++}),{positions:e,markers:o,edges:s}},[c,S,g,N]),q=a.useMemo(()=>I.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[I]),u=a.useMemo(()=>{const e=$.filter(l=>l.isPrimary&&(l.confidence>=.5||l.isSource||l.isDestination));if(e.length===0)return null;let o=1/0,s=-1/0,i=1/0,f=-1/0;for(const l of e){const[b,p]=l.position;bs&&(s=b),pf&&(f=p)}return[[i,o],[f,s]]},[$]),O=a.useMemo(()=>{if(v.length===0)return r?[r.longitude,r.latitude]:[0,0];let e=0,o=0;for(const[s,i]of v)e+=s,o+=i;return[o/v.length,e/v.length]},[v,r]),H=a.useCallback(()=>{var o;const e=(o=x.current)==null?void 0:o.getMap();if(!e||!u){D(!0);return}e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:0}),setTimeout(()=>{D(!0)},50)},[u]),X=a.useMemo(()=>u?`${u[0][0].toFixed(5)},${u[0][1].toFixed(5)},${u[1][0].toFixed(5)},${u[1][1].toFixed(5)}`:"",[u]);a.useEffect(()=>{var o;if(!j)return;const e=(o=x.current)==null?void 0:o.getMap();!e||!u||e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:300})},[X,j,u]);const Q=P&&j,ee=a.useCallback(e=>{w({longitude:e.position[1],latitude:e.position[0],marker:e})},[]);return v.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted text-sm bg-elevated",children:"No mappable path data"}):t.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden depth-stroke-inset",children:[!Q&&t.jsx("div",{className:"absolute inset-0 bg-elevated flex items-center justify-center pointer-events-none",children:t.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-300 ease-out",style:{opacity:Q?1:0},children:t.jsxs(pe,{ref:x,initialViewState:{longitude:O[0],latitude:O[1],zoom:10},onLoad:H,style:{height:"100%",width:"100%"},mapStyle:be,attributionControl:!1,children:[t.jsx(xe,{mode:E}),I.map((e,o)=>t.jsx(me,{id:`edge-${o}`,type:"geojson",data:q[o],children:t.jsx(fe,{id:`edge-line-${o}`,type:"line",paint:{"line-color":e.color,"line-width":4,"line-opacity":1},layout:{"line-cap":"round","line-join":"round"}})},`edge-${o}`)),I.map((e,o)=>t.jsx(_,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx(je,{hopNumber:o+1,snr:k?e.snrFwd:void 0,edgeColor:e.color})},`hop-${o}`)),(()=>{const e=$.filter(s=>s.isPrimary),o=e.length>1?e.length-2:-1;return e.map((s,i)=>{const f=W===s.hopIndex,l=i===o&&!s.candidate.isLocal&&!s.isDestination;return t.jsx(_,{longitude:s.position[1],latitude:s.position[0],anchor:"center",children:t.jsx(Ce,{prefix:s.prefix,isLocal:s.candidate.isLocal||!1,isSource:s.isSource,isDestination:s.isDestination,isLastHop:l,isHighlighted:f,isWardrive:s.candidate.isWardrive||!1,candidate:s.candidate,onHover:()=>y==null?void 0:y(s.hopIndex),onLeave:()=>y==null?void 0:y(null),onClick:()=>ee(s)})},`${s.hopIndex}-${s.candidate.hash}`)})})(),n&&t.jsx(ge,{longitude:n.longitude,latitude:n.latitude,anchor:"bottom",offset:[0,-12],closeOnClick:!1,onClose:()=>w(null),className:"maplibre-popup",children:t.jsxs("div",{className:"text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"font-semibold",children:n.marker.candidate.name}),(()=>{const e=G();return t.jsxs(t.Fragment,{children:[n.marker.isSource&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.sourceColor,color:"#000"},children:"SRC"}),n.marker.isDestination&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.destinationColor,color:"#000"},children:"DST"}),n.marker.isHub&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.hubColor,color:"#000"},children:"HUB"}),n.marker.candidate.isLocal&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.localColor,color:"#fff"},children:"LOCAL"}),n.marker.candidate.isWardrive&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:"#F97316",color:"#fff"},children:"WARDRIVE"})]})})()]}),t.jsxs("div",{className:"text-fg-muted type-data-xs",children:[n.marker.prefix," • ",n.marker.candidate.hash.slice(0,10),"..."]}),!n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{style:{color:G().ambiguousColor},children:["Alternative (",(n.marker.candidate.probability*100).toFixed(0),"%)"]}),n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{className:"text-fg-muted",children:[n.marker.candidateCount," candidates"]})]})})]},Z)})]})}export{Ee as default}; +import{r as a,d0 as ae,cc as ie,c0 as le,gz as de,Z as J,cf as ce,j as t,V as K,c as z,gA as ue}from"./index-CR6htdhJ.js";import{M as pe,S as me,L as fe,a as _,P as ge}from"./maplibre-gl-Df1NK1kQ.js";import{B as xe}from"./BasemapLayer-B6qv9zHt.js";import{C as he}from"./car-BDe4EgpC.js";import{H as ye}from"./useMapViewStore-Dst_TEXH.js";import"./index-BtT4gFCt.js";import"./index-CnoLcwbn.js";const be={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},h={nodeColor:"#4338CA",localColor:"#4F46E5",hubColor:"#6366F1",edgeColor:"#3B3F4A",ambiguousColor:"#F9D26F",highlightColor:"#B49DFF",sourceColor:"#39D98A",destinationColor:"#B49DFF"};function C(c,r){if(!c)return r;if(c.startsWith("#"))return c;const m=ue(c);return m?`#${m.r.toString(16).padStart(2,"0")}${m.g.toString(16).padStart(2,"0")}${m.b.toString(16).padStart(2,"0")}`:r}function G(){if(typeof document>"u")return h;const c=document.documentElement,r=getComputedStyle(c);return{nodeColor:C(r.getPropertyValue("--map-node-stroke").trim(),h.nodeColor),localColor:C(r.getPropertyValue("--map-local-color").trim(),h.localColor),hubColor:C(r.getPropertyValue("--map-hub-color").trim(),h.hubColor),edgeColor:C(r.getPropertyValue("--map-edge-rest").trim(),h.edgeColor),ambiguousColor:C(r.getPropertyValue("--sys-indigo").trim(),h.ambiguousColor),highlightColor:C(r.getPropertyValue("--sys-blue").trim(),h.highlightColor),sourceColor:C(r.getPropertyValue("--sys-green").trim(),h.sourceColor),destinationColor:C(r.getPropertyValue("--sys-blue").trim(),h.destinationColor)}}function Ce({prefix:c,isLocal:r,isSource:m,isDestination:W,isLastHop:y,isHighlighted:g,isWardrive:k,candidate:x,onHover:E,onLeave:N,onClick:S}){const[n,w]=a.useState(!1),P=a.useCallback(()=>{w(!0),E()},[E]),j=a.useCallback(()=>{w(!1),N()},[N]),D=()=>k?"orange":r?"amber":m?"green":y?"amber":W?"purple":"blue";return k?t.jsxs("div",{className:z("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded-full",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:[t.jsx("div",{className:z("flex items-center justify-center","w-7 h-7 rounded-full","bg-sys-orange text-white","shadow-lg border-2 border-sys-orange/50","transition-transform duration-150",n&&"scale-110"),children:t.jsx(he,{className:"w-4 h-4",strokeWidth:2.5})}),n&&t.jsxs(K,{color:"orange",filled:!0,className:"ml-1 type-data-xs shadow-lg",children:[c,x.name&&t.jsx("span",{className:"ml-1 opacity-75",children:x.name})]})]}):t.jsx("div",{className:z("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:t.jsxs(K,{color:D(),filled:!0,className:"type-data-xs shadow-lg border border-current/30",children:[r&&t.jsx(ye,{className:"w-2.5 h-2.5 mr-1"}),c,n&&x.name&&t.jsx("span",{className:"ml-1 opacity-75",children:x.name})]})})}function je({hopNumber:c,snr:r,edgeColor:m}){return t.jsxs("div",{className:"flex flex-col items-center gap-0.5 pointer-events-none",children:[t.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center font-mono font-bold tabular-nums shadow-md",style:{backgroundColor:m||J[500],color:"#fff",fontSize:"8px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:c}),r!==void 0&&t.jsx(K,{color:"zinc",compact:!0,className:"!text-[9px] font-mono tabular-nums shadow-sm",children:r.toFixed(1)})]})}function Ee({resolvedPath:c,localNode:r,hubNodes:m=[],hoveredHopIndex:W,onHoverHop:y,traceSnr:g}){const k=g!==void 0&&g.length>0,x=a.useRef(null),E=ae(),N=ie(),S=a.useMemo(()=>new Set(m),[m]),[n,w]=a.useState(null),P=le(),[j,D]=a.useState(!1),[Z,U]=a.useState(0);a.useEffect(()=>{var f;const e=(f=x.current)==null?void 0:f.getMap();if(!e)return;const o=e.getCanvas();if(!o)return;const s=l=>{l.preventDefault(),console.warn("[PathMapMapLibre] WebGL context lost")},i=()=>{console.warn("[PathMapMapLibre] WebGL context restored, remounting..."),U(l=>l+1)};return o.addEventListener("webglcontextlost",s),o.addEventListener("webglcontextrestored",i),()=>{o.removeEventListener("webglcontextlost",s),o.removeEventListener("webglcontextrestored",i)}},[Z]);const{positions:v,markers:$,edges:I}=a.useMemo(()=>{const e=[],o=[],s=[],i=[],f=(p,V)=>p!==0||V!==0;let l=0,b=!1;return c.hops.forEach((p,V)=>{const Y=p.candidates.filter(d=>f(d.latitude,d.longitude));if(Y.length===0)return;const R=[...Y].sort((d,F)=>F.probability-d.probability),A=R[0],L=[A.longitude,A.latitude];if(i.push(L),i.length>=2){const d=i[i.length-2],F=i.length-2,M=g==null?void 0:g[F],T=L[0]-d[0],se=L[1]-d[1],ne=Math.atan2(T,se)*(180/Math.PI),re=G();let B;b?B="#F97316":M!==void 0?B=de()[ce(M,N)]||J[500]:B=re.edgeColor,s.push({from:d,to:L,snrFwd:M,midpoint:[(d[0]+L[0])/2,(d[1]+L[1])/2],bearing:ne,color:B,isFromWardrive:b})}const te=p.isSource===!0,oe=p.isDestination===!0;b=A.isWardrive===!0,R.forEach((d,F)=>{const M=[d.latitude,d.longitude];e.push(M);const T=F===0;o.push({position:M,prefix:p.prefix,confidence:p.confidence,candidateCount:R.length,hopIndex:V,candidate:d,isHub:S.has(d.hash),isPrimary:T,isSource:te,isDestination:oe,validIndex:l})}),l++}),{positions:e,markers:o,edges:s}},[c,S,g,N]),q=a.useMemo(()=>I.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[I]),u=a.useMemo(()=>{const e=$.filter(l=>l.isPrimary&&(l.confidence>=.5||l.isSource||l.isDestination));if(e.length===0)return null;let o=1/0,s=-1/0,i=1/0,f=-1/0;for(const l of e){const[b,p]=l.position;bs&&(s=b),pf&&(f=p)}return[[i,o],[f,s]]},[$]),O=a.useMemo(()=>{if(v.length===0)return r?[r.longitude,r.latitude]:[0,0];let e=0,o=0;for(const[s,i]of v)e+=s,o+=i;return[o/v.length,e/v.length]},[v,r]),H=a.useCallback(()=>{var o;const e=(o=x.current)==null?void 0:o.getMap();if(!e||!u){D(!0);return}e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:0}),setTimeout(()=>{D(!0)},50)},[u]),X=a.useMemo(()=>u?`${u[0][0].toFixed(5)},${u[0][1].toFixed(5)},${u[1][0].toFixed(5)},${u[1][1].toFixed(5)}`:"",[u]);a.useEffect(()=>{var o;if(!j)return;const e=(o=x.current)==null?void 0:o.getMap();!e||!u||e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:300})},[X,j,u]);const Q=P&&j,ee=a.useCallback(e=>{w({longitude:e.position[1],latitude:e.position[0],marker:e})},[]);return v.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted text-sm bg-elevated",children:"No mappable path data"}):t.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden depth-stroke-inset",children:[!Q&&t.jsx("div",{className:"absolute inset-0 bg-elevated flex items-center justify-center pointer-events-none",children:t.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-300 ease-out",style:{opacity:Q?1:0},children:t.jsxs(pe,{ref:x,initialViewState:{longitude:O[0],latitude:O[1],zoom:10},onLoad:H,style:{height:"100%",width:"100%"},mapStyle:be,attributionControl:!1,children:[t.jsx(xe,{mode:E}),I.map((e,o)=>t.jsx(me,{id:`edge-${o}`,type:"geojson",data:q[o],children:t.jsx(fe,{id:`edge-line-${o}`,type:"line",paint:{"line-color":e.color,"line-width":4,"line-opacity":1},layout:{"line-cap":"round","line-join":"round"}})},`edge-${o}`)),I.map((e,o)=>t.jsx(_,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx(je,{hopNumber:o+1,snr:k?e.snrFwd:void 0,edgeColor:e.color})},`hop-${o}`)),(()=>{const e=$.filter(s=>s.isPrimary),o=e.length>1?e.length-2:-1;return e.map((s,i)=>{const f=W===s.hopIndex,l=i===o&&!s.candidate.isLocal&&!s.isDestination;return t.jsx(_,{longitude:s.position[1],latitude:s.position[0],anchor:"center",children:t.jsx(Ce,{prefix:s.prefix,isLocal:s.candidate.isLocal||!1,isSource:s.isSource,isDestination:s.isDestination,isLastHop:l,isHighlighted:f,isWardrive:s.candidate.isWardrive||!1,candidate:s.candidate,onHover:()=>y==null?void 0:y(s.hopIndex),onLeave:()=>y==null?void 0:y(null),onClick:()=>ee(s)})},`${s.hopIndex}-${s.candidate.hash}`)})})(),n&&t.jsx(ge,{longitude:n.longitude,latitude:n.latitude,anchor:"bottom",offset:[0,-12],closeOnClick:!1,onClose:()=>w(null),className:"maplibre-popup",children:t.jsxs("div",{className:"text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"font-semibold",children:n.marker.candidate.name}),(()=>{const e=G();return t.jsxs(t.Fragment,{children:[n.marker.isSource&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.sourceColor,color:"#000"},children:"SRC"}),n.marker.isDestination&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.destinationColor,color:"#000"},children:"DST"}),n.marker.isHub&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.hubColor,color:"#000"},children:"HUB"}),n.marker.candidate.isLocal&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.localColor,color:"#fff"},children:"LOCAL"}),n.marker.candidate.isWardrive&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:"#F97316",color:"#fff"},children:"WARDRIVE"})]})})()]}),t.jsxs("div",{className:"text-fg-muted type-data-xs",children:[n.marker.prefix," • ",n.marker.candidate.hash.slice(0,10),"..."]}),!n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{style:{color:G().ambiguousColor},children:["Alternative (",(n.marker.candidate.probability*100).toFixed(0),"%)"]}),n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{className:"text-fg-muted",children:[n.marker.candidateCount," candidates"]})]})})]},Z)})]})}export{Ee as default}; diff --git a/frontend/dist/assets/RoomServer-D8juclj6.js b/frontend/dist/assets/RoomServer-BRJBoVVS.js similarity index 97% rename from frontend/dist/assets/RoomServer-D8juclj6.js rename to frontend/dist/assets/RoomServer-BRJBoVVS.js index 4a3edfa8..f89a915f 100644 --- a/frontend/dist/assets/RoomServer-D8juclj6.js +++ b/frontend/dist/assets/RoomServer-BRJBoVVS.js @@ -1,4 +1,4 @@ -import{e as I,r as l,j as e,ct as W,aa as De,c as A,aC as Ae,aL as $e,aD as Ke,V as U,I as E,eJ as Fe,B as b,cb as we,aF as ie,O as Oe,a7 as te,a3 as Ce,a0 as G,a1 as Be,eK as Se,eL as ze,bJ as _e,eM as qe,eN as He,eO as Ve,eP as Ue,eQ as Ge,eR as We,eS as Ye,eT as Ie,a6 as Je,Q as Qe,eE as Xe,cv as ce}from"./index-Bcr7MabU.js";import{C as q,P as de,a as me,B as Ze}from"./PageLayout-Bd1lZEvE.js";import{R as es,C as ue}from"./Grid-ChpC-NJE.js";import{c as ss,m as ts}from"./node-types-BFsObq9k.js";import{R as as}from"./repeat-BW0T0cvm.js";import{L as ns,a as rs,b as ls}from"./listbox-D38oqfIZ.js";import{P as os}from"./plus-DZIbd-kZ.js";import{F as P,L as D,D as is}from"./fieldset-Sxb3-P4w.js";import{M as Z}from"./map-pin-CmfqMW3N.js";import{T as Re}from"./trash-2-Dyph4AYl.js";import{S as ee,K as Y}from"./KeycapButton-DO0xfq38.js";import{C as xe}from"./ConfirmModal-CvAkhuom.js";import{S as cs,C as ds}from"./ChatBubble-BqSfRbsT.js";import{e as ms,g as us,a as xs}from"./chat-utils-lxurr5ix.js";import{W as se}from"./wifi-D7y3h36J.js";import{M as ps}from"./message-square-text-Cx7sNqKi.js";import{K as hs}from"./key-round-CzmFaK7Z.js";import"./element-movement-DUifCLY7.js";import"./use-text-value-B9WhdAMT.js";import"./frozen-Csgg4u-n.js";import"./keycap-sfx-ByZp-njj.js";/** +import{e as I,r as l,j as e,ct as W,aa as De,c as A,aC as Ae,aL as $e,aD as Ke,V as U,I as E,eJ as Fe,B as b,cb as we,aF as ie,O as Oe,a7 as te,a3 as Ce,a0 as G,a1 as Be,eK as Se,eL as ze,bJ as _e,eM as qe,eN as He,eO as Ve,eP as Ue,eQ as Ge,eR as We,eS as Ye,eT as Ie,a6 as Je,Q as Qe,eE as Xe,cv as ce}from"./index-CR6htdhJ.js";import{C as q,P as de,a as me,B as Ze}from"./PageLayout-Dk902Dlo.js";import{R as es,C as ue}from"./Grid-D3Ix759E.js";import{c as ss,m as ts}from"./node-types-BvQCDNK9.js";import{R as as}from"./repeat-5Hqru-wI.js";import{L as ns,a as rs,b as ls}from"./listbox-DbdSXuSb.js";import{P as os}from"./plus-CfHg5JLg.js";import{F as P,L as D,D as is}from"./fieldset-CnJ1jd-h.js";import{M as Z}from"./map-pin-DLf5Z8nk.js";import{T as Re}from"./trash-2-DDi3fVjz.js";import{S as ee,K as Y}from"./KeycapButton-DiVOyEmR.js";import{C as xe}from"./ConfirmModal-CijEsZrl.js";import{S as cs,C as ds}from"./ChatBubble-CpAqiMRZ.js";import{e as ms,g as us,a as xs}from"./chat-utils-DHa6YwrS.js";import{W as se}from"./wifi-DFzHXMz6.js";import{M as ps}from"./message-square-text-DBY1d0D7.js";import{K as hs}from"./key-round-CTDlyfAN.js";import"./element-movement-DIPTY4wV.js";import"./use-text-value-Ch4p-2-R.js";import"./frozen-i7Ib99V7.js";import"./keycap-sfx-ByZp-njj.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Sessions-edHRMZTm.js b/frontend/dist/assets/Sessions-BYXIJtxq.js similarity index 97% rename from frontend/dist/assets/Sessions-edHRMZTm.js rename to frontend/dist/assets/Sessions-BYXIJtxq.js index 43fc09ea..8eab2b47 100644 --- a/frontend/dist/assets/Sessions-edHRMZTm.js +++ b/frontend/dist/assets/Sessions-BYXIJtxq.js @@ -1,4 +1,4 @@ -import{e as g,r as l,fk as V,fl as z,eg as J,j as e,B as j,a2 as M,a0 as U,dV as Z,bJ as C,c as N,bZ as Q,eL as Y,cV as W,cF as X,ct as ee,c4 as se}from"./index-Bcr7MabU.js";import{C as ae}from"./ConfirmModal-CvAkhuom.js";import{P as te,a as le,B as ie,C as E}from"./PageLayout-Bd1lZEvE.js";import{R as T,C as y}from"./Grid-ChpC-NJE.js";import{S as $}from"./shield-check-Bjhdd7t0.js";import{C as ne}from"./circle-question-mark-CHrfUdMk.js";import{S as ce}from"./shield-CcCTQoJ7.js";import{A as re}from"./antenna-2HP9MLCI.js";import{T as F}from"./trash-2-Dyph4AYl.js";/** +import{e as g,r as l,fk as V,fl as z,eg as J,j as e,B as j,a2 as M,a0 as U,dV as Z,bJ as C,c as N,bZ as Q,eL as Y,cV as W,cF as X,ct as ee,c4 as se}from"./index-CR6htdhJ.js";import{C as ae}from"./ConfirmModal-CijEsZrl.js";import{P as te,a as le,B as ie,C as E}from"./PageLayout-Dk902Dlo.js";import{R as T,C as y}from"./Grid-D3Ix759E.js";import{S as $}from"./shield-check-CX3GhuSg.js";import{C as ne}from"./circle-question-mark-BTap0a_9.js";import{S as ce}from"./shield-Bd_LbwYW.js";import{A as re}from"./antenna-Bv3MESsD.js";import{T as F}from"./trash-2-DDi3fVjz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/SignalIndicator-CYjIo_Mn.js b/frontend/dist/assets/SignalIndicator-ClMJO5cF.js similarity index 99% rename from frontend/dist/assets/SignalIndicator-CYjIo_Mn.js rename to frontend/dist/assets/SignalIndicator-ClMJO5cF.js index 45015e7e..e9ee003b 100644 --- a/frontend/dist/assets/SignalIndicator-CYjIo_Mn.js +++ b/frontend/dist/assets/SignalIndicator-ClMJO5cF.js @@ -1,4 +1,4 @@ -import{e as l,r as m,c as i,j as r,gq as j,dx as _,e8 as k}from"./index-Bcr7MabU.js";/** +import{e as l,r as m,c as i,j as r,gq as j,dx as _,e8 as k}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Statistics-Cs88Tyyh.js b/frontend/dist/assets/Statistics-ITQ__4F-.js similarity index 98% rename from frontend/dist/assets/Statistics-Cs88Tyyh.js rename to frontend/dist/assets/Statistics-ITQ__4F-.js index 54d29195..15d45aab 100644 --- a/frontend/dist/assets/Statistics-Cs88Tyyh.js +++ b/frontend/dist/assets/Statistics-ITQ__4F-.js @@ -1,4 +1,4 @@ -var Ft=Object.defineProperty;var Ht=(t,n,s)=>n in t?Ft(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var ke=(t,n,s)=>Ht(t,typeof n!="symbol"?n+"":n,s);import{e as Oe,r as l,j as e,G as Ve,c as mt,P as At,cG as _t,cH as qe,w as De,cI as Bt,V as Pe,cJ as $t,co as Re,cK as zt,cL as Wt,x as Ut,at as Gt,cM as Vt,cN as qt,cO as Xt,cP as Kt,cQ as Yt,cc as Zt,cR as Xe,cf as Qt,cS as Jt,cT as es,a7 as Le,cU as ts,bZ as dt,c4 as ss,af as Rt,ag as ns,cV as as,bL as rs,a6 as is,ac as ls,ab as os,Q as cs,aR as ms,aS as ds,ad as us,aA as hs,cW as Ke,aj as xs,cX as ut,as as ps,aa as fs,cY as gs}from"./index-Bcr7MabU.js";import{L as Ee}from"./layers-D696eHgB.js";import{u as lt,h as ys,r as ot}from"./consumer-registry-Dy-EEMxV.js";import{e as bs}from"./easing-CUJ3Hgok.js";import{C as Ye}from"./compass-D-aH3UW_.js";import{T as js,M as vs}from"./MqttModeBadge-CrJ5xyVU.js";import{C as be,P as Ns,a as ks,B as ws}from"./PageLayout-Bd1lZEvE.js";import{A as Ze,D as ze}from"./DataValue-C0IxO0Ky.js";import{C as Ss}from"./CollisionExplorerModal-Y6S5TUlx.js";import{H as ht}from"./hash-DnbanjL5.js";import{L as We}from"./LightSparkline-DI3I2Qod.js";import{A as Ms}from"./activity-BHsjc-ov.js";import{c as Cs,a as As,A as _s}from"./AnalyzerFilterPanel-Dspm437W.js";import{useResolveSource as Rs}from"./usePipelineStore-nFeiBWWq.js";import{R as Ae,C as Ie}from"./Grid-ChpC-NJE.js";import{S as Ts}from"./settings-2-Warn9Z6j.js";import{N as Ls}from"./network-Bga26A1_.js";import"./chevron-right-BrHsAUr1.js";import"./map-pin-CmfqMW3N.js";import"./index-we8JTzK8.js";import"./index-BbwbpcoC.js";import"./maplibre-gl-CsF9Hmsz.js";import"./BasemapLayer-A-p_Dr5u.js";import"./share-2-CBcJN8r0.js";import"./node-types-BFsObq9k.js";import"./circle-question-mark-CHrfUdMk.js";import"./funnel-DFQf6jmi.js";import"./search-D6EZ95nX.js";/** +var Ft=Object.defineProperty;var Ht=(t,n,s)=>n in t?Ft(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var ke=(t,n,s)=>Ht(t,typeof n!="symbol"?n+"":n,s);import{e as Oe,r as l,j as e,G as Ve,c as mt,P as At,cG as _t,cH as qe,w as De,cI as Bt,V as Pe,cJ as $t,co as Re,cK as zt,cL as Wt,x as Ut,at as Gt,cM as Vt,cN as qt,cO as Xt,cP as Kt,cQ as Yt,cc as Zt,cR as Xe,cf as Qt,cS as Jt,cT as es,a7 as Le,cU as ts,bZ as dt,c4 as ss,af as Rt,ag as ns,cV as as,bL as rs,a6 as is,ac as ls,ab as os,Q as cs,aR as ms,aS as ds,ad as us,aA as hs,cW as Ke,aj as xs,cX as ut,as as ps,aa as fs,cY as gs}from"./index-CR6htdhJ.js";import{L as Ee}from"./layers-sBqNiTGy.js";import{u as lt,h as ys,r as ot}from"./consumer-registry-7Hi_pNJ6.js";import{e as bs}from"./easing-D4193t8J.js";import{C as Ye}from"./compass-fAtfJAIE.js";import{T as js,M as vs}from"./MqttModeBadge-_nVkYyqI.js";import{C as be,P as Ns,a as ks,B as ws}from"./PageLayout-Dk902Dlo.js";import{A as Ze,D as ze}from"./DataValue-CkLq2-xL.js";import{C as Ss}from"./CollisionExplorerModal-BjNF8_2U.js";import{H as ht}from"./hash-D5cqF2Y_.js";import{L as We}from"./LightSparkline-B480JOwC.js";import{A as Ms}from"./activity-B1_-JLqt.js";import{c as Cs,a as As,A as _s}from"./AnalyzerFilterPanel-C99KUEiV.js";import{useResolveSource as Rs}from"./usePipelineStore-CyVtwxqQ.js";import{R as Ae,C as Ie}from"./Grid-D3Ix759E.js";import{S as Ts}from"./settings-2-CKRrmjMw.js";import{N as Ls}from"./network-BdCm-DdC.js";import"./chevron-right-D2DgrpVm.js";import"./map-pin-DLf5Z8nk.js";import"./index-BtT4gFCt.js";import"./index-CnoLcwbn.js";import"./maplibre-gl-Df1NK1kQ.js";import"./BasemapLayer-B6qv9zHt.js";import"./share-2-Cm0TgUDc.js";import"./node-types-BvQCDNK9.js";import"./circle-question-mark-BTap0a_9.js";import"./funnel-4oboVPXr.js";import"./search-Djg1V5_Y.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/System-DbNujDNs.js b/frontend/dist/assets/System-kVeDbuco.js similarity index 98% rename from frontend/dist/assets/System-DbNujDNs.js rename to frontend/dist/assets/System-kVeDbuco.js index 879fe69c..837303c9 100644 --- a/frontend/dist/assets/System-DbNujDNs.js +++ b/frontend/dist/assets/System-kVeDbuco.js @@ -1,4 +1,4 @@ -import{e as ee,aK as A,O as B,r as l,L as J,j as e,dQ as z,c as F,bZ as se,a7 as E,dR as te,dS as re,dT as ne,dU as ae,cG as oe,B as le,dV as ce,dW as ie,dX as G}from"./index-Bcr7MabU.js";import{C as P,P as de,a as me,B as ue}from"./PageLayout-Bd1lZEvE.js";import{A as xe}from"./arrow-up-r11Chuf6.js";import{N as fe}from"./network-Bga26A1_.js";import{A as he}from"./arrow-down-DFZvzXIi.js";import{T as pe}from"./thermometer-DrBja3ui.js";import{A as D}from"./activity-BHsjc-ov.js";import{C as ge}from"./cpu-CnyGw0WC.js";import{R as H,C as $}from"./Grid-ChpC-NJE.js";/** +import{e as ee,aK as A,O as B,r as l,L as J,j as e,dQ as z,c as F,bZ as se,a7 as E,dR as te,dS as re,dT as ne,dU as ae,cG as oe,B as le,dV as ce,dW as ie,dX as G}from"./index-CR6htdhJ.js";import{C as P,P as de,a as me,B as ue}from"./PageLayout-Dk902Dlo.js";import{A as xe}from"./arrow-up-K4au-fHx.js";import{N as fe}from"./network-BdCm-DdC.js";import{A as he}from"./arrow-down-DFhP0Q_b.js";import{T as pe}from"./thermometer-BJ9Pjk-U.js";import{A as D}from"./activity-B1_-JLqt.js";import{C as ge}from"./cpu-dVpC8VDl.js";import{R as H,C as $}from"./Grid-D3Ix759E.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Terminal-Bw5JmSLd.js b/frontend/dist/assets/Terminal-C_swQfTI.js similarity index 99% rename from frontend/dist/assets/Terminal-Bw5JmSLd.js rename to frontend/dist/assets/Terminal-C_swQfTI.js index 79ae8971..402e3b0e 100644 --- a/frontend/dist/assets/Terminal-Bw5JmSLd.js +++ b/frontend/dist/assets/Terminal-C_swQfTI.js @@ -1,4 +1,4 @@ -var Ua=Object.defineProperty;var ja=(e,t,s)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var D=(e,t,s)=>ja(e,typeof t!="symbol"?t+"":t,s);import{e as li,Z as is,O as ve,e4 as Ka,e5 as rt,e6 as ei,e7 as qa,e8 as xo,du as ko,dv as Va,X as Eo,e9 as Ga,ea as Xa,eb as Ya,cD as Ja,ec as Za,cu as Qa,t as Ro,dt as el,bS as tl,ed as sl,c9 as Bo,ee as ce,bK as il,P as rl,c7 as nl,cv as xt,ef as ol,eg as al,eh as ll,ei as hl,dX as Ur,ej as vs,ek as Lo,el as Mo,em as Do,j as m,aC as To,aL as $o,aE as jr,aD as Ao,B as cl,r as U,d as fi,m as $s,en as Kr,eo as qr,c_ as dl,ep as ul,c as ti,eq as _l,er as fl,a6 as pl,es as ml,et as gl,eu as vl}from"./index-Bcr7MabU.js";import{g as Sl,r as yl}from"./system-0ZU2C0Q5.js";import{P as bl,B as wl,C as Cl}from"./PageLayout-Bd1lZEvE.js";import{K as Po,S as xl}from"./KeycapButton-DO0xfq38.js";import{S as Vr}from"./search-D6EZ95nX.js";import{C as kl}from"./chevron-right-BrHsAUr1.js";import"./keycap-sfx-ByZp-njj.js";/** +var Ua=Object.defineProperty;var ja=(e,t,s)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var D=(e,t,s)=>ja(e,typeof t!="symbol"?t+"":t,s);import{e as li,Z as is,O as ve,e4 as Ka,e5 as rt,e6 as ei,e7 as qa,e8 as xo,du as ko,dv as Va,X as Eo,e9 as Ga,ea as Xa,eb as Ya,cD as Ja,ec as Za,cu as Qa,t as Ro,dt as el,bS as tl,ed as sl,c9 as Bo,ee as ce,bK as il,P as rl,c7 as nl,cv as xt,ef as ol,eg as al,eh as ll,ei as hl,dX as Ur,ej as vs,ek as Lo,el as Mo,em as Do,j as m,aC as To,aL as $o,aE as jr,aD as Ao,B as cl,r as U,d as fi,m as $s,en as Kr,eo as qr,c_ as dl,ep as ul,c as ti,eq as _l,er as fl,a6 as pl,es as ml,et as gl,eu as vl}from"./index-CR6htdhJ.js";import{g as Sl,r as yl}from"./system-BR9AxlO1.js";import{P as bl,B as wl,C as Cl}from"./PageLayout-Dk902Dlo.js";import{K as Po,S as xl}from"./KeycapButton-DiVOyEmR.js";import{S as Vr}from"./search-Djg1V5_Y.js";import{C as kl}from"./chevron-right-D2DgrpVm.js";import"./keycap-sfx-ByZp-njj.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -142,7 +142,7 @@ The web user needs polkit permissions to restart the service. See: /etc/polkit-1/localauthority/50-local.d/pymc-repeater.pkla`,"error");return}s.update(r,a.error||"Restart failed","error")}catch(n){const o=n instanceof Error?n.message:"";o.includes("ERR_NETWORK")||o.includes("ECONNRESET")||o.includes("Failed to fetch")||o.includes("Load failed")||o.includes("network connection was lost")||o.includes("abort")||o.includes("timeout")||n instanceof DOMException&&n.name==="TimeoutError"||n instanceof DOMException&&n.name==="AbortError"?(s.update(r,"Service is restarting (connection dropped).","success"),await this.waitForService(s)):s.update(r,`Error: ${o||"Restart failed"}`,"error")}}waitForService(s){return new Promise(i=>{const r=s.write("Waiting for service...","system");let n=0;const o=30;setTimeout(()=>{const a=setInterval(async()=>{n++,s.update(r,`Waiting for service... ${n}s`,"system");try{const h=new AbortController,l=setTimeout(()=>h.abort(),3e3);await fetch(`${hl}/api/stats`,{signal:h.signal}),clearTimeout(l),clearInterval(a),s.update(r,`Service connected. (${n+4}s)`,"success"),i();return}catch{}n>=o&&(clearInterval(a),s.update(r,`Service did not respond within ${o+4}s. Check manually.`,"warning"),i())},1e3)},4e3)})}}const Wt="\x1B[",Oe=`${Wt}0m`,Fa=`${Wt}32m`,Hr=`${Wt}33m`,Wr=`${Wt}31m`,M_=`${Wt}36m`,Lt=`${Wt}90m`,Ha=`${Wt}1m`;function Yt(e){return e>=1073741824?`${(e/1073741824).toFixed(1)}G`:e>=1048576?`${(e/1048576).toFixed(0)}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}B`}function uo(e){const t=Math.floor(e/86400),s=Math.floor(e%86400/3600),i=Math.floor(e%3600/60);return t>0?`${t}d ${s}h ${i}m`:s>0?`${s}h ${i}m`:`${i}m`}function D_(e,t){const s=Math.max(0,Math.min(100,e)),i=Math.round(s/100*t),r=t-i,n=s>=90?Wr:s>=70?Hr:Fa,o=`${n}${"█".repeat(i)}${Oe}${Lt}${"░".repeat(r)}${Oe}`,a=`${s.toFixed(1)}%`.padStart(6);return`[${o}] ${n}${a}${Oe}`}function T_(e){return e>=80?`${Wr}${Ha}${e.toFixed(1)}°C${Oe}`:e>=60?`${Hr}${e.toFixed(1)}°C${Oe}`:`${Fa}${e.toFixed(1)}°C${Oe}`}const Cs=2,_o=" ";function Jt(e,t){const s=" ".repeat(Cs),i=t-Cs,r=_o.length,n=[];let o="",a=0;for(const h of e){const l=_u(h);a===0?(o=h,a=l):a+r+l<=i?(o+=_o+h,a+=r+l):(n.push(s+o),o=h,a=l)}return a>0&&n.push(s+o),n}function $_(e,t,s){var d,u;const i=e.node_name||"unknown",r=e.version?`v${e.version}`:"",n=(d=t.system)!=null&&d.uptime?uo(t.system.uptime):"?",o=uo(e.uptime_seconds||0),a=Math.max(3,s-Cs*2),h=((u=t.cpu.load_avg)==null?void 0:u["1min"].toFixed(2))??"?",l=t.cpu.load_avg?`${h} ${t.cpu.load_avg["5min"].toFixed(2)} ${t.cpu.load_avg["15min"].toFixed(2)}`:"?",c=s>=60?l:h;return[` ${M_}${Ha}${i}${Oe} ${Lt}${r}${Oe}`,` ${Lt}${"─".repeat(a)}${Oe}`,...Jt([w("Sys",y(n)),w("Svc",y(o)),w("Load",y(c))],s)]}function A_(e,t){const i=Cs+4+1+2+6,r=Math.max(6,Math.min(30,t-i)),n=i+r,o=t-n-2,a=[""],h=`${e.cpu.count} core${e.cpu.count>1?"s":""}`,l=`${Yt(e.memory.used)}/${Yt(e.memory.total)}`,c=`${Yt(e.disk.used)}/${Yt(e.disk.total)}`,d=(f,_,p)=>{const g=D_(_,r),k=o>=p.length?` ${Pe(p)}`:"";return` ${b(f.padEnd(4))}${g}${k}`};a.push(d("CPU",e.cpu.usage_percent,h)),a.push(d("Mem",e.memory.usage_percent,l)),a.push(d("Dsk",e.disk.usage_percent,c));const u=Object.entries(e.temperatures||{});if(u.length>0){const f=u.map(([_,p])=>`${Pe(_+":")} ${T_(p)}`);a.push(...Jt(f,t))}return a}function P_(e,t){var l,c;const s=e.neighbors||{},i=Object.keys(s).length,r=Object.values(s).filter(d=>d.zero_hop).length,n=((c=(l=e.config)==null?void 0:l.repeater)==null?void 0:c.mode)||"?",o=e.noise_floor_dbm!=null?`${e.noise_floor_dbm}dBm`:"?",a=e.duty_cycle_percent??0,h=["",` ${Lt}MESH${Oe}`];return h.push(...Jt([w("Mode",y(n)),w("Nbrs",`${y(String(r))}${Pe(`/${i}`)}`),w("Noise",y(o)),w("Air",y(`${a.toFixed(1)}%`))],t)),h.push(...Jt([w("RX",y(String(e.rx_count??0))),w("TX",y(String(e.tx_count??0))),w("FWD",y(String(e.forwarded_count??0))),w("Drop",y(String(e.dropped_count??0)))],t)),h.push(...Jt([w("RX/h",y(String(Math.round(e.rx_per_hour??0)))),w("FWD/h",y(String(Math.round(e.forwarded_per_hour??0))))],t)),h}function N_(e,t){if(!e.network)return[];const s=["",` ${Lt}NET${Oe}`];return s.push(...Jt([w("TX",y(Yt(e.network.bytes_sent))),w("RX",y(Yt(e.network.bytes_recv))),w("Pkt",`${y(String(e.network.packets_sent))}${Pe("/")}${y(String(e.network.packets_recv))}`)],t)),s}function I_(e,t,s){if(e.length===0)return[];const i=t>=50,r=t>=50?6:5,n=t>=50?6:5,o=i?7:0,a=Cs+0,h=Math.max(4,t-a-o-r-n-4),l=3,c=t>=50?8:5,d=s!=null?Math.max(0,Math.min(c,s-l)):c;if(d<=0)return[];const u=["",` ${Lt}PROCS${Oe}`],f=(i?"PID".padEnd(o):"")+"CPU".padStart(r)+"MEM".padStart(n)+" NAME";u.push(` ${Pe(f)}`);for(const _ of e.slice(0,d)){const p=i?Pe(String(_.pid).padEnd(o)):"",g=(t>=50?_.cpu_percent.toFixed(1):_.cpu_percent.toFixed(0)).padStart(r),k=(t>=50?_.memory_percent.toFixed(1):_.memory_percent.toFixed(0)).padStart(n),q=_.name.length>h?_.name.slice(0,h-1)+"…":_.name,F=_.cpu_percent>=50?Wr:_.cpu_percent>=20?Hr:"",T=F?`${F}${g}${Oe}`:g;u.push(` ${p}${T}${Pe(k)} ${q}`)}return u}function O_(){return new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function fo(e,t,s,i,r){if(!e||!t)return` ${Lt}Waiting for data…${Oe}`;const n=$_(e,t,i),o=A_(t,i),a=P_(e,i),h=N_(t,i),l=["",` ${Lt}${O_()} · Ctrl+C to exit${Oe}`],c=[...n,...o,...a,...h,...l],d=r?br(c,i):0,u=r?Math.max(0,r-d):void 0,f=I_(s,i,u),_=[...c.slice(0,-l.length),...f,...l];return r&&_.length>r&&(_.length=r),_.join(` `)}const F_=3e3;class H_ extends ie{constructor(){super(...arguments);D(this,"name","top");D(this,"description","Live system overview (Ctrl+C to exit)");D(this,"aliases",["htop"])}async execute({output:s,rawInput:i,cols:r,signal:n}){var l,c;if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("top"),` ${b("Live-updating system overview combining hardware")}`,` ${b("stats, mesh metrics, and running processes.")}`,` ${b("Refreshes every 3s. Press Ctrl+C to exit.")}`,"",B("top","start live display"),"",z("Sections"),` ${b("Header Node name, version, uptime, load average")}`,` ${b("Gauges CPU, memory, disk usage with bar charts")}`,` ${b("Mesh Mode, neighbors, packet counts, airtime")}`,` ${b("Network TCP/IP bytes and packet counters")}`,` ${b("Processes Top 8 processes by CPU usage")}`,"",z("Aliases"),` ${b("htop")}`].join(` `));return}let o=null,a=[],h=xt.getState().stats;try{const[d,u]=await Promise.all([ei(),Ur()]);d.success&&d.data&&(o=d.data),u.success&&u.data&&(a=u.data.processes.sort((f,_)=>_.cpu_percent-f.cpu_percent))}catch{}if(!n.aborted){(l=s.enterFullscreen)==null||l.call(s);try{const d=s.write(fo(h,o,a,s.cols??r,s.rows));await new Promise(u=>{if(n.aborted){u();return}const f=async()=>{h=xt.getState().stats;try{const[p,g]=await Promise.all([ei(),Ur()]);p.success&&p.data&&(o=p.data),g.success&&g.data&&(a=g.data.processes.sort((k,q)=>q.cpu_percent-k.cpu_percent))}catch{}n.aborted||s.update(d,fo(h,o,a,s.cols??r,s.rows))},_=setInterval(()=>{if(n.aborted){clearInterval(_),u();return}f()},F_);n.addEventListener("abort",()=>{clearInterval(_),u()},{once:!0})})}finally{(c=s.exitFullscreen)==null||c.call(s)}}}}const po=["DONT PANIC","C0FFEE","FEED C0DE","LOL","I CANNOT DO THAT"];function zr(){return po[Math.floor(Math.random()*po.length)]}const Cr=new EventTarget,xr="shell-phrase";function Wa(e){Cr.dispatchEvent(new CustomEvent(xr,{detail:e??zr()}))}function W_(e){const t=s=>e(s.detail);return Cr.addEventListener(xr,t),()=>Cr.removeEventListener(xr,t)}class z_ extends ie{constructor(){super(...arguments);D(this,"name","fortune");D(this,"description","Display a fortune on the header");D(this,"aliases",["lol"])}execute({output:s}){const i=zr();Wa(i),s.write(b(` ${i}`))}}const kr=new EventTarget,Er="party-time";function U_(){kr.dispatchEvent(new Event(Er))}function j_(e){return kr.addEventListener(Er,e),()=>kr.removeEventListener(Er,e)}class K_ extends ie{constructor(){super(...arguments);D(this,"name","partytime");D(this,"description","Party on, Garth!");D(this,"aliases",["party","excellent","waynesworld"])}execute({output:s}){U_(),Wa("PARTY 0N GARTH"),s.write(b(" SCHWING!"))}}class q_ extends ie{constructor(){super(...arguments);D(this,"name","ver");D(this,"description","Show version info");D(this,"aliases",["version"])}async execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("ver"),` ${b("Display pyMC_Repeater, core, and console version.")}`,` ${b('Equivalent to firmware serial CLI "ver" command.')}`,"",B("ver","show version"),"",z("Aliases"),` ${b("version")}`].join(` -`));return}const r=s.write("processing...","system");try{const n=await rt();s.update(r,[` ${w("pyMC_Repeater",y(`v${n.version||"?"}`))}`,` ${w("pyMC_Core",y(n.core_version||"?"))}`,` ${w("pyMC_Console",y("v0.9.321"))}`].join(` +`));return}const r=s.write("processing...","system");try{const n=await rt();s.update(r,[` ${w("pyMC_Repeater",y(`v${n.version||"?"}`))}`,` ${w("pyMC_Core",y(n.core_version||"?"))}`,` ${w("pyMC_Console",y("v0.9.322"))}`].join(` `),"value")}catch(n){s.update(r,`Error: ${n instanceof Error?n.message:"Command failed"}`,"error")}}}class V_ extends ie{constructor(){super(...arguments);D(this,"name","clock");D(this,"description","Show system UTC time")}execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("clock"),` ${b("Display the current system UTC time.")}`,` ${b('Equivalent to firmware serial CLI "clock" command.')}`,` ${b("Use to verify NTP sync and correlate packet timestamps.")}`,"",B("clock","show UTC time")].join(` `));return}const r=new Date;s.write([` ${w("UTC",y(r.toUTCString()))}`,` ${w("ISO",y(r.toISOString()))}`,` ${w("Unix",y(String(Math.floor(r.getTime()/1e3))))}`].join(` `),"value")}}class G_ extends ie{constructor(){super(...arguments);D(this,"name","stats-packets");D(this,"description","Packet counters")}async execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("stats-packets"),` ${b("Display packet counters: sent, received, forwarded, dropped.")}`,` ${b('Equivalent to firmware serial CLI "stats-packets" command.')}`,"",B("stats-packets","show packet counters")].join(` diff --git a/frontend/dist/assets/Test-BlhdbxMX.js b/frontend/dist/assets/Test-BcitrV8D.js similarity index 99% rename from frontend/dist/assets/Test-BlhdbxMX.js rename to frontend/dist/assets/Test-BcitrV8D.js index 2ba6edbf..22a1e475 100644 --- a/frontend/dist/assets/Test-BlhdbxMX.js +++ b/frontend/dist/assets/Test-BcitrV8D.js @@ -1,4 +1,4 @@ -import{e as Ae,r as p,gu as _e,gv as Ie,af as Be,ag as Ve,j as e,a7 as U,V as ye,dV as He,dK as qe,c as le,aF as We,Q as Oe,a6 as Ye,gw as Xe,O as $,co as z,v as ze,c8 as Ge,bZ as Je,H as me,Z,gx as Qe,L as xe}from"./index-Bcr7MabU.js";import{C as Q,P as Ke,a as Ue,B as De}from"./PageLayout-Bd1lZEvE.js";import{useResolveSource as Ze}from"./usePipelineStore-nFeiBWWq.js";import{C as et}from"./chevron-right-BrHsAUr1.js";import{R as se,C as ae}from"./Grid-ChpC-NJE.js";import"./node-types-BFsObq9k.js";/** +import{e as Ae,r as p,gu as _e,gv as Ie,af as Be,ag as Ve,j as e,a7 as U,V as ye,dV as He,dK as qe,c as le,aF as We,Q as Oe,a6 as Ye,gw as Xe,O as $,co as z,v as ze,c8 as Ge,bZ as Je,H as me,Z,gx as Qe,L as xe}from"./index-CR6htdhJ.js";import{C as Q,P as Ke,a as Ue,B as De}from"./PageLayout-Dk902Dlo.js";import{useResolveSource as Ze}from"./usePipelineStore-CyVtwxqQ.js";import{C as et}from"./chevron-right-D2DgrpVm.js";import{R as se,C as ae}from"./Grid-D3Ix759E.js";import"./node-types-BvQCDNK9.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/activity-BHsjc-ov.js b/frontend/dist/assets/activity-B1_-JLqt.js similarity index 89% rename from frontend/dist/assets/activity-BHsjc-ov.js rename to frontend/dist/assets/activity-B1_-JLqt.js index 07caaa63..6a963e4e 100644 --- a/frontend/dist/assets/activity-BHsjc-ov.js +++ b/frontend/dist/assets/activity-B1_-JLqt.js @@ -1,4 +1,4 @@ -import{e as t}from"./index-Bcr7MabU.js";/** +import{e as t}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/antenna-2HP9MLCI.js b/frontend/dist/assets/antenna-Bv3MESsD.js similarity index 91% rename from frontend/dist/assets/antenna-2HP9MLCI.js rename to frontend/dist/assets/antenna-Bv3MESsD.js index 1cc6fa9a..1db08ca4 100644 --- a/frontend/dist/assets/antenna-2HP9MLCI.js +++ b/frontend/dist/assets/antenna-Bv3MESsD.js @@ -1,4 +1,4 @@ -import{e}from"./index-Bcr7MabU.js";/** +import{e}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/arrow-down-DFZvzXIi.js b/frontend/dist/assets/arrow-down-DFhP0Q_b.js similarity index 86% rename from frontend/dist/assets/arrow-down-DFZvzXIi.js rename to frontend/dist/assets/arrow-down-DFhP0Q_b.js index a0cf7334..c8a45d88 100644 --- a/frontend/dist/assets/arrow-down-DFZvzXIi.js +++ b/frontend/dist/assets/arrow-down-DFhP0Q_b.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Bcr7MabU.js";/** +import{e as o}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/arrow-right-Bv8RdUpJ.js b/frontend/dist/assets/arrow-right-3jiFJDYq.js similarity index 86% rename from frontend/dist/assets/arrow-right-Bv8RdUpJ.js rename to frontend/dist/assets/arrow-right-3jiFJDYq.js index 737aed7a..7e50ccbe 100644 --- a/frontend/dist/assets/arrow-right-Bv8RdUpJ.js +++ b/frontend/dist/assets/arrow-right-3jiFJDYq.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Bcr7MabU.js";/** +import{e as o}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/arrow-up-r11Chuf6.js b/frontend/dist/assets/arrow-up-K4au-fHx.js similarity index 86% rename from frontend/dist/assets/arrow-up-r11Chuf6.js rename to frontend/dist/assets/arrow-up-K4au-fHx.js index 89c928ee..410798f9 100644 --- a/frontend/dist/assets/arrow-up-r11Chuf6.js +++ b/frontend/dist/assets/arrow-up-K4au-fHx.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Bcr7MabU.js";/** +import{e as o}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/car-Cn7MZO12.js b/frontend/dist/assets/car-BDe4EgpC.js similarity index 92% rename from frontend/dist/assets/car-Cn7MZO12.js rename to frontend/dist/assets/car-BDe4EgpC.js index 7a1148c6..e5d478d4 100644 --- a/frontend/dist/assets/car-Cn7MZO12.js +++ b/frontend/dist/assets/car-BDe4EgpC.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Bcr7MabU.js";/** +import{e as c}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/chat-utils-lxurr5ix.js b/frontend/dist/assets/chat-utils-DHa6YwrS.js similarity index 97% rename from frontend/dist/assets/chat-utils-lxurr5ix.js rename to frontend/dist/assets/chat-utils-DHa6YwrS.js index d632b1fc..d6a28d97 100644 --- a/frontend/dist/assets/chat-utils-lxurr5ix.js +++ b/frontend/dist/assets/chat-utils-DHa6YwrS.js @@ -1 +1 @@ -import{r as g,Z as d,O as l}from"./index-Bcr7MabU.js";function p(e){const n=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,o=Math.max(n,t,r),i=Math.min(n,t,r),a=(o+i)/2;if(o===i)return[0,0,a];const s=o-i,u=a>.5?s/(2-o-i):s/(o+i);let c=0;return o===n?c=((t-r)/s+(t(c<0&&(c+=1),c>1&&(c-=1),c<1/6?s+(u-s)*6*c:c<1/2?u:c<2/3?s+(u-s)*(2/3-c)*6:s),o=t<.5?t*(1+n):t+n-t*n,i=2*t-o,a=s=>Math.round(s*255).toString(16).padStart(2,"0");return`#${a(r(i,o,e+1/3))}${a(r(i,o,e))}${a(r(i,o,e-1/3))}`}function S(e,n,t){let r=n[0]-e[0];return r>.5&&(r-=1),r<-.5&&(r+=1),[(e[0]+r*t+1)%1,e[1]+(n[1]-e[1])*t,e[2]+(n[2]-e[2])*t]}const x=[l.red,l.orange,l.amber,l.green,l.teal,l.cyan,l.blue,l.indigo,l.purple,l.pink],m=4,h=[];{const e=x.map(p);for(let n=0;n3||n.replace(f,"").replace(/[\u200D\uFE0F\s]/g,"").length>0?0:t.length}function C(e){const n=e.match(f);if(n&&n.length>0){const t=n[0],r=e.replace(f,"").trim();return{emoji:t,cleanName:r||e}}return{emoji:null,cleanName:e}}function y(e){const{cleanName:n}=C(e),t=n.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const o=Array.from(t[0])[0]||"",i=Array.from(t[1])[0]||"";return(o+i).toUpperCase()}return Array.from(n).slice(0,2).join("").toUpperCase()}function M(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function T(e,n){const t=/@\[([^\]]+)\]/g,r=[];let o=0,i;const a=n!=null&&n.isOutgoing?d[200]:l.blue,s=n==null?void 0:n.onMentionClick;for(;(i=t.exec(e))!==null;){i.index>o&&r.push(e.slice(o,i.index));const u=i[1];r.push(g.createElement(s?"button":"span",{key:i.index,className:s?"font-bold hover:underline underline-offset-2 cursor-pointer":"font-bold",style:{color:a},...s&&{type:"button",onClick:c=>{c.stopPropagation(),s(u)}}},u)),o=i.index+i[0].length}return o0?r:e}export{y as a,M as b,N as c,C as e,T as f,j as g}; +import{r as g,Z as d,O as l}from"./index-CR6htdhJ.js";function p(e){const n=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,o=Math.max(n,t,r),i=Math.min(n,t,r),a=(o+i)/2;if(o===i)return[0,0,a];const s=o-i,u=a>.5?s/(2-o-i):s/(o+i);let c=0;return o===n?c=((t-r)/s+(t(c<0&&(c+=1),c>1&&(c-=1),c<1/6?s+(u-s)*6*c:c<1/2?u:c<2/3?s+(u-s)*(2/3-c)*6:s),o=t<.5?t*(1+n):t+n-t*n,i=2*t-o,a=s=>Math.round(s*255).toString(16).padStart(2,"0");return`#${a(r(i,o,e+1/3))}${a(r(i,o,e))}${a(r(i,o,e-1/3))}`}function S(e,n,t){let r=n[0]-e[0];return r>.5&&(r-=1),r<-.5&&(r+=1),[(e[0]+r*t+1)%1,e[1]+(n[1]-e[1])*t,e[2]+(n[2]-e[2])*t]}const x=[l.red,l.orange,l.amber,l.green,l.teal,l.cyan,l.blue,l.indigo,l.purple,l.pink],m=4,h=[];{const e=x.map(p);for(let n=0;n3||n.replace(f,"").replace(/[\u200D\uFE0F\s]/g,"").length>0?0:t.length}function C(e){const n=e.match(f);if(n&&n.length>0){const t=n[0],r=e.replace(f,"").trim();return{emoji:t,cleanName:r||e}}return{emoji:null,cleanName:e}}function y(e){const{cleanName:n}=C(e),t=n.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const o=Array.from(t[0])[0]||"",i=Array.from(t[1])[0]||"";return(o+i).toUpperCase()}return Array.from(n).slice(0,2).join("").toUpperCase()}function M(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function T(e,n){const t=/@\[([^\]]+)\]/g,r=[];let o=0,i;const a=n!=null&&n.isOutgoing?d[200]:l.blue,s=n==null?void 0:n.onMentionClick;for(;(i=t.exec(e))!==null;){i.index>o&&r.push(e.slice(o,i.index));const u=i[1];r.push(g.createElement(s?"button":"span",{key:i.index,className:s?"font-bold hover:underline underline-offset-2 cursor-pointer":"font-bold",style:{color:a},...s&&{type:"button",onClick:c=>{c.stopPropagation(),s(u)}}},u)),o=i.index+i[0].length}return o0?r:e}export{y as a,M as b,N as c,C as e,T as f,j as g}; diff --git a/frontend/dist/assets/check-check-XzEYoNqt.js b/frontend/dist/assets/check-check-TgoebkD3.js similarity index 88% rename from frontend/dist/assets/check-check-XzEYoNqt.js rename to frontend/dist/assets/check-check-TgoebkD3.js index 63165808..526cab16 100644 --- a/frontend/dist/assets/check-check-XzEYoNqt.js +++ b/frontend/dist/assets/check-check-TgoebkD3.js @@ -1,4 +1,4 @@ -import{e}from"./index-Bcr7MabU.js";/** +import{e}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/chevron-right-BrHsAUr1.js b/frontend/dist/assets/chevron-right-D2DgrpVm.js similarity index 85% rename from frontend/dist/assets/chevron-right-BrHsAUr1.js rename to frontend/dist/assets/chevron-right-D2DgrpVm.js index 0f3b8644..31520420 100644 --- a/frontend/dist/assets/chevron-right-BrHsAUr1.js +++ b/frontend/dist/assets/chevron-right-D2DgrpVm.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-Bcr7MabU.js";/** +import{e as o}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/chevron-up-DDF7YpTU.js b/frontend/dist/assets/chevron-up-v1ZA2R-9.js similarity index 99% rename from frontend/dist/assets/chevron-up-DDF7YpTU.js rename to frontend/dist/assets/chevron-up-v1ZA2R-9.js index db4600cc..af60c200 100644 --- a/frontend/dist/assets/chevron-up-DDF7YpTU.js +++ b/frontend/dist/assets/chevron-up-v1ZA2R-9.js @@ -1,4 +1,4 @@ -import{r as x,ba as F,e as R}from"./index-Bcr7MabU.js";function S(r,l,e){let s=e.initialDeps??[],t,n=!0;function o(){var i,h,u;let c;e.key&&((i=e.debug)!=null&&i.call(e))&&(c=Date.now());const f=r();if(!(f.length!==s.length||f.some((p,d)=>s[d]!==p)))return t;s=f;let m;if(e.key&&((h=e.debug)!=null&&h.call(e))&&(m=Date.now()),t=l(...f),e.key&&((u=e.debug)!=null&&u.call(e))){const p=Math.round((Date.now()-c)*100)/100,d=Math.round((Date.now()-m)*100)/100,b=d/16,E=(g,w)=>{for(g=String(g);g.lengths[d]!==p)))return t;s=f;let m;if(e.key&&((h=e.debug)!=null&&h.call(e))&&(m=Date.now()),t=l(...f),e.key&&((u=e.debug)!=null&&u.call(e))){const p=Math.round((Date.now()-c)*100)/100,d=Math.round((Date.now()-m)*100)/100,b=d/16,E=(g,w)=>{for(g=String(g);g.length{s=i},o}function M(r,l){if(r===void 0)throw new Error("Unexpected undefined");return r}const _=(r,l)=>Math.abs(r-l)<1.01,T=(r,l,e)=>{let s;return function(...t){r.clearTimeout(s),s=r.setTimeout(()=>l.apply(this,t),e)}},z=r=>{const{offsetWidth:l,offsetHeight:e}=r;return{width:l,height:e}},k=r=>r,W=r=>{const l=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),s=[];for(let t=l;t<=e;t++)s.push(t);return s},D=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const t=o=>{const{width:i,height:h}=o;l({width:Math.round(i),height:Math.round(h)})};if(t(z(e)),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(o=>{const i=()=>{const h=o[0];if(h!=null&&h.borderBoxSize){const u=h.borderBoxSize[0];if(u){t({width:u.inlineSize,height:u.blockSize});return}}t(z(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return n.observe(e,{box:"border-box"}),()=>{n.unobserve(e)}},C={passive:!0},O=typeof window>"u"?!0:"onscrollend"in window,L=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;let t=0;const n=r.options.useScrollendEvent&&O?()=>{}:T(s,()=>{l(t,!1)},r.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:f,isRtl:a}=r.options;t=f?e.scrollLeft*(a&&-1||1):e.scrollTop,n(),l(t,c)},i=o(!0),h=o(!1);e.addEventListener("scroll",i,C);const u=r.options.useScrollendEvent&&O;return u&&e.addEventListener("scrollend",h,C),()=>{e.removeEventListener("scroll",i),u&&e.removeEventListener("scrollend",h)}},j=(r,l,e)=>{if(l!=null&&l.borderBoxSize){const s=l.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},P=(r,{adjustments:l=0,behavior:e},s)=>{var t,n;const o=r+l;(n=(t=s.scrollElement)==null?void 0:t.scrollTo)==null||n.call(t,{[s.options.horizontal?"left":"top"]:o,behavior:e})};class B{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(n=>{const o=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var t;(t=s())==null||t.disconnect(),e=null},observe:t=>{var n;return(n=s())==null?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return(n=s())==null?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,t])=>{typeof t>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:k,rangeExtractor:W,onChange:()=>{},measureElement:j,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,t;(t=(s=this.options).onChange)==null||t.call(s,this,e)},this.maybeNotify=S(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const t=new Map,n=new Map;for(let o=s-1;o>=0;o--){const i=e[o];if(t.has(i.lane))continue;const h=n.get(i.lane);if(h==null||i.end>h.end?n.set(i.lane,i):i.endo.end===i.end?o.index-i.index:o.end-i.end)[0]:void 0},this.getMeasurementOptions=S(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,s,t,n,o,i)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:o,lanes:i}),{key:!1}),this.getMeasurements=S(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:o,lanes:i},h)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const a of this.laneAssignments.keys())a>=e&&this.laneAssignments.delete(a);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(a=>{this.itemSizeCache.set(a.key,a.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const c=this.measurementsCache.slice(0,u),f=new Array(i).fill(void 0);for(let a=0;a1){d=p;const v=f[d],y=v!==void 0?c[v]:void 0;b=y?y.end+this.options.gap:s+t}else{const v=this.options.lanes===1?c[a-1]:this.getFurthestMeasurement(c,a);b=v?v.end+this.options.gap:s+t,d=v?v.lane:a%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(a,d)}const E=h.get(m),g=typeof E=="number"?E:this.options.estimateSize(a),w=b+g;c[a]={index:a,start:b,size:g,end:w,key:m,lane:d},f[d]=a}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=S(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,t,n)=>this.range=e.length>0&&s>0?H({measurements:e,outerSize:s,scrollOffset:t,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=S(()=>{let e=null,s=null;const t=this.calculateRange();return t&&(e=t.startIndex,s=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,t,n,o)=>n===null||o===null?[]:e({startIndex:n,endIndex:o,overscan:s,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,t=e.getAttribute(s);return t?parseInt(t,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const t=this.indexFromElement(e),n=this.measurementsCache[t];if(!n)return;const o=n.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const t=this.measurementsCache[e];if(!t)return;const n=this.itemSizeCache.get(t.key)??t.size,o=s-n;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,o,this):t.start{if(!e){this.elementsCache.forEach((s,t)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=S(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const t=[];for(let n=0,o=e.length;nthis.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return M(s[A(0,s.length-1,t=>M(s[t]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,s,t=0)=>{if(!this.scrollElement)return 0;const n=this.getSize(),o=this.getScrollOffset();s==="auto"&&(s=e>=o+n?"end":"start"),s==="center"?e+=(t-n)/2:s==="end"&&(e-=n);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const n=this.getSize(),o=this.getScrollOffset();if(s==="auto")if(t.end>=o+n-this.options.scrollPaddingEnd)s="end";else if(t.start<=o+this.options.scrollPaddingStart)s="start";else return[o,s];if(s==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),s];const i=s==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,s,t.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:s="start",behavior:t}={})=>{t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:s="auto",behavior:t}={})=>{t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let n=0;const o=10,i=u=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(e,u);if(!c){console.warn("Failed to get offset for index:",e);return}const[f,a]=c;this._scrollToOffset(f,{adjustments:void 0,behavior:t}),this.targetWindow.requestAnimationFrame(()=>{const m=()=>{if(this.currentScrollToIndex!==e)return;const p=this.getScrollOffset(),d=this.getOffsetForIndex(e,a);if(!d){console.warn("Failed to get offset for index:",e);return}_(d[0],p)||h(a)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(m):m()})},h=u=>{this.targetWindow&&this.currentScrollToIndex===e&&(n++,ni(u)):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};i(s)},this.scrollBy=(e,{behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let t;if(s.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=s[s.length-1])==null?void 0:e.end)??0;else{const n=Array(this.options.lanes).fill(null);let o=s.length-1;for(;o>=0&&n.some(i=>i===null);){const i=s[o];n[i.lane]===null&&(n[i.lane]=i.end),o--}t=Math.max(...n.filter(i=>i!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(l)}}const A=(r,l,e,s)=>{for(;r<=l;){const t=(r+l)/2|0,n=e(t);if(ns)l=t-1;else return t}return r>0?r-1:0};function H({measurements:r,outerSize:l,scrollOffset:e,lanes:s}){const t=r.length-1,n=h=>r[h].start;if(r.length<=s)return{startIndex:0,endIndex:t};let o=A(0,t,n,e),i=o;if(s===1)for(;i1){const h=Array(s).fill(0);for(;ic=0&&u.some(c=>c>=e);){const c=r[o];u[c.lane]=c.start,o--}o=Math.max(0,o-o%s),i=Math.min(t,i+(s-1-i%s))}return{startIndex:o,endIndex:i}}const I=typeof document<"u"?x.useLayoutEffect:x.useEffect;function N({useFlushSync:r=!0,...l}){const e=x.useReducer(()=>({}),{})[1],s={...l,onChange:(n,o)=>{var i;r&&o?F.flushSync(e):e(),(i=l.onChange)==null||i.call(l,n,o)}},[t]=x.useState(()=>new B(s));return t.setOptions(s),I(()=>t._didMount(),[]),I(()=>t._willUpdate()),t}function q(r){return N({observeElementRect:D,observeElementOffset:L,scrollToFn:P,...r})}/** diff --git a/frontend/dist/assets/circle-alert-CbWxNnM7.js b/frontend/dist/assets/circle-alert-BFYzxudo.js similarity index 90% rename from frontend/dist/assets/circle-alert-CbWxNnM7.js rename to frontend/dist/assets/circle-alert-BFYzxudo.js index bc367bc7..ec5aec14 100644 --- a/frontend/dist/assets/circle-alert-CbWxNnM7.js +++ b/frontend/dist/assets/circle-alert-BFYzxudo.js @@ -1,4 +1,4 @@ -import{e}from"./index-Bcr7MabU.js";/** +import{e}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-question-mark-CHrfUdMk.js b/frontend/dist/assets/circle-question-mark-BTap0a_9.js similarity index 89% rename from frontend/dist/assets/circle-question-mark-CHrfUdMk.js rename to frontend/dist/assets/circle-question-mark-BTap0a_9.js index 7433defa..7a0aa9d5 100644 --- a/frontend/dist/assets/circle-question-mark-CHrfUdMk.js +++ b/frontend/dist/assets/circle-question-mark-BTap0a_9.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Bcr7MabU.js";/** +import{e as c}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-stop-DyHSKXzf.js b/frontend/dist/assets/circle-stop-PRJBjCmt.js similarity index 94% rename from frontend/dist/assets/circle-stop-DyHSKXzf.js rename to frontend/dist/assets/circle-stop-PRJBjCmt.js index 7e7a0e87..be050e96 100644 --- a/frontend/dist/assets/circle-stop-DyHSKXzf.js +++ b/frontend/dist/assets/circle-stop-PRJBjCmt.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Bcr7MabU.js";/** +import{e as c}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/clock-vUFydv3d.js b/frontend/dist/assets/clock-BFNcreJN.js similarity index 87% rename from frontend/dist/assets/clock-vUFydv3d.js rename to frontend/dist/assets/clock-BFNcreJN.js index 25b2aa4c..6bffe300 100644 --- a/frontend/dist/assets/clock-vUFydv3d.js +++ b/frontend/dist/assets/clock-BFNcreJN.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Bcr7MabU.js";/** +import{e as c}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/compass-D-aH3UW_.js b/frontend/dist/assets/compass-fAtfJAIE.js similarity index 89% rename from frontend/dist/assets/compass-D-aH3UW_.js rename to frontend/dist/assets/compass-fAtfJAIE.js index 4db3c655..f8d98bd1 100644 --- a/frontend/dist/assets/compass-D-aH3UW_.js +++ b/frontend/dist/assets/compass-fAtfJAIE.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Bcr7MabU.js";/** +import{e as c}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/consumer-registry-Dy-EEMxV.js b/frontend/dist/assets/consumer-registry-7Hi_pNJ6.js similarity index 92% rename from frontend/dist/assets/consumer-registry-Dy-EEMxV.js rename to frontend/dist/assets/consumer-registry-7Hi_pNJ6.js index 6d0b25bd..a8adc6ce 100644 --- a/frontend/dist/assets/consumer-registry-Dy-EEMxV.js +++ b/frontend/dist/assets/consumer-registry-7Hi_pNJ6.js @@ -1 +1 @@ -import{ax as n,r as i}from"./index-Bcr7MabU.js";const p=t=>(t.type??t.payload_type)===n.ADVERT,l=t=>(t.type??t.payload_type)===n.TRACE,h=t=>(t.type??t.payload_type)===n.TXT_MSG,_=t=>(t.type??t.payload_type)===n.PATH,d=t=>(t.type??t.payload_type)===n.ACK,g=t=>{const e=t.type??t.payload_type;return e===n.GRP_TXT||e===n.GRP_DATA},m=t=>(t.path_length??(Array.isArray(t.original_path)?t.original_path.length:0))>0,A=t=>!!t.src_hash,T=t=>t.airtime_ms!=null,c=new Set,o=new Map;function a(t,e){return`${t}|${e}`}function u(t,e){const s=a(t,e);o.set(s,(o.get(s)??0)+1)}function y(t,e){const s=a(t,e),r=o.get(s)??0;r>1?o.set(s,r-1):o.delete(s)}function C(t){for(const e of t){const s=a(e.target,e.fn);c.has(s)||c.add(s)}}function P(t){i.useEffect(()=>{for(const e of t)u(e.target,e.fn);return()=>{for(const e of t)y(e.target,e.fn)}},[t])}export{m as a,A as b,h as c,d,p as e,l as f,_ as g,T as h,g as i,C as r,P as u}; +import{ax as n,r as i}from"./index-CR6htdhJ.js";const p=t=>(t.type??t.payload_type)===n.ADVERT,l=t=>(t.type??t.payload_type)===n.TRACE,h=t=>(t.type??t.payload_type)===n.TXT_MSG,_=t=>(t.type??t.payload_type)===n.PATH,d=t=>(t.type??t.payload_type)===n.ACK,g=t=>{const e=t.type??t.payload_type;return e===n.GRP_TXT||e===n.GRP_DATA},m=t=>(t.path_length??(Array.isArray(t.original_path)?t.original_path.length:0))>0,A=t=>!!t.src_hash,T=t=>t.airtime_ms!=null,c=new Set,o=new Map;function a(t,e){return`${t}|${e}`}function u(t,e){const s=a(t,e);o.set(s,(o.get(s)??0)+1)}function y(t,e){const s=a(t,e),r=o.get(s)??0;r>1?o.set(s,r-1):o.delete(s)}function C(t){for(const e of t){const s=a(e.target,e.fn);c.has(s)||c.add(s)}}function P(t){i.useEffect(()=>{for(const e of t)u(e.target,e.fn);return()=>{for(const e of t)y(e.target,e.fn)}},[t])}export{m as a,A as b,h as c,d,p as e,l as f,_ as g,T as h,g as i,C as r,P as u}; diff --git a/frontend/dist/assets/cpu-CnyGw0WC.js b/frontend/dist/assets/cpu-dVpC8VDl.js similarity index 94% rename from frontend/dist/assets/cpu-CnyGw0WC.js rename to frontend/dist/assets/cpu-dVpC8VDl.js index 2a7952ff..d2ce3617 100644 --- a/frontend/dist/assets/cpu-CnyGw0WC.js +++ b/frontend/dist/assets/cpu-dVpC8VDl.js @@ -1,4 +1,4 @@ -import{e as h}from"./index-Bcr7MabU.js";/** +import{e as h}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/database-DdKGqHhF.js b/frontend/dist/assets/database-B1i3odU4.js similarity index 90% rename from frontend/dist/assets/database-DdKGqHhF.js rename to frontend/dist/assets/database-B1i3odU4.js index c64bb449..0fa66cc2 100644 --- a/frontend/dist/assets/database-DdKGqHhF.js +++ b/frontend/dist/assets/database-B1i3odU4.js @@ -1,4 +1,4 @@ -import{e}from"./index-Bcr7MabU.js";/** +import{e}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/easing-CUJ3Hgok.js b/frontend/dist/assets/easing-D4193t8J.js similarity index 57% rename from frontend/dist/assets/easing-CUJ3Hgok.js rename to frontend/dist/assets/easing-D4193t8J.js index bf2912b1..4150dfc0 100644 --- a/frontend/dist/assets/easing-CUJ3Hgok.js +++ b/frontend/dist/assets/easing-D4193t8J.js @@ -1 +1 @@ -import{gT as s}from"./index-Bcr7MabU.js";const e=s(.65,0,.35,1),t=s(.33,1,.68,1),c=s(.33,.67,.67,1),u=s(.76,0,.24,1);export{t as a,e as b,c,u as e}; +import{gT as s}from"./index-CR6htdhJ.js";const e=s(.65,0,.35,1),t=s(.33,1,.68,1),c=s(.33,.67,.67,1),u=s(.76,0,.24,1);export{t as a,e as b,c,u as e}; diff --git a/frontend/dist/assets/element-movement-DUifCLY7.js b/frontend/dist/assets/element-movement-DIPTY4wV.js similarity index 97% rename from frontend/dist/assets/element-movement-DUifCLY7.js rename to frontend/dist/assets/element-movement-DIPTY4wV.js index 888853e7..b8ec39b1 100644 --- a/frontend/dist/assets/element-movement-DUifCLY7.js +++ b/frontend/dist/assets/element-movement-DIPTY4wV.js @@ -1 +1 @@ -import{r as o,aU as p,d4 as v,gr as b,gs as $,dk as m,by as x}from"./index-Bcr7MabU.js";function y(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function D(e=y){return o.useCallback((t,n)=>{if(typeof e=="string"){let u=e;return(t==null?void 0:t[u])===(n==null?void 0:n[u])}return e(t,n)},[e])}var w=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(w||{});function M(e){let t=o.useRef(null),n=p(l=>{t.current=l.pointerType,!v(l.currentTarget)&&l.pointerType==="mouse"&&l.button===w.Left&&(l.preventDefault(),e(l))}),u=p(l=>{t.current!=="mouse"&&(v(l.currentTarget)||e(l))});return{onPointerDown:n,onClick:u}}var R=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(R||{});const E={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,k=5;function N(e,{trigger:t,action:n,close:u,select:l}){let r=o.useRef(null),i=o.useRef(null),c=o.useRef(null);b(e&&t!==null,"pointerdown",s=>{$(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=s.x,c.current=s.y,r.current=s.timeStamp)}),b(e&&t!==null,"pointerup",s=>{var a,d;let f=r.current;if(f===null||(r.current=null,!m(s.target))||Math.abs(s.x-((a=i.current)!=null?a:s.x))I&&(l(g.target),u());break}case 2:{u();break}}},{capture:!0})}function h(e){return[e.screenX,e.screenY]}function j(){let e=o.useRef([-1,-1]);return{wasMoved(t){let n=h(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=h(t)}}}function L(e){throw new Error("Unexpected object: "+e)}var S=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(S||{});function P(e,t){let n=t.resolveItems();if(n.length<=0)return null;let u=t.resolveActiveIndex(),l=u??-1;switch(e.focus){case 0:{for(let r=0;r=0;--r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 2:{for(let r=l+1;r=0;--r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 4:{for(let r=0;r({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function T(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function F(e,t,n){let u=x();if(t.kind==="Tracked"){let l=function(){r!==T(e)&&(u.dispose(),n())},{position:r}=t,i=new ResizeObserver(l);i.observe(e),u.add(()=>i.disconnect()),u.addEventListener(window,"scroll",l,{passive:!0}),u.addEventListener(window,"resize",l)}return()=>u.dispose()}export{N as L,E as S,z as a,T as b,S as c,D as d,P as f,w as g,F as p,M as s,j as u}; +import{r as o,aU as p,d4 as v,gr as b,gs as $,dk as m,by as x}from"./index-CR6htdhJ.js";function y(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function D(e=y){return o.useCallback((t,n)=>{if(typeof e=="string"){let u=e;return(t==null?void 0:t[u])===(n==null?void 0:n[u])}return e(t,n)},[e])}var w=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(w||{});function M(e){let t=o.useRef(null),n=p(l=>{t.current=l.pointerType,!v(l.currentTarget)&&l.pointerType==="mouse"&&l.button===w.Left&&(l.preventDefault(),e(l))}),u=p(l=>{t.current!=="mouse"&&(v(l.currentTarget)||e(l))});return{onPointerDown:n,onClick:u}}var R=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(R||{});const E={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,k=5;function N(e,{trigger:t,action:n,close:u,select:l}){let r=o.useRef(null),i=o.useRef(null),c=o.useRef(null);b(e&&t!==null,"pointerdown",s=>{$(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=s.x,c.current=s.y,r.current=s.timeStamp)}),b(e&&t!==null,"pointerup",s=>{var a,d;let f=r.current;if(f===null||(r.current=null,!m(s.target))||Math.abs(s.x-((a=i.current)!=null?a:s.x))I&&(l(g.target),u());break}case 2:{u();break}}},{capture:!0})}function h(e){return[e.screenX,e.screenY]}function j(){let e=o.useRef([-1,-1]);return{wasMoved(t){let n=h(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=h(t)}}}function L(e){throw new Error("Unexpected object: "+e)}var S=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(S||{});function P(e,t){let n=t.resolveItems();if(n.length<=0)return null;let u=t.resolveActiveIndex(),l=u??-1;switch(e.focus){case 0:{for(let r=0;r=0;--r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 2:{for(let r=l+1;r=0;--r)if(!t.resolveDisabled(n[r],r,n))return r;return u}case 4:{for(let r=0;r({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function T(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function F(e,t,n){let u=x();if(t.kind==="Tracked"){let l=function(){r!==T(e)&&(u.dispose(),n())},{position:r}=t,i=new ResizeObserver(l);i.observe(e),u.add(()=>i.disconnect()),u.addEventListener(window,"scroll",l,{passive:!0}),u.addEventListener(window,"resize",l)}return()=>u.dispose()}export{N as L,E as S,z as a,T as b,S as c,D as d,P as f,w as g,F as p,M as s,j as u}; diff --git a/frontend/dist/assets/fieldset-Sxb3-P4w.js b/frontend/dist/assets/fieldset-CnJ1jd-h.js similarity index 80% rename from frontend/dist/assets/fieldset-Sxb3-P4w.js rename to frontend/dist/assets/fieldset-CnJ1jd-h.js index 8cf6d411..dd64a702 100644 --- a/frontend/dist/assets/fieldset-Sxb3-P4w.js +++ b/frontend/dist/assets/fieldset-CnJ1jd-h.js @@ -1 +1 @@ -import{j as a,dM as l,c as i,b3 as n,fH as c}from"./index-Bcr7MabU.js";function x({disabled:e,className:s,children:t}){return a.jsx(l,{disabled:e,className:i("flex flex-col gap-2",s),children:t})}function m({required:e,className:s,children:t,...r}){return a.jsxs(n,{className:i("text-sm font-medium text-fg-primary select-none","data-[disabled]:opacity-50",r.title&&"cursor-help",s),...r,children:[t,e&&a.jsx("span",{className:"text-sys-red ml-0.5","aria-hidden":"true",children:"*"})]})}function o({className:e,children:s,...t}){return a.jsx(c,{className:i("text-sm text-fg-muted","data-[disabled]:opacity-50",e),...t,children:s})}export{o as D,x as F,m as L}; +import{j as a,dM as l,c as i,b3 as n,fH as c}from"./index-CR6htdhJ.js";function x({disabled:e,className:s,children:t}){return a.jsx(l,{disabled:e,className:i("flex flex-col gap-2",s),children:t})}function m({required:e,className:s,children:t,...r}){return a.jsxs(n,{className:i("text-sm font-medium text-fg-primary select-none","data-[disabled]:opacity-50",r.title&&"cursor-help",s),...r,children:[t,e&&a.jsx("span",{className:"text-sys-red ml-0.5","aria-hidden":"true",children:"*"})]})}function o({className:e,children:s,...t}){return a.jsx(c,{className:i("text-sm text-fg-muted","data-[disabled]:opacity-50",e),...t,children:s})}export{o as D,x as F,m as L}; diff --git a/frontend/dist/assets/frozen-Csgg4u-n.js b/frontend/dist/assets/frozen-i7Ib99V7.js similarity index 78% rename from frontend/dist/assets/frozen-Csgg4u-n.js rename to frontend/dist/assets/frozen-i7Ib99V7.js index ebff811e..89d46576 100644 --- a/frontend/dist/assets/frozen-Csgg4u-n.js +++ b/frontend/dist/assets/frozen-i7Ib99V7.js @@ -1 +1 @@ -import{bv as l,r as o}from"./index-Bcr7MabU.js";function a({children:t,freeze:e},n){let r=f(e,t);return o.isValidElement(r)?o.cloneElement(r,{ref:n}):l.createElement(l.Fragment,null,r)}const s=l.forwardRef(a);function f(t,e){let[n,r]=o.useState(e);return!t&&n!==e&&r(e),t?n:e}export{s,f as u}; +import{bv as l,r as o}from"./index-CR6htdhJ.js";function a({children:t,freeze:e},n){let r=f(e,t);return o.isValidElement(r)?o.cloneElement(r,{ref:n}):l.createElement(l.Fragment,null,r)}const s=l.forwardRef(a);function f(t,e){let[n,r]=o.useState(e);return!t&&n!==e&&r(e),t?n:e}export{s,f as u}; diff --git a/frontend/dist/assets/funnel-DFQf6jmi.js b/frontend/dist/assets/funnel-4oboVPXr.js similarity index 90% rename from frontend/dist/assets/funnel-DFQf6jmi.js rename to frontend/dist/assets/funnel-4oboVPXr.js index 7076e06d..140778ee 100644 --- a/frontend/dist/assets/funnel-DFQf6jmi.js +++ b/frontend/dist/assets/funnel-4oboVPXr.js @@ -1,4 +1,4 @@ -import{e}from"./index-Bcr7MabU.js";/** +import{e}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/git-branch-CzidlvuL.js b/frontend/dist/assets/git-branch-94MoMaKB.js similarity index 90% rename from frontend/dist/assets/git-branch-CzidlvuL.js rename to frontend/dist/assets/git-branch-94MoMaKB.js index 1c92c28b..21abf5cc 100644 --- a/frontend/dist/assets/git-branch-CzidlvuL.js +++ b/frontend/dist/assets/git-branch-94MoMaKB.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-Bcr7MabU.js";/** +import{e as c}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/hash-DnbanjL5.js b/frontend/dist/assets/hash-D5cqF2Y_.js similarity index 91% rename from frontend/dist/assets/hash-DnbanjL5.js rename to frontend/dist/assets/hash-D5cqF2Y_.js index 4692cdac..e61df2f1 100644 --- a/frontend/dist/assets/hash-DnbanjL5.js +++ b/frontend/dist/assets/hash-D5cqF2Y_.js @@ -1,4 +1,4 @@ -import{e}from"./index-Bcr7MabU.js";/** +import{e}from"./index-CR6htdhJ.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/index-we8JTzK8.js b/frontend/dist/assets/index-BtT4gFCt.js similarity index 98% rename from frontend/dist/assets/index-we8JTzK8.js rename to frontend/dist/assets/index-BtT4gFCt.js index 12c37b57..4d9ad3ec 100644 --- a/frontend/dist/assets/index-we8JTzK8.js +++ b/frontend/dist/assets/index-BtT4gFCt.js @@ -1 +1 @@ -import{gU as J,r as i,M as R,q as H,j as u,gV as Z,m as k,gW as Q,gX as O,d as _,c3 as ee,gY as te,gZ as ne}from"./index-Bcr7MabU.js";import{a as G}from"./index-BbwbpcoC.js";function re({children:n,isValidProp:e,...t}){e&&J(e),t={...i.useContext(R),...t},t.isStatic=H(()=>t.isStatic);const s=i.useMemo(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion]);return u.jsx(R.Provider,{value:s,children:n})}function ie(n){const e=H(()=>Z(n)),{isStatic:t}=i.useContext(R);if(t){const[,s]=i.useState(n);i.useEffect(()=>e.on("change",s),[])}return e}const j="var(--mask-height, 0.15em)",E="var(--mask-width, 0.5em)",I=`calc(${E} / var(--invert-x, 1))`,M="#000 0, transparent 71%",se=`linear-gradient(to right, transparent 0, #000 ${I}, #000 calc(100% - ${I}), transparent),linear-gradient(to bottom, transparent 0, #000 ${j}, #000 calc(100% - ${j}), transparent 100%),radial-gradient(at bottom right, ${M}),radial-gradient(at bottom left, ${M}), radial-gradient(at top left, ${M}), radial-gradient(at top right, ${M})`,ae=`100% calc(100% - ${j} * 2),calc(100% - ${I} * 2) 100%,${I} ${j},${I} ${j},${I} ${j},${I} ${j}`;Q({"--invert-x":{correct:(n,{treeScale:e,projectionDelta:t})=>t.x.scale*e.x}});function oe({children:n,layoutDependency:e}){return u.jsx(k.span,{layout:!0,layoutDependency:e,"aria-hidden":!0,style:{display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${E})`,padding:`calc(${j}/2) ${E}`,position:"relative",zIndex:-1,overflow:"clip",WebkitMaskImage:se,WebkitMaskSize:ae,WebkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",WebkitMaskRepeat:"no-repeat"},children:n})}function K(){const n=i.useRef(!0);return i.useEffect(()=>{n.current=!1},[]),n.current}function N(n){const{width:e,fontSize:t}=getComputedStyle(n);return`${parseFloat(e)/parseFloat(t)}em`}const X=new WeakMap,ce=i.forwardRef(function({value:e,initialValue:t=e,...s},a){const{transition:x}=i.useContext(R),g=i.useRef(t).current,b=K(),c=i.useRef(null),y=i.useRef(null);i.useImperativeHandle(a,()=>y.current,[]);const w=i.useRef(new Array(10)),h=O(),f=h?e:0;i.useLayoutEffect(()=>{!c.current||!w.current[g]||(c.current.style.width=N(w.current[g]))},[]);const m=i.useRef(t);i.useLayoutEffect(()=>{var $;if(!c.current||f===m.current)return;const r=c.current.getBoundingClientRect(),o=($=y.current)==null?void 0:$.getBoundingClientRect(),v=r.height*(f-m.current)+(r.top-(o?o.top||0:r.top));return G(c.current,{y:[v,0]},x),()=>{m.current=f}},[f]);const[p,l]=i.useState();i.useEffect(()=>{if(b&&g===f||!w.current[f])return;const r=N(w.current[f]);y.current&&X.set(y.current,r),l(r)},[f]);const d=r=>u.jsx("span",{style:{display:"inline-block",padding:`calc(${j}/2) 0`},ref:o=>void(w.current[r]=o),children:r},r);return u.jsx(k.span,{...s,ref:y,layout:"position","data-state":h?void 0:"exiting",style:{display:"inline-flex",justifyContent:"center",width:p},children:u.jsxs("span",{ref:c,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"},children:[f!==0&&u.jsx("span",{style:{...F,bottom:"100%",left:0},children:new Array(f).fill(null).map((r,o)=>d(o))}),d(f),f!==9&&u.jsx("span",{style:{...F,top:"100%",left:0},children:new Array(9-f).fill(null).map((r,o)=>d(f+o+1))})]})})}),F={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"},Y=i.createContext({justify:"left"}),le=i.forwardRef(function({partKey:e,type:t,children:s,layoutDependency:a,...x},g){const b=O(),{justify:c}=i.useContext(Y);return u.jsx(k.span,{...x,"data-state":b?void 0:"exiting",style:{display:"inline-flex",justifyContent:c,padding:`calc(${j}/2) 0`,position:"relative"},layout:"position",layoutDependency:a,ref:g,children:u.jsx(_,{mode:"popLayout",anchorX:c,initial:!1,children:u.jsx(k.span,{layout:c==="right"?"position":!1,layoutDependency:a,initial:{opacity:0},animate:{opacity:[null,1]},exit:{opacity:[null,0]},style:{display:"inline-block",whiteSpace:"pre"},children:s},s)})})}),D=i.forwardRef(function({parts:e,justify:t="left",mode:s,style:a,name:x,layoutDependency:g,...b},c){const y=i.useRef(null);i.useImperativeHandle(c,()=>y.current,[]);const w=i.useMemo(()=>({justify:t}),[t]),h=i.useRef(null),f=K(),[m,p]=i.useState();return i.useEffect(()=>{if(!h.current)return;if(f){y.current&&(y.current.style.width=N(h.current));return}const l=Array.from(h.current.children).map(d=>{if(!(d instanceof HTMLElement))return;if(d.dataset.state==="exiting"){const v=d.nextSibling;return d.remove(),()=>{h.current&&h.current.insertBefore(d,v)}}const r=X.get(d);if(!r)return;const o=d.style.width;return d.style.width=r,()=>{d.style.width=o}});p(N(h.current));for(let d=l.length-1;d>=0;d--){const r=l[d];r&&r()}},[e.map(l=>l.value).join("")]),u.jsx(Y.Provider,{value:w,children:u.jsx(k.span,{layoutDependency:g,...b,ref:y,className:`number-section-${x}`,style:{...a,display:"inline-flex",justifyContent:t,width:m},children:u.jsxs("span",{ref:h,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"},children:["​",u.jsx(_,{mode:s,anchorX:t,initial:!1,children:e.map(l=>l.type==="integer"||l.type==="fraction"?u.jsx(ce,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:l.value,initialValue:f?void 0:0,layoutDependency:g},l.key):u.jsx(le,{type:l.type,partKey:l.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},layoutDependency:g,children:l.value},l.type==="literal"?`${l.key}:${l.value}`:l.key))})]})})})}),ue=(n,{locales:e,format:t},s,a)=>{const g=new Intl.NumberFormat(e,t).formatToParts(Number(n));s&&g.unshift({type:"prefix",value:s}),a&&g.push({type:"suffix",value:a});const b=[],c=[],y=[],w=[],h={},f=r=>`${r}:${h[r]=(h[r]??-1)+1}`;let m="",p=!1,l=!1;for(const r of g){m+=r.value;const o=r.type==="minusSign"||r.type==="plusSign"?"sign":r.type;switch(o){case"integer":p=!0,c.push(...r.value.split("").map(v=>({type:o,value:parseInt(v)})));break;case"group":c.push({type:o,value:r.value});break;case"decimal":l=!0,y.push({type:o,value:r.value,key:f(o)});break;case"fraction":y.push(...r.value.split("").map(v=>({type:o,value:parseInt(v),key:f(o)})));break;default:(p||l?w:b).push({type:o,value:r.value,key:f(o)})}}const d=[];for(let r=c.length-1;r>=0;r--)d.unshift({...c[r],key:f(c[r].type)});return{pre:b,integer:d,fraction:y,post:w,formatted:m}},fe={opacity:{duration:1,ease:te},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},ve=i.forwardRef(function({children:e,locales:t,format:s,transition:a,style:x,suffix:g,prefix:b,...c},y){const w=i.useMemo(()=>ue(e,{locales:t,format:s},b,g),[e,t,s]),{pre:h,integer:f,fraction:m,post:p,formatted:l}=w,d=i.useContext(R).transition;a=a??d??fe;const{layoutDependency:r}=c,o=i.useMemo(()=>{if(r!==void 0)return{layoutDependency:r,value:e}},[r,e]);return u.jsx(ee,{children:u.jsx(re,{transition:a,children:u.jsx(k.div,{...c,ref:y,layout:!0,layoutDependency:o,style:{lineHeight:1,...x,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"},children:u.jsxs(k.div,{layout:!0,layoutDependency:o,"aria-label":l,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1},children:[u.jsx(D,{style:{padding:`calc(${j}/2) 0`},layoutDependency:o,"aria-hidden":!0,justify:"right",mode:"popLayout",parts:h,name:"pre"}),u.jsxs(oe,{layoutDependency:o,children:[u.jsx(D,{layoutDependency:o,justify:"right",parts:f,name:"integer"}),u.jsx(D,{layout:"position",layoutDependency:o,parts:m,name:"fraction"})]}),u.jsx(D,{style:{padding:`calc(${j}/2) 0`},"aria-hidden":!0,layout:"position",layoutDependency:o,mode:"popLayout",parts:p,name:"post"})]})})})})});k.create(i.Fragment);function q(n,e){return n.length>e.length||n.length>0&&!e.startsWith(n)}function U(n,e,t){return n+(e-n)*t}function de(n,e,t,s,a){if(q(e,n))return t*a;if(s==="natural")return pe(n,e,t);if(typeof s=="number"&&s>0){const x=t*(s/100);return t+U(-x,x,Math.random())}return t}function pe(n,e,t){const s=e.length,a=n[s],x=n[s-1];if(!a)return t;const b=n.slice(0,s).lastIndexOf(" "),c=s-b-1,y=b+1,h=n.slice(s).indexOf(" "),m=(h===-1?n.length:s+h)-y;let p=1;if(x&&/[.!?]/.test(x)&&a===" "&&(p*=3),m<=3?p*=.7:(c===0&&a!==" "&&(p*=1.5),c===m-1&&(p*=1.4)),c>0&&c3){const o=Math.min(c/m,.4);p*=1-o}ye.has(a)&&(p*=1.5),me.has(a)&&(p*=1.5),/\d/.test(a)&&(p*=1.3),m>8&&(p*=1.3),a!==a.toLowerCase()&&(p*=1.25);const l=200;if(s>l){const o=Math.min((s-l)/1e3,.3);p*=1+o}const d=U(-.25,.25,Math.random());p*=1+d;const r=t*p;return Math.max(t*.2,r)}const ye=new Set([".",",","!","?",":",";","'",'"',"-","(",")"]),me=new Set(["!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":",'"',"<",">","?"]);function he(n,e){let t=e-1;for(;t>=0&&/\s/.test(n[t]);)t--;for(;t>=0&&!/\s/.test(n[t]);)t--;return Math.max(0,t+1)}function ge(n,e){const t=Math.min(n.length,e.length);let s=0;for(let a=0;a{var C;(C=S.current)==null||C.call(S),S.current=null},B=()=>{W.current=G(P.current,{opacity:[1,1,0,0]},{duration:b,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"})};return i.useEffect(()=>{m==="all"&&e!==v.current&&$.set(""),v.current=e},[e,m]),i.useEffect(()=>{var V;if(!y){B(),L();return}(V=W.current)==null||V.cancel();const C=()=>{const z=xe($.get(),e,m,p);$.set(z),z!==e?T():(B(),c==null||c())},T=()=>{S.current=ne(C,de(e,$.get(),A,a,l))};return S.current||T(),L},[y,c,e,A,a,l,p]),u.jsxs(o,{ref:r,...d,"aria-label":w||e,children:[u.jsx(k.span,{className:h,style:f,children:$}),u.jsx(k.span,{ref:P,className:x,style:{display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...g}})]})});export{ve as A,ie as u}; +import{gU as J,r as i,M as R,q as H,j as u,gV as Z,m as k,gW as Q,gX as O,d as _,c3 as ee,gY as te,gZ as ne}from"./index-CR6htdhJ.js";import{a as G}from"./index-CnoLcwbn.js";function re({children:n,isValidProp:e,...t}){e&&J(e),t={...i.useContext(R),...t},t.isStatic=H(()=>t.isStatic);const s=i.useMemo(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion]);return u.jsx(R.Provider,{value:s,children:n})}function ie(n){const e=H(()=>Z(n)),{isStatic:t}=i.useContext(R);if(t){const[,s]=i.useState(n);i.useEffect(()=>e.on("change",s),[])}return e}const j="var(--mask-height, 0.15em)",E="var(--mask-width, 0.5em)",I=`calc(${E} / var(--invert-x, 1))`,M="#000 0, transparent 71%",se=`linear-gradient(to right, transparent 0, #000 ${I}, #000 calc(100% - ${I}), transparent),linear-gradient(to bottom, transparent 0, #000 ${j}, #000 calc(100% - ${j}), transparent 100%),radial-gradient(at bottom right, ${M}),radial-gradient(at bottom left, ${M}), radial-gradient(at top left, ${M}), radial-gradient(at top right, ${M})`,ae=`100% calc(100% - ${j} * 2),calc(100% - ${I} * 2) 100%,${I} ${j},${I} ${j},${I} ${j},${I} ${j}`;Q({"--invert-x":{correct:(n,{treeScale:e,projectionDelta:t})=>t.x.scale*e.x}});function oe({children:n,layoutDependency:e}){return u.jsx(k.span,{layout:!0,layoutDependency:e,"aria-hidden":!0,style:{display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${E})`,padding:`calc(${j}/2) ${E}`,position:"relative",zIndex:-1,overflow:"clip",WebkitMaskImage:se,WebkitMaskSize:ae,WebkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",WebkitMaskRepeat:"no-repeat"},children:n})}function K(){const n=i.useRef(!0);return i.useEffect(()=>{n.current=!1},[]),n.current}function N(n){const{width:e,fontSize:t}=getComputedStyle(n);return`${parseFloat(e)/parseFloat(t)}em`}const X=new WeakMap,ce=i.forwardRef(function({value:e,initialValue:t=e,...s},a){const{transition:x}=i.useContext(R),g=i.useRef(t).current,b=K(),c=i.useRef(null),y=i.useRef(null);i.useImperativeHandle(a,()=>y.current,[]);const w=i.useRef(new Array(10)),h=O(),f=h?e:0;i.useLayoutEffect(()=>{!c.current||!w.current[g]||(c.current.style.width=N(w.current[g]))},[]);const m=i.useRef(t);i.useLayoutEffect(()=>{var $;if(!c.current||f===m.current)return;const r=c.current.getBoundingClientRect(),o=($=y.current)==null?void 0:$.getBoundingClientRect(),v=r.height*(f-m.current)+(r.top-(o?o.top||0:r.top));return G(c.current,{y:[v,0]},x),()=>{m.current=f}},[f]);const[p,l]=i.useState();i.useEffect(()=>{if(b&&g===f||!w.current[f])return;const r=N(w.current[f]);y.current&&X.set(y.current,r),l(r)},[f]);const d=r=>u.jsx("span",{style:{display:"inline-block",padding:`calc(${j}/2) 0`},ref:o=>void(w.current[r]=o),children:r},r);return u.jsx(k.span,{...s,ref:y,layout:"position","data-state":h?void 0:"exiting",style:{display:"inline-flex",justifyContent:"center",width:p},children:u.jsxs("span",{ref:c,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"},children:[f!==0&&u.jsx("span",{style:{...F,bottom:"100%",left:0},children:new Array(f).fill(null).map((r,o)=>d(o))}),d(f),f!==9&&u.jsx("span",{style:{...F,top:"100%",left:0},children:new Array(9-f).fill(null).map((r,o)=>d(f+o+1))})]})})}),F={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"},Y=i.createContext({justify:"left"}),le=i.forwardRef(function({partKey:e,type:t,children:s,layoutDependency:a,...x},g){const b=O(),{justify:c}=i.useContext(Y);return u.jsx(k.span,{...x,"data-state":b?void 0:"exiting",style:{display:"inline-flex",justifyContent:c,padding:`calc(${j}/2) 0`,position:"relative"},layout:"position",layoutDependency:a,ref:g,children:u.jsx(_,{mode:"popLayout",anchorX:c,initial:!1,children:u.jsx(k.span,{layout:c==="right"?"position":!1,layoutDependency:a,initial:{opacity:0},animate:{opacity:[null,1]},exit:{opacity:[null,0]},style:{display:"inline-block",whiteSpace:"pre"},children:s},s)})})}),D=i.forwardRef(function({parts:e,justify:t="left",mode:s,style:a,name:x,layoutDependency:g,...b},c){const y=i.useRef(null);i.useImperativeHandle(c,()=>y.current,[]);const w=i.useMemo(()=>({justify:t}),[t]),h=i.useRef(null),f=K(),[m,p]=i.useState();return i.useEffect(()=>{if(!h.current)return;if(f){y.current&&(y.current.style.width=N(h.current));return}const l=Array.from(h.current.children).map(d=>{if(!(d instanceof HTMLElement))return;if(d.dataset.state==="exiting"){const v=d.nextSibling;return d.remove(),()=>{h.current&&h.current.insertBefore(d,v)}}const r=X.get(d);if(!r)return;const o=d.style.width;return d.style.width=r,()=>{d.style.width=o}});p(N(h.current));for(let d=l.length-1;d>=0;d--){const r=l[d];r&&r()}},[e.map(l=>l.value).join("")]),u.jsx(Y.Provider,{value:w,children:u.jsx(k.span,{layoutDependency:g,...b,ref:y,className:`number-section-${x}`,style:{...a,display:"inline-flex",justifyContent:t,width:m},children:u.jsxs("span",{ref:h,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"},children:["​",u.jsx(_,{mode:s,anchorX:t,initial:!1,children:e.map(l=>l.type==="integer"||l.type==="fraction"?u.jsx(ce,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:l.value,initialValue:f?void 0:0,layoutDependency:g},l.key):u.jsx(le,{type:l.type,partKey:l.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},layoutDependency:g,children:l.value},l.type==="literal"?`${l.key}:${l.value}`:l.key))})]})})})}),ue=(n,{locales:e,format:t},s,a)=>{const g=new Intl.NumberFormat(e,t).formatToParts(Number(n));s&&g.unshift({type:"prefix",value:s}),a&&g.push({type:"suffix",value:a});const b=[],c=[],y=[],w=[],h={},f=r=>`${r}:${h[r]=(h[r]??-1)+1}`;let m="",p=!1,l=!1;for(const r of g){m+=r.value;const o=r.type==="minusSign"||r.type==="plusSign"?"sign":r.type;switch(o){case"integer":p=!0,c.push(...r.value.split("").map(v=>({type:o,value:parseInt(v)})));break;case"group":c.push({type:o,value:r.value});break;case"decimal":l=!0,y.push({type:o,value:r.value,key:f(o)});break;case"fraction":y.push(...r.value.split("").map(v=>({type:o,value:parseInt(v),key:f(o)})));break;default:(p||l?w:b).push({type:o,value:r.value,key:f(o)})}}const d=[];for(let r=c.length-1;r>=0;r--)d.unshift({...c[r],key:f(c[r].type)});return{pre:b,integer:d,fraction:y,post:w,formatted:m}},fe={opacity:{duration:1,ease:te},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},ve=i.forwardRef(function({children:e,locales:t,format:s,transition:a,style:x,suffix:g,prefix:b,...c},y){const w=i.useMemo(()=>ue(e,{locales:t,format:s},b,g),[e,t,s]),{pre:h,integer:f,fraction:m,post:p,formatted:l}=w,d=i.useContext(R).transition;a=a??d??fe;const{layoutDependency:r}=c,o=i.useMemo(()=>{if(r!==void 0)return{layoutDependency:r,value:e}},[r,e]);return u.jsx(ee,{children:u.jsx(re,{transition:a,children:u.jsx(k.div,{...c,ref:y,layout:!0,layoutDependency:o,style:{lineHeight:1,...x,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"},children:u.jsxs(k.div,{layout:!0,layoutDependency:o,"aria-label":l,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1},children:[u.jsx(D,{style:{padding:`calc(${j}/2) 0`},layoutDependency:o,"aria-hidden":!0,justify:"right",mode:"popLayout",parts:h,name:"pre"}),u.jsxs(oe,{layoutDependency:o,children:[u.jsx(D,{layoutDependency:o,justify:"right",parts:f,name:"integer"}),u.jsx(D,{layout:"position",layoutDependency:o,parts:m,name:"fraction"})]}),u.jsx(D,{style:{padding:`calc(${j}/2) 0`},"aria-hidden":!0,layout:"position",layoutDependency:o,mode:"popLayout",parts:p,name:"post"})]})})})})});k.create(i.Fragment);function q(n,e){return n.length>e.length||n.length>0&&!e.startsWith(n)}function U(n,e,t){return n+(e-n)*t}function de(n,e,t,s,a){if(q(e,n))return t*a;if(s==="natural")return pe(n,e,t);if(typeof s=="number"&&s>0){const x=t*(s/100);return t+U(-x,x,Math.random())}return t}function pe(n,e,t){const s=e.length,a=n[s],x=n[s-1];if(!a)return t;const b=n.slice(0,s).lastIndexOf(" "),c=s-b-1,y=b+1,h=n.slice(s).indexOf(" "),m=(h===-1?n.length:s+h)-y;let p=1;if(x&&/[.!?]/.test(x)&&a===" "&&(p*=3),m<=3?p*=.7:(c===0&&a!==" "&&(p*=1.5),c===m-1&&(p*=1.4)),c>0&&c3){const o=Math.min(c/m,.4);p*=1-o}ye.has(a)&&(p*=1.5),me.has(a)&&(p*=1.5),/\d/.test(a)&&(p*=1.3),m>8&&(p*=1.3),a!==a.toLowerCase()&&(p*=1.25);const l=200;if(s>l){const o=Math.min((s-l)/1e3,.3);p*=1+o}const d=U(-.25,.25,Math.random());p*=1+d;const r=t*p;return Math.max(t*.2,r)}const ye=new Set([".",",","!","?",":",";","'",'"',"-","(",")"]),me=new Set(["!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":",'"',"<",">","?"]);function he(n,e){let t=e-1;for(;t>=0&&/\s/.test(n[t]);)t--;for(;t>=0&&!/\s/.test(n[t]);)t--;return Math.max(0,t+1)}function ge(n,e){const t=Math.min(n.length,e.length);let s=0;for(let a=0;a{var C;(C=S.current)==null||C.call(S),S.current=null},B=()=>{W.current=G(P.current,{opacity:[1,1,0,0]},{duration:b,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"})};return i.useEffect(()=>{m==="all"&&e!==v.current&&$.set(""),v.current=e},[e,m]),i.useEffect(()=>{var V;if(!y){B(),L();return}(V=W.current)==null||V.cancel();const C=()=>{const z=xe($.get(),e,m,p);$.set(z),z!==e?T():(B(),c==null||c())},T=()=>{S.current=ne(C,de(e,$.get(),A,a,l))};return S.current||T(),L},[y,c,e,A,a,l,p]),u.jsxs(o,{ref:r,...d,"aria-label":w||e,children:[u.jsx(k.span,{className:h,style:f,children:$}),u.jsx(k.span,{ref:P,className:x,style:{display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...g}})]})});export{ve as A,ie as u}; diff --git a/frontend/dist/assets/index-Bcr7MabU.js b/frontend/dist/assets/index-CR6htdhJ.js similarity index 75% rename from frontend/dist/assets/index-Bcr7MabU.js rename to frontend/dist/assets/index-CR6htdhJ.js index d8d9bb83..4bdc4713 100644 --- a/frontend/dist/assets/index-Bcr7MabU.js +++ b/frontend/dist/assets/index-CR6htdhJ.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-C-L5xhz4.js","assets/PageLayout-Bd1lZEvE.js","assets/consumer-registry-Dy-EEMxV.js","assets/DataValue-C0IxO0Ky.js","assets/index-we8JTzK8.js","assets/index-BbwbpcoC.js","assets/node-types-BFsObq9k.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-DmJjzUH5.js","assets/chevron-up-DDF7YpTU.js","assets/primitives-D7nwWFFF.js","assets/badge-colors-Dl76Mz8m.js","assets/chat-utils-lxurr5ix.js","assets/SignalIndicator-CYjIo_Mn.js","assets/arrow-up-r11Chuf6.js","assets/arrow-right-Bv8RdUpJ.js","assets/arrow-down-DFZvzXIi.js","assets/chevron-right-BrHsAUr1.js","assets/payload-detail-jRk0k5AL.js","assets/map-pin-CmfqMW3N.js","assets/circle-question-mark-CHrfUdMk.js","assets/layers-D696eHgB.js","assets/hash-DnbanjL5.js","assets/clock-vUFydv3d.js","assets/route-DdD1xQhl.js","assets/activity-BHsjc-ov.js","assets/database-DdKGqHhF.js","assets/useMapViewStore-DqjoQCEZ.js","assets/shield-CcCTQoJ7.js","assets/MqttModeBadge-CrJ5xyVU.js","assets/zap-D8PO3IgR.js","assets/usePipelineStore-nFeiBWWq.js","assets/LightSparkline-DI3I2Qod.js","assets/link-scoring-BhS4yAyO.js","assets/AutoConfigureDialog-nQzi_zPM.js","assets/wand-sparkles-D_MagcvJ.js","assets/ChatBubble-BqSfRbsT.js","assets/message-square-text-Cx7sNqKi.js","assets/message-square-DfbrFBie.js","assets/shield-check-Bjhdd7t0.js","assets/Grid-ChpC-NJE.js","assets/Packets-D313r9wr.js","assets/element-movement-DUifCLY7.js","assets/use-tree-walker-DFaznB-R.js","assets/frozen-Csgg4u-n.js","assets/AnalyzerFilterPanel-Dspm437W.js","assets/funnel-DFQf6jmi.js","assets/search-D6EZ95nX.js","assets/Contacts-DL1IltrR.js","assets/listbox-D38oqfIZ.js","assets/use-text-value-B9WhdAMT.js","assets/CollisionExplorerModal-Y6S5TUlx.js","assets/BasemapLayer-A-p_Dr5u.js","assets/share-2-CBcJN8r0.js","assets/target-3KNT7m1p.js","assets/map-pin-off-DbUyHIkr.js","assets/trash-2-Dyph4AYl.js","assets/ConfirmModal-CvAkhuom.js","assets/maplibre-gl-B1CfjdFi.css","assets/Statistics-Cs88Tyyh.js","assets/easing-CUJ3Hgok.js","assets/compass-D-aH3UW_.js","assets/settings-2-Warn9Z6j.js","assets/network-Bga26A1_.js","assets/MeshGraph-hbIFphfn.js","assets/max-3Pc3oKmC.js","assets/variants-Dh1uX6Aa.js","assets/git-branch-CzidlvuL.js","assets/rotate-ccw-C1kT5MK1.js","assets/System-DbNujDNs.js","assets/thermometer-DrBja3ui.js","assets/cpu-CnyGw0WC.js","assets/Logs-C_jpyZwT.js","assets/circle-stop-DyHSKXzf.js","assets/Terminal-Bw5JmSLd.js","assets/system-0ZU2C0Q5.js","assets/KeycapButton-DO0xfq38.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-B3NvfCFZ.js","assets/pencil-C-yivzpx.js","assets/repeat-BW0T0cvm.js","assets/antenna-2HP9MLCI.js","assets/plus-DZIbd-kZ.js","assets/key-round-CzmFaK7Z.js","assets/RoomServer-D8juclj6.js","assets/fieldset-Sxb3-P4w.js","assets/wifi-D7y3h36J.js","assets/PacketObservatory-BbrNfYq0.js","assets/Sessions-edHRMZTm.js","assets/Mqtt-_qQp7dyO.js","assets/check-check-XzEYoNqt.js","assets/wifi-off-B_wOGsPk.js","assets/Companion-RZ1tWdUk.js","assets/circle-alert-CbWxNnM7.js","assets/Test-BlhdbxMX.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-D6lUw9kd.js","assets/PageLayout-Dk902Dlo.js","assets/consumer-registry-7Hi_pNJ6.js","assets/DataValue-CkLq2-xL.js","assets/index-BtT4gFCt.js","assets/index-CnoLcwbn.js","assets/node-types-BvQCDNK9.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-DnOyjg3o.js","assets/chevron-up-v1ZA2R-9.js","assets/primitives-EdDnh5-7.js","assets/badge-colors-Dl76Mz8m.js","assets/chat-utils-DHa6YwrS.js","assets/SignalIndicator-ClMJO5cF.js","assets/arrow-up-K4au-fHx.js","assets/arrow-right-3jiFJDYq.js","assets/arrow-down-DFhP0Q_b.js","assets/chevron-right-D2DgrpVm.js","assets/payload-detail-B6eeo8Zi.js","assets/map-pin-DLf5Z8nk.js","assets/circle-question-mark-BTap0a_9.js","assets/layers-sBqNiTGy.js","assets/hash-D5cqF2Y_.js","assets/clock-BFNcreJN.js","assets/route-BdG55Ep-.js","assets/activity-B1_-JLqt.js","assets/database-B1i3odU4.js","assets/useMapViewStore-Dst_TEXH.js","assets/shield-Bd_LbwYW.js","assets/MqttModeBadge-_nVkYyqI.js","assets/zap-BpXirfUQ.js","assets/usePipelineStore-CyVtwxqQ.js","assets/LightSparkline-B480JOwC.js","assets/link-scoring-D8OLMCQf.js","assets/AutoConfigureDialog-BizEoaly.js","assets/wand-sparkles-qgdZS22e.js","assets/ChatBubble-CpAqiMRZ.js","assets/message-square-text-DBY1d0D7.js","assets/message-square-CNUTpjtG.js","assets/shield-check-CX3GhuSg.js","assets/Grid-D3Ix759E.js","assets/Packets-BjpKkMEN.js","assets/element-movement-DIPTY4wV.js","assets/use-tree-walker-BLvCEoIh.js","assets/frozen-i7Ib99V7.js","assets/AnalyzerFilterPanel-C99KUEiV.js","assets/funnel-4oboVPXr.js","assets/search-Djg1V5_Y.js","assets/Contacts-BRAnAiI8.js","assets/listbox-DbdSXuSb.js","assets/use-text-value-Ch4p-2-R.js","assets/CollisionExplorerModal-BjNF8_2U.js","assets/BasemapLayer-B6qv9zHt.js","assets/share-2-Cm0TgUDc.js","assets/target-Bmhgwg_g.js","assets/map-pin-off-DzBgJ4-5.js","assets/trash-2-DDi3fVjz.js","assets/ConfirmModal-CijEsZrl.js","assets/maplibre-gl-B1CfjdFi.css","assets/Statistics-ITQ__4F-.js","assets/easing-D4193t8J.js","assets/compass-fAtfJAIE.js","assets/settings-2-CKRrmjMw.js","assets/network-BdCm-DdC.js","assets/MeshGraph-BI-UzBT5.js","assets/max-BHszoqgD.js","assets/variants-B-xhsx06.js","assets/git-branch-94MoMaKB.js","assets/rotate-ccw-D8J04SFo.js","assets/System-kVeDbuco.js","assets/thermometer-BJ9Pjk-U.js","assets/cpu-dVpC8VDl.js","assets/Logs-1xtkFUfl.js","assets/circle-stop-PRJBjCmt.js","assets/Terminal-C_swQfTI.js","assets/system-BR9AxlO1.js","assets/KeycapButton-DiVOyEmR.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-CFIFEleu.js","assets/pencil-JjdQp1l1.js","assets/repeat-5Hqru-wI.js","assets/antenna-Bv3MESsD.js","assets/plus-CfHg5JLg.js","assets/key-round-CTDlyfAN.js","assets/RoomServer-BRJBoVVS.js","assets/fieldset-CnJ1jd-h.js","assets/wifi-DFzHXMz6.js","assets/PacketObservatory-CLDnc4JJ.js","assets/Sessions-BYXIJtxq.js","assets/Mqtt-2KIa8-95.js","assets/check-check-TgoebkD3.js","assets/wifi-off-h3izwtpW.js","assets/Companion-wAuzneXz.js","assets/circle-alert-BFYzxudo.js","assets/Test-BcitrV8D.js"])))=>i.map(i=>d[i]); var KM=Object.defineProperty;var Jk=e=>{throw TypeError(e)};var YM=(e,t,n)=>t in e?KM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>YM(e,typeof t!="symbol"?t+"":t,n),W0=(e,t,n)=>t.has(e)||Jk("Cannot "+n);var he=(e,t,n)=>(W0(e,t,"read from private field"),n?n.call(e):t.get(e)),en=(e,t,n)=>t.has(e)?Jk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>(W0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),yt=(e,t,n)=>(W0(e,t,"access private method"),n);var Ep=(e,t,n,r)=>({set _(s){Tt(e,t,s,n)},get _(){return he(e,t,r)}});function QM(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function XM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q0={exports:{}},Ed={},G0={exports:{}},qt={};/** * @license React * react.production.min.js @@ -7,7 +7,7 @@ var KM=Object.defineProperty;var Jk=e=>{throw TypeError(e)};var YM=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zk;function JM(){if(Zk)return qt;Zk=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function p(G){return G===null||typeof G!="object"?null:(G=h&&G[h]||G["@@iterator"],typeof G=="function"?G:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function w(G,V,Y){this.props=G,this.context=V,this.refs=b,this.updater=Y||g}w.prototype.isReactComponent={},w.prototype.setState=function(G,V){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,V,"setState")},w.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function C(){}C.prototype=w.prototype;function v(G,V,Y){this.props=G,this.context=V,this.refs=b,this.updater=Y||g}var x=v.prototype=new C;x.constructor=v,y(x,w.prototype),x.isPureReactComponent=!0;var _=Array.isArray,S=Object.prototype.hasOwnProperty,I={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function A(G,V,Y){var ge,ee={},ke=null,ne=null;if(V!=null)for(ge in V.ref!==void 0&&(ne=V.ref),V.key!==void 0&&(ke=""+V.key),V)S.call(V,ge)&&!k.hasOwnProperty(ge)&&(ee[ge]=V[ge]);var re=arguments.length-2;if(re===1)ee.children=Y;else if(1{throw TypeError(e)};var YM=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var tS;function ZM(){if(tS)return Ed;tS=1;var e=Lg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(a,c,u){var f,h={},p=null,g=null;u!==void 0&&(p=""+u),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(g=c.ref);for(f in c)r.call(c,f)&&!o.hasOwnProperty(f)&&(h[f]=c[f]);if(a&&a.defaultProps)for(f in c=a.defaultProps,c)h[f]===void 0&&(h[f]=c[f]);return{$$typeof:t,type:a,key:p,ref:g,props:h,_owner:s.current}}return Ed.Fragment=n,Ed.jsx=i,Ed.jsxs=i,Ed}var nS;function eR(){return nS||(nS=1,q0.exports=ZM()),q0.exports}var P=eR(),F=Lg();const at=XM(F),rS=QM({__proto__:null,default:at},[F]);var Cp={},K0={exports:{}},As={},Y0={exports:{}},Q0={};/** + */var tS;function ZM(){if(tS)return Ed;tS=1;var e=Lg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(a,c,u){var f,h={},p=null,g=null;u!==void 0&&(p=""+u),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(g=c.ref);for(f in c)r.call(c,f)&&!o.hasOwnProperty(f)&&(h[f]=c[f]);if(a&&a.defaultProps)for(f in c=a.defaultProps,c)h[f]===void 0&&(h[f]=c[f]);return{$$typeof:t,type:a,key:p,ref:g,props:h,_owner:s.current}}return Ed.Fragment=n,Ed.jsx=i,Ed.jsxs=i,Ed}var nS;function eR(){return nS||(nS=1,q0.exports=ZM()),q0.exports}var F=eR(),T=Lg();const at=XM(T),rS=QM({__proto__:null,default:at},[T]);var Cp={},K0={exports:{}},As={},Y0={exports:{}},Q0={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var KM=Object.defineProperty;var Jk=e=>{throw TypeError(e)};var YM=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var sS;function tR(){return sS||(sS=1,(function(e){function t(q,oe){var K=q.length;q.push(oe);e:for(;0>>1,V=q[G];if(0>>1;Gs(ee,K))kes(ne,ee)?(q[G]=ne,q[ke]=K,G=ke):(q[G]=ee,q[ge]=K,G=ge);else if(kes(ne,K))q[G]=ne,q[ke]=K,G=ke;else break e}}return oe}function s(q,oe){var K=q.sortIndex-oe.sortIndex;return K!==0?K:q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var c=[],u=[],f=1,h=null,p=3,g=!1,y=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(q){for(var oe=n(u);oe!==null;){if(oe.callback===null)r(u);else if(oe.startTime<=q)r(u),oe.sortIndex=oe.expirationTime,t(c,oe);else break;oe=n(u)}}function _(q){if(b=!1,x(q),!y)if(n(c)!==null)y=!0,Q(S);else{var oe=n(u);oe!==null&&W(_,oe.startTime-q)}}function S(q,oe){y=!1,b&&(b=!1,C(A),A=-1),g=!0;var K=p;try{for(x(oe),h=n(c);h!==null&&(!(h.expirationTime>oe)||q&&!N());){var G=h.callback;if(typeof G=="function"){h.callback=null,p=h.priorityLevel;var V=G(h.expirationTime<=oe);oe=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(c)&&r(c),x(oe)}else r(c);h=n(c)}if(h!==null)var Y=!0;else{var ge=n(u);ge!==null&&W(_,ge.startTime-oe),Y=!1}return Y}finally{h=null,p=K,g=!1}}var I=!1,k=null,A=-1,D=5,T=-1;function N(){return!(e.unstable_now()-Tq||125G?(q.sortIndex=K,t(u,q),n(c)===null&&q===n(u)&&(b?(C(A),A=-1):b=!0,W(_,K-G))):(q.sortIndex=V,t(c,q),y||g||(y=!0,Q(S))),q},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(q){var oe=p;return function(){var K=p;p=oe;try{return q.apply(this,arguments)}finally{p=K}}}})(Q0)),Q0}var oS;function nR(){return oS||(oS=1,Y0.exports=tR()),Y0.exports}/** + */var sS;function tR(){return sS||(sS=1,(function(e){function t(G,te){var Y=G.length;G.push(te);e:for(;0>>1,V=G[q];if(0>>1;qs(ee,Y))kes(re,ee)?(G[q]=re,G[ke]=Y,q=ke):(G[q]=ee,G[ge]=Y,q=ge);else if(kes(re,Y))G[q]=re,G[ke]=Y,q=ke;else break e}}return te}function s(G,te){var Y=G.sortIndex-te.sortIndex;return Y!==0?Y:G.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var c=[],u=[],f=1,h=null,p=3,g=!1,y=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(G){for(var te=n(u);te!==null;){if(te.callback===null)r(u);else if(te.startTime<=G)r(u),te.sortIndex=te.expirationTime,t(c,te);else break;te=n(u)}}function A(G){if(b=!1,x(G),!y)if(n(c)!==null)y=!0,K(S);else{var te=n(u);te!==null&&H(A,te.startTime-G)}}function S(G,te){y=!1,b&&(b=!1,C(k),k=-1),g=!0;var Y=p;try{for(x(te),h=n(c);h!==null&&(!(h.expirationTime>te)||G&&!R());){var q=h.callback;if(typeof q=="function"){h.callback=null,p=h.priorityLevel;var V=q(h.expirationTime<=te);te=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(c)&&r(c),x(te)}else r(c);h=n(c)}if(h!==null)var Q=!0;else{var ge=n(u);ge!==null&&H(A,ge.startTime-te),Q=!1}return Q}finally{h=null,p=Y,g=!1}}var I=!1,N=null,k=-1,_=5,B=-1;function R(){return!(e.unstable_now()-B<_)}function L(){if(N!==null){var G=e.unstable_now();B=G;var te=!0;try{te=N(!0,G)}finally{te?$():(I=!1,N=null)}}else I=!1}var $;if(typeof v=="function")$=function(){v(L)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,U=z.port2;z.port1.onmessage=L,$=function(){U.postMessage(null)}}else $=function(){w(L,0)};function K(G){N=G,I||(I=!0,$())}function H(G,te){k=w(function(){G(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,K(S))},e.unstable_forceFrameRate=function(G){0>G||125q?(G.sortIndex=Y,t(u,G),n(c)===null&&G===n(u)&&(b?(C(k),k=-1):b=!0,H(A,Y-q))):(G.sortIndex=V,t(c,G),y||g||(y=!0,K(S))),G},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(G){var te=p;return function(){var Y=p;p=te;try{return G.apply(this,arguments)}finally{p=Y}}}})(Q0)),Q0}var oS;function nR(){return oS||(oS=1,Y0.exports=tR()),Y0.exports}/** * @license React * react-dom.production.min.js * @@ -31,14 +31,14 @@ var KM=Object.defineProperty;var Jk=e=>{throw TypeError(e)};var YM=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iS;function rR(){if(iS)return As;iS=1;var e=Lg(),t=nR();function n(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function p(l){return c.call(h,l)?!0:c.call(f,l)?!1:u.test(l)?h[l]=!0:(f[l]=!0,!1)}function g(l,d,m,E){if(m!==null&&m.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return E?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,d,m,E){if(d===null||typeof d>"u"||g(l,d,m,E))return!0;if(E)return!1;if(m!==null)switch(m.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function b(l,d,m,E,M,j,X){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=E,this.attributeNamespace=M,this.mustUseProperty=m,this.propertyName=l,this.type=d,this.sanitizeURL=j,this.removeEmptyString=X}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){w[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];w[d]=new b(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){w[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){w[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){w[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){w[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){w[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){w[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){w[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function v(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var d=l.replace(C,v);w[d]=new b(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(C,v);w[d]=new b(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(C,v);w[d]=new b(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){w[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),w.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){w[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function x(l,d,m,E){var M=w.hasOwnProperty(d)?w[d]:null;(M!==null?M.type!==0:E||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function p(l){return c.call(h,l)?!0:c.call(f,l)?!1:u.test(l)?h[l]=!0:(f[l]=!0,!1)}function g(l,d,m,E){if(m!==null&&m.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return E?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,d,m,E){if(d===null||typeof d>"u"||g(l,d,m,E))return!0;if(E)return!1;if(m!==null)switch(m.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function b(l,d,m,E,P,j,X){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=E,this.attributeNamespace=P,this.mustUseProperty=m,this.propertyName=l,this.type=d,this.sanitizeURL=j,this.removeEmptyString=X}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){w[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];w[d]=new b(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){w[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){w[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){w[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){w[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){w[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){w[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){w[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function v(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var d=l.replace(C,v);w[d]=new b(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(C,v);w[d]=new b(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(C,v);w[d]=new b(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){w[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),w.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){w[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function x(l,d,m,E){var P=w.hasOwnProperty(d)?w[d]:null;(P!==null?P.type!==0:E||!(2me||M[X]!==j[me]){var Ae=` -`+M[X].replace(" at new "," at ");return l.displayName&&Ae.includes("")&&(Ae=Ae.replace("",l.displayName)),Ae}while(1<=X&&0<=me);break}}}finally{Y=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?V(l):""}function ee(l){switch(l.tag){case 5:return V(l.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return l=ge(l.type,!1),l;case 11:return l=ge(l.type.render,!1),l;case 1:return l=ge(l.type,!0),l;default:return""}}function ke(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case k:return"Fragment";case I:return"Portal";case D:return"Profiler";case A:return"StrictMode";case U:return"Suspense";case z:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case N:return(l.displayName||"Context")+".Consumer";case T:return(l._context.displayName||"Context")+".Provider";case L:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case $:return d=l.displayName||null,d!==null?d:ke(l.type)||"Memo";case Q:d=l._payload,l=l._init;try{return ke(l(d))}catch{}}return null}function ne(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(d);case 8:return d===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function re(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function xe(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function te(l){var d=xe(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),E=""+l[d];if(!l.hasOwnProperty(d)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var M=m.get,j=m.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return M.call(this)},set:function(X){E=""+X,j.call(this,X)}}),Object.defineProperty(l,d,{enumerable:m.enumerable}),{getValue:function(){return E},setValue:function(X){E=""+X},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function de(l){l._valueTracker||(l._valueTracker=te(l))}function ye(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var m=d.getValue(),E="";return l&&(E=xe(l)?l.checked?"true":"false":l.value),l=E,l!==m?(d.setValue(l),!0):!1}function Fe(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Te(l,d){var m=d.checked;return K({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function se(l,d){var m=d.defaultValue==null?"":d.defaultValue,E=d.checked!=null?d.checked:d.defaultChecked;m=re(d.value!=null?d.value:m),l._wrapperState={initialChecked:E,initialValue:m,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function be(l,d){d=d.checked,d!=null&&x(l,"checked",d,!1)}function Se(l,d){be(l,d);var m=re(d.value),E=d.type;if(m!=null)E==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(E==="submit"||E==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?Ne(l,d.type,m):d.hasOwnProperty("defaultValue")&&Ne(l,d.type,re(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Pe(l,d,m){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var E=d.type;if(!(E!=="submit"&&E!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,m||d===l.value||(l.value=d),l.defaultValue=d}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function Ne(l,d,m){(d!=="number"||Fe(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var Oe=Array.isArray;function ve(l,d,m,E){if(l=l.options,d){d={};for(var M=0;M"+d.valueOf().toString()+"",d=O.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function le(l,d){if(d){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=d;return}}l.textContent=d}var Ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=["Webkit","ms","Moz","O"];Object.keys(Ce).forEach(function(l){Ee.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),Ce[d]=Ce[l]})});function ce(l,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||Ce.hasOwnProperty(l)&&Ce[l]?(""+d).trim():d+"px"}function pe(l,d){l=l.style;for(var m in d)if(d.hasOwnProperty(m)){var E=m.indexOf("--")===0,M=ce(m,d[m],E);m==="float"&&(m="cssFloat"),E?l.setProperty(m,M):l[m]=M}}var Xe=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function st(l,d){if(d){if(Xe[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function nt(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mt=null;function $t(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Xt=null,xt=null,Vt=null;function kt(l){if(l=id(l)){if(typeof Xt!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Lh(d),Xt(l.stateNode,l.type,d))}}function Ht(l){xt?Vt?Vt.push(l):Vt=[l]:xt=l}function Jt(){if(xt){var l=xt,d=Vt;if(Vt=xt=null,kt(l),d)for(l=0;l>>=0,l===0?32:31-(Hu(l)/$r|0)|0}var tl=64,Qi=4194304;function Xi(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function uc(l,d){var m=l.pendingLanes;if(m===0)return 0;var E=0,M=l.suspendedLanes,j=l.pingedLanes,X=m&268435455;if(X!==0){var me=X&~M;me!==0?E=Xi(me):(j&=X,j!==0&&(E=Xi(j)))}else X=m&~M,X!==0?E=Xi(X):j!==0&&(E=Xi(j));if(E===0)return 0;if(d!==0&&d!==E&&(d&M)===0&&(M=E&-E,j=d&-d,M>=j||M===16&&(j&4194240)!==0))return d;if((E&4)!==0&&(E|=m&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=E;0m;m++)d.push(l);return d}function Ji(l,d,m){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-es(d),l[d]=m}function Gu(l,d){var m=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var E=l.eventTimes;for(l=l.expirationTimes;0=bi),Th=" ",wc=!1;function H(l,d){switch(l){case"keyup":return Xn.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ae=!1;function fe(l,d){switch(l){case"compositionend":return J(d);case"keypress":return d.which!==32?null:(wc=!0,Th);case"textInput":return l=d.data,l===Th&&wc?null:l;default:return null}}function _e(l,d){if(ae)return l==="compositionend"||!vc&&H(l,d)?(l=Is(),Rs=Xu=Ms=null,ae=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:m,offset:d-l};l=E}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=ws(m)}}function zr(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?zr(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function ss(){for(var l=window,d=Fe();d instanceof l.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)l=d.contentWindow;else break;d=Fe(l.document)}return d}function os(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function Js(l){var d=ss(),m=l.focusedElem,E=l.selectionRange;if(d!==m&&m&&m.ownerDocument&&zr(m.ownerDocument.documentElement,m)){if(E!==null&&os(m)){if(d=E.start,l=E.end,l===void 0&&(l=d),"selectionStart"in m)m.selectionStart=d,m.selectionEnd=Math.min(l,m.value.length);else if(l=(d=m.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var M=m.textContent.length,j=Math.min(E.start,M);E=E.end===void 0?j:Math.min(E.end,M),!l.extend&&j>E&&(M=E,E=j,j=M),M=Ns(m,j);var X=Ns(m,E);M&&X&&(l.rangeCount!==1||l.anchorNode!==M.node||l.anchorOffset!==M.offset||l.focusNode!==X.node||l.focusOffset!==X.offset)&&(d=d.createRange(),d.setStart(M.node,M.offset),l.removeAllRanges(),j>E?(l.addRange(d),l.extend(X.node,X.offset)):(d.setEnd(X.node,X.offset),l.addRange(d)))}}for(d=[],l=m;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m=document.documentMode,lr=null,vo=null,rr=null,Ec=!1;function sx(l,d,m){var E=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Ec||lr==null||lr!==Fe(E)||(E=lr,"selectionStart"in E&&os(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),rr&&kr(rr,E)||(rr=E,E=Mh(vo,"onSelect"),0Ac||(l.current=zy[Ac],zy[Ac]=null,Ac--)}function Sn(l,d){Ac++,zy[Ac]=l.current,l.current=d}var fa={},Vr=da(fa),Es=da(!1),fl=fa;function _c(l,d){var m=l.type.contextTypes;if(!m)return fa;var E=l.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===d)return E.__reactInternalMemoizedMaskedChildContext;var M={},j;for(j in m)M[j]=d[j];return E&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=M),M}function Cs(l){return l=l.childContextTypes,l!=null}function Nh(){Dn(Es),Dn(Vr)}function vx(l,d,m){if(Vr.current!==fa)throw Error(n(168));Sn(Vr,d),Sn(Es,m)}function Ex(l,d,m){var E=l.stateNode;if(d=d.childContextTypes,typeof E.getChildContext!="function")return m;E=E.getChildContext();for(var M in E)if(!(M in d))throw Error(n(108,ne(l)||"Unknown",M));return K({},m,E)}function jh(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||fa,fl=Vr.current,Sn(Vr,l),Sn(Es,Es.current),!0}function Cx(l,d,m){var E=l.stateNode;if(!E)throw Error(n(169));m?(l=Ex(l,d,fl),E.__reactInternalMemoizedMergedChildContext=l,Dn(Es),Dn(Vr),Sn(Vr,l)):Dn(Es),Sn(Es,m)}var wi=null,Oh=!1,Vy=!1;function xx(l){wi===null?wi=[l]:wi.push(l)}function hM(l){Oh=!0,xx(l)}function ha(){if(!Vy&&wi!==null){Vy=!0;var l=0,d=Yt;try{var m=wi;for(Yt=1;l>=X,M-=X,Ei=1<<32-es(d)+M|m<Rt?(_r=Dt,Dt=null):_r=Dt.sibling;var sn=Je(Re,Dt,je[Rt],it);if(sn===null){Dt===null&&(Dt=_r);break}l&&Dt&&sn.alternate===null&&d(Re,Dt),De=j(sn,De,Rt),_t===null?Ct=sn:_t.sibling=sn,_t=sn,Dt=_r}if(Rt===je.length)return m(Re,Dt),Rn&&pl(Re,Rt),Ct;if(Dt===null){for(;RtRt?(_r=Dt,Dt=null):_r=Dt.sibling;var Ca=Je(Re,Dt,sn.value,it);if(Ca===null){Dt===null&&(Dt=_r);break}l&&Dt&&Ca.alternate===null&&d(Re,Dt),De=j(Ca,De,Rt),_t===null?Ct=Ca:_t.sibling=Ca,_t=Ca,Dt=_r}if(sn.done)return m(Re,Dt),Rn&&pl(Re,Rt),Ct;if(Dt===null){for(;!sn.done;Rt++,sn=je.next())sn=tt(Re,sn.value,it),sn!==null&&(De=j(sn,De,Rt),_t===null?Ct=sn:_t.sibling=sn,_t=sn);return Rn&&pl(Re,Rt),Ct}for(Dt=E(Re,Dt);!sn.done;Rt++,sn=je.next())sn=ht(Dt,Re,Rt,sn.value,it),sn!==null&&(l&&sn.alternate!==null&&Dt.delete(sn.key===null?Rt:sn.key),De=j(sn,De,Rt),_t===null?Ct=sn:_t.sibling=sn,_t=sn);return l&&Dt.forEach(function(GM){return d(Re,GM)}),Rn&&pl(Re,Rt),Ct}function sr(Re,De,je,it){if(typeof je=="object"&&je!==null&&je.type===k&&je.key===null&&(je=je.props.children),typeof je=="object"&&je!==null){switch(je.$$typeof){case S:e:{for(var Ct=je.key,_t=De;_t!==null;){if(_t.key===Ct){if(Ct=je.type,Ct===k){if(_t.tag===7){m(Re,_t.sibling),De=M(_t,je.props.children),De.return=Re,Re=De;break e}}else if(_t.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===Q&&Tx(Ct)===_t.type){m(Re,_t.sibling),De=M(_t,je.props),De.ref=ad(Re,_t,je),De.return=Re,Re=De;break e}m(Re,_t);break}else d(Re,_t);_t=_t.sibling}je.type===k?(De=Cl(je.props.children,Re.mode,it,je.key),De.return=Re,Re=De):(it=hp(je.type,je.key,je.props,null,Re.mode,it),it.ref=ad(Re,De,je),it.return=Re,Re=it)}return X(Re);case I:e:{for(_t=je.key;De!==null;){if(De.key===_t)if(De.tag===4&&De.stateNode.containerInfo===je.containerInfo&&De.stateNode.implementation===je.implementation){m(Re,De.sibling),De=M(De,je.children||[]),De.return=Re,Re=De;break e}else{m(Re,De);break}else d(Re,De);De=De.sibling}De=$0(je,Re.mode,it),De.return=Re,Re=De}return X(Re);case Q:return _t=je._init,sr(Re,De,_t(je._payload),it)}if(Oe(je))return bt(Re,De,je,it);if(oe(je))return wt(Re,De,je,it);Vh(Re,je)}return typeof je=="string"&&je!==""||typeof je=="number"?(je=""+je,De!==null&&De.tag===6?(m(Re,De.sibling),De=M(De,je),De.return=Re,Re=De):(m(Re,De),De=O0(je,Re.mode,it),De.return=Re,Re=De),X(Re)):m(Re,De)}return sr}var Fc=Bx(!0),Fx=Bx(!1),Hh=da(null),Wh=null,Pc=null,Yy=null;function Qy(){Yy=Pc=Wh=null}function Xy(l){var d=Hh.current;Dn(Hh),l._currentValue=d}function Jy(l,d,m){for(;l!==null;){var E=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,E!==null&&(E.childLanes|=d)):E!==null&&(E.childLanes&d)!==d&&(E.childLanes|=d),l===m)break;l=l.return}}function Mc(l,d){Wh=l,Yy=Pc=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(xs=!0),l.firstContext=null)}function to(l){var d=l._currentValue;if(Yy!==l)if(l={context:l,memoizedValue:d,next:null},Pc===null){if(Wh===null)throw Error(n(308));Pc=l,Wh.dependencies={lanes:0,firstContext:l}}else Pc=Pc.next=l;return d}var ml=null;function Zy(l){ml===null?ml=[l]:ml.push(l)}function Px(l,d,m,E){var M=d.interleaved;return M===null?(m.next=m,Zy(d)):(m.next=M.next,M.next=m),d.interleaved=m,xi(l,E)}function xi(l,d){l.lanes|=d;var m=l.alternate;for(m!==null&&(m.lanes|=d),m=l,l=l.return;l!==null;)l.childLanes|=d,m=l.alternate,m!==null&&(m.childLanes|=d),m=l,l=l.return;return m.tag===3?m.stateNode:null}var pa=!1;function e0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mx(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ki(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function ma(l,d,m){var E=l.updateQueue;if(E===null)return null;if(E=E.shared,(Zt&2)!==0){var M=E.pending;return M===null?d.next=d:(d.next=M.next,M.next=d),E.pending=d,xi(l,m)}return M=E.interleaved,M===null?(d.next=d,Zy(E)):(d.next=M.next,M.next=d),E.interleaved=d,xi(l,m)}function qh(l,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194240)!==0)){var E=d.lanes;E&=l.pendingLanes,m|=E,d.lanes=m,Zi(l,m)}}function Rx(l,d){var m=l.updateQueue,E=l.alternate;if(E!==null&&(E=E.updateQueue,m===E)){var M=null,j=null;if(m=m.firstBaseUpdate,m!==null){do{var X={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};j===null?M=j=X:j=j.next=X,m=m.next}while(m!==null);j===null?M=j=d:j=j.next=d}else M=j=d;m={baseState:E.baseState,firstBaseUpdate:M,lastBaseUpdate:j,shared:E.shared,effects:E.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=d:l.next=d,m.lastBaseUpdate=d}function Gh(l,d,m,E){var M=l.updateQueue;pa=!1;var j=M.firstBaseUpdate,X=M.lastBaseUpdate,me=M.shared.pending;if(me!==null){M.shared.pending=null;var Ae=me,ze=Ae.next;Ae.next=null,X===null?j=ze:X.next=ze,X=Ae;var et=l.alternate;et!==null&&(et=et.updateQueue,me=et.lastBaseUpdate,me!==X&&(me===null?et.firstBaseUpdate=ze:me.next=ze,et.lastBaseUpdate=Ae))}if(j!==null){var tt=M.baseState;X=0,et=ze=Ae=null,me=j;do{var Je=me.lane,ht=me.eventTime;if((E&Je)===Je){et!==null&&(et=et.next={eventTime:ht,lane:0,tag:me.tag,payload:me.payload,callback:me.callback,next:null});e:{var bt=l,wt=me;switch(Je=d,ht=m,wt.tag){case 1:if(bt=wt.payload,typeof bt=="function"){tt=bt.call(ht,tt,Je);break e}tt=bt;break e;case 3:bt.flags=bt.flags&-65537|128;case 0:if(bt=wt.payload,Je=typeof bt=="function"?bt.call(ht,tt,Je):bt,Je==null)break e;tt=K({},tt,Je);break e;case 2:pa=!0}}me.callback!==null&&me.lane!==0&&(l.flags|=64,Je=M.effects,Je===null?M.effects=[me]:Je.push(me))}else ht={eventTime:ht,lane:Je,tag:me.tag,payload:me.payload,callback:me.callback,next:null},et===null?(ze=et=ht,Ae=tt):et=et.next=ht,X|=Je;if(me=me.next,me===null){if(me=M.shared.pending,me===null)break;Je=me,me=Je.next,Je.next=null,M.lastBaseUpdate=Je,M.shared.pending=null}}while(!0);if(et===null&&(Ae=tt),M.baseState=Ae,M.firstBaseUpdate=ze,M.lastBaseUpdate=et,d=M.shared.interleaved,d!==null){M=d;do X|=M.lane,M=M.next;while(M!==d)}else j===null&&(M.shared.lanes=0);bl|=X,l.lanes=X,l.memoizedState=tt}}function Ix(l,d,m){if(l=d.effects,d.effects=null,l!==null)for(d=0;dm?m:4,l(!0);var E=o0.transition;o0.transition={};try{l(!1),d()}finally{Yt=m,o0.transition=E}}function ek(){return no().memoizedState}function yM(l,d,m){var E=va(l);if(m={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null},tk(l))nk(d,m);else if(m=Px(l,d,m,E),m!==null){var M=as();ko(m,l,E,M),rk(m,d,E)}}function bM(l,d,m){var E=va(l),M={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null};if(tk(l))nk(d,M);else{var j=l.alternate;if(l.lanes===0&&(j===null||j.lanes===0)&&(j=d.lastRenderedReducer,j!==null))try{var X=d.lastRenderedState,me=j(X,m);if(M.hasEagerState=!0,M.eagerState=me,Cn(me,X)){var Ae=d.interleaved;Ae===null?(M.next=M,Zy(d)):(M.next=Ae.next,Ae.next=M),d.interleaved=M;return}}catch{}finally{}m=Px(l,d,M,E),m!==null&&(M=as(),ko(m,l,E,M),rk(m,d,E))}}function tk(l){var d=l.alternate;return l===Vn||d!==null&&d===Vn}function nk(l,d){dd=Qh=!0;var m=l.pending;m===null?d.next=d:(d.next=m.next,m.next=d),l.pending=d}function rk(l,d,m){if((m&4194240)!==0){var E=d.lanes;E&=l.pendingLanes,m|=E,d.lanes=m,Zi(l,m)}}var Zh={readContext:to,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},vM={readContext:to,useCallback:function(l,d){return qo().memoizedState=[l,d===void 0?null:d],l},useContext:to,useEffect:qx,useImperativeHandle:function(l,d,m){return m=m!=null?m.concat([l]):null,Xh(4194308,4,Yx.bind(null,d,l),m)},useLayoutEffect:function(l,d){return Xh(4194308,4,l,d)},useInsertionEffect:function(l,d){return Xh(4,2,l,d)},useMemo:function(l,d){var m=qo();return d=d===void 0?null:d,l=l(),m.memoizedState=[l,d],l},useReducer:function(l,d,m){var E=qo();return d=m!==void 0?m(d):d,E.memoizedState=E.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},E.queue=l,l=l.dispatch=yM.bind(null,Vn,l),[E.memoizedState,l]},useRef:function(l){var d=qo();return l={current:l},d.memoizedState=l},useState:Hx,useDebugValue:f0,useDeferredValue:function(l){return qo().memoizedState=l},useTransition:function(){var l=Hx(!1),d=l[0];return l=gM.bind(null,l[1]),qo().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,m){var E=Vn,M=qo();if(Rn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=d(),Ar===null)throw Error(n(349));(yl&30)!==0||Ox(E,d,m)}M.memoizedState=m;var j={value:m,getSnapshot:d};return M.queue=j,qx(Ux.bind(null,E,j,l),[l]),E.flags|=2048,pd(9,$x.bind(null,E,j,m,d),void 0,null),m},useId:function(){var l=qo(),d=Ar.identifierPrefix;if(Rn){var m=Ci,E=Ei;m=(E&~(1<<32-es(E)-1)).toString(32)+m,d=":"+d+"R"+m,m=fd++,0me||P[X]!==j[me]){var Ae=` +`+P[X].replace(" at new "," at ");return l.displayName&&Ae.includes("")&&(Ae=Ae.replace("",l.displayName)),Ae}while(1<=X&&0<=me);break}}}finally{Q=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?V(l):""}function ee(l){switch(l.tag){case 5:return V(l.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return l=ge(l.type,!1),l;case 11:return l=ge(l.type.render,!1),l;case 1:return l=ge(l.type,!0),l;default:return""}}function ke(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case N:return"Fragment";case I:return"Portal";case _:return"Profiler";case k:return"StrictMode";case $:return"Suspense";case z:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case R:return(l.displayName||"Context")+".Consumer";case B:return(l._context.displayName||"Context")+".Provider";case L:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case U:return d=l.displayName||null,d!==null?d:ke(l.type)||"Memo";case K:d=l._payload,l=l._init;try{return ke(l(d))}catch{}}return null}function re(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(d);case 8:return d===k?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function se(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function xe(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function ne(l){var d=xe(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),E=""+l[d];if(!l.hasOwnProperty(d)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var P=m.get,j=m.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return P.call(this)},set:function(X){E=""+X,j.call(this,X)}}),Object.defineProperty(l,d,{enumerable:m.enumerable}),{getValue:function(){return E},setValue:function(X){E=""+X},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function de(l){l._valueTracker||(l._valueTracker=ne(l))}function ye(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var m=d.getValue(),E="";return l&&(E=xe(l)?l.checked?"true":"false":l.value),l=E,l!==m?(d.setValue(l),!0):!1}function Fe(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Te(l,d){var m=d.checked;return Y({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function oe(l,d){var m=d.defaultValue==null?"":d.defaultValue,E=d.checked!=null?d.checked:d.defaultChecked;m=se(d.value!=null?d.value:m),l._wrapperState={initialChecked:E,initialValue:m,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function be(l,d){d=d.checked,d!=null&&x(l,"checked",d,!1)}function Se(l,d){be(l,d);var m=se(d.value),E=d.type;if(m!=null)E==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(E==="submit"||E==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?Ne(l,d.type,m):d.hasOwnProperty("defaultValue")&&Ne(l,d.type,se(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Pe(l,d,m){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var E=d.type;if(!(E!=="submit"&&E!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,m||d===l.value||(l.value=d),l.defaultValue=d}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function Ne(l,d,m){(d!=="number"||Fe(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var Oe=Array.isArray;function ve(l,d,m,E){if(l=l.options,d){d={};for(var P=0;P"+d.valueOf().toString()+"",d=O.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function le(l,d){if(d){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=d;return}}l.textContent=d}var Ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=["Webkit","ms","Moz","O"];Object.keys(Ce).forEach(function(l){Ee.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),Ce[d]=Ce[l]})});function ce(l,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||Ce.hasOwnProperty(l)&&Ce[l]?(""+d).trim():d+"px"}function pe(l,d){l=l.style;for(var m in d)if(d.hasOwnProperty(m)){var E=m.indexOf("--")===0,P=ce(m,d[m],E);m==="float"&&(m="cssFloat"),E?l.setProperty(m,P):l[m]=P}}var Xe=Y({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function st(l,d){if(d){if(Xe[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function nt(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mt=null;function $t(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Xt=null,xt=null,Vt=null;function kt(l){if(l=id(l)){if(typeof Xt!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Lh(d),Xt(l.stateNode,l.type,d))}}function Ht(l){xt?Vt?Vt.push(l):Vt=[l]:xt=l}function Jt(){if(xt){var l=xt,d=Vt;if(Vt=xt=null,kt(l),d)for(l=0;l>>=0,l===0?32:31-(Hu(l)/$r|0)|0}var tl=64,Qi=4194304;function Xi(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function uc(l,d){var m=l.pendingLanes;if(m===0)return 0;var E=0,P=l.suspendedLanes,j=l.pingedLanes,X=m&268435455;if(X!==0){var me=X&~P;me!==0?E=Xi(me):(j&=X,j!==0&&(E=Xi(j)))}else X=m&~P,X!==0?E=Xi(X):j!==0&&(E=Xi(j));if(E===0)return 0;if(d!==0&&d!==E&&(d&P)===0&&(P=E&-E,j=d&-d,P>=j||P===16&&(j&4194240)!==0))return d;if((E&4)!==0&&(E|=m&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=E;0m;m++)d.push(l);return d}function Ji(l,d,m){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-es(d),l[d]=m}function Gu(l,d){var m=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var E=l.eventTimes;for(l=l.expirationTimes;0=bi),Th=" ",wc=!1;function W(l,d){switch(l){case"keyup":return Xn.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ae=!1;function fe(l,d){switch(l){case"compositionend":return J(d);case"keypress":return d.which!==32?null:(wc=!0,Th);case"textInput":return l=d.data,l===Th&&wc?null:l;default:return null}}function _e(l,d){if(ae)return l==="compositionend"||!vc&&W(l,d)?(l=Is(),Rs=Xu=Ms=null,ae=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:m,offset:d-l};l=E}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=ws(m)}}function zr(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?zr(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function ss(){for(var l=window,d=Fe();d instanceof l.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)l=d.contentWindow;else break;d=Fe(l.document)}return d}function os(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function Js(l){var d=ss(),m=l.focusedElem,E=l.selectionRange;if(d!==m&&m&&m.ownerDocument&&zr(m.ownerDocument.documentElement,m)){if(E!==null&&os(m)){if(d=E.start,l=E.end,l===void 0&&(l=d),"selectionStart"in m)m.selectionStart=d,m.selectionEnd=Math.min(l,m.value.length);else if(l=(d=m.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var P=m.textContent.length,j=Math.min(E.start,P);E=E.end===void 0?j:Math.min(E.end,P),!l.extend&&j>E&&(P=E,E=j,j=P),P=Ns(m,j);var X=Ns(m,E);P&&X&&(l.rangeCount!==1||l.anchorNode!==P.node||l.anchorOffset!==P.offset||l.focusNode!==X.node||l.focusOffset!==X.offset)&&(d=d.createRange(),d.setStart(P.node,P.offset),l.removeAllRanges(),j>E?(l.addRange(d),l.extend(X.node,X.offset)):(d.setEnd(X.node,X.offset),l.addRange(d)))}}for(d=[],l=m;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m=document.documentMode,lr=null,vo=null,rr=null,Ec=!1;function sx(l,d,m){var E=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Ec||lr==null||lr!==Fe(E)||(E=lr,"selectionStart"in E&&os(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),rr&&kr(rr,E)||(rr=E,E=Mh(vo,"onSelect"),0Ac||(l.current=zy[Ac],zy[Ac]=null,Ac--)}function Sn(l,d){Ac++,zy[Ac]=l.current,l.current=d}var fa={},Vr=da(fa),Es=da(!1),fl=fa;function _c(l,d){var m=l.type.contextTypes;if(!m)return fa;var E=l.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===d)return E.__reactInternalMemoizedMaskedChildContext;var P={},j;for(j in m)P[j]=d[j];return E&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=P),P}function Cs(l){return l=l.childContextTypes,l!=null}function Nh(){Dn(Es),Dn(Vr)}function vx(l,d,m){if(Vr.current!==fa)throw Error(n(168));Sn(Vr,d),Sn(Es,m)}function Ex(l,d,m){var E=l.stateNode;if(d=d.childContextTypes,typeof E.getChildContext!="function")return m;E=E.getChildContext();for(var P in E)if(!(P in d))throw Error(n(108,re(l)||"Unknown",P));return Y({},m,E)}function jh(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||fa,fl=Vr.current,Sn(Vr,l),Sn(Es,Es.current),!0}function Cx(l,d,m){var E=l.stateNode;if(!E)throw Error(n(169));m?(l=Ex(l,d,fl),E.__reactInternalMemoizedMergedChildContext=l,Dn(Es),Dn(Vr),Sn(Vr,l)):Dn(Es),Sn(Es,m)}var wi=null,Oh=!1,Vy=!1;function xx(l){wi===null?wi=[l]:wi.push(l)}function hM(l){Oh=!0,xx(l)}function ha(){if(!Vy&&wi!==null){Vy=!0;var l=0,d=Yt;try{var m=wi;for(Yt=1;l>=X,P-=X,Ei=1<<32-es(d)+P|m<Rt?(_r=Dt,Dt=null):_r=Dt.sibling;var sn=Je(Re,Dt,je[Rt],it);if(sn===null){Dt===null&&(Dt=_r);break}l&&Dt&&sn.alternate===null&&d(Re,Dt),De=j(sn,De,Rt),_t===null?Ct=sn:_t.sibling=sn,_t=sn,Dt=_r}if(Rt===je.length)return m(Re,Dt),Rn&&pl(Re,Rt),Ct;if(Dt===null){for(;RtRt?(_r=Dt,Dt=null):_r=Dt.sibling;var Ca=Je(Re,Dt,sn.value,it);if(Ca===null){Dt===null&&(Dt=_r);break}l&&Dt&&Ca.alternate===null&&d(Re,Dt),De=j(Ca,De,Rt),_t===null?Ct=Ca:_t.sibling=Ca,_t=Ca,Dt=_r}if(sn.done)return m(Re,Dt),Rn&&pl(Re,Rt),Ct;if(Dt===null){for(;!sn.done;Rt++,sn=je.next())sn=tt(Re,sn.value,it),sn!==null&&(De=j(sn,De,Rt),_t===null?Ct=sn:_t.sibling=sn,_t=sn);return Rn&&pl(Re,Rt),Ct}for(Dt=E(Re,Dt);!sn.done;Rt++,sn=je.next())sn=ht(Dt,Re,Rt,sn.value,it),sn!==null&&(l&&sn.alternate!==null&&Dt.delete(sn.key===null?Rt:sn.key),De=j(sn,De,Rt),_t===null?Ct=sn:_t.sibling=sn,_t=sn);return l&&Dt.forEach(function(GM){return d(Re,GM)}),Rn&&pl(Re,Rt),Ct}function sr(Re,De,je,it){if(typeof je=="object"&&je!==null&&je.type===N&&je.key===null&&(je=je.props.children),typeof je=="object"&&je!==null){switch(je.$$typeof){case S:e:{for(var Ct=je.key,_t=De;_t!==null;){if(_t.key===Ct){if(Ct=je.type,Ct===N){if(_t.tag===7){m(Re,_t.sibling),De=P(_t,je.props.children),De.return=Re,Re=De;break e}}else if(_t.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===K&&Tx(Ct)===_t.type){m(Re,_t.sibling),De=P(_t,je.props),De.ref=ad(Re,_t,je),De.return=Re,Re=De;break e}m(Re,_t);break}else d(Re,_t);_t=_t.sibling}je.type===N?(De=Cl(je.props.children,Re.mode,it,je.key),De.return=Re,Re=De):(it=hp(je.type,je.key,je.props,null,Re.mode,it),it.ref=ad(Re,De,je),it.return=Re,Re=it)}return X(Re);case I:e:{for(_t=je.key;De!==null;){if(De.key===_t)if(De.tag===4&&De.stateNode.containerInfo===je.containerInfo&&De.stateNode.implementation===je.implementation){m(Re,De.sibling),De=P(De,je.children||[]),De.return=Re,Re=De;break e}else{m(Re,De);break}else d(Re,De);De=De.sibling}De=$0(je,Re.mode,it),De.return=Re,Re=De}return X(Re);case K:return _t=je._init,sr(Re,De,_t(je._payload),it)}if(Oe(je))return bt(Re,De,je,it);if(te(je))return wt(Re,De,je,it);Vh(Re,je)}return typeof je=="string"&&je!==""||typeof je=="number"?(je=""+je,De!==null&&De.tag===6?(m(Re,De.sibling),De=P(De,je),De.return=Re,Re=De):(m(Re,De),De=O0(je,Re.mode,it),De.return=Re,Re=De),X(Re)):m(Re,De)}return sr}var Fc=Bx(!0),Fx=Bx(!1),Hh=da(null),Wh=null,Pc=null,Yy=null;function Qy(){Yy=Pc=Wh=null}function Xy(l){var d=Hh.current;Dn(Hh),l._currentValue=d}function Jy(l,d,m){for(;l!==null;){var E=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,E!==null&&(E.childLanes|=d)):E!==null&&(E.childLanes&d)!==d&&(E.childLanes|=d),l===m)break;l=l.return}}function Mc(l,d){Wh=l,Yy=Pc=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(xs=!0),l.firstContext=null)}function to(l){var d=l._currentValue;if(Yy!==l)if(l={context:l,memoizedValue:d,next:null},Pc===null){if(Wh===null)throw Error(n(308));Pc=l,Wh.dependencies={lanes:0,firstContext:l}}else Pc=Pc.next=l;return d}var ml=null;function Zy(l){ml===null?ml=[l]:ml.push(l)}function Px(l,d,m,E){var P=d.interleaved;return P===null?(m.next=m,Zy(d)):(m.next=P.next,P.next=m),d.interleaved=m,xi(l,E)}function xi(l,d){l.lanes|=d;var m=l.alternate;for(m!==null&&(m.lanes|=d),m=l,l=l.return;l!==null;)l.childLanes|=d,m=l.alternate,m!==null&&(m.childLanes|=d),m=l,l=l.return;return m.tag===3?m.stateNode:null}var pa=!1;function e0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mx(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ki(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function ma(l,d,m){var E=l.updateQueue;if(E===null)return null;if(E=E.shared,(Zt&2)!==0){var P=E.pending;return P===null?d.next=d:(d.next=P.next,P.next=d),E.pending=d,xi(l,m)}return P=E.interleaved,P===null?(d.next=d,Zy(E)):(d.next=P.next,P.next=d),E.interleaved=d,xi(l,m)}function qh(l,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194240)!==0)){var E=d.lanes;E&=l.pendingLanes,m|=E,d.lanes=m,Zi(l,m)}}function Rx(l,d){var m=l.updateQueue,E=l.alternate;if(E!==null&&(E=E.updateQueue,m===E)){var P=null,j=null;if(m=m.firstBaseUpdate,m!==null){do{var X={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};j===null?P=j=X:j=j.next=X,m=m.next}while(m!==null);j===null?P=j=d:j=j.next=d}else P=j=d;m={baseState:E.baseState,firstBaseUpdate:P,lastBaseUpdate:j,shared:E.shared,effects:E.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=d:l.next=d,m.lastBaseUpdate=d}function Gh(l,d,m,E){var P=l.updateQueue;pa=!1;var j=P.firstBaseUpdate,X=P.lastBaseUpdate,me=P.shared.pending;if(me!==null){P.shared.pending=null;var Ae=me,ze=Ae.next;Ae.next=null,X===null?j=ze:X.next=ze,X=Ae;var et=l.alternate;et!==null&&(et=et.updateQueue,me=et.lastBaseUpdate,me!==X&&(me===null?et.firstBaseUpdate=ze:me.next=ze,et.lastBaseUpdate=Ae))}if(j!==null){var tt=P.baseState;X=0,et=ze=Ae=null,me=j;do{var Je=me.lane,ht=me.eventTime;if((E&Je)===Je){et!==null&&(et=et.next={eventTime:ht,lane:0,tag:me.tag,payload:me.payload,callback:me.callback,next:null});e:{var bt=l,wt=me;switch(Je=d,ht=m,wt.tag){case 1:if(bt=wt.payload,typeof bt=="function"){tt=bt.call(ht,tt,Je);break e}tt=bt;break e;case 3:bt.flags=bt.flags&-65537|128;case 0:if(bt=wt.payload,Je=typeof bt=="function"?bt.call(ht,tt,Je):bt,Je==null)break e;tt=Y({},tt,Je);break e;case 2:pa=!0}}me.callback!==null&&me.lane!==0&&(l.flags|=64,Je=P.effects,Je===null?P.effects=[me]:Je.push(me))}else ht={eventTime:ht,lane:Je,tag:me.tag,payload:me.payload,callback:me.callback,next:null},et===null?(ze=et=ht,Ae=tt):et=et.next=ht,X|=Je;if(me=me.next,me===null){if(me=P.shared.pending,me===null)break;Je=me,me=Je.next,Je.next=null,P.lastBaseUpdate=Je,P.shared.pending=null}}while(!0);if(et===null&&(Ae=tt),P.baseState=Ae,P.firstBaseUpdate=ze,P.lastBaseUpdate=et,d=P.shared.interleaved,d!==null){P=d;do X|=P.lane,P=P.next;while(P!==d)}else j===null&&(P.shared.lanes=0);bl|=X,l.lanes=X,l.memoizedState=tt}}function Ix(l,d,m){if(l=d.effects,d.effects=null,l!==null)for(d=0;dm?m:4,l(!0);var E=o0.transition;o0.transition={};try{l(!1),d()}finally{Yt=m,o0.transition=E}}function ek(){return no().memoizedState}function yM(l,d,m){var E=va(l);if(m={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null},tk(l))nk(d,m);else if(m=Px(l,d,m,E),m!==null){var P=as();ko(m,l,E,P),rk(m,d,E)}}function bM(l,d,m){var E=va(l),P={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null};if(tk(l))nk(d,P);else{var j=l.alternate;if(l.lanes===0&&(j===null||j.lanes===0)&&(j=d.lastRenderedReducer,j!==null))try{var X=d.lastRenderedState,me=j(X,m);if(P.hasEagerState=!0,P.eagerState=me,Cn(me,X)){var Ae=d.interleaved;Ae===null?(P.next=P,Zy(d)):(P.next=Ae.next,Ae.next=P),d.interleaved=P;return}}catch{}finally{}m=Px(l,d,P,E),m!==null&&(P=as(),ko(m,l,E,P),rk(m,d,E))}}function tk(l){var d=l.alternate;return l===Vn||d!==null&&d===Vn}function nk(l,d){dd=Qh=!0;var m=l.pending;m===null?d.next=d:(d.next=m.next,m.next=d),l.pending=d}function rk(l,d,m){if((m&4194240)!==0){var E=d.lanes;E&=l.pendingLanes,m|=E,d.lanes=m,Zi(l,m)}}var Zh={readContext:to,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},vM={readContext:to,useCallback:function(l,d){return qo().memoizedState=[l,d===void 0?null:d],l},useContext:to,useEffect:qx,useImperativeHandle:function(l,d,m){return m=m!=null?m.concat([l]):null,Xh(4194308,4,Yx.bind(null,d,l),m)},useLayoutEffect:function(l,d){return Xh(4194308,4,l,d)},useInsertionEffect:function(l,d){return Xh(4,2,l,d)},useMemo:function(l,d){var m=qo();return d=d===void 0?null:d,l=l(),m.memoizedState=[l,d],l},useReducer:function(l,d,m){var E=qo();return d=m!==void 0?m(d):d,E.memoizedState=E.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},E.queue=l,l=l.dispatch=yM.bind(null,Vn,l),[E.memoizedState,l]},useRef:function(l){var d=qo();return l={current:l},d.memoizedState=l},useState:Hx,useDebugValue:f0,useDeferredValue:function(l){return qo().memoizedState=l},useTransition:function(){var l=Hx(!1),d=l[0];return l=gM.bind(null,l[1]),qo().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,m){var E=Vn,P=qo();if(Rn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=d(),Ar===null)throw Error(n(349));(yl&30)!==0||Ox(E,d,m)}P.memoizedState=m;var j={value:m,getSnapshot:d};return P.queue=j,qx(Ux.bind(null,E,j,l),[l]),E.flags|=2048,pd(9,$x.bind(null,E,j,m,d),void 0,null),m},useId:function(){var l=qo(),d=Ar.identifierPrefix;if(Rn){var m=Ci,E=Ei;m=(E&~(1<<32-es(E)-1)).toString(32)+m,d=":"+d+"R"+m,m=fd++,0<\/script>",l=l.removeChild(l.firstChild)):typeof E.is=="string"?l=X.createElement(m,{is:E.is}):(l=X.createElement(m),m==="select"&&(X=l,E.multiple?X.multiple=!0:E.size&&(X.size=E.size))):l=X.createElementNS(l,m),l[Ho]=d,l[od]=E,xk(l,d,!1,!1),d.stateNode=l;e:{switch(X=nt(m,E),m){case"dialog":_n("cancel",l),_n("close",l),M=E;break;case"iframe":case"object":case"embed":_n("load",l),M=E;break;case"video":case"audio":for(M=0;Mjc&&(d.flags|=128,E=!0,md(j,!1),d.lanes=4194304)}else{if(!E)if(l=Kh(X),l!==null){if(d.flags|=128,E=!0,m=l.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),md(j,!0),j.tail===null&&j.tailMode==="hidden"&&!X.alternate&&!Rn)return Wr(d),null}else 2*En()-j.renderingStartTime>jc&&m!==1073741824&&(d.flags|=128,E=!0,md(j,!1),d.lanes=4194304);j.isBackwards?(X.sibling=d.child,d.child=X):(m=j.last,m!==null?m.sibling=X:d.child=X,j.last=X)}return j.tail!==null?(d=j.tail,j.rendering=d,j.tail=d.sibling,j.renderingStartTime=En(),d.sibling=null,m=zn.current,Sn(zn,E?m&1|2:m&1),d):(Wr(d),null);case 22:case 23:return L0(),E=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==E&&(d.flags|=8192),E&&(d.mode&1)!==0?($s&1073741824)!==0&&(Wr(d),d.subtreeFlags&6&&(d.flags|=8192)):Wr(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function _M(l,d){switch(Wy(d),d.tag){case 1:return Cs(d.type)&&Nh(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Rc(),Dn(Es),Dn(Vr),s0(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return n0(d),null;case 13:if(Dn(zn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Bc()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Dn(zn),null;case 4:return Rc(),null;case 10:return Xy(d.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var rp=!1,qr=!1,DM=typeof WeakSet=="function"?WeakSet:Set,gt=null;function Lc(l,d){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(E){Jn(l,d,E)}else m.current=null}function k0(l,d,m){try{m()}catch(E){Jn(l,d,E)}}var Ak=!1;function TM(l,d){if(Ly=hn,l=ss(),os(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var E=m.getSelection&&m.getSelection();if(E&&E.rangeCount!==0){m=E.anchorNode;var M=E.anchorOffset,j=E.focusNode;E=E.focusOffset;try{m.nodeType,j.nodeType}catch{m=null;break e}var X=0,me=-1,Ae=-1,ze=0,et=0,tt=l,Je=null;t:for(;;){for(var ht;tt!==m||M!==0&&tt.nodeType!==3||(me=X+M),tt!==j||E!==0&&tt.nodeType!==3||(Ae=X+E),tt.nodeType===3&&(X+=tt.nodeValue.length),(ht=tt.firstChild)!==null;)Je=tt,tt=ht;for(;;){if(tt===l)break t;if(Je===m&&++ze===M&&(me=X),Je===j&&++et===E&&(Ae=X),(ht=tt.nextSibling)!==null)break;tt=Je,Je=tt.parentNode}tt=ht}m=me===-1||Ae===-1?null:{start:me,end:Ae}}else m=null}m=m||{start:0,end:0}}else m=null;for(Ny={focusedElem:l,selectionRange:m},hn=!1,gt=d;gt!==null;)if(d=gt,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,gt=l;else for(;gt!==null;){d=gt;try{var bt=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(bt!==null){var wt=bt.memoizedProps,sr=bt.memoizedState,Re=d.stateNode,De=Re.getSnapshotBeforeUpdate(d.elementType===d.type?wt:Eo(d.type,wt),sr);Re.__reactInternalSnapshotBeforeUpdate=De}break;case 3:var je=d.stateNode.containerInfo;je.nodeType===1?je.textContent="":je.nodeType===9&&je.documentElement&&je.removeChild(je.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(it){Jn(d,d.return,it)}if(l=d.sibling,l!==null){l.return=d.return,gt=l;break}gt=d.return}return bt=Ak,Ak=!1,bt}function gd(l,d,m){var E=d.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var M=E=E.next;do{if((M.tag&l)===l){var j=M.destroy;M.destroy=void 0,j!==void 0&&k0(d,m,j)}M=M.next}while(M!==E)}}function sp(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var m=d=d.next;do{if((m.tag&l)===l){var E=m.create;m.destroy=E()}m=m.next}while(m!==d)}}function S0(l){var d=l.ref;if(d!==null){var m=l.stateNode;switch(l.tag){case 5:l=m;break;default:l=m}typeof d=="function"?d(l):d.current=l}}function _k(l){var d=l.alternate;d!==null&&(l.alternate=null,_k(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Ho],delete d[od],delete d[Uy],delete d[dM],delete d[fM])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Dk(l){return l.tag===5||l.tag===3||l.tag===4}function Tk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Dk(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function A0(l,d,m){var E=l.tag;if(E===5||E===6)l=l.stateNode,d?m.nodeType===8?m.parentNode.insertBefore(l,d):m.insertBefore(l,d):(m.nodeType===8?(d=m.parentNode,d.insertBefore(l,m)):(d=m,d.appendChild(l)),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=Ih));else if(E!==4&&(l=l.child,l!==null))for(A0(l,d,m),l=l.sibling;l!==null;)A0(l,d,m),l=l.sibling}function _0(l,d,m){var E=l.tag;if(E===5||E===6)l=l.stateNode,d?m.insertBefore(l,d):m.appendChild(l);else if(E!==4&&(l=l.child,l!==null))for(_0(l,d,m),l=l.sibling;l!==null;)_0(l,d,m),l=l.sibling}var Ir=null,Co=!1;function ga(l,d,m){for(m=m.child;m!==null;)Bk(l,d,m),m=m.sibling}function Bk(l,d,m){if(ys&&typeof ys.onCommitFiberUnmount=="function")try{ys.onCommitFiberUnmount(Yi,m)}catch{}switch(m.tag){case 5:qr||Lc(m,d);case 6:var E=Ir,M=Co;Ir=null,ga(l,d,m),Ir=E,Co=M,Ir!==null&&(Co?(l=Ir,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):Ir.removeChild(m.stateNode));break;case 18:Ir!==null&&(Co?(l=Ir,m=m.stateNode,l.nodeType===8?$y(l.parentNode,m):l.nodeType===1&&$y(l,m),ia(l)):$y(Ir,m.stateNode));break;case 4:E=Ir,M=Co,Ir=m.stateNode.containerInfo,Co=!0,ga(l,d,m),Ir=E,Co=M;break;case 0:case 11:case 14:case 15:if(!qr&&(E=m.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){M=E=E.next;do{var j=M,X=j.destroy;j=j.tag,X!==void 0&&((j&2)!==0||(j&4)!==0)&&k0(m,d,X),M=M.next}while(M!==E)}ga(l,d,m);break;case 1:if(!qr&&(Lc(m,d),E=m.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=m.memoizedProps,E.state=m.memoizedState,E.componentWillUnmount()}catch(me){Jn(m,d,me)}ga(l,d,m);break;case 21:ga(l,d,m);break;case 22:m.mode&1?(qr=(E=qr)||m.memoizedState!==null,ga(l,d,m),qr=E):ga(l,d,m);break;default:ga(l,d,m)}}function Fk(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new DM),d.forEach(function(E){var M=jM.bind(null,l,E);m.has(E)||(m.add(E),E.then(M,M))})}}function xo(l,d){var m=d.deletions;if(m!==null)for(var E=0;EM&&(M=X),E&=~j}if(E=M,E=En()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*FM(E/1960))-E,10l?16:l,ba===null)var E=!1;else{if(l=ba,ba=null,cp=0,(Zt&6)!==0)throw Error(n(331));var M=Zt;for(Zt|=4,gt=l.current;gt!==null;){var j=gt,X=j.child;if((gt.flags&16)!==0){var me=j.deletions;if(me!==null){for(var Ae=0;AeEn()-B0?wl(l,0):T0|=m),Ss(l,d)}function Hk(l,d){d===0&&((l.mode&1)===0?d=1:(d=Qi,Qi<<=1,(Qi&130023424)===0&&(Qi=4194304)));var m=as();l=xi(l,d),l!==null&&(Ji(l,d,m),Ss(l,m))}function NM(l){var d=l.memoizedState,m=0;d!==null&&(m=d.retryLane),Hk(l,m)}function jM(l,d){var m=0;switch(l.tag){case 13:var E=l.stateNode,M=l.memoizedState;M!==null&&(m=M.retryLane);break;case 19:E=l.stateNode;break;default:throw Error(n(314))}E!==null&&E.delete(d),Hk(l,m)}var Wk;Wk=function(l,d,m){if(l!==null)if(l.memoizedProps!==d.pendingProps||Es.current)xs=!0;else{if((l.lanes&m)===0&&(d.flags&128)===0)return xs=!1,SM(l,d,m);xs=(l.flags&131072)!==0}else xs=!1,Rn&&(d.flags&1048576)!==0&&kx(d,Uh,d.index);switch(d.lanes=0,d.tag){case 2:var E=d.type;np(l,d),l=d.pendingProps;var M=_c(d,Vr.current);Mc(d,m),M=a0(null,d,E,l,M,m);var j=l0();return d.flags|=1,typeof M=="object"&&M!==null&&typeof M.render=="function"&&M.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Cs(E)?(j=!0,jh(d)):j=!1,d.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,e0(d),M.updater=ep,d.stateNode=M,M._reactInternals=d,p0(d,E,l,m),d=b0(null,d,E,!0,j,m)):(d.tag=0,Rn&&j&&Hy(d),is(null,d,M,m),d=d.child),d;case 16:E=d.elementType;e:{switch(np(l,d),l=d.pendingProps,M=E._init,E=M(E._payload),d.type=E,M=d.tag=$M(E),l=Eo(E,l),M){case 0:d=y0(null,d,E,l,m);break e;case 1:d=yk(null,d,E,l,m);break e;case 11:d=fk(null,d,E,l,m);break e;case 14:d=hk(null,d,E,Eo(E.type,l),m);break e}throw Error(n(306,E,""))}return d;case 0:return E=d.type,M=d.pendingProps,M=d.elementType===E?M:Eo(E,M),y0(l,d,E,M,m);case 1:return E=d.type,M=d.pendingProps,M=d.elementType===E?M:Eo(E,M),yk(l,d,E,M,m);case 3:e:{if(bk(d),l===null)throw Error(n(387));E=d.pendingProps,j=d.memoizedState,M=j.element,Mx(l,d),Gh(d,E,null,m);var X=d.memoizedState;if(E=X.element,j.isDehydrated)if(j={element:E,isDehydrated:!1,cache:X.cache,pendingSuspenseBoundaries:X.pendingSuspenseBoundaries,transitions:X.transitions},d.updateQueue.baseState=j,d.memoizedState=j,d.flags&256){M=Ic(Error(n(423)),d),d=vk(l,d,E,m,M);break e}else if(E!==M){M=Ic(Error(n(424)),d),d=vk(l,d,E,m,M);break e}else for(Os=ua(d.stateNode.containerInfo.firstChild),js=d,Rn=!0,wo=null,m=Fx(d,null,E,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Bc(),E===M){d=Si(l,d,m);break e}is(l,d,E,m)}d=d.child}return d;case 5:return Lx(d),l===null&&Gy(d),E=d.type,M=d.pendingProps,j=l!==null?l.memoizedProps:null,X=M.children,jy(E,M)?X=null:j!==null&&jy(E,j)&&(d.flags|=32),gk(l,d),is(l,d,X,m),d.child;case 6:return l===null&&Gy(d),null;case 13:return wk(l,d,m);case 4:return t0(d,d.stateNode.containerInfo),E=d.pendingProps,l===null?d.child=Fc(d,null,E,m):is(l,d,E,m),d.child;case 11:return E=d.type,M=d.pendingProps,M=d.elementType===E?M:Eo(E,M),fk(l,d,E,M,m);case 7:return is(l,d,d.pendingProps,m),d.child;case 8:return is(l,d,d.pendingProps.children,m),d.child;case 12:return is(l,d,d.pendingProps.children,m),d.child;case 10:e:{if(E=d.type._context,M=d.pendingProps,j=d.memoizedProps,X=M.value,Sn(Hh,E._currentValue),E._currentValue=X,j!==null)if(Cn(j.value,X)){if(j.children===M.children&&!Es.current){d=Si(l,d,m);break e}}else for(j=d.child,j!==null&&(j.return=d);j!==null;){var me=j.dependencies;if(me!==null){X=j.child;for(var Ae=me.firstContext;Ae!==null;){if(Ae.context===E){if(j.tag===1){Ae=ki(-1,m&-m),Ae.tag=2;var ze=j.updateQueue;if(ze!==null){ze=ze.shared;var et=ze.pending;et===null?Ae.next=Ae:(Ae.next=et.next,et.next=Ae),ze.pending=Ae}}j.lanes|=m,Ae=j.alternate,Ae!==null&&(Ae.lanes|=m),Jy(j.return,m,d),me.lanes|=m;break}Ae=Ae.next}}else if(j.tag===10)X=j.type===d.type?null:j.child;else if(j.tag===18){if(X=j.return,X===null)throw Error(n(341));X.lanes|=m,me=X.alternate,me!==null&&(me.lanes|=m),Jy(X,m,d),X=j.sibling}else X=j.child;if(X!==null)X.return=j;else for(X=j;X!==null;){if(X===d){X=null;break}if(j=X.sibling,j!==null){j.return=X.return,X=j;break}X=X.return}j=X}is(l,d,M.children,m),d=d.child}return d;case 9:return M=d.type,E=d.pendingProps.children,Mc(d,m),M=to(M),E=E(M),d.flags|=1,is(l,d,E,m),d.child;case 14:return E=d.type,M=Eo(E,d.pendingProps),M=Eo(E.type,M),hk(l,d,E,M,m);case 15:return pk(l,d,d.type,d.pendingProps,m);case 17:return E=d.type,M=d.pendingProps,M=d.elementType===E?M:Eo(E,M),np(l,d),d.tag=1,Cs(E)?(l=!0,jh(d)):l=!1,Mc(d,m),ok(d,E,M),p0(d,E,M,m),b0(null,d,E,!0,l,m);case 19:return Ck(l,d,m);case 22:return mk(l,d,m)}throw Error(n(156,d.tag))};function qk(l,d){return tr(l,d)}function OM(l,d,m,E){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function so(l,d,m,E){return new OM(l,d,m,E)}function j0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function $M(l){if(typeof l=="function")return j0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===$)return 14}return 2}function Ea(l,d){var m=l.alternate;return m===null?(m=so(l.tag,d,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=d,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,d=l.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function hp(l,d,m,E,M,j){var X=2;if(E=l,typeof l=="function")j0(l)&&(X=1);else if(typeof l=="string")X=5;else e:switch(l){case k:return Cl(m.children,M,j,d);case A:X=8,M|=8;break;case D:return l=so(12,m,d,M|2),l.elementType=D,l.lanes=j,l;case U:return l=so(13,m,d,M),l.elementType=U,l.lanes=j,l;case z:return l=so(19,m,d,M),l.elementType=z,l.lanes=j,l;case W:return pp(m,M,j,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case T:X=10;break e;case N:X=9;break e;case L:X=11;break e;case $:X=14;break e;case Q:X=16,E=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=so(X,m,d,M),d.elementType=l,d.type=E,d.lanes=j,d}function Cl(l,d,m,E){return l=so(7,l,E,d),l.lanes=m,l}function pp(l,d,m,E){return l=so(22,l,E,d),l.elementType=W,l.lanes=m,l.stateNode={isHidden:!1},l}function O0(l,d,m){return l=so(6,l,null,d),l.lanes=m,l}function $0(l,d,m){return d=so(4,l.children!==null?l.children:[],l.key,d),d.lanes=m,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function UM(l,d,m,E,M){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qu(0),this.expirationTimes=qu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qu(0),this.identifierPrefix=E,this.onRecoverableError=M,this.mutableSourceEagerHydrationData=null}function U0(l,d,m,E,M,j,X,me,Ae){return l=new UM(l,d,m,me,Ae),d===1?(d=1,j===!0&&(d|=8)):d=0,j=so(3,null,null,d),l.current=j,j.stateNode=l,j.memoizedState={element:E,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},e0(j),l}function zM(l,d,m){var E=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),K0.exports=rR(),K0.exports}var lS;function sR(){if(lS)return Cp;lS=1;var e=YD();return Cp.createRoot=e.createRoot,Cp.hydrateRoot=e.hydrateRoot,Cp}var oR=sR();/** +`+j.stack}return{value:l,source:d,stack:P,digest:null}}function m0(l,d,m){return{value:l,source:null,stack:m??null,digest:d??null}}function g0(l,d){try{console.error(d.value)}catch(m){setTimeout(function(){throw m})}}var CM=typeof WeakMap=="function"?WeakMap:Map;function ak(l,d,m){m=ki(-1,m),m.tag=3,m.payload={element:null};var E=d.value;return m.callback=function(){ap||(ap=!0,F0=E),g0(l,d)},m}function lk(l,d,m){m=ki(-1,m),m.tag=3;var E=l.type.getDerivedStateFromError;if(typeof E=="function"){var P=d.value;m.payload=function(){return E(P)},m.callback=function(){g0(l,d)}}var j=l.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(m.callback=function(){g0(l,d),typeof E!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var X=d.stack;this.componentDidCatch(d.value,{componentStack:X!==null?X:""})}),m}function ck(l,d,m){var E=l.pingCache;if(E===null){E=l.pingCache=new CM;var P=new Set;E.set(d,P)}else P=E.get(d),P===void 0&&(P=new Set,E.set(d,P));P.has(m)||(P.add(m),l=LM.bind(null,l,d,m),d.then(l,l))}function uk(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function dk(l,d,m,E,P){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(d=ki(-1,1),d.tag=2,ma(m,d,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=P,l)}var xM=A.ReactCurrentOwner,xs=!1;function is(l,d,m,E){d.child=l===null?Fx(d,null,m,E):Fc(d,l.child,m,E)}function fk(l,d,m,E,P){m=m.render;var j=d.ref;return Mc(d,P),E=a0(l,d,m,E,j,P),m=l0(),l!==null&&!xs?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~P,Si(l,d,P)):(Rn&&m&&Hy(d),d.flags|=1,is(l,d,E,P),d.child)}function hk(l,d,m,E,P){if(l===null){var j=m.type;return typeof j=="function"&&!j0(j)&&j.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(d.tag=15,d.type=j,pk(l,d,j,E,P)):(l=hp(m.type,null,E,d,d.mode,P),l.ref=d.ref,l.return=d,d.child=l)}if(j=l.child,(l.lanes&P)===0){var X=j.memoizedProps;if(m=m.compare,m=m!==null?m:kr,m(X,E)&&l.ref===d.ref)return Si(l,d,P)}return d.flags|=1,l=Ea(j,E),l.ref=d.ref,l.return=d,d.child=l}function pk(l,d,m,E,P){if(l!==null){var j=l.memoizedProps;if(kr(j,E)&&l.ref===d.ref)if(xs=!1,d.pendingProps=E=j,(l.lanes&P)!==0)(l.flags&131072)!==0&&(xs=!0);else return d.lanes=l.lanes,Si(l,d,P)}return y0(l,d,m,E,P)}function mk(l,d,m){var E=d.pendingProps,P=E.children,j=l!==null?l.memoizedState:null;if(E.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Sn(Nc,$s),$s|=m;else{if((m&1073741824)===0)return l=j!==null?j.baseLanes|m:m,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,Sn(Nc,$s),$s|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},E=j!==null?j.baseLanes:m,Sn(Nc,$s),$s|=E}else j!==null?(E=j.baseLanes|m,d.memoizedState=null):E=m,Sn(Nc,$s),$s|=E;return is(l,d,P,m),d.child}function gk(l,d){var m=d.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(d.flags|=512,d.flags|=2097152)}function y0(l,d,m,E,P){var j=Cs(m)?fl:Vr.current;return j=_c(d,j),Mc(d,P),m=a0(l,d,m,E,j,P),E=l0(),l!==null&&!xs?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~P,Si(l,d,P)):(Rn&&E&&Hy(d),d.flags|=1,is(l,d,m,P),d.child)}function yk(l,d,m,E,P){if(Cs(m)){var j=!0;jh(d)}else j=!1;if(Mc(d,P),d.stateNode===null)np(l,d),ok(d,m,E),p0(d,m,E,P),E=!0;else if(l===null){var X=d.stateNode,me=d.memoizedProps;X.props=me;var Ae=X.context,ze=m.contextType;typeof ze=="object"&&ze!==null?ze=to(ze):(ze=Cs(m)?fl:Vr.current,ze=_c(d,ze));var et=m.getDerivedStateFromProps,tt=typeof et=="function"||typeof X.getSnapshotBeforeUpdate=="function";tt||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(me!==E||Ae!==ze)&&ik(d,X,E,ze),pa=!1;var Je=d.memoizedState;X.state=Je,Gh(d,E,X,P),Ae=d.memoizedState,me!==E||Je!==Ae||Es.current||pa?(typeof et=="function"&&(h0(d,m,et,E),Ae=d.memoizedState),(me=pa||sk(d,m,me,E,Je,Ae,ze))?(tt||typeof X.UNSAFE_componentWillMount!="function"&&typeof X.componentWillMount!="function"||(typeof X.componentWillMount=="function"&&X.componentWillMount(),typeof X.UNSAFE_componentWillMount=="function"&&X.UNSAFE_componentWillMount()),typeof X.componentDidMount=="function"&&(d.flags|=4194308)):(typeof X.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=E,d.memoizedState=Ae),X.props=E,X.state=Ae,X.context=ze,E=me):(typeof X.componentDidMount=="function"&&(d.flags|=4194308),E=!1)}else{X=d.stateNode,Mx(l,d),me=d.memoizedProps,ze=d.type===d.elementType?me:Eo(d.type,me),X.props=ze,tt=d.pendingProps,Je=X.context,Ae=m.contextType,typeof Ae=="object"&&Ae!==null?Ae=to(Ae):(Ae=Cs(m)?fl:Vr.current,Ae=_c(d,Ae));var ht=m.getDerivedStateFromProps;(et=typeof ht=="function"||typeof X.getSnapshotBeforeUpdate=="function")||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(me!==tt||Je!==Ae)&&ik(d,X,E,Ae),pa=!1,Je=d.memoizedState,X.state=Je,Gh(d,E,X,P);var bt=d.memoizedState;me!==tt||Je!==bt||Es.current||pa?(typeof ht=="function"&&(h0(d,m,ht,E),bt=d.memoizedState),(ze=pa||sk(d,m,ze,E,Je,bt,Ae)||!1)?(et||typeof X.UNSAFE_componentWillUpdate!="function"&&typeof X.componentWillUpdate!="function"||(typeof X.componentWillUpdate=="function"&&X.componentWillUpdate(E,bt,Ae),typeof X.UNSAFE_componentWillUpdate=="function"&&X.UNSAFE_componentWillUpdate(E,bt,Ae)),typeof X.componentDidUpdate=="function"&&(d.flags|=4),typeof X.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof X.componentDidUpdate!="function"||me===l.memoizedProps&&Je===l.memoizedState||(d.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||me===l.memoizedProps&&Je===l.memoizedState||(d.flags|=1024),d.memoizedProps=E,d.memoizedState=bt),X.props=E,X.state=bt,X.context=Ae,E=ze):(typeof X.componentDidUpdate!="function"||me===l.memoizedProps&&Je===l.memoizedState||(d.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||me===l.memoizedProps&&Je===l.memoizedState||(d.flags|=1024),E=!1)}return b0(l,d,m,E,j,P)}function b0(l,d,m,E,P,j){gk(l,d);var X=(d.flags&128)!==0;if(!E&&!X)return P&&Cx(d,m,!1),Si(l,d,j);E=d.stateNode,xM.current=d;var me=X&&typeof m.getDerivedStateFromError!="function"?null:E.render();return d.flags|=1,l!==null&&X?(d.child=Fc(d,l.child,null,j),d.child=Fc(d,null,me,j)):is(l,d,me,j),d.memoizedState=E.state,P&&Cx(d,m,!0),d.child}function bk(l){var d=l.stateNode;d.pendingContext?vx(l,d.pendingContext,d.pendingContext!==d.context):d.context&&vx(l,d.context,!1),t0(l,d.containerInfo)}function vk(l,d,m,E,P){return Bc(),Ky(P),d.flags|=256,is(l,d,m,E),d.child}var v0={dehydrated:null,treeContext:null,retryLane:0};function w0(l){return{baseLanes:l,cachePool:null,transitions:null}}function wk(l,d,m){var E=d.pendingProps,P=zn.current,j=!1,X=(d.flags&128)!==0,me;if((me=X)||(me=l!==null&&l.memoizedState===null?!1:(P&2)!==0),me?(j=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(P|=1),Sn(zn,P&1),l===null)return Gy(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(X=E.children,l=E.fallback,j?(E=d.mode,j=d.child,X={mode:"hidden",children:X},(E&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=X):j=pp(X,E,0,null),l=Cl(l,E,m,null),j.return=d,l.return=d,j.sibling=l,d.child=j,d.child.memoizedState=w0(m),d.memoizedState=v0,l):E0(d,X));if(P=l.memoizedState,P!==null&&(me=P.dehydrated,me!==null))return kM(l,d,X,E,me,P,m);if(j){j=E.fallback,X=d.mode,P=l.child,me=P.sibling;var Ae={mode:"hidden",children:E.children};return(X&1)===0&&d.child!==P?(E=d.child,E.childLanes=0,E.pendingProps=Ae,d.deletions=null):(E=Ea(P,Ae),E.subtreeFlags=P.subtreeFlags&14680064),me!==null?j=Ea(me,j):(j=Cl(j,X,m,null),j.flags|=2),j.return=d,E.return=d,E.sibling=j,d.child=E,E=j,j=d.child,X=l.child.memoizedState,X=X===null?w0(m):{baseLanes:X.baseLanes|m,cachePool:null,transitions:X.transitions},j.memoizedState=X,j.childLanes=l.childLanes&~m,d.memoizedState=v0,E}return j=l.child,l=j.sibling,E=Ea(j,{mode:"visible",children:E.children}),(d.mode&1)===0&&(E.lanes=m),E.return=d,E.sibling=null,l!==null&&(m=d.deletions,m===null?(d.deletions=[l],d.flags|=16):m.push(l)),d.child=E,d.memoizedState=null,E}function E0(l,d){return d=pp({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function tp(l,d,m,E){return E!==null&&Ky(E),Fc(d,l.child,null,m),l=E0(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function kM(l,d,m,E,P,j,X){if(m)return d.flags&256?(d.flags&=-257,E=m0(Error(n(422))),tp(l,d,X,E)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(j=E.fallback,P=d.mode,E=pp({mode:"visible",children:E.children},P,0,null),j=Cl(j,P,X,null),j.flags|=2,E.return=d,j.return=d,E.sibling=j,d.child=E,(d.mode&1)!==0&&Fc(d,l.child,null,X),d.child.memoizedState=w0(X),d.memoizedState=v0,j);if((d.mode&1)===0)return tp(l,d,X,null);if(P.data==="$!"){if(E=P.nextSibling&&P.nextSibling.dataset,E)var me=E.dgst;return E=me,j=Error(n(419)),E=m0(j,E,void 0),tp(l,d,X,E)}if(me=(X&l.childLanes)!==0,xs||me){if(E=Ar,E!==null){switch(X&-X){case 4:P=2;break;case 16:P=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:P=32;break;case 536870912:P=268435456;break;default:P=0}P=(P&(E.suspendedLanes|X))!==0?0:P,P!==0&&P!==j.retryLane&&(j.retryLane=P,xi(l,P),ko(E,l,P,-1))}return N0(),E=m0(Error(n(421))),tp(l,d,X,E)}return P.data==="$?"?(d.flags|=128,d.child=l.child,d=NM.bind(null,l),P._reactRetry=d,null):(l=j.treeContext,Os=ua(P.nextSibling),js=d,Rn=!0,wo=null,l!==null&&(Zs[eo++]=Ei,Zs[eo++]=Ci,Zs[eo++]=hl,Ei=l.id,Ci=l.overflow,hl=d),d=E0(d,E.children),d.flags|=4096,d)}function Ek(l,d,m){l.lanes|=d;var E=l.alternate;E!==null&&(E.lanes|=d),Jy(l.return,d,m)}function C0(l,d,m,E,P){var j=l.memoizedState;j===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:E,tail:m,tailMode:P}:(j.isBackwards=d,j.rendering=null,j.renderingStartTime=0,j.last=E,j.tail=m,j.tailMode=P)}function Ck(l,d,m){var E=d.pendingProps,P=E.revealOrder,j=E.tail;if(is(l,d,E.children,m),E=zn.current,(E&2)!==0)E=E&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Ek(l,m,d);else if(l.tag===19)Ek(l,m,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}E&=1}if(Sn(zn,E),(d.mode&1)===0)d.memoizedState=null;else switch(P){case"forwards":for(m=d.child,P=null;m!==null;)l=m.alternate,l!==null&&Kh(l)===null&&(P=m),m=m.sibling;m=P,m===null?(P=d.child,d.child=null):(P=m.sibling,m.sibling=null),C0(d,!1,P,m,j);break;case"backwards":for(m=null,P=d.child,d.child=null;P!==null;){if(l=P.alternate,l!==null&&Kh(l)===null){d.child=P;break}l=P.sibling,P.sibling=m,m=P,P=l}C0(d,!0,m,null,j);break;case"together":C0(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function np(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function Si(l,d,m){if(l!==null&&(d.dependencies=l.dependencies),bl|=d.lanes,(m&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(n(153));if(d.child!==null){for(l=d.child,m=Ea(l,l.pendingProps),d.child=m,m.return=d;l.sibling!==null;)l=l.sibling,m=m.sibling=Ea(l,l.pendingProps),m.return=d;m.sibling=null}return d.child}function SM(l,d,m){switch(d.tag){case 3:bk(d),Bc();break;case 5:Lx(d);break;case 1:Cs(d.type)&&jh(d);break;case 4:t0(d,d.stateNode.containerInfo);break;case 10:var E=d.type._context,P=d.memoizedProps.value;Sn(Hh,E._currentValue),E._currentValue=P;break;case 13:if(E=d.memoizedState,E!==null)return E.dehydrated!==null?(Sn(zn,zn.current&1),d.flags|=128,null):(m&d.child.childLanes)!==0?wk(l,d,m):(Sn(zn,zn.current&1),l=Si(l,d,m),l!==null?l.sibling:null);Sn(zn,zn.current&1);break;case 19:if(E=(m&d.childLanes)!==0,(l.flags&128)!==0){if(E)return Ck(l,d,m);d.flags|=128}if(P=d.memoizedState,P!==null&&(P.rendering=null,P.tail=null,P.lastEffect=null),Sn(zn,zn.current),E)break;return null;case 22:case 23:return d.lanes=0,mk(l,d,m)}return Si(l,d,m)}var xk,x0,kk,Sk;xk=function(l,d){for(var m=d.child;m!==null;){if(m.tag===5||m.tag===6)l.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},x0=function(){},kk=function(l,d,m,E){var P=l.memoizedProps;if(P!==E){l=d.stateNode,gl(Wo.current);var j=null;switch(m){case"input":P=Te(l,P),E=Te(l,E),j=[];break;case"select":P=Y({},P,{value:void 0}),E=Y({},E,{value:void 0}),j=[];break;case"textarea":P=Me(l,P),E=Me(l,E),j=[];break;default:typeof P.onClick!="function"&&typeof E.onClick=="function"&&(l.onclick=Ih)}st(m,E);var X;m=null;for(ze in P)if(!E.hasOwnProperty(ze)&&P.hasOwnProperty(ze)&&P[ze]!=null)if(ze==="style"){var me=P[ze];for(X in me)me.hasOwnProperty(X)&&(m||(m={}),m[X]="")}else ze!=="dangerouslySetInnerHTML"&&ze!=="children"&&ze!=="suppressContentEditableWarning"&&ze!=="suppressHydrationWarning"&&ze!=="autoFocus"&&(s.hasOwnProperty(ze)?j||(j=[]):(j=j||[]).push(ze,null));for(ze in E){var Ae=E[ze];if(me=P!=null?P[ze]:void 0,E.hasOwnProperty(ze)&&Ae!==me&&(Ae!=null||me!=null))if(ze==="style")if(me){for(X in me)!me.hasOwnProperty(X)||Ae&&Ae.hasOwnProperty(X)||(m||(m={}),m[X]="");for(X in Ae)Ae.hasOwnProperty(X)&&me[X]!==Ae[X]&&(m||(m={}),m[X]=Ae[X])}else m||(j||(j=[]),j.push(ze,m)),m=Ae;else ze==="dangerouslySetInnerHTML"?(Ae=Ae?Ae.__html:void 0,me=me?me.__html:void 0,Ae!=null&&me!==Ae&&(j=j||[]).push(ze,Ae)):ze==="children"?typeof Ae!="string"&&typeof Ae!="number"||(j=j||[]).push(ze,""+Ae):ze!=="suppressContentEditableWarning"&&ze!=="suppressHydrationWarning"&&(s.hasOwnProperty(ze)?(Ae!=null&&ze==="onScroll"&&_n("scroll",l),j||me===Ae||(j=[])):(j=j||[]).push(ze,Ae))}m&&(j=j||[]).push("style",m);var ze=j;(d.updateQueue=ze)&&(d.flags|=4)}},Sk=function(l,d,m,E){m!==E&&(d.flags|=4)};function md(l,d){if(!Rn)switch(l.tailMode){case"hidden":d=l.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var E=null;m!==null;)m.alternate!==null&&(E=m),m=m.sibling;E===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:E.sibling=null}}function Wr(l){var d=l.alternate!==null&&l.alternate.child===l.child,m=0,E=0;if(d)for(var P=l.child;P!==null;)m|=P.lanes|P.childLanes,E|=P.subtreeFlags&14680064,E|=P.flags&14680064,P.return=l,P=P.sibling;else for(P=l.child;P!==null;)m|=P.lanes|P.childLanes,E|=P.subtreeFlags,E|=P.flags,P.return=l,P=P.sibling;return l.subtreeFlags|=E,l.childLanes=m,d}function AM(l,d,m){var E=d.pendingProps;switch(Wy(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wr(d),null;case 1:return Cs(d.type)&&Nh(),Wr(d),null;case 3:return E=d.stateNode,Rc(),Dn(Es),Dn(Vr),s0(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(l===null||l.child===null)&&(zh(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,wo!==null&&(R0(wo),wo=null))),x0(l,d),Wr(d),null;case 5:n0(d);var P=gl(ud.current);if(m=d.type,l!==null&&d.stateNode!=null)kk(l,d,m,E,P),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!E){if(d.stateNode===null)throw Error(n(166));return Wr(d),null}if(l=gl(Wo.current),zh(d)){E=d.stateNode,m=d.type;var j=d.memoizedProps;switch(E[Ho]=d,E[od]=j,l=(d.mode&1)!==0,m){case"dialog":_n("cancel",E),_n("close",E);break;case"iframe":case"object":case"embed":_n("load",E);break;case"video":case"audio":for(P=0;P<\/script>",l=l.removeChild(l.firstChild)):typeof E.is=="string"?l=X.createElement(m,{is:E.is}):(l=X.createElement(m),m==="select"&&(X=l,E.multiple?X.multiple=!0:E.size&&(X.size=E.size))):l=X.createElementNS(l,m),l[Ho]=d,l[od]=E,xk(l,d,!1,!1),d.stateNode=l;e:{switch(X=nt(m,E),m){case"dialog":_n("cancel",l),_n("close",l),P=E;break;case"iframe":case"object":case"embed":_n("load",l),P=E;break;case"video":case"audio":for(P=0;Pjc&&(d.flags|=128,E=!0,md(j,!1),d.lanes=4194304)}else{if(!E)if(l=Kh(X),l!==null){if(d.flags|=128,E=!0,m=l.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),md(j,!0),j.tail===null&&j.tailMode==="hidden"&&!X.alternate&&!Rn)return Wr(d),null}else 2*En()-j.renderingStartTime>jc&&m!==1073741824&&(d.flags|=128,E=!0,md(j,!1),d.lanes=4194304);j.isBackwards?(X.sibling=d.child,d.child=X):(m=j.last,m!==null?m.sibling=X:d.child=X,j.last=X)}return j.tail!==null?(d=j.tail,j.rendering=d,j.tail=d.sibling,j.renderingStartTime=En(),d.sibling=null,m=zn.current,Sn(zn,E?m&1|2:m&1),d):(Wr(d),null);case 22:case 23:return L0(),E=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==E&&(d.flags|=8192),E&&(d.mode&1)!==0?($s&1073741824)!==0&&(Wr(d),d.subtreeFlags&6&&(d.flags|=8192)):Wr(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function _M(l,d){switch(Wy(d),d.tag){case 1:return Cs(d.type)&&Nh(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Rc(),Dn(Es),Dn(Vr),s0(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return n0(d),null;case 13:if(Dn(zn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Bc()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Dn(zn),null;case 4:return Rc(),null;case 10:return Xy(d.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var rp=!1,qr=!1,DM=typeof WeakSet=="function"?WeakSet:Set,gt=null;function Lc(l,d){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(E){Jn(l,d,E)}else m.current=null}function k0(l,d,m){try{m()}catch(E){Jn(l,d,E)}}var Ak=!1;function TM(l,d){if(Ly=hn,l=ss(),os(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var E=m.getSelection&&m.getSelection();if(E&&E.rangeCount!==0){m=E.anchorNode;var P=E.anchorOffset,j=E.focusNode;E=E.focusOffset;try{m.nodeType,j.nodeType}catch{m=null;break e}var X=0,me=-1,Ae=-1,ze=0,et=0,tt=l,Je=null;t:for(;;){for(var ht;tt!==m||P!==0&&tt.nodeType!==3||(me=X+P),tt!==j||E!==0&&tt.nodeType!==3||(Ae=X+E),tt.nodeType===3&&(X+=tt.nodeValue.length),(ht=tt.firstChild)!==null;)Je=tt,tt=ht;for(;;){if(tt===l)break t;if(Je===m&&++ze===P&&(me=X),Je===j&&++et===E&&(Ae=X),(ht=tt.nextSibling)!==null)break;tt=Je,Je=tt.parentNode}tt=ht}m=me===-1||Ae===-1?null:{start:me,end:Ae}}else m=null}m=m||{start:0,end:0}}else m=null;for(Ny={focusedElem:l,selectionRange:m},hn=!1,gt=d;gt!==null;)if(d=gt,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,gt=l;else for(;gt!==null;){d=gt;try{var bt=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(bt!==null){var wt=bt.memoizedProps,sr=bt.memoizedState,Re=d.stateNode,De=Re.getSnapshotBeforeUpdate(d.elementType===d.type?wt:Eo(d.type,wt),sr);Re.__reactInternalSnapshotBeforeUpdate=De}break;case 3:var je=d.stateNode.containerInfo;je.nodeType===1?je.textContent="":je.nodeType===9&&je.documentElement&&je.removeChild(je.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(it){Jn(d,d.return,it)}if(l=d.sibling,l!==null){l.return=d.return,gt=l;break}gt=d.return}return bt=Ak,Ak=!1,bt}function gd(l,d,m){var E=d.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var P=E=E.next;do{if((P.tag&l)===l){var j=P.destroy;P.destroy=void 0,j!==void 0&&k0(d,m,j)}P=P.next}while(P!==E)}}function sp(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var m=d=d.next;do{if((m.tag&l)===l){var E=m.create;m.destroy=E()}m=m.next}while(m!==d)}}function S0(l){var d=l.ref;if(d!==null){var m=l.stateNode;switch(l.tag){case 5:l=m;break;default:l=m}typeof d=="function"?d(l):d.current=l}}function _k(l){var d=l.alternate;d!==null&&(l.alternate=null,_k(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Ho],delete d[od],delete d[Uy],delete d[dM],delete d[fM])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Dk(l){return l.tag===5||l.tag===3||l.tag===4}function Tk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Dk(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function A0(l,d,m){var E=l.tag;if(E===5||E===6)l=l.stateNode,d?m.nodeType===8?m.parentNode.insertBefore(l,d):m.insertBefore(l,d):(m.nodeType===8?(d=m.parentNode,d.insertBefore(l,m)):(d=m,d.appendChild(l)),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=Ih));else if(E!==4&&(l=l.child,l!==null))for(A0(l,d,m),l=l.sibling;l!==null;)A0(l,d,m),l=l.sibling}function _0(l,d,m){var E=l.tag;if(E===5||E===6)l=l.stateNode,d?m.insertBefore(l,d):m.appendChild(l);else if(E!==4&&(l=l.child,l!==null))for(_0(l,d,m),l=l.sibling;l!==null;)_0(l,d,m),l=l.sibling}var Ir=null,Co=!1;function ga(l,d,m){for(m=m.child;m!==null;)Bk(l,d,m),m=m.sibling}function Bk(l,d,m){if(ys&&typeof ys.onCommitFiberUnmount=="function")try{ys.onCommitFiberUnmount(Yi,m)}catch{}switch(m.tag){case 5:qr||Lc(m,d);case 6:var E=Ir,P=Co;Ir=null,ga(l,d,m),Ir=E,Co=P,Ir!==null&&(Co?(l=Ir,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):Ir.removeChild(m.stateNode));break;case 18:Ir!==null&&(Co?(l=Ir,m=m.stateNode,l.nodeType===8?$y(l.parentNode,m):l.nodeType===1&&$y(l,m),ia(l)):$y(Ir,m.stateNode));break;case 4:E=Ir,P=Co,Ir=m.stateNode.containerInfo,Co=!0,ga(l,d,m),Ir=E,Co=P;break;case 0:case 11:case 14:case 15:if(!qr&&(E=m.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){P=E=E.next;do{var j=P,X=j.destroy;j=j.tag,X!==void 0&&((j&2)!==0||(j&4)!==0)&&k0(m,d,X),P=P.next}while(P!==E)}ga(l,d,m);break;case 1:if(!qr&&(Lc(m,d),E=m.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=m.memoizedProps,E.state=m.memoizedState,E.componentWillUnmount()}catch(me){Jn(m,d,me)}ga(l,d,m);break;case 21:ga(l,d,m);break;case 22:m.mode&1?(qr=(E=qr)||m.memoizedState!==null,ga(l,d,m),qr=E):ga(l,d,m);break;default:ga(l,d,m)}}function Fk(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new DM),d.forEach(function(E){var P=jM.bind(null,l,E);m.has(E)||(m.add(E),E.then(P,P))})}}function xo(l,d){var m=d.deletions;if(m!==null)for(var E=0;EP&&(P=X),E&=~j}if(E=P,E=En()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*FM(E/1960))-E,10l?16:l,ba===null)var E=!1;else{if(l=ba,ba=null,cp=0,(Zt&6)!==0)throw Error(n(331));var P=Zt;for(Zt|=4,gt=l.current;gt!==null;){var j=gt,X=j.child;if((gt.flags&16)!==0){var me=j.deletions;if(me!==null){for(var Ae=0;AeEn()-B0?wl(l,0):T0|=m),Ss(l,d)}function Hk(l,d){d===0&&((l.mode&1)===0?d=1:(d=Qi,Qi<<=1,(Qi&130023424)===0&&(Qi=4194304)));var m=as();l=xi(l,d),l!==null&&(Ji(l,d,m),Ss(l,m))}function NM(l){var d=l.memoizedState,m=0;d!==null&&(m=d.retryLane),Hk(l,m)}function jM(l,d){var m=0;switch(l.tag){case 13:var E=l.stateNode,P=l.memoizedState;P!==null&&(m=P.retryLane);break;case 19:E=l.stateNode;break;default:throw Error(n(314))}E!==null&&E.delete(d),Hk(l,m)}var Wk;Wk=function(l,d,m){if(l!==null)if(l.memoizedProps!==d.pendingProps||Es.current)xs=!0;else{if((l.lanes&m)===0&&(d.flags&128)===0)return xs=!1,SM(l,d,m);xs=(l.flags&131072)!==0}else xs=!1,Rn&&(d.flags&1048576)!==0&&kx(d,Uh,d.index);switch(d.lanes=0,d.tag){case 2:var E=d.type;np(l,d),l=d.pendingProps;var P=_c(d,Vr.current);Mc(d,m),P=a0(null,d,E,l,P,m);var j=l0();return d.flags|=1,typeof P=="object"&&P!==null&&typeof P.render=="function"&&P.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Cs(E)?(j=!0,jh(d)):j=!1,d.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,e0(d),P.updater=ep,d.stateNode=P,P._reactInternals=d,p0(d,E,l,m),d=b0(null,d,E,!0,j,m)):(d.tag=0,Rn&&j&&Hy(d),is(null,d,P,m),d=d.child),d;case 16:E=d.elementType;e:{switch(np(l,d),l=d.pendingProps,P=E._init,E=P(E._payload),d.type=E,P=d.tag=$M(E),l=Eo(E,l),P){case 0:d=y0(null,d,E,l,m);break e;case 1:d=yk(null,d,E,l,m);break e;case 11:d=fk(null,d,E,l,m);break e;case 14:d=hk(null,d,E,Eo(E.type,l),m);break e}throw Error(n(306,E,""))}return d;case 0:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Eo(E,P),y0(l,d,E,P,m);case 1:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Eo(E,P),yk(l,d,E,P,m);case 3:e:{if(bk(d),l===null)throw Error(n(387));E=d.pendingProps,j=d.memoizedState,P=j.element,Mx(l,d),Gh(d,E,null,m);var X=d.memoizedState;if(E=X.element,j.isDehydrated)if(j={element:E,isDehydrated:!1,cache:X.cache,pendingSuspenseBoundaries:X.pendingSuspenseBoundaries,transitions:X.transitions},d.updateQueue.baseState=j,d.memoizedState=j,d.flags&256){P=Ic(Error(n(423)),d),d=vk(l,d,E,m,P);break e}else if(E!==P){P=Ic(Error(n(424)),d),d=vk(l,d,E,m,P);break e}else for(Os=ua(d.stateNode.containerInfo.firstChild),js=d,Rn=!0,wo=null,m=Fx(d,null,E,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Bc(),E===P){d=Si(l,d,m);break e}is(l,d,E,m)}d=d.child}return d;case 5:return Lx(d),l===null&&Gy(d),E=d.type,P=d.pendingProps,j=l!==null?l.memoizedProps:null,X=P.children,jy(E,P)?X=null:j!==null&&jy(E,j)&&(d.flags|=32),gk(l,d),is(l,d,X,m),d.child;case 6:return l===null&&Gy(d),null;case 13:return wk(l,d,m);case 4:return t0(d,d.stateNode.containerInfo),E=d.pendingProps,l===null?d.child=Fc(d,null,E,m):is(l,d,E,m),d.child;case 11:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Eo(E,P),fk(l,d,E,P,m);case 7:return is(l,d,d.pendingProps,m),d.child;case 8:return is(l,d,d.pendingProps.children,m),d.child;case 12:return is(l,d,d.pendingProps.children,m),d.child;case 10:e:{if(E=d.type._context,P=d.pendingProps,j=d.memoizedProps,X=P.value,Sn(Hh,E._currentValue),E._currentValue=X,j!==null)if(Cn(j.value,X)){if(j.children===P.children&&!Es.current){d=Si(l,d,m);break e}}else for(j=d.child,j!==null&&(j.return=d);j!==null;){var me=j.dependencies;if(me!==null){X=j.child;for(var Ae=me.firstContext;Ae!==null;){if(Ae.context===E){if(j.tag===1){Ae=ki(-1,m&-m),Ae.tag=2;var ze=j.updateQueue;if(ze!==null){ze=ze.shared;var et=ze.pending;et===null?Ae.next=Ae:(Ae.next=et.next,et.next=Ae),ze.pending=Ae}}j.lanes|=m,Ae=j.alternate,Ae!==null&&(Ae.lanes|=m),Jy(j.return,m,d),me.lanes|=m;break}Ae=Ae.next}}else if(j.tag===10)X=j.type===d.type?null:j.child;else if(j.tag===18){if(X=j.return,X===null)throw Error(n(341));X.lanes|=m,me=X.alternate,me!==null&&(me.lanes|=m),Jy(X,m,d),X=j.sibling}else X=j.child;if(X!==null)X.return=j;else for(X=j;X!==null;){if(X===d){X=null;break}if(j=X.sibling,j!==null){j.return=X.return,X=j;break}X=X.return}j=X}is(l,d,P.children,m),d=d.child}return d;case 9:return P=d.type,E=d.pendingProps.children,Mc(d,m),P=to(P),E=E(P),d.flags|=1,is(l,d,E,m),d.child;case 14:return E=d.type,P=Eo(E,d.pendingProps),P=Eo(E.type,P),hk(l,d,E,P,m);case 15:return pk(l,d,d.type,d.pendingProps,m);case 17:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Eo(E,P),np(l,d),d.tag=1,Cs(E)?(l=!0,jh(d)):l=!1,Mc(d,m),ok(d,E,P),p0(d,E,P,m),b0(null,d,E,!0,l,m);case 19:return Ck(l,d,m);case 22:return mk(l,d,m)}throw Error(n(156,d.tag))};function qk(l,d){return tr(l,d)}function OM(l,d,m,E){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function so(l,d,m,E){return new OM(l,d,m,E)}function j0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function $M(l){if(typeof l=="function")return j0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===U)return 14}return 2}function Ea(l,d){var m=l.alternate;return m===null?(m=so(l.tag,d,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=d,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,d=l.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function hp(l,d,m,E,P,j){var X=2;if(E=l,typeof l=="function")j0(l)&&(X=1);else if(typeof l=="string")X=5;else e:switch(l){case N:return Cl(m.children,P,j,d);case k:X=8,P|=8;break;case _:return l=so(12,m,d,P|2),l.elementType=_,l.lanes=j,l;case $:return l=so(13,m,d,P),l.elementType=$,l.lanes=j,l;case z:return l=so(19,m,d,P),l.elementType=z,l.lanes=j,l;case H:return pp(m,P,j,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case B:X=10;break e;case R:X=9;break e;case L:X=11;break e;case U:X=14;break e;case K:X=16,E=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=so(X,m,d,P),d.elementType=l,d.type=E,d.lanes=j,d}function Cl(l,d,m,E){return l=so(7,l,E,d),l.lanes=m,l}function pp(l,d,m,E){return l=so(22,l,E,d),l.elementType=H,l.lanes=m,l.stateNode={isHidden:!1},l}function O0(l,d,m){return l=so(6,l,null,d),l.lanes=m,l}function $0(l,d,m){return d=so(4,l.children!==null?l.children:[],l.key,d),d.lanes=m,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function UM(l,d,m,E,P){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qu(0),this.expirationTimes=qu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qu(0),this.identifierPrefix=E,this.onRecoverableError=P,this.mutableSourceEagerHydrationData=null}function U0(l,d,m,E,P,j,X,me,Ae){return l=new UM(l,d,m,me,Ae),d===1?(d=1,j===!0&&(d|=8)):d=0,j=so(3,null,null,d),l.current=j,j.stateNode=l,j.memoizedState={element:E,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},e0(j),l}function zM(l,d,m){var E=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),K0.exports=rR(),K0.exports}var lS;function sR(){if(lS)return Cp;lS=1;var e=YD();return Cp.createRoot=e.createRoot,Cp.hydrateRoot=e.hydrateRoot,Cp}var oR=sR();/** * react-router v7.10.1 * * Copyright (c) Remix Software Inc. @@ -47,19 +47,19 @@ Error generating stack: `+j.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */var cS="popstate";function iR(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return Sv("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Cf(s)}return lR(t,n,null,e)}function Ln(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ws(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aR(){return Math.random().toString(36).substring(2,10)}function uS(e,t){return{usr:e.state,key:e.key,idx:t}}function Sv(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?xu(t):t,state:n,key:t&&t.key||r||aR()}}function Cf({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function xu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function lR(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a="POP",c=null,u=f();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function f(){return(i.state||{idx:null}).idx}function h(){a="POP";let w=f(),C=w==null?null:w-u;u=w,c&&c({action:a,location:b.location,delta:C})}function p(w,C){a="PUSH";let v=Sv(b.location,w,C);u=f()+1;let x=uS(v,u),_=b.createHref(v);try{i.pushState(x,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(_)}o&&c&&c({action:a,location:b.location,delta:1})}function g(w,C){a="REPLACE";let v=Sv(b.location,w,C);u=f();let x=uS(v,u),_=b.createHref(v);i.replaceState(x,"",_),o&&c&&c({action:a,location:b.location,delta:0})}function y(w){return cR(w)}let b={get action(){return a},get location(){return e(s,i)},listen(w){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(cS,h),c=w,()=>{s.removeEventListener(cS,h),c=null}},createHref(w){return t(s,w)},createURL:y,encodeLocation(w){let C=y(w);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(w){return i.go(w)}};return b}function cR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ln(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Cf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function QD(e,t,n="/"){return uR(e,t,n,!1)}function uR(e,t,n,r){let s=typeof t=="string"?xu(t):t,o=$i(s.pathname||"/",n);if(o==null)return null;let i=XD(e);dR(i);let a=null;for(let c=0;a==null&&c{let f={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&c)return;Ln(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let h=Ri([r,f.relativePath]),p=n.concat(f);i.children&&i.children.length>0&&(Ln(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),XD(i.children,t,p,h,c)),!(i.path==null&&!i.index)&&t.push({path:h,score:bR(h,i.index),routesMeta:p})};return e.forEach((i,a)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))o(i,a);else for(let u of JD(i.path))o(i,a,!0,u)}),t}function JD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=JD(r.join("/")),a=[];return a.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function dR(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vR(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var fR=/^:[\w-]+$/,hR=3,pR=2,mR=1,gR=10,yR=-2,dS=e=>e==="*";function bR(e,t){let n=e.split("/"),r=n.length;return n.some(dS)&&(r+=yR),t&&(r+=pR),n.filter(s=>!dS(s)).reduce((s,o)=>s+(fR.test(o)?hR:o===""?mR:gR),r)}function vR(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function wR(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a{if(f==="*"){let y=a[p]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[p];return h&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function ER(e,t=!1,n=!0){Ws(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function CR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ws(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function $i(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var xR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kR=e=>xR.test(e);function SR(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?xu(e):e,o;if(n)if(kR(n))o=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ws(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?o=fS(n.substring(1),"/"):o=fS(n,t)}else o=t;return{pathname:o,search:DR(r),hash:TR(s)}}function fS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function X0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function AR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function z2(e){let t=AR(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function V2(e,t,n,r=!1){let s;typeof e=="string"?s=xu(e):(s={...e},Ln(!s.pathname||!s.pathname.includes("?"),X0("?","pathname","search",s)),Ln(!s.pathname||!s.pathname.includes("#"),X0("#","pathname","hash",s)),Ln(!s.search||!s.search.includes("#"),X0("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=n;else{let h=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),h-=1;s.pathname=p.join("/")}a=h>=0?t[h]:"/"}let c=SR(s,a),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}var Ri=e=>e.join("/").replace(/\/\/+/g,"/"),_R=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,TR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function FR(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ZD=["POST","PUT","PATCH","DELETE"];new Set(ZD);var PR=["GET",...ZD];new Set(PR);var ku=F.createContext(null);ku.displayName="DataRouter";var Ng=F.createContext(null);Ng.displayName="DataRouterState";F.createContext(!1);var e6=F.createContext({isTransitioning:!1});e6.displayName="ViewTransition";var MR=F.createContext(new Map);MR.displayName="Fetchers";var RR=F.createContext(null);RR.displayName="Await";var go=F.createContext(null);go.displayName="Navigation";var jf=F.createContext(null);jf.displayName="Location";var di=F.createContext({outlet:null,matches:[],isDataRoute:!1});di.displayName="Route";var H2=F.createContext(null);H2.displayName="RouteError";function IR(e,{relative:t}={}){Ln(Su(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=F.useContext(go),{hash:s,pathname:o,search:i}=$f(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Ri([n,o])),r.createHref({pathname:a,search:i,hash:s})}function Su(){return F.useContext(jf)!=null}function yo(){return Ln(Su(),"useLocation() may be used only in the context of a component."),F.useContext(jf).location}var t6="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function n6(e){F.useContext(go).static||F.useLayoutEffect(e)}function Of(){let{isDataRoute:e}=F.useContext(di);return e?KR():LR()}function LR(){Ln(Su(),"useNavigate() may be used only in the context of a component.");let e=F.useContext(ku),{basename:t,navigator:n}=F.useContext(go),{matches:r}=F.useContext(di),{pathname:s}=yo(),o=JSON.stringify(z2(r)),i=F.useRef(!1);return n6(()=>{i.current=!0}),F.useCallback((c,u={})=>{if(Ws(i.current,t6),!i.current)return;if(typeof c=="number"){n.go(c);return}let f=V2(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ri([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}F.createContext(null);function $f(e,{relative:t}={}){let{matches:n}=F.useContext(di),{pathname:r}=yo(),s=JSON.stringify(z2(n));return F.useMemo(()=>V2(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function NR(e,t){return r6(e,t)}function r6(e,t,n,r,s){var v;Ln(Su(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=F.useContext(go),{matches:i}=F.useContext(di),a=i[i.length-1],c=a?a.params:{},u=a?a.pathname:"/",f=a?a.pathnameBase:"/",h=a&&a.route;{let x=h&&h.path||"";s6(u,!h||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + */var cS="popstate";function iR(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return Sv("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Cf(s)}return lR(t,n,null,e)}function Ln(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ws(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aR(){return Math.random().toString(36).substring(2,10)}function uS(e,t){return{usr:e.state,key:e.key,idx:t}}function Sv(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?xu(t):t,state:n,key:t&&t.key||r||aR()}}function Cf({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function xu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function lR(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a="POP",c=null,u=f();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function f(){return(i.state||{idx:null}).idx}function h(){a="POP";let w=f(),C=w==null?null:w-u;u=w,c&&c({action:a,location:b.location,delta:C})}function p(w,C){a="PUSH";let v=Sv(b.location,w,C);u=f()+1;let x=uS(v,u),A=b.createHref(v);try{i.pushState(x,"",A)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(A)}o&&c&&c({action:a,location:b.location,delta:1})}function g(w,C){a="REPLACE";let v=Sv(b.location,w,C);u=f();let x=uS(v,u),A=b.createHref(v);i.replaceState(x,"",A),o&&c&&c({action:a,location:b.location,delta:0})}function y(w){return cR(w)}let b={get action(){return a},get location(){return e(s,i)},listen(w){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(cS,h),c=w,()=>{s.removeEventListener(cS,h),c=null}},createHref(w){return t(s,w)},createURL:y,encodeLocation(w){let C=y(w);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(w){return i.go(w)}};return b}function cR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ln(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Cf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function QD(e,t,n="/"){return uR(e,t,n,!1)}function uR(e,t,n,r){let s=typeof t=="string"?xu(t):t,o=$i(s.pathname||"/",n);if(o==null)return null;let i=XD(e);dR(i);let a=null;for(let c=0;a==null&&c{let f={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&c)return;Ln(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let h=Ri([r,f.relativePath]),p=n.concat(f);i.children&&i.children.length>0&&(Ln(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),XD(i.children,t,p,h,c)),!(i.path==null&&!i.index)&&t.push({path:h,score:bR(h,i.index),routesMeta:p})};return e.forEach((i,a)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))o(i,a);else for(let u of JD(i.path))o(i,a,!0,u)}),t}function JD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=JD(r.join("/")),a=[];return a.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function dR(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vR(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var fR=/^:[\w-]+$/,hR=3,pR=2,mR=1,gR=10,yR=-2,dS=e=>e==="*";function bR(e,t){let n=e.split("/"),r=n.length;return n.some(dS)&&(r+=yR),t&&(r+=pR),n.filter(s=>!dS(s)).reduce((s,o)=>s+(fR.test(o)?hR:o===""?mR:gR),r)}function vR(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function wR(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a{if(f==="*"){let y=a[p]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[p];return h&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function ER(e,t=!1,n=!0){Ws(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function CR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ws(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function $i(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var xR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kR=e=>xR.test(e);function SR(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?xu(e):e,o;if(n)if(kR(n))o=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ws(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?o=fS(n.substring(1),"/"):o=fS(n,t)}else o=t;return{pathname:o,search:DR(r),hash:TR(s)}}function fS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function X0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function AR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function z2(e){let t=AR(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function V2(e,t,n,r=!1){let s;typeof e=="string"?s=xu(e):(s={...e},Ln(!s.pathname||!s.pathname.includes("?"),X0("?","pathname","search",s)),Ln(!s.pathname||!s.pathname.includes("#"),X0("#","pathname","hash",s)),Ln(!s.search||!s.search.includes("#"),X0("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=n;else{let h=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),h-=1;s.pathname=p.join("/")}a=h>=0?t[h]:"/"}let c=SR(s,a),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}var Ri=e=>e.join("/").replace(/\/\/+/g,"/"),_R=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,TR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function FR(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ZD=["POST","PUT","PATCH","DELETE"];new Set(ZD);var PR=["GET",...ZD];new Set(PR);var ku=T.createContext(null);ku.displayName="DataRouter";var Ng=T.createContext(null);Ng.displayName="DataRouterState";T.createContext(!1);var e6=T.createContext({isTransitioning:!1});e6.displayName="ViewTransition";var MR=T.createContext(new Map);MR.displayName="Fetchers";var RR=T.createContext(null);RR.displayName="Await";var go=T.createContext(null);go.displayName="Navigation";var jf=T.createContext(null);jf.displayName="Location";var di=T.createContext({outlet:null,matches:[],isDataRoute:!1});di.displayName="Route";var H2=T.createContext(null);H2.displayName="RouteError";function IR(e,{relative:t}={}){Ln(Su(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=T.useContext(go),{hash:s,pathname:o,search:i}=$f(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Ri([n,o])),r.createHref({pathname:a,search:i,hash:s})}function Su(){return T.useContext(jf)!=null}function yo(){return Ln(Su(),"useLocation() may be used only in the context of a component."),T.useContext(jf).location}var t6="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function n6(e){T.useContext(go).static||T.useLayoutEffect(e)}function Of(){let{isDataRoute:e}=T.useContext(di);return e?KR():LR()}function LR(){Ln(Su(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(ku),{basename:t,navigator:n}=T.useContext(go),{matches:r}=T.useContext(di),{pathname:s}=yo(),o=JSON.stringify(z2(r)),i=T.useRef(!1);return n6(()=>{i.current=!0}),T.useCallback((c,u={})=>{if(Ws(i.current,t6),!i.current)return;if(typeof c=="number"){n.go(c);return}let f=V2(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ri([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}T.createContext(null);function $f(e,{relative:t}={}){let{matches:n}=T.useContext(di),{pathname:r}=yo(),s=JSON.stringify(z2(n));return T.useMemo(()=>V2(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function NR(e,t){return r6(e,t)}function r6(e,t,n,r,s){var v;Ln(Su(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=T.useContext(go),{matches:i}=T.useContext(di),a=i[i.length-1],c=a?a.params:{},u=a?a.pathname:"/",f=a?a.pathnameBase:"/",h=a&&a.route;{let x=h&&h.path||"";s6(u,!h||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let p=yo(),g;if(t){let x=typeof t=="string"?xu(t):t;Ln(f==="/"||((v=x.pathname)==null?void 0:v.startsWith(f)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${x.pathname}" was given in the \`location\` prop.`),g=x}else g=p;let y=g.pathname||"/",b=y;if(f!=="/"){let x=f.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(x.length).join("/")}let w=QD(e,{pathname:b});Ws(h||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ws(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let C=zR(w&&w.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Ri([f,o.encodeLocation?o.encodeLocation(x.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?f:Ri([f,o.encodeLocation?o.encodeLocation(x.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),i,n,r,s);return t&&C?F.createElement(jf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},C):C}function jR(){let e=GR(),t=BR(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=F.createElement(F.Fragment,null,F.createElement("p",null,"💿 Hey developer 👋"),F.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",F.createElement("code",{style:o},"ErrorBoundary")," or"," ",F.createElement("code",{style:o},"errorElement")," prop on your route.")),F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},t),n?F.createElement("pre",{style:s},n):null,i)}var OR=F.createElement(jR,null),$R=class extends F.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?F.createElement(di.Provider,{value:this.props.routeContext},F.createElement(H2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function UR({routeContext:e,match:t,children:n}){let r=F.useContext(ku);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),F.createElement(di.Provider,{value:e},n)}function zR(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let f=o.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);Ln(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,f+1))}let a=!1,c=-1;if(n)for(let f=0;f=0?o=o.slice(0,c+1):o=[o[0]];break}}}let u=n&&r?(f,h)=>{var p,g;r(f,{location:n.location,params:((g=(p=n.matches)==null?void 0:p[0])==null?void 0:g.params)??{},unstable_pattern:FR(n.matches),errorInfo:h})}:void 0;return o.reduceRight((f,h,p)=>{let g,y=!1,b=null,w=null;n&&(g=i&&h.route.id?i[h.route.id]:void 0,b=h.route.errorElement||OR,a&&(c<0&&p===0?(s6("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,w=null):c===p&&(y=!0,w=h.route.hydrateFallbackElement||null)));let C=t.concat(o.slice(0,p+1)),v=()=>{let x;return g?x=b:y?x=w:h.route.Component?x=F.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=f,F.createElement(UR,{match:h,routeContext:{outlet:f,matches:C,isDataRoute:n!=null},children:x})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?F.createElement($R,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:v(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:u}):v()},null)}function W2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VR(e){let t=F.useContext(ku);return Ln(t,W2(e)),t}function HR(e){let t=F.useContext(Ng);return Ln(t,W2(e)),t}function WR(e){let t=F.useContext(di);return Ln(t,W2(e)),t}function q2(e){let t=WR(e),n=t.matches[t.matches.length-1];return Ln(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function qR(){return q2("useRouteId")}function GR(){var r;let e=F.useContext(H2),t=HR("useRouteError"),n=q2("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function KR(){let{router:e}=VR("useNavigate"),t=q2("useNavigate"),n=F.useRef(!1);return n6(()=>{n.current=!0}),F.useCallback(async(s,o={})=>{Ws(n.current,t6),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var hS={};function s6(e,t,n){!t&&!hS[e]&&(hS[e]=!0,Ws(!1,n))}F.memo(YR);function YR({routes:e,future:t,state:n,unstable_onError:r}){return r6(e,void 0,n,r,t)}function QR({to:e,replace:t,state:n,relative:r}){Ln(Su()," may be used only in the context of a component.");let{static:s}=F.useContext(go);Ws(!s," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:o}=F.useContext(di),{pathname:i}=yo(),a=Of(),c=V2(e,z2(o),i,r==="path"),u=JSON.stringify(c);return F.useEffect(()=>{a(JSON.parse(u),{replace:t,state:n,relative:r})},[a,u,r,t,n]),null}function Dr(e){Ln(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function XR({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,unstable_useTransitions:i}){Ln(!Su(),"You cannot render a inside another . You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=F.useMemo(()=>({basename:a,navigator:s,static:o,unstable_useTransitions:i,future:{}}),[a,s,o,i]);typeof n=="string"&&(n=xu(n));let{pathname:u="/",search:f="",hash:h="",state:p=null,key:g="default"}=n,y=F.useMemo(()=>{let b=$i(u,a);return b==null?null:{location:{pathname:b,search:f,hash:h,state:p,key:g},navigationType:r}},[a,u,f,h,p,g,r]);return Ws(y!=null,` is not able to match the URL "${u}${f}${h}" because it does not start with the basename, so the won't render anything.`),y==null?null:F.createElement(go.Provider,{value:c},F.createElement(jf.Provider,{children:t,value:y}))}function pS({children:e,location:t}){return NR(Av(e),t)}function Av(e,t=[]){let n=[];return F.Children.forEach(e,(r,s)=>{if(!F.isValidElement(r))return;let o=[...t,s];if(r.type===F.Fragment){n.push.apply(n,Av(r.props.children,o));return}Ln(r.type===Dr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Ln(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Av(r.props.children,o)),n.push(i)}),n}var bm="get",vm="application/x-www-form-urlencoded";function jg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function JR(e){return jg(e)&&e.tagName.toLowerCase()==="button"}function ZR(e){return jg(e)&&e.tagName.toLowerCase()==="form"}function e7(e){return jg(e)&&e.tagName.toLowerCase()==="input"}function t7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function n7(e,t){return e.button===0&&(!t||t==="_self")&&!t7(e)}function _v(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function r7(e,t){let n=_v(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var xp=null;function s7(){if(xp===null)try{new FormData(document.createElement("form"),0),xp=!1}catch{xp=!0}return xp}var o7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function J0(e){return e!=null&&!o7.has(e)?(Ws(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${vm}"`),null):e}function i7(e,t){let n,r,s,o,i;if(ZR(e)){let a=e.getAttribute("action");r=a?$i(a,t):null,n=e.getAttribute("method")||bm,s=J0(e.getAttribute("enctype"))||vm,o=new FormData(e)}else if(JR(e)||e7(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a