diff --git a/frontend/dist/VERSION b/frontend/dist/VERSION index ec96785b..63b433d1 100644 --- a/frontend/dist/VERSION +++ b/frontend/dist/VERSION @@ -1 +1 @@ -0.9.335 +0.9.336 diff --git a/frontend/dist/assets/AnalyzerFilterPanel-CBecqjNU.js b/frontend/dist/assets/AnalyzerFilterPanel-CwOmGxBn.js similarity index 98% rename from frontend/dist/assets/AnalyzerFilterPanel-CBecqjNU.js rename to frontend/dist/assets/AnalyzerFilterPanel-CwOmGxBn.js index f1e9ab65..088b8ad7 100644 --- a/frontend/dist/assets/AnalyzerFilterPanel-CBecqjNU.js +++ b/frontend/dist/assets/AnalyzerFilterPanel-CwOmGxBn.js @@ -1,4 +1,4 @@ -import{e as U,d0 as q,aq as G,R as J,cG as Q,cv as V,r as d,j as n,bK as K,B as Y}from"./index-C8J8z7Af.js";import{c as Z}from"./node-types-B5WxOxT2.js";import{C as W}from"./circle-question-mark-CD6FHJ5H.js";import{F as ee}from"./funnel-CRYMLc9L.js";import{S as te}from"./search-BO7ZBfwt.js";/** +import{e as U,d0 as q,aq as G,R as J,cG as Q,cv as V,r as d,j as n,bK as K,B as Y}from"./index-Dk8KEIKm.js";import{c as Z}from"./node-types-SdzDwn2r.js";import{C as W}from"./circle-question-mark-BNRkoCvq.js";import{F as ee}from"./funnel-B-Z6Air3.js";import{S as te}from"./search-DgakOYk2.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/AutoConfigureDialog-CVadgP9a.js b/frontend/dist/assets/AutoConfigureDialog-CH58tL57.js similarity index 98% rename from frontend/dist/assets/AutoConfigureDialog-CVadgP9a.js rename to frontend/dist/assets/AutoConfigureDialog-CH58tL57.js index 379313c9..6b0dcffd 100644 --- a/frontend/dist/assets/AutoConfigureDialog-CVadgP9a.js +++ b/frontend/dist/assets/AutoConfigureDialog-CH58tL57.js @@ -1 +1 @@ -import{r as f,en as X,j as e,f as K,R as Z,c3 as M,cv as G,cG as U,dv as V,eG as ee,ay as ae,aH as se,az as te,a6 as J,bX as ne,B as S,c as g,aB as le}from"./index-C8J8z7Af.js";import{C as ie}from"./PageLayout-D_1HzH-E.js";import{W as re}from"./wand-sparkles-CkPC71f7.js";import{A as oe}from"./arrow-right-D_4v2CeG.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 X();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(Z,{}),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(G,{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(G,{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(U,{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(U,{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,w={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 V("/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 Se({open:s,onClose:a,currentConfig:r,onApplied:c}){var H,C,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(S,{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:(H=x.tokenBucket)==null?void 0:H.bucket_capacity,recommended:d.tokenBucket.bucket_capacity,format:t=>`${t} tokens`}),e.jsx(u,{label:"Refill Tokens",current:(C=x.tokenBucket)==null?void 0:C.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:(z=x.penaltyBox)==null?void 0:z.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:($=x.adaptive)==null?void 0:$.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(S,{color:"primary",onClick:_,children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(S,{plain:!0,onClick:_,children:"Cancel"}),e.jsx(S,{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{Se as A,ke as N,ge as S,Ne as a}; +import{r as f,en as X,j as e,f as K,R as Z,c3 as M,cv as G,cG as U,dv as V,eG as ee,ay as ae,aH as se,az as te,a6 as J,bX as ne,B as S,c as g,aB as le}from"./index-Dk8KEIKm.js";import{C as ie}from"./PageLayout-CGcnsIyM.js";import{W as re}from"./wand-sparkles-Cfv_3ntm.js";import{A as oe}from"./arrow-right-vgcsVPr-.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 X();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(Z,{}),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(G,{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(G,{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(U,{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(U,{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,w={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 V("/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 Se({open:s,onClose:a,currentConfig:r,onApplied:c}){var H,C,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(S,{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:(H=x.tokenBucket)==null?void 0:H.bucket_capacity,recommended:d.tokenBucket.bucket_capacity,format:t=>`${t} tokens`}),e.jsx(u,{label:"Refill Tokens",current:(C=x.tokenBucket)==null?void 0:C.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:(z=x.penaltyBox)==null?void 0:z.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:($=x.adaptive)==null?void 0:$.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(S,{color:"primary",onClick:_,children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(S,{plain:!0,onClick:_,children:"Cancel"}),e.jsx(S,{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{Se as A,ke as N,ge as S,Ne as a}; diff --git a/frontend/dist/assets/BackupRestore-B5tynF_C.js b/frontend/dist/assets/BackupRestore-B0l04Qsd.js similarity index 95% rename from frontend/dist/assets/BackupRestore-B5tynF_C.js rename to frontend/dist/assets/BackupRestore-B0l04Qsd.js index cbf92b8e..528e18e8 100644 --- a/frontend/dist/assets/BackupRestore-B5tynF_C.js +++ b/frontend/dist/assets/BackupRestore-B0l04Qsd.js @@ -1 +1 @@ -import{r as p,j as e,aA as R,d6 as B,f as b,B as l}from"./index-C8J8z7Af.js";import{e as H,a as K,i as $}from"./backup-D2yaW6qB.js";import{P as D,a as q,B as Y,C as x}from"./PageLayout-D_1HzH-E.js";import{R as y,C as T}from"./Grid-CfYPlwSW.js";import{U as O}from"./upload-DE3acz7s.js";import{K as M}from"./key-round-C1SnbsaC.js";function W(t,n){const f=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),c=URL.createObjectURL(f),o=document.createElement("a");o.href=c,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(c)}function z(t,n){const f=new Blob([n],{type:"text/plain"}),c=URL.createObjectURL(f),o=document.createElement("a");o.href=c,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(c)}function U(t){var n;return String(((n=t==null?void 0:t.meta)==null?void 0:n.exported_at)||new Date().toISOString()).replace(/[:.]/g,"-")}function te(){var E,I;const[t,n]=p.useState(null),[f,c]=p.useState(!1),[o,w]=p.useState(!1),[a,h]=p.useState(null),[_,j]=p.useState(!1),[N,m]=p.useState(null),[v,d]=p.useState(null),k=p.useRef(null),C=window.location.protocol==="http:",F=p.useMemo(()=>a?Object.keys(a.config).join(", "):"",[a]),J=((E=a==null?void 0:a.meta)==null?void 0:E.includes_secrets)===!0||((I=a==null?void 0:a.meta)==null?void 0:I.includes_secrets)==="true",S=async s=>{n(s?"full":"settings"),d(null),m(null);try{const r=await H(s);if(!r.success||!r.data)throw new Error(r.error||"Export failed");W(s?`openhop-repeater-full-backup-${U(r.data)}.json`:`openhop-repeater-settings-${U(r.data)}.json`,r.data),m(s?"Full backup exported. Store it securely.":"Settings export downloaded with secrets redacted."),c(!1)}catch(r){d(r instanceof Error?r.message:"Export failed")}finally{n(null)}},L=async()=>{n("identity"),d(null),m(null);try{const s=await K();if(!s.success||!s.data)throw new Error(s.error||"Identity export failed");z(`openhop-identity-${s.data.node_address||"key"}.hex`,s.data.identity_key_hex),m(`Identity key exported (${s.data.key_length_bytes} bytes). Store it securely.`),w(!1)}catch(s){d(s instanceof Error?s.message:"Identity export failed")}finally{n(null)}},A=s=>{var g;const r=(g=s.target.files)==null?void 0:g[0];if(!r)return;d(null),m(null),h(null),j(!1);const i=new FileReader;i.onload=()=>{try{const u=JSON.parse(String(i.result));u&&typeof u=="object"&&!Array.isArray(u)?u.config&&typeof u.config=="object"?h({config:u.config,meta:u.meta}):h({config:u}):d("Invalid file format — expected a JSON object.")}catch{d("Invalid JSON file.")}},i.readAsText(r)},P=async()=>{var s,r;if(a){n("import"),d(null),m(null);try{const i=await $(a.config);if(!i.success)throw new Error(i.error||"Import failed");const g=(s=i.data)!=null&&s.restart_required?" A service restart is required for some changes.":"";m(((r=i.data)==null?void 0:r.message)||`Configuration imported.${g}`),h(null),j(!1),k.current&&(k.current.value="")}catch(i){d(i instanceof Error?i.message:"Import failed")}finally{n(null)}}};return e.jsxs(D,{children:[e.jsx(q,{title:"Backup / Restore",icon:e.jsx(R,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Export, import, and restore Repeater configuration with explicit secret warnings."})}),e.jsxs(Y,{ready:!0,children:[C&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"border border-sys-red/30",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(B,{className:"w-5 h-5 text-sys-red"}),e.jsx("p",{className:"type-body-sm text-sys-red",children:"This page is served over HTTP. Secret-bearing backups and identity keys are transmitted in plain text; only use this on a trusted local network."})]})})}),v&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-red",children:v})}),N&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-green",children:N})}),e.jsxs(y,{template:"standard",children:[e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(R,{}),title:"Export Settings"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads current configuration with passwords, JWT secrets, and identity keys redacted."}),e.jsx(l,{color:"primary",onClick:()=>S(!1),disabled:!!t,children:t==="settings"?"Exporting…":"Export Settings"})]})}),e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(B,{}),title:"Full Backup"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Includes passwords, JWT secrets, and identity keys. Store securely and never share."}),f?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting all secrets",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:()=>S(!0),disabled:!!t,children:t==="full"?"Exporting…":"Yes, Export Full Backup"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>c(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>c(!0),children:"Full Backup"})]})})]}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(O,{}),title:"Import Configuration"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Import a settings export or full backup. Restore requires confirmation and never auto-restarts the service."}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer bg-subtle-fill radius-card p-4 border border-edge-subtle",children:[e.jsx(O,{className:"w-5 h-5 text-sys-blue"}),e.jsx("span",{className:"type-body-sm text-fg-muted",children:"Choose JSON file…"}),e.jsx("input",{ref:k,type:"file",accept:".json,application/json",className:"hidden",onChange:A})]}),a&&e.jsxs("div",{className:"mt-4 bg-subtle-fill radius-card p-4",children:[e.jsx("p",{className:"type-body text-fg-primary",children:"Import preview"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mt-1",children:["Sections: ",e.jsx("span",{className:"type-code",children:F||"unknown"})]}),J&&e.jsx("p",{className:"type-body-sm text-sys-amber mt-2",children:"This full backup may overwrite passwords and identity keys."}),_?e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(l,{color:"warning",onClick:P,disabled:!!t,children:t==="import"?"Importing…":"Yes, Import"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>j(!1),disabled:!!t,children:"Cancel"})]}):e.jsx(l,{className:"mt-3",color:"warning",outline:!0,onClick:()=>j(!0),children:"Review & Import"})]})]})}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(M,{}),title:"Export Identity Key"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads the repeater private identity key as hex. Anyone with this key can impersonate your node."}),o?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting the private key",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:L,disabled:!!t,children:t==="identity"?"Exporting…":"Yes, Export Key"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>w(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>w(!0),children:"Export Identity Key"})]})})]})]})}export{te as default}; +import{r as p,j as e,aA as R,d6 as B,f as b,B as l}from"./index-Dk8KEIKm.js";import{e as H,a as K,i as $}from"./backup-CooFBfHx.js";import{P as D,a as q,B as Y,C as x}from"./PageLayout-CGcnsIyM.js";import{R as y,C as T}from"./Grid-CThL_TW5.js";import{U as O}from"./upload-L_Eq4fFX.js";import{K as M}from"./key-round-CDk8iwaD.js";function W(t,n){const f=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),c=URL.createObjectURL(f),o=document.createElement("a");o.href=c,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(c)}function z(t,n){const f=new Blob([n],{type:"text/plain"}),c=URL.createObjectURL(f),o=document.createElement("a");o.href=c,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(c)}function U(t){var n;return String(((n=t==null?void 0:t.meta)==null?void 0:n.exported_at)||new Date().toISOString()).replace(/[:.]/g,"-")}function te(){var E,I;const[t,n]=p.useState(null),[f,c]=p.useState(!1),[o,w]=p.useState(!1),[a,h]=p.useState(null),[_,j]=p.useState(!1),[N,m]=p.useState(null),[v,d]=p.useState(null),k=p.useRef(null),C=window.location.protocol==="http:",F=p.useMemo(()=>a?Object.keys(a.config).join(", "):"",[a]),J=((E=a==null?void 0:a.meta)==null?void 0:E.includes_secrets)===!0||((I=a==null?void 0:a.meta)==null?void 0:I.includes_secrets)==="true",S=async s=>{n(s?"full":"settings"),d(null),m(null);try{const r=await H(s);if(!r.success||!r.data)throw new Error(r.error||"Export failed");W(s?`openhop-repeater-full-backup-${U(r.data)}.json`:`openhop-repeater-settings-${U(r.data)}.json`,r.data),m(s?"Full backup exported. Store it securely.":"Settings export downloaded with secrets redacted."),c(!1)}catch(r){d(r instanceof Error?r.message:"Export failed")}finally{n(null)}},L=async()=>{n("identity"),d(null),m(null);try{const s=await K();if(!s.success||!s.data)throw new Error(s.error||"Identity export failed");z(`openhop-identity-${s.data.node_address||"key"}.hex`,s.data.identity_key_hex),m(`Identity key exported (${s.data.key_length_bytes} bytes). Store it securely.`),w(!1)}catch(s){d(s instanceof Error?s.message:"Identity export failed")}finally{n(null)}},A=s=>{var g;const r=(g=s.target.files)==null?void 0:g[0];if(!r)return;d(null),m(null),h(null),j(!1);const i=new FileReader;i.onload=()=>{try{const u=JSON.parse(String(i.result));u&&typeof u=="object"&&!Array.isArray(u)?u.config&&typeof u.config=="object"?h({config:u.config,meta:u.meta}):h({config:u}):d("Invalid file format — expected a JSON object.")}catch{d("Invalid JSON file.")}},i.readAsText(r)},P=async()=>{var s,r;if(a){n("import"),d(null),m(null);try{const i=await $(a.config);if(!i.success)throw new Error(i.error||"Import failed");const g=(s=i.data)!=null&&s.restart_required?" A service restart is required for some changes.":"";m(((r=i.data)==null?void 0:r.message)||`Configuration imported.${g}`),h(null),j(!1),k.current&&(k.current.value="")}catch(i){d(i instanceof Error?i.message:"Import failed")}finally{n(null)}}};return e.jsxs(D,{children:[e.jsx(q,{title:"Backup / Restore",icon:e.jsx(R,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Export, import, and restore Repeater configuration with explicit secret warnings."})}),e.jsxs(Y,{ready:!0,children:[C&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"border border-sys-red/30",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(B,{className:"w-5 h-5 text-sys-red"}),e.jsx("p",{className:"type-body-sm text-sys-red",children:"This page is served over HTTP. Secret-bearing backups and identity keys are transmitted in plain text; only use this on a trusted local network."})]})})}),v&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-red",children:v})}),N&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-green",children:N})}),e.jsxs(y,{template:"standard",children:[e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(R,{}),title:"Export Settings"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads current configuration with passwords, JWT secrets, and identity keys redacted."}),e.jsx(l,{color:"primary",onClick:()=>S(!1),disabled:!!t,children:t==="settings"?"Exporting…":"Export Settings"})]})}),e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(B,{}),title:"Full Backup"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Includes passwords, JWT secrets, and identity keys. Store securely and never share."}),f?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting all secrets",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:()=>S(!0),disabled:!!t,children:t==="full"?"Exporting…":"Yes, Export Full Backup"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>c(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>c(!0),children:"Full Backup"})]})})]}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(O,{}),title:"Import Configuration"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Import a settings export or full backup. Restore requires confirmation and never auto-restarts the service."}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer bg-subtle-fill radius-card p-4 border border-edge-subtle",children:[e.jsx(O,{className:"w-5 h-5 text-sys-blue"}),e.jsx("span",{className:"type-body-sm text-fg-muted",children:"Choose JSON file…"}),e.jsx("input",{ref:k,type:"file",accept:".json,application/json",className:"hidden",onChange:A})]}),a&&e.jsxs("div",{className:"mt-4 bg-subtle-fill radius-card p-4",children:[e.jsx("p",{className:"type-body text-fg-primary",children:"Import preview"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mt-1",children:["Sections: ",e.jsx("span",{className:"type-code",children:F||"unknown"})]}),J&&e.jsx("p",{className:"type-body-sm text-sys-amber mt-2",children:"This full backup may overwrite passwords and identity keys."}),_?e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(l,{color:"warning",onClick:P,disabled:!!t,children:t==="import"?"Importing…":"Yes, Import"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>j(!1),disabled:!!t,children:"Cancel"})]}):e.jsx(l,{className:"mt-3",color:"warning",outline:!0,onClick:()=>j(!0),children:"Review & Import"})]})]})}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(M,{}),title:"Export Identity Key"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads the repeater private identity key as hex. Anyone with this key can impersonate your node."}),o?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting the private key",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:L,disabled:!!t,children:t==="identity"?"Exporting…":"Yes, Export Key"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>w(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>w(!0),children:"Export Identity Key"})]})})]})]})}export{te as default}; diff --git a/frontend/dist/assets/BasemapLayer-BvoQWTC4.js b/frontend/dist/assets/BasemapLayer-snfcoHal.js similarity index 98% rename from frontend/dist/assets/BasemapLayer-BvoQWTC4.js rename to frontend/dist/assets/BasemapLayer-snfcoHal.js index 9476b6bf..8e51f300 100644 --- a/frontend/dist/assets/BasemapLayer-BvoQWTC4.js +++ b/frontend/dist/assets/BasemapLayer-snfcoHal.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C8J8z7Af.js","assets/index-CqhZhFJJ.css"])))=>i.map(i=>d[i]); -import{r as a,_ as H,b6 as D}from"./index-C8J8z7Af.js";const W=a.createContext(null);function B(){var s;const e=(s=a.useContext(W))==null?void 0:s.maps,n=a.useContext(x);return a.useMemo(()=>({...e,current:n==null?void 0:n.map}),[e,n])}function Z(e,n){const t=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(n)?n[0]:n?n.x:0,r=Array.isArray(n)?n[1]:n?n.y:0;return t===o&&s===r}function L(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=n[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const i of V)i in r&&(o[i]=r[i])}return o||s});return{...e,layers:t}}const O={version:8,sources:{},layers:[]},A={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},N={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},U={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},q=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],G=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class w{constructor(n,t,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[U[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||I(this._map.transform);const r=this.props[N[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=I(o),T(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[A[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._MapClass=n,this.props=t,this._initialize(s)}get map(){return this._map}setProps(n){const t=this.props;this.props=n;const s=this._updateSettings(n,t),o=this._updateSize(n),r=this._updateViewState(n);this._updateStyle(n,t),this._updateStyleComponents(n),this._updateHandlers(n,t),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(n,t){const s=w.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(t.className=r.className;r.childNodes.length>0;)t.appendChild(r.childNodes[0]);o._container=t;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(t)),s.setProps({...n,styleDiffing:!1}),o.resize();const{initialViewState:c}=n;return c&&(c.bounds?o.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):s._updateViewState(c)),o.isStyleLoaded()?o.fire("load"):o.once("style.load",()=>o.fire("load")),o._update(),s}_initialize(n){const{props:t}=this,{mapStyle:s=O}=t,o={...t,...t.initialViewState,container:n,style:z(s)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),t.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,t.gl)}const i=new this._MapClass(o);r.padding&&i.setPadding(r.padding),t.cursor&&(i.getCanvas().style.cursor=t.cursor),i.transformCameraUpdate=this._onCameraUpdate,i.on("style.load",()=>{var c;this._styleComponents={light:i.getLight(),sky:i.getSky(),projection:(c=i.getProjection)==null?void 0:c.call(i),terrain:i.getTerrain()},this._updateStyleComponents(this.props)}),i.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in A)i.on(c,this._onPointerEvent);for(const c in N)i.on(c,this._onCameraEvent);for(const c in U)i.on(c,this._onEvent);this._map=i}recycle(){const t=this.map.getContainer().querySelector("[mapboxgl-children]");t==null||t.remove(),w.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_updateSize(n){const{viewState:t}=n;if(t){const s=this._map;if(t.width!==s.transform.width||t.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(n){const t=this._map,s=t.transform;if(!t.isMoving()){const r=T(s,n);if(Object.keys(r).length>0)return this._internalUpdate=!0,t.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(n,t){const s=this._map;let o=!1;for(const r of q)if(r in n&&!L(n[r],t[r])){o=!0;const i=s[`set${r[0].toUpperCase()}${r.slice(1)}`];i==null||i.call(s,n[r])}return o}_updateStyle(n,t){if(n.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==t.mapStyle){const{mapStyle:s=O,styleDiffing:o=!0}=n,r={diff:o};"localIdeographFontFamily"in n&&(r.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(z(s),r)}}_updateStyleComponents({light:n,projection:t,sky:s,terrain:o}){var c,l;const r=this._map,i=this._styleComponents;r.style._loaded&&(n&&!L(n,i.light)&&(i.light=n,r.setLight(n)),t&&!L(t,i.projection)&&t!==((c=i.projection)==null?void 0:c.type)&&(i.projection=typeof t=="string"?{type:t}:t,(l=r.setProjection)==null||l.call(r,i.projection)),s&&!L(s,i.sky)&&(i.sky=s,r.setSky(s)),o!==void 0&&!L(o,i.terrain)&&(!o||r.getSource(o.source))&&(i.terrain=o,r.setTerrain(o)))}_updateHandlers(n,t){const s=this._map;for(const o of G){const r=n[o]??!0,i=t[o]??!0;L(r,i)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(n){const t=this._map,{interactiveLayerIds:s=[]}=this.props;try{return t.queryRenderedFeatures(n,{layers:s.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(n){var o;const{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){const r=n.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(n.point),l=c.length>0;!l&&i&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=c,l&&!i&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=r}else this._hoveredFeatures=null}}w.savedMaps=[];const $=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function J(e){if(!e)return null;const n=e.map,t={getMap:()=>n};for(const s of K(n))!(s in t)&&!$.includes(s)&&(t[s]=n[s].bind(n));return t}function K(e){const n=new Set;let t=e;for(;t;){for(const s of Object.getOwnPropertyNames(t))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&n.add(s);t=Object.getPrototypeOf(t)}return Array.from(n)}const Y=typeof document<"u"?a.useLayoutEffect:a.useEffect;function X(e,n){const{RTLTextPlugin:t,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=n;if(t&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:c=!0}=typeof t=="string"?{pluginUrl:t}:t;e.setRTLTextPlugin(i,l=>{l&&console.error(l)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const x=a.createContext(null);function Q(e,n){const t=a.useContext(W),[s,o]=a.useState(null),r=a.useRef(),{current:i}=a.useRef({mapLib:null,map:null});a.useEffect(()=>{const f=e.mapLib;let u=!0,d;return Promise.resolve(f||H(()=>import("./maplibre-gl-wPzyDBA-.js").then(h=>h.m),__vite__mapDeps([0,1]))).then(h=>{if(!u)return;if(!h)throw new Error("Invalid mapLib");const m="Map"in h?h:h.default;if(!m.Map)throw new Error("Invalid mapLib");X(m,e),e.reuseMaps&&(d=w.reuse(e,r.current)),d||(d=new w(m.Map,e,r.current)),i.map=J(d),i.mapLib=m,o(d),t==null||t.onMapMount(i.map,e.id)}).catch(h=>{const{onError:m}=e;m?m({type:"error",target:null,originalEvent:null,error:h}):console.error(h)}),()=>{u=!1,d&&(t==null||t.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Y(()=>{s&&s.setProps(e)}),a.useImperativeHandle(n,()=>i.map,[s]);const c=a.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),l={height:"100%"};return a.createElement("div",{id:e.id,ref:r,style:c},s&&a.createElement(x.Provider,{value:i},a.createElement("div",{"mapboxgl-children":"",style:l},e.children)))}const de=a.forwardRef(Q),ee=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function E(e,n){if(!e||!n)return;const t=e.style;for(const s in n){const o=n[s];Number.isFinite(o)&&!ee.test(s)?t[s]=`${o}px`:t[s]=o}}function j(e,n){if(e===n)return null;const t=F(e),s=F(n),o=[];for(const r of s)t.has(r)||o.push(r);for(const r of t)s.has(r)||o.push(r);return o.length===0?null:o}function F(e){return new Set(e?e.trim().split(/\s+/):[])}const me=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useRef({props:e}),r=a.useMemo(()=>{let b=!1;a.Children.forEach(e.children,p=>{p&&(b=!0)});const k={...e,element:b?document.createElement("div"):void 0},_=new s.Marker(k);return _.setLngLat([e.longitude,e.latitude]),_.getElement().addEventListener("click",p=>{var y,g;(g=(y=o.current.props).onClick)==null||g.call(y,{type:"click",target:_,originalEvent:p})}),_.on("dragstart",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragStart)==null||C.call(g,y)}),_.on("drag",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDrag)==null||C.call(g,y)}),_.on("dragend",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragEnd)==null||C.call(g,y)}),_},[]);a.useEffect(()=>(r.addTo(t.getMap()),()=>{r.remove()}),[]);const{longitude:i,latitude:c,offset:l,style:f,draggable:u=!1,popup:d=null,rotation:h=0,rotationAlignment:m="auto",pitchAlignment:v="auto"}=e;a.useEffect(()=>{E(r.getElement(),f)},[f]),a.useImperativeHandle(n,()=>r,[]);const S=o.current.props;(r.getLngLat().lng!==i||r.getLngLat().lat!==c)&&r.setLngLat([i,c]),l&&!Z(r.getOffset(),l)&&r.setOffset(l),r.isDraggable()!==u&&r.setDraggable(u),r.getRotation()!==h&&r.setRotation(h),r.getRotationAlignment()!==m&&r.setRotationAlignment(m),r.getPitchAlignment()!==v&&r.setPitchAlignment(v),r.getPopup()!==d&&r.setPopup(d);const R=j(S.className,e.className);if(R)for(const b of R)r.toggleClassName(b);return o.current.props=e,D.createPortal(e.children,r.getElement())})),he=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useMemo(()=>document.createElement("div"),[]),r=a.useRef({props:e}),i=a.useMemo(()=>{const c={...e},l=new s.Popup(c);return l.setLngLat([e.longitude,e.latitude]),l.once("open",f=>{var u,d;(d=(u=r.current.props).onOpen)==null||d.call(u,f)}),l},[]);if(a.useEffect(()=>{const c=l=>{var f,u;(u=(f=r.current.props).onClose)==null||u.call(f,l)};return i.on("close",c),i.setDOMContent(o).addTo(t.getMap()),()=>{i.off("close",c),i.isOpen()&&i.remove()}},[]),a.useEffect(()=>{E(i.getElement(),e.style)},[e.style]),a.useImperativeHandle(n,()=>i,[]),i.isOpen()){const c=r.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!L(c.offset,e.offset)&&i.setOffset(e.offset),(c.anchor!==e.anchor||c.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth));const l=j(c.className,e.className);if(l)for(const f of l)i.toggleClassName(f);r.current.props=e}return D.createPortal(e.children,o)}));function M(e,n,t,s){const o=a.useContext(x),r=a.useMemo(()=>e(o),[]);return a.useEffect(()=>{const i=n,c=null,l=typeof n=="function"?n:null,{map:f}=o;return f.hasControl(r)||(f.addControl(r,i==null?void 0:i.position),c&&c(o)),()=>{l&&l(o),f.hasControl(r)&&f.removeControl(r)}},[]),r}function te(e){const n=M(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(te);function ne(e){const n=M(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return a.useEffect(()=>{E(n._controlContainer,e.style)},[e.style]),null}a.memo(ne);function oe(e,n){const t=a.useRef({props:e}),s=M(({mapLib:o})=>{const r=new o.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on("geolocate",c=>{var l,f;(f=(l=t.current.props).onGeolocate)==null||f.call(l,c)}),r.on("error",c=>{var l,f;(f=(l=t.current.props).onError)==null||f.call(l,c)}),r.on("outofmaxbounds",c=>{var l,f;(f=(l=t.current.props).onOutOfMaxBounds)==null||f.call(l,c)}),r.on("trackuserlocationstart",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationStart)==null||f.call(l,c)}),r.on("trackuserlocationend",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationEnd)==null||f.call(l,c)}),r},{position:e.position});return t.current.props=e,a.useImperativeHandle(n,()=>s,[]),a.useEffect(()=>{E(s._container,e.style)},[e.style]),null}a.memo(a.forwardRef(oe));function re(e){const n=M(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(re);function se(e){const n=M(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),t=a.useRef(e),s=t.current;t.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&n.setUnit(e.unit),a.useEffect(()=>{E(n._container,o)},[o]),null}const ge=a.memo(se);function ie(e){const n=M(({mapLib:t})=>new t.TerrainControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ie);function ae(e){const n=M(({mapLib:t})=>new t.LogoControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ae);const ce={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},le={light:"basemap-light-",dark:"basemap-dark-"},P={};async function ue(e){if(P[e])return P[e];const t=await(await fetch(ce[e])).json();return P[e]=t,t}function ye({mode:e}){const{current:n}=B(),[t,s]=a.useState(null),o=a.useRef({light:!1,dark:!1}),r=a.useRef({light:[],dark:[]}),i=a.useRef(e);a.useEffect(()=>{i.current=e},[e]),a.useEffect(()=>{const u=()=>{var v;const m=(v=n==null?void 0:n.getMap)==null?void 0:v.call(n);m&&!t&&s(m)};u();const d=setInterval(u,50),h=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(h)}},[n,t]);const c=a.useCallback(async(u,d,h)=>{var k,_;if(o.current[d])return;const m=le[d],v=await ue(d),S=[];for(const[p,y]of Object.entries(v.sources||{})){const g=m+p;u.getSource(g)||u.addSource(g,y)}const b=(_=(((k=u.getStyle())==null?void 0:k.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:_.id;for(const p of v.layers||[]){const y=m+p.id;if(S.push(y),u.getLayer(y))continue;const g={...p,id:y};"source"in g&&typeof g.source=="string"&&(g.source=m+g.source),g.layout||(g.layout={}),g.layout.visibility=h?"visible":"none";try{u.addLayer(g,b)}catch(C){console.warn(`[BasemapLayer] Failed to add layer ${y}:`,C)}}r.current[d]=S,o.current[d]=!0},[]),l=a.useCallback((u,d,h)=>{const m=r.current[d],v=h?"visible":"none";for(const S of m)if(u.getLayer(S))try{u.setLayoutProperty(S,"visibility",v)}catch{}},[]),f=a.useCallback(u=>{var m;const h=(((m=u.getStyle())==null?void 0:m.layers)||[]).filter(v=>!v.id.startsWith("basemap-light-")&&!v.id.startsWith("basemap-dark-"));for(const v of h)try{u.moveLayer(v.id)}catch{}},[]);return a.useEffect(()=>{if(!t)return;const u=d=>{t.hasImage(d.id)||t.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return t.on("styleimagemissing",u),()=>{t.off("styleimagemissing",u)}},[t]),a.useEffect(()=>{if(!t)return;let u=!1;const d=async()=>{if(!u)try{const m=i.current;await Promise.all([c(t,"light",m==="light"),c(t,"dark",m==="dark")]),u||(l(t,"light",i.current==="light"),l(t,"dark",i.current==="dark"),f(t),t.resize())}catch(m){console.error("[BasemapLayer] Setup error:",m)}};t.isStyleLoaded()?d():(t.once("style.load",d),t.once("load",()=>{!u&&!o.current.light&&d()}));const h=()=>{u||setTimeout(()=>{!u&&o.current.light&&o.current.dark&&f(t)},100)};return t.on("styledata",h),()=>{u=!0,t.off("styledata",h)}},[t,c,f,l]),a.useEffect(()=>{t&&(!o.current.light||!o.current.dark||(l(t,"light",e==="light"),l(t,"dark",e==="dark"),t.resize(),t.triggerRepaint()))},[t,e,l]),null}export{ye as B,de as M,he as P,ge as S,me as a,x as b,L as d,B as u}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dk8KEIKm.js","assets/index-CqhZhFJJ.css"])))=>i.map(i=>d[i]); +import{r as a,_ as H,b6 as D}from"./index-Dk8KEIKm.js";const W=a.createContext(null);function B(){var s;const e=(s=a.useContext(W))==null?void 0:s.maps,n=a.useContext(x);return a.useMemo(()=>({...e,current:n==null?void 0:n.map}),[e,n])}function Z(e,n){const t=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(n)?n[0]:n?n.x:0,r=Array.isArray(n)?n[1]:n?n.y:0;return t===o&&s===r}function L(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=n[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const i of V)i in r&&(o[i]=r[i])}return o||s});return{...e,layers:t}}const O={version:8,sources:{},layers:[]},A={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},N={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},U={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},q=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],G=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class w{constructor(n,t,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[U[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||I(this._map.transform);const r=this.props[N[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=I(o),T(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[A[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._MapClass=n,this.props=t,this._initialize(s)}get map(){return this._map}setProps(n){const t=this.props;this.props=n;const s=this._updateSettings(n,t),o=this._updateSize(n),r=this._updateViewState(n);this._updateStyle(n,t),this._updateStyleComponents(n),this._updateHandlers(n,t),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(n,t){const s=w.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(t.className=r.className;r.childNodes.length>0;)t.appendChild(r.childNodes[0]);o._container=t;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(t)),s.setProps({...n,styleDiffing:!1}),o.resize();const{initialViewState:c}=n;return c&&(c.bounds?o.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):s._updateViewState(c)),o.isStyleLoaded()?o.fire("load"):o.once("style.load",()=>o.fire("load")),o._update(),s}_initialize(n){const{props:t}=this,{mapStyle:s=O}=t,o={...t,...t.initialViewState,container:n,style:z(s)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),t.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,t.gl)}const i=new this._MapClass(o);r.padding&&i.setPadding(r.padding),t.cursor&&(i.getCanvas().style.cursor=t.cursor),i.transformCameraUpdate=this._onCameraUpdate,i.on("style.load",()=>{var c;this._styleComponents={light:i.getLight(),sky:i.getSky(),projection:(c=i.getProjection)==null?void 0:c.call(i),terrain:i.getTerrain()},this._updateStyleComponents(this.props)}),i.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in A)i.on(c,this._onPointerEvent);for(const c in N)i.on(c,this._onCameraEvent);for(const c in U)i.on(c,this._onEvent);this._map=i}recycle(){const t=this.map.getContainer().querySelector("[mapboxgl-children]");t==null||t.remove(),w.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_updateSize(n){const{viewState:t}=n;if(t){const s=this._map;if(t.width!==s.transform.width||t.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(n){const t=this._map,s=t.transform;if(!t.isMoving()){const r=T(s,n);if(Object.keys(r).length>0)return this._internalUpdate=!0,t.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(n,t){const s=this._map;let o=!1;for(const r of q)if(r in n&&!L(n[r],t[r])){o=!0;const i=s[`set${r[0].toUpperCase()}${r.slice(1)}`];i==null||i.call(s,n[r])}return o}_updateStyle(n,t){if(n.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==t.mapStyle){const{mapStyle:s=O,styleDiffing:o=!0}=n,r={diff:o};"localIdeographFontFamily"in n&&(r.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(z(s),r)}}_updateStyleComponents({light:n,projection:t,sky:s,terrain:o}){var c,l;const r=this._map,i=this._styleComponents;r.style._loaded&&(n&&!L(n,i.light)&&(i.light=n,r.setLight(n)),t&&!L(t,i.projection)&&t!==((c=i.projection)==null?void 0:c.type)&&(i.projection=typeof t=="string"?{type:t}:t,(l=r.setProjection)==null||l.call(r,i.projection)),s&&!L(s,i.sky)&&(i.sky=s,r.setSky(s)),o!==void 0&&!L(o,i.terrain)&&(!o||r.getSource(o.source))&&(i.terrain=o,r.setTerrain(o)))}_updateHandlers(n,t){const s=this._map;for(const o of G){const r=n[o]??!0,i=t[o]??!0;L(r,i)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(n){const t=this._map,{interactiveLayerIds:s=[]}=this.props;try{return t.queryRenderedFeatures(n,{layers:s.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(n){var o;const{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){const r=n.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(n.point),l=c.length>0;!l&&i&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=c,l&&!i&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=r}else this._hoveredFeatures=null}}w.savedMaps=[];const $=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function J(e){if(!e)return null;const n=e.map,t={getMap:()=>n};for(const s of K(n))!(s in t)&&!$.includes(s)&&(t[s]=n[s].bind(n));return t}function K(e){const n=new Set;let t=e;for(;t;){for(const s of Object.getOwnPropertyNames(t))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&n.add(s);t=Object.getPrototypeOf(t)}return Array.from(n)}const Y=typeof document<"u"?a.useLayoutEffect:a.useEffect;function X(e,n){const{RTLTextPlugin:t,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=n;if(t&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:c=!0}=typeof t=="string"?{pluginUrl:t}:t;e.setRTLTextPlugin(i,l=>{l&&console.error(l)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const x=a.createContext(null);function Q(e,n){const t=a.useContext(W),[s,o]=a.useState(null),r=a.useRef(),{current:i}=a.useRef({mapLib:null,map:null});a.useEffect(()=>{const f=e.mapLib;let u=!0,d;return Promise.resolve(f||H(()=>import("./maplibre-gl-Cjpoa4ZG.js").then(h=>h.m),__vite__mapDeps([0,1]))).then(h=>{if(!u)return;if(!h)throw new Error("Invalid mapLib");const m="Map"in h?h:h.default;if(!m.Map)throw new Error("Invalid mapLib");X(m,e),e.reuseMaps&&(d=w.reuse(e,r.current)),d||(d=new w(m.Map,e,r.current)),i.map=J(d),i.mapLib=m,o(d),t==null||t.onMapMount(i.map,e.id)}).catch(h=>{const{onError:m}=e;m?m({type:"error",target:null,originalEvent:null,error:h}):console.error(h)}),()=>{u=!1,d&&(t==null||t.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Y(()=>{s&&s.setProps(e)}),a.useImperativeHandle(n,()=>i.map,[s]);const c=a.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),l={height:"100%"};return a.createElement("div",{id:e.id,ref:r,style:c},s&&a.createElement(x.Provider,{value:i},a.createElement("div",{"mapboxgl-children":"",style:l},e.children)))}const de=a.forwardRef(Q),ee=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function E(e,n){if(!e||!n)return;const t=e.style;for(const s in n){const o=n[s];Number.isFinite(o)&&!ee.test(s)?t[s]=`${o}px`:t[s]=o}}function j(e,n){if(e===n)return null;const t=F(e),s=F(n),o=[];for(const r of s)t.has(r)||o.push(r);for(const r of t)s.has(r)||o.push(r);return o.length===0?null:o}function F(e){return new Set(e?e.trim().split(/\s+/):[])}const me=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useRef({props:e}),r=a.useMemo(()=>{let b=!1;a.Children.forEach(e.children,p=>{p&&(b=!0)});const k={...e,element:b?document.createElement("div"):void 0},_=new s.Marker(k);return _.setLngLat([e.longitude,e.latitude]),_.getElement().addEventListener("click",p=>{var y,g;(g=(y=o.current.props).onClick)==null||g.call(y,{type:"click",target:_,originalEvent:p})}),_.on("dragstart",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragStart)==null||C.call(g,y)}),_.on("drag",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDrag)==null||C.call(g,y)}),_.on("dragend",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragEnd)==null||C.call(g,y)}),_},[]);a.useEffect(()=>(r.addTo(t.getMap()),()=>{r.remove()}),[]);const{longitude:i,latitude:c,offset:l,style:f,draggable:u=!1,popup:d=null,rotation:h=0,rotationAlignment:m="auto",pitchAlignment:v="auto"}=e;a.useEffect(()=>{E(r.getElement(),f)},[f]),a.useImperativeHandle(n,()=>r,[]);const S=o.current.props;(r.getLngLat().lng!==i||r.getLngLat().lat!==c)&&r.setLngLat([i,c]),l&&!Z(r.getOffset(),l)&&r.setOffset(l),r.isDraggable()!==u&&r.setDraggable(u),r.getRotation()!==h&&r.setRotation(h),r.getRotationAlignment()!==m&&r.setRotationAlignment(m),r.getPitchAlignment()!==v&&r.setPitchAlignment(v),r.getPopup()!==d&&r.setPopup(d);const R=j(S.className,e.className);if(R)for(const b of R)r.toggleClassName(b);return o.current.props=e,D.createPortal(e.children,r.getElement())})),he=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useMemo(()=>document.createElement("div"),[]),r=a.useRef({props:e}),i=a.useMemo(()=>{const c={...e},l=new s.Popup(c);return l.setLngLat([e.longitude,e.latitude]),l.once("open",f=>{var u,d;(d=(u=r.current.props).onOpen)==null||d.call(u,f)}),l},[]);if(a.useEffect(()=>{const c=l=>{var f,u;(u=(f=r.current.props).onClose)==null||u.call(f,l)};return i.on("close",c),i.setDOMContent(o).addTo(t.getMap()),()=>{i.off("close",c),i.isOpen()&&i.remove()}},[]),a.useEffect(()=>{E(i.getElement(),e.style)},[e.style]),a.useImperativeHandle(n,()=>i,[]),i.isOpen()){const c=r.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!L(c.offset,e.offset)&&i.setOffset(e.offset),(c.anchor!==e.anchor||c.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth));const l=j(c.className,e.className);if(l)for(const f of l)i.toggleClassName(f);r.current.props=e}return D.createPortal(e.children,o)}));function M(e,n,t,s){const o=a.useContext(x),r=a.useMemo(()=>e(o),[]);return a.useEffect(()=>{const i=n,c=null,l=typeof n=="function"?n:null,{map:f}=o;return f.hasControl(r)||(f.addControl(r,i==null?void 0:i.position),c&&c(o)),()=>{l&&l(o),f.hasControl(r)&&f.removeControl(r)}},[]),r}function te(e){const n=M(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(te);function ne(e){const n=M(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return a.useEffect(()=>{E(n._controlContainer,e.style)},[e.style]),null}a.memo(ne);function oe(e,n){const t=a.useRef({props:e}),s=M(({mapLib:o})=>{const r=new o.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on("geolocate",c=>{var l,f;(f=(l=t.current.props).onGeolocate)==null||f.call(l,c)}),r.on("error",c=>{var l,f;(f=(l=t.current.props).onError)==null||f.call(l,c)}),r.on("outofmaxbounds",c=>{var l,f;(f=(l=t.current.props).onOutOfMaxBounds)==null||f.call(l,c)}),r.on("trackuserlocationstart",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationStart)==null||f.call(l,c)}),r.on("trackuserlocationend",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationEnd)==null||f.call(l,c)}),r},{position:e.position});return t.current.props=e,a.useImperativeHandle(n,()=>s,[]),a.useEffect(()=>{E(s._container,e.style)},[e.style]),null}a.memo(a.forwardRef(oe));function re(e){const n=M(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(re);function se(e){const n=M(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),t=a.useRef(e),s=t.current;t.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&n.setUnit(e.unit),a.useEffect(()=>{E(n._container,o)},[o]),null}const ge=a.memo(se);function ie(e){const n=M(({mapLib:t})=>new t.TerrainControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ie);function ae(e){const n=M(({mapLib:t})=>new t.LogoControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ae);const ce={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},le={light:"basemap-light-",dark:"basemap-dark-"},P={};async function ue(e){if(P[e])return P[e];const t=await(await fetch(ce[e])).json();return P[e]=t,t}function ye({mode:e}){const{current:n}=B(),[t,s]=a.useState(null),o=a.useRef({light:!1,dark:!1}),r=a.useRef({light:[],dark:[]}),i=a.useRef(e);a.useEffect(()=>{i.current=e},[e]),a.useEffect(()=>{const u=()=>{var v;const m=(v=n==null?void 0:n.getMap)==null?void 0:v.call(n);m&&!t&&s(m)};u();const d=setInterval(u,50),h=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(h)}},[n,t]);const c=a.useCallback(async(u,d,h)=>{var k,_;if(o.current[d])return;const m=le[d],v=await ue(d),S=[];for(const[p,y]of Object.entries(v.sources||{})){const g=m+p;u.getSource(g)||u.addSource(g,y)}const b=(_=(((k=u.getStyle())==null?void 0:k.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:_.id;for(const p of v.layers||[]){const y=m+p.id;if(S.push(y),u.getLayer(y))continue;const g={...p,id:y};"source"in g&&typeof g.source=="string"&&(g.source=m+g.source),g.layout||(g.layout={}),g.layout.visibility=h?"visible":"none";try{u.addLayer(g,b)}catch(C){console.warn(`[BasemapLayer] Failed to add layer ${y}:`,C)}}r.current[d]=S,o.current[d]=!0},[]),l=a.useCallback((u,d,h)=>{const m=r.current[d],v=h?"visible":"none";for(const S of m)if(u.getLayer(S))try{u.setLayoutProperty(S,"visibility",v)}catch{}},[]),f=a.useCallback(u=>{var m;const h=(((m=u.getStyle())==null?void 0:m.layers)||[]).filter(v=>!v.id.startsWith("basemap-light-")&&!v.id.startsWith("basemap-dark-"));for(const v of h)try{u.moveLayer(v.id)}catch{}},[]);return a.useEffect(()=>{if(!t)return;const u=d=>{t.hasImage(d.id)||t.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return t.on("styleimagemissing",u),()=>{t.off("styleimagemissing",u)}},[t]),a.useEffect(()=>{if(!t)return;let u=!1;const d=async()=>{if(!u)try{const m=i.current;await Promise.all([c(t,"light",m==="light"),c(t,"dark",m==="dark")]),u||(l(t,"light",i.current==="light"),l(t,"dark",i.current==="dark"),f(t),t.resize())}catch(m){console.error("[BasemapLayer] Setup error:",m)}};t.isStyleLoaded()?d():(t.once("style.load",d),t.once("load",()=>{!u&&!o.current.light&&d()}));const h=()=>{u||setTimeout(()=>{!u&&o.current.light&&o.current.dark&&f(t)},100)};return t.on("styledata",h),()=>{u=!0,t.off("styledata",h)}},[t,c,f,l]),a.useEffect(()=>{t&&(!o.current.light||!o.current.dark||(l(t,"light",e==="light"),l(t,"dark",e==="dark"),t.resize(),t.triggerRepaint()))},[t,e,l]),null}export{ye as B,de as M,he as P,ge as S,me as a,x as b,L as d,B as u}; diff --git a/frontend/dist/assets/CADCalibration-DlKXekH3.js b/frontend/dist/assets/CADCalibration-CGIGz84J.js similarity index 96% rename from frontend/dist/assets/CADCalibration-DlKXekH3.js rename to frontend/dist/assets/CADCalibration-CGIGz84J.js index c2ea7d5f..59a04c27 100644 --- a/frontend/dist/assets/CADCalibration-DlKXekH3.js +++ b/frontend/dist/assets/CADCalibration-CGIGz84J.js @@ -1,4 +1,4 @@ -import{e as G,dv as S,dw as J,dx as V,r as o,j as e,B as b,dA as W,aA as X,f as C,R as K}from"./index-C8J8z7Af.js";import{P as Q,a as Y,B as Z,C as u}from"./PageLayout-D_1HzH-E.js";import{C as I}from"./ConfirmModal-B5_l2g7c.js";import{r as ee}from"./system-CzT5Ikli.js";import{A as te}from"./activity-Bh2DzqDM.js";import{R as _,C as D}from"./Grid-CfYPlwSW.js";import{S as se}from"./save-ChsI8Mf5.js";import{S as ae}from"./sparkles-vljvhdkN.js";import{T as $}from"./target-BJQI0xG9.js";import{T as re}from"./timer-BVd5WQSE.js";/** +import{e as G,dv as S,dw as J,dx as V,r as o,j as e,B as b,dA as W,aA as X,f as C,R as K}from"./index-Dk8KEIKm.js";import{P as Q,a as Y,B as Z,C as u}from"./PageLayout-CGcnsIyM.js";import{C as I}from"./ConfirmModal-n8Se2h3L.js";import{r as ee}from"./system-CChwfvfT.js";import{A as te}from"./activity-D99FIjaW.js";import{R as _,C as D}from"./Grid-CThL_TW5.js";import{S as se}from"./save-DrkPtb78.js";import{S as ae}from"./sparkles-CZBEDNRz.js";import{T as $}from"./target-Djl_t-RI.js";import{T as re}from"./timer-DxeOkv-V.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ChatBubble-DwkygOA9.js b/frontend/dist/assets/ChatBubble-4SEgCFK2.js similarity index 97% rename from frontend/dist/assets/ChatBubble-DwkygOA9.js rename to frontend/dist/assets/ChatBubble-4SEgCFK2.js index 971f5c4f..8c97d17b 100644 --- a/frontend/dist/assets/ChatBubble-DwkygOA9.js +++ b/frontend/dist/assets/ChatBubble-4SEgCFK2.js @@ -1 +1 @@ -import{r as B,j as e,c as s}from"./index-C8J8z7Af.js";import{e as M,g as W,a as E,c as S,f as g,b}from"./chat-utils-C5p1i8vZ.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-Dk8KEIKm.js";import{e as M,g as W,a as E,c as S,f as g,b}from"./chat-utils-DAcFG23d.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-bQOWAc0q.js b/frontend/dist/assets/CollisionExplorerModal-5AGT-1cv.js similarity index 96% rename from frontend/dist/assets/CollisionExplorerModal-bQOWAc0q.js rename to frontend/dist/assets/CollisionExplorerModal-5AGT-1cv.js index 81e82a31..f15ebfa1 100644 --- a/frontend/dist/assets/CollisionExplorerModal-bQOWAc0q.js +++ b/frontend/dist/assets/CollisionExplorerModal-5AGT-1cv.js @@ -1 +1 @@ -import{r as c,aa as L,cj as S,ad as H,j as e,ay as k,bX as R,az as B,d1 as E,b_ as T,c as N,aq as P,$ as M,a7 as _,a4 as z,a5 as D,cv as I,cG as W}from"./index-C8J8z7Af.js";import{M as q,B as F,a as $}from"./BasemapLayer-BvoQWTC4.js";import{S as A,L as G}from"./layer-DgtbTXVx.js";import{M as U}from"./map-pin-ufrVZcS3.js";import{S as Y}from"./share-2-PheBENSj.js";const J={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 _(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=Y,r="text-sys-blue";return m?(n=I,r="text-signal-fair"):l?(n=W,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(z,{className:"w-2.5 h-2.5"}):e.jsx(D,{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(U,{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(q,{ref:p,initialViewState:{longitude:r.longitude,latitude:r.latitude,zoom:10},style:{height:"100%",width:"100%"},mapStyle:J,attributionControl:!1,onLoad:j,children:[e.jsx(F,{mode:g}),d&&e.jsx(A,{id:"collision-edges",type:"geojson",data:d,children:e.jsx(G,{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=P(a.hash);return e.jsx($,{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 Q({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(Q);export{ee as C}; +import{r as c,aa as L,cj as S,ad as H,j as e,ay as k,bX as R,az as B,d1 as E,b_ as T,c as N,aq as P,$ as M,a7 as _,a4 as z,a5 as D,cv as I,cG as W}from"./index-Dk8KEIKm.js";import{M as q,B as F,a as $}from"./BasemapLayer-snfcoHal.js";import{S as A,L as G}from"./layer-CgHNe4F2.js";import{M as U}from"./map-pin-6ZLH5iNg.js";import{S as Y}from"./share-2-CopKWuTH.js";const J={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 _(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=Y,r="text-sys-blue";return m?(n=I,r="text-signal-fair"):l?(n=W,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(z,{className:"w-2.5 h-2.5"}):e.jsx(D,{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(U,{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(q,{ref:p,initialViewState:{longitude:r.longitude,latitude:r.latitude,zoom:10},style:{height:"100%",width:"100%"},mapStyle:J,attributionControl:!1,onLoad:j,children:[e.jsx(F,{mode:g}),d&&e.jsx(A,{id:"collision-edges",type:"geojson",data:d,children:e.jsx(G,{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=P(a.hash);return e.jsx($,{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 Q({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(Q);export{ee as C}; diff --git a/frontend/dist/assets/Companion-BVi91xoL.js b/frontend/dist/assets/Companion-Cq3cjcyh.js similarity index 98% rename from frontend/dist/assets/Companion-BVi91xoL.js rename to frontend/dist/assets/Companion-Cq3cjcyh.js index 4246c011..c3756498 100644 --- a/frontend/dist/assets/Companion-BVi91xoL.js +++ b/frontend/dist/assets/Companion-Cq3cjcyh.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompanionPathMap-CXIYZL2H.js","assets/index-C8J8z7Af.js","assets/BasemapLayer-BvoQWTC4.js","assets/layer-DgtbTXVx.js","assets/usePipelineStore-CtpzsDw6.js","assets/node-types-B5WxOxT2.js","assets/useReplayTick-BAMq1uf1.js","assets/payload-detail-BWHpd-ZF.js","assets/car-KA4-aUWv.js","assets/map-pin-off-COAzJaWC.js","assets/index-CqhZhFJJ.css","assets/BasemapLayer-B1CfjdFi.css","assets/CompanionEchoMap-D-ZiSBZa.js"])))=>i.map(i=>d[i]); -import{aU as Wa,fG as ws,aW as un,aX as Ua,aV as Tt,aY as mn,r as l,aZ as Ga,a_ as ge,b1 as _e,aQ as ee,b5 as Q,b2 as fe,bf as Ka,b6 as Rt,ba as $t,bb as At,bg as qa,bc as Re,bd as mt,bh as Va,be as ye,bi as ks,bj as Ja,bk as Qa,bl as ct,bm as Xa,bn as Ya,bo as Za,aT as rt,b3 as er,fI as tr,de as Oe,fL as pn,bq as sr,br as re,bs as nr,bz as ar,ds as rr,dt as lr,bB as ir,fM as or,bp as De,bA as pt,bu as cr,fN as Ft,bD as Cs,fO as xt,a$ as Ze,bw as xn,bx as dr,by as ur,dc as Ss,df as Is,fH as mr,bC as pr,b0 as xr,b8 as hr,b9 as fr,bt as hn,da as fn,e as le,j as e,c as M,a4 as Ne,fP as gr,w as yr,c$ as ie,fQ as ae,cG as je,cv as ht,R as Ke,bK as ft,f7 as Me,f8 as Ee,f9 as Pe,d as ve,fR as br,fS as vr,m as oe,fT as jr,cV as qe,ay as Ce,aH as Te,aA as Ve,az as Se,a6 as ue,bX as Je,eO as $e,B as U,fU as Nr,fV as gt,av as wr,W as kr,fW as _s,_ as gn,cb as Cr,$ as Le,fX as Sr,S as Ir,dK as _r,fY as Ot,fZ as Rr,f_ as Mr,bF as Mt,f$ as Er,g0 as Pr,g1 as Tr,d6 as $r,a5 as Dt,en as Ar,g2 as Fr,g3 as Or,g4 as yn,g5 as Dr,ab as Lr,g6 as zr,g7 as bn,fv as Hr,g8 as Br,g9 as Wr,I as he,C as Rs,ga as vn,gb as Ur,gc as Gr,gd as Kr,ge as qr,gf as Vr,gg as Jr,gh as Qr,gi as Xr,gj as Yr,gk as Zr,aa as el,gl as tl,gm as sl,gn as nl,go as al,gp as rl,gq as ll,gr as il,gs as ol,gt as cl,gu as dl,gv as ul,gw as ml,eJ as pl}from"./index-C8J8z7Af.js";import{P as Ms,a as xl,B as Es,C as Ps}from"./PageLayout-D_1HzH-E.js";import{e as yt,g as bt,a as vt,f as hl,b as fl}from"./chat-utils-C5p1i8vZ.js";import{c as Ts,S as gl,a as yl}from"./SignalIndicator-CpPs32QG.js";import{b as bl,F as vl,y as jl,R as Nl,T as wl,w as kl,A as Cl}from"./floating-DcVaWvZe.js";import{p as Sl,a as lt,c as Y,f as nt,b as Il,L as _l,S as at,s as Rl,u as Ml,d as El}from"./element-movement-DhaeUFJY.js";import{s as Pl}from"./use-text-value-Bj-jCGjS.js";import{F as Tl}from"./use-tree-walker-DrduKptm.js";import{a as it}from"./index-DAnUKwME.js";import{S as $s}from"./search-BO7ZBfwt.js";import{S as $l}from"./share-2-PheBENSj.js";import{R as Qe,L as Al}from"./route-BEiTCi9B.js";import{R as jn}from"./rotate-ccw-CH2KviiM.js";import{T as Xe}from"./trash-2-MzXRdjh-.js";import{H as ze}from"./hash-8dFF62ov.js";import{C as Fl}from"./check-check-BxJI0DsK.js";import{P as Ye}from"./plus-DWX8cdcI.js";import{S as Ol,C as Dl}from"./ChatBubble-DwkygOA9.js";import{p as Ll}from"./payload-detail-BWHpd-ZF.js";import{A as zl}from"./arrow-down-Dqy7bDoY.js";import{C as Hl}from"./chevron-right-ZaDPsavE.js";import{C as Nn}from"./circle-alert-CkWx_yNx.js";import{f as Bl,c as Wl,a as Ul,M as Gl}from"./variants-CSW2-RVV.js";import{M as wn}from"./map-pin-ufrVZcS3.js";import{C as kn}from"./clock-CTBG2e06.js";import{A as Cn}from"./activity-Bh2DzqDM.js";import{T as Sn}from"./thermometer-JkoQlooZ.js";import{U as Lt}from"./upload-DE3acz7s.js";import{W as As}from"./wand-sparkles-CkPC71f7.js";import{S as Kl}from"./save-ChsI8Mf5.js";import{C as ql}from"./compass--Ql4hKkC.js";import{G as Fs}from"./git-branch-ChtBrERo.js";import{F as ce,L as de,D as Ie}from"./fieldset-Dw6uLZoo.js";import{C as In}from"./ConfirmModal-B5_l2g7c.js";import{K as _n}from"./key-round-C1SnbsaC.js";import{F as Rn}from"./folder-lock-DvltIKzr.js";import{P as Vl}from"./pencil-C5OSBhs0.js";var Jl=Object.defineProperty,Ql=(s,t,n)=>t in s?Jl(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,Os=(s,t,n)=>(Ql(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 Ds(s,t=n=>n){let n=s.activeItemIndex!==null?s.items[s.activeItemIndex]:null,a=mn(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 Xl={1(s){if(s.menuState===1)return s;let t=s.buttonElement?lt.Tracked(Il(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:lt.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=nt(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=nt(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=Ds(s),f=nt(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=nt(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,...Ds(s),pendingShouldSort:!1}:s,10(s){return s.buttonPositionState.kind!=="Tracked"?s:{...s,buttonPositionState:lt.Moved}}};class zt extends Wa{constructor(t){super(t),Os(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)})]})}),Os(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=un.get(null);this.disposables.add(a.on(Ua.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(Sl(a.buttonElement,a.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new zt({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:lt.Idle})}reduce(t,n){return Tt(n.type,Xl,t,n)}}const Mn=l.createContext(null);function Ht(s){let t=l.useContext(Mn);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,En),n}return t}function En({id:s,__demoMode:t=!1}){let n=l.useMemo(()=>zt.new({id:s,__demoMode:t}),[]);return Ga(()=>n.dispose()),n}let Yl=l.Fragment;function Zl(s,t){let n=l.useId(),{__demoMode:a=!1,...r}=s,i=En({id:n,__demoMode:a}),[o,u,d]=fe(i,k=>[k.menuState,k.itemsElement,k.buttonElement]),f=_e(t),c=un.get(null),x=fe(c,l.useCallback(k=>c.selectors.isTop(k,n),[c,n]));ar(x,[d,u],(k,h)=>{var w;i.send({type:V.CloseMenu}),rr(h,lr.Loose)||(k.preventDefault(),(w=i.state.buttonElement)==null||w.focus())});let y=ee(()=>{i.send({type:V.CloseMenu})}),g=Re({open:o===ne.Open,close:y}),m={ref:f},j=ye();return re.createElement(Cl,null,re.createElement(Mn.Provider,{value:i},re.createElement(ir,{value:Tt(o,{[ne.Open]:ct.Open,[ne.Closed]:ct.Closed})},j({ourProps:m,theirProps:r,slot:g,defaultTag:Yl,name:"Menu"}))))}let ei="button";function ti(s,t){let n=Ht("Menu.Button"),a=l.useId(),{id:r=`headlessui-menu-button-${a}`,disabled:i=!1,autoFocus:o=!1,...u}=s,d=l.useRef(null),f=bl(),c=_e(t,d,vl(),ee(N=>n.send({type:V.SetButtonElement,element:N}))),x=ee(N=>{switch(N.key){case Q.Space:case Q.Enter:case Q.ArrowDown:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.First}});break;case Q.ArrowUp:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.Last}});break}}),y=ee(N=>{switch(N.key){case Q.Space:N.preventDefault();break}}),[g,m,j]=fe(n,N=>[N.menuState,N.buttonElement,N.itemsElement]),k=g===ne.Open;_l(k,{trigger:m,action:l.useCallback(N=>{if(m!=null&&m.contains(N.target))return at.Ignore;let C=N.target.closest('[role="menuitem"]:not([data-disabled])');return Ka(C)?at.Select(C):j!=null&&j.contains(N.target)?at.Ignore:at.Close},[m,j]),close:l.useCallback(()=>n.send({type:V.CloseMenu}),[]),select:l.useCallback(N=>N.click(),[])});let h=Rl(N=>{var C;i||(g===ne.Open?(Rt.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:R,hoverProps:b}=At({isDisabled:i}),{pressed:I,pressProps:T}=qa({disabled:i}),_=Re({open:g===ne.Open,active:I||g===ne.Open,disabled:i,hover:R,focus:w,autofocus:o}),p=mt(f(),{ref:c,id:r,type:Va(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:ei,name:"Menu.Button"})}let si="div",ni=Cs.RenderStrategy|Cs.Static;function ai(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=jl(r),c=Ht("Menu.Items"),[x,y]=Nl(f),g=wl(),[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),R=ks(m);f&&(i=!0);let b=Ja(),[I,T]=Qa(u,m,b!==null?(b&ct.Open)===ct.Open:h===ne.Open);Xa(I,w,()=>{c.send({type:V.CloseMenu})});let _=fe(c,O=>O.__demoMode),p=_?!1:o&&h===ne.Open;Ya(p,R);let N=_?!1:o&&h===ne.Open;Za(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&&(rt(O)||O.focus({preventScroll:!0}))},[h,m]),Tl(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=er(),L=ee(O=>{var q,J,B;switch(v.dispose(),O.key){case Q.Space:if(c.state.searchQuery!=="")return O.preventDefault(),O.stopPropagation(),c.send({type:V.Search,value:O.key});case Q.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}),pn(c.state.buttonElement);break;case Q.ArrowDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Next});case Q.ArrowUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Previous});case Q.Home:case Q.PageUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.First});case Q.End:case Q.PageDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Last});case Q.Escape:O.preventDefault(),O.stopPropagation(),Rt.flushSync(()=>c.send({type:V.CloseMenu})),(B=c.state.buttonElement)==null||B.focus({preventScroll:!0});break;case Q.Tab:O.preventDefault(),O.stopPropagation(),Rt.flushSync(()=>c.send({type:V.CloseMenu})),tr(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 Q.Space:O.preventDefault();break}}),D=Re({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":kl(I,w,!0).width},...sr(T)}),G=ye();return re.createElement(nr,{enabled:i?s.static||I:!1,ownerDocument:E},G({ourProps:$,theirProps:d,slot:D,defaultTag:si,features:ni,visible:C,name:"Menu.Items"}))}let ri=l.Fragment;function li(s,t){let n=l.useId(),{id:a=`headlessui-menu-item-${n}`,disabled:r=!1,...i}=s,o=Ht("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 cr().requestAnimationFrame(()=>{var C,v;(v=(C=d.current)==null?void 0:C.scrollIntoView)==null||v.call(C,{block:"nearest"})})},[c,d]);let x=Pl(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}),pn(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}))}),[R,b]=pt(),[I,T]=Ft(),_=Re({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":R,"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 re.createElement(b,null,re.createElement(T,null,N({ourProps:p,theirProps:i,slot:_,defaultTag:ri,name:"Menu.Item"})))}let ii="div";function oi(s,t){let[n,a]=pt(),r=s,i={ref:t,"aria-labelledby":n,role:"group"},o=ye();return re.createElement(a,null,o({ourProps:i,theirProps:r,slot:{},defaultTag:ii,name:"Menu.Section"}))}let ci="header";function di(s,t){let n=l.useId(),{id:a=`headlessui-menu-heading-${n}`,...r}=s,i=or();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:ci,name:"Menu.Heading"})}let ui="div";function mi(s,t){let n=s,a={ref:t,role:"separator"};return ye()({ourProps:a,theirProps:n,slot:{},defaultTag:ui,name:"Menu.Separator"})}let pi=ge(Zl),Pn=ge(ti),Tn=ge(ai),Et=ge(li),xi=ge(oi),hi=ge(di),$n=ge(mi),fi=Object.assign(pi,{Button:Pn,Items:Tn,Item:Et,Section:xi,Heading:hi,Separator:$n});var gi=(s=>(s[s.RegisterOption=0]="RegisterOption",s[s.UnregisterOption=1]="UnregisterOption",s))(gi||{});let yi={0(s,t){let n=[...s.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...s,options:mn(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})}},Bt=l.createContext(null);Bt.displayName="RadioGroupDataContext";function Wt(s){let t=l.useContext(Bt);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wt),n}return t}let Ut=l.createContext(null);Ut.displayName="RadioGroupActionsContext";function Gt(s){let t=l.useContext(Ut);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Gt),n}return t}function bi(s,t){return Tt(t.type,yi,s,t)}let vi="div";function ji(s,t){let n=l.useId(),a=xn(),{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=El(f),[j,k]=l.useReducer(bi,{options:[]}),h=j.options,[w,E]=pt(),[R,b]=Ft(),I=l.useRef(null),T=_e(I,t),_=dr(x),[p,N]=ur(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 Q.Enter:mr(A.currentTarget);break;case Q.ArrowLeft:case Q.ArrowUp:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Previous|Oe.WrapAround)===Is.Success){let F=h.find(W=>rt(W.element.current));F&&L(F.propsRef.current.value)}break;case Q.ArrowRight:case Q.ArrowDown:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Next|Oe.WrapAround)===Is.Success){let F=h.find(W=>rt(W.element.current));F&&L(F.propsRef.current.value)}break;case Q.Space:{A.preventDefault(),A.stopPropagation();let F=h.find(W=>rt(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":R,onKeyDown:S},q=Re({value:p}),J=l.useCallback(()=>{if(_!==void 0)return L(_)},[L,_]),B=ye();return re.createElement(b,{name:"RadioGroup.Description"},re.createElement(E,{name:"RadioGroup.Label"},re.createElement(Ut.Provider,{value:G},re.createElement(Bt.Provider,{value:$},u!=null&&re.createElement(pr,{disabled:c,data:{[u]:p||"on"},overrides:{type:"radio",checked:p!=null},form:o,onReset:J}),B({ourProps:O,theirProps:g,slot:q,defaultTag:vi,name:"RadioGroup"})))))}let Ni="div";function wi(s,t){var n;let a=Wt("RadioGroup.Option"),r=Gt("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=hn({value:u,disabled:d});De(()=>r.registerOption({id:o,element:x,propsRef:h}),[o,r,x,h]);let w=ee(v=>{var L;if(fn(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:R,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=Re({checked:_,disabled:d,active:R,hover:I,focus:R,autofocus:f}),C=ye();return re.createElement(k,{name:"RadioGroup.Description"},re.createElement(m,{name:"RadioGroup.Label"},C({ourProps:p,theirProps:c,slot:N,defaultTag:Ni,name:"RadioGroup.Option"})))}let ki="span";function Ci(s,t){var n;let a=Wt("Radio"),r=Gt("Radio"),i=l.useId(),o=xr(),u=xn(),{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=hr(),k=fr(),h=hn({value:f,disabled:c});De(()=>r.registerOption({id:d,element:g,propsRef:h}),[d,r,g,h]);let w=ee(C=>{var v;if(fn(C.currentTarget))return C.preventDefault();r.change(f)&&((v=g.current)==null||v.focus())}),{isFocusVisible:E,focusProps:R}=$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},R,I),N=Re({checked:_,disabled:c,hover:b,focus:E,autofocus:x});return ye()({ourProps:p,theirProps:y,slot:N,defaultTag:ki,name:"Radio"})}let Si=ge(ji),Ii=ge(wi),jt=ge(Ci),_i=Ze,Ri=xt,Mi=Object.assign(Si,{Option:Ii,Radio:jt,Label:_i,Description:Ri});/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompanionPathMap-CqxSHGK1.js","assets/index-Dk8KEIKm.js","assets/BasemapLayer-snfcoHal.js","assets/layer-CgHNe4F2.js","assets/usePipelineStore-C2CKtblH.js","assets/node-types-SdzDwn2r.js","assets/useReplayTick-DTG9e32S.js","assets/payload-detail-BR_z6q5h.js","assets/car-BJCuYr8A.js","assets/map-pin-off-DSyO3Y2C.js","assets/index-CqhZhFJJ.css","assets/BasemapLayer-B1CfjdFi.css","assets/CompanionEchoMap-Cad6Uf2W.js"])))=>i.map(i=>d[i]); +import{aU as Wa,fG as ws,aW as un,aX as Ua,aV as Tt,aY as mn,r as l,aZ as Ga,a_ as ge,b1 as _e,aQ as ee,b5 as Q,b2 as fe,bf as Ka,b6 as Rt,ba as $t,bb as At,bg as qa,bc as Re,bd as mt,bh as Va,be as ye,bi as ks,bj as Ja,bk as Qa,bl as ct,bm as Xa,bn as Ya,bo as Za,aT as rt,b3 as er,fI as tr,de as Oe,fL as pn,bq as sr,br as re,bs as nr,bz as ar,ds as rr,dt as lr,bB as ir,fM as or,bp as De,bA as pt,bu as cr,fN as Ft,bD as Cs,fO as xt,a$ as Ze,bw as xn,bx as dr,by as ur,dc as Ss,df as Is,fH as mr,bC as pr,b0 as xr,b8 as hr,b9 as fr,bt as hn,da as fn,e as le,j as e,c as M,a4 as Ne,fP as gr,w as yr,c$ as ie,fQ as ae,cG as je,cv as ht,R as Ke,bK as ft,f7 as Me,f8 as Ee,f9 as Pe,d as ve,fR as br,fS as vr,m as oe,fT as jr,cV as qe,ay as Ce,aH as Te,aA as Ve,az as Se,a6 as ue,bX as Je,eO as $e,B as U,fU as Nr,fV as gt,av as wr,W as kr,fW as _s,_ as gn,cb as Cr,$ as Le,fX as Sr,S as Ir,dK as _r,fY as Ot,fZ as Rr,f_ as Mr,bF as Mt,f$ as Er,g0 as Pr,g1 as Tr,d6 as $r,a5 as Dt,en as Ar,g2 as Fr,g3 as Or,g4 as yn,g5 as Dr,ab as Lr,g6 as zr,g7 as bn,fv as Hr,g8 as Br,g9 as Wr,I as he,C as Rs,ga as vn,gb as Ur,gc as Gr,gd as Kr,ge as qr,gf as Vr,gg as Jr,gh as Qr,gi as Xr,gj as Yr,gk as Zr,aa as el,gl as tl,gm as sl,gn as nl,go as al,gp as rl,gq as ll,gr as il,gs as ol,gt as cl,gu as dl,gv as ul,gw as ml,eJ as pl}from"./index-Dk8KEIKm.js";import{P as Ms,a as xl,B as Es,C as Ps}from"./PageLayout-CGcnsIyM.js";import{e as yt,g as bt,a as vt,f as hl,b as fl}from"./chat-utils-DAcFG23d.js";import{c as Ts,S as gl,a as yl}from"./SignalIndicator-DJ2WGJCI.js";import{b as bl,F as vl,y as jl,R as Nl,T as wl,w as kl,A as Cl}from"./floating-DAdA6y7o.js";import{p as Sl,a as lt,c as Y,f as nt,b as Il,L as _l,S as at,s as Rl,u as Ml,d as El}from"./element-movement-CrHrmJVz.js";import{s as Pl}from"./use-text-value-XAXtIZxt.js";import{F as Tl}from"./use-tree-walker-D-l3KkK-.js";import{a as it}from"./index-DMeWa3DH.js";import{S as $s}from"./search-DgakOYk2.js";import{S as $l}from"./share-2-CopKWuTH.js";import{R as Qe,L as Al}from"./route-CxDUYLxS.js";import{R as jn}from"./rotate-ccw-BQDcEa4l.js";import{T as Xe}from"./trash-2-BNWAPzrN.js";import{H as ze}from"./hash-BaVtxU1B.js";import{C as Fl}from"./check-check-BfFB-ozy.js";import{P as Ye}from"./plus-BQyrUsn7.js";import{S as Ol,C as Dl}from"./ChatBubble-4SEgCFK2.js";import{p as Ll}from"./payload-detail-BR_z6q5h.js";import{A as zl}from"./arrow-down-B85BrN7t.js";import{C as Hl}from"./chevron-right-BugwEnle.js";import{C as Nn}from"./circle-alert-CkK66Qaq.js";import{f as Bl,c as Wl,a as Ul,M as Gl}from"./variants-bcpM0cYI.js";import{M as wn}from"./map-pin-6ZLH5iNg.js";import{C as kn}from"./clock-BSYVhL7Q.js";import{A as Cn}from"./activity-D99FIjaW.js";import{T as Sn}from"./thermometer-CwnqiDCo.js";import{U as Lt}from"./upload-L_Eq4fFX.js";import{W as As}from"./wand-sparkles-Cfv_3ntm.js";import{S as Kl}from"./save-DrkPtb78.js";import{C as ql}from"./compass-DJByH8FZ.js";import{G as Fs}from"./git-branch-Dye45Z4B.js";import{F as ce,L as de,D as Ie}from"./fieldset-BlgsvaPV.js";import{C as In}from"./ConfirmModal-n8Se2h3L.js";import{K as _n}from"./key-round-CDk8iwaD.js";import{F as Rn}from"./folder-lock-CojF4hzD.js";import{P as Vl}from"./pencil-Cf1ve6Fc.js";var Jl=Object.defineProperty,Ql=(s,t,n)=>t in s?Jl(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,Os=(s,t,n)=>(Ql(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 Ds(s,t=n=>n){let n=s.activeItemIndex!==null?s.items[s.activeItemIndex]:null,a=mn(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 Xl={1(s){if(s.menuState===1)return s;let t=s.buttonElement?lt.Tracked(Il(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:lt.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=nt(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=nt(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=Ds(s),f=nt(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=nt(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,...Ds(s),pendingShouldSort:!1}:s,10(s){return s.buttonPositionState.kind!=="Tracked"?s:{...s,buttonPositionState:lt.Moved}}};class zt extends Wa{constructor(t){super(t),Os(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)})]})}),Os(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=un.get(null);this.disposables.add(a.on(Ua.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(Sl(a.buttonElement,a.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new zt({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:lt.Idle})}reduce(t,n){return Tt(n.type,Xl,t,n)}}const Mn=l.createContext(null);function Ht(s){let t=l.useContext(Mn);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,En),n}return t}function En({id:s,__demoMode:t=!1}){let n=l.useMemo(()=>zt.new({id:s,__demoMode:t}),[]);return Ga(()=>n.dispose()),n}let Yl=l.Fragment;function Zl(s,t){let n=l.useId(),{__demoMode:a=!1,...r}=s,i=En({id:n,__demoMode:a}),[o,u,d]=fe(i,k=>[k.menuState,k.itemsElement,k.buttonElement]),f=_e(t),c=un.get(null),x=fe(c,l.useCallback(k=>c.selectors.isTop(k,n),[c,n]));ar(x,[d,u],(k,h)=>{var w;i.send({type:V.CloseMenu}),rr(h,lr.Loose)||(k.preventDefault(),(w=i.state.buttonElement)==null||w.focus())});let y=ee(()=>{i.send({type:V.CloseMenu})}),g=Re({open:o===ne.Open,close:y}),m={ref:f},j=ye();return re.createElement(Cl,null,re.createElement(Mn.Provider,{value:i},re.createElement(ir,{value:Tt(o,{[ne.Open]:ct.Open,[ne.Closed]:ct.Closed})},j({ourProps:m,theirProps:r,slot:g,defaultTag:Yl,name:"Menu"}))))}let ei="button";function ti(s,t){let n=Ht("Menu.Button"),a=l.useId(),{id:r=`headlessui-menu-button-${a}`,disabled:i=!1,autoFocus:o=!1,...u}=s,d=l.useRef(null),f=bl(),c=_e(t,d,vl(),ee(N=>n.send({type:V.SetButtonElement,element:N}))),x=ee(N=>{switch(N.key){case Q.Space:case Q.Enter:case Q.ArrowDown:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.First}});break;case Q.ArrowUp:N.preventDefault(),N.stopPropagation(),n.send({type:V.OpenMenu,focus:{focus:Y.Last}});break}}),y=ee(N=>{switch(N.key){case Q.Space:N.preventDefault();break}}),[g,m,j]=fe(n,N=>[N.menuState,N.buttonElement,N.itemsElement]),k=g===ne.Open;_l(k,{trigger:m,action:l.useCallback(N=>{if(m!=null&&m.contains(N.target))return at.Ignore;let C=N.target.closest('[role="menuitem"]:not([data-disabled])');return Ka(C)?at.Select(C):j!=null&&j.contains(N.target)?at.Ignore:at.Close},[m,j]),close:l.useCallback(()=>n.send({type:V.CloseMenu}),[]),select:l.useCallback(N=>N.click(),[])});let h=Rl(N=>{var C;i||(g===ne.Open?(Rt.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:R,hoverProps:b}=At({isDisabled:i}),{pressed:I,pressProps:T}=qa({disabled:i}),_=Re({open:g===ne.Open,active:I||g===ne.Open,disabled:i,hover:R,focus:w,autofocus:o}),p=mt(f(),{ref:c,id:r,type:Va(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:ei,name:"Menu.Button"})}let si="div",ni=Cs.RenderStrategy|Cs.Static;function ai(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=jl(r),c=Ht("Menu.Items"),[x,y]=Nl(f),g=wl(),[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),R=ks(m);f&&(i=!0);let b=Ja(),[I,T]=Qa(u,m,b!==null?(b&ct.Open)===ct.Open:h===ne.Open);Xa(I,w,()=>{c.send({type:V.CloseMenu})});let _=fe(c,O=>O.__demoMode),p=_?!1:o&&h===ne.Open;Ya(p,R);let N=_?!1:o&&h===ne.Open;Za(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&&(rt(O)||O.focus({preventScroll:!0}))},[h,m]),Tl(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=er(),L=ee(O=>{var q,J,B;switch(v.dispose(),O.key){case Q.Space:if(c.state.searchQuery!=="")return O.preventDefault(),O.stopPropagation(),c.send({type:V.Search,value:O.key});case Q.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}),pn(c.state.buttonElement);break;case Q.ArrowDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Next});case Q.ArrowUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Previous});case Q.Home:case Q.PageUp:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.First});case Q.End:case Q.PageDown:return O.preventDefault(),O.stopPropagation(),c.send({type:V.GoToItem,focus:Y.Last});case Q.Escape:O.preventDefault(),O.stopPropagation(),Rt.flushSync(()=>c.send({type:V.CloseMenu})),(B=c.state.buttonElement)==null||B.focus({preventScroll:!0});break;case Q.Tab:O.preventDefault(),O.stopPropagation(),Rt.flushSync(()=>c.send({type:V.CloseMenu})),tr(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 Q.Space:O.preventDefault();break}}),D=Re({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":kl(I,w,!0).width},...sr(T)}),G=ye();return re.createElement(nr,{enabled:i?s.static||I:!1,ownerDocument:E},G({ourProps:$,theirProps:d,slot:D,defaultTag:si,features:ni,visible:C,name:"Menu.Items"}))}let ri=l.Fragment;function li(s,t){let n=l.useId(),{id:a=`headlessui-menu-item-${n}`,disabled:r=!1,...i}=s,o=Ht("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 cr().requestAnimationFrame(()=>{var C,v;(v=(C=d.current)==null?void 0:C.scrollIntoView)==null||v.call(C,{block:"nearest"})})},[c,d]);let x=Pl(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}),pn(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}))}),[R,b]=pt(),[I,T]=Ft(),_=Re({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":R,"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 re.createElement(b,null,re.createElement(T,null,N({ourProps:p,theirProps:i,slot:_,defaultTag:ri,name:"Menu.Item"})))}let ii="div";function oi(s,t){let[n,a]=pt(),r=s,i={ref:t,"aria-labelledby":n,role:"group"},o=ye();return re.createElement(a,null,o({ourProps:i,theirProps:r,slot:{},defaultTag:ii,name:"Menu.Section"}))}let ci="header";function di(s,t){let n=l.useId(),{id:a=`headlessui-menu-heading-${n}`,...r}=s,i=or();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:ci,name:"Menu.Heading"})}let ui="div";function mi(s,t){let n=s,a={ref:t,role:"separator"};return ye()({ourProps:a,theirProps:n,slot:{},defaultTag:ui,name:"Menu.Separator"})}let pi=ge(Zl),Pn=ge(ti),Tn=ge(ai),Et=ge(li),xi=ge(oi),hi=ge(di),$n=ge(mi),fi=Object.assign(pi,{Button:Pn,Items:Tn,Item:Et,Section:xi,Heading:hi,Separator:$n});var gi=(s=>(s[s.RegisterOption=0]="RegisterOption",s[s.UnregisterOption=1]="UnregisterOption",s))(gi||{});let yi={0(s,t){let n=[...s.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...s,options:mn(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})}},Bt=l.createContext(null);Bt.displayName="RadioGroupDataContext";function Wt(s){let t=l.useContext(Bt);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wt),n}return t}let Ut=l.createContext(null);Ut.displayName="RadioGroupActionsContext";function Gt(s){let t=l.useContext(Ut);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Gt),n}return t}function bi(s,t){return Tt(t.type,yi,s,t)}let vi="div";function ji(s,t){let n=l.useId(),a=xn(),{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=El(f),[j,k]=l.useReducer(bi,{options:[]}),h=j.options,[w,E]=pt(),[R,b]=Ft(),I=l.useRef(null),T=_e(I,t),_=dr(x),[p,N]=ur(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 Q.Enter:mr(A.currentTarget);break;case Q.ArrowLeft:case Q.ArrowUp:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Previous|Oe.WrapAround)===Is.Success){let F=h.find(W=>rt(W.element.current));F&&L(F.propsRef.current.value)}break;case Q.ArrowRight:case Q.ArrowDown:if(A.preventDefault(),A.stopPropagation(),Ss(z,Oe.Next|Oe.WrapAround)===Is.Success){let F=h.find(W=>rt(W.element.current));F&&L(F.propsRef.current.value)}break;case Q.Space:{A.preventDefault(),A.stopPropagation();let F=h.find(W=>rt(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":R,onKeyDown:S},q=Re({value:p}),J=l.useCallback(()=>{if(_!==void 0)return L(_)},[L,_]),B=ye();return re.createElement(b,{name:"RadioGroup.Description"},re.createElement(E,{name:"RadioGroup.Label"},re.createElement(Ut.Provider,{value:G},re.createElement(Bt.Provider,{value:$},u!=null&&re.createElement(pr,{disabled:c,data:{[u]:p||"on"},overrides:{type:"radio",checked:p!=null},form:o,onReset:J}),B({ourProps:O,theirProps:g,slot:q,defaultTag:vi,name:"RadioGroup"})))))}let Ni="div";function wi(s,t){var n;let a=Wt("RadioGroup.Option"),r=Gt("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=hn({value:u,disabled:d});De(()=>r.registerOption({id:o,element:x,propsRef:h}),[o,r,x,h]);let w=ee(v=>{var L;if(fn(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:R,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=Re({checked:_,disabled:d,active:R,hover:I,focus:R,autofocus:f}),C=ye();return re.createElement(k,{name:"RadioGroup.Description"},re.createElement(m,{name:"RadioGroup.Label"},C({ourProps:p,theirProps:c,slot:N,defaultTag:Ni,name:"RadioGroup.Option"})))}let ki="span";function Ci(s,t){var n;let a=Wt("Radio"),r=Gt("Radio"),i=l.useId(),o=xr(),u=xn(),{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=hr(),k=fr(),h=hn({value:f,disabled:c});De(()=>r.registerOption({id:d,element:g,propsRef:h}),[d,r,g,h]);let w=ee(C=>{var v;if(fn(C.currentTarget))return C.preventDefault();r.change(f)&&((v=g.current)==null||v.focus())}),{isFocusVisible:E,focusProps:R}=$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},R,I),N=Re({checked:_,disabled:c,hover:b,focus:E,autofocus:x});return ye()({ourProps:p,theirProps:y,slot:N,defaultTag:ki,name:"Radio"})}let Si=ge(ji),Ii=ge(wi),jt=ge(Ci),_i=Ze,Ri=xt,Mi=Object.assign(Si,{Option:Ii,Radio:jt,Label:_i,Description:Ri});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -76,6 +76,6 @@ import{aU as Wa,fG as ws,aW as un,aX as Ua,aV as Tt,aY as mn,r as l,aZ as Ga,a_ `).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 Kn(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 No=new Set(["🟢","🟡","🟠","🔴","🟣","🟤"]);function qn(s){let t="";for(const x of No)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 Vn(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 Jn(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 Qn(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 ko)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 ta(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 Co=new Set(["🐱","🐈","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐾","👂","🐟","🧶","🥛"]);function sa(s){if(!/\bcats?\b/i.test(s))return null;const t=s.slice(-4);for(const n of Co)if(t.includes(n))return s;return null}const So=[{type:"dice",test:Ln},{type:"joke",test:zn},{type:"dadjoke",test:Hn},{type:"magic8",test:Bn},{type:"weather-alert",test:Wn},{type:"satpass",test:Yn},{type:"aurora",test:Zn},{type:"moon",test:Xn},{type:"sun",test:Qn},{type:"hfcond",test:Jn},{type:"solar",test:Vn},{type:"aqi",test:qn},{type:"sports",test:ea},{type:"stats",test:ta},{type:"path",test:Kn},{type:"weather-multiday",test:Un},{type:"weather-hourly",test:Gn},{type:"test",test:Dn},{type:"weather",test:On},{type:"catfact",test:sa}];function na(s){for(const{type:t,test:n}of So)if(n(s)!=null)return t;return null}function Io(s,t){switch(t){case"weather":return On(s);case"weather-multiday":return Un(s);case"weather-hourly":return Gn(s);case"weather-alert":return Wn(s);case"test":return Dn(s);case"path":return Kn(s);case"aqi":return qn(s);case"solar":return Vn(s);case"hfcond":return Jn(s);case"sun":return Qn(s);case"moon":return Xn(s);case"satpass":return Yn(s);case"aurora":return Zn(s);case"dice":return Ln(s);case"joke":return zn(s);case"dadjoke":return Hn(s);case"magic8":return Bn(s);case"sports":return ea(s);case"stats":return ta(s);case"catfact":return sa(s);default:return null}}const aa=/[\u{1F916}\u{1F9BE}\u{1F9BF}]/u;function _o(s,t,n){if(t==="bot")return!0;if(t==="not-bot")return!1;if(aa.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)na(i)!=null&&a++;if(a>=Math.ceil(r.length*.6))return!0}return!1}function ra(s){return aa.test(s)||/bot\b/i.test(s)}const la="pymc_howl_bot_overrides";function Ro(){try{const s=localStorage.getItem(la);if(!s)return new Map;const t=JSON.parse(s);return new Map(t)}catch{return new Map}}function Hs(s){try{localStorage.setItem(la,JSON.stringify([...s]))}catch{}}const ia=yr(s=>({overrides:Ro(),setOverride:(t,n)=>s(a=>{const r=new Map(a.overrides);return r.set(t,n),Hs(r),{overrides:r}}),clearOverride:t=>s(n=>{const a=new Map(n.overrides);return a.delete(t),Hs(a),{overrides:a}})}));function oa(s){return ia(t=>t.overrides.get(s))}function Mo(){return ia(s=>s.setOverride)}const ca="pymc_companion_contacts_micro",da="pymc_companion_favorites",St=56;function Bs(){try{return localStorage.getItem(ca)==="1"}catch{return!1}}function Eo(s){try{localStorage.setItem(ca,s?"1":"0")}catch{}}function Po(){try{const s=localStorage.getItem(da);return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}function To(s){try{localStorage.setItem(da,JSON.stringify([...s]))}catch{}}function $o({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:M(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(gl,{rssi:r.rssi,snr:r.snr,compact:!0,showValues:!1}):e.jsx(Ke,{className:M(u,"text-sys-blue")})})}if(i===3)return e.jsx("div",{className:M(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px] ring-sys-pink"),children:e.jsx(ht,{className:M(u,"text-sys-pink")})});if(!s)return e.jsx("div",{className:M(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:M(o,"relative clay-avatar",d?"text-base":"text-white text-[11px] font-bold"),style:{"--avatar-color":f},children:d||c})}const Ws=[{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 Ao(s){const t=(s.adv_type??0)&15;return t===3?"room":t===2?"repeater":"companion"}const Fo=4e3,Oo=5e3,Do=2e3,Lo=8,zo=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=br(t.public_key),w=vr(t.public_key),E=oa(t.public_key),R=Mo(),b=E==="bot"||E==null&&ra(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"?Oo:Do);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 X=new ResizeObserver(W);return X.observe(F),()=>X.disconnect()},[G]);const O=l.useCallback(()=>{T(!0),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>T(!1),Fo)},[]),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 X=m.advertCount,me=3,be=X+me;return{rssi:Math.round((m.rssi*X+w.rssi*me)/be),snr:(m.snr*X+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:M("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:M("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(jr,{borderRadius:Lo,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:M("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($o,{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(Ls,{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:M("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:M("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(fi,{as:"div",className:"absolute inset-0",children:({open:F})=>e.jsxs(e.Fragment,{children:[e.jsx(Pn,{className:M("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(zi,{className:M("h-3.5 w-3.5 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-blue")})}),e.jsxs(Tn,{anchor:"right start",transition:!0,className:M("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(qe,{className:"w-4 h-4"}),onClick:()=>{d==null||d({type:"contact",id:t.public_key})},children:"Details"}),f&&e.jsx(ke,{icon:e.jsx($l,{className:"w-4 h-4"}),onClick:()=>f(t.public_key),children:"Share"}),e.jsx(ke,{icon:e.jsx(Qe,{className:"w-4 h-4"}),onClick:()=>u({type:"contact",id:t.public_key}),children:"Set Path"}),c&&e.jsx(ke,{icon:e.jsx(jn,{className:"w-4 h-4"}),onClick:()=>c(t.public_key),children:"Reset Path"}),y&&e.jsx(ke,{icon:e.jsx(Di,{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(Xe,{className:"w-4 h-4"}),destructive:!0,onClick:O,children:"Remove Contact"}),e.jsx(ro,{}),e.jsx(ke,{icon:b?e.jsx($i,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Ls,{className:"w-4 h-4 text-sys-violet"}),onClick:()=>R(t.public_key,b?"not-bot":"bot"),children:b?"Not a Bot":"Mark as HOWL Bot"}),e.jsx(ke,{icon:e.jsx(Yi,{className:M("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:M("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(Xe,{className:"w-4 h-4 text-white"})})]})})]})]},t.public_key)}),Us={excellent:4,good:3,fair:2,weak:1,poor:0};function Gs(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 Ho(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=Gs(i.public_key,a,r),c=Gs(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=Us[Ts(f)]??0,y=Us[Ts(c)]??0;if(x!==y)return y-x}}return(i.name||"").localeCompare(o.name||"")})}const Bo=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(Bs),[R,b]=l.useState(Bs),[I,T]=l.useState(""),[_,p]=l.useState(!1),[N,C]=l.useState(Po),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;Eo(z);const F=L.current;if(z&&b(!0),F){let W=0;const X=F.parentElement;if(z)W=(X==null?void 0:X.offsetWidth)??F.offsetWidth;else if(X){const be=X.style.width;X.style.width="var(--companion-side)",W=X.offsetWidth,X.style.width=be}const me=z?St:Math.round(m/100*W);it(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),To(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 X;return((X=W.name)==null?void 0:X.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 Ws)A.set(z.key,[]);for(const z of O)A.get(Ao(z)).push(z);return Ws.map(z=>({...z,items:Ho(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:M("flex-shrink-0 overflow-hidden flex flex-col h-full",k),style:{width:w?St:`${m}%`},children:[e.jsx("div",{className:M("flex items-center border-b border-edge-subtle flex-shrink-0",R?"justify-center p-2":"gap-2 px-3 py-2"),children:R?e.jsx("button",{onClick:D,className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Expand contacts",children:e.jsx(qi,{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:M("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($s,{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(Gi,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]})}),!R&&G&&e.jsxs("div",{className:"relative px-2.5 py-2 border-b border-edge-subtle/50 flex-shrink-0",children:[e.jsx($s,{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:M("flex-1 overflow-y-auto min-h-0",R?"px-0":"px-1.5"),style:{contain:"layout style paint"},children:[J.map(A=>{const z=A.icon;return e.jsxs(Me,{defaultOpen:!0,className:"mb-1",children:[e.jsxs(Ee,{className:M("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:M("w-3.5 h-3.5",A.color)}),!R&&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(zo,{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:R,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 Wo({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]),R=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(An,{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(Ve,{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(Je,{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:M("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:M("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:[R+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:M("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:M("text-sm truncate",p.status==="done"?"text-fg-primary":"text-fg-secondary"),children:p.name})]}),e.jsx("span",{className:M("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(Ve,{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(Je,{className:"w-3.5 h-3.5"}),b," failed"]}),e.jsxs(U,{color:"primary",onClick:t,children:[e.jsx(Fl,{className:"w-4 h-4"}),"Done — ",R," imported"]})]})]})]})}const Uo=4e3;function Go(s){const t=s.frequency_hz/1e3,n=s.bandwidth_hz/1e3;return`${t} · SF${s.spreading_factor} · ${n}k`}const Ko=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),Uo)},[]),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:M("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:M("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:M("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:M("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:Go(o)})]}),r&&e.jsx("div",{className:M("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:M("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(Xe,{className:M("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:M("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(Xe,{className:"w-4 h-4 text-white"})})]})})]})})}),qo=l.memo(l.forwardRef(function({channels:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onAddChannel:o,onDeleteChannel:u,className:d},f){const c=Nr(),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 R=w.name.toLowerCase()==="public",b=E.name.toLowerCase()==="public";if(R&&!b)return-1;if(!R&&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:M("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(Ve,{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(Ye,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]}),e.jsx(Wo,{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(Ye,{className:"w-3.5 h-3.5"}),"Add Channel"]})]}):e.jsx(ve,{initial:!1,mode:"popLayout",children:m.map(k=>e.jsx(Ko,{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 Vo(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 Jo(s){const t=gt(),n=wr(),a=kr(),r=t==null?void 0:t.node_name,i=l.useMemo(()=>r?Vo(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:M("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]})}),Qo=new Set(["☀️","🌤","🌤️"]),Xo=new Set(["⛅","⛅️"]),Yo=new Set(["☁️","🌫","🌫️"]),Zo=new Set(["🌧","🌧️","🌦","🌦️","⛈","⛈️","🌩","🌩️"]),ec=new Set(["❄️","🌨","🌨️"]);function tc(s){return Qo.has(s)?"bg-gradient-to-br from-[var(--sys-blue)]/20 to-[var(--sys-indigo)]/10":Xo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-blue)]/15":Yo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60":Zo.has(s)?"bg-gradient-to-br from-[var(--zinc-900)]/80 to-[var(--zinc-700)]/60":ec.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 sc({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 nc=l.memo(function({data:t}){const n=t.periods[0],a=t.periods.slice(1),r=tc(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(sc,{period:i},o))})]})}),ac=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))})})}),rc=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:M("text-[9px] tabular-nums font-medium",n.precipChance>=50?"text-sys-blue":"text-sys-blue/60"),children:[n.precipChance,"%"]})]},a))})})});function lc(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 ic={red:"border-l-sys-red",amber:"border-l-sys-amber"},oc={red:"text-sys-red",amber:"text-sys-amber"},cc=l.memo(function({data:t}){const n=lc(t.severity);return e.jsx(Z,{compact:!0,hideBadge:!0,children:e.jsxs("div",{className:M("border-l-[3px] pl-2.5 -ml-0.5",ic[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:M("text-[10px] font-bold uppercase tracking-wider",oc[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})]})})}),dc={high:"🎯",medium:"📍",low:"❓"};function uc({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:M("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:dc[s.confidence]})]})]})}const mc=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(uc,{hop:n},a))})]})});function pc(s){return s>=10?5:s>=6?4:s>=3?3:s>=0?2:s>=-5?1:0}function xc(s){return s>=4?"bg-sys-green":s>=3?"bg-sys-amber":s>=2?"bg-sys-orange":"bg-sys-red"}function hc({bars:s}){const t=xc(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:M("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 gc(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 yc=l.memo(function({data:t}){const{text:n,bg:a}=gc(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:M("flex items-center justify-center w-12 h-12 rounded-xl",a),children:e.jsx("span",{className:M("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:M("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 bc(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:M("text-sm font-semibold tabular-nums text-fg-primary",n),children:t})]})}const vc=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:bc(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 jc(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 Ks({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:M("text-[10px] font-semibold px-1.5 py-0.5 rounded",jc(s.condition)),children:s.condition})]})}const Nc=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(Ks,{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(Ks,{band:r},i))]})]})]})});function wc({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 kc=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(wc,{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),"°"]})]})]})}),Cc=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),"°"]})]})]})}),Sc=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 Ic(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 _c=l.memo(function({data:t}){const n=Ic(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})]})]})}),Rc=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})]})]})}),qs=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})})]})})}),Mc=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))})})}),Ec=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)})})]})}),Pc=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 Tc({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:hl(s)})})}const $c=l.memo(function({text:t,messageType:n}){const a=l.useMemo(()=>n?Io(t,n):null,[t,n]);if(a)switch(n){case"weather":return e.jsx(nc,{data:a});case"weather-multiday":return e.jsx(ac,{data:a});case"weather-hourly":return e.jsx(rc,{data:a});case"weather-alert":return e.jsx(cc,{data:a});case"path":return e.jsx(mc,{data:a});case"test":return e.jsx(fc,{data:a});case"aqi":return e.jsx(yc,{data:a});case"solar":return e.jsx(vc,{data:a});case"hfcond":return e.jsx(Nc,{data:a});case"sun":return e.jsx(kc,{data:a});case"moon":return e.jsx(Cc,{data:a});case"satpass":return e.jsx(Sc,{data:a});case"aurora":return e.jsx(_c,{data:a});case"dice":return e.jsx(Rc,{data:a});case"joke":return e.jsx(qs,{data:a});case"dadjoke":return e.jsx(qs,{data:a,isDadJoke:!0});case"sports":return e.jsx(Mc,{data:a});case"stats":return e.jsx(Ec,{data:a});case"catfact":return e.jsx(Pc,{data:a})}return e.jsx(Tc,{text:t})}),Ac=l.lazy(()=>gn(()=>import("./CompanionPathMap-CXIYZL2H.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(s=>({default:s.CompanionPathMap}))),Fc=l.lazy(()=>gn(()=>import("./CompanionEchoMap-D-ZiSBZa.js"),__vite__mapDeps([12,1,2,3,4,5,9,10,11])).then(s=>({default:s.CompanionEchoMap}))),Vs=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 Oc(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 Dc(s){const t=new Date(s*1e3);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Lc(s){const t=new Map;for(const n of s)n.name&&t.set(n.public_key,n.name);return t}function zc(s){const t=new Map;for(const n of s)t.set(n.public_key,n);return t}function Hc(s){if(!s)return[];const t=[];for(let n=0;n64?t&63:t}function Wc(s,t){const n=t.find(a=>a.public_key.startsWith(s));return(n==null?void 0:n.name)||null}function Js(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 Uc=new Set(["🎭","🥸"]);function Gc({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:M("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:fl(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 Kc=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=Bc(t.path_len),h=!t.is_outgoing,w=h&&k!=null,E=t.is_outgoing&&t.is_channel&&(i??0)>0,R=(o==null?void 0:o.toLowerCase().includes("wardrive"))??!1,b=l.useMemo(()=>R&&h?Ll(t.text):null,[R,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.slice(0,64),snr:t.path_snr,rssi:t.path_rssi});else if(h&&(n!=null&&n.out_path)){const D=Hc(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:M("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:M("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(Qe,{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(Qe,{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 $=Wc(S,a);return e.jsxs("span",{className:"contents",children:[D>0&&e.jsx(Hl,{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(yl,{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:Vs,children:e.jsx(Ac,{hops:p.hops,contacts:a,selfInfo:r,snr:C,wardriveCoords:b??void 0,wardriveSenderName:t.sender_name,channelMessages:R?u:void 0,messageTimestamp:t.timestamp})})]}),x&&E&&e.jsx("div",{className:"mt-1.5",children:e.jsx(l.Suspense,{fallback:Vs,children:e.jsx(Fc,{text:t.text,timestamp:t.timestamp,contacts:a})})})]})})]})}),qc=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 R=l.useMemo(()=>Lc(n),[n]),b=l.useMemo(()=>zc(n),[n]),I=gt(),T=Jo(t),_=oa(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 _o(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||!Uc.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 ko)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 ta(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 Co=new Set(["🐱","🐈","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐾","👂","🐟","🧶","🥛"]);function sa(s){if(!/\bcats?\b/i.test(s))return null;const t=s.slice(-4);for(const n of Co)if(t.includes(n))return s;return null}const So=[{type:"dice",test:Ln},{type:"joke",test:zn},{type:"dadjoke",test:Hn},{type:"magic8",test:Bn},{type:"weather-alert",test:Wn},{type:"satpass",test:Yn},{type:"aurora",test:Zn},{type:"moon",test:Xn},{type:"sun",test:Qn},{type:"hfcond",test:Jn},{type:"solar",test:Vn},{type:"aqi",test:qn},{type:"sports",test:ea},{type:"stats",test:ta},{type:"path",test:Kn},{type:"weather-multiday",test:Un},{type:"weather-hourly",test:Gn},{type:"test",test:Dn},{type:"weather",test:On},{type:"catfact",test:sa}];function na(s){for(const{type:t,test:n}of So)if(n(s)!=null)return t;return null}function Io(s,t){switch(t){case"weather":return On(s);case"weather-multiday":return Un(s);case"weather-hourly":return Gn(s);case"weather-alert":return Wn(s);case"test":return Dn(s);case"path":return Kn(s);case"aqi":return qn(s);case"solar":return Vn(s);case"hfcond":return Jn(s);case"sun":return Qn(s);case"moon":return Xn(s);case"satpass":return Yn(s);case"aurora":return Zn(s);case"dice":return Ln(s);case"joke":return zn(s);case"dadjoke":return Hn(s);case"magic8":return Bn(s);case"sports":return ea(s);case"stats":return ta(s);case"catfact":return sa(s);default:return null}}const aa=/[\u{1F916}\u{1F9BE}\u{1F9BF}]/u;function _o(s,t,n){if(t==="bot")return!0;if(t==="not-bot")return!1;if(aa.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)na(i)!=null&&a++;if(a>=Math.ceil(r.length*.6))return!0}return!1}function ra(s){return aa.test(s)||/bot\b/i.test(s)}const la="pymc_howl_bot_overrides";function Ro(){try{const s=localStorage.getItem(la);if(!s)return new Map;const t=JSON.parse(s);return new Map(t)}catch{return new Map}}function Hs(s){try{localStorage.setItem(la,JSON.stringify([...s]))}catch{}}const ia=yr(s=>({overrides:Ro(),setOverride:(t,n)=>s(a=>{const r=new Map(a.overrides);return r.set(t,n),Hs(r),{overrides:r}}),clearOverride:t=>s(n=>{const a=new Map(n.overrides);return a.delete(t),Hs(a),{overrides:a}})}));function oa(s){return ia(t=>t.overrides.get(s))}function Mo(){return ia(s=>s.setOverride)}const ca="pymc_companion_contacts_micro",da="pymc_companion_favorites",St=56;function Bs(){try{return localStorage.getItem(ca)==="1"}catch{return!1}}function Eo(s){try{localStorage.setItem(ca,s?"1":"0")}catch{}}function Po(){try{const s=localStorage.getItem(da);return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}function To(s){try{localStorage.setItem(da,JSON.stringify([...s]))}catch{}}function $o({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:M(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(gl,{rssi:r.rssi,snr:r.snr,compact:!0,showValues:!1}):e.jsx(Ke,{className:M(u,"text-sys-blue")})})}if(i===3)return e.jsx("div",{className:M(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px] ring-sys-pink"),children:e.jsx(ht,{className:M(u,"text-sys-pink")})});if(!s)return e.jsx("div",{className:M(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:M(o,"relative clay-avatar",d?"text-base":"text-white text-[11px] font-bold"),style:{"--avatar-color":f},children:d||c})}const Ws=[{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 Ao(s){const t=(s.adv_type??0)&15;return t===3?"room":t===2?"repeater":"companion"}const Fo=4e3,Oo=5e3,Do=2e3,Lo=8,zo=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=br(t.public_key),w=vr(t.public_key),E=oa(t.public_key),R=Mo(),b=E==="bot"||E==null&&ra(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"?Oo:Do);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 X=new ResizeObserver(W);return X.observe(F),()=>X.disconnect()},[G]);const O=l.useCallback(()=>{T(!0),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>T(!1),Fo)},[]),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 X=m.advertCount,me=3,be=X+me;return{rssi:Math.round((m.rssi*X+w.rssi*me)/be),snr:(m.snr*X+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:M("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:M("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(jr,{borderRadius:Lo,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:M("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($o,{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(Ls,{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:M("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:M("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(fi,{as:"div",className:"absolute inset-0",children:({open:F})=>e.jsxs(e.Fragment,{children:[e.jsx(Pn,{className:M("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(zi,{className:M("h-3.5 w-3.5 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-blue")})}),e.jsxs(Tn,{anchor:"right start",transition:!0,className:M("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(qe,{className:"w-4 h-4"}),onClick:()=>{d==null||d({type:"contact",id:t.public_key})},children:"Details"}),f&&e.jsx(ke,{icon:e.jsx($l,{className:"w-4 h-4"}),onClick:()=>f(t.public_key),children:"Share"}),e.jsx(ke,{icon:e.jsx(Qe,{className:"w-4 h-4"}),onClick:()=>u({type:"contact",id:t.public_key}),children:"Set Path"}),c&&e.jsx(ke,{icon:e.jsx(jn,{className:"w-4 h-4"}),onClick:()=>c(t.public_key),children:"Reset Path"}),y&&e.jsx(ke,{icon:e.jsx(Di,{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(Xe,{className:"w-4 h-4"}),destructive:!0,onClick:O,children:"Remove Contact"}),e.jsx(ro,{}),e.jsx(ke,{icon:b?e.jsx($i,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Ls,{className:"w-4 h-4 text-sys-violet"}),onClick:()=>R(t.public_key,b?"not-bot":"bot"),children:b?"Not a Bot":"Mark as HOWL Bot"}),e.jsx(ke,{icon:e.jsx(Yi,{className:M("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:M("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(Xe,{className:"w-4 h-4 text-white"})})]})})]})]},t.public_key)}),Us={excellent:4,good:3,fair:2,weak:1,poor:0};function Gs(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 Ho(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=Gs(i.public_key,a,r),c=Gs(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=Us[Ts(f)]??0,y=Us[Ts(c)]??0;if(x!==y)return y-x}}return(i.name||"").localeCompare(o.name||"")})}const Bo=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(Bs),[R,b]=l.useState(Bs),[I,T]=l.useState(""),[_,p]=l.useState(!1),[N,C]=l.useState(Po),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;Eo(z);const F=L.current;if(z&&b(!0),F){let W=0;const X=F.parentElement;if(z)W=(X==null?void 0:X.offsetWidth)??F.offsetWidth;else if(X){const be=X.style.width;X.style.width="var(--companion-side)",W=X.offsetWidth,X.style.width=be}const me=z?St:Math.round(m/100*W);it(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),To(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 X;return((X=W.name)==null?void 0:X.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 Ws)A.set(z.key,[]);for(const z of O)A.get(Ao(z)).push(z);return Ws.map(z=>({...z,items:Ho(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:M("flex-shrink-0 overflow-hidden flex flex-col h-full",k),style:{width:w?St:`${m}%`},children:[e.jsx("div",{className:M("flex items-center border-b border-edge-subtle flex-shrink-0",R?"justify-center p-2":"gap-2 px-3 py-2"),children:R?e.jsx("button",{onClick:D,className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Expand contacts",children:e.jsx(qi,{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:M("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($s,{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(Gi,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]})}),!R&&G&&e.jsxs("div",{className:"relative px-2.5 py-2 border-b border-edge-subtle/50 flex-shrink-0",children:[e.jsx($s,{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:M("flex-1 overflow-y-auto min-h-0",R?"px-0":"px-1.5"),style:{contain:"layout style paint"},children:[J.map(A=>{const z=A.icon;return e.jsxs(Me,{defaultOpen:!0,className:"mb-1",children:[e.jsxs(Ee,{className:M("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:M("w-3.5 h-3.5",A.color)}),!R&&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(zo,{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:R,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 Wo({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]),R=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(An,{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(Ve,{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(Je,{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:M("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:M("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:[R+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:M("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:M("text-sm truncate",p.status==="done"?"text-fg-primary":"text-fg-secondary"),children:p.name})]}),e.jsx("span",{className:M("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(Ve,{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(Je,{className:"w-3.5 h-3.5"}),b," failed"]}),e.jsxs(U,{color:"primary",onClick:t,children:[e.jsx(Fl,{className:"w-4 h-4"}),"Done — ",R," imported"]})]})]})]})}const Uo=4e3;function Go(s){const t=s.frequency_hz/1e3,n=s.bandwidth_hz/1e3;return`${t} · SF${s.spreading_factor} · ${n}k`}const Ko=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),Uo)},[]),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:M("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:M("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:M("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:M("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:Go(o)})]}),r&&e.jsx("div",{className:M("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:M("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(Xe,{className:M("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:M("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(Xe,{className:"w-4 h-4 text-white"})})]})})]})})}),qo=l.memo(l.forwardRef(function({channels:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onAddChannel:o,onDeleteChannel:u,className:d},f){const c=Nr(),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 R=w.name.toLowerCase()==="public",b=E.name.toLowerCase()==="public";if(R&&!b)return-1;if(!R&&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:M("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(Ve,{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(Ye,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]}),e.jsx(Wo,{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(Ye,{className:"w-3.5 h-3.5"}),"Add Channel"]})]}):e.jsx(ve,{initial:!1,mode:"popLayout",children:m.map(k=>e.jsx(Ko,{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 Vo(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 Jo(s){const t=gt(),n=wr(),a=kr(),r=t==null?void 0:t.node_name,i=l.useMemo(()=>r?Vo(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:M("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]})}),Qo=new Set(["☀️","🌤","🌤️"]),Xo=new Set(["⛅","⛅️"]),Yo=new Set(["☁️","🌫","🌫️"]),Zo=new Set(["🌧","🌧️","🌦","🌦️","⛈","⛈️","🌩","🌩️"]),ec=new Set(["❄️","🌨","🌨️"]);function tc(s){return Qo.has(s)?"bg-gradient-to-br from-[var(--sys-blue)]/20 to-[var(--sys-indigo)]/10":Xo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-blue)]/15":Yo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60":Zo.has(s)?"bg-gradient-to-br from-[var(--zinc-900)]/80 to-[var(--zinc-700)]/60":ec.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 sc({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 nc=l.memo(function({data:t}){const n=t.periods[0],a=t.periods.slice(1),r=tc(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(sc,{period:i},o))})]})}),ac=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))})})}),rc=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:M("text-[9px] tabular-nums font-medium",n.precipChance>=50?"text-sys-blue":"text-sys-blue/60"),children:[n.precipChance,"%"]})]},a))})})});function lc(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 ic={red:"border-l-sys-red",amber:"border-l-sys-amber"},oc={red:"text-sys-red",amber:"text-sys-amber"},cc=l.memo(function({data:t}){const n=lc(t.severity);return e.jsx(Z,{compact:!0,hideBadge:!0,children:e.jsxs("div",{className:M("border-l-[3px] pl-2.5 -ml-0.5",ic[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:M("text-[10px] font-bold uppercase tracking-wider",oc[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})]})})}),dc={high:"🎯",medium:"📍",low:"❓"};function uc({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:M("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:dc[s.confidence]})]})]})}const mc=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(uc,{hop:n},a))})]})});function pc(s){return s>=10?5:s>=6?4:s>=3?3:s>=0?2:s>=-5?1:0}function xc(s){return s>=4?"bg-sys-green":s>=3?"bg-sys-amber":s>=2?"bg-sys-orange":"bg-sys-red"}function hc({bars:s}){const t=xc(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:M("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 gc(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 yc=l.memo(function({data:t}){const{text:n,bg:a}=gc(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:M("flex items-center justify-center w-12 h-12 rounded-xl",a),children:e.jsx("span",{className:M("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:M("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 bc(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:M("text-sm font-semibold tabular-nums text-fg-primary",n),children:t})]})}const vc=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:bc(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 jc(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 Ks({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:M("text-[10px] font-semibold px-1.5 py-0.5 rounded",jc(s.condition)),children:s.condition})]})}const Nc=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(Ks,{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(Ks,{band:r},i))]})]})]})});function wc({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 kc=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(wc,{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),"°"]})]})]})}),Cc=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),"°"]})]})]})}),Sc=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 Ic(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 _c=l.memo(function({data:t}){const n=Ic(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})]})]})}),Rc=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})]})]})}),qs=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})})]})})}),Mc=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))})})}),Ec=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)})})]})}),Pc=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 Tc({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:hl(s)})})}const $c=l.memo(function({text:t,messageType:n}){const a=l.useMemo(()=>n?Io(t,n):null,[t,n]);if(a)switch(n){case"weather":return e.jsx(nc,{data:a});case"weather-multiday":return e.jsx(ac,{data:a});case"weather-hourly":return e.jsx(rc,{data:a});case"weather-alert":return e.jsx(cc,{data:a});case"path":return e.jsx(mc,{data:a});case"test":return e.jsx(fc,{data:a});case"aqi":return e.jsx(yc,{data:a});case"solar":return e.jsx(vc,{data:a});case"hfcond":return e.jsx(Nc,{data:a});case"sun":return e.jsx(kc,{data:a});case"moon":return e.jsx(Cc,{data:a});case"satpass":return e.jsx(Sc,{data:a});case"aurora":return e.jsx(_c,{data:a});case"dice":return e.jsx(Rc,{data:a});case"joke":return e.jsx(qs,{data:a});case"dadjoke":return e.jsx(qs,{data:a,isDadJoke:!0});case"sports":return e.jsx(Mc,{data:a});case"stats":return e.jsx(Ec,{data:a});case"catfact":return e.jsx(Pc,{data:a})}return e.jsx(Tc,{text:t})}),Ac=l.lazy(()=>gn(()=>import("./CompanionPathMap-CqxSHGK1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(s=>({default:s.CompanionPathMap}))),Fc=l.lazy(()=>gn(()=>import("./CompanionEchoMap-Cad6Uf2W.js"),__vite__mapDeps([12,1,2,3,4,5,9,10,11])).then(s=>({default:s.CompanionEchoMap}))),Vs=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 Oc(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 Dc(s){const t=new Date(s*1e3);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Lc(s){const t=new Map;for(const n of s)n.name&&t.set(n.public_key,n.name);return t}function zc(s){const t=new Map;for(const n of s)t.set(n.public_key,n);return t}function Hc(s){if(!s)return[];const t=[];for(let n=0;n64?t&63:t}function Wc(s,t){const n=t.find(a=>a.public_key.startsWith(s));return(n==null?void 0:n.name)||null}function Js(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 Uc=new Set(["🎭","🥸"]);function Gc({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:M("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:fl(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 Kc=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=Bc(t.path_len),h=!t.is_outgoing,w=h&&k!=null,E=t.is_outgoing&&t.is_channel&&(i??0)>0,R=(o==null?void 0:o.toLowerCase().includes("wardrive"))??!1,b=l.useMemo(()=>R&&h?Ll(t.text):null,[R,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.slice(0,64),snr:t.path_snr,rssi:t.path_rssi});else if(h&&(n!=null&&n.out_path)){const D=Hc(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:M("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:M("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(Qe,{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(Qe,{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 $=Wc(S,a);return e.jsxs("span",{className:"contents",children:[D>0&&e.jsx(Hl,{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(yl,{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:Vs,children:e.jsx(Ac,{hops:p.hops,contacts:a,selfInfo:r,snr:C,wardriveCoords:b??void 0,wardriveSenderName:t.sender_name,channelMessages:R?u:void 0,messageTimestamp:t.timestamp})})]}),x&&E&&e.jsx("div",{className:"mt-1.5",children:e.jsx(l.Suspense,{fallback:Vs,children:e.jsx(Fc,{text:t.text,timestamp:t.timestamp,contacts:a})})})]})})]})}),qc=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 R=l.useMemo(()=>Lc(n),[n]),b=l.useMemo(()=>zc(n),[n]),I=gt(),T=Jo(t),_=oa(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 _o(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||!Uc.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:M("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=Dc($.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(Ol,{text:Oc($.timestamp)}),e.jsx(Kc,{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=Js($,R);if($.is_channel?ra(A):N){const F=C.get($.id)??$.text,W=na(F);return e.jsx(Gc,{senderName:A,timestamp:$.timestamp,signed:$.txt_type===_s.SignedPlain,children:e.jsx($c,{text:F,messageType:W})})}}return e.jsx(Dl,{senderName:Js($,R),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:M("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(zl,{className:"w-4 h-4 text-white"})})]})}),Vc=6,Jc=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,Vc)},[x,i]),w=h.length>0;l.useEffect(()=>{k(0)},[h]);const E=l.useCallback(()=>{y(null),m(-1),k(0)},[]),R=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(),R(h[j]);return}if(_.key==="Escape"){_.preventDefault(),E();return}}_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),b())},[b,w,h,j,R,E]);return e.jsxs("div",{className:M("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(),R(_)},className:M("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:M("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:M("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(Cr,{className:"w-4.5 h-4.5 -translate-x-[0.5px] translate-y-[0.5px]",strokeWidth:2.5})})]})}),Kt="pymc_companion_room_pwd_";function Qc(s){try{return localStorage.getItem(`${Kt}${s}`)}catch{return null}}function Xc(s,t){try{localStorage.setItem(`${Kt}${s}`,t)}catch{}}function Qs(s){try{localStorage.removeItem(`${Kt}${s}`)}catch{}}const Yc=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 R=Qc(j);if(!R){y(!0);return}y(!0),(async()=>{const b=await a(j,R);m.current&&(b||(Qs(j),c("Saved password rejected — please re-enter.")))})()},[j,x,n,a]);const h=l.useCallback(async()=>{c(null);const R=await a(j,i);m.current&&(R?u&&i?Xc(j,i):Qs(j):c("Login failed — check your password and try again."))},[j,i,u,a]),w=l.useCallback(R=>{R.key==="Enter"&&(R.preventDefault(),h())},[h]),E=n==="pending";return E&&!i?e.jsxs("div",{className:M("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:M("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(Nn,{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:R=>o(R.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:R=>d(R.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 Xs(s,t){return[s,t].sort().join("-")}function ot(s){return s.substring(0,2)}function Zc(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 ed(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=Ys(s,o),d=Ys(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=Zc(_),N=b.cost+1/p,C=f.get(T)??1/0;N{var L,S;const T=ot(b),_=j.get(T);let p=0;const N=g[I],C=Xs(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(ot),confidence:R,via:h}}function Ys(s,t){if(t.has(s))return s;const n=ot(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 Zs(s){switch(s&15){case 1:return"Companion";case 2:return"Repeater";case 3:return"Room Server";default:return"Unknown"}}function en(s){switch(s&15){case 1:return"blue";case 2:return"green";case 3:return"indigo";default:return"zinc"}}function td(s){return(s&15)===2}const tn=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,[R,b]=l.useState(E);if(E!==R&&(b(E),w({})),!t&&!n)return i?null:e.jsx("div",{className:M("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(ld,{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(nn,{pubkey:t.public_key})]}),e.jsx(Le,{color:en(t.adv_type),children:Zs(t.adv_type)})]})]}),i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{color:en(t.adv_type),children:Zs(t.adv_type)}),e.jsx(nn,{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(Qe,{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(wn,{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(kn,{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(od,{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(jn,{"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(Cn,{"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(Sn,{"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(Lt,{"data-slot":"icon"}),"Export Contact"]}),td(t.adv_type)&&e.jsxs(e.Fragment,{children:[e.jsx(cd,{pubkey:t.public_key,onLogin:f,onLogout:c,actionState:h,runAction:I}),e.jsx(dd,{pubkey:t.public_key,onGetNeighbours:x,actionState:h,runAction:I}),e.jsx(ud,{pubkey:t.public_key,contact:t,onTrace:y,actionState:h,runAction:I})]}),e.jsx(sd,{pubkey:t.public_key}),e.jsx(rd,{pubkey:t.public_key})]}):null,p=T??_;return i?e.jsx("div",{className:k,children:p}):e.jsx("div",{className:M("flex flex-col h-full overflow-y-auto",k),children:e.jsx(ve,{mode:"wait",children:n?e.jsx(oe.div,{variants:Bl,initial:"hidden",animate:"visible",exit:"exit",className:"p-4",children:T},`ch-${n.index}`):t?e.jsx(oe.div,{variants:Wl,initial:"hidden",animate:"visible",exit:"exit",className:"p-4",children:_},`contact-${t.public_key}`):null})})});function sn(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 sd({pubkey:s}){const t=Pr(s);return t?e.jsxs(Me,{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(Cn,{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:sn(t.totalUpTimeSecs)}),e.jsx(se,{label:"Air Time",value:sn(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 nd(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 ad(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 rd({pubkey:s}){const t=Tr(s);if(!t)return null;const n=bo(t.lppSensorData);return n.length===0?null:e.jsxs(Me,{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-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} ${nd(a.type)}`,value:`${typeof a.value=="number"?a.value.toFixed(a.type===103||a.type===116?2:0):a.value}${ad(a.type)}`},r))})})]})}function ld({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:M("w-14 h-14 clay-avatar",t?"text-2xl":"text-white text-lg font-bold"),style:{"--avatar-color":n},children:t||a})}function nn({pubkey:s}){return Sr().get(s)!==!0?null:e.jsx("span",{title:"Ed25519 verified identity",children:e.jsx(Ir,{className:"w-4 h-4 text-sys-green flex-shrink-0"})})}const It=64;function id(s){if(!s)return[];const t=[];for(let n=0;n0,b=id(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=ed(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(Me,{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(Qe,{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:R?`${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(As,{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:M("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(Kl,{"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(As,{className:"w-3 h-3"}),"Auto-route"]}),r&&e.jsxs("button",{onClick:()=>u("discover",()=>r(s.public_key)),disabled:i.discover==="loading",className:M("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(ql,{className:"w-3 h-3"}),i.discover==="loading"?"Discovering…":i.discover==="done"?"Discovered!":i.discover==="error"?"Failed":"Discover"]})]})})]})})]})}function cd({pubkey:s,onLogin:t,onLogout:n,actionState:a,runAction:r}){const[i,o]=l.useState(""),u=Ot(s);return t?e.jsxs(Me,{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(Rr,{"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 dd({pubkey:s,onGetNeighbours:t,actionState:n,runAction:a}){const r=Mr(s),i=Ot(s);return t?e.jsxs(Me,{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(Mt,{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(Mt,{"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:pd(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:M("h-full rounded-full",md(o.snr)),style:{width:`${Math.min(100,Math.max(5,(o.snr+20)/35*100))}%`}})}),e.jsx("span",{className:M("font-mono text-[9px] w-8 text-right",ut(o.snr)),children:o.snr.toFixed(1)})]})]},u))})]})})]}):null}function ud({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(Me,{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(Fs,{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(Fs,{"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:M("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:M("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 md(s){return s>5?"bg-sys-green":s>0?"bg-sys-amber":"bg-sys-red"}function pd(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 an=128,rn=/^[0-9a-fA-F]+$/;function xd({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),[R,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===an&&rn.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",solid:!0,children:[e.jsx(Te,{icon:e.jsx(_n,{className:"w-5 h-5"}),title:"Key Management",onClose:t}),e.jsxs(Se,{children:[R&&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:M("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(Ve,{className:"w-3.5 h-3.5"}):e.jsx(Lt,{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(Je,{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||R,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:rn.test(y)?`${y.length}/${an} 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(Je,{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||R,children:m?"Importing…":"Import Key"})]})]}),e.jsx(In,{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 ua(s){return s.settings??{}}const ma="pymc_companion_recent_regions",qt=8;function pa(){try{const s=localStorage.getItem(ma);return s?JSON.parse(s).slice(0,qt):[]}catch{return[]}}function hd(s){try{localStorage.setItem(ma,JSON.stringify(s.slice(0,qt)))}catch{}}function fd(s){const t=pa().filter(a=>a!==s);t.unshift(s);const n=t.slice(0,qt);return hd(n),n}function ln(s){return s.toLowerCase().replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function gd({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"),[R,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=ua(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",solid:!0,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?"Configured":"Not registered"}),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:R,children:R?"Saving…":i?"Save":"Create"})]})]})}function yd(){const s=zr(),t=bn(),{setFloodScope:n,clearFloodScope:a}=ae.getState(),[r,i]=l.useState(""),[o,u]=l.useState(!1),[d,f]=l.useState(pa),[c,x]=l.useState(null),y=l.useRef(null),g=r.trim()?ln(r.trim()):"",m=l.useCallback(async h=>{const w=ln(h);if(!w)return;u(!0),x(null),i(""),f(fd(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(qe,{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(wn,{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(kn,{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:M("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 on({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,R]=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=yn(),{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",solid:!0,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:M("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.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-sys-blue/10 bg-sys-blue/5 p-3",children:[e.jsx(qe,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-sys-blue"}),e.jsx("p",{className:"type-data-xs text-fg-muted",children:"This switch only controls openHop Console's browser companion session. Turning it off releases the browser frame connection so external apps can connect; it does not stop the companion identity or companion service from working in the repeater."})]}),p.map(B=>{const A=ua(B),z=G(B.name),F=O===B.name;return e.jsxs("div",{className:M("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:M("h-2 w-2 rounded-full flex-shrink-0",z?"bg-fg-muted":"bg-sys-blue")}),e.jsx("h3",{className:"type-body-sm text-fg-primary font-medium truncate flex-1",children:B.name}),e.jsx(Le,{color:z?"zinc":"blue",children:z?"Browser off":"Browser on"}),e.jsx(U,{color:"primary",plain:!0,onClick:()=>{m(B),y("edit"),c(!0)},children:e.jsx(Vl,{"data-slot":"icon"})}),e.jsx(Lr,{enabled:!z,onChange:W=>J(B.name,W),size:"sm",disabled:F,status:F?"loading":"idle",tooltip:z?"Allow Console to connect in this browser":"Release Console browser connection for external apps",dangerOff:!0}),e.jsx(U,{color:"danger",plain:!0,onClick:()=>k(B),children:e.jsx(Xe,{"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"," · ",z?"external apps can connect":"external apps cannot use this companion while Browser on"]})]},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(yd,{})]}),e.jsxs($e,{children:[a==="companions"&&e.jsx(U,{plain:!0,onClick:()=>R(!0),title:"Key Management",children:e.jsx(_n,{"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(Ye,{"data-slot":"icon"})," Add Companion"]})]})]}),e.jsx(gd,{open:f,onClose:()=>c(!1),mode:x,identity:g,onSave:N}),e.jsx(In,{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(xd,{open:E,onClose:()=>R(!1)})]})}const bd=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"}],vd=[{value:"all",label:"All time"},{value:"24h",label:"Last 24 hours"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"}];function jd(s){switch(s){case"24h":return 24;case"7d":return 168;case"30d":return 720;default:return}}function Nd({open:s,onClose:t,companionName:n,onImport:a}){const[r,i]=l.useState(()=>new Set(Ge.map(R=>R.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(R=>R.value))),u("all"),f(""),x(!1),g(null)));const k=r.size===Ge.length;function h(R){i(b=>{const I=new Set(b);return I.has(R)?I.delete(R):I.add(R),I})}function w(){i(k?new Set:new Set(Ge.map(R=>R.value)))}const E=l.useCallback(async()=>{if(!(r.size===0||c)){x(!0),g(null);try{const R={types:[...r],hours:jd(o)},b=parseInt(d,10);b>0&&(R.limit=b);const I=await a(R);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(Rs,{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(R=>e.jsx(Rs,{checked:r.has(R.value),onChange:()=>h(R.value),label:R.label,size:"sm"},R.value))})]})]}),e.jsx(ao,{label:"Recency",value:o,onChange:u,options:vd,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:R=>f(R.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 wd=["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"],kd=new Set(wd);function Cd(){return crypto.getRandomValues(new Uint8Array(16))}function cn(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 Sd(s){const n=`#${vn(s)}`,a=new TextEncoder().encode(n);return(await Ur(a)).slice(0,16)}const dn=[{key:"create-private",label:"Create Private",icon:Al,desc:"Generate a new private channel with a random key"},{key:"join-private",label:"Join Private",icon:Bi,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 Id({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 R=l.useMemo(()=>n.length===0?0:Math.max(...n.map(v=>v.index))+1,[n]),b=l.useMemo(()=>r!=="join-hashtag"?"":vn(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?kd.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(cn(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=Cd(),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 Sd(o),L=`#${b}`;break}default:return}if(await a(R,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,R,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:dn.map(v=>{const L=v.icon,S=r===v.key;return e.jsxs("button",{onClick:()=>{i(v.key),j(""),x(null)},className:M("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=dn.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:cn(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(Je,{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:R})]}),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 _d=202,Rd=/^[0-9a-fA-F]+$/;function Md(s){const t=s.replace(/\s/g,"");return t.length>=_d&&t.length%2===0&&Rd.test(t)}const Ed=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,R]=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),R(!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),R(!0),setTimeout(()=>R(!1),2e3)}catch{I("Failed to copy to clipboard")}},[x]),L=l.useCallback(async()=>{const S=g.replace(/\s/g,"");if(!Md(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:M("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(Lt,{className:"w-3.5 h-3.5"}),"Export"]}),e.jsxs("button",{onClick:()=>{d("import"),I(null)},className:M("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(Ve,{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(Nn,{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 hu(){var gs,ys,bs,vs,js,Ns;const s=Kr(),t=yn(),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=bn(),h=nl(),w=al(t),E=rl(),R=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),X="pymc_companion_contacts_micro",me="pymc_companion_split",[be,He]=l.useState(()=>{try{return localStorage.getItem(X)==="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}}),tt=l.useRef(null),Be=l.useRef(null),Xt=l.useRef(null),st=l.useRef(!1),We=l.useRef(wt);We.current=wt;const xa=l.useCallback(P=>{P.preventDefault(),P.target.setPointerCapture(P.pointerId),st.current=!0},[]),ha=l.useCallback(P=>{if(!st.current||!tt.current)return;const H=tt.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(!st.current)return;st.current=!1;const P=We.current;Qt(P);try{localStorage.setItem(me,String(P))}catch{}},[]),fa=l.useCallback(()=>{We.current=50,Be.current&&it(Be.current,{width:"50%"},ie.layoutResize),Qt(50);try{localStorage.setItem(me,String(50))}catch{}},[]),ga=l.useCallback(P=>{if(He(P),typeof window<"u"&&window.innerWidth<768)return;const H=tt.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 za=P?56:We.current/100*pe,Ha=K.offsetWidth,Ba=Math.max(0,pe-za-12);K.style.flex="none",K.style.width=`${Ha}px`,it(K,{width:`${Ba}px`},{...ie.layoutResize,onComplete(){K.style.flex="",K.style.width=""}})}it(H,{width:`${pe}px`},{...ie.layoutResize,onComplete(){H.style.width=P?"var(--companion-side-micro)":"var(--companion-side)"}})},[]),{selectCompanion:ya,selectConversation:we,sendMessage:Zt,sendChannelMessage:es,retryMessage:ba,retryMessageAsFlood:va,resetPath:kt,shareContact:ja,removeContact:Na,addChannel:wa,requestStatus:ts,requestTelemetry:ss,loginToRepeater:Ct,logoutFromRepeater:ns,getNeighbours:as,traceContactPath:rs,discoverPath:ls,pingContact:ka,markAsRead:is,fetchCompanions:os,seedFromRepeater:Ca,exportContactAdvert:Sa,importContactAdvert:Ia,setContactPath:cs,deleteChannel:_a,loadOlderMessages:Ra}=ae.getState(),Ma=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 Ea=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]),Pa=l.useCallback(P=>{const H=ms.get(P.toLowerCase());H&&(we({type:"contact",id:H}),B(!0))},[ms,we]),Ta=l.useCallback(async P=>m?m.type==="channel"?es(Number(m.id),P):Zt(m.id,P):!1,[m,Zt,es]),$a=k&&!E,ps=b!=null&&(b.adv_type&15)===3,xs=Ot(ps?b.public_key:null),Aa=ps&&xs!=="success",hs=ul(),[xe,Ae]=l.useState("idle"),Fa=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)},[]),Oa=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)},[]),Da=e.jsxs("div",{className:"flex items-center gap-2",children:[k&&n&&e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsxs("button",{onClick:Fa,disabled:xe!=="idle"&&xe!=="zero-done",className:M("inline-flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3.5 py-1.5 sm: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(Qi,{className:"w-4 h-4"}),xe==="flood-done"?e.jsx("span",{children:"Sent!"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Flood Advert"}),e.jsx("span",{className:"sm:hidden",children:"Flood"})]})]}),e.jsxs("button",{onClick:Oa,disabled:xe!=="idle"&&xe!=="flood-done",className:M("inline-flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3.5 py-1.5 sm: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(An,{className:"w-4 h-4"}),xe==="zero-done"?e.jsx("span",{children:"Sent!"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Local Advert"}),e.jsx("span",{className:"sm:hidden",children:"Local"})]})]})]}),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(Ul,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Gl,{className:"w-4 h-4 text-fg-muted"})})]}),La=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(eo,{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(Mt,{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(bd,{companions:s,selected:t,onSelect:ya}),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(Ms,{children:[e.jsx(xl,{title:"Companion",icon:e.jsx(je,{}),controls:e.jsxs(U,{color:"primary",outline:!0,onClick:()=>C(!0),children:[e.jsx(Ye,{"data-slot":"icon"}),"Add Companion"]})}),e.jsx(Es,{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(Ye,{"data-slot":"icon"}),"Add Companion"]})]})}),e.jsx(on,{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(Ms,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 min-h-9",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsxs("h1",{className:"type-title text-fg-primary flex items-baseline gap-2 sm:gap-3 min-w-0",children:[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:e.jsx(je,{})}),e.jsx("span",{className:"truncate",children:(o==null?void 0:o.node_name)||"Companion"})]}),Da]}),e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 w-full md:w-auto justify-end",children:La})]}),e.jsx(Es,{children:e.jsxs("div",{className:"companion-layout flex gap-4",style:{height:"calc(100vh - 11rem)",minHeight:400},children:[e.jsxs("div",{ref:tt,"data-micro":be?"true":void 0,className:M("companion-side-card flex-shrink-0 flex h-full overflow-hidden radius-inner bg-surface/80 backdrop-blur-lg depth-raised",F?"flex":"hidden md:flex"),children:[e.jsx(Bo,{ref:Be,contacts:x,selectedConversation:m,unreadMap:us,messages:ds,onSelect:P=>{we(P),window.innerWidth<768&&W(!1)},onShowDetails:Ma,onShareContact:ja,onResetPath:kt,onRemoveContact:Na,onPingContact:ka,repeaterNeighborHashes:y,repeaterSignalMap:g,isLoading:E,splitPercent:wt,onMicroChange:ga}),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:xa,onPointerMove:ha,onPointerUp:Yt,onPointerCancel:Yt,onDoubleClick:fa,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(qo,{ref:Xt,channels:i,selectedConversation:m,unreadMap:us,messages:ds,onSelect:P=>{we(P),window.innerWidth<768&&W(!1)},onAddChannel:()=>D(!0),onDeleteChannel:_a})]}),e.jsxs(Ps,{noPadding:!0,radius:"sm",className:M("flex-1 flex-col min-w-0 overflow-hidden relative",F?"hidden md:flex":"flex"),children:[e.jsx(ve,{children:R&&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:R})]},"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(Pi,{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(qe,{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(zs,{className:"w-4 h-4 text-fg-muted"}):e.jsx(qe,{className:"w-4 h-4 text-fg-muted"})},"ctx-toggle")})]}),Aa&&b?e.jsx(Yc,{contact:b,loginStatus:xs,onLogin:Ct}):e.jsxs(e.Fragment,{children:[e.jsx(qc,{messages:j,contacts:x,className:"flex-1 min-h-0",conversationKey:m?m.type==="channel"?`ch:${m.id}`:m.id:void 0,onRetry:ba,onRetryAsFlood:va,onMentionClick:Pa,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(Jc,{onSend:Ta,disabled:!$a,mentionNames:Ea,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(Ps,{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(zs,{className:"w-4 h-4 text-fg-muted"})},"ctx-close")}),e.jsx(tn,{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(on,{open:N,onClose:()=>C(!1),onRefresh:os}),e.jsx(Nd,{open:v,onClose:()=>L(!1),companionName:t??"companion",onImport:Ca}),e.jsx(Ed,{open:$,onClose:()=>{G(!1),q(null)},contacts:x,exportPubKey:O,onExport:Sa,onImport:Ia}),e.jsx(Id,{open:S,onClose:()=>D(!1),channels:i,onAddChannel:wa}),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(tn,{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{hu as default}; diff --git a/frontend/dist/assets/CompanionEchoMap-D-ZiSBZa.js b/frontend/dist/assets/CompanionEchoMap-Cad6Uf2W.js similarity index 94% rename from frontend/dist/assets/CompanionEchoMap-D-ZiSBZa.js rename to frontend/dist/assets/CompanionEchoMap-Cad6Uf2W.js index 388c67db..e1a31f87 100644 --- a/frontend/dist/assets/CompanionEchoMap-D-ZiSBZa.js +++ b/frontend/dist/assets/CompanionEchoMap-Cad6Uf2W.js @@ -1 +1 @@ -import{r as i,d1 as K,aa as O,W as T,fV as D,av as I,cE as J,ge as q,Z as Q,V as X,j as a,c as W,$ as k,cG as ee}from"./index-C8J8z7Af.js";import{M as te,B as ne,a as R}from"./BasemapLayer-BvoQWTC4.js";import{S as se,L as ae}from"./layer-DgtbTXVx.js";import{useSrcHashResolverMap as oe,useDiscoveredNodes as re}from"./usePipelineStore-CtpzsDw6.js";import{M as le}from"./map-pin-off-COAzJaWC.js";import"./node-types-B5WxOxT2.js";const ie={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},A=X.amber,U=Q[400],V=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(k,{color:n,filled:!0,className:W("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 v(p,c){return p==null||c==null?!1:p!==0||c!==0}function ce(p,c,o){var u;const f=p.toUpperCase(),n=c.find(l=>l.public_key.toUpperCase().startsWith(f));if(n&&v(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(v(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&&v(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&&v(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 ue(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 N=t.timestamp??l.timestamp;if(Math.floor(N/30)===r&&t.text===p)return u}return null}function de(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 be({text:p,timestamp:c,contacts:o,className:f}){const n=i.useRef(null),r=K(),u=O(),l=T(),[t,N]=i.useState(!1),m=D(),C=I(),z=u==null?void 0:u.neighbors,E=oe(),B=re(),M=J(),h=q(),w=(m==null?void 0:m.node_name)??(h==null?void 0:h.node_name)??null,G=i.useMemo(()=>({neighbors:z,srcHashMap:E,discoveredNodes:B}),[z,E,B]),d=i.useMemo(()=>{const e=(m==null?void 0:m.node_name)||(h==null?void 0:h.node_name)||(h==null?void 0:h.companion_name)||"Me";return m&&v(m.latitude,m.longitude)?{prefix:m.public_key.slice(0,2).toUpperCase(),name:e,lat:m.latitude,lng:m.longitude}:M&&v(M.latitude,M.longitude)?{prefix:"",name:e,lat:M.latitude,lng:M.longitude}:null},[m,h,M]),L=i.useMemo(()=>w?ue(p,c,C,w):null,[p,c,C,w]),F=i.useMemo(()=>L?de(L,l):[],[L,l]),j=i.useMemo(()=>F.map(e=>{const s=ce(e.prefix,o,G);return{prefix:e.prefix,snr:e.snr,...s}}),[F,o,G]),y=i.useMemo(()=>j.filter(e=>e.hasGps),[j]),P=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 g=[s.lng,s.lat];return{from:e,to:g,midpoint:[(e[0]+g[0])/2,(e[1]+g[1])/2]}})},[d,y]),Z=i.useMemo(()=>_.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[_]),$=i.useMemo(()=>{if(typeof document>"u")return{amber:A,zinc:U};const e=getComputedStyle(document.documentElement),s=e.getPropertyValue("--sys-amber").trim(),g=e.getPropertyValue("--zinc-400").trim();return{amber:s.startsWith("#")?s:A,zinc:g.startsWith("#")?g:U}},[]),x=i.useMemo(()=>{if(!d||y.length===0)return null;let e=d.lat,s=d.lat,g=d.lng,S=d.lng;for(const b of y)b.lats&&(s=b.lat),b.lngS&&(S=b.lng);return[[g,e],[S,s]]},[d,y]),Y=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}),N(!0)},[x]);if(!x||!d)return null;const H=[(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2];return a.jsxs("div",{className:W("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:H[0],latitude:H[1],zoom:10},onLoad:Y,style:{height:"100%",width:"100%"},mapStyle:ie,attributionControl:!1,interactive:!1,children:[a.jsx(ne,{mode:r}),_.map((e,s)=>a.jsx(se,{id:`cecho-${s}`,type:"geojson",data:Z[s],lineMetrics:!0,children:a.jsx(ae,{id:`cecho-line-${s}`,type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,$.amber,1,$.zinc]},layout:{"line-cap":"round","line-join":"round"}})},`cecho-${s}`)),a.jsx(R,{longitude:d.lng,latitude:d.lat,anchor:"center",children:a.jsx(V,{prefix:d.prefix,name:d.name,isLocal:!0,color:"amber"})}),y.map((e,s)=>a.jsx(R,{longitude:e.lng,latitude:e.lat,anchor:"center",children:a.jsx(V,{prefix:e.prefix,name:e.name,isLocal:!1,color:"zinc"})},`cecho-node-${e.prefix}-${s}`))]})}),P.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:P.map((e,s)=>a.jsxs(k,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[a.jsx(le,{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(k,{color:"green",className:"type-data-xs shadow-sm",children:[j.length," echo",j.length!==1?"es":""]})})]})}export{be as CompanionEchoMap}; +import{r as i,d1 as K,aa as O,W as T,fV as D,av as I,cE as J,ge as q,Z as Q,V as X,j as a,c as W,$ as k,cG as ee}from"./index-Dk8KEIKm.js";import{M as te,B as ne,a as R}from"./BasemapLayer-snfcoHal.js";import{S as se,L as ae}from"./layer-CgHNe4F2.js";import{useSrcHashResolverMap as oe,useDiscoveredNodes as re}from"./usePipelineStore-C2CKtblH.js";import{M as le}from"./map-pin-off-DSyO3Y2C.js";import"./node-types-SdzDwn2r.js";const ie={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},A=X.amber,U=Q[400],V=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(k,{color:n,filled:!0,className:W("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 v(p,c){return p==null||c==null?!1:p!==0||c!==0}function ce(p,c,o){var u;const f=p.toUpperCase(),n=c.find(l=>l.public_key.toUpperCase().startsWith(f));if(n&&v(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(v(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&&v(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&&v(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 ue(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 N=t.timestamp??l.timestamp;if(Math.floor(N/30)===r&&t.text===p)return u}return null}function de(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 be({text:p,timestamp:c,contacts:o,className:f}){const n=i.useRef(null),r=K(),u=O(),l=T(),[t,N]=i.useState(!1),m=D(),C=I(),z=u==null?void 0:u.neighbors,E=oe(),B=re(),M=J(),h=q(),w=(m==null?void 0:m.node_name)??(h==null?void 0:h.node_name)??null,G=i.useMemo(()=>({neighbors:z,srcHashMap:E,discoveredNodes:B}),[z,E,B]),d=i.useMemo(()=>{const e=(m==null?void 0:m.node_name)||(h==null?void 0:h.node_name)||(h==null?void 0:h.companion_name)||"Me";return m&&v(m.latitude,m.longitude)?{prefix:m.public_key.slice(0,2).toUpperCase(),name:e,lat:m.latitude,lng:m.longitude}:M&&v(M.latitude,M.longitude)?{prefix:"",name:e,lat:M.latitude,lng:M.longitude}:null},[m,h,M]),L=i.useMemo(()=>w?ue(p,c,C,w):null,[p,c,C,w]),F=i.useMemo(()=>L?de(L,l):[],[L,l]),j=i.useMemo(()=>F.map(e=>{const s=ce(e.prefix,o,G);return{prefix:e.prefix,snr:e.snr,...s}}),[F,o,G]),y=i.useMemo(()=>j.filter(e=>e.hasGps),[j]),P=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 g=[s.lng,s.lat];return{from:e,to:g,midpoint:[(e[0]+g[0])/2,(e[1]+g[1])/2]}})},[d,y]),Z=i.useMemo(()=>_.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[_]),$=i.useMemo(()=>{if(typeof document>"u")return{amber:A,zinc:U};const e=getComputedStyle(document.documentElement),s=e.getPropertyValue("--sys-amber").trim(),g=e.getPropertyValue("--zinc-400").trim();return{amber:s.startsWith("#")?s:A,zinc:g.startsWith("#")?g:U}},[]),x=i.useMemo(()=>{if(!d||y.length===0)return null;let e=d.lat,s=d.lat,g=d.lng,S=d.lng;for(const b of y)b.lats&&(s=b.lat),b.lngS&&(S=b.lng);return[[g,e],[S,s]]},[d,y]),Y=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}),N(!0)},[x]);if(!x||!d)return null;const H=[(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2];return a.jsxs("div",{className:W("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:H[0],latitude:H[1],zoom:10},onLoad:Y,style:{height:"100%",width:"100%"},mapStyle:ie,attributionControl:!1,interactive:!1,children:[a.jsx(ne,{mode:r}),_.map((e,s)=>a.jsx(se,{id:`cecho-${s}`,type:"geojson",data:Z[s],lineMetrics:!0,children:a.jsx(ae,{id:`cecho-line-${s}`,type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,$.amber,1,$.zinc]},layout:{"line-cap":"round","line-join":"round"}})},`cecho-${s}`)),a.jsx(R,{longitude:d.lng,latitude:d.lat,anchor:"center",children:a.jsx(V,{prefix:d.prefix,name:d.name,isLocal:!0,color:"amber"})}),y.map((e,s)=>a.jsx(R,{longitude:e.lng,latitude:e.lat,anchor:"center",children:a.jsx(V,{prefix:e.prefix,name:e.name,isLocal:!1,color:"zinc"})},`cecho-node-${e.prefix}-${s}`))]})}),P.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:P.map((e,s)=>a.jsxs(k,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[a.jsx(le,{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(k,{color:"green",className:"type-data-xs shadow-sm",children:[j.length," echo",j.length!==1?"es":""]})})]})}export{be as CompanionEchoMap}; diff --git a/frontend/dist/assets/CompanionPathMap-CXIYZL2H.js b/frontend/dist/assets/CompanionPathMap-CqxSHGK1.js similarity index 96% rename from frontend/dist/assets/CompanionPathMap-CXIYZL2H.js rename to frontend/dist/assets/CompanionPathMap-CqxSHGK1.js index 0ada5e50..76ecbc39 100644 --- a/frontend/dist/assets/CompanionPathMap-CXIYZL2H.js +++ b/frontend/dist/assets/CompanionPathMap-CqxSHGK1.js @@ -1 +1 @@ -import{r as a,d1 as Le,aa as Re,cE as Ce,ge as ke,Z as me,V as U,j as t,c as J,bK as Ee,dT as Pe,dA as Fe,$ as Y,cG as Ge}from"./index-C8J8z7Af.js";import{M as _e,B as Ae,a as $}from"./BasemapLayer-BvoQWTC4.js";import{S as _,L as A}from"./layer-DgtbTXVx.js";import{useSrcHashResolverMap as He,useDiscoveredNodes as Oe}from"./usePipelineStore-CtpzsDw6.js";import{g as ze,u as $e,l as Be,a as We,m as Ke,c as Te,j as De,k as Ie,p as Ve,r as Je,e as E,R as Ye}from"./useReplayTick-BAMq1uf1.js";import{C as ue}from"./car-KA4-aUWv.js";import{M as Ue}from"./map-pin-off-COAzJaWC.js";import"./node-types-B5WxOxT2.js";import"./payload-detail-BWHpd-ZF.js";const Ze={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},Xe=me[500],de=U.orange,pe=U.green,B=U.blue,V={type:"FeatureCollection",features:[]},qe=a.memo(function({prefix:s,name:r,isLocal:p,color:f}){const[c,h]=a.useState(!1);return t.jsx("div",{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{pointerEvents:"auto"},children:t.jsxs(Y,{color:f,filled:!0,className:J("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",c&&"relative z-50"),children:[p&&t.jsx(Ge,{className:"w-2.5 h-2.5 mr-0.5"}),s&&t.jsx("span",{className:"font-mono",children:s}),c&&r&&t.jsx("span",{className:s?"ml-0.5 opacity-75":"",children:r})]})})});function R(l,s){return Number.isFinite(s)&&Number.isFinite(l)&&s>=-90&&s<=90&&l>=-180&&l<=180}function P(l,s){return l==null||s==null?!1:R(s,l)&&(l!==0||s!==0)}function Qe(l,s,r){var f;const p=[];for(const c of l){const h=c.toUpperCase(),d=s.find(m=>m.public_key.toUpperCase().startsWith(h));if(d&&P(d.gps_lat,d.gps_lon)){p.push({prefix:c,name:d.name||null,lat:d.gps_lat,lng:d.gps_lon,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const m=Object.entries(r.neighbors).find(([i])=>i.toUpperCase().startsWith(h));if(m){const[,i]=m;if(P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}const N=r.srcHashMap.get(h);if(N){const m=r.discoveredNodes.get(N);if(m&&P(m.latitude,m.longitude)){p.push({prefix:c,name:m.name||null,lat:m.latitude,lng:m.longitude,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const i=r.neighbors[N];if(i&&P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}p.push({prefix:c,name:(d==null?void 0:d.name)||(N?((f=r.discoveredNodes.get(N))==null?void 0:f.name)??null:null),lat:0,lng:0,isLocal:!1,hasGps:!1})}return p}function et(l,s,r,p){const f=(s==null?void 0:s.node_name)||p||(r==null?void 0:r.name)||"Me";if(s&&P(s.latitude,s.longitude)){const c=s.public_key.slice(0,2).toUpperCase();return[...l,{prefix:c,name:f,lat:s.latitude,lng:s.longitude,isLocal:!0,hasGps:!0}]}return r&&P(r.latitude,r.longitude)?[...l,{prefix:"",name:f,lat:r.latitude,lng:r.longitude,isLocal:!0,hasGps:!0}]:l}function ut({hops:l,contacts:s,selfInfo:r,snr:p,wardriveCoords:f,wardriveSenderName:c,channelMessages:h,messageTimestamp:d,className:N}){const m=a.useRef(null),i=Le(),W=Re(),[Z,ge]=a.useState(!1),X=W==null?void 0:W.neighbors,q=He(),Q=Oe(),ee=Ce(),C=ke(),te=a.useMemo(()=>({neighbors:X,srcHashMap:q,discoveredNodes:Q}),[X,q,Q]),F=a.useMemo(()=>{if(!(h!=null&&h.length)||!c||!d)return[];const e=ze(h),n=d-86400;return e.filter(o=>o.senderName===c&&o.timestampS>=n&&o.timestampS<=d)},[h,c,d]),K=F.length>=2,G=a.useMemo(()=>`${c??"x"}-${d??0}`,[c,d]),fe=$e(),he=Be(),ne=We(),v=Ke(),ye=Te(),y=De();Ie();const g=fe&&he===G,T=g&&y.length>0?Math.round(Math.max(0,Math.min(y.length-1,v))):-1,se=a.useMemo(()=>{var e;return T>=0?((e=y[T])==null?void 0:e.pathHops)??l:l},[T,y,l]),oe=(C==null?void 0:C.node_name)??(C==null?void 0:C.companion_name)??null,j=a.useMemo(()=>{const e=Qe(se,s,te);return et(e,r,ee,oe)},[se,s,te,r,ee,oe]),x=a.useMemo(()=>j.filter(e=>e.hasGps),[j]),ae=a.useMemo(()=>j.filter(e=>!e.hasGps),[j]),b=a.useMemo(()=>f&&R(f.lon,f.lat)?f:null,[f]),H=a.useMemo(()=>{const e=[];if(x.length<2)return e;const n=[];for(let o=0;oH.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[H]),re=a.useMemo(()=>{if(typeof document>"u")return Xe;const e=getComputedStyle(document.documentElement).getPropertyValue("--zinc-400").trim();return e.startsWith("#")?e:me[400]},[]),O=a.useMemo(()=>{if(!b||x.length===0)return null;const e=[b.lon,b.lat],n=x[0];return{from:e,to:[n.lng,n.lat]}},[b,x]),le=a.useMemo(()=>O?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[O.from,O.to]}}]}:null,[O]),ie=a.useMemo(()=>{if(typeof document>"u")return{orange:de,green:pe};const e=getComputedStyle(document.documentElement),n=e.getPropertyValue("--sys-orange").trim(),o=e.getPropertyValue("--sys-green").trim();return{orange:n.startsWith("#")?n:de,green:o.startsWith("#")?o:pe}},[]),k=a.useMemo(()=>{if(!g)return null;const e=Ve(y,v);return e&&R(e.lon,e.lat)?e:null},[g,y,v]),be=a.useMemo(()=>{if(!g)return V;const e=Je(y,v).filter(([n,o])=>R(n,o));return e.length<2?V:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}},[g,y,v]),je=a.useMemo(()=>!g||y.length===0?V:{type:"FeatureCollection",features:y.filter(e=>R(e.lon,e.lat)).map((e,n)=>({type:"Feature",properties:{index:n},geometry:{type:"Point",coordinates:[e.lon,e.lat]}}))},[g,y]);a.useEffect(()=>()=>{const e=E.getState();e.ownerKey===G&&e.stopRewind()},[G]);const we=y.length,z=Math.max(0,we-1),Ne=z>0?v/z:1,ve=Math.round(z-v),w=a.useMemo(()=>{const e=[];for(const u of x)R(u.lng,u.lat)&&e.push([u.lng,u.lat]);b&&e.push([b.lon,b.lat]);for(const u of F)R(u.lon,u.lat)&&e.push([u.lon,u.lat]);if(e.length<2)return null;let n=1/0,o=-1/0,S=1/0,M=-1/0;for(const[u,L]of e)Lo&&(o=L),uM&&(M=u);return[[S,n],[M,o]]},[x,b,F]),Se=a.useCallback(()=>{E.getState().stopRewind()},[]),Me=a.useCallback(()=>{var e;try{const n=(e=m.current)==null?void 0:e.getMap();n&&w&&n.fitBounds(w,{padding:{top:40,bottom:K?52:44,left:56,right:56},maxZoom:14,duration:0})}catch(n){console.warn("[CompanionPathMap] Failed to fit wardrive/path bounds:",n)}finally{ge(!0)}K&&E.getState().startRewind(F,G)},[w,K,F,G]);if(!w)return null;const ce=[(w[0][0]+w[1][0])/2,(w[0][1]+w[1][1])/2];return t.jsxs("div",{className:J("relative rounded-lg overflow-hidden",N),style:{aspectRatio:"16 / 10"},children:[!Z&&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:Z?1:0},children:t.jsxs(_e,{ref:m,initialViewState:{longitude:ce[0],latitude:ce[1],zoom:10},onLoad:Me,style:{height:"100%",width:"100%"},mapStyle:Ze,attributionControl:!1,interactive:g,children:[t.jsx(Ae,{mode:i}),le&&!g&&t.jsx(_,{id:"cwd-edge",type:"geojson",data:le,lineMetrics:!0,children:t.jsx(A,{id:"cwd-edge-line",type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,ie.orange,1,ie.green]},layout:{"line-cap":"round","line-join":"round"}})}),b&&!g&&t.jsx($,{longitude:b.lon,latitude:b.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(ue,{className:"w-4 h-4",strokeWidth:2.5})})})}),H.map((e,n)=>t.jsx(_,{id:`cedge-${n}`,type:"geojson",data:xe[n],children:t.jsx(A,{id:`cedge-line-${n}`,type:"line",paint:{"line-color":re,"line-width":2,"line-opacity":.85},layout:{"line-cap":"round","line-join":"round"}})},`cedge-${n}`)),H.map((e,n)=>t.jsx($,{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:re,color:"#fff",fontSize:"10px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:e.hopNumber})},`chop-${n}`)),x.map((e,n)=>{const o=n===0,S=n===x.length-1,M=e.isLocal?"amber":o?"green":S?"amber":"zinc";return t.jsx($,{longitude:e.lng,latitude:e.lat,anchor:"center",children:t.jsx(qe,{prefix:e.prefix,name:e.name,isLocal:e.isLocal,color:M})},`cnode-${e.prefix}-${n}`)}),g&&t.jsxs(t.Fragment,{children:[t.jsx(_,{id:"replay-dots",type:"geojson",data:je,children:t.jsx(A,{id:"replay-dots-circle",type:"circle",paint:{"circle-radius":3,"circle-color":B,"circle-opacity":.35,"circle-stroke-width":1,"circle-stroke-color":B,"circle-stroke-opacity":.15}})}),t.jsx(_,{id:"replay-trail",type:"geojson",data:be,children:t.jsx(A,{id:"replay-trail-line",type:"line",paint:{"line-color":B,"line-width":3,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"}})}),k&&x.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],[x[0].lng,x[0].lat]]}}]},children:t.jsx(A,{id:"replay-path-link-line",type:"line",paint:{"line-color":B,"line-width":1.5,"line-opacity":.5,"line-dasharray":[3,2]},layout:{"line-cap":"round"}})}),k&&t.jsx($,{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(ue,{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(Ee,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>E.getState().togglePlay(),className:"p-1 rounded-full bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 transition-colors shrink-0",title:ne?"Pause":"Rewind",children:ne?t.jsx(Pe,{className:"w-3 h-3"}):t.jsx(Fe,{className:"w-3 h-3"})}),t.jsx("input",{type:"range",min:0,max:100,step:.1,value:Ne*100,onChange:e=>{const n=parseFloat(e.target.value)/100;E.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:[ve,"/",z," pkts"]}),t.jsx("div",{className:"flex items-center gap-px shrink-0",children:Ye.map(e=>t.jsxs("button",{onClick:()=>E.getState().setSpeed(e),className:J("px-1 py-0.5 rounded text-[9px] font-medium transition-colors",e===ye?"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary"),children:[e,"×"]},e))})]})}),!g&&ae.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:ae.map((e,n)=>t.jsxs(Y,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[t.jsx(Ue,{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(Y,{color:"zinc",className:"type-data-xs shadow-sm",children:[p>0?"+":"",p.toFixed(1)," dB"]})})]})}export{ut as CompanionPathMap}; +import{r as a,d1 as Le,aa as Re,cE as Ce,ge as ke,Z as me,V as U,j as t,c as J,bK as Ee,dT as Pe,dA as Fe,$ as Y,cG as Ge}from"./index-Dk8KEIKm.js";import{M as _e,B as Ae,a as $}from"./BasemapLayer-snfcoHal.js";import{S as _,L as A}from"./layer-CgHNe4F2.js";import{useSrcHashResolverMap as He,useDiscoveredNodes as Oe}from"./usePipelineStore-C2CKtblH.js";import{g as ze,u as $e,l as Be,a as We,m as Ke,c as Te,j as De,k as Ie,p as Ve,r as Je,e as E,R as Ye}from"./useReplayTick-DTG9e32S.js";import{C as ue}from"./car-BJCuYr8A.js";import{M as Ue}from"./map-pin-off-DSyO3Y2C.js";import"./node-types-SdzDwn2r.js";import"./payload-detail-BR_z6q5h.js";const Ze={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},Xe=me[500],de=U.orange,pe=U.green,B=U.blue,V={type:"FeatureCollection",features:[]},qe=a.memo(function({prefix:s,name:r,isLocal:p,color:f}){const[c,h]=a.useState(!1);return t.jsx("div",{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{pointerEvents:"auto"},children:t.jsxs(Y,{color:f,filled:!0,className:J("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",c&&"relative z-50"),children:[p&&t.jsx(Ge,{className:"w-2.5 h-2.5 mr-0.5"}),s&&t.jsx("span",{className:"font-mono",children:s}),c&&r&&t.jsx("span",{className:s?"ml-0.5 opacity-75":"",children:r})]})})});function R(l,s){return Number.isFinite(s)&&Number.isFinite(l)&&s>=-90&&s<=90&&l>=-180&&l<=180}function P(l,s){return l==null||s==null?!1:R(s,l)&&(l!==0||s!==0)}function Qe(l,s,r){var f;const p=[];for(const c of l){const h=c.toUpperCase(),d=s.find(m=>m.public_key.toUpperCase().startsWith(h));if(d&&P(d.gps_lat,d.gps_lon)){p.push({prefix:c,name:d.name||null,lat:d.gps_lat,lng:d.gps_lon,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const m=Object.entries(r.neighbors).find(([i])=>i.toUpperCase().startsWith(h));if(m){const[,i]=m;if(P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}const N=r.srcHashMap.get(h);if(N){const m=r.discoveredNodes.get(N);if(m&&P(m.latitude,m.longitude)){p.push({prefix:c,name:m.name||null,lat:m.latitude,lng:m.longitude,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const i=r.neighbors[N];if(i&&P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}p.push({prefix:c,name:(d==null?void 0:d.name)||(N?((f=r.discoveredNodes.get(N))==null?void 0:f.name)??null:null),lat:0,lng:0,isLocal:!1,hasGps:!1})}return p}function et(l,s,r,p){const f=(s==null?void 0:s.node_name)||p||(r==null?void 0:r.name)||"Me";if(s&&P(s.latitude,s.longitude)){const c=s.public_key.slice(0,2).toUpperCase();return[...l,{prefix:c,name:f,lat:s.latitude,lng:s.longitude,isLocal:!0,hasGps:!0}]}return r&&P(r.latitude,r.longitude)?[...l,{prefix:"",name:f,lat:r.latitude,lng:r.longitude,isLocal:!0,hasGps:!0}]:l}function ut({hops:l,contacts:s,selfInfo:r,snr:p,wardriveCoords:f,wardriveSenderName:c,channelMessages:h,messageTimestamp:d,className:N}){const m=a.useRef(null),i=Le(),W=Re(),[Z,ge]=a.useState(!1),X=W==null?void 0:W.neighbors,q=He(),Q=Oe(),ee=Ce(),C=ke(),te=a.useMemo(()=>({neighbors:X,srcHashMap:q,discoveredNodes:Q}),[X,q,Q]),F=a.useMemo(()=>{if(!(h!=null&&h.length)||!c||!d)return[];const e=ze(h),n=d-86400;return e.filter(o=>o.senderName===c&&o.timestampS>=n&&o.timestampS<=d)},[h,c,d]),K=F.length>=2,G=a.useMemo(()=>`${c??"x"}-${d??0}`,[c,d]),fe=$e(),he=Be(),ne=We(),v=Ke(),ye=Te(),y=De();Ie();const g=fe&&he===G,T=g&&y.length>0?Math.round(Math.max(0,Math.min(y.length-1,v))):-1,se=a.useMemo(()=>{var e;return T>=0?((e=y[T])==null?void 0:e.pathHops)??l:l},[T,y,l]),oe=(C==null?void 0:C.node_name)??(C==null?void 0:C.companion_name)??null,j=a.useMemo(()=>{const e=Qe(se,s,te);return et(e,r,ee,oe)},[se,s,te,r,ee,oe]),x=a.useMemo(()=>j.filter(e=>e.hasGps),[j]),ae=a.useMemo(()=>j.filter(e=>!e.hasGps),[j]),b=a.useMemo(()=>f&&R(f.lon,f.lat)?f:null,[f]),H=a.useMemo(()=>{const e=[];if(x.length<2)return e;const n=[];for(let o=0;oH.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[H]),re=a.useMemo(()=>{if(typeof document>"u")return Xe;const e=getComputedStyle(document.documentElement).getPropertyValue("--zinc-400").trim();return e.startsWith("#")?e:me[400]},[]),O=a.useMemo(()=>{if(!b||x.length===0)return null;const e=[b.lon,b.lat],n=x[0];return{from:e,to:[n.lng,n.lat]}},[b,x]),le=a.useMemo(()=>O?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[O.from,O.to]}}]}:null,[O]),ie=a.useMemo(()=>{if(typeof document>"u")return{orange:de,green:pe};const e=getComputedStyle(document.documentElement),n=e.getPropertyValue("--sys-orange").trim(),o=e.getPropertyValue("--sys-green").trim();return{orange:n.startsWith("#")?n:de,green:o.startsWith("#")?o:pe}},[]),k=a.useMemo(()=>{if(!g)return null;const e=Ve(y,v);return e&&R(e.lon,e.lat)?e:null},[g,y,v]),be=a.useMemo(()=>{if(!g)return V;const e=Je(y,v).filter(([n,o])=>R(n,o));return e.length<2?V:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}},[g,y,v]),je=a.useMemo(()=>!g||y.length===0?V:{type:"FeatureCollection",features:y.filter(e=>R(e.lon,e.lat)).map((e,n)=>({type:"Feature",properties:{index:n},geometry:{type:"Point",coordinates:[e.lon,e.lat]}}))},[g,y]);a.useEffect(()=>()=>{const e=E.getState();e.ownerKey===G&&e.stopRewind()},[G]);const we=y.length,z=Math.max(0,we-1),Ne=z>0?v/z:1,ve=Math.round(z-v),w=a.useMemo(()=>{const e=[];for(const u of x)R(u.lng,u.lat)&&e.push([u.lng,u.lat]);b&&e.push([b.lon,b.lat]);for(const u of F)R(u.lon,u.lat)&&e.push([u.lon,u.lat]);if(e.length<2)return null;let n=1/0,o=-1/0,S=1/0,M=-1/0;for(const[u,L]of e)Lo&&(o=L),uM&&(M=u);return[[S,n],[M,o]]},[x,b,F]),Se=a.useCallback(()=>{E.getState().stopRewind()},[]),Me=a.useCallback(()=>{var e;try{const n=(e=m.current)==null?void 0:e.getMap();n&&w&&n.fitBounds(w,{padding:{top:40,bottom:K?52:44,left:56,right:56},maxZoom:14,duration:0})}catch(n){console.warn("[CompanionPathMap] Failed to fit wardrive/path bounds:",n)}finally{ge(!0)}K&&E.getState().startRewind(F,G)},[w,K,F,G]);if(!w)return null;const ce=[(w[0][0]+w[1][0])/2,(w[0][1]+w[1][1])/2];return t.jsxs("div",{className:J("relative rounded-lg overflow-hidden",N),style:{aspectRatio:"16 / 10"},children:[!Z&&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:Z?1:0},children:t.jsxs(_e,{ref:m,initialViewState:{longitude:ce[0],latitude:ce[1],zoom:10},onLoad:Me,style:{height:"100%",width:"100%"},mapStyle:Ze,attributionControl:!1,interactive:g,children:[t.jsx(Ae,{mode:i}),le&&!g&&t.jsx(_,{id:"cwd-edge",type:"geojson",data:le,lineMetrics:!0,children:t.jsx(A,{id:"cwd-edge-line",type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,ie.orange,1,ie.green]},layout:{"line-cap":"round","line-join":"round"}})}),b&&!g&&t.jsx($,{longitude:b.lon,latitude:b.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(ue,{className:"w-4 h-4",strokeWidth:2.5})})})}),H.map((e,n)=>t.jsx(_,{id:`cedge-${n}`,type:"geojson",data:xe[n],children:t.jsx(A,{id:`cedge-line-${n}`,type:"line",paint:{"line-color":re,"line-width":2,"line-opacity":.85},layout:{"line-cap":"round","line-join":"round"}})},`cedge-${n}`)),H.map((e,n)=>t.jsx($,{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:re,color:"#fff",fontSize:"10px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:e.hopNumber})},`chop-${n}`)),x.map((e,n)=>{const o=n===0,S=n===x.length-1,M=e.isLocal?"amber":o?"green":S?"amber":"zinc";return t.jsx($,{longitude:e.lng,latitude:e.lat,anchor:"center",children:t.jsx(qe,{prefix:e.prefix,name:e.name,isLocal:e.isLocal,color:M})},`cnode-${e.prefix}-${n}`)}),g&&t.jsxs(t.Fragment,{children:[t.jsx(_,{id:"replay-dots",type:"geojson",data:je,children:t.jsx(A,{id:"replay-dots-circle",type:"circle",paint:{"circle-radius":3,"circle-color":B,"circle-opacity":.35,"circle-stroke-width":1,"circle-stroke-color":B,"circle-stroke-opacity":.15}})}),t.jsx(_,{id:"replay-trail",type:"geojson",data:be,children:t.jsx(A,{id:"replay-trail-line",type:"line",paint:{"line-color":B,"line-width":3,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"}})}),k&&x.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],[x[0].lng,x[0].lat]]}}]},children:t.jsx(A,{id:"replay-path-link-line",type:"line",paint:{"line-color":B,"line-width":1.5,"line-opacity":.5,"line-dasharray":[3,2]},layout:{"line-cap":"round"}})}),k&&t.jsx($,{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(ue,{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(Ee,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>E.getState().togglePlay(),className:"p-1 rounded-full bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 transition-colors shrink-0",title:ne?"Pause":"Rewind",children:ne?t.jsx(Pe,{className:"w-3 h-3"}):t.jsx(Fe,{className:"w-3 h-3"})}),t.jsx("input",{type:"range",min:0,max:100,step:.1,value:Ne*100,onChange:e=>{const n=parseFloat(e.target.value)/100;E.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:[ve,"/",z," pkts"]}),t.jsx("div",{className:"flex items-center gap-px shrink-0",children:Ye.map(e=>t.jsxs("button",{onClick:()=>E.getState().setSpeed(e),className:J("px-1 py-0.5 rounded text-[9px] font-medium transition-colors",e===ye?"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary"),children:[e,"×"]},e))})]})}),!g&&ae.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:ae.map((e,n)=>t.jsxs(Y,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[t.jsx(Ue,{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(Y,{color:"zinc",className:"type-data-xs shadow-sm",children:[p>0?"+":"",p.toFixed(1)," dB"]})})]})}export{ut as CompanionPathMap}; diff --git a/frontend/dist/assets/Configuration-DiItfVqY.js b/frontend/dist/assets/Configuration-YvAayUtY.js similarity index 98% rename from frontend/dist/assets/Configuration-DiItfVqY.js rename to frontend/dist/assets/Configuration-YvAayUtY.js index 11c05f71..ccfe724d 100644 --- a/frontend/dist/assets/Configuration-DiItfVqY.js +++ b/frontend/dist/assets/Configuration-YvAayUtY.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 _e,dv as ze,dw as _t,dx as kt,r as a,eC as is,eD as ls,j as e,c as b,_ as Me,ab as fe,H as St,G as Ct,eE as Tt,f as B,bK as Oe,a6 as Y,a4 as Ne,cV as we,cx as cs,eF as Ft,B as F,$ as rs,eG as Vs,aB as Ws,bX as Le,a1 as Ys,eH as Et,aa as Rt,aA as Hs,c3 as Pt,c7 as os,dz as Qs,eI as Mt,eJ as $s,eK as At,eL as Dt,eM as Lt,R as It,eN as de,I as Ot,a5 as zt,a7 as Kt}from"./index-C8J8z7Af.js";import{g as Vt,a as Ht,s as $t,c as Ut,u as Bt,d as qt}from"./transport-UEOv7eJu.js";import{c as Gt,r as Xt}from"./system-CzT5Ikli.js";import{C as Jt}from"./ConfirmModal-B5_l2g7c.js";import{S as Wt,A as Yt,a as Qt,N as Zt}from"./AutoConfigureDialog-CVadgP9a.js";import{S,a as Ae}from"./setting-field-DUdKGmIP.js";import{i as ea,g as sa,s as ta,a as aa,k as na}from"./keycap-sfx-ByZp-njj.js";import{C as q,P as la,a as ra,B as oa}from"./PageLayout-D_1HzH-E.js";import{T as Zs}from"./trash-2-MzXRdjh-.js";import{P as ia}from"./pencil-C5OSBhs0.js";import{R as ca}from"./rotate-ccw-CH2KviiM.js";import{W as da}from"./wand-sparkles-CkPC71f7.js";import{S as ua}from"./shield-Gw0bk8jQ.js";import{R as ma}from"./repeat-DFihKOPA.js";import{G as fa}from"./git-branch-ChtBrERo.js";import{C as xa}from"./clock-CTBG2e06.js";import{C as et}from"./chevron-right-ZaDPsavE.js";import{R as W,C as ue}from"./Grid-CfYPlwSW.js";import{A as pa}from"./antenna-uOteVbHn.js";import{F as Us}from"./folder-lock-DvltIKzr.js";import{P as Bs}from"./plus-DWX8cdcI.js";import{K as Ze}from"./key-round-C1SnbsaC.js";import"./arrow-right-D_4v2CeG.js";/** +import{e as _e,dv as ze,dw as _t,dx as kt,r as a,eC as is,eD as ls,j as e,c as b,_ as Me,ab as fe,H as St,G as Ct,eE as Tt,f as B,bK as Oe,a6 as Y,a4 as Ne,cV as we,cx as cs,eF as Ft,B as F,$ as rs,eG as Vs,aB as Ws,bX as Le,a1 as Ys,eH as Et,aa as Rt,aA as Hs,c3 as Pt,c7 as os,dz as Qs,eI as Mt,eJ as $s,eK as At,eL as Dt,eM as Lt,R as It,eN as de,I as Ot,a5 as zt,a7 as Kt}from"./index-Dk8KEIKm.js";import{g as Vt,a as Ht,s as $t,c as Ut,u as Bt,d as qt}from"./transport-DFMEelmb.js";import{c as Gt,r as Xt}from"./system-CChwfvfT.js";import{C as Jt}from"./ConfirmModal-n8Se2h3L.js";import{S as Wt,A as Yt,a as Qt,N as Zt}from"./AutoConfigureDialog-CH58tL57.js";import{S,a as Ae}from"./setting-field-mByymMx9.js";import{i as ea,g as sa,s as ta,a as aa,k as na}from"./keycap-sfx-ByZp-njj.js";import{C as q,P as la,a as ra,B as oa}from"./PageLayout-CGcnsIyM.js";import{T as Zs}from"./trash-2-BNWAPzrN.js";import{P as ia}from"./pencil-Cf1ve6Fc.js";import{R as ca}from"./rotate-ccw-BQDcEa4l.js";import{W as da}from"./wand-sparkles-Cfv_3ntm.js";import{S as ua}from"./shield-61UHbj0K.js";import{R as ma}from"./repeat-CCIOgB90.js";import{G as fa}from"./git-branch-Dye45Z4B.js";import{C as xa}from"./clock-BSYVhL7Q.js";import{C as et}from"./chevron-right-BugwEnle.js";import{R as W,C as ue}from"./Grid-CThL_TW5.js";import{A as pa}from"./antenna-BPUiILZz.js";import{F as Us}from"./folder-lock-CojF4hzD.js";import{P as Bs}from"./plus-BQyrUsn7.js";import{K as Ze}from"./key-round-CDk8iwaD.js";import"./arrow-right-vgcsVPr-.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConfirmModal-B5_l2g7c.js b/frontend/dist/assets/ConfirmModal-n8Se2h3L.js similarity index 91% rename from frontend/dist/assets/ConfirmModal-B5_l2g7c.js rename to frontend/dist/assets/ConfirmModal-n8Se2h3L.js index 943fa4a6..a3e98545 100644 --- a/frontend/dist/assets/ConfirmModal-B5_l2g7c.js +++ b/frontend/dist/assets/ConfirmModal-n8Se2h3L.js @@ -1 +1 @@ -import{r as d,j as s,ay as x,aH as m,bX as g,c as f,az as C,eO as j,B as o}from"./index-C8J8z7Af.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:f("w-5 h-5",u[a])}),title:r,onClose:e}),s.jsx(C,{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,ay as x,aH as m,bX as g,c as f,az as C,eO as j,B as o}from"./index-Dk8KEIKm.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:f("w-5 h-5",u[a])}),title:r,onClose:e}),s.jsx(C,{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-BxFskpCD.js b/frontend/dist/assets/Contacts-DIeFu4lF.js similarity index 90% rename from frontend/dist/assets/Contacts-BxFskpCD.js rename to frontend/dist/assets/Contacts-DIeFu4lF.js index 51040299..0540cc9e 100644 --- a/frontend/dist/assets/Contacts-BxFskpCD.js +++ b/frontend/dist/assets/Contacts-DIeFu4lF.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-BTeia5BJ.js","assets/index-C8J8z7Af.js","assets/BasemapLayer-BvoQWTC4.js","assets/consumer-registry-BKgTBvt8.js","assets/link-scoring-BlhmfUap.js","assets/ConfirmModal-B5_l2g7c.js","assets/variants-CSW2-RVV.js","assets/git-branch-ChtBrERo.js","assets/useMapViewStore-CmYR40pV.js","assets/index-CSWZC0QG.js","assets/index-DAnUKwME.js","assets/funnel-CRYMLc9L.js","assets/plus-DWX8cdcI.js","assets/compass--Ql4hKkC.js","assets/zap-8IJ4kWaK.js","assets/max-DNf2hxWM.js","assets/trash-2-MzXRdjh-.js","assets/wifi-off-DYd4qfYe.js","assets/wifi-5HVE8VPj.js","assets/circle-alert-CkWx_yNx.js","assets/clock-CTBG2e06.js","assets/chevron-right-ZaDPsavE.js","assets/useReplayTick-BAMq1uf1.js","assets/payload-detail-BWHpd-ZF.js","assets/LightSparkline-DUJ9rwBo.js","assets/badge-colors-Dl76Mz8m.js","assets/map-pin-ufrVZcS3.js","assets/wrench-DY1XOTkT.js","assets/layer-DgtbTXVx.js","assets/node-types-B5WxOxT2.js","assets/easing-CQ2FiqiW.js","assets/usePipelineStore-CtpzsDw6.js","assets/PageLayout-D_1HzH-E.js","assets/listbox-BOcIoorq.js","assets/element-movement-DhaeUFJY.js","assets/floating-DcVaWvZe.js","assets/use-text-value-Bj-jCGjS.js","assets/frozen-BZ7OZfIg.js","assets/TimeRangeStepper-D6X8K2qC.js","assets/MqttModeBadge-D5EDDcC2.js","assets/chat-utils-C5p1i8vZ.js","assets/SignalIndicator-CpPs32QG.js","assets/CollisionExplorerModal-bQOWAc0q.js","assets/share-2-PheBENSj.js","assets/circle-question-mark-CD6FHJ5H.js","assets/map-pin-off-COAzJaWC.js","assets/activity-Bh2DzqDM.js","assets/target-BJQI0xG9.js","assets/search-BO7ZBfwt.js","assets/index-CqhZhFJJ.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); -import{e as xe,at as cs,j as e,r as n,_ as is,cr as He,cs as Oe,aq as U,ct as ls,a4 as Ce,cu as ds,cv as me,R as de,c3 as ms,aw as Ie,cw as ye,a6 as De,cx as xs,ae as us,cy as ps,cz as hs,cA as fs,ad as gs,cB as js,cC as bs,af as ys,ax as Ns,ag as Ne,cD as vs,cE as ws,bG as Cs,cF as ks,bF as ee,cG as $e,a2 as Ms,I as Ss,bK as Ps,c as we}from"./index-C8J8z7Af.js";import{useDiscoveredNodes as Rs}from"./usePipelineStore-CtpzsDw6.js";import{c as ke}from"./node-types-B5WxOxT2.js";import{P as _s,a as Ls,B as Ts}from"./PageLayout-D_1HzH-E.js";import{L as $s,a as le}from"./listbox-BOcIoorq.js";import{T as Fe}from"./TimeRangeStepper-D6X8K2qC.js";import{M as Fs}from"./MqttModeBadge-D5EDDcC2.js";import{u as Es,e as Hs,f as Os,r as Is}from"./consumer-registry-BKgTBvt8.js";import{e as Ds,g as zs,a as Bs}from"./chat-utils-C5p1i8vZ.js";import{b as As}from"./SignalIndicator-CpPs32QG.js";import{C as qs}from"./CollisionExplorerModal-bQOWAc0q.js";import{S as Vs}from"./share-2-PheBENSj.js";import{C as ze}from"./circle-question-mark-CD6FHJ5H.js";import{M as Gs}from"./map-pin-off-COAzJaWC.js";import{A as Be}from"./activity-Bh2DzqDM.js";import{T as Us}from"./target-BJQI0xG9.js";import{T as Ws}from"./trash-2-MzXRdjh-.js";import{C as Qs}from"./ConfirmModal-B5_l2g7c.js";import{M as Ks}from"./map-pin-ufrVZcS3.js";import{S as Xs}from"./search-BO7ZBfwt.js";import{C as Zs}from"./clock-CTBG2e06.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-2Kt6ucfC.js","assets/index-Dk8KEIKm.js","assets/BasemapLayer-snfcoHal.js","assets/consumer-registry-CTHycSys.js","assets/link-scoring-DySzFC0u.js","assets/ConfirmModal-n8Se2h3L.js","assets/variants-bcpM0cYI.js","assets/git-branch-Dye45Z4B.js","assets/useMapViewStore-CNJAZ76M.js","assets/index-M6ru5Gad.js","assets/index-DMeWa3DH.js","assets/funnel-B-Z6Air3.js","assets/plus-BQyrUsn7.js","assets/compass-DJByH8FZ.js","assets/zap-B0O7nHBO.js","assets/max-zrNGYgli.js","assets/trash-2-BNWAPzrN.js","assets/wifi-off-Dyij-7Es.js","assets/wifi-BW0hMh8T.js","assets/circle-alert-CkK66Qaq.js","assets/clock-BSYVhL7Q.js","assets/chevron-right-BugwEnle.js","assets/useReplayTick-DTG9e32S.js","assets/payload-detail-BR_z6q5h.js","assets/LightSparkline-eR-H8PYv.js","assets/badge-colors-Dl76Mz8m.js","assets/map-pin-6ZLH5iNg.js","assets/wrench-2g9NYn7s.js","assets/layer-CgHNe4F2.js","assets/node-types-SdzDwn2r.js","assets/easing-x6QsY02F.js","assets/usePipelineStore-C2CKtblH.js","assets/PageLayout-CGcnsIyM.js","assets/listbox-BpBYEakW.js","assets/element-movement-CrHrmJVz.js","assets/floating-DAdA6y7o.js","assets/use-text-value-XAXtIZxt.js","assets/frozen-DqtxZ1v6.js","assets/TimeRangeStepper-CNBzSSfG.js","assets/MqttModeBadge-CijH65Eh.js","assets/chat-utils-DAcFG23d.js","assets/SignalIndicator-DJ2WGJCI.js","assets/CollisionExplorerModal-5AGT-1cv.js","assets/share-2-CopKWuTH.js","assets/circle-question-mark-BNRkoCvq.js","assets/map-pin-off-DSyO3Y2C.js","assets/activity-D99FIjaW.js","assets/target-Djl_t-RI.js","assets/search-DgakOYk2.js","assets/index-CqhZhFJJ.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); +import{e as xe,at as cs,j as e,r as n,_ as is,cr as He,cs as Oe,aq as U,ct as ls,a4 as Ce,cu as ds,cv as me,R as de,c3 as ms,aw as Ie,cw as ye,a6 as De,cx as xs,ae as us,cy as ps,cz as hs,cA as fs,ad as gs,cB as js,cC as bs,af as ys,ax as Ns,ag as Ne,cD as vs,cE as ws,bG as Cs,cF as ks,bF as ee,cG as $e,a2 as Ms,I as Ss,bK as Ps,c as we}from"./index-Dk8KEIKm.js";import{useDiscoveredNodes as Rs}from"./usePipelineStore-C2CKtblH.js";import{c as ke}from"./node-types-SdzDwn2r.js";import{P as _s,a as Ls,B as Ts}from"./PageLayout-CGcnsIyM.js";import{L as $s,a as le}from"./listbox-BpBYEakW.js";import{T as Fe}from"./TimeRangeStepper-CNBzSSfG.js";import{M as Fs}from"./MqttModeBadge-CijH65Eh.js";import{u as Es,e as Hs,f as Os,r as Is}from"./consumer-registry-CTHycSys.js";import{e as Ds,g as zs,a as Bs}from"./chat-utils-DAcFG23d.js";import{b as As}from"./SignalIndicator-DJ2WGJCI.js";import{C as qs}from"./CollisionExplorerModal-5AGT-1cv.js";import{S as Vs}from"./share-2-CopKWuTH.js";import{C as ze}from"./circle-question-mark-BNRkoCvq.js";import{M as Gs}from"./map-pin-off-DSyO3Y2C.js";import{A as Be}from"./activity-D99FIjaW.js";import{T as Us}from"./target-Djl_t-RI.js";import{T as Ws}from"./trash-2-BNWAPzrN.js";import{C as Qs}from"./ConfirmModal-n8Se2h3L.js";import{M as Ks}from"./map-pin-6ZLH5iNg.js";import{S as Xs}from"./search-DgakOYk2.js";import{C as Zs}from"./clock-BSYVhL7Q.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,at as cs,j as e,r as n,_ as is,cr as He,cs as Oe,aq as U,ct as ls * * 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-BTeia5BJ.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,49,50,51]))),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(()=>U(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),z=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:z,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(ls,{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(qs,{isOpen:!0,prefix:p.prefix,candidateHashes:p.candidateHashes,onClose:B})]})}const lt=n.memo(it),qe=[{target:"Contacts",fn:"name",minStage:1,when:Hs},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Os}];Is(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:z,metaSummary:B,metaTooltip:A,onRowClick:q,onPing:S,onRemove:P}){Es(qe);const R=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:W,isRoomServer:_,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":""} ${R?"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 ${ds(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(_&&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(Vs,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(_)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((W||Q)&&H!=="Unknown"){const{emoji:F,cleanName:ue}=Ds(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:Bs(H)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(ze,{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"}),_&&e.jsx("span",{className:"contact-tag contact-tag--room",children:"ROOM"}),W&&e.jsx("span",{className:"contact-tag contact-tag--comp",children:"COMP"}),Q&&e.jsx("span",{className:"contact-tag contact-tag--client",children:"CLIENT"}),z&&e.jsx("span",{className:"contact-tag contact-tag--mobile",children:"MOB"}),!R&&e.jsx(Gs,{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(ms,{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(As,{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(De,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Us,{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(Ws,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const xt=n.memo(mt),ut=6371e3,pt=[{field:"lastHeard",icon:Zs,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}=xs(),l=us(),g=ps(),u=hs(),j=fs(),N=gs(),c=js(),T=bs(),$=ys(),w=Ns(),p=Ne[$],C=He(),z=Oe(),B=vs(),A=z.totalPaths>0&&z.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),[R,H]=n.useState("lastHeard"),[O,se]=n.useState("desc"),[v,W]=n.useState(""),[_,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),[Ge,K]=n.useState(new Map),[k,Ue]=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=Rs(),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=ws(),D=o==null?void 0:o.local_hash,We=n.useMemo(()=>{const s=new Map;if(!D||c.size===0)return s;for(const[a,t]of c)if(a.endsWith(`→${D}`)&&t.hops.length>1){const r=a.split("→")[0],i=t.hops[t.hops.length-1];s.set(r,i)}return s},[c,D]),Qe=n.useMemo(()=>{const s=new Map;if(!D||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(`→${D}`)||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,D,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:Ke}=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=_||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=U(i).toLowerCase();return h.includes(s)||f.includes(s)||i.toLowerCase().includes(s)}))},[I,v,_,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=U(r).toLowerCase(),E=U(d).toLowerCase(),M=y===a,G=E===a;if(M&&!G)return-1;if(G&&!M)return 1}let f=0;switch(R){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,R,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]),Re=n.useMemo(()=>k===0?x:x.slice(0,V),[x,V,k]);n.useEffect(()=>{ne(k||x.length)},[R,O,v,_,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 Ze=n.useCallback(s=>{Ue(s),ne(s||x.length)},[x.length]),Je=n.useCallback(s=>{R===s?se(a=>a==="desc"?"asc":"desc"):(H(s),se("desc"))},[R]),Ye=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})},[]),_e=Cs((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}),K(t=>{const r=new Map(t);return r.delete(s),r});try{const r=`0x${U(s,_e)}`,i=await ks(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)):(K(d=>new Map(d).set(s,i.error||"Ping failed")),setTimeout(()=>{K(d=>{const h=new Map(d);return h.delete(s),h})},5e3))}catch(t){const r=t instanceof Error?t.message:"Ping failed";K(i=>new Map(i).set(s,r)),setTimeout(()=>{K(i=>{const d=new Map(i);return d.delete(s),d})},5e3)}finally{Se(null)}}},[pe,_e]);return e.jsxs(_s,{children:[e.jsx(Ls,{title:"Contacts",icon:e.jsx(ee,{}),subtitle:e.jsx(Fs,{}),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(Ks,{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(ze,{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(Ts,{children:[e.jsx(ct,{neighbors:I,localNode:L??void 0,localHash:D,onRemoveNode:g,selectedNodeHash:ue,onNodeSelected:es}),e.jsxs(Ms,{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(Ss,{type:"search",size:"sm",value:v,onChange:s=>W(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Xs,{className:"w-3.5 h-3.5"}),trailingIcon:v?e.jsx("button",{onClick:()=>{W(""),(v.toLowerCase().trim()==="neighbor"||v.toLowerCase().trim()==="neighbors")&&Q(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(Ps,{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(!_),className:ve(_,{color:"success",border:!0}),title:_?"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:()=>Je(s),className:ve(R===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}),R===s&&e.jsx(Ys,{className:we("w-3 h-3",O==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs($s,{value:k,onChange:Ze,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:Re.map(([s,a])=>{const t=U(s),r=Xe.has(s),i=ce.has(s),d=oe.get(s)??null,h=j.get(s)||0,f=i?Ke.get(s):void 0,y=t?q.get(t)??null:null,E=T.has(s),M=i?null:Qe.get(s)??null,G=We.get(s)??null,je=B.get(s);let Z=null;if(je&&je.length>0){const ie=je.reduce((rs,os)=>rs+os.count,0);ie>0&&(Z=ie/24)}const be=a.first_seen?Ie(a.first_seen).replace(/ ago$/i,""):null,J=[],Y=[];if(M){const ie=M.name??M.prefix;J.push(`→${ie} +${M.hopCount}`),Y.push(`Gateway: ${M.name??M.prefix} (${M.hopCount} hop${M.hopCount!==1?"s":""})`)}G&&(J.push(`↙${G}`),Y.push(`Last forwarder: ${G}`)),Z!==null&&(J.push(`${Z<1?"<1":Math.round(Z)}/hr`),Y.push(`Packet rate: ${Z.toFixed(1)}/hr`)),be&&(J.push(be),Y.push(`First seen: ${be} ago`));const as=J.join(" · "),ns=Y.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-2Kt6ucfC.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,49,50,51]))),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(()=>U(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),z=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:z,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(ls,{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(qs,{isOpen:!0,prefix:p.prefix,candidateHashes:p.candidateHashes,onClose:B})]})}const lt=n.memo(it),qe=[{target:"Contacts",fn:"name",minStage:1,when:Hs},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Os}];Is(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:z,metaSummary:B,metaTooltip:A,onRowClick:q,onPing:S,onRemove:P}){Es(qe);const R=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:W,isRoomServer:_,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":""} ${R?"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 ${ds(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(_&&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(Vs,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(_)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((W||Q)&&H!=="Unknown"){const{emoji:F,cleanName:ue}=Ds(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:Bs(H)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(ze,{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"}),_&&e.jsx("span",{className:"contact-tag contact-tag--room",children:"ROOM"}),W&&e.jsx("span",{className:"contact-tag contact-tag--comp",children:"COMP"}),Q&&e.jsx("span",{className:"contact-tag contact-tag--client",children:"CLIENT"}),z&&e.jsx("span",{className:"contact-tag contact-tag--mobile",children:"MOB"}),!R&&e.jsx(Gs,{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(ms,{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(As,{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(De,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Us,{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(Ws,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const xt=n.memo(mt),ut=6371e3,pt=[{field:"lastHeard",icon:Zs,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}=xs(),l=us(),g=ps(),u=hs(),j=fs(),N=gs(),c=js(),T=bs(),$=ys(),w=Ns(),p=Ne[$],C=He(),z=Oe(),B=vs(),A=z.totalPaths>0&&z.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),[R,H]=n.useState("lastHeard"),[O,se]=n.useState("desc"),[v,W]=n.useState(""),[_,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),[Ge,K]=n.useState(new Map),[k,Ue]=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=Rs(),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=ws(),D=o==null?void 0:o.local_hash,We=n.useMemo(()=>{const s=new Map;if(!D||c.size===0)return s;for(const[a,t]of c)if(a.endsWith(`→${D}`)&&t.hops.length>1){const r=a.split("→")[0],i=t.hops[t.hops.length-1];s.set(r,i)}return s},[c,D]),Qe=n.useMemo(()=>{const s=new Map;if(!D||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(`→${D}`)||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,D,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:Ke}=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=_||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=U(i).toLowerCase();return h.includes(s)||f.includes(s)||i.toLowerCase().includes(s)}))},[I,v,_,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=U(r).toLowerCase(),E=U(d).toLowerCase(),M=y===a,G=E===a;if(M&&!G)return-1;if(G&&!M)return 1}let f=0;switch(R){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,R,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]),Re=n.useMemo(()=>k===0?x:x.slice(0,V),[x,V,k]);n.useEffect(()=>{ne(k||x.length)},[R,O,v,_,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 Ze=n.useCallback(s=>{Ue(s),ne(s||x.length)},[x.length]),Je=n.useCallback(s=>{R===s?se(a=>a==="desc"?"asc":"desc"):(H(s),se("desc"))},[R]),Ye=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})},[]),_e=Cs((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}),K(t=>{const r=new Map(t);return r.delete(s),r});try{const r=`0x${U(s,_e)}`,i=await ks(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)):(K(d=>new Map(d).set(s,i.error||"Ping failed")),setTimeout(()=>{K(d=>{const h=new Map(d);return h.delete(s),h})},5e3))}catch(t){const r=t instanceof Error?t.message:"Ping failed";K(i=>new Map(i).set(s,r)),setTimeout(()=>{K(i=>{const d=new Map(i);return d.delete(s),d})},5e3)}finally{Se(null)}}},[pe,_e]);return e.jsxs(_s,{children:[e.jsx(Ls,{title:"Contacts",icon:e.jsx(ee,{}),subtitle:e.jsx(Fs,{}),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(Ks,{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(ze,{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(Ts,{children:[e.jsx(ct,{neighbors:I,localNode:L??void 0,localHash:D,onRemoveNode:g,selectedNodeHash:ue,onNodeSelected:es}),e.jsxs(Ms,{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(Ss,{type:"search",size:"sm",value:v,onChange:s=>W(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Xs,{className:"w-3.5 h-3.5"}),trailingIcon:v?e.jsx("button",{onClick:()=>{W(""),(v.toLowerCase().trim()==="neighbor"||v.toLowerCase().trim()==="neighbors")&&Q(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(Ps,{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(!_),className:ve(_,{color:"success",border:!0}),title:_?"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:()=>Je(s),className:ve(R===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}),R===s&&e.jsx(Ys,{className:we("w-3 h-3",O==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs($s,{value:k,onChange:Ze,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:Re.map(([s,a])=>{const t=U(s),r=Xe.has(s),i=ce.has(s),d=oe.get(s)??null,h=j.get(s)||0,f=i?Ke.get(s):void 0,y=t?q.get(t)??null:null,E=T.has(s),M=i?null:Qe.get(s)??null,G=We.get(s)??null,je=B.get(s);let Z=null;if(je&&je.length>0){const ie=je.reduce((rs,os)=>rs+os.count,0);ie>0&&(Z=ie/24)}const be=a.first_seen?Ie(a.first_seen).replace(/ ago$/i,""):null,J=[],Y=[];if(M){const ie=M.name??M.prefix;J.push(`→${ie} +${M.hopCount}`),Y.push(`Gateway: ${M.name??M.prefix} (${M.hopCount} hop${M.hopCount!==1?"s":""})`)}G&&(J.push(`↙${G}`),Y.push(`Last forwarder: ${G}`)),Z!==null&&(J.push(`${Z<1?"<1":Math.round(Z)}/hr`),Y.push(`Packet rate: ${Z.toFixed(1)}/hr`)),be&&(J.push(be),Y.push(`First seen: ${be} ago`));const as=J.join(" · "),ns=Y.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:Ge.get(s),isMobile:E,metaSummary:as,metaTooltip:ns,onRowClick:Ye,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-BTeia5BJ.js b/frontend/dist/assets/ContactsMapMapLibre-2Kt6ucfC.js similarity index 99% rename from frontend/dist/assets/ContactsMapMapLibre-BTeia5BJ.js rename to frontend/dist/assets/ContactsMapMapLibre-2Kt6ucfC.js index ad9707a6..e10e8392 100644 --- a/frontend/dist/assets/ContactsMapMapLibre-BTeia5BJ.js +++ b/frontend/dist/assets/ContactsMapMapLibre-2Kt6ucfC.js @@ -1,4 +1,4 @@ -import{e as Wr,ap as wa,r as T,hd as va,cx as ba,dB as ka,dC as Ca,j as m,ay as Eo,dD as Ea,az as So,m as qt,a4 as Yn,aA as Mo,ca as Sa,c as Cn,a6 as q0,V as ur,Z as vn,he as J0,hf as Bo,hg as Ma,cl as Ba,cs as Da,cv as _a,dz as Do,ct as _o,ar as jo,aB as To,d as Sr,b as En,B as Ft,dS as ja,cn as ps,H as Us,G as Vs,dJ as Ro,w as Io,d1 as Lo,R as No,bK as Sn,bF as wi,hh as Fo,W as Ta,aa as Ra,dR as Ia,hi as La,aw as Po,bR as vi,bT as Na,a5 as X0,a7 as As,cp as Fa,b6 as Pa,f6 as Qo,hj as Qa,hk as Oa,dT as za,dA as Ha,hl as Ga,hm as Ua,aO as Oo,$ as bt,hn as Va,ho as zo,gO as Wa,aq as Mr,bN as Ho,dI as Ya,hp as Go,hq as Uo,cc as Ka,hb as $a,cf as Za,dG as Vo,dK as qa,ad as Ja,hr as Xa,fi as Au,hs as gs,gh as eu,fQ as tu,dy as ru}from"./index-C8J8z7Af.js";import{u as Yr,M as nu,S as su,B as iu}from"./BasemapLayer-BvoQWTC4.js";import{u as Wo,r as Yo,e as bi,f as ki,g as ou}from"./consumer-registry-BKgTBvt8.js";import{L as V0,c as lu}from"./link-scoring-BlhmfUap.js";import{C as au}from"./ConfirmModal-B5_l2g7c.js";import{s as uu,a as cu,M as fu}from"./variants-CSW2-RVV.js";import{G as Bs}from"./git-branch-ChtBrERo.js";import{H as hu,A as y0,D as Ci,p as du,c as mu,u as mn}from"./useMapViewStore-CmYR40pV.js";import{F as pu}from"./funnel-CRYMLc9L.js";import{P as gu}from"./plus-DWX8cdcI.js";import{C as yu}from"./compass--Ql4hKkC.js";import{Z as xu}from"./zap-8IJ4kWaK.js";import{b as wu,e as vu,a as Ko,m as Ei,E as bu,u as ku,G as Cu,g as Eu,d as Su,f as Mu}from"./max-DNf2hxWM.js";import{T as Bu}from"./trash-2-MzXRdjh-.js";import{W as Du}from"./wifi-off-DYd4qfYe.js";import{W as _u}from"./wifi-5HVE8VPj.js";import{C as ju}from"./circle-alert-CkWx_yNx.js";import{C as $o}from"./clock-CTBG2e06.js";import{C as Tu}from"./chevron-right-ZaDPsavE.js";import{u as Ws,a as Zo,b as qo,c as Ru,d as Iu,e as Ys,f as Si,R as Lu,g as Nu,h as Jo,t as Fu,i as Pu,j as Qu,k as Ou}from"./useReplayTick-BAMq1uf1.js";import{L as zu}from"./LightSparkline-DUJ9rwBo.js";import{P as Xo,R as Hu}from"./Contacts-BxFskpCD.js";import{H as K0,C as cr,N as Gu,a as Uu}from"./badge-colors-Dl76Mz8m.js";import{M as Vu}from"./map-pin-ufrVZcS3.js";import{W as Wu}from"./wrench-DY1XOTkT.js";import{S as Vr,L as Zt}from"./layer-DgtbTXVx.js";import{c as Mi}from"./node-types-B5WxOxT2.js";import{a as Al,b as Ds,c as Yu}from"./easing-CQ2FiqiW.js";import"./index-CSWZC0QG.js";import"./index-DAnUKwME.js";import"./payload-detail-BWHpd-ZF.js";import"./usePipelineStore-CtpzsDw6.js";import"./PageLayout-D_1HzH-E.js";import"./listbox-BOcIoorq.js";import"./element-movement-DhaeUFJY.js";import"./floating-DcVaWvZe.js";import"./use-text-value-Bj-jCGjS.js";import"./frozen-BZ7OZfIg.js";import"./TimeRangeStepper-D6X8K2qC.js";import"./MqttModeBadge-D5EDDcC2.js";import"./chat-utils-C5p1i8vZ.js";import"./SignalIndicator-CpPs32QG.js";import"./CollisionExplorerModal-bQOWAc0q.js";import"./share-2-PheBENSj.js";import"./circle-question-mark-CD6FHJ5H.js";import"./map-pin-off-COAzJaWC.js";import"./activity-Bh2DzqDM.js";import"./target-BJQI0xG9.js";import"./search-BO7ZBfwt.js";/** +import{e as Wr,ap as wa,r as T,hd as va,cx as ba,dB as ka,dC as Ca,j as m,ay as Eo,dD as Ea,az as So,m as qt,a4 as Yn,aA as Mo,ca as Sa,c as Cn,a6 as q0,V as ur,Z as vn,he as J0,hf as Bo,hg as Ma,cl as Ba,cs as Da,cv as _a,dz as Do,ct as _o,ar as jo,aB as To,d as Sr,b as En,B as Ft,dS as ja,cn as ps,H as Us,G as Vs,dJ as Ro,w as Io,d1 as Lo,R as No,bK as Sn,bF as wi,hh as Fo,W as Ta,aa as Ra,dR as Ia,hi as La,aw as Po,bR as vi,bT as Na,a5 as X0,a7 as As,cp as Fa,b6 as Pa,f6 as Qo,hj as Qa,hk as Oa,dT as za,dA as Ha,hl as Ga,hm as Ua,aO as Oo,$ as bt,hn as Va,ho as zo,gO as Wa,aq as Mr,bN as Ho,dI as Ya,hp as Go,hq as Uo,cc as Ka,hb as $a,cf as Za,dG as Vo,dK as qa,ad as Ja,hr as Xa,fi as Au,hs as gs,gh as eu,fQ as tu,dy as ru}from"./index-Dk8KEIKm.js";import{u as Yr,M as nu,S as su,B as iu}from"./BasemapLayer-snfcoHal.js";import{u as Wo,r as Yo,e as bi,f as ki,g as ou}from"./consumer-registry-CTHycSys.js";import{L as V0,c as lu}from"./link-scoring-DySzFC0u.js";import{C as au}from"./ConfirmModal-n8Se2h3L.js";import{s as uu,a as cu,M as fu}from"./variants-bcpM0cYI.js";import{G as Bs}from"./git-branch-Dye45Z4B.js";import{H as hu,A as y0,D as Ci,p as du,c as mu,u as mn}from"./useMapViewStore-CNJAZ76M.js";import{F as pu}from"./funnel-B-Z6Air3.js";import{P as gu}from"./plus-BQyrUsn7.js";import{C as yu}from"./compass-DJByH8FZ.js";import{Z as xu}from"./zap-B0O7nHBO.js";import{b as wu,e as vu,a as Ko,m as Ei,E as bu,u as ku,G as Cu,g as Eu,d as Su,f as Mu}from"./max-zrNGYgli.js";import{T as Bu}from"./trash-2-BNWAPzrN.js";import{W as Du}from"./wifi-off-Dyij-7Es.js";import{W as _u}from"./wifi-BW0hMh8T.js";import{C as ju}from"./circle-alert-CkK66Qaq.js";import{C as $o}from"./clock-BSYVhL7Q.js";import{C as Tu}from"./chevron-right-BugwEnle.js";import{u as Ws,a as Zo,b as qo,c as Ru,d as Iu,e as Ys,f as Si,R as Lu,g as Nu,h as Jo,t as Fu,i as Pu,j as Qu,k as Ou}from"./useReplayTick-DTG9e32S.js";import{L as zu}from"./LightSparkline-eR-H8PYv.js";import{P as Xo,R as Hu}from"./Contacts-DIeFu4lF.js";import{H as K0,C as cr,N as Gu,a as Uu}from"./badge-colors-Dl76Mz8m.js";import{M as Vu}from"./map-pin-6ZLH5iNg.js";import{W as Wu}from"./wrench-2g9NYn7s.js";import{S as Vr,L as Zt}from"./layer-CgHNe4F2.js";import{c as Mi}from"./node-types-SdzDwn2r.js";import{a as Al,b as Ds,c as Yu}from"./easing-x6QsY02F.js";import"./index-M6ru5Gad.js";import"./index-DMeWa3DH.js";import"./payload-detail-BR_z6q5h.js";import"./usePipelineStore-C2CKtblH.js";import"./PageLayout-CGcnsIyM.js";import"./listbox-BpBYEakW.js";import"./element-movement-CrHrmJVz.js";import"./floating-DAdA6y7o.js";import"./use-text-value-XAXtIZxt.js";import"./frozen-DqtxZ1v6.js";import"./TimeRangeStepper-CNBzSSfG.js";import"./MqttModeBadge-CijH65Eh.js";import"./chat-utils-DAcFG23d.js";import"./SignalIndicator-DJ2WGJCI.js";import"./CollisionExplorerModal-5AGT-1cv.js";import"./share-2-CopKWuTH.js";import"./circle-question-mark-BNRkoCvq.js";import"./map-pin-off-DSyO3Y2C.js";import"./activity-D99FIjaW.js";import"./target-Djl_t-RI.js";import"./search-DgakOYk2.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Dashboard-Cvvu9N9z.js b/frontend/dist/assets/Dashboard-C-JGUZGD.js similarity index 97% rename from frontend/dist/assets/Dashboard-Cvvu9N9z.js rename to frontend/dist/assets/Dashboard-C-JGUZGD.js index 6c91336d..2bbb43be 100644 --- a/frontend/dist/assets/Dashboard-Cvvu9N9z.js +++ b/frontend/dist/assets/Dashboard-C-JGUZGD.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C8J8z7Af.js","assets/index-CqhZhFJJ.css"])))=>i.map(i=>d[i]); -import{e as Z,k as ps,n as Tt,o as St,J as xs,p as gs,q as ys,t as $e,v as bs,r as h,M as js,w as ws,_ as et,x as tt,y as _t,z as Bt,D as Ns,E as ee,F as vs,j as t,d as Je,m as Re,G as Dt,H as Rt,U as ks,K as Ms,L as De,P as Cs,N as Ts,O as Q,Q as Ss,T as _s,V as Y,W as Pe,X as At,Y as Lt,$ as se,a0 as Bs,a1 as Ds,a2 as be,a3 as Rs,a4 as st,a5 as As,a6 as Ls,a7 as Ps,a8 as $s,a9 as Fs,aa as ie,f as Pt,ab as $t,ac as Es,B as Ae,R as Ft,ad as Et,ae as Hs,af as je,ag as ne,ah as Ht,ai as It,aj as Is,ak as zs,al as Os,am as Gs,an as Ws,ao as Fe,u as zt,ap as qs,aq as nt,ar as me,as as ve,at as Ot,au as Us,av as Xs,c as J,aw as Vs,ax as Gt,ay as Wt,az as qt,aA as Ys,aB as Js,aC as we,aD as Zs,aE as Ks,aF as Qs,S as en,aG as Ze,aH as tn,aI as Ut,aJ as Xt,aK as sn,aL as nn,Z as at,aM as an,aN as on,aO as rn,aP as ot}from"./index-C8J8z7Af.js";import{C as rt,P as ln,a as cn,B as dn}from"./PageLayout-D_1HzH-E.js";import{u as fe,r as he,h as un,a as mn,b as fn,i as hn}from"./consumer-registry-BKgTBvt8.js";import{A as re,D as Xe}from"./DataValue-CWEIHPTl.js";import{c as pn}from"./node-types-B5WxOxT2.js";import{b as Vt,c as ge,a as xn,d as gn,F as ke}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as yn,u as Ve,P as bn,T as jn,C as Yt}from"./PacketList-qNmSxnCj.js";import{useGetDecodedContent as wn,useResolveSource as Nn}from"./usePipelineStore-CtpzsDw6.js";import{A as it}from"./arrow-right-D_4v2CeG.js";import{T as Jt}from"./TimeRangeStepper-D6X8K2qC.js";import{L as Zt}from"./LightSparkline-DUJ9rwBo.js";import{c as vn}from"./link-scoring-BlhmfUap.js";import{T as kn}from"./timer-BVd5WQSE.js";import{Z as Mn}from"./zap-8IJ4kWaK.js";import{A as Cn,N as Tn}from"./AutoConfigureDialog-CVadgP9a.js";import{g as Sn,e as Ee,a as _n,f as Bn}from"./chat-utils-C5p1i8vZ.js";import{C as Dn}from"./ChatBubble-DwkygOA9.js";import{M as Kt}from"./message-square-text-CwsdV-n7.js";import{C as lt}from"./chevron-right-ZaDPsavE.js";import{H as Rn}from"./hash-8dFF62ov.js";import{M as An}from"./message-square-CZnvv13e.js";import{M as Ln}from"./MqttModeBadge-D5EDDcC2.js";import{W as Pn}from"./wand-sparkles-CkPC71f7.js";import{u as ue}from"./index-CSWZC0QG.js";import{H as $n}from"./useMapViewStore-CmYR40pV.js";import{R as ct}from"./Grid-CfYPlwSW.js";import"./chevron-up-BhSn6i9S.js";import"./primitives-CBHOCw6k.js";import"./badge-colors-Dl76Mz8m.js";import"./SignalIndicator-CpPs32QG.js";import"./arrow-up-CsqMGTbi.js";import"./arrow-down-Dqy7bDoY.js";import"./payload-detail-BWHpd-ZF.js";import"./map-pin-ufrVZcS3.js";import"./circle-question-mark-CD6FHJ5H.js";import"./layers-Dy827Q5R.js";import"./clock-CTBG2e06.js";import"./route-BEiTCi9B.js";import"./activity-Bh2DzqDM.js";import"./shield-Gw0bk8jQ.js";import"./floating-DcVaWvZe.js";import"./index-DAnUKwME.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dk8KEIKm.js","assets/index-CqhZhFJJ.css"])))=>i.map(i=>d[i]); +import{e as Z,k as ps,n as Tt,o as St,J as xs,p as gs,q as ys,t as $e,v as bs,r as h,M as js,w as ws,_ as et,x as tt,y as _t,z as Bt,D as Ns,E as ee,F as vs,j as t,d as Je,m as Re,G as Dt,H as Rt,U as ks,K as Ms,L as De,P as Cs,N as Ts,O as Q,Q as Ss,T as _s,V as Y,W as Pe,X as At,Y as Lt,$ as se,a0 as Bs,a1 as Ds,a2 as be,a3 as Rs,a4 as st,a5 as As,a6 as Ls,a7 as Ps,a8 as $s,a9 as Fs,aa as ie,f as Pt,ab as $t,ac as Es,B as Ae,R as Ft,ad as Et,ae as Hs,af as je,ag as ne,ah as Ht,ai as It,aj as Is,ak as zs,al as Os,am as Gs,an as Ws,ao as Fe,u as zt,ap as qs,aq as nt,ar as me,as as ve,at as Ot,au as Us,av as Xs,c as J,aw as Vs,ax as Gt,ay as Wt,az as qt,aA as Ys,aB as Js,aC as we,aD as Zs,aE as Ks,aF as Qs,S as en,aG as Ze,aH as tn,aI as Ut,aJ as Xt,aK as sn,aL as nn,Z as at,aM as an,aN as on,aO as rn,aP as ot}from"./index-Dk8KEIKm.js";import{C as rt,P as ln,a as cn,B as dn}from"./PageLayout-CGcnsIyM.js";import{u as fe,r as he,h as un,a as mn,b as fn,i as hn}from"./consumer-registry-CTHycSys.js";import{A as re,D as Xe}from"./DataValue-D1URDV5k.js";import{c as pn}from"./node-types-SdzDwn2r.js";import{b as Vt,c as ge,a as xn,d as gn,F as ke}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as yn,u as Ve,P as bn,T as jn,C as Yt}from"./PacketList-CmrEXwog.js";import{useGetDecodedContent as wn,useResolveSource as Nn}from"./usePipelineStore-C2CKtblH.js";import{A as it}from"./arrow-right-vgcsVPr-.js";import{T as Jt}from"./TimeRangeStepper-CNBzSSfG.js";import{L as Zt}from"./LightSparkline-eR-H8PYv.js";import{c as vn}from"./link-scoring-DySzFC0u.js";import{T as kn}from"./timer-DxeOkv-V.js";import{Z as Mn}from"./zap-B0O7nHBO.js";import{A as Cn,N as Tn}from"./AutoConfigureDialog-CH58tL57.js";import{g as Sn,e as Ee,a as _n,f as Bn}from"./chat-utils-DAcFG23d.js";import{C as Dn}from"./ChatBubble-4SEgCFK2.js";import{M as Kt}from"./message-square-text-hT1rOeOR.js";import{C as lt}from"./chevron-right-BugwEnle.js";import{H as Rn}from"./hash-BaVtxU1B.js";import{M as An}from"./message-square-KCaAXVVf.js";import{M as Ln}from"./MqttModeBadge-CijH65Eh.js";import{W as Pn}from"./wand-sparkles-Cfv_3ntm.js";import{u as ue}from"./index-M6ru5Gad.js";import{H as $n}from"./useMapViewStore-CNJAZ76M.js";import{R as ct}from"./Grid-CThL_TW5.js";import"./chevron-up-DzJVNs-c.js";import"./primitives-CrKVF5BS.js";import"./badge-colors-Dl76Mz8m.js";import"./SignalIndicator-DJ2WGJCI.js";import"./arrow-up-BhSGIVnk.js";import"./arrow-down-B85BrN7t.js";import"./payload-detail-BR_z6q5h.js";import"./map-pin-6ZLH5iNg.js";import"./circle-question-mark-BNRkoCvq.js";import"./layers-g7u6rTYv.js";import"./clock-BSYVhL7Q.js";import"./route-CxDUYLxS.js";import"./activity-D99FIjaW.js";import"./shield-61UHbj0K.js";import"./floating-DAdA6y7o.js";import"./index-DMeWa3DH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -54,7 +54,7 @@ import{e as Z,k as ps,n as Tt,o as St,J as xs,p as gs,q as ys,t as $e,v as bs,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kn=[["circle",{cx:"7",cy:"7",r:"5",key:"x29byf"}],["circle",{cx:"17",cy:"17",r:"5",key:"1op1d2"}],["path",{d:"M12 17h10",key:"ls21zv"}],["path",{d:"m3.46 10.54 7.08-7.08",key:"1rehiu"}]],Qn=Z("tablets",Kn);function ea(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],d=e[3+o],c=ps(r,a,d);return n?c(s):c}function ta(e,n,o={}){const s=e.get();let r=null,a=s,d;const c=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,f=()=>{r&&(r.stop(),r=null)},m=()=>{f();const u=ft(e.get()),y=ft(a);u!==y&&(r=new xs({keyframes:[u,y],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:d}))};if(e.attach((u,y)=>{a=u,d=l=>y(mt(l,c)),Tt.postRender(()=>{var l;m(),(l=e.events.animationStart)==null||l.notify(),r==null||r.then(()=>{var x;(x=e.events.animationComplete)==null||x.notify()})})},f),St(n)){const u=n.on("change",l=>e.set(mt(l,c))),y=e.on("destroy",u);return()=>{u(),y()}}return f}function mt(e,n){return n?e+n:e}function ft(e){return typeof e=="number"?e:parseFloat(e)}function ss(e,n){const o=ue(n()),s=()=>o.set(n());return s(),gs(()=>{const r=()=>Tt.preRender(s,!1,!0),a=e.map(d=>d.on("change",r));return()=>{a.forEach(d=>d()),ys(s)}}),o}function sa(e){$e.current=[],e();const n=ss($e.current,e);return $e.current=void 0,n}function na(e,n,o,s){if(typeof e=="function")return sa(e);const a=ea(n,o,s);return Array.isArray(e)?ht(e,a):ht([e],([d])=>a(d))}function ht(e,n){const o=bs(()=>[]);return ss(e,()=>{o.length=0;const s=e.length;for(let r=0;rSt(e)?e.get():e;if(o)return na(s);const r=ue(s());return h.useInsertionEffect(()=>ta(r,e,n),[r,JSON.stringify(n)]),r}function Me(e,n={}){return aa(e,{type:"spring",...n})}const oe=ws(()=>({result:null,isComputing:!1})),oa=500,ra=300;let ce=null,Ce=null;function ia(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 la(){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 ca(e,n,o,s){const r=la();if(!r)return;const a=e.length,d=new Float64Array(a),c=new Float64Array(a),f=new Uint16Array(a),m=new Uint8Array(a),u=new Uint8Array(a),y=new Uint8Array(a),l=new Uint8Array(a),x=new Float32Array(a),b=new Float32Array(a),p=new Uint32Array(a),g=new Map;let D=0;for(let S=0;SparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function da(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(u=>({...u,bytesByType:{...u.bytesByType},countByType:{...u.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(u=>({...u,bytesByType:{...u.bytesByType},countByType:{...u.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(u=>({...u,bytesByType:{...u.bytesByType},countByType:{...u.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:d,bucket_count:c}=e,f=new Set;for(const u of n){const y=u.timestamp??0;if(ya)continue;const l=Math.floor((y-r)/d);if(l<0||l>=c)continue;f.has(l)||(f.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=_t(u,o),b=u.length??u.payload_length??0,p=u.type??u.payload_type??0,g=u.packet_origin;g==="tx_local"?(s.transmitted[l].count++,s.transmitted[l].airtime_ms+=x):g==="tx_forward"||u.transmitted?(s.forwarded[l].count++,s.forwarded[l].airtime_ms+=x,s.forwardedBytesBuckets[l].bytesByType[p]=(s.forwardedBytesBuckets[l].bytesByType[p]??0)+b,s.forwardedBytesBuckets[l].totalBytes+=b,s.forwardedBytesBuckets[l].countByType[p]=(s.forwardedBytesBuckets[l].countByType[p]??0)+1,s.forwardedBytesBuckets[l].totalCount++,s.forwardedTotalByType[p]=(s.forwardedTotalByType[p]??0)+b,s.totalForwardedCount++):u.drop_reason&&(s.dropped[l].count++,s.dropped[l].airtime_ms+=x,s.droppedBytesBuckets[l].bytesByType[p]=(s.droppedBytesBuckets[l].bytesByType[p]??0)+b,s.droppedBytesBuckets[l].totalBytes+=b,s.droppedBytesBuckets[l].countByType[p]=(s.droppedBytesBuckets[l].countByType[p]??0)+1,s.droppedBytesBuckets[l].totalCount++,s.droppedTotalByType[p]=(s.droppedTotalByType[p]??0)+b,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[p]=(s.receivedBytesBuckets[l].bytesByType[p]??0)+b,s.receivedBytesBuckets[l].totalBytes+=b,s.receivedBytesBuckets[l].countByType[p]=(s.receivedBytesBuckets[l].countByType[p]??0)+1,s.receivedBytesBuckets[l].totalCount++,s.receivedTotalByType[p]=(s.receivedTotalByType[p]??0)+b,s.receivedCountByType[p]=(s.receivedCountByType[p]??0)+1,s.totalReceivedBytes+=b)}const m=s.time_range_minutes/60;return s.kbPerHour=m>0?Math.round(s.totalReceivedBytes/1024/m):0,s.forwardedRatePerHour=m>0?Math.round(s.totalForwardedCount/m):0,s.droppedRatePerHour=m>0?Math.round(s.totalDroppedCount/m):0,s.receivedActiveTypes=He(s.receivedTotalByType),s.forwardedActiveTypes=He(s.forwardedTotalByType),s.droppedActiveTypes=He(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([et(()=>import("./index-C8J8z7Af.js").then(e=>e.hw),__vite__mapDeps([0,1])),et(()=>import("./index-C8J8z7Af.js").then(e=>e.hv),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(d=>{const c=d.packets.length,f=d.globalTimeRangeIndex,m=ia(d.stats);if(c===s&&f===r&&m===a)return;const u=s,y=r,l=a;if(s=c,r=f,a=m,c===0)return;const x=o[f]??o[4],b=x.minutes,p=x.buckets,g=d.stats,D=tt(g),T=c-u,S=f!==y,v=m!==l,w=oe.getState().result;if(!S&&!v&&T>0&&T{Ce=null;const i=e.useStore.getState();if(i.packets.length===0||!i.stats)return;const _=o[i.globalTimeRangeIndex]??o[4],k=tt(i.stats);ca(i.packets,_.minutes,_.buckets,k)},ra)})});const ua=()=>oe(e=>e.result),ns=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:un}];he(ns);function ma(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function pt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const pe=32,Ie=20,fa=[.25,.5,.75,1];function ha({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){fe(ns);const r=Bt(),[a,d]=h.useState(null),[c,f]=h.useState(null),[m,u]=h.useState(null),y=h.useCallback((v,w,j)=>{d(w),f(j)},[]),l=e.length>0&&n.length>0,x=a?ma(a.start):null,b=a?pt(a.start):"",p=m!==null&&x!==null&&m!==x;x!==m&&u(x);const g=h.useMemo(()=>Ns(e),[e]),D=s==="count"?ee:vs,T=h.useMemo(()=>g===0?[]:fa.map(v=>({pct:v,label:D(Math.round(g*v)),pos:(1-v)*100})),[g,D]),S=h.useMemo(()=>{if(e.length===0)return[];const v=e.length,w=Math.max(1,Math.floor(v/6)),j=[];for(let i=0;it.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${j}%`,transform:v===1?"none":"translateY(-50%)",right:0},children:w},v))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:pe,right:0,top:0,bottom:Ie},children:l&&t.jsx(ks,{buckets:e,activeTypes:n,gridColor:r.grid,axisTickColor:r.axisTick,onHover:y,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:pe,height:Ie},"aria-hidden":"true",children:S.map((v,w)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${v.pos}%`,transform:w===0?"none":w===S.length-1?"translateX(-100%)":"translateX(-50%)"},children:v.label},w))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:l&&t.jsx(Ms,{activeTypes:n,totalByType:o,formatMode:s})})]})}const xt={top:8,right:8,bottom:28,left:48},gt={top:0,right:0,bottom:0,left:0};let Te=null,yt=0;const pa=1e3;function xa(){const e=performance.now();return Te&&e-ytp&&(p=L),P>g&&(g=P)}p===0&&g===0?(p=1,g=1):p===0?p=1:g===0&&(g=1);const D=p*1.05,T=g*1.05,S=D+T;let v=D/S;v=Math.max(Le,Math.min(1-Le,v));const w=c-u,j=v*w,i=(1-v)*w,_=a+j,k=a+j+u,C=a+j+u/2;for(let A=0;A0)for(const $ of s){const N=B[$]??0;if(N===0)continue;const F=N/D*j,E=P-F;e.fillStyle=De($),e.fillRect(L,E,l,F),P=E}let R=k;const M=o[A].countByType;if(b[A]>0){const $=M[Q]??0;if($>0){const N=$/T*i;e.fillStyle=De(Q),e.fillRect(L,R,l,N),R+=N}for(const N of s){if(N===Q)continue;const F=M[N]??0;if(F===0)continue;const E=F/T*i;e.fillStyle=De(N),e.fillRect(L,R,l,E),R+=E}}}return{baselineY:C,fwdHalf:j,drpHalf:i,fwdCeil:D,drpCeil:T,gapPx:u}}function ya(e,n,o,s,r,a,d,c,f,m,u=!1){if(n.length===0)return;const{baselineY:y,fwdHalf:l,drpHalf:x,fwdCeil:b,drpCeil:p,gapPx:g}=f,D=xa(),T=y-Math.ceil(g/2),S=y+Math.floor(g/2);e.save(),e.strokeStyle=d,e.lineWidth=1*m,e.setLineDash([]);const v=[.5,1];for(const w of v){const j=Math.round(T-w*l)+.5;e.beginPath(),e.moveTo(o,j),e.lineTo(o+r,j),e.stroke();const i=Math.round(S+w*x)+.5;e.beginPath(),e.moveTo(o,i),e.lineTo(o+r,i),e.stroke()}if(e.restore(),e.clearRect(o,y-Math.ceil(g/2),r,g),!u){e.save(),e.font=`bold ${10*m}px ${D}`,e.textAlign="left";const w=4*m,j=2*m;for(const i of v){const _=Math.round(b*i),k=Math.round(p*i),C=i===1,A=T-i*l,L=S+i*x;_>0&&(e.fillStyle=Y.green,e.globalAlpha=.7,C?(e.textBaseline="top",e.fillText(ee(_),w,A+j)):(e.textBaseline="middle",e.fillText(ee(_),w,A))),k>0&&(e.fillStyle=Y.red,e.globalAlpha=.7,C?(e.textBaseline="bottom",e.fillText(ee(k),w,L-j)):(e.textBaseline="middle",e.fillText(ee(k),w,L)))}e.globalAlpha=1,e.restore()}if(!u){e.save(),e.font=`${12*m}px ${D}`,e.fillStyle=c,e.textBaseline="top",e.textAlign="center";const w=8*m,j=n.length,i=Math.max(1,Math.floor(j/6)),_=r/j;for(let k=0;k{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const d=s===Q?"CRC":Cs[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:De(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:d}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",ee(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",ee(a)]})]})]},s)})})}function ja(e,n,o){const s=e.length;let r=0,a=0;for(let u=0;ur&&(r=y),l>a&&(a=l)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const d=r*1.05,c=a*1.05,f=d+c;let m=d/f;return m=Math.max(Le,Math.min(1-Le,m)),{fwdMax:Math.round(d),drpMax:Math.round(c),fwdFrac:m}}function wa({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:d=!1}){const c=h.useRef(null),f=h.useRef(null),m=h.useRef(e),u=h.useRef(n),y=h.useRef(o),l=h.useRef(d);m.current=e,u.current=n,y.current=o,l.current=d;const x=d?gt:xt,b=typeof document<"u"&&document.documentElement.dataset.mode!=="light",p=r||(b?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),g=a||(b?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),D=h.useRef({gridColor:p,axisTickColor:g});D.current={gridColor:p,axisTickColor:g};const T=e.length,S=h.useMemo(()=>{const j=e.map(_=>_.start),i=e.map(()=>1);return[j,i]},[T]),v=h.useCallback(j=>{if(!c.current||e.length===0)return;const i=c.current.getBoundingClientRect(),_=j.clientX-i.left,k=d?gt:xt,C=k.left,A=i.width-k.left-k.right,P=(_-C)/A;if(P<0||P>1){s==null||s(null,null,null);return}const B=Math.min(e.length-1,Math.max(0,Math.floor(P*e.length)));s==null||s(B,e[B],P)},[e,s]),w=h.useCallback(()=>{s==null||s(null,null,null)},[s]);return h.useEffect(()=>{if(!c.current||T===0)return;const j=c.current;let i=null;const _=Ts(()=>{const k=j.getBoundingClientRect(),C=Math.floor(k.width)||400,A=Math.floor(k.height)||200,L={width:C,height:A,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:[B=>{const R=B.ctx,{left:M,top:$,width:N,height:F}=B.bbox,E=window.devicePixelRatio||1,W=D.current,H=m.current;H.length>=2&&_s(R,H[0].start,H[H.length-1].end,M,$,N,F);const O=ga(R,m.current,u.current,y.current,M,$,N,F);ya(R,m.current,M,$,N,F,W.gridColor,W.axisTickColor,O,E,l.current)}]}},P=new Ss(L,S,j);f.current=P,i=new ResizeObserver(()=>{const B=j.getBoundingClientRect();B.width>0&&B.height>0&&f.current&&f.current.setSize({width:Math.floor(B.width),height:Math.floor(B.height)})}),i.observe(j)});return()=>{var k;_(),i==null||i.disconnect(),(k=f.current)==null||k.destroy(),f.current=null}},[T]),h.useEffect(()=>{f.current&&f.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:c,className:"w-full h-full",onMouseMove:v,onMouseLeave:w})}const Na=h.memo(wa),as=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];he(as);function va(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 xe=32,ze=20,ka=[.5,1];function Ma({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:d,crcHistory:c,receivedCount:f,forwardedTotalByType:m,droppedTotalByType:u,startTime:y,bucketDurationSeconds:l,bucketCount:x,timeRangeMinutes:b}){fe(as);const p=Bt(),g=Pe(),[D,T]=h.useState(null),[S,v]=h.useState(null),[w,j]=h.useState(null),i=h.useCallback((G,I,X)=>{T(I),v(X)},[]),_=Math.max(1,b/60),k=h.useMemo(()=>At(g,_),[g,_]),C=h.useMemo(()=>k?Lt(k):0,[k]),A=Math.round(C*10)/10,L=Math.round((k==null?void 0:k.avgBackoffMs)??0),{fwdMirror:P,drpMirror:B,allTypes:R,fwdTotals:M,drpTotals:$}=h.useMemo(()=>{const G=e.map(U=>({start:U.start,end:U.end,countByType:{...U.countByType}})),I=new Array(x).fill(0);for(const U of c){let K=Math.floor((U.timestamp-y)/l);K<0&&(K=0),!(K>=x)&&I[K]++}const X=n.map((U,K)=>({start:U.start,end:U.end,countByType:{...U.countByType,...I[K]>0?{[Q]:I[K]}:{}}})),V=new Set([...o,...s]);d>0&&V.add(Q);const te={...m},ae={...u};d>0&&(ae[Q]=d);const Ne=[...V].sort((U,K)=>{const hs=(te[U]??0)+(ae[U]??0);return(te[K]??0)+(ae[K]??0)-hs});return{fwdMirror:G,drpMirror:X,allTypes:Ne,fwdTotals:te,drpTotals:ae}},[e,n,o,s,c,d,y,l,x,m,u]),N=R.length>0&&P.length>0,F=D?va(D.start):null,E=D?bt(D.start):"",W=w!==null&&F!==null&&w!==F;F!==w&&j(F);const H=h.useMemo(()=>N?ja(P,B,R):null,[N,P,B,R]),O=h.useMemo(()=>{if(!H)return[];const{fwdMax:G,drpMax:I,fwdFrac:X}=H,V=[];for(const te of ka){const ae=Math.round(G*te);if(ae>0){const U=(1-te)*X*100;V.push({label:ee(ae),pos:U,color:"green"})}const Ne=Math.round(I*te);if(Ne>0){const U=(X+te*(1-X))*100;V.push({label:ee(Ne),pos:U,color:"red"})}}return V},[H]),z=h.useMemo(()=>{if(P.length===0)return[];const G=P.length,I=Math.max(1,Math.floor(G/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:`${I}%`,transform:I<=1?"none":I>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:G},V))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:ze},children:[N&&H&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${H.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(ut,{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(dt,{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((G,I)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${G}%`}},`u${I}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${N?"opacity-100":"opacity-0"}`,children:N&&t.jsx(Na,{forwardedBuckets:P,droppedBuckets:B,allTypes:R,gridColor:p.grid,axisTickColor:p.axisTick,onHover:i,externalAxes:!0})}),N&&H&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${H.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:ze},"aria-hidden":"true",children:z.map((G,I)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${G.pos}%`,transform:I===0?"none":I===z.length-1?"translateX(-100%)":"translateX(-50%)"},children:G.label},I))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:N&&t.jsx(ba,{allTypes:R,forwardedTotalByType:M,droppedTotalByType:$})})]})}const Ca=2,Ta=1;function Sa(e,n,o){const s=f=>(f==null?void 0:f.reduce((m,u)=>m+u.count,0))??0,r=s(n),a=s(o),d=r||(e==null?void 0:e.rx_count)||1,c=a||(e==null?void 0:e.dropped_count)||0;return d>0?c/(d+c)*100:0}function _a(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,d)=>a+d.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,d=n.length*o*1e3;return a/d*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 jt(e,n,o){return xn(Math.max(n,Math.min(o,e)))}function Ba(e,n,o,s,r){let a=Vt(e);n>20?a+=ke*2:n>12&&(a+=ke),o>8&&(a+=ke);const d=jt(a,0,Ca);let c=gn(e);o>8&&(c+=ke);const f=jt(c,0,Ta),m=ge(d),u=ge(f),y=s!==null?ge(s):null;let l="stable";return y!==null&&(m>y?l="increase":m{if(m!=="applying"){u("applying");try{const I=await Ds({tx_delay_factor:z,direct_tx_delay_factor:G});I!=null&&I.success?(u("success"),setTimeout(()=>u("idle"),2e3)):(u("error"),setTimeout(()=>u("idle"),2500))}catch{u("error"),setTimeout(()=>u("idle"),2500)}}},[m]);if(!d)return t.jsx(be,{children:t.jsx(Rs,{})});const x=10080*60,p=Math.floor(Date.now()/1e3)-x,g=Object.values((e==null?void 0:e.neighbors)??{}).filter(z=>z.zero_hop&&z.last_seen>=p&&pn(z).isRepeater).length,D=y.filter(z=>z.status==="active"||z.lastSeen>=p).length,T=Math.max(g,D),S=Sa(e,n,o),v=_a(e,s,r),w=((W=(E=e==null?void 0:e.config)==null?void 0:E.delays)==null?void 0:W.tx_delay_factor)??null,j=((O=(H=e==null?void 0:e.config)==null?void 0:H.delays)==null?void 0:O.direct_tx_delay_factor)??null,i=Ba(T,S,v,w),_=T!==1,k=Vt(T),C=[`${T} repeater${_?"s":""} heard in the last 7 days (base ×${k.toFixed(1)}).`];i.floodFactor===k&&S<=12&&v<=8?C.push("No modifiers applied — network looks healthy."):(S>20?C.push(`High duplicate rate (${S.toFixed(1)}%) suggests frequent collisions — window widened.`):S>12&&C.push(`Elevated duplicate rate (${S.toFixed(1)}%) — window widened one step.`),v>8&&C.push(`Channel is busy (${v.toFixed(1)}% TX util) — extra spacing added.`));const A=[`Direct uses one forwarder — ×${i.directFactor.toFixed(1)} backoff for channel contention.`];v>8&&A.push("Busy channel — small extra backoff.");const L=[`Flood ×${i.floodFactor.toFixed(1)} (${i.floodSlots} slot${i.floodSlots!==1?"s":""})`,...C,"",`Direct ×${i.directFactor.toFixed(1)}`,...A,"","Click to copy CLI commands"].join(` + */const Kn=[["circle",{cx:"7",cy:"7",r:"5",key:"x29byf"}],["circle",{cx:"17",cy:"17",r:"5",key:"1op1d2"}],["path",{d:"M12 17h10",key:"ls21zv"}],["path",{d:"m3.46 10.54 7.08-7.08",key:"1rehiu"}]],Qn=Z("tablets",Kn);function ea(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],d=e[3+o],c=ps(r,a,d);return n?c(s):c}function ta(e,n,o={}){const s=e.get();let r=null,a=s,d;const c=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,f=()=>{r&&(r.stop(),r=null)},m=()=>{f();const u=ft(e.get()),y=ft(a);u!==y&&(r=new xs({keyframes:[u,y],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:d}))};if(e.attach((u,y)=>{a=u,d=l=>y(mt(l,c)),Tt.postRender(()=>{var l;m(),(l=e.events.animationStart)==null||l.notify(),r==null||r.then(()=>{var x;(x=e.events.animationComplete)==null||x.notify()})})},f),St(n)){const u=n.on("change",l=>e.set(mt(l,c))),y=e.on("destroy",u);return()=>{u(),y()}}return f}function mt(e,n){return n?e+n:e}function ft(e){return typeof e=="number"?e:parseFloat(e)}function ss(e,n){const o=ue(n()),s=()=>o.set(n());return s(),gs(()=>{const r=()=>Tt.preRender(s,!1,!0),a=e.map(d=>d.on("change",r));return()=>{a.forEach(d=>d()),ys(s)}}),o}function sa(e){$e.current=[],e();const n=ss($e.current,e);return $e.current=void 0,n}function na(e,n,o,s){if(typeof e=="function")return sa(e);const a=ea(n,o,s);return Array.isArray(e)?ht(e,a):ht([e],([d])=>a(d))}function ht(e,n){const o=bs(()=>[]);return ss(e,()=>{o.length=0;const s=e.length;for(let r=0;rSt(e)?e.get():e;if(o)return na(s);const r=ue(s());return h.useInsertionEffect(()=>ta(r,e,n),[r,JSON.stringify(n)]),r}function Me(e,n={}){return aa(e,{type:"spring",...n})}const oe=ws(()=>({result:null,isComputing:!1})),oa=500,ra=300;let ce=null,Ce=null;function ia(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 la(){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 ca(e,n,o,s){const r=la();if(!r)return;const a=e.length,d=new Float64Array(a),c=new Float64Array(a),f=new Uint16Array(a),m=new Uint8Array(a),u=new Uint8Array(a),y=new Uint8Array(a),l=new Uint8Array(a),x=new Float32Array(a),b=new Float32Array(a),p=new Uint32Array(a),g=new Map;let D=0;for(let S=0;SparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function da(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(u=>({...u,bytesByType:{...u.bytesByType},countByType:{...u.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(u=>({...u,bytesByType:{...u.bytesByType},countByType:{...u.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(u=>({...u,bytesByType:{...u.bytesByType},countByType:{...u.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:d,bucket_count:c}=e,f=new Set;for(const u of n){const y=u.timestamp??0;if(ya)continue;const l=Math.floor((y-r)/d);if(l<0||l>=c)continue;f.has(l)||(f.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=_t(u,o),b=u.length??u.payload_length??0,p=u.type??u.payload_type??0,g=u.packet_origin;g==="tx_local"?(s.transmitted[l].count++,s.transmitted[l].airtime_ms+=x):g==="tx_forward"||u.transmitted?(s.forwarded[l].count++,s.forwarded[l].airtime_ms+=x,s.forwardedBytesBuckets[l].bytesByType[p]=(s.forwardedBytesBuckets[l].bytesByType[p]??0)+b,s.forwardedBytesBuckets[l].totalBytes+=b,s.forwardedBytesBuckets[l].countByType[p]=(s.forwardedBytesBuckets[l].countByType[p]??0)+1,s.forwardedBytesBuckets[l].totalCount++,s.forwardedTotalByType[p]=(s.forwardedTotalByType[p]??0)+b,s.totalForwardedCount++):u.drop_reason&&(s.dropped[l].count++,s.dropped[l].airtime_ms+=x,s.droppedBytesBuckets[l].bytesByType[p]=(s.droppedBytesBuckets[l].bytesByType[p]??0)+b,s.droppedBytesBuckets[l].totalBytes+=b,s.droppedBytesBuckets[l].countByType[p]=(s.droppedBytesBuckets[l].countByType[p]??0)+1,s.droppedBytesBuckets[l].totalCount++,s.droppedTotalByType[p]=(s.droppedTotalByType[p]??0)+b,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[p]=(s.receivedBytesBuckets[l].bytesByType[p]??0)+b,s.receivedBytesBuckets[l].totalBytes+=b,s.receivedBytesBuckets[l].countByType[p]=(s.receivedBytesBuckets[l].countByType[p]??0)+1,s.receivedBytesBuckets[l].totalCount++,s.receivedTotalByType[p]=(s.receivedTotalByType[p]??0)+b,s.receivedCountByType[p]=(s.receivedCountByType[p]??0)+1,s.totalReceivedBytes+=b)}const m=s.time_range_minutes/60;return s.kbPerHour=m>0?Math.round(s.totalReceivedBytes/1024/m):0,s.forwardedRatePerHour=m>0?Math.round(s.totalForwardedCount/m):0,s.droppedRatePerHour=m>0?Math.round(s.totalDroppedCount/m):0,s.receivedActiveTypes=He(s.receivedTotalByType),s.forwardedActiveTypes=He(s.forwardedTotalByType),s.droppedActiveTypes=He(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([et(()=>import("./index-Dk8KEIKm.js").then(e=>e.hw),__vite__mapDeps([0,1])),et(()=>import("./index-Dk8KEIKm.js").then(e=>e.hv),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(d=>{const c=d.packets.length,f=d.globalTimeRangeIndex,m=ia(d.stats);if(c===s&&f===r&&m===a)return;const u=s,y=r,l=a;if(s=c,r=f,a=m,c===0)return;const x=o[f]??o[4],b=x.minutes,p=x.buckets,g=d.stats,D=tt(g),T=c-u,S=f!==y,v=m!==l,w=oe.getState().result;if(!S&&!v&&T>0&&T{Ce=null;const i=e.useStore.getState();if(i.packets.length===0||!i.stats)return;const _=o[i.globalTimeRangeIndex]??o[4],k=tt(i.stats);ca(i.packets,_.minutes,_.buckets,k)},ra)})});const ua=()=>oe(e=>e.result),ns=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:un}];he(ns);function ma(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function pt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const pe=32,Ie=20,fa=[.25,.5,.75,1];function ha({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){fe(ns);const r=Bt(),[a,d]=h.useState(null),[c,f]=h.useState(null),[m,u]=h.useState(null),y=h.useCallback((v,w,j)=>{d(w),f(j)},[]),l=e.length>0&&n.length>0,x=a?ma(a.start):null,b=a?pt(a.start):"",p=m!==null&&x!==null&&m!==x;x!==m&&u(x);const g=h.useMemo(()=>Ns(e),[e]),D=s==="count"?ee:vs,T=h.useMemo(()=>g===0?[]:fa.map(v=>({pct:v,label:D(Math.round(g*v)),pos:(1-v)*100})),[g,D]),S=h.useMemo(()=>{if(e.length===0)return[];const v=e.length,w=Math.max(1,Math.floor(v/6)),j=[];for(let i=0;it.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${j}%`,transform:v===1?"none":"translateY(-50%)",right:0},children:w},v))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:pe,right:0,top:0,bottom:Ie},children:l&&t.jsx(ks,{buckets:e,activeTypes:n,gridColor:r.grid,axisTickColor:r.axisTick,onHover:y,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:pe,height:Ie},"aria-hidden":"true",children:S.map((v,w)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${v.pos}%`,transform:w===0?"none":w===S.length-1?"translateX(-100%)":"translateX(-50%)"},children:v.label},w))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:l&&t.jsx(Ms,{activeTypes:n,totalByType:o,formatMode:s})})]})}const xt={top:8,right:8,bottom:28,left:48},gt={top:0,right:0,bottom:0,left:0};let Te=null,yt=0;const pa=1e3;function xa(){const e=performance.now();return Te&&e-ytp&&(p=L),P>g&&(g=P)}p===0&&g===0?(p=1,g=1):p===0?p=1:g===0&&(g=1);const D=p*1.05,T=g*1.05,S=D+T;let v=D/S;v=Math.max(Le,Math.min(1-Le,v));const w=c-u,j=v*w,i=(1-v)*w,_=a+j,k=a+j+u,C=a+j+u/2;for(let A=0;A0)for(const $ of s){const N=B[$]??0;if(N===0)continue;const F=N/D*j,E=P-F;e.fillStyle=De($),e.fillRect(L,E,l,F),P=E}let R=k;const M=o[A].countByType;if(b[A]>0){const $=M[Q]??0;if($>0){const N=$/T*i;e.fillStyle=De(Q),e.fillRect(L,R,l,N),R+=N}for(const N of s){if(N===Q)continue;const F=M[N]??0;if(F===0)continue;const E=F/T*i;e.fillStyle=De(N),e.fillRect(L,R,l,E),R+=E}}}return{baselineY:C,fwdHalf:j,drpHalf:i,fwdCeil:D,drpCeil:T,gapPx:u}}function ya(e,n,o,s,r,a,d,c,f,m,u=!1){if(n.length===0)return;const{baselineY:y,fwdHalf:l,drpHalf:x,fwdCeil:b,drpCeil:p,gapPx:g}=f,D=xa(),T=y-Math.ceil(g/2),S=y+Math.floor(g/2);e.save(),e.strokeStyle=d,e.lineWidth=1*m,e.setLineDash([]);const v=[.5,1];for(const w of v){const j=Math.round(T-w*l)+.5;e.beginPath(),e.moveTo(o,j),e.lineTo(o+r,j),e.stroke();const i=Math.round(S+w*x)+.5;e.beginPath(),e.moveTo(o,i),e.lineTo(o+r,i),e.stroke()}if(e.restore(),e.clearRect(o,y-Math.ceil(g/2),r,g),!u){e.save(),e.font=`bold ${10*m}px ${D}`,e.textAlign="left";const w=4*m,j=2*m;for(const i of v){const _=Math.round(b*i),k=Math.round(p*i),C=i===1,A=T-i*l,L=S+i*x;_>0&&(e.fillStyle=Y.green,e.globalAlpha=.7,C?(e.textBaseline="top",e.fillText(ee(_),w,A+j)):(e.textBaseline="middle",e.fillText(ee(_),w,A))),k>0&&(e.fillStyle=Y.red,e.globalAlpha=.7,C?(e.textBaseline="bottom",e.fillText(ee(k),w,L-j)):(e.textBaseline="middle",e.fillText(ee(k),w,L)))}e.globalAlpha=1,e.restore()}if(!u){e.save(),e.font=`${12*m}px ${D}`,e.fillStyle=c,e.textBaseline="top",e.textAlign="center";const w=8*m,j=n.length,i=Math.max(1,Math.floor(j/6)),_=r/j;for(let k=0;k{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const d=s===Q?"CRC":Cs[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:De(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:d}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",ee(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",ee(a)]})]})]},s)})})}function ja(e,n,o){const s=e.length;let r=0,a=0;for(let u=0;ur&&(r=y),l>a&&(a=l)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const d=r*1.05,c=a*1.05,f=d+c;let m=d/f;return m=Math.max(Le,Math.min(1-Le,m)),{fwdMax:Math.round(d),drpMax:Math.round(c),fwdFrac:m}}function wa({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:d=!1}){const c=h.useRef(null),f=h.useRef(null),m=h.useRef(e),u=h.useRef(n),y=h.useRef(o),l=h.useRef(d);m.current=e,u.current=n,y.current=o,l.current=d;const x=d?gt:xt,b=typeof document<"u"&&document.documentElement.dataset.mode!=="light",p=r||(b?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),g=a||(b?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),D=h.useRef({gridColor:p,axisTickColor:g});D.current={gridColor:p,axisTickColor:g};const T=e.length,S=h.useMemo(()=>{const j=e.map(_=>_.start),i=e.map(()=>1);return[j,i]},[T]),v=h.useCallback(j=>{if(!c.current||e.length===0)return;const i=c.current.getBoundingClientRect(),_=j.clientX-i.left,k=d?gt:xt,C=k.left,A=i.width-k.left-k.right,P=(_-C)/A;if(P<0||P>1){s==null||s(null,null,null);return}const B=Math.min(e.length-1,Math.max(0,Math.floor(P*e.length)));s==null||s(B,e[B],P)},[e,s]),w=h.useCallback(()=>{s==null||s(null,null,null)},[s]);return h.useEffect(()=>{if(!c.current||T===0)return;const j=c.current;let i=null;const _=Ts(()=>{const k=j.getBoundingClientRect(),C=Math.floor(k.width)||400,A=Math.floor(k.height)||200,L={width:C,height:A,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:[B=>{const R=B.ctx,{left:M,top:$,width:N,height:F}=B.bbox,E=window.devicePixelRatio||1,W=D.current,H=m.current;H.length>=2&&_s(R,H[0].start,H[H.length-1].end,M,$,N,F);const O=ga(R,m.current,u.current,y.current,M,$,N,F);ya(R,m.current,M,$,N,F,W.gridColor,W.axisTickColor,O,E,l.current)}]}},P=new Ss(L,S,j);f.current=P,i=new ResizeObserver(()=>{const B=j.getBoundingClientRect();B.width>0&&B.height>0&&f.current&&f.current.setSize({width:Math.floor(B.width),height:Math.floor(B.height)})}),i.observe(j)});return()=>{var k;_(),i==null||i.disconnect(),(k=f.current)==null||k.destroy(),f.current=null}},[T]),h.useEffect(()=>{f.current&&f.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:c,className:"w-full h-full",onMouseMove:v,onMouseLeave:w})}const Na=h.memo(wa),as=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];he(as);function va(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 xe=32,ze=20,ka=[.5,1];function Ma({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:d,crcHistory:c,receivedCount:f,forwardedTotalByType:m,droppedTotalByType:u,startTime:y,bucketDurationSeconds:l,bucketCount:x,timeRangeMinutes:b}){fe(as);const p=Bt(),g=Pe(),[D,T]=h.useState(null),[S,v]=h.useState(null),[w,j]=h.useState(null),i=h.useCallback((G,I,X)=>{T(I),v(X)},[]),_=Math.max(1,b/60),k=h.useMemo(()=>At(g,_),[g,_]),C=h.useMemo(()=>k?Lt(k):0,[k]),A=Math.round(C*10)/10,L=Math.round((k==null?void 0:k.avgBackoffMs)??0),{fwdMirror:P,drpMirror:B,allTypes:R,fwdTotals:M,drpTotals:$}=h.useMemo(()=>{const G=e.map(U=>({start:U.start,end:U.end,countByType:{...U.countByType}})),I=new Array(x).fill(0);for(const U of c){let K=Math.floor((U.timestamp-y)/l);K<0&&(K=0),!(K>=x)&&I[K]++}const X=n.map((U,K)=>({start:U.start,end:U.end,countByType:{...U.countByType,...I[K]>0?{[Q]:I[K]}:{}}})),V=new Set([...o,...s]);d>0&&V.add(Q);const te={...m},ae={...u};d>0&&(ae[Q]=d);const Ne=[...V].sort((U,K)=>{const hs=(te[U]??0)+(ae[U]??0);return(te[K]??0)+(ae[K]??0)-hs});return{fwdMirror:G,drpMirror:X,allTypes:Ne,fwdTotals:te,drpTotals:ae}},[e,n,o,s,c,d,y,l,x,m,u]),N=R.length>0&&P.length>0,F=D?va(D.start):null,E=D?bt(D.start):"",W=w!==null&&F!==null&&w!==F;F!==w&&j(F);const H=h.useMemo(()=>N?ja(P,B,R):null,[N,P,B,R]),O=h.useMemo(()=>{if(!H)return[];const{fwdMax:G,drpMax:I,fwdFrac:X}=H,V=[];for(const te of ka){const ae=Math.round(G*te);if(ae>0){const U=(1-te)*X*100;V.push({label:ee(ae),pos:U,color:"green"})}const Ne=Math.round(I*te);if(Ne>0){const U=(X+te*(1-X))*100;V.push({label:ee(Ne),pos:U,color:"red"})}}return V},[H]),z=h.useMemo(()=>{if(P.length===0)return[];const G=P.length,I=Math.max(1,Math.floor(G/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:`${I}%`,transform:I<=1?"none":I>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:G},V))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:ze},children:[N&&H&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${H.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(ut,{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(dt,{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((G,I)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${G}%`}},`u${I}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${N?"opacity-100":"opacity-0"}`,children:N&&t.jsx(Na,{forwardedBuckets:P,droppedBuckets:B,allTypes:R,gridColor:p.grid,axisTickColor:p.axisTick,onHover:i,externalAxes:!0})}),N&&H&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${H.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:ze},"aria-hidden":"true",children:z.map((G,I)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${G.pos}%`,transform:I===0?"none":I===z.length-1?"translateX(-100%)":"translateX(-50%)"},children:G.label},I))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:N&&t.jsx(ba,{allTypes:R,forwardedTotalByType:M,droppedTotalByType:$})})]})}const Ca=2,Ta=1;function Sa(e,n,o){const s=f=>(f==null?void 0:f.reduce((m,u)=>m+u.count,0))??0,r=s(n),a=s(o),d=r||(e==null?void 0:e.rx_count)||1,c=a||(e==null?void 0:e.dropped_count)||0;return d>0?c/(d+c)*100:0}function _a(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,d)=>a+d.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,d=n.length*o*1e3;return a/d*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 jt(e,n,o){return xn(Math.max(n,Math.min(o,e)))}function Ba(e,n,o,s,r){let a=Vt(e);n>20?a+=ke*2:n>12&&(a+=ke),o>8&&(a+=ke);const d=jt(a,0,Ca);let c=gn(e);o>8&&(c+=ke);const f=jt(c,0,Ta),m=ge(d),u=ge(f),y=s!==null?ge(s):null;let l="stable";return y!==null&&(m>y?l="increase":m{if(m!=="applying"){u("applying");try{const I=await Ds({tx_delay_factor:z,direct_tx_delay_factor:G});I!=null&&I.success?(u("success"),setTimeout(()=>u("idle"),2e3)):(u("error"),setTimeout(()=>u("idle"),2500))}catch{u("error"),setTimeout(()=>u("idle"),2500)}}},[m]);if(!d)return t.jsx(be,{children:t.jsx(Rs,{})});const x=10080*60,p=Math.floor(Date.now()/1e3)-x,g=Object.values((e==null?void 0:e.neighbors)??{}).filter(z=>z.zero_hop&&z.last_seen>=p&&pn(z).isRepeater).length,D=y.filter(z=>z.status==="active"||z.lastSeen>=p).length,T=Math.max(g,D),S=Sa(e,n,o),v=_a(e,s,r),w=((W=(E=e==null?void 0:e.config)==null?void 0:E.delays)==null?void 0:W.tx_delay_factor)??null,j=((O=(H=e==null?void 0:e.config)==null?void 0:H.delays)==null?void 0:O.direct_tx_delay_factor)??null,i=Ba(T,S,v,w),_=T!==1,k=Vt(T),C=[`${T} repeater${_?"s":""} heard in the last 7 days (base ×${k.toFixed(1)}).`];i.floodFactor===k&&S<=12&&v<=8?C.push("No modifiers applied — network looks healthy."):(S>20?C.push(`High duplicate rate (${S.toFixed(1)}%) suggests frequent collisions — window widened.`):S>12&&C.push(`Elevated duplicate rate (${S.toFixed(1)}%) — window widened one step.`),v>8&&C.push(`Channel is busy (${v.toFixed(1)}% TX util) — extra spacing added.`));const A=[`Direct uses one forwarder — ×${i.directFactor.toFixed(1)} backoff for channel contention.`];v>8&&A.push("Busy channel — small extra backoff.");const L=[`Flood ×${i.floodFactor.toFixed(1)} (${i.floodSlots} slot${i.floodSlots!==1?"s":""})`,...C,"",`Direct ×${i.directFactor.toFixed(1)}`,...A,"","Click to copy CLI commands"].join(` `),P=w!==null?ge(w):null,B=j!==null?ge(j):null,R=P!==null&&i.floodSlots!==P,M=B!==null&&i.directSlots!==B,$=R||M,N=async()=>{const z=`set txdelay ${i.floodFactor.toFixed(1)} set direct.txdelay ${i.directFactor.toFixed(1)}`;await Ps(z),f(!0),setTimeout(()=>f(!1),1500)},F=()=>l(i.floodFactor,i.directFactor);return t.jsxs(be,{children:[t.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3 flex-wrap",children:[t.jsx(yn,{className:"w-4 h-4 text-icon-card-title flex-shrink-0"}),t.jsx("span",{className:"type-micro",children:"DELAY DOCTOR"}),a&&t.jsx(se,{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:L,children:[t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-fg-primary",children:t.jsxs(Xe,{children:["×",i.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(Xe,{children:["×",i.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:c?t.jsx(st,{className:"w-4 h-4 text-sys-green"}):t.jsx(As,{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 ${i.duplicateRate>8?"text-status-warning":""}`,children:[i.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:[i.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:w!==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:["×",w.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"})})]}),$&&t.jsxs("button",{onClick:F,disabled:m==="applying"||m==="success",className:`flex items-center gap-1.5 px-2.5 py-1.5 radius-inner type-micro font-medium transition-base ${m==="success"?"bg-sys-green/15 text-sys-green":m==="error"?"bg-sys-red/15 text-sys-red":m==="applying"?"bg-subtle-fill text-fg-muted":"bg-sys-blue/10 text-sys-blue hover:bg-sys-blue/20"}`,title:`Apply ×${i.floodFactor.toFixed(1)} flood, ×${i.directFactor.toFixed(1)} direct`,children:[m==="success"?"Rx'd":m==="error"?"Failed":"Apply",m==="applying"?t.jsx(Ls,{className:"w-3.5 h-3.5 animate-spin"}):m==="success"?t.jsx(st,{className:"w-3.5 h-3.5"}):t.jsxs("span",{className:"relative inline-flex items-end w-6 h-3.5",children:[t.jsx(Vn,{className:"w-3.5 h-3.5 absolute left-0 bottom-0"}),t.jsx(Qn,{className:"w-3 h-3 absolute right-0 bottom-0"})]})]})]})})]})}const os=[{target:"RecentPackets",fn:"rssi",minStage:1},{target:"RecentPackets",fn:"snr",minStage:1}];he(os);const Ra=25;function Aa(){fe(os);const e=Pe(),n=$s(),o=Fs(),s=ie(),r=wn(),a=Ve(x=>x.requestChannel),[d,c]=h.useState(!0),f=h.useCallback(x=>c(x),[]),m=h.useMemo(()=>[...e.length<=100?e:e.slice(-100)].sort((b,p)=>(p.timestamp??0)-(b.timestamp??0)),[e]),u=s==null?void 0:s.local_hash,y=s==null?void 0:s.neighbors,l=Nn();return t.jsxs(be,{noPadding:!0,className:"!overflow-visible",children:[t.jsx(Pt,{listHeader:!0,icon:t.jsx(Ft,{}),title:"Recent Packets",actions:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx($t,{enabled:d,onChange:f,label:"Hide Dupes",size:"sm"}),o&&t.jsx(Es,{showLabel:!0}),t.jsxs(Ae,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(it,{"data-slot":"icon"})]})]})}),t.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-1",children:t.jsx(bn,{packets:m,allPackets:e,localHash:u,neighbors:y,resolveSource:l,getDecodedContent:r,onChannelClick:a,loading:n,maxPackets:Ra,showPagination:!1,flashNewest:!0,hideDupes:d,emptyMessage:"No packets received",footerAction:t.jsxs(Ae,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(it,{"data-slot":"icon"})]})})})]})}const La={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function Pa({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:La[e]})})})}function $a(){return t.jsx("div",{className:"mini-widget-loading",children:t.jsx("div",{className:"mini-widget-loading-spinner"})})}function Fa({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:d,subtitleValue:c,trend:f,headerRight:m,children:u,isLoading:y=!1,error:l,className:x="",onClick:b,isLoaded:p}){const g=["mini-widget-value",r==="lg"&&"mini-widget-value-lg",r==="sm"&&"mini-widget-value-sm"].filter(Boolean).join(" "),D=["mini-widget",x].filter(Boolean).join(" ");return t.jsxs(be,{noPadding:!0,className:D,onClick:b,isLoaded:p,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}`}),f&&t.jsx(Pa,{trend:f}),m&&t.jsx("span",{className:"ml-auto flex items-center",children:m})]}),y?t.jsx($a,{}):l?t.jsx(Fa,{message:l}):t.jsxs("div",{className:"mini-widget-content",children:[(o!==void 0||d||c)&&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(Xe,{children:o}),s&&t.jsx("span",{className:"mini-widget-unit",children:s})]}),(d||c)&&t.jsxs("span",{className:"mini-widget-badge-group",children:[d&&!c&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:d}),d&&c&&t.jsx("span",{className:"mini-widget-subtitle truncate",children:d}),c&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:c})]})]}),u]})]})}const Ea={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},rs={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 Ye(e,n){if(e.length===0)return null;const o=[...e].sort((d,c)=>d-c),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 wt(e){return Ye(e,50)}function Ha(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 Ia(e){if(e.length<2)return 0;const n=e.length;let o=0,s=0,r=0,a=0;const d=e[0].timestamp;for(const f of e){const m=(f.timestamp-d)/3600,u=f.value;o+=m,s+=u,r+=m*u,a+=m*m}const c=n*a-o*o;return Math.abs(c)<1e-4?0:(n*r-o*s)/c}function za(e,n,o){const s=Ea;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 Oa(e){if(e.length===0)return{...rs,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=wt(o),d=Ye(o,10),c=Ye(o,90),f=wt(s),m=f!==null&&d!==null?f-d:0,u=r.map((g,D)=>({timestamp:n-(r.length-1-D)*3600,value:g})),y=Ia(u),l=Ha(r),x=o.length>=12,[b,p]=x?za(m,y,l):[0,null];return{baselineMedian:a,baselineP10:d,baselineP90:c,currentMedian:f,currentSampleCount:s.length,delta:m,slope:y,jitter:l,penalty:b,penaltyReason:p,computedAt:n,isReliable:x}}const Ga={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],noiseFloorWindowHistory:[],linkQuality:null,channelHealth:null,nfTrend:rs,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},is=h.createContext(Ga);function Wa({children:e}){var B;const n=ie(),o=Pe(),s=Et(),r=Hs(),a=je(),d=ne[a],c=Math.max(1,d.minutes/60),f=n===null,[m,u]=h.useState(null),y=h.useCallback(async()=>{try{const R=await Ht(Math.ceil(c));if(R.success&&R.data){u(R.data.history);return}const M=await It(Math.ceil(c));M.success&&M.data&&M.data.count>0&&u(null)}catch{}},[c]);h.useEffect(()=>{y();const R=setInterval(y,6e4);return()=>clearInterval(R)},[y]);const l=h.useMemo(()=>At(o,c,m),[o,c,m]),x=(n==null?void 0:n.noise_floor_dbm)??null,b=h.useMemo(()=>Is(x)?x:null,[x]),p=h.useMemo(()=>{var M;const R=(M=n==null?void 0:n.config)==null?void 0:M.radio;return R?{sf:R.spreading_factor??7,bwHz:R.bandwidth??125e3}:null},[(B=n==null?void 0:n.config)==null?void 0:B.radio]),g=zs(c),D=Os(c),T=n==null?void 0:n.neighbors,S=h.useMemo(()=>Object.fromEntries(Object.entries(T??{}).filter(([M])=>!r.has(M))),[T,r]),v=h.useMemo(()=>s.filter(R=>!r.has(R.hash)),[s,r]),w=h.useMemo(()=>Oa(g),[g]),j=h.useMemo(()=>Gs(v,S,p),[v,S,p]),i=h.useMemo(()=>Ws(l,b,j),[l,b,j]),[_,k]=h.useState({noiseFloor:null,networkScore:null,channelHealth:null}),C=h.useRef(0);h.useEffect(()=>{const R=()=>{const $=Date.now();$-C.current>3e4&&(C.current=$,k({noiseFloor:b,networkScore:(j==null?void 0:j.networkScore)??null,channelHealth:(i==null?void 0:i.score)??null}))};R();const M=setInterval(R,5e3);return()=>clearInterval(M)},[b,j==null?void 0:j.networkScore,i==null?void 0:i.score]);const A=h.useMemo(()=>({noiseFloor:{current:b,previous:_.noiseFloor,trend:b!==null?Fe(b,_.noiseFloor,2,!0):"stable"},networkScore:{current:(j==null?void 0:j.networkScore)??0,previous:_.networkScore,trend:Fe((j==null?void 0:j.networkScore)??0,_.networkScore,3,!1)},channelHealth:{current:(i==null?void 0:i.score)??0,previous:_.channelHealth,trend:Fe((i==null?void 0:i.score)??0,_.channelHealth,3,!1)}}),[b,j==null?void 0:j.networkScore,i==null?void 0:i.score,_]),P={lbtStats:l,noiseFloor:b,sparklineNoiseFloor:g,noiseFloorWindowHistory:D,linkQuality:j,channelHealth:i,nfTrend:w,radioConfig:p,trends:A,stats:n,recentPackets:o,quickNeighbors:s,isLoading:f,error:null,refresh:async()=>{}};return t.jsx(is.Provider,{value:P,children:e})}function Ke(){const e=h.useContext(is);if(e===void 0)throw new Error("useLBTData must be used within an LBTDataProvider");return e}function qa(e){return e<100?"excellent":e<250?"good":e<500?"fair":e<1e3?"congested":"critical"}function Ua(e){return e===0?"No backoffs":"Retries"}function Xa(e,n){return e===0?void 0:`${n.toFixed(0)}%`}function Va(){const{lbtStats:e,isLoading:n,error:o}=Ke(),s=zt(),r=(e==null?void 0:e.avgBackoffMs)??0,a=(e==null?void 0:e.retryRate)??0,d=e?qa(r):"unknown",c=e==null?void 0:e.sparklineBackoff,f=h.useMemo(()=>!c||c.length<2?[]:c.map((m,u)=>({timestamp:Date.now()-(c.length-1-u)*36e5,count:m})),[c]);return t.jsx(le,{title:"LBT Backoff",icon:t.jsx(kn,{className:"mini-widget-icon"}),value:Math.round(r),unit:"ms",status:d,subtitle:e?Ua(r):void 0,subtitleValue:e?Xa(r,a):void 0,isLoading:n,error:o,onClick:()=>s("/packets"),children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(Zt,{data:f,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}const ls=[{target:"LinkLeaders",fn:"path",minStage:1,when:mn},{target:"LinkLeaders",fn:"src_hash",minStage:1,when:fn}];he(ls);function Ya(){fe(ls);const e=zt(),n=Et(),o=Pe(),s=ie(),r=je(),d=ne[r].minutes*60,c=qs(),f=h.useMemo(()=>{if(c===0)return o;const i=c-d;return o.filter(_=>_.timestamp>=i)},[o,d,c]),m=s===null,u=s!=null&&s.local_hash?nt(s.local_hash):"",y=(s==null?void 0:s.neighbors)??{},{neighborHashes:l,neighborNames:x}=h.useMemo(()=>{const i=new Set,_=new Map;for(const k of n){i.add(k.hash);const C=y[k.hash],A=(C==null?void 0:C.name)||(C==null?void 0:C.node_name)||k.prefix;_.set(k.hash,A)}return{neighborHashes:i,neighborNames:_}},[n,y]),b=h.useMemo(()=>{if(l.size===0||f.length===0||!u)return{champion:null,listener:null,loudest:null};const{scores:i}=vn(f,l,u),_=[];for(const[L,P]of i)P.blendedScore!==0&&_.push({...P,name:x.get(L)??nt(L)});let k=null,C=null,A=null;for(const L of _)(!k||L.blendedScore>k.blendedScore)&&(k=L),(!C||L.listenerScore>C.listenerScore)&&(C=L),(!A||L.loudScore>A.loudScore)&&(A=L);return{champion:k,listener:C,loudest:A}},[f,l,u,x]),p=i=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",i.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Blended Score: ",i.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: ",i.listenerScore,"/100 (",i.listenerCount," shared paths)"]}),t.jsxs("div",{children:["Loud: ",i.loudScore,"/100 (",i.loudCount," packets relayed)"]})]})]}),g=i=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",i.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",i.listenerScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[i.listenerCount," packets where they heard your transmissions"]})})]}),D=i=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",i.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",i.loudScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[i.loudCount," packets they relayed directly to you"]})})]}),{champion:T,listener:S,loudest:v}=b,j=T||S||v?t.jsxs("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:[T&&t.jsx(me,{content:p(T),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(jn,{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:T.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:T.blendedScore})]})}),S&&t.jsx(me,{content:g(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(es,{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:S.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:S.listenerScore})]})}),v&&t.jsx(me,{content:D(v),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(Un,{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:v.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:v.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(Jn,{className:"mini-widget-icon"}),isLoading:m,onClick:()=>e("/contacts"),children:j})}function Ja(e){return e<15?"excellent":e<30?"good":e<45?"fair":e<60?"congested":"critical"}function Za(e){return e<15?"Clear channel":e<30?"Light traffic":e<45?"Moderate traffic":e<60?"Heavy traffic":e<75?"Congested":"Severe congestion"}function Ka(){const{lbtStats:e,isLoading:n,error:o}=Ke(),s=e?Lt(e):0,r=e?Ja(s):"unknown",a=(e==null?void 0:e.maxBackoffMs)??0,d=e?a>200?"Peak":Za(s):void 0,c=e&&a>200?`${Math.round(a)}ms`:void 0,f=e==null?void 0:e.sparklineCollisionRisk,m=h.useMemo(()=>!f||f.length<2?[]:f.map((y,l)=>({timestamp:Date.now()-(f.length-1-l)*36e5,count:y})),[f]),u=Math.round(s*10)/10;return t.jsx(le,{title:"Collision Risk",icon:t.jsx(Mn,{className:"mini-widget-icon"}),value:u,unit:"%",status:r,subtitle:d,subtitleValue:c,isLoading:n,error:o,children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(Zt,{data:m,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function Qa(e){return e<30?"excellent":e<50?"good":e<70?"fair":e<90?"congested":"critical"}function eo(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function to(){var p,g;const[e,n]=h.useState(!1),[o]=h.useState(0),{stats:s,lbtStats:r,isLoading:a}=Ke(),d=((g=(p=s==null?void 0:s.config)==null?void 0:p.duty_cycle)==null?void 0:g.enforcement_enabled)??!1,c=h.useMemo(()=>{if(!s)return null;if(!d){const w=s.airtime_used_ms??0,j=s.max_airtime_ms??1,i=j>0?w/j*100:0;return{usedMs:w,maxMs:j,remainingMs:Math.max(0,j-w),utilizationPercent:i}}const D=s.airtime_used_ms??0,T=s.max_airtime_ms??1,S=s.airtime_remaining_ms??0,v=s.utilization_percent??(T>0?D/T*100:0);return{usedMs:D,maxMs:T,remainingMs:S,utilizationPercent:v}},[s,d]),f=h.useMemo(()=>{if(!r||r.totalPacketsWithLBT===0)return 100;const D=r.totalPacketsWithLBT-r.packetsWithRetries,T=r.totalPacketsWithLBT;return D/T*100},[r]),m=(c==null?void 0:c.utilizationPercent)??0,u=Qa(m),y=(c==null?void 0:c.remainingMs)??0,l=f<95?"1st Try":"Remaining",x=f<95?`${f.toFixed(0)}%`:eo(y),b=c?t.jsx("div",{className:"mini-widget-progress mt-auto",children:t.jsx("div",{className:`mini-widget-progress-bar ${u}`,style:{width:`${Math.min(m,100)}%`}})}):null;return t.jsx(le,{title:"Duty Cycle",icon:t.jsx(Ft,{className:"mini-widget-icon"}),value:m.toFixed(1),unit:"%",status:u,subtitle:l,subtitleValue:x,isLoading:a,children:b})}function so(){return t.jsxs("div",{className:"mini-widget",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(ve,{className:"w-4 h-4"}),t.jsx(ve,{className:"h-3 w-16"})]}),t.jsx(ve,{className:"h-7 w-12 mt-2"}),t.jsx(ve,{className:"h-3 w-20 mt-2"})]})}function no(){return t.jsx("div",{className:"widget-row",children:Array.from({length:5}).map((e,n)=>t.jsx(so,{},n))})}const cs=[{target:"MeshHealth",fn:"type",minStage:1}];he(cs);function ao({className:e="",isLoaded:n,leading:o}){fe(cs);const s=Ot(),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(Us,{className:"w-4 h-4 text-sys-blue"}),t.jsx("span",{className:"type-label text-fg-muted",children:"MESH HEALTH"})]}),r?t.jsx(Wa,{children:t.jsxs("div",{className:"widget-row",children:[o&&t.jsx("div",{className:"widget-leading",children:o}),t.jsx(Va,{}),t.jsx(Ka,{}),t.jsx(to,{}),t.jsx(Ya,{})]})}):t.jsx(no,{})]})}const ds=[{target:"PublicChannel",fn:"decrypt",minStage:2,when:hn}];he(ds);let us="",ms="",Nt="";function oo(){const e=new Date,n=e.toDateString();if(n!==Nt){Nt=n,us=n;const o=new Date(e);o.setDate(o.getDate()-1),ms=o.toDateString()}}function ro(e){oo();const n=new Date(e*1e3).toDateString();return n===us?"Today":n===ms?"Yesterday":new Date(e*1e3).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})}function io(e,n,o){return`${e||""}|${n}|${o}`}function lo(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 co=h.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(Dn,{senderName:n.senderName||"Unknown",text:n.text,timestamp:n.timestamp,bubbleVariant:"subtle",nameAccessory:t.jsx(Yt,{channelName:r,active:s,onClick:()=>o==null?void 0:o(n.channelHash)})})})},lo);function uo({open:e,onClose:n,messages:o,initialChannel:s}){const r=h.useRef(null),a=h.useRef(!0),d=je(),c=Gt(),f=h.useMemo(()=>{const i=Date.now()/1e3,_=ne[d].minutes,k=i-_*60;return[...o].filter(C=>C.timestamp>=k).sort((C,A)=>C.timestamp-A.timestamp)},[o,d]),m=h.useCallback(()=>{const i=r.current;i&&(a.current=i.scrollTop>=-50)},[]),u=h.useMemo(()=>{const i=new Map;for(const _ of f){const k=_.channelHash,C=i.get(k);C?C.count++:i.set(k,{name:_.channelName||_.channelHash.slice(0,6),hash:_.channelHash,count:1})}return Array.from(i.values()).sort((_,k)=>k.count-_.count)},[f]),y=u.length,[l,x]=h.useState(null),[b,p]=h.useState(!1);h.useEffect(()=>{e&&s&&x(s)},[e,s]);const g=h.useMemo(()=>l?f.filter(i=>i.channelHash===l):f,[f,l]),D=h.useMemo(()=>{const i=[];let _="";for(const k of g){const C=ro(k.timestamp);C!==_&&(i.push({type:"date",date:C}),_=C),i.push({type:"message",message:k})}return i},[g]);h.useLayoutEffect(()=>{const i=r.current;i&&a.current&&(i.scrollTop=0)},[g.length]);const T=h.useCallback(()=>{if(g.length===0)return;const i=[...g].sort((B,R)=>B.timestamp-R.timestamp),_=u.find(B=>B.hash===l),k=(_==null?void 0:_.name)??"All_Channels";let C=`Chat Export - ${k} diff --git a/frontend/dist/assets/DataValue-CWEIHPTl.js b/frontend/dist/assets/DataValue-D1URDV5k.js similarity index 87% rename from frontend/dist/assets/DataValue-CWEIHPTl.js rename to frontend/dist/assets/DataValue-D1URDV5k.js index 642af3a2..431725c4 100644 --- a/frontend/dist/assets/DataValue-CWEIHPTl.js +++ b/frontend/dist/assets/DataValue-D1URDV5k.js @@ -1 +1 @@ -import{r as a,c_ as d,j as o,c$ as N}from"./index-C8J8z7Af.js";import{A as g}from"./index-CSWZC0QG.js";const b=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 I=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{b as A,I as D}; +import{r as a,c_ as d,j as o,c$ as N}from"./index-Dk8KEIKm.js";import{A as g}from"./index-M6ru5Gad.js";const b=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 I=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{b as A,I as D}; diff --git a/frontend/dist/assets/DatabaseManagement-Dz64hdQo.js b/frontend/dist/assets/DatabaseManagement-DJ7JfUIQ.js similarity index 94% rename from frontend/dist/assets/DatabaseManagement-Dz64hdQo.js rename to frontend/dist/assets/DatabaseManagement-DJ7JfUIQ.js index 3dfdf006..267cc86e 100644 --- a/frontend/dist/assets/DatabaseManagement-Dz64hdQo.js +++ b/frontend/dist/assets/DatabaseManagement-DJ7JfUIQ.js @@ -1 +1 @@ -import{r as a,j as e,ca as b,f as h,B as j,dz as k,d6 as z}from"./index-C8J8z7Af.js";import{b as _,v as M,p as v}from"./maintenance-C116ce5C.js";import{P as G,a as U,B as V,C as c}from"./PageLayout-D_1HzH-E.js";import{R as f,C as N}from"./Grid-CfYPlwSW.js";import{W as F}from"./wrench-DY1XOTkT.js";import{T as $}from"./trash-2-MzXRdjh-.js";function R(t){if(typeof t!="number"||!Number.isFinite(t))return"—";const l=["B","KB","MB","GB"];let o=t,n=0;for(;o>=1024&&n2e9?t:t*1e3;return new Date(l).toLocaleString()}function H({name:t}){return e.jsx("div",{className:"min-w-0",children:e.jsx("span",{className:"inline-flex max-w-full rounded-full border border-edge-subtle bg-surface/70 px-2.5 py-1 type-data-xs font-semibold text-fg-primary",children:e.jsx("span",{className:"truncate",children:t})})})}function Q(){const[t,l]=a.useState(null),[o,n]=a.useState(!0),[g,d]=a.useState(null),[p,y]=a.useState(new Set),[w,S]=a.useState(""),[P,u]=a.useState(null),[C,r]=a.useState(null),E=a.useMemo(()=>(t==null?void 0:t.tables)??[],[t]),m=a.useCallback(async()=>{n(!0),r(null);try{const s=await _();if(!s.success)throw new Error(s.error||"Database stats endpoint is unavailable");l(s.data??{})}catch(s){l(null),r(s instanceof Error?s.message:"Failed to load database stats")}finally{n(!1)}},[]);a.useEffect(()=>{m()},[m]);const D=s=>{y(x=>{const i=new Set(x);return i.has(s)?i.delete(s):i.add(s),i})},L=async()=>{d("vacuum"),r(null),u(null);try{const s=await M();if(!s.success)throw new Error(s.error||"Vacuum failed");u("Database vacuum completed."),await m()}catch(s){r(s instanceof Error?s.message:"Vacuum failed")}finally{d(null)}},B=async()=>{if(p.size!==0){d("purge-selected"),r(null),u(null);try{const s=await v(Array.from(p));if(!s.success)throw new Error(s.error||"Purge failed");u(`Purged ${p.size} selected table(s).`),y(new Set),await m()}catch(s){r(s instanceof Error?s.message:"Purge failed")}finally{d(null)}}},T=async()=>{if(w==="PURGE ALL"){d("purge-all"),r(null),u(null);try{const s=await v("all");if(!s.success)throw new Error(s.error||"Purge all failed");u("Purged all purgeable database tables."),S(""),y(new Set),await m()}catch(s){r(s instanceof Error?s.message:"Purge all failed")}finally{d(null)}}};return e.jsxs(G,{children:[e.jsx(U,{title:"Database Management",icon:e.jsx(b,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Inspect database size and run guarded maintenance operations."})}),e.jsxs(V,{ready:!o,children:[C&&e.jsx(f,{template:"auto",children:e.jsx(c,{neomorphic:!0,className:"text-sys-red",children:C})}),P&&e.jsx(f,{template:"auto",children:e.jsx(c,{neomorphic:!0,className:"text-sys-green",children:P})}),e.jsxs(f,{template:"standard",children:[e.jsx(N,{span:"full",md:4,children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(b,{}),title:"Main DB"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.database_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(b,{}),title:"RRD Store"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.rrd_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(F,{}),title:"Actions"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(j,{color:"primary",outline:!0,onClick:m,disabled:o,children:[e.jsx(k,{"data-slot":"icon"}),"Refresh"]}),e.jsx(j,{color:"warning",outline:!0,onClick:L,disabled:!!g,children:g==="vacuum"?"Running…":"Vacuum"})]})]})})]}),e.jsx(f,{template:"auto",children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(b,{}),title:"Tables"}),E.length===0?e.jsx("p",{className:"type-body-sm text-fg-muted",children:"No table statistics reported by this backend."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-edge-subtle bg-surface/30",children:e.jsxs("table",{className:"w-full min-w-[760px] table-fixed type-body-sm",children:[e.jsx("thead",{className:"bg-subtle-fill text-fg-muted",children:e.jsxs("tr",{className:"border-b border-edge-subtle",children:[e.jsx("th",{className:"w-20 px-3 py-3 text-center type-label",children:"Purge"}),e.jsx("th",{className:"w-[34%] px-3 py-3 text-left type-label",children:"Table"}),e.jsx("th",{className:"w-28 px-3 py-3 text-right type-label",children:"Rows"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Oldest"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Newest"})]})}),e.jsx("tbody",{className:"divide-y divide-edge-subtle",children:E.map(s=>{var x,i;return e.jsxs("tr",{className:"align-middle transition-colors hover:bg-subtle-fill/60",children:[e.jsx("td",{className:"px-3 py-3 text-center",children:e.jsx("input",{type:"checkbox",checked:p.has(s.name),onChange:()=>D(s.name)})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(H,{name:s.name})}),e.jsx("td",{className:"px-3 py-3 text-right type-data tabular-nums text-fg-primary",children:((i=(x=s.row_count)==null?void 0:x.toLocaleString)==null?void 0:i.call(x))??"—"}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.oldest_timestamp)}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.newest_timestamp)})]},s.name)})})]})}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:e.jsxs(j,{color:"danger",outline:!0,onClick:B,disabled:p.size===0||!!g,children:[e.jsx($,{"data-slot":"icon"}),"Purge Selected"]})})]})}),e.jsx(f,{template:"auto",children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(z,{}),title:"Purge All"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mb-3",children:["Irreversible. Type ",e.jsx("span",{className:"type-code text-sys-red",children:"PURGE ALL"})," to enable the button."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{className:"surface-input radius-inner px-3 py-2 flex-1",value:w,onChange:s=>S(s.target.value),placeholder:"PURGE ALL"}),e.jsx(j,{color:"danger",onClick:T,disabled:w!=="PURGE ALL"||!!g,children:"Purge All"})]})]})})]})]})}export{Q as default}; +import{r as a,j as e,ca as b,f as h,B as j,dz as k,d6 as z}from"./index-Dk8KEIKm.js";import{b as _,v as M,p as v}from"./maintenance-BwN0Nmu4.js";import{P as G,a as U,B as V,C as c}from"./PageLayout-CGcnsIyM.js";import{R as f,C as N}from"./Grid-CThL_TW5.js";import{W as F}from"./wrench-2g9NYn7s.js";import{T as $}from"./trash-2-BNWAPzrN.js";function R(t){if(typeof t!="number"||!Number.isFinite(t))return"—";const l=["B","KB","MB","GB"];let o=t,n=0;for(;o>=1024&&n2e9?t:t*1e3;return new Date(l).toLocaleString()}function H({name:t}){return e.jsx("div",{className:"min-w-0",children:e.jsx("span",{className:"inline-flex max-w-full rounded-full border border-edge-subtle bg-surface/70 px-2.5 py-1 type-data-xs font-semibold text-fg-primary",children:e.jsx("span",{className:"truncate",children:t})})})}function Q(){const[t,l]=a.useState(null),[o,n]=a.useState(!0),[g,d]=a.useState(null),[p,y]=a.useState(new Set),[w,S]=a.useState(""),[P,u]=a.useState(null),[C,r]=a.useState(null),E=a.useMemo(()=>(t==null?void 0:t.tables)??[],[t]),m=a.useCallback(async()=>{n(!0),r(null);try{const s=await _();if(!s.success)throw new Error(s.error||"Database stats endpoint is unavailable");l(s.data??{})}catch(s){l(null),r(s instanceof Error?s.message:"Failed to load database stats")}finally{n(!1)}},[]);a.useEffect(()=>{m()},[m]);const D=s=>{y(x=>{const i=new Set(x);return i.has(s)?i.delete(s):i.add(s),i})},L=async()=>{d("vacuum"),r(null),u(null);try{const s=await M();if(!s.success)throw new Error(s.error||"Vacuum failed");u("Database vacuum completed."),await m()}catch(s){r(s instanceof Error?s.message:"Vacuum failed")}finally{d(null)}},B=async()=>{if(p.size!==0){d("purge-selected"),r(null),u(null);try{const s=await v(Array.from(p));if(!s.success)throw new Error(s.error||"Purge failed");u(`Purged ${p.size} selected table(s).`),y(new Set),await m()}catch(s){r(s instanceof Error?s.message:"Purge failed")}finally{d(null)}}},T=async()=>{if(w==="PURGE ALL"){d("purge-all"),r(null),u(null);try{const s=await v("all");if(!s.success)throw new Error(s.error||"Purge all failed");u("Purged all purgeable database tables."),S(""),y(new Set),await m()}catch(s){r(s instanceof Error?s.message:"Purge all failed")}finally{d(null)}}};return e.jsxs(G,{children:[e.jsx(U,{title:"Database Management",icon:e.jsx(b,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Inspect database size and run guarded maintenance operations."})}),e.jsxs(V,{ready:!o,children:[C&&e.jsx(f,{template:"auto",children:e.jsx(c,{neomorphic:!0,className:"text-sys-red",children:C})}),P&&e.jsx(f,{template:"auto",children:e.jsx(c,{neomorphic:!0,className:"text-sys-green",children:P})}),e.jsxs(f,{template:"standard",children:[e.jsx(N,{span:"full",md:4,children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(b,{}),title:"Main DB"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.database_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(b,{}),title:"RRD Store"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.rrd_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(F,{}),title:"Actions"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(j,{color:"primary",outline:!0,onClick:m,disabled:o,children:[e.jsx(k,{"data-slot":"icon"}),"Refresh"]}),e.jsx(j,{color:"warning",outline:!0,onClick:L,disabled:!!g,children:g==="vacuum"?"Running…":"Vacuum"})]})]})})]}),e.jsx(f,{template:"auto",children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(b,{}),title:"Tables"}),E.length===0?e.jsx("p",{className:"type-body-sm text-fg-muted",children:"No table statistics reported by this backend."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-edge-subtle bg-surface/30",children:e.jsxs("table",{className:"w-full min-w-[760px] table-fixed type-body-sm",children:[e.jsx("thead",{className:"bg-subtle-fill text-fg-muted",children:e.jsxs("tr",{className:"border-b border-edge-subtle",children:[e.jsx("th",{className:"w-20 px-3 py-3 text-center type-label",children:"Purge"}),e.jsx("th",{className:"w-[34%] px-3 py-3 text-left type-label",children:"Table"}),e.jsx("th",{className:"w-28 px-3 py-3 text-right type-label",children:"Rows"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Oldest"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Newest"})]})}),e.jsx("tbody",{className:"divide-y divide-edge-subtle",children:E.map(s=>{var x,i;return e.jsxs("tr",{className:"align-middle transition-colors hover:bg-subtle-fill/60",children:[e.jsx("td",{className:"px-3 py-3 text-center",children:e.jsx("input",{type:"checkbox",checked:p.has(s.name),onChange:()=>D(s.name)})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(H,{name:s.name})}),e.jsx("td",{className:"px-3 py-3 text-right type-data tabular-nums text-fg-primary",children:((i=(x=s.row_count)==null?void 0:x.toLocaleString)==null?void 0:i.call(x))??"—"}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.oldest_timestamp)}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.newest_timestamp)})]},s.name)})})]})}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:e.jsxs(j,{color:"danger",outline:!0,onClick:B,disabled:p.size===0||!!g,children:[e.jsx($,{"data-slot":"icon"}),"Purge Selected"]})})]})}),e.jsx(f,{template:"auto",children:e.jsxs(c,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(z,{}),title:"Purge All"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mb-3",children:["Irreversible. Type ",e.jsx("span",{className:"type-code text-sys-red",children:"PURGE ALL"})," to enable the button."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{className:"surface-input radius-inner px-3 py-2 flex-1",value:w,onChange:s=>S(s.target.value),placeholder:"PURGE ALL"}),e.jsx(j,{color:"danger",onClick:T,disabled:w!=="PURGE ALL"||!!g,children:"Purge All"})]})]})})]})]})}export{Q as default}; diff --git a/frontend/dist/assets/GPSDiagnostics-D4qyRZvV.js b/frontend/dist/assets/GPSDiagnostics-B-z1YN9k.js similarity index 99% rename from frontend/dist/assets/GPSDiagnostics-D4qyRZvV.js rename to frontend/dist/assets/GPSDiagnostics-B-z1YN9k.js index 82704b7b..452277f4 100644 --- a/frontend/dist/assets/GPSDiagnostics-D4qyRZvV.js +++ b/frontend/dist/assets/GPSDiagnostics-B-z1YN9k.js @@ -1,4 +1,4 @@ -import{e as i2,dv as s2,dw as a2,dx as l2,r as O,j as i,f as w1,d1 as c2,dy as p2}from"./index-C8J8z7Af.js";import{M as u2,B as y2,S as f2,a as d2}from"./BasemapLayer-BvoQWTC4.js";import{P as g2,a as h2,B as m2,C as t1}from"./PageLayout-D_1HzH-E.js";import{M as K1}from"./map-pin-ufrVZcS3.js";import{R as V1,C as M1}from"./Grid-CfYPlwSW.js";import{S as x2}from"./satellite-oFalh_20.js";/** +import{e as i2,dv as s2,dw as a2,dx as l2,r as O,j as i,f as w1,d1 as c2,dy as p2}from"./index-Dk8KEIKm.js";import{M as u2,B as y2,S as f2,a as d2}from"./BasemapLayer-snfcoHal.js";import{P as g2,a as h2,B as m2,C as t1}from"./PageLayout-CGcnsIyM.js";import{M as K1}from"./map-pin-6ZLH5iNg.js";import{R as V1,C as M1}from"./Grid-CThL_TW5.js";import{S as x2}from"./satellite-COoSp6TF.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Grid-CfYPlwSW.js b/frontend/dist/assets/Grid-CThL_TW5.js similarity index 95% rename from frontend/dist/assets/Grid-CfYPlwSW.js rename to frontend/dist/assets/Grid-CThL_TW5.js index 8e745984..65af8444 100644 --- a/frontend/dist/assets/Grid-CfYPlwSW.js +++ b/frontend/dist/assets/Grid-CThL_TW5.js @@ -1 +1 @@ -import{r as b,j as c,c as d}from"./index-C8J8z7Af.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-Dk8KEIKm.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-LnaBrSq2.js b/frontend/dist/assets/KeycapButton-BcsI7tsG.js similarity index 98% rename from frontend/dist/assets/KeycapButton-LnaBrSq2.js rename to frontend/dist/assets/KeycapButton-BcsI7tsG.js index 1b3f8063..863f462e 100644 --- a/frontend/dist/assets/KeycapButton-LnaBrSq2.js +++ b/frontend/dist/assets/KeycapButton-BcsI7tsG.js @@ -1 +1 @@ -import{r as l,j as t,Z as O}from"./index-C8J8z7Af.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-Dk8KEIKm.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-DUJ9rwBo.js b/frontend/dist/assets/LightSparkline-eR-H8PYv.js similarity index 96% rename from frontend/dist/assets/LightSparkline-DUJ9rwBo.js rename to frontend/dist/assets/LightSparkline-eR-H8PYv.js index 4e1874fa..4290e633 100644 --- a/frontend/dist/assets/LightSparkline-DUJ9rwBo.js +++ b/frontend/dist/assets/LightSparkline-eR-H8PYv.js @@ -1 +1 @@ -import{r as y,j as t}from"./index-C8J8z7Af.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-Dk8KEIKm.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-PnHZAnpC.js b/frontend/dist/assets/Login-d13CCiQB.js similarity index 99% rename from frontend/dist/assets/Login-PnHZAnpC.js rename to frontend/dist/assets/Login-d13CCiQB.js index dabd0984..c02d6b6a 100644 --- a/frontend/dist/assets/Login-PnHZAnpC.js +++ b/frontend/dist/assets/Login-d13CCiQB.js @@ -1 +1 @@ -import{r as s,j as e,u as _,g as Z,i as B,s as A,l as E,m as r,a as T,b as u,A as z,c as v,I as y,C as I,d as W,B as D,Z as F}from"./index-C8J8z7Af.js";function H({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 U=s.memo(H),q="/assets/WCM_Waves-RN-_ocPH.gif",K="/assets/openhop-logo-ABnN0k-5.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=v("block type-badge text-fg-secondary"),O=s.memo(function({className:n}){return e.jsxs("svg",{className:v("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})}),f=()=>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:F[950]},"aria-hidden":"true"})}),V=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/openhop-dev/openhop_repeater",children:e.jsx("img",{src:K,alt:"openHop",className:"h-14"})}),e.jsx(f,{}),e.jsx(p,{href:"https://meshcore.io",children:e.jsx(U,{height:12,className:"text-white"})}),e.jsx(f,{}),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:q,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),X={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(""),[a,N]=s.useState(""),[C,w]=s.useState(Z),[L,g]=s.useState(!1),[o,h]=s.useState(null),[j]=s.useState(()=>{try{const t=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),t?X[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),[]),k=s.useCallback(t=>{d(t.target.value),o&&m()},[o,m]),M=s.useCallback(t=>{N(t.target.value),o&&m()},[o,m]),S=s.useCallback(t=>{w(t),A(t)},[]),R=s.useCallback(async t=>{if(t.preventDefault(),!c)return;g(!0),h(null);const x=await E(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(z,{})}),j&&!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:j})}),e.jsxs(r.form,{variants:l.item,onSubmit:R,onKeyDown:P,method:"post",action:"/auth/login",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(y,{id:"username",name:"username",type:"text",value:n,onChange:k,required:!0,autoComplete:"username",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,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(y,{id:"password",name:"password",type:"password",value:a,onChange:M,required:!0,autoComplete:"current-password",className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(I,{checked:C,onChange:S,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(W,{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(D,{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(O,{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(V,{})]})}export{J as default}; +import{r as s,j as e,u as _,g as Z,i as B,s as A,l as E,m as r,a as T,b as u,A as z,c as v,I as y,C as I,d as W,B as D,Z as F}from"./index-Dk8KEIKm.js";function H({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 U=s.memo(H),q="/assets/WCM_Waves-RN-_ocPH.gif",K="/assets/openhop-logo-ABnN0k-5.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=v("block type-badge text-fg-secondary"),O=s.memo(function({className:n}){return e.jsxs("svg",{className:v("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})}),f=()=>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:F[950]},"aria-hidden":"true"})}),V=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/openhop-dev/openhop_repeater",children:e.jsx("img",{src:K,alt:"openHop",className:"h-14"})}),e.jsx(f,{}),e.jsx(p,{href:"https://meshcore.io",children:e.jsx(U,{height:12,className:"text-white"})}),e.jsx(f,{}),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:q,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),X={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(""),[a,N]=s.useState(""),[C,w]=s.useState(Z),[L,g]=s.useState(!1),[o,h]=s.useState(null),[j]=s.useState(()=>{try{const t=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),t?X[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),[]),k=s.useCallback(t=>{d(t.target.value),o&&m()},[o,m]),M=s.useCallback(t=>{N(t.target.value),o&&m()},[o,m]),S=s.useCallback(t=>{w(t),A(t)},[]),R=s.useCallback(async t=>{if(t.preventDefault(),!c)return;g(!0),h(null);const x=await E(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(z,{})}),j&&!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:j})}),e.jsxs(r.form,{variants:l.item,onSubmit:R,onKeyDown:P,method:"post",action:"/auth/login",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(y,{id:"username",name:"username",type:"text",value:n,onChange:k,required:!0,autoComplete:"username",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,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(y,{id:"password",name:"password",type:"password",value:a,onChange:M,required:!0,autoComplete:"current-password",className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(I,{checked:C,onChange:S,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(W,{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(D,{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(O,{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(V,{})]})}export{J as default}; diff --git a/frontend/dist/assets/Logs-DeiDk3ov.js b/frontend/dist/assets/Logs-nUEk6i_Z.js similarity index 97% rename from frontend/dist/assets/Logs-DeiDk3ov.js rename to frontend/dist/assets/Logs-nUEk6i_Z.js index 59ded35d..9616f042 100644 --- a/frontend/dist/assets/Logs-DeiDk3ov.js +++ b/frontend/dist/assets/Logs-nUEk6i_Z.js @@ -1 +1 @@ -import{e4 as $,e5 as G,a9 as W,e6 as D,e7 as U,r,e8 as V,j as e,$ as H,B as d,dz as _,e9 as O,c as y,f as q,ea as J,eb as B,m as K}from"./index-C8J8z7Af.js";import{P as Q,a as X,B as Y,C as w}from"./PageLayout-D_1HzH-E.js";import{C as Z,a as ee}from"./circle-stop-Bv_ZsQj9.js";import{R as S}from"./Grid-CfYPlwSW.js";const F=["CRITICAL","ERROR","WARNING","WARN","INFO","DEBUG"];function C(a){if(a.logger)return a.logger;const t=a.message.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR|WARN|CRITICAL) -/);return t?t[1].trim():"Unknown"}function P(a){const t=a.message.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR|WARN|CRITICAL) - (.+)$/);return t?t[1]:a.message}function M(a){return Array.from(a).sort((t,l)=>{const c=F.indexOf(t),u=F.indexOf(l);return c!==-1||u!==-1?(c===-1?99:c)-(u===-1?99:u):t.localeCompare(l)})}function j({label:a,value:t,detail:l}){return e.jsxs("div",{className:"rounded-xl border border-edge-subtle bg-subtle-fill/80 px-3 py-2",children:[e.jsx("p",{className:"type-label text-fg-muted",children:a}),e.jsx("p",{className:"mt-0.5 type-body font-semibold text-fg-primary",children:t}),e.jsx("p",{className:"type-body-xs text-fg-muted",children:l})]})}function se(a,t){return t?y("bg-surface/60",B(a)):"border-edge-subtle bg-surface/40 text-fg-muted"}const te=r.memo(function({log:t}){const l=C(t);return e.jsx(K.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"px-3 py-2 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex flex-col gap-1 lg:flex-row lg:items-start",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:w-64 lg:flex-none",children:[e.jsx("span",{className:"type-data-xs tabular-nums text-fg-muted",children:new Date(t.timestamp).toLocaleTimeString()}),e.jsx("span",{className:"max-w-36 truncate rounded-full border border-edge-subtle bg-surface/60 px-2 py-0.5 type-data-xs text-fg-muted",children:l}),e.jsx("span",{className:y("rounded-full border border-edge-subtle px-2 py-0.5 type-data-xs font-semibold",B(t.level)),children:t.level})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:P(t)}),(t.module||t.line||t.exception)&&e.jsx("p",{className:"mt-1 type-data-xs text-fg-muted",children:[t.module,t.line!=null?`line ${t.line}`:null,t.exception?"exception attached":null].filter(Boolean).join(" · ")})]})]})})});function ie(){const a=$(),t=G(),l=W(),c=D(),u=U(),R=r.useRef(!1),[m,x]=r.useState(new Set),[p,g]=r.useState(new Set),[N,E]=r.useState(""),[v,I]=r.useState(""),i=r.useMemo(()=>new Set(a.map(C)),[a]),o=r.useMemo(()=>new Set(a.map(s=>s.level)),[a]),A=r.useMemo(()=>M(i).filter(s=>s.toLowerCase().includes(v.trim().toLowerCase())),[i,v]),T=r.useMemo(()=>M(o),[o]);r.useEffect(()=>{R.current||a.length===0||(R.current=!0,x(new Set(i)),g(new Set(o)))},[i,o,a.length]);const L=r.useRef(c);L.current=c,r.useEffect(()=>{if(!l)return;L.current();const s=setInterval(()=>L.current(),V.logs);return()=>clearInterval(s)},[l]);const k=r.useCallback((s,n)=>{n(h=>{const b=new Set(h);return b.has(s)?b.delete(s):b.add(s),b})},[]),f=r.useMemo(()=>{const s=N.trim().toLowerCase();return a.filter(n=>{const h=C(n);return!m.has(h)||!p.has(n.level)?!1:s?[h,n.level,P(n),n.exception??"",n.module??"",n.process??""].join(" ").toLowerCase().includes(s):!0})},[p,m,a,N]),z=a.length?a[a.length-1].timestamp:null;return e.jsxs(Q,{children:[e.jsx(X,{title:"System Logs",icon:e.jsx(O,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Live tail for repeater logs with pause, search, and logger-level filtering."}),controls:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(H,{color:l?"green":"zinc",children:l?"Live":"Paused"}),e.jsxs(d,{plain:!0,color:l?"danger":"primary",onClick:()=>u(!l),children:[l?e.jsx(Z,{"data-slot":"icon"}):e.jsx(ee,{"data-slot":"icon"}),l?"Pause Live":"Resume Live"]}),e.jsxs(d,{color:"primary",outline:!0,onClick:()=>c(),disabled:t,children:[e.jsx(_,{"data-slot":"icon",className:t?"animate-spin":void 0})," Refresh Snapshot"]})]})}),e.jsxs(Y,{ready:!0,children:[e.jsx(S,{template:"auto",children:e.jsx(w,{compact:!0,children:e.jsxs("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:[e.jsx(j,{label:"Visible",value:f.length.toLocaleString(),detail:`of ${a.length.toLocaleString()} lines`}),e.jsx(j,{label:"Loggers",value:m.size,detail:`of ${i.size} selected`}),e.jsx(j,{label:"Levels",value:p.size,detail:`of ${o.size} selected`}),e.jsx(j,{label:"Last Activity",value:z?new Date(z).toLocaleTimeString():"Waiting",detail:l?"Up to date":"Live paused"})]})})}),e.jsx(S,{template:"auto",children:e.jsxs(w,{neomorphic:!0,children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-12",children:[e.jsxs("label",{className:"xl:col-span-8 space-y-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:"Search Logs"}),e.jsx("input",{className:"surface-input radius-inner w-full px-3 py-2 text-fg-primary",value:N,onChange:s=>E(s.target.value),placeholder:"Search logger, message, exception, module..."})]}),e.jsxs("div",{className:"xl:col-span-4 space-y-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:"Actions"}),e.jsx("div",{className:"flex flex-wrap gap-2 xl:justify-end",children:e.jsx(d,{plain:!0,onClick:()=>{E(""),I(""),x(new Set(i)),g(new Set(o))},children:"Reset Filters"})})]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border border-edge-subtle bg-subtle-fill/70 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"type-body-sm font-semibold text-fg-primary",children:"Level Filters"}),e.jsxs("p",{className:"type-body-xs text-fg-muted",children:[p.size," of ",o.size," selected"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{plain:!0,onClick:()=>g(new Set(o)),children:"All"}),e.jsx(d,{color:"danger",outline:!0,onClick:()=>g(new Set),children:"None"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:T.map(s=>e.jsx("button",{type:"button",onClick:()=>k(s,g),className:y("rounded-full border px-3 py-1.5 type-data-xs font-semibold transition-colors",se(s,p.has(s))),children:s},s))})]}),e.jsxs("div",{className:"rounded-xl border border-edge-subtle bg-subtle-fill/70 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"type-body-sm font-semibold text-fg-primary",children:"Logger Filters"}),e.jsxs("p",{className:"type-body-xs text-fg-muted",children:[m.size," of ",i.size," selected"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{plain:!0,onClick:()=>x(new Set(i)),children:"All Loggers"}),e.jsx(d,{color:"danger",outline:!0,onClick:()=>x(new Set),children:"Clear Loggers"})]})]}),e.jsx("input",{className:"surface-input radius-inner mb-3 w-full px-3 py-2 text-fg-primary",value:v,onChange:s=>I(s.target.value),placeholder:"Find a logger..."}),e.jsx("div",{className:"flex max-h-40 flex-wrap gap-2 overflow-y-auto pr-1",children:A.length?A.map(s=>e.jsx("button",{type:"button",onClick:()=>k(s,x),className:y("rounded-full border px-3 py-1.5 type-data-xs transition-colors",m.has(s)?"border-sys-blue/60 bg-sys-blue/10 text-sys-blue":"border-edge-subtle text-fg-muted hover:bg-overlay-soft"),children:s},s)):e.jsx("p",{className:"w-full py-6 text-center type-body-sm text-fg-muted",children:"No loggers match this filter."})})]})]})]})}),e.jsx(S,{template:"auto",children:e.jsxs(w,{neomorphic:!0,noPadding:!0,children:[e.jsx(q,{listHeader:!0,icon:e.jsx(O,{className:"icon-sm"}),title:"Log Entries",badge:`${f.length} visible`}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-360px)] min-h-80 overflow-y-auto p-4",children:t&&a.length===0?e.jsx(J,{count:10}):f.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:a.length===0?"No logs available":"No logs match selected filters"}):f.map((s,n)=>e.jsx(te,{log:s},`${s.id??s.timestamp}-${n}`))})]})})]})]})}export{ie as default}; +import{e4 as $,e5 as G,a9 as W,e6 as D,e7 as U,r,e8 as V,j as e,$ as H,B as d,dz as _,e9 as O,c as y,f as q,ea as J,eb as B,m as K}from"./index-Dk8KEIKm.js";import{P as Q,a as X,B as Y,C as w}from"./PageLayout-CGcnsIyM.js";import{C as Z,a as ee}from"./circle-stop-DA7KtBFF.js";import{R as S}from"./Grid-CThL_TW5.js";const F=["CRITICAL","ERROR","WARNING","WARN","INFO","DEBUG"];function C(a){if(a.logger)return a.logger;const t=a.message.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR|WARN|CRITICAL) -/);return t?t[1].trim():"Unknown"}function P(a){const t=a.message.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR|WARN|CRITICAL) - (.+)$/);return t?t[1]:a.message}function M(a){return Array.from(a).sort((t,l)=>{const c=F.indexOf(t),u=F.indexOf(l);return c!==-1||u!==-1?(c===-1?99:c)-(u===-1?99:u):t.localeCompare(l)})}function j({label:a,value:t,detail:l}){return e.jsxs("div",{className:"rounded-xl border border-edge-subtle bg-subtle-fill/80 px-3 py-2",children:[e.jsx("p",{className:"type-label text-fg-muted",children:a}),e.jsx("p",{className:"mt-0.5 type-body font-semibold text-fg-primary",children:t}),e.jsx("p",{className:"type-body-xs text-fg-muted",children:l})]})}function se(a,t){return t?y("bg-surface/60",B(a)):"border-edge-subtle bg-surface/40 text-fg-muted"}const te=r.memo(function({log:t}){const l=C(t);return e.jsx(K.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"px-3 py-2 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex flex-col gap-1 lg:flex-row lg:items-start",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:w-64 lg:flex-none",children:[e.jsx("span",{className:"type-data-xs tabular-nums text-fg-muted",children:new Date(t.timestamp).toLocaleTimeString()}),e.jsx("span",{className:"max-w-36 truncate rounded-full border border-edge-subtle bg-surface/60 px-2 py-0.5 type-data-xs text-fg-muted",children:l}),e.jsx("span",{className:y("rounded-full border border-edge-subtle px-2 py-0.5 type-data-xs font-semibold",B(t.level)),children:t.level})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:P(t)}),(t.module||t.line||t.exception)&&e.jsx("p",{className:"mt-1 type-data-xs text-fg-muted",children:[t.module,t.line!=null?`line ${t.line}`:null,t.exception?"exception attached":null].filter(Boolean).join(" · ")})]})]})})});function ie(){const a=$(),t=G(),l=W(),c=D(),u=U(),R=r.useRef(!1),[m,x]=r.useState(new Set),[p,g]=r.useState(new Set),[N,E]=r.useState(""),[v,I]=r.useState(""),i=r.useMemo(()=>new Set(a.map(C)),[a]),o=r.useMemo(()=>new Set(a.map(s=>s.level)),[a]),A=r.useMemo(()=>M(i).filter(s=>s.toLowerCase().includes(v.trim().toLowerCase())),[i,v]),T=r.useMemo(()=>M(o),[o]);r.useEffect(()=>{R.current||a.length===0||(R.current=!0,x(new Set(i)),g(new Set(o)))},[i,o,a.length]);const L=r.useRef(c);L.current=c,r.useEffect(()=>{if(!l)return;L.current();const s=setInterval(()=>L.current(),V.logs);return()=>clearInterval(s)},[l]);const k=r.useCallback((s,n)=>{n(h=>{const b=new Set(h);return b.has(s)?b.delete(s):b.add(s),b})},[]),f=r.useMemo(()=>{const s=N.trim().toLowerCase();return a.filter(n=>{const h=C(n);return!m.has(h)||!p.has(n.level)?!1:s?[h,n.level,P(n),n.exception??"",n.module??"",n.process??""].join(" ").toLowerCase().includes(s):!0})},[p,m,a,N]),z=a.length?a[a.length-1].timestamp:null;return e.jsxs(Q,{children:[e.jsx(X,{title:"System Logs",icon:e.jsx(O,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Live tail for repeater logs with pause, search, and logger-level filtering."}),controls:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(H,{color:l?"green":"zinc",children:l?"Live":"Paused"}),e.jsxs(d,{plain:!0,color:l?"danger":"primary",onClick:()=>u(!l),children:[l?e.jsx(Z,{"data-slot":"icon"}):e.jsx(ee,{"data-slot":"icon"}),l?"Pause Live":"Resume Live"]}),e.jsxs(d,{color:"primary",outline:!0,onClick:()=>c(),disabled:t,children:[e.jsx(_,{"data-slot":"icon",className:t?"animate-spin":void 0})," Refresh Snapshot"]})]})}),e.jsxs(Y,{ready:!0,children:[e.jsx(S,{template:"auto",children:e.jsx(w,{compact:!0,children:e.jsxs("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:[e.jsx(j,{label:"Visible",value:f.length.toLocaleString(),detail:`of ${a.length.toLocaleString()} lines`}),e.jsx(j,{label:"Loggers",value:m.size,detail:`of ${i.size} selected`}),e.jsx(j,{label:"Levels",value:p.size,detail:`of ${o.size} selected`}),e.jsx(j,{label:"Last Activity",value:z?new Date(z).toLocaleTimeString():"Waiting",detail:l?"Up to date":"Live paused"})]})})}),e.jsx(S,{template:"auto",children:e.jsxs(w,{neomorphic:!0,children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-12",children:[e.jsxs("label",{className:"xl:col-span-8 space-y-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:"Search Logs"}),e.jsx("input",{className:"surface-input radius-inner w-full px-3 py-2 text-fg-primary",value:N,onChange:s=>E(s.target.value),placeholder:"Search logger, message, exception, module..."})]}),e.jsxs("div",{className:"xl:col-span-4 space-y-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:"Actions"}),e.jsx("div",{className:"flex flex-wrap gap-2 xl:justify-end",children:e.jsx(d,{plain:!0,onClick:()=>{E(""),I(""),x(new Set(i)),g(new Set(o))},children:"Reset Filters"})})]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border border-edge-subtle bg-subtle-fill/70 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"type-body-sm font-semibold text-fg-primary",children:"Level Filters"}),e.jsxs("p",{className:"type-body-xs text-fg-muted",children:[p.size," of ",o.size," selected"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{plain:!0,onClick:()=>g(new Set(o)),children:"All"}),e.jsx(d,{color:"danger",outline:!0,onClick:()=>g(new Set),children:"None"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:T.map(s=>e.jsx("button",{type:"button",onClick:()=>k(s,g),className:y("rounded-full border px-3 py-1.5 type-data-xs font-semibold transition-colors",se(s,p.has(s))),children:s},s))})]}),e.jsxs("div",{className:"rounded-xl border border-edge-subtle bg-subtle-fill/70 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"type-body-sm font-semibold text-fg-primary",children:"Logger Filters"}),e.jsxs("p",{className:"type-body-xs text-fg-muted",children:[m.size," of ",i.size," selected"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{plain:!0,onClick:()=>x(new Set(i)),children:"All Loggers"}),e.jsx(d,{color:"danger",outline:!0,onClick:()=>x(new Set),children:"Clear Loggers"})]})]}),e.jsx("input",{className:"surface-input radius-inner mb-3 w-full px-3 py-2 text-fg-primary",value:v,onChange:s=>I(s.target.value),placeholder:"Find a logger..."}),e.jsx("div",{className:"flex max-h-40 flex-wrap gap-2 overflow-y-auto pr-1",children:A.length?A.map(s=>e.jsx("button",{type:"button",onClick:()=>k(s,x),className:y("rounded-full border px-3 py-1.5 type-data-xs transition-colors",m.has(s)?"border-sys-blue/60 bg-sys-blue/10 text-sys-blue":"border-edge-subtle text-fg-muted hover:bg-overlay-soft"),children:s},s)):e.jsx("p",{className:"w-full py-6 text-center type-body-sm text-fg-muted",children:"No loggers match this filter."})})]})]})]})}),e.jsx(S,{template:"auto",children:e.jsxs(w,{neomorphic:!0,noPadding:!0,children:[e.jsx(q,{listHeader:!0,icon:e.jsx(O,{className:"icon-sm"}),title:"Log Entries",badge:`${f.length} visible`}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-360px)] min-h-80 overflow-y-auto p-4",children:t&&a.length===0?e.jsx(J,{count:10}):f.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:a.length===0?"No logs available":"No logs match selected filters"}):f.map((s,n)=>e.jsx(te,{log:s},`${s.id??s.timestamp}-${n}`))})]})})]})]})}export{ie as default}; diff --git a/frontend/dist/assets/MemoryDebug-CviboBHK.js b/frontend/dist/assets/MemoryDebug-DQikeVuR.js similarity index 97% rename from frontend/dist/assets/MemoryDebug-CviboBHK.js rename to frontend/dist/assets/MemoryDebug-DQikeVuR.js index c69d7899..590ffea8 100644 --- a/frontend/dist/assets/MemoryDebug-CviboBHK.js +++ b/frontend/dist/assets/MemoryDebug-DQikeVuR.js @@ -1,4 +1,4 @@ -import{e as z,r as i,j as e,fJ as E,f as D,B as v,dz as F,cV as T,c7 as C,bX as k}from"./index-C8J8z7Af.js";import{c as R,r as L}from"./maintenance-C116ce5C.js";import{P as I,a as P,B as G,C as M}from"./PageLayout-D_1HzH-E.js";import{R as _}from"./Grid-CfYPlwSW.js";/** +import{e as z,r as i,j as e,fJ as E,f as D,B as v,dz as F,cV as T,c7 as C,bX as k}from"./index-Dk8KEIKm.js";import{c as R,r as L}from"./maintenance-BwN0Nmu4.js";import{P as I,a as P,B as G,C as M}from"./PageLayout-CGcnsIyM.js";import{R as _}from"./Grid-CThL_TW5.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MeshGraph-BvCtLSUf.js b/frontend/dist/assets/MeshGraph-D4AwE2ti.js similarity index 99% rename from frontend/dist/assets/MeshGraph-BvCtLSUf.js rename to frontend/dist/assets/MeshGraph-D4AwE2ti.js index 5bc5b4ff..96decb6d 100644 --- a/frontend/dist/assets/MeshGraph-BvCtLSUf.js +++ b/frontend/dist/assets/MeshGraph-D4AwE2ti.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-B873amTQ.js","assets/index-C8J8z7Af.js","assets/max-DNf2hxWM.js","assets/consumer-registry-BKgTBvt8.js","assets/variants-CSW2-RVV.js","assets/git-branch-ChtBrERo.js","assets/clock-CTBG2e06.js","assets/badge-colors-Dl76Mz8m.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/layers-Dy827Q5R.js","assets/search-BO7ZBfwt.js","assets/settings-2-BrtUmS4l.js","assets/rotate-ccw-CH2KviiM.js","assets/chevron-right-ZaDPsavE.js","assets/target-BJQI0xG9.js","assets/network-BNx67sOl.js","assets/index-CqhZhFJJ.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,br as un,cx as mg,dB as dL,dC as hL,j as f,ay as fL,az as g0,bK as Vl,c as oh,bX as pL,dD as mL,m as ma,a4 as ey,ca as gL,a6 as gg,dE as PS,dF as jh,dG as NS,aq as hd,dH as _L,dI as yL,d as Jc,dJ as bL,aN as vL,dK as xL,dL as wL,dM as SL,dN as EL,dO as CL,dP as TL,dQ as kL,aa as AL,cR as IL,dR as LL,V as Ge,Z as Xt,dS as _0,$ as Bi,ar as be,ct as RL,dT as PL,dA as NL,R as _g,d6 as fd,aA as y0,dU as DL,aB as Pc,dV as ML,a$ as BL,dW as OL,dX as FL,B as ty,c3 as zL,a5 as UL,a7 as $L,dY as jL}from"./index-C8J8z7Af.js";import{m as b0,t as yg,a as HL,b as VL,e as Rn,u as GL,G as WL,c as YL,E as qL}from"./max-DNf2hxWM.js";import{u as XL,r as KL,f as v0,g as ZL,e as QL}from"./consumer-registry-BKgTBvt8.js";import{s as JL,M as DS,a as x0,b as iy}from"./variants-CSW2-RVV.js";import{G as Wp}from"./git-branch-ChtBrERo.js";import{C as eR}from"./clock-CTBG2e06.js";import{N as tR,a as iR}from"./badge-colors-Dl76Mz8m.js";import{e as nR,f as w0,g as sR}from"./meshcore-tx-constants-DgpFTAmf.js";import{L as S0}from"./layers-Dy827Q5R.js";import{S as E0}from"./search-BO7ZBfwt.js";import{S as C0}from"./settings-2-BrtUmS4l.js";import{R as T0}from"./rotate-ccw-CH2KviiM.js";import{C as Yp}from"./chevron-right-ZaDPsavE.js";import{T as rR}from"./target-BJQI0xG9.js";import{N as MS}from"./network-BNx67sOl.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-D0NAnJg8.js","assets/index-Dk8KEIKm.js","assets/max-zrNGYgli.js","assets/consumer-registry-CTHycSys.js","assets/variants-bcpM0cYI.js","assets/git-branch-Dye45Z4B.js","assets/clock-BSYVhL7Q.js","assets/badge-colors-Dl76Mz8m.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/layers-g7u6rTYv.js","assets/search-DgakOYk2.js","assets/settings-2-CTbt3KT5.js","assets/rotate-ccw-BQDcEa4l.js","assets/chevron-right-BugwEnle.js","assets/target-Djl_t-RI.js","assets/network-BgtOii-i.js","assets/index-CqhZhFJJ.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,br as un,cx as mg,dB as dL,dC as hL,j as f,ay as fL,az as g0,bK as Vl,c as oh,bX as pL,dD as mL,m as ma,a4 as ey,ca as gL,a6 as gg,dE as PS,dF as jh,dG as NS,aq as hd,dH as _L,dI as yL,d as Jc,dJ as bL,aN as vL,dK as xL,dL as wL,dM as SL,dN as EL,dO as CL,dP as TL,dQ as kL,aa as AL,cR as IL,dR as LL,V as Ge,Z as Xt,dS as _0,$ as Bi,ar as be,ct as RL,dT as PL,dA as NL,R as _g,d6 as fd,aA as y0,dU as DL,aB as Pc,dV as ML,a$ as BL,dW as OL,dX as FL,B as ty,c3 as zL,a5 as UL,a7 as $L,dY as jL}from"./index-Dk8KEIKm.js";import{m as b0,t as yg,a as HL,b as VL,e as Rn,u as GL,G as WL,c as YL,E as qL}from"./max-zrNGYgli.js";import{u as XL,r as KL,f as v0,g as ZL,e as QL}from"./consumer-registry-CTHycSys.js";import{s as JL,M as DS,a as x0,b as iy}from"./variants-bcpM0cYI.js";import{G as Wp}from"./git-branch-Dye45Z4B.js";import{C as eR}from"./clock-BSYVhL7Q.js";import{N as tR,a as iR}from"./badge-colors-Dl76Mz8m.js";import{e as nR,f as w0,g as sR}from"./meshcore-tx-constants-DgpFTAmf.js";import{L as S0}from"./layers-g7u6rTYv.js";import{S as E0}from"./search-DgakOYk2.js";import{S as C0}from"./settings-2-CTbt3KT5.js";import{R as T0}from"./rotate-ccw-BQDcEa4l.js";import{C as Yp}from"./chevron-right-BugwEnle.js";import{T as rR}from"./target-Djl_t-RI.js";import{N as MS}from"./network-BgtOii-i.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)}}};$(C2,"defaultProps",{...yn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let VN=C2;function GN(i){return WN(i.source)||i.id||py(`unnamed ${i.stage}-shader`)}function WN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const k2=class A2 extends yn{constructor(e,t){super(e,t,A2.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"}};$(k2,"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=k2;const I2=class L2 extends yn{constructor(e,t){super(e,t,L2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(I2,"defaultProps",{...yn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let tx=I2;function YN(i){return ZN[i]}function qN(i){const[e,t]=KN[i],n=e==="i32"||e==="u32",s=e!=="u32",r=XN[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const XN={f32:4,f16:2,i32:4,u32:4},KN={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]},ZN={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 R2(i,e){const t={};for(const n of i.attributes){const s=QN(i,e,n.name);s&&(t[n.name]=s)}return t}function Pte(i,e,t=16){const n=R2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function QN(i,e,t){const n=JN(i,t),s=eD(e,t);if(!n)return null;const r=qN(n.type),o=yN(r),a=(s==null?void 0:s.vertexFormat)||o,l=gy(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 JN(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 eD(i,e){tD(i);let t=iD(i,e);return t||(t=nD(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function tD(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 iD(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 nD(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=gy(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 P2(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){aD(this.uniforms[e],t)||(this.uniforms[e]=lD(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 oD(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new cD({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 Bo;(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"})(Bo||(Bo={}));const uD={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:{}},dD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),hD=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)}}),fD=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 pD(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&&mD(s),s}return this.originalGetContext(t,n)}}function mD(i){i.getExtension("EXT_color_buffer_float");const e={...uD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:dD(i),OES_vertex_array_object:hD(i),ANGLE_instanced_arrays:fD(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 N2(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 gD=1;let fi=null,ix=!1;const yy={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function _D(i){if(!globalThis.SPECTOR)try{await N2(i.debugSpectorJSUrl||yy.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Mte(i){var e;if(i={...yy,...i},!i.debugSpectorJS)return null;if(!fi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(gD,"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(ix||(ix=!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 yD="https://unpkg.com/webgl-debug@2.0.1/index.js";function D2(i){return i.luma=i.luma||{},i.luma}async function bD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await N2(yD))}function Bte(i,e={}){return e.debugWebGL||e.traceWebGL?xD(i,e):vD(i)}function vD(i){const e=D2(i);return e.realContext?e.realContext:i}function xD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=D2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Bo,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,wD.bind(null,e),SD.bind(null,e));for(const o in Bo)!(o in n)&&typeof Bo[o]=="number"&&(n[o]=Bo[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 nx(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 wD(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 SD(i,e,t){let n="";le.level>=1&&(n=nx(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||nx(e,t);debugger}}const Sd=1;class ED extends DN{constructor(){super(),$(this,"type","webgl"),Cg.defaultProps={...Cg.defaultProps,...yy}}enforceWebGL2(e){pD(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-B873amTQ.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!CD(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-B873amTQ.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));le.groupCollapsed(Sd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(bD()),e.debugSpectorJS&&n.push(_D(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 CD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const TD=new ED,kD="#b3b3b3",AD=void 0,Ag=void 0,ID=1,LD=4,RD="#666666",PD=.1,ND=1,DD=1,M2="#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},MD=.7,BD=.95,OD=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:B2,setPrototypeOf:sx,isFrozen:FD,getPrototypeOf:zD,getOwnPropertyDescriptor:UD}=Object;let{freeze:fn,seal:gs,create:O2}=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),$D=pn(Array.prototype.lastIndexOf),rx=pn(Array.prototype.pop),cc=pn(Array.prototype.push),jD=pn(Array.prototype.splice),hh=pn(String.prototype.toLowerCase),nm=pn(String.prototype.toString),ox=pn(String.prototype.match),uc=pn(String.prototype.replace),HD=pn(String.prototype.indexOf),VD=pn(String.prototype.trim),Ms=pn(Object.prototype.hasOwnProperty),rn=pn(RegExp.prototype.test),dc=GD(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;sx&&sx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(FD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function WD(i){for(let e=0;e/gm),ZD=gs(/\$\{[\w\W]*/gm),QD=gs(/^data-[\-\w.\u00B7-\uFFFF]+$/),JD=gs(/^aria-[\-\w]+$/),F2=gs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eM=gs(/^(?:\w+script|data):/i),tM=gs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),z2=gs(/^html$/i),iM=gs(/^[a-z][.\w]*(-[.\w]+)+$/i);var dx=Object.freeze({__proto__:null,ARIA_ATTR:JD,ATTR_WHITESPACE:tM,CUSTOM_ELEMENT:iM,DATA_ATTR:QD,DOCTYPE_NAME:z2,ERB_EXPR:KD,IS_ALLOWED_URI:F2,IS_SCRIPT_OR_DATA:eM,MUSTACHE_EXPR:XD,TMPLIT_EXPR:ZD});const fc={element:1,text:3,progressingInstruction:7,comment:8,document:9},nM=function(){return typeof window>"u"?null:window},sM=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}},hx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function U2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nM();const e=L=>U2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==fc.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=hc(m,"cloneNode"),g=hc(m,"remove"),_=hc(m,"nextSibling"),S=hc(m,"childNodes"),E=hc(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:O,createDocumentFragment:H,getElementsByTagName:Q}=t,{importNode:re}=n;let D=hx();e.isSupported=typeof B2=="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}=dx;let{IS_ALLOWED_URI:ae}=dx,J=null;const Se=rt({},[...ax,...sm,...rm,...om,...lx]);let xe=null;const et=rt({},[...cx,...am,...ux,...Cd]);let he=Object.seal(O2(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,Bn=!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 On=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 Br=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(On),L.ADD_URI_SAFE_ATTR,Jt):On,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,Bn=L.IN_PLACE||!1,ae=L.ALLOWED_URI_REGEXP||F2,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({},lx),xe=[],di.html===!0&&(rt(J,ax),rt(xe,cx)),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,ux),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 dc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,T=x.createHTML("")}else x===void 0&&(x=sM(p,s)),x!==null&&typeof T=="string"&&(T=x.createHTML(""));fn&&fn(L),At=L}},er=rt({},[...sm,...rm,...YD]),Or=rt({},[...om,...qD]),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]:!!Or[C]:L.namespaceURI===Ti?V.namespaceURI===nn&&!ji[G]||V.namespaceURI===Es&&!Mr[G]?!1:!Or[C]&&(Br[C]||!er[C]):!!(Cs==="application/xhtml+xml"&&vn[L.namespaceURI]):!1},es=function(L){cc(e.removed,{element:L});try{E(L).removeChild(L)}catch{g(L)}},hi=function(L,V){try{cc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{cc(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=ox(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 O.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===fc.progressingInstruction||We&&L.nodeType===fc.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===fc.text&&(V=L.textContent,Ed([de,se,R],G=>{V=uc(V,G," ")}),L.textContent!==V&&(cc(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,uc(C,te,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&HD(C,"data:")===0&&Qn[L])&&!(Ce&&!rn(q,uc(C,te,"")))&&C)return!1}return!0},tr=function(L){return L!=="annotation-xml"&&ox(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:VD(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=uc(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):rx(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 dc("dirty is not a string, aborting")}else throw dc("toString is not a function");if(!e.isSupported)return L;if(bt||Ts(V),e.removed=[],typeof L=="string"&&(Bn=!1),Bn){if(L.nodeName){const Je=Jt(L.nodeName);if(!J[Je]||yt[Je])throw dc("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===fc.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(Bn?L:C);for(;ne=It.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&sn(ne.content);if(Bn)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(z2,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)}}};$(C2,"defaultProps",{...yn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let VN=C2;function GN(i){return WN(i.source)||i.id||py(`unnamed ${i.stage}-shader`)}function WN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const k2=class A2 extends yn{constructor(e,t){super(e,t,A2.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"}};$(k2,"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=k2;const I2=class L2 extends yn{constructor(e,t){super(e,t,L2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(I2,"defaultProps",{...yn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let tx=I2;function YN(i){return ZN[i]}function qN(i){const[e,t]=KN[i],n=e==="i32"||e==="u32",s=e!=="u32",r=XN[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const XN={f32:4,f16:2,i32:4,u32:4},KN={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]},ZN={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 R2(i,e){const t={};for(const n of i.attributes){const s=QN(i,e,n.name);s&&(t[n.name]=s)}return t}function Pte(i,e,t=16){const n=R2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function QN(i,e,t){const n=JN(i,t),s=eD(e,t);if(!n)return null;const r=qN(n.type),o=yN(r),a=(s==null?void 0:s.vertexFormat)||o,l=gy(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 JN(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 eD(i,e){tD(i);let t=iD(i,e);return t||(t=nD(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function tD(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 iD(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 nD(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=gy(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 P2(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){aD(this.uniforms[e],t)||(this.uniforms[e]=lD(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 oD(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new cD({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 Bo;(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"})(Bo||(Bo={}));const uD={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:{}},dD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),hD=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)}}),fD=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 pD(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&&mD(s),s}return this.originalGetContext(t,n)}}function mD(i){i.getExtension("EXT_color_buffer_float");const e={...uD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:dD(i),OES_vertex_array_object:hD(i),ANGLE_instanced_arrays:fD(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 N2(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 gD=1;let fi=null,ix=!1;const yy={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function _D(i){if(!globalThis.SPECTOR)try{await N2(i.debugSpectorJSUrl||yy.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Mte(i){var e;if(i={...yy,...i},!i.debugSpectorJS)return null;if(!fi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(gD,"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(ix||(ix=!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 yD="https://unpkg.com/webgl-debug@2.0.1/index.js";function D2(i){return i.luma=i.luma||{},i.luma}async function bD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await N2(yD))}function Bte(i,e={}){return e.debugWebGL||e.traceWebGL?xD(i,e):vD(i)}function vD(i){const e=D2(i);return e.realContext?e.realContext:i}function xD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=D2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Bo,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,wD.bind(null,e),SD.bind(null,e));for(const o in Bo)!(o in n)&&typeof Bo[o]=="number"&&(n[o]=Bo[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 nx(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 wD(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 SD(i,e,t){let n="";le.level>=1&&(n=nx(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||nx(e,t);debugger}}const Sd=1;class ED extends DN{constructor(){super(),$(this,"type","webgl"),Cg.defaultProps={...Cg.defaultProps,...yy}}enforceWebGL2(e){pD(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-D0NAnJg8.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!CD(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-D0NAnJg8.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));le.groupCollapsed(Sd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(bD()),e.debugSpectorJS&&n.push(_D(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 CD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const TD=new ED,kD="#b3b3b3",AD=void 0,Ag=void 0,ID=1,LD=4,RD="#666666",PD=.1,ND=1,DD=1,M2="#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},MD=.7,BD=.95,OD=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:B2,setPrototypeOf:sx,isFrozen:FD,getPrototypeOf:zD,getOwnPropertyDescriptor:UD}=Object;let{freeze:fn,seal:gs,create:O2}=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),$D=pn(Array.prototype.lastIndexOf),rx=pn(Array.prototype.pop),cc=pn(Array.prototype.push),jD=pn(Array.prototype.splice),hh=pn(String.prototype.toLowerCase),nm=pn(String.prototype.toString),ox=pn(String.prototype.match),uc=pn(String.prototype.replace),HD=pn(String.prototype.indexOf),VD=pn(String.prototype.trim),Ms=pn(Object.prototype.hasOwnProperty),rn=pn(RegExp.prototype.test),dc=GD(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;sx&&sx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(FD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function WD(i){for(let e=0;e/gm),ZD=gs(/\$\{[\w\W]*/gm),QD=gs(/^data-[\-\w.\u00B7-\uFFFF]+$/),JD=gs(/^aria-[\-\w]+$/),F2=gs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eM=gs(/^(?:\w+script|data):/i),tM=gs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),z2=gs(/^html$/i),iM=gs(/^[a-z][.\w]*(-[.\w]+)+$/i);var dx=Object.freeze({__proto__:null,ARIA_ATTR:JD,ATTR_WHITESPACE:tM,CUSTOM_ELEMENT:iM,DATA_ATTR:QD,DOCTYPE_NAME:z2,ERB_EXPR:KD,IS_ALLOWED_URI:F2,IS_SCRIPT_OR_DATA:eM,MUSTACHE_EXPR:XD,TMPLIT_EXPR:ZD});const fc={element:1,text:3,progressingInstruction:7,comment:8,document:9},nM=function(){return typeof window>"u"?null:window},sM=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}},hx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function U2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nM();const e=L=>U2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==fc.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=hc(m,"cloneNode"),g=hc(m,"remove"),_=hc(m,"nextSibling"),S=hc(m,"childNodes"),E=hc(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:O,createDocumentFragment:H,getElementsByTagName:Q}=t,{importNode:re}=n;let D=hx();e.isSupported=typeof B2=="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}=dx;let{IS_ALLOWED_URI:ae}=dx,J=null;const Se=rt({},[...ax,...sm,...rm,...om,...lx]);let xe=null;const et=rt({},[...cx,...am,...ux,...Cd]);let he=Object.seal(O2(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,Bn=!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 On=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 Br=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(On),L.ADD_URI_SAFE_ATTR,Jt):On,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,Bn=L.IN_PLACE||!1,ae=L.ALLOWED_URI_REGEXP||F2,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({},lx),xe=[],di.html===!0&&(rt(J,ax),rt(xe,cx)),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,ux),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 dc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,T=x.createHTML("")}else x===void 0&&(x=sM(p,s)),x!==null&&typeof T=="string"&&(T=x.createHTML(""));fn&&fn(L),At=L}},er=rt({},[...sm,...rm,...YD]),Or=rt({},[...om,...qD]),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]:!!Or[C]:L.namespaceURI===Ti?V.namespaceURI===nn&&!ji[G]||V.namespaceURI===Es&&!Mr[G]?!1:!Or[C]&&(Br[C]||!er[C]):!!(Cs==="application/xhtml+xml"&&vn[L.namespaceURI]):!1},es=function(L){cc(e.removed,{element:L});try{E(L).removeChild(L)}catch{g(L)}},hi=function(L,V){try{cc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{cc(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=ox(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 O.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===fc.progressingInstruction||We&&L.nodeType===fc.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===fc.text&&(V=L.textContent,Ed([de,se,R],G=>{V=uc(V,G," ")}),L.textContent!==V&&(cc(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,uc(C,te,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&HD(C,"data:")===0&&Qn[L])&&!(Ce&&!rn(q,uc(C,te,"")))&&C)return!1}return!0},tr=function(L){return L!=="annotation-xml"&&ox(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:VD(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=uc(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):rx(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 dc("dirty is not a string, aborting")}else throw dc("toString is not a function");if(!e.isSupported)return L;if(bt||Ts(V),e.removed=[],typeof L=="string"&&(Bn=!1),Bn){if(L.nodeName){const Je=Jt(L.nodeName);if(!J[Je]||yt[Je])throw dc("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===fc.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(Bn?L:C);for(;ne=It.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&sn(ne.content);if(Bn)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(z2,C.ownerDocument.doctype.name)&&(st=" `+st),X&&Ed([de,se,R],Je=>{st=uc(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"&&cc(D[L],V)},e.removeHook=function(L,V){if(V!==void 0){const C=$D(D[L],V);return C===-1?void 0:jD(D[L],C,1)[0]}return rx(D[L])},e.removeHooks=function(L){D[L]=[]},e.removeAllHooks=function(){D=hx()},e}var rM=U2();const oM=i=>typeof i=="function",$2=i=>Array.isArray(i),aM=i=>i instanceof Object,lM=i=>i instanceof Object?i.constructor.name!=="Function"&&i.constructor.name!=="Object":!1,fx=i=>aM(i)&&!$2(i)&&!oM(i)&&!lM(i);function Oo(i){let e;if($2(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 cM(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 uM(i,e,t){return Math.min(Math.max(i,e),t)}function ss(i){return i!=null&&!Number.isNaN(i)}function dM(i,e){return rM.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 hM{constructor(){this.enableSimulation=fe.enableSimulation,this.backgroundColor=M2,this.spaceSize=fe.spaceSize,this.pointColor=kD,this.pointDefaultColor=void 0,this.pointGreyoutOpacity=AD,this.pointGreyoutColor=Ag,this.pointSize=LD,this.pointDefaultSize=void 0,this.pointOpacity=ID,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=RD,this.linkDefaultColor=void 0,this.linkOpacity=ND,this.linkGreyoutOpacity=PD,this.linkWidth=DD,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){fx(e[n])&&fx(t[n])?Object.keys(t[n]).forEach(s=>{this.deepMergeConfig(e[n],t[n],s)}):e[n]=t[n]}getConfig(){return this}}function by(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 fM(i){const e={};for(const[t,n]of Object.entries(i))e[t]=pM(n);return e}function pM(i){let e=px(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=px(i.value),{...i,...lm[e],type:e}):{type:"object",value:null};throw new Error("props")}function px(i){return Array.isArray(i)||ArrayBuffer.isView(i)?"array":typeof i}const mM=`#ifdef MODULE_LOGDEPTH logdepth_adjustPosition(gl_Position); #endif diff --git a/frontend/dist/assets/Mqtt-T5trP6l_.js b/frontend/dist/assets/Mqtt-Bj_t7IzQ.js similarity index 98% rename from frontend/dist/assets/Mqtt-T5trP6l_.js rename to frontend/dist/assets/Mqtt-Bj_t7IzQ.js index 66d483bc..1d536f6a 100644 --- a/frontend/dist/assets/Mqtt-T5trP6l_.js +++ b/frontend/dist/assets/Mqtt-Bj_t7IzQ.js @@ -1,4 +1,4 @@ -import{e as we,fr as N,fs as Ke,r as d,j as e,I as K,B as te,c as C,f7 as Fe,f8 as ze,aB as be,f9 as Ve,ab as pe,$ as I,a4 as ne,bK as xe,ft as Se,d2 as ye,fu as Le,fv as me,bE as We,fw as $e,R as le,f as Pe,h as Ye,fx as O,fy as Ze,fz as Je,fA as Me,fB as Xe,fC as qe,fD as _e,a6 as Ae,ca as fe,fE as Qe,cM as ke,fF as et,bX as tt}from"./index-C8J8z7Af.js";import{C as Q,P as st,a as at,B as nt}from"./PageLayout-D_1HzH-E.js";import{L as Re,a as ge}from"./listbox-BOcIoorq.js";import{S as rt}from"./settings-2-BrtUmS4l.js";import{P as re}from"./plus-DWX8cdcI.js";import{M as lt}from"./map-pin-ufrVZcS3.js";import{C as ot}from"./check-check-BxJI0DsK.js";import{Z as se}from"./zap-8IJ4kWaK.js";import{S as Te}from"./search-BO7ZBfwt.js";import{C as de}from"./chevron-right-ZaDPsavE.js";import{H as it}from"./hash-8dFF62ov.js";import{u as ct,C as dt}from"./chevron-up-BhSn6i9S.js";import{F as ut}from"./funnel-CRYMLc9L.js";import{a as mt,C as ht}from"./circle-stop-Bv_ZsQj9.js";import{T as pt}from"./trash-2-MzXRdjh-.js";import{M as xt}from"./message-square-CZnvv13e.js";import{S as je}from"./satellite-oFalh_20.js";import{R as ue,C as Ne}from"./Grid-CfYPlwSW.js";import{W as ft}from"./wifi-5HVE8VPj.js";import{W as gt}from"./wifi-off-DYd4qfYe.js";import{C as Nt}from"./clock-CTBG2e06.js";import"./element-movement-DhaeUFJY.js";import"./floating-DcVaWvZe.js";import"./use-text-value-Bj-jCGjS.js";import"./frozen-BZ7OZfIg.js";/** +import{e as we,fr as N,fs as Ke,r as d,j as e,I as K,B as te,c as C,f7 as Fe,f8 as ze,aB as be,f9 as Ve,ab as pe,$ as I,a4 as ne,bK as xe,ft as Se,d2 as ye,fu as Le,fv as me,bE as We,fw as $e,R as le,f as Pe,h as Ye,fx as O,fy as Ze,fz as Je,fA as Me,fB as Xe,fC as qe,fD as _e,a6 as Ae,ca as fe,fE as Qe,cM as ke,fF as et,bX as tt}from"./index-Dk8KEIKm.js";import{C as Q,P as st,a as at,B as nt}from"./PageLayout-CGcnsIyM.js";import{L as Re,a as ge}from"./listbox-BpBYEakW.js";import{S as rt}from"./settings-2-CTbt3KT5.js";import{P as re}from"./plus-BQyrUsn7.js";import{M as lt}from"./map-pin-6ZLH5iNg.js";import{C as ot}from"./check-check-BfFB-ozy.js";import{Z as se}from"./zap-B0O7nHBO.js";import{S as Te}from"./search-DgakOYk2.js";import{C as de}from"./chevron-right-BugwEnle.js";import{H as it}from"./hash-BaVtxU1B.js";import{u as ct,C as dt}from"./chevron-up-DzJVNs-c.js";import{F as ut}from"./funnel-B-Z6Air3.js";import{a as mt,C as ht}from"./circle-stop-DA7KtBFF.js";import{T as pt}from"./trash-2-BNWAPzrN.js";import{M as xt}from"./message-square-KCaAXVVf.js";import{S as je}from"./satellite-COoSp6TF.js";import{R as ue,C as Ne}from"./Grid-CThL_TW5.js";import{W as ft}from"./wifi-BW0hMh8T.js";import{W as gt}from"./wifi-off-Dyij-7Es.js";import{C as Nt}from"./clock-BSYVhL7Q.js";import"./element-movement-CrHrmJVz.js";import"./floating-DAdA6y7o.js";import"./use-text-value-XAXtIZxt.js";import"./frozen-DqtxZ1v6.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MqttModeBadge-D5EDDcC2.js b/frontend/dist/assets/MqttModeBadge-CijH65Eh.js similarity index 92% rename from frontend/dist/assets/MqttModeBadge-D5EDDcC2.js rename to frontend/dist/assets/MqttModeBadge-CijH65Eh.js index 86d3110f..008b9e0a 100644 --- a/frontend/dist/assets/MqttModeBadge-D5EDDcC2.js +++ b/frontend/dist/assets/MqttModeBadge-CijH65Eh.js @@ -1 +1 @@ -import{r as d,d2 as x,u,j as t,c as o,$ as p,R as c}from"./index-C8J8z7Af.js";const j=d.memo(function({variant:l="inline",showChannel:r=!0,className:s}){const{active:m,iatas:e}=x(),a=u();if(!m)return null;const n=r&&e.length>0?e.length<=3?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`:null,i=n?`MQTT · ${n}`:"MQTT";return l==="pill"?t.jsx("span",{onClick:()=>a("/mqtt"),className:o("cursor-pointer",s),children:t.jsxs(p,{color:"cyan",children:[t.jsx(c,{className:"w-3 h-3 mr-1"}),i]})}):t.jsxs("span",{className:o("inline-flex items-center gap-1 text-sys-cyan type-data-xs cursor-pointer","hover:text-sys-cyan/80 transition-colors",s),onClick:()=>a("/mqtt"),title:"MQTT mode active — click to manage",children:[t.jsx(c,{className:"w-3 h-3"}),t.jsx("span",{className:"font-medium",children:i})]})});export{j as M}; +import{r as d,d2 as x,u,j as t,c as o,$ as p,R as c}from"./index-Dk8KEIKm.js";const j=d.memo(function({variant:l="inline",showChannel:r=!0,className:s}){const{active:m,iatas:e}=x(),a=u();if(!m)return null;const n=r&&e.length>0?e.length<=3?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`:null,i=n?`MQTT · ${n}`:"MQTT";return l==="pill"?t.jsx("span",{onClick:()=>a("/mqtt"),className:o("cursor-pointer",s),children:t.jsxs(p,{color:"cyan",children:[t.jsx(c,{className:"w-3 h-3 mr-1"}),i]})}):t.jsxs("span",{className:o("inline-flex items-center gap-1 text-sys-cyan type-data-xs cursor-pointer","hover:text-sys-cyan/80 transition-colors",s),onClick:()=>a("/mqtt"),title:"MQTT mode active — click to manage",children:[t.jsx(c,{className:"w-3 h-3"}),t.jsx("span",{className:"font-medium",children:i})]})});export{j as M}; diff --git a/frontend/dist/assets/Observer-jT6ZkA2J.js b/frontend/dist/assets/Observer-B3mst5X7.js similarity index 97% rename from frontend/dist/assets/Observer-jT6ZkA2J.js rename to frontend/dist/assets/Observer-B3mst5X7.js index dad9d35f..adbbfba4 100644 --- a/frontend/dist/assets/Observer-jT6ZkA2J.js +++ b/frontend/dist/assets/Observer-B3mst5X7.js @@ -1,4 +1,4 @@ -import{e as ae,aa as xe,r as i,j as e,ct as se,B as h,f as R,$ as x,dz as ne,c7 as he,bE as fe}from"./index-C8J8z7Af.js";import{P as je,a as ye,B as ge,C}from"./PageLayout-D_1HzH-E.js";import{g as we,a as _e,u as ve}from"./maintenance-C116ce5C.js";import{r as be}from"./system-CzT5Ikli.js";import{R as M,C as I}from"./Grid-CfYPlwSW.js";import{R as Ne}from"./rotate-cw-8-HjiytO.js";import{S as Se}from"./save-ChsI8Mf5.js";import{P as Ce}from"./plus-DWX8cdcI.js";import{T as Te}from"./trash-2-MzXRdjh-.js";/** +import{e as ae,aa as xe,r as i,j as e,ct as se,B as h,f as R,$ as x,dz as ne,c7 as he,bE as fe}from"./index-Dk8KEIKm.js";import{P as je,a as ye,B as ge,C}from"./PageLayout-CGcnsIyM.js";import{g as we,a as _e,u as ve}from"./maintenance-BwN0Nmu4.js";import{r as be}from"./system-CChwfvfT.js";import{R as M,C as I}from"./Grid-CThL_TW5.js";import{R as Ne}from"./rotate-cw-DeILC3U9.js";import{S as Se}from"./save-DrkPtb78.js";import{P as Ce}from"./plus-BQyrUsn7.js";import{T as Te}from"./trash-2-BNWAPzrN.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PacketList-qNmSxnCj.js b/frontend/dist/assets/PacketList-CmrEXwog.js similarity index 98% rename from frontend/dist/assets/PacketList-qNmSxnCj.js rename to frontend/dist/assets/PacketList-CmrEXwog.js index 0bc731de..57dde247 100644 --- a/frontend/dist/assets/PacketList-qNmSxnCj.js +++ b/frontend/dist/assets/PacketList-CmrEXwog.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-YblSn0Q9.js","assets/index-C8J8z7Af.js","assets/BasemapLayer-BvoQWTC4.js","assets/layer-DgtbTXVx.js","assets/car-KA4-aUWv.js","assets/useMapViewStore-CmYR40pV.js","assets/index-CSWZC0QG.js","assets/index-DAnUKwME.js","assets/index-CqhZhFJJ.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); -import{e as Be,bL as lt,bM as Bs,v as it,p as ct,j as e,c as F,B as rs,w as ot,r as u,a5 as ls,$ as B,aq as Se,bN as dt,bO as Ms,bP as Ls,bQ as Rs,R as me,bR as Hs,bS as Fs,bT as Ds,bU as xt,bV as pe,bW as Ze,bX as Je,_ as mt,bY as ht,bZ as ut,b_ as pt,b$ as ft,c0 as gt,c1 as yt,m as xe,c2 as oe,a7 as jt,a4 as bt,c3 as Z,c4 as Nt,c5 as de,c6 as vt,c7 as wt,c8 as us,c9 as kt,ca as Ct,cb as _t,cc as St,cd as Tt,ce as Pt,cf as Bt,cg as es,ch as Mt,ci as Lt,aa as As,cj as Rt,ck as Ht,cl as Ft,cm as Dt,ay as zs,az as Es,d as Ke,cn as At,aB as zt,co as Et,cp as is,cq as It}from"./index-C8J8z7Af.js";import{C as $t,u as Ut}from"./chevron-up-BhSn6i9S.js";import{p as Ot,e as Is,g as Vt,b as Gt}from"./primitives-CBHOCw6k.js";import{u as Qt,r as qt,a as Wt,b as Kt,c as Yt,d as Xt,i as Zt}from"./consumer-registry-BKgTBvt8.js";import{D as Me,R as Ie,P as Le,g as Jt}from"./badge-colors-Dl76Mz8m.js";import{g as $s,e as Te,a as Us}from"./chat-utils-C5p1i8vZ.js";import{S as $e,i as Ue,a as ea,g as ps}from"./SignalIndicator-CpPs32QG.js";import{A as sa}from"./arrow-up-CsqMGTbi.js";import{A as fe}from"./arrow-right-D_4v2CeG.js";import{A as Os}from"./arrow-down-Dqy7bDoY.js";import{C as cs}from"./chevron-right-ZaDPsavE.js";import{d as ta}from"./payload-detail-BWHpd-ZF.js";import{M as Oe}from"./map-pin-ufrVZcS3.js";import{C as aa}from"./circle-question-mark-CD6FHJ5H.js";import{L as na}from"./layers-Dy827Q5R.js";import{H as Vs}from"./hash-8dFF62ov.js";import{C as he}from"./clock-CTBG2e06.js";import{L as os,R as ra}from"./route-BEiTCi9B.js";import{A as la}from"./activity-Bh2DzqDM.js";import{H as ia,D as ss,u as ca}from"./useMapViewStore-CmYR40pV.js";import{S as ke}from"./shield-Gw0bk8jQ.js";import{C as Gs}from"./TimeRangeStepper-D6X8K2qC.js";import{Z as fs}from"./zap-8IJ4kWaK.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-DZCsJsTA.js","assets/index-Dk8KEIKm.js","assets/BasemapLayer-snfcoHal.js","assets/layer-CgHNe4F2.js","assets/car-BJCuYr8A.js","assets/useMapViewStore-CNJAZ76M.js","assets/index-M6ru5Gad.js","assets/index-DMeWa3DH.js","assets/index-CqhZhFJJ.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); +import{e as Be,bL as lt,bM as Bs,v as it,p as ct,j as e,c as F,B as rs,w as ot,r as u,a5 as ls,$ as B,aq as Se,bN as dt,bO as Ms,bP as Ls,bQ as Rs,R as me,bR as Hs,bS as Fs,bT as Ds,bU as xt,bV as pe,bW as Ze,bX as Je,_ as mt,bY as ht,bZ as ut,b_ as pt,b$ as ft,c0 as gt,c1 as yt,m as xe,c2 as oe,a7 as jt,a4 as bt,c3 as Z,c4 as Nt,c5 as de,c6 as vt,c7 as wt,c8 as us,c9 as kt,ca as Ct,cb as _t,cc as St,cd as Tt,ce as Pt,cf as Bt,cg as es,ch as Mt,ci as Lt,aa as As,cj as Rt,ck as Ht,cl as Ft,cm as Dt,ay as zs,az as Es,d as Ke,cn as At,aB as zt,co as Et,cp as is,cq as It}from"./index-Dk8KEIKm.js";import{C as $t,u as Ut}from"./chevron-up-DzJVNs-c.js";import{p as Ot,e as Is,g as Vt,b as Gt}from"./primitives-CrKVF5BS.js";import{u as Qt,r as qt,a as Wt,b as Kt,c as Yt,d as Xt,i as Zt}from"./consumer-registry-CTHycSys.js";import{D as Me,R as Ie,P as Le,g as Jt}from"./badge-colors-Dl76Mz8m.js";import{g as $s,e as Te,a as Us}from"./chat-utils-DAcFG23d.js";import{S as $e,i as Ue,a as ea,g as ps}from"./SignalIndicator-DJ2WGJCI.js";import{A as sa}from"./arrow-up-BhSGIVnk.js";import{A as fe}from"./arrow-right-vgcsVPr-.js";import{A as Os}from"./arrow-down-B85BrN7t.js";import{C as cs}from"./chevron-right-BugwEnle.js";import{d as ta}from"./payload-detail-BR_z6q5h.js";import{M as Oe}from"./map-pin-6ZLH5iNg.js";import{C as aa}from"./circle-question-mark-BNRkoCvq.js";import{L as na}from"./layers-g7u6rTYv.js";import{H as Vs}from"./hash-BaVtxU1B.js";import{C as he}from"./clock-BSYVhL7Q.js";import{L as os,R as ra}from"./route-CxDUYLxS.js";import{A as la}from"./activity-D99FIjaW.js";import{H as ia,D as ss,u as ca}from"./useMapViewStore-CNJAZ76M.js";import{S as ke}from"./shield-61UHbj0K.js";import{C as Gs}from"./TimeRangeStepper-CNBzSSfG.js";import{Z as fs}from"./zap-B0O7nHBO.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -29,7 +29,7 @@ import{e as Be,bL as lt,bM as Bs,v as it,p as ct,j as e,c as F,B as rs,w as ot,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fa=[["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"}]],Ce=Be("user",fa);function ga(s){s.values.forEach(a=>a.stop())}function ts(s,a){[...a].reverse().forEach(n=>{const l=s.getVariant(n);l&&Bs(s,l),s.variantChildren&&s.variantChildren.forEach(i=>{ts(i,a)})})}function ya(s,a){if(Array.isArray(a))return ts(s,a);if(typeof a=="string")return ts(s,[a]);Bs(s,a)}function ja(){const s=new Set,a={subscribe(t){return s.add(t),()=>void s.delete(t)},start(t,n){const l=[];return s.forEach(i=>{l.push(lt(i,t,{transitionOverride:n}))}),Promise.all(l)},set(t){return s.forEach(n=>{ya(n,t)})},stop(){s.forEach(t=>{ga(t)})},mount(){return()=>{a.stop()}}};return a}function ba(){const s=it(ja);return ct(s.mount,[]),s}function Na({"aria-label":s="Page navigation",className:a,...t}){return e.jsx("nav",{"aria-label":s,...t,className:F("flex gap-x-2",a)})}function va({onClick:s,disabled:a=!1,className:t,children:n="Previous"}){return e.jsx("span",{className:F("grow basis-0",t),children:e.jsxs(rs,{plain:!0,onClick:s,disabled:a,"aria-label":"Previous page",className:F("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 wa({onClick:s,disabled:a=!1,className:t,children:n="Next"}){return e.jsx("span",{className:F("flex grow basis-0 justify-end",t),children:e.jsxs(rs,{plain:!0,onClick:s,disabled:a,"aria-label":"Next page",className:F("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 ka({className:s,...a}){return e.jsx("span",{...a,className:F("hidden items-baseline gap-x-2 sm:flex",s)})}function Ca({page:s,current:a=!1,onClick:t,className:n,children:l}){return e.jsx(rs,{plain:!a,outline:a,onClick:()=>t==null?void 0:t(s),"aria-label":`Page ${s}`,"aria-current":a?"page":void 0,className:F("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:l??s})}function _a({className:s,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:F("w-[2.25rem] select-none text-center text-sm text-fg-muted",s),children:"…"})}function Sa(s,a,t=1){if(a<=7)return Array.from({length:a},(x,g)=>g+1);const n=Math.max(s-t,1),l=Math.min(s+t,a),i=n>2,r=lf+1),"gap",a]}if(i&&!r){const x=3+2*t;return[1,"gap",...Array.from({length:x},(h,f)=>a-x+f+1)]}return[1,"gap",...Array.from({length:l-n+1},(x,g)=>n+g),"gap",a]}const fr=ot(s=>({requestedHash:null,requestChannel:a=>s({requestedHash:a}),clearRequest:()=>s({requestedHash:null})}));function Ta(s){if(s.length===0)return[];const a=[];let t=0;for(;t{const r=i===s.length-1,c=n!==null&&dt(l.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:l.toUpperCase()}),!r&&e.jsx(cs,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${l}-${i}`)})})}const Ws=u.memo(Ra);function Ks({channelName:s,onClick:a,active:t,compact:n,className:l}){const i=s.startsWith("#")?s:`#${s}`,r=F("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",l);return a?e.jsx("button",{type:"button",onClick:a,className:r,children:i}):e.jsx("span",{className:r,children:i})}function Ys({packet:s}){return s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("teal"),children:"HTTP"}):s._mqttSource&&!s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("purple"),children:"MQTT"}):null}function je(s){return{"--data-box-accent":pe[s]}}function Xs(s){const a=s.payload_type_name||Fs(s.payload_type??s.type),t=s.route_type_name||Ds(s.route_type??s.route),n=Le[a]??"zinc",l=Ie[t]??"zinc";return{payloadType:a,routeType:t,payloadColor:n,routeColor:l}}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 Zs(s,a){if(a){const t=a(s);return{name:t.name,hash:t.hash,isCompanion:t.isCompanion,isRepeater:t.isRepeater}}return{name:null,hash:null,isCompanion:!1,isRepeater:!1}}function Js(s,a,t,n){const l=a||s.src_hash_full||s.src_hash;if(!l)return null;const i=s.path_hash_size===1||s.path_hash_size===2||s.path_hash_size===3?s.path_hash_size:null,r=n.length>0?xt(n[0]):null;return Se(l,i??r??t)}function Ha({packet:s,onClick:a,localHash:t,pathHashSize:n=1,neighbors:l,resolveSource:i,isFlashing:r=!1,isTraceHighlighted:c,onTraceHover:x,traceTag:g,onViewTraceReport:h,dupeGroupPosition:f,isDupeGroupHovered:C=!1,onDupeGroupHover:b,dupeCount:o,getDecodedContent:_,onChannelClick:P}){const d=o?!1:Ms(s.is_duplicate),w=f!==void 0,{payloadType:m,routeType:v,payloadColor:N,routeColor:y}=Xs(s),I=s.packet_origin==="tx_local",A=m==="TRACE",V=Ve(s.original_path),W=Ve(s.forwarded_path),G=W.length>0?W:V,{name:Y,hash:D,isRepeater:J}=Zs(s,i),L=Js(s,D,n,G);let X=null,U=null,ne=null,T=null;if(m==="GRP_TXT"&&_){const $=_(s);$!=null&&$.decrypted&&(U=$.senderName,ne=$.channelName,T=$.channelHash,$.text&&(X=$.text))}else if(m==="TXT_MSG"&&s.raw_packet)try{const $=Ls.fromHex(s.raw_packet);if($.success&&$.packet){const ie=Rs($.packet.payload);ie&&!ie.encrypted&&(X=ie.text)}}catch{}const z=U||(J?null:Y),ee=!!z,M=!ee&&J&&!!Y,p=!ee&&!M&&m==="GRP_TXT"&&!X,ae=s.payload_length??s.length??0;s.lbt_attempts;const se=u.useCallback(()=>{A&&g&&h?h(g):a(s)},[A,g,h,a,s]),le=u.useCallback(()=>{A&&g&&x&&x(g),w&&b&&s.packet_hash&&b(s.packet_hash)},[A,g,x,w,b,s.packet_hash]),te=u.useCallback(()=>{x&&x(null),b&&b(null)},[x,b]),S=pe[N]||pe.zinc,K=C,R=()=>{const $={pointerEvents:"none"};return f==="first"?{...$,borderTop:`2px solid ${S}`,borderLeft:`2px solid ${S}`,borderRight:`2px solid ${S}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:f==="middle"?{...$,borderTop:"none",borderLeft:`2px solid ${S}`,borderRight:`2px solid ${S}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:f==="last"?{...$,borderTop:"none",borderLeft:`2px solid ${S}`,borderRight:`2px solid ${S}`,borderBottom:`2px solid ${S}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...$,border:`2px solid ${S}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:se,onMouseEnter:le,onMouseLeave:te,className:F("group relative cursor-pointer","hover:bg-subtle-fill",d&&!C&&"opacity-40",r&&"flash-row",I&&"bg-sys-indigo/5",c&&"bg-sys-teal/10"),children:[e.jsx("div",{className:F("absolute pointer-events-none transition-opacity duration-75",w?K?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:R()}),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:ee?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:$s(Te(z).cleanName)},children:Te(z).emoji?e.jsx("span",{className:"text-base leading-none",children:Te(z).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:Us(z)})}):M?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(me,{className:"size-5 text-sys-blue"})}):p?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(Qs,{className:"size-4 text-fg-muted"})}):e.jsx(qs,{packet:s,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:ee?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:z}),L&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:L})]}):M?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:Y}),L&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:L})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:L||"—"}),Y&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate max-w-[70px]",children:Y})]})})]}),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:je(N),children:m}),I&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("indigo"),children:"LOCAL"}),e.jsx(Ys,{packet:s}),o&&o>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",o]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je(y),children:v}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[ae,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:X||ne?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[ne&&e.jsx(Ks,{channelName:ne,compact:!0,onClick:P&&T?$=>{$.stopPropagation(),P(T)}:void 0}),X&&e.jsx("span",{className:"italic truncate",children:X})]}):e.jsx(Ws,{path:G,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:Hs(s.timestamp)}),e.jsx($e,{rssi:s.rssi,snr:s.snr,compact:!0,showValues:!0,validated:Ue(s)})]})]})]})}function Fa({packet:s,onClick:a,localHash:t,pathHashSize:n=1,neighbors:l,resolveSource:i,isFlashing:r=!1,isTraceHighlighted:c,traceTag:x,onViewTraceReport:g,dupeGroupPosition:h,isDupeGroupHovered:f=!1,onDupeGroupHover:C,dupeCount:b,getDecodedContent:o,onChannelClick:_}){const{payloadType:P,routeType:d,payloadColor:w,routeColor:m}=Xs(s),v=s.packet_origin==="tx_local",N=P==="TRACE",y=b?!1:Ms(s.is_duplicate),I=Ve(s.original_path),A=Ve(s.forwarded_path),V=A.length>0?A:I,W=s._hopCount??V.length,{name:G,hash:Y,isRepeater:D}=Zs(s,i),J=Js(s,Y,n,V);let L=null,X=null,U=null,ne=null;if(P==="GRP_TXT"&&o){const S=o(s);S!=null&&S.decrypted&&(X=S.senderName,U=S.channelName,ne=S.channelHash,S.text&&(L=S.text))}else if(P==="TXT_MSG"&&s.raw_packet)try{const S=Ls.fromHex(s.raw_packet);if(S.success&&S.packet){const K=Rs(S.packet.payload);K&&!K.encrypted&&(L=K.text)}}catch{}const T=X||(D?null:G),z=!!T,ee=!z&&D&&!!G,M=!z&&!ee&&P==="GRP_TXT"&&!L,p=s.payload_length??s.length??0,ae=s.lbt_attempts??0,se=()=>{N&&x&&g?g(x):a(s)},le=pe[w]||pe.zinc,te=()=>{if(!h)return{opacity:0};const S=f?1:.4,K=f?"3px":"2px";return h==="first"?{backgroundColor:le,opacity:S,width:K,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:h==="middle"?{backgroundColor:le,opacity:S,width:K,top:0,bottom:0,borderRadius:0}:h==="last"?{backgroundColor:le,opacity:S,width:K,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:le,opacity:S,width:K,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:se,className:F("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",y&&"opacity-40",r&&"flash-row",v&&"bg-sys-indigo/5",c&&"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:z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:$s(Te(T).cleanName)},children:Te(T).emoji?e.jsx("span",{className:"text-base leading-none",children:Te(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:Us(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(me,{className:"size-5 text-sys-blue"})}):M?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(Qs,{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:[z?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:T}):ee?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:G}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:J||"—"}),G&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:G})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je(w),children:P}),v&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("indigo"),children:"LOCAL"}),e.jsx(Ys,{packet:s}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je(m),children:d}),b&&b>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",b]}),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:Hs(s.timestamp)}),p>0&&e.jsxs("span",{children:[p,"B"]}),ae>0&&e.jsxs("span",{className:ae>1?"text-sys-amber/60":void 0,children:["LBT:",ae]}),s.snr!=null&&e.jsxs("span",{children:[s.snr.toFixed(0),"dB"]}),L||U?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[U&&e.jsx(Ks,{channelName:U,compact:!0,onClick:_&&ne?S=>{S.stopPropagation(),_(ne)}:void 0}),L&&e.jsx("span",{className:"italic truncate",children:L})]}):W>0?e.jsx(Ws,{path:V,localHash:t}):null]})]})]})]})}const Da=u.memo(Ha),Aa=u.memo(Fa);function za(s,a,t,n,l=!1){const i=s.toUpperCase(),r=[],c=t&&Ze(i,t);c&&r.push(t);for(const b of Object.keys(a))Ze(i,b)&&r.push(b);if(l&&c&&t&&r.length===1)return{matches:r,probability:1,bestMatch:t};if(l&&c&&r.length>1){const b=r.filter(o=>o!==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 h=null,f=-1;if(g.length===1)h=g[0];else if(g.length>1&&n){for(const b of g){const o=n.get(b),_=o?typeof o=="number"?o:o.combinedScore:0;_>f&&(f=_,h=b)}h||(h=g[0])}else g.length>0&&(h=g[0]);let C=x;if(r.length>1&&n&&f>0){let b=0;for(const o of r){const _=n.get(o);b+=_?typeof _=="number"?_:_.combinedScore:0}b>0&&(C=Math.min(.95,f/b))}return{matches:r,probability:C,bestMatch:h}}function Ea(s,a,t,n){const i=(t-s)*Math.PI/180,r=(n-a)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/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 Ia(s){return s<100?1:s<500?.9:s<1e3?.7:s<5e3?.5:s<1e4?.3:.1}const $a=u.lazy(()=>mt(()=>import("./PathMapMapLibre-YblSn0Q9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])));function Ua(s,a,t,n,l=!1,i,r,c){const x=ht(a);let g;r&&(g=ut(r,s,{position:c,isLastHop:l}).confidence);const{matches:h,probability:f}=za(s,x,n,i,l),C=h.length,b=[],o=s.toUpperCase(),_=t&&t.latitude!==void 0&&t.longitude!==void 0&&(t.latitude!==0||t.longitude!==0);for(const d of h){if(n&&Ze(o,n)&&d===n&&_&&t){b.push({hash:d,name:t.name||"Local Node",latitude:t.latitude,longitude:t.longitude,probability:l?1:f,isLocal:!0});continue}const w=x[d];w!=null&&w.latitude&&(w!=null&&w.longitude)&&!(w.latitude===0&&w.longitude===0)&&b.push({hash:d,name:w.node_name||w.name||"Unknown",latitude:w.latitude,longitude:w.longitude,probability:f,isLocal:!1,isDirectNeighbor:w.zero_hop===!0})}const P=b.length;if(P===1)b[0].probability=g??1;else if(P>1)if(g!==void 0&&g>0){const d=b[0];d.probability=g;const w=1-g,m=P-1;b.slice(1).forEach(v=>{v.probability=w/m})}else{let d=0;const w=b.map(m=>{if(m.isLocal)return{candidate:m,score:1};const v=i==null?void 0:i.get(m.hash);let N=.5;if(_&&t){const I=Ea(t.latitude,t.longitude,m.latitude,m.longitude);N=Ia(I)}let y;return v?y=N*.3+v.hopConsistencyScore*.3+v.frequencyScore*.4:(y=N,m.isDirectNeighbor&&(y=Math.max(y,.8))),d+=y,{candidate:m,score:y}});if(d>0)w.forEach(({candidate:m,score:v})=>{m.probability=Math.min(.95,v/d)});else{const m=1/P;b.forEach(v=>v.probability=m)}}return{candidates:b,totalMatches:C}}function Oa(s,a,t,n,l,i){if(!s||s.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const r=s.length-1,c=s.map((h,f)=>{const C=f===r,b=s.length-f,{candidates:o,totalMatches:_}=Ua(h,a,t,n,C,l,i,b),P=o.length>0?Math.max(...o.map(d=>d.probability)):0;return{prefix:h,candidates:o,confidence:P,totalMatches:_}}),x=c.reduce((h,f)=>f.confidence===0?0:h*f.confidence,1),g=c.some(h=>h.candidates.length>0);return{hops:c,overallConfidence:x,hasValidPath:g}}function Va(s){return`${(s*100).toFixed(0)}%`}function Ga(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 Qa(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 qa extends u.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(Je,{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:l,dstHash:i,neighborAffinity:r,prefixLookup:c,hubNodes:x,traceSnr:g,advertiserSource:h}){const[f,C]=u.useState(null),b=u.useMemo(()=>{if(!h)return null;const m=h.nodeType==="wardrive";return{prefix:h.prefix||"??",candidates:[{hash:h.publicKey||h.prefix||"source",name:h.name,latitude:h.latitude,longitude:h.longitude,probability:1,isLocal:!1,isWardrive:m}],confidence:1,totalMatches:1,isSource:!0}},[h]),o=u.useMemo(()=>{if(h||!l)return null;const m=Se(l),v=a[l];if((v==null?void 0:v.latitude)&&(v==null?void 0:v.longitude)&&!(v.latitude===0&&v.longitude===0))return{prefix:m,candidates:[{hash:l,name:v.node_name||v.name||"Source",latitude:v.latitude,longitude:v.longitude,probability:1,isLocal:!1,isDirectNeighbor:v.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const y=(v==null?void 0:v.node_name)||(v==null?void 0:v.name)||l.slice(0,8);return{prefix:m,candidates:[{hash:l,name:y,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[h,l,a]),_=u.useMemo(()=>{const m=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!m||m==="00"||m==="0000000000000000")&&t&&n){const V=Se(n),W=t.latitude!==0||t.longitude!==0;return{prefix:V,candidates:[{hash:n,name:t.name||"Local Node",latitude:W?t.latitude:0,longitude:W?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const N=Se(i);if(n&&i===n&&t){const V=t.latitude!==0||t.longitude!==0;return{prefix:N,candidates:[{hash:i,name:t.name||"Local Node",latitude:V?t.latitude:0,longitude:V?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const y=a[i];if((y==null?void 0:y.latitude)&&(y==null?void 0:y.longitude)&&!(y.latitude===0&&y.longitude===0))return{prefix:N,candidates:[{hash:i,name:y.node_name||y.name||"Destination",latitude:y.latitude,longitude:y.longitude,probability:1,isLocal:!1,isDirectNeighbor:y.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const A=(y==null?void 0:y.node_name)||(y==null?void 0:y.name)||i.slice(0,8);return{prefix:N,candidates:[{hash:i,name:A,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,a,t,n]),P=u.useMemo(()=>Oa(s,a,t,n,r,c),[s,a,t,n,r,c]),d=u.useMemo(()=>{const m=[];b?m.push(b):o&&m.push(o),m.push(...P.hops),_&&m.push(_);const v=m.reduce((y,I)=>I.confidence===0?0:y*I.confidence,1),N=m.some(y=>y.candidates.some(I=>I.latitude!==0||I.longitude!==0));return{hops:m,overallConfidence:v,hasValidPath:N}},[b,o,P,_]),w=u.useMemo(()=>{const m=getComputedStyle(document.documentElement);return{success:m.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:m.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:m.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:m.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:m.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return d.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:Ga(d.overallConfidence),children:Va(d.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(aa,{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(qa,{children:e.jsx(u.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($a,{resolvedPath:d,localNode:t,hubNodes:x,hoveredHopIndex:f,onHoverHop:C,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:d.hops.map((m,v)=>{var V,W,G;const N=m.isSource===!0,y=m.isDestination===!0,I=f===v;let A;return N?A=`Source: ${((V=m.candidates[0])==null?void 0:V.name)||"Unknown"}`:y?A=`Destination: ${((W=m.candidates[0])==null?void 0:W.name)||"Unknown"}`:m.totalMatches===0?A="No matching nodes found":m.totalMatches===1?A=`Exact match: ${((G=m.candidates[0])==null?void 0:G.name)||"Unknown"}`:A=`${m.totalMatches} possible matches (${(m.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:F("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",N&&"border border-sys-green/30",y&&"border border-sys-blue/30"),title:A,onMouseEnter:()=>C(v),onMouseLeave:()=>C(null),children:[N&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),y&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:Qa(m.confidence,m.totalMatches,w),children:m.prefix}),!N&&!y&&m.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",m.totalMatches]}),!N&&!y&&m.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},v)})})]}):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 Ye=16;function Qe(s){return s.match(/.{1,2}/g)||[]}function be(s){return s!==null&&s.startsWith("payload:")}const Pe={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` + */const fa=[["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"}]],Ce=Be("user",fa);function ga(s){s.values.forEach(a=>a.stop())}function ts(s,a){[...a].reverse().forEach(n=>{const l=s.getVariant(n);l&&Bs(s,l),s.variantChildren&&s.variantChildren.forEach(i=>{ts(i,a)})})}function ya(s,a){if(Array.isArray(a))return ts(s,a);if(typeof a=="string")return ts(s,[a]);Bs(s,a)}function ja(){const s=new Set,a={subscribe(t){return s.add(t),()=>void s.delete(t)},start(t,n){const l=[];return s.forEach(i=>{l.push(lt(i,t,{transitionOverride:n}))}),Promise.all(l)},set(t){return s.forEach(n=>{ya(n,t)})},stop(){s.forEach(t=>{ga(t)})},mount(){return()=>{a.stop()}}};return a}function ba(){const s=it(ja);return ct(s.mount,[]),s}function Na({"aria-label":s="Page navigation",className:a,...t}){return e.jsx("nav",{"aria-label":s,...t,className:F("flex gap-x-2",a)})}function va({onClick:s,disabled:a=!1,className:t,children:n="Previous"}){return e.jsx("span",{className:F("grow basis-0",t),children:e.jsxs(rs,{plain:!0,onClick:s,disabled:a,"aria-label":"Previous page",className:F("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 wa({onClick:s,disabled:a=!1,className:t,children:n="Next"}){return e.jsx("span",{className:F("flex grow basis-0 justify-end",t),children:e.jsxs(rs,{plain:!0,onClick:s,disabled:a,"aria-label":"Next page",className:F("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 ka({className:s,...a}){return e.jsx("span",{...a,className:F("hidden items-baseline gap-x-2 sm:flex",s)})}function Ca({page:s,current:a=!1,onClick:t,className:n,children:l}){return e.jsx(rs,{plain:!a,outline:a,onClick:()=>t==null?void 0:t(s),"aria-label":`Page ${s}`,"aria-current":a?"page":void 0,className:F("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:l??s})}function _a({className:s,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:F("w-[2.25rem] select-none text-center text-sm text-fg-muted",s),children:"…"})}function Sa(s,a,t=1){if(a<=7)return Array.from({length:a},(x,g)=>g+1);const n=Math.max(s-t,1),l=Math.min(s+t,a),i=n>2,r=lf+1),"gap",a]}if(i&&!r){const x=3+2*t;return[1,"gap",...Array.from({length:x},(h,f)=>a-x+f+1)]}return[1,"gap",...Array.from({length:l-n+1},(x,g)=>n+g),"gap",a]}const fr=ot(s=>({requestedHash:null,requestChannel:a=>s({requestedHash:a}),clearRequest:()=>s({requestedHash:null})}));function Ta(s){if(s.length===0)return[];const a=[];let t=0;for(;t{const r=i===s.length-1,c=n!==null&&dt(l.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:l.toUpperCase()}),!r&&e.jsx(cs,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${l}-${i}`)})})}const Ws=u.memo(Ra);function Ks({channelName:s,onClick:a,active:t,compact:n,className:l}){const i=s.startsWith("#")?s:`#${s}`,r=F("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",l);return a?e.jsx("button",{type:"button",onClick:a,className:r,children:i}):e.jsx("span",{className:r,children:i})}function Ys({packet:s}){return s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("teal"),children:"HTTP"}):s._mqttSource&&!s._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("purple"),children:"MQTT"}):null}function je(s){return{"--data-box-accent":pe[s]}}function Xs(s){const a=s.payload_type_name||Fs(s.payload_type??s.type),t=s.route_type_name||Ds(s.route_type??s.route),n=Le[a]??"zinc",l=Ie[t]??"zinc";return{payloadType:a,routeType:t,payloadColor:n,routeColor:l}}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 Zs(s,a){if(a){const t=a(s);return{name:t.name,hash:t.hash,isCompanion:t.isCompanion,isRepeater:t.isRepeater}}return{name:null,hash:null,isCompanion:!1,isRepeater:!1}}function Js(s,a,t,n){const l=a||s.src_hash_full||s.src_hash;if(!l)return null;const i=s.path_hash_size===1||s.path_hash_size===2||s.path_hash_size===3?s.path_hash_size:null,r=n.length>0?xt(n[0]):null;return Se(l,i??r??t)}function Ha({packet:s,onClick:a,localHash:t,pathHashSize:n=1,neighbors:l,resolveSource:i,isFlashing:r=!1,isTraceHighlighted:c,onTraceHover:x,traceTag:g,onViewTraceReport:h,dupeGroupPosition:f,isDupeGroupHovered:C=!1,onDupeGroupHover:b,dupeCount:o,getDecodedContent:_,onChannelClick:P}){const d=o?!1:Ms(s.is_duplicate),w=f!==void 0,{payloadType:m,routeType:v,payloadColor:N,routeColor:y}=Xs(s),I=s.packet_origin==="tx_local",A=m==="TRACE",V=Ve(s.original_path),W=Ve(s.forwarded_path),G=W.length>0?W:V,{name:Y,hash:D,isRepeater:J}=Zs(s,i),L=Js(s,D,n,G);let X=null,U=null,ne=null,T=null;if(m==="GRP_TXT"&&_){const $=_(s);$!=null&&$.decrypted&&(U=$.senderName,ne=$.channelName,T=$.channelHash,$.text&&(X=$.text))}else if(m==="TXT_MSG"&&s.raw_packet)try{const $=Ls.fromHex(s.raw_packet);if($.success&&$.packet){const ie=Rs($.packet.payload);ie&&!ie.encrypted&&(X=ie.text)}}catch{}const z=U||(J?null:Y),ee=!!z,M=!ee&&J&&!!Y,p=!ee&&!M&&m==="GRP_TXT"&&!X,ae=s.payload_length??s.length??0;s.lbt_attempts;const se=u.useCallback(()=>{A&&g&&h?h(g):a(s)},[A,g,h,a,s]),le=u.useCallback(()=>{A&&g&&x&&x(g),w&&b&&s.packet_hash&&b(s.packet_hash)},[A,g,x,w,b,s.packet_hash]),te=u.useCallback(()=>{x&&x(null),b&&b(null)},[x,b]),S=pe[N]||pe.zinc,K=C,R=()=>{const $={pointerEvents:"none"};return f==="first"?{...$,borderTop:`2px solid ${S}`,borderLeft:`2px solid ${S}`,borderRight:`2px solid ${S}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:f==="middle"?{...$,borderTop:"none",borderLeft:`2px solid ${S}`,borderRight:`2px solid ${S}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:f==="last"?{...$,borderTop:"none",borderLeft:`2px solid ${S}`,borderRight:`2px solid ${S}`,borderBottom:`2px solid ${S}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...$,border:`2px solid ${S}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:se,onMouseEnter:le,onMouseLeave:te,className:F("group relative cursor-pointer","hover:bg-subtle-fill",d&&!C&&"opacity-40",r&&"flash-row",I&&"bg-sys-indigo/5",c&&"bg-sys-teal/10"),children:[e.jsx("div",{className:F("absolute pointer-events-none transition-opacity duration-75",w?K?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:R()}),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:ee?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:$s(Te(z).cleanName)},children:Te(z).emoji?e.jsx("span",{className:"text-base leading-none",children:Te(z).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:Us(z)})}):M?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(me,{className:"size-5 text-sys-blue"})}):p?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(Qs,{className:"size-4 text-fg-muted"})}):e.jsx(qs,{packet:s,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:ee?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:z}),L&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:L})]}):M?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:Y}),L&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:L})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:L||"—"}),Y&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate max-w-[70px]",children:Y})]})})]}),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:je(N),children:m}),I&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("indigo"),children:"LOCAL"}),e.jsx(Ys,{packet:s}),o&&o>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",o]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je(y),children:v}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[ae,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:X||ne?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[ne&&e.jsx(Ks,{channelName:ne,compact:!0,onClick:P&&T?$=>{$.stopPropagation(),P(T)}:void 0}),X&&e.jsx("span",{className:"italic truncate",children:X})]}):e.jsx(Ws,{path:G,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:Hs(s.timestamp)}),e.jsx($e,{rssi:s.rssi,snr:s.snr,compact:!0,showValues:!0,validated:Ue(s)})]})]})]})}function Fa({packet:s,onClick:a,localHash:t,pathHashSize:n=1,neighbors:l,resolveSource:i,isFlashing:r=!1,isTraceHighlighted:c,traceTag:x,onViewTraceReport:g,dupeGroupPosition:h,isDupeGroupHovered:f=!1,onDupeGroupHover:C,dupeCount:b,getDecodedContent:o,onChannelClick:_}){const{payloadType:P,routeType:d,payloadColor:w,routeColor:m}=Xs(s),v=s.packet_origin==="tx_local",N=P==="TRACE",y=b?!1:Ms(s.is_duplicate),I=Ve(s.original_path),A=Ve(s.forwarded_path),V=A.length>0?A:I,W=s._hopCount??V.length,{name:G,hash:Y,isRepeater:D}=Zs(s,i),J=Js(s,Y,n,V);let L=null,X=null,U=null,ne=null;if(P==="GRP_TXT"&&o){const S=o(s);S!=null&&S.decrypted&&(X=S.senderName,U=S.channelName,ne=S.channelHash,S.text&&(L=S.text))}else if(P==="TXT_MSG"&&s.raw_packet)try{const S=Ls.fromHex(s.raw_packet);if(S.success&&S.packet){const K=Rs(S.packet.payload);K&&!K.encrypted&&(L=K.text)}}catch{}const T=X||(D?null:G),z=!!T,ee=!z&&D&&!!G,M=!z&&!ee&&P==="GRP_TXT"&&!L,p=s.payload_length??s.length??0,ae=s.lbt_attempts??0,se=()=>{N&&x&&g?g(x):a(s)},le=pe[w]||pe.zinc,te=()=>{if(!h)return{opacity:0};const S=f?1:.4,K=f?"3px":"2px";return h==="first"?{backgroundColor:le,opacity:S,width:K,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:h==="middle"?{backgroundColor:le,opacity:S,width:K,top:0,bottom:0,borderRadius:0}:h==="last"?{backgroundColor:le,opacity:S,width:K,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:le,opacity:S,width:K,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:se,className:F("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",y&&"opacity-40",r&&"flash-row",v&&"bg-sys-indigo/5",c&&"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:z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:$s(Te(T).cleanName)},children:Te(T).emoji?e.jsx("span",{className:"text-base leading-none",children:Te(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:Us(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(me,{className:"size-5 text-sys-blue"})}):M?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(Qs,{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:[z?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:T}):ee?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:G}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:J||"—"}),G&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:G})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je(w),children:P}),v&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je("indigo"),children:"LOCAL"}),e.jsx(Ys,{packet:s}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:je(m),children:d}),b&&b>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",b]}),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:Hs(s.timestamp)}),p>0&&e.jsxs("span",{children:[p,"B"]}),ae>0&&e.jsxs("span",{className:ae>1?"text-sys-amber/60":void 0,children:["LBT:",ae]}),s.snr!=null&&e.jsxs("span",{children:[s.snr.toFixed(0),"dB"]}),L||U?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[U&&e.jsx(Ks,{channelName:U,compact:!0,onClick:_&&ne?S=>{S.stopPropagation(),_(ne)}:void 0}),L&&e.jsx("span",{className:"italic truncate",children:L})]}):W>0?e.jsx(Ws,{path:V,localHash:t}):null]})]})]})]})}const Da=u.memo(Ha),Aa=u.memo(Fa);function za(s,a,t,n,l=!1){const i=s.toUpperCase(),r=[],c=t&&Ze(i,t);c&&r.push(t);for(const b of Object.keys(a))Ze(i,b)&&r.push(b);if(l&&c&&t&&r.length===1)return{matches:r,probability:1,bestMatch:t};if(l&&c&&r.length>1){const b=r.filter(o=>o!==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 h=null,f=-1;if(g.length===1)h=g[0];else if(g.length>1&&n){for(const b of g){const o=n.get(b),_=o?typeof o=="number"?o:o.combinedScore:0;_>f&&(f=_,h=b)}h||(h=g[0])}else g.length>0&&(h=g[0]);let C=x;if(r.length>1&&n&&f>0){let b=0;for(const o of r){const _=n.get(o);b+=_?typeof _=="number"?_:_.combinedScore:0}b>0&&(C=Math.min(.95,f/b))}return{matches:r,probability:C,bestMatch:h}}function Ea(s,a,t,n){const i=(t-s)*Math.PI/180,r=(n-a)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/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 Ia(s){return s<100?1:s<500?.9:s<1e3?.7:s<5e3?.5:s<1e4?.3:.1}const $a=u.lazy(()=>mt(()=>import("./PathMapMapLibre-DZCsJsTA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])));function Ua(s,a,t,n,l=!1,i,r,c){const x=ht(a);let g;r&&(g=ut(r,s,{position:c,isLastHop:l}).confidence);const{matches:h,probability:f}=za(s,x,n,i,l),C=h.length,b=[],o=s.toUpperCase(),_=t&&t.latitude!==void 0&&t.longitude!==void 0&&(t.latitude!==0||t.longitude!==0);for(const d of h){if(n&&Ze(o,n)&&d===n&&_&&t){b.push({hash:d,name:t.name||"Local Node",latitude:t.latitude,longitude:t.longitude,probability:l?1:f,isLocal:!0});continue}const w=x[d];w!=null&&w.latitude&&(w!=null&&w.longitude)&&!(w.latitude===0&&w.longitude===0)&&b.push({hash:d,name:w.node_name||w.name||"Unknown",latitude:w.latitude,longitude:w.longitude,probability:f,isLocal:!1,isDirectNeighbor:w.zero_hop===!0})}const P=b.length;if(P===1)b[0].probability=g??1;else if(P>1)if(g!==void 0&&g>0){const d=b[0];d.probability=g;const w=1-g,m=P-1;b.slice(1).forEach(v=>{v.probability=w/m})}else{let d=0;const w=b.map(m=>{if(m.isLocal)return{candidate:m,score:1};const v=i==null?void 0:i.get(m.hash);let N=.5;if(_&&t){const I=Ea(t.latitude,t.longitude,m.latitude,m.longitude);N=Ia(I)}let y;return v?y=N*.3+v.hopConsistencyScore*.3+v.frequencyScore*.4:(y=N,m.isDirectNeighbor&&(y=Math.max(y,.8))),d+=y,{candidate:m,score:y}});if(d>0)w.forEach(({candidate:m,score:v})=>{m.probability=Math.min(.95,v/d)});else{const m=1/P;b.forEach(v=>v.probability=m)}}return{candidates:b,totalMatches:C}}function Oa(s,a,t,n,l,i){if(!s||s.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const r=s.length-1,c=s.map((h,f)=>{const C=f===r,b=s.length-f,{candidates:o,totalMatches:_}=Ua(h,a,t,n,C,l,i,b),P=o.length>0?Math.max(...o.map(d=>d.probability)):0;return{prefix:h,candidates:o,confidence:P,totalMatches:_}}),x=c.reduce((h,f)=>f.confidence===0?0:h*f.confidence,1),g=c.some(h=>h.candidates.length>0);return{hops:c,overallConfidence:x,hasValidPath:g}}function Va(s){return`${(s*100).toFixed(0)}%`}function Ga(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 Qa(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 qa extends u.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(Je,{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:l,dstHash:i,neighborAffinity:r,prefixLookup:c,hubNodes:x,traceSnr:g,advertiserSource:h}){const[f,C]=u.useState(null),b=u.useMemo(()=>{if(!h)return null;const m=h.nodeType==="wardrive";return{prefix:h.prefix||"??",candidates:[{hash:h.publicKey||h.prefix||"source",name:h.name,latitude:h.latitude,longitude:h.longitude,probability:1,isLocal:!1,isWardrive:m}],confidence:1,totalMatches:1,isSource:!0}},[h]),o=u.useMemo(()=>{if(h||!l)return null;const m=Se(l),v=a[l];if((v==null?void 0:v.latitude)&&(v==null?void 0:v.longitude)&&!(v.latitude===0&&v.longitude===0))return{prefix:m,candidates:[{hash:l,name:v.node_name||v.name||"Source",latitude:v.latitude,longitude:v.longitude,probability:1,isLocal:!1,isDirectNeighbor:v.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const y=(v==null?void 0:v.node_name)||(v==null?void 0:v.name)||l.slice(0,8);return{prefix:m,candidates:[{hash:l,name:y,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[h,l,a]),_=u.useMemo(()=>{const m=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!m||m==="00"||m==="0000000000000000")&&t&&n){const V=Se(n),W=t.latitude!==0||t.longitude!==0;return{prefix:V,candidates:[{hash:n,name:t.name||"Local Node",latitude:W?t.latitude:0,longitude:W?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const N=Se(i);if(n&&i===n&&t){const V=t.latitude!==0||t.longitude!==0;return{prefix:N,candidates:[{hash:i,name:t.name||"Local Node",latitude:V?t.latitude:0,longitude:V?t.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const y=a[i];if((y==null?void 0:y.latitude)&&(y==null?void 0:y.longitude)&&!(y.latitude===0&&y.longitude===0))return{prefix:N,candidates:[{hash:i,name:y.node_name||y.name||"Destination",latitude:y.latitude,longitude:y.longitude,probability:1,isLocal:!1,isDirectNeighbor:y.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const A=(y==null?void 0:y.node_name)||(y==null?void 0:y.name)||i.slice(0,8);return{prefix:N,candidates:[{hash:i,name:A,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,a,t,n]),P=u.useMemo(()=>Oa(s,a,t,n,r,c),[s,a,t,n,r,c]),d=u.useMemo(()=>{const m=[];b?m.push(b):o&&m.push(o),m.push(...P.hops),_&&m.push(_);const v=m.reduce((y,I)=>I.confidence===0?0:y*I.confidence,1),N=m.some(y=>y.candidates.some(I=>I.latitude!==0||I.longitude!==0));return{hops:m,overallConfidence:v,hasValidPath:N}},[b,o,P,_]),w=u.useMemo(()=>{const m=getComputedStyle(document.documentElement);return{success:m.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:m.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:m.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:m.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:m.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return d.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:Ga(d.overallConfidence),children:Va(d.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(aa,{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(qa,{children:e.jsx(u.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($a,{resolvedPath:d,localNode:t,hubNodes:x,hoveredHopIndex:f,onHoverHop:C,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:d.hops.map((m,v)=>{var V,W,G;const N=m.isSource===!0,y=m.isDestination===!0,I=f===v;let A;return N?A=`Source: ${((V=m.candidates[0])==null?void 0:V.name)||"Unknown"}`:y?A=`Destination: ${((W=m.candidates[0])==null?void 0:W.name)||"Unknown"}`:m.totalMatches===0?A="No matching nodes found":m.totalMatches===1?A=`Exact match: ${((G=m.candidates[0])==null?void 0:G.name)||"Unknown"}`:A=`${m.totalMatches} possible matches (${(m.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:F("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",N&&"border border-sys-green/30",y&&"border border-sys-blue/30"),title:A,onMouseEnter:()=>C(v),onMouseLeave:()=>C(null),children:[N&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),y&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:Qa(m.confidence,m.totalMatches,w),children:m.prefix}),!N&&!y&&m.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",m.totalMatches]}),!N&&!y&&m.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},v)})})]}):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 Ye=16;function Qe(s){return s.match(/.{1,2}/g)||[]}function be(s){return s!==null&&s.startsWith("payload:")}const Pe={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` var(--depth-stroke-tl), var(--depth-stroke-br) `,selectionBorderWidth:2},as={type:"tween",duration:.25,ease:[.25,.1,.25,1]};function Wa(s,a){return s?`inset 0 0 0 ${Pe.selectionBorderWidth}px ${pe[a]}`:Pe.cardRestShadow}function Ka(s,a){return s?a:`color-mix(in srgb, ${a} ${Pe.hexRestOpacity}%, transparent)`}function Ya({segments:s,selectedSegment:a,onSegmentClick:t}){const[n,l]=u.useState(null),[i,r]=u.useState(null),c=s.some(h=>h.id!==void 0)&&t,x=[];for(const h of s){const f=Qe(h.hex);for(const C of f)x.push({byte:C.toUpperCase(),color:h.color,id:h.id})}const g=[];for(let h=0;h{const C=h.length{const d=P===h.length-1,w=C&&d,m=pe[o],y=(_?n===_:i===o)||!!(_&&a===_);return e.jsx("span",{className:`w-[1.75rem] text-xs text-center py-0.5 font-mono select-text ${c?"cursor-pointer":""}`,style:{backgroundColor:Ka(y,m),color:y?"rgba(255,255,255,0.95)":m,transition:y?"none":"background-color 0.15s ease-out, color 0.15s ease-out",touchAction:"manipulation",...w?{borderRadius:"0 0.375rem 0.375rem 0"}:{}},onMouseEnter:()=>{_?l(_):r(o)},onMouseLeave:()=>{l(null),r(null)},onClick:()=>_&&(t==null?void 0:t(_)),onTouchStart:()=>{_?l(_):r(o)},onTouchEnd:()=>{l(null),r(null)},children:b},P)})},f)})})}function Xa({rawHex:s,hexSegments:a,selectedSegment:t,onSegmentClick:n}){const[l,i]=u.useState(!1),r=u.useCallback(async()=>{await jt(s.toUpperCase()),i(!0),setTimeout(()=>i(!1),2e3)},[s]);return e.jsxs("div",{className:"bg-inset radius-inner p-6 relative depth-stroke-inset",children:[e.jsx(Ya,{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:l?e.jsxs(e.Fragment,{children:[e.jsx(bt,{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(ls,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Copy"})]})})]})}function Za(s,a){const t=[];let n=0;const l=a.slice(0,64);t.push({id:"payload:publicKey",title:"Public Key",color:"pink",hex:l,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 i=a.slice(64,72);t.push({id:"payload:timestamp",title:"Timestamp",color:"orange",hex:i,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(Z,{size:"standard",copy:!0,children:i.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[s.timestamp," (",de(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(Z,{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(Z,{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(Z,{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(Z,{size:"standard",copy:!0,children:x.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:['"',s.name,'"']})]})})}return t}function Ja(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(Z,{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 en(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(Z,{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(Z,{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 sn(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(Z,{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(Z,{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 tn(s,a){const t=[],n=parseInt(a.slice(0,2),16),l=isNaN(n)?{hashSize:1,hopCount:s.pathLength}:vt(n),i=l.hopCount*l.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(Z,{size:"standard",children:l.hopCount}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[l.hopCount," hop",l.hopCount!==1?"s":"",l.hashSize>1&&` × ${l.hashSize}B hashes`]})]})}),s.path.length>0){const r=a.slice(2,2+i*2);t.push({id:"payload:path",title:"Path Hops",color:"amber",hex:r,startByte:1,endByte:i,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(fe,{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+i;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(Z,{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+i+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 an(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(Z,{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(Z,{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(Z,{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 l=a.slice(18);return l&&t.push({id:"payload:path",title:"Target Path",color:"indigo",hex:l,startByte:9,endByte:9+l.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:s.pathHashes.map((i,r)=>{const c=s.snrValues[r],x=c!==void 0?Jt(c):"zinc";return e.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&e.jsx(fe,{className:"w-3 h-3 text-fg-muted"}),e.jsx(B,{color:"indigo",className:"font-mono",children:i}),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 nn(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(Z,{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(Z,{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(Z,{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 rn(s,a){switch(s.type){case"advert":return Za(s,a);case"ack":return Ja(s,a);case"grp_txt":return en(s,a);case"grp_data":return sn(s,a);case"path":return tn(s,a);case"trace":return an(s,a);case"multipart":return nn(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 ln(s){return s.map(a=>({id:a.id,hex:a.hex,color:a.color}))}function cn({bits:s,field:a,value:t,binary:n}){const l=()=>{if(a==="Payload Type"){const i=Le[t]||"zinc";return e.jsx(B,{color:i,children:t})}if(a==="Route Type"){const i=Ie[t]||"zinc";return e.jsx(B,{color:i,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:l()}),e.jsx("td",{className:"py-1.5 type-data-xs text-sys-cyan",children:n})]})}function bs({id:s,title:a,color:t,hexBytes:n,startByte:l,endByte:i,isSelected:r,children:c}){const x=n?Qe(n):[];return e.jsxs(xe.div,{layout:"position",layoutId:s,transition:as,className:"w-full min-w-0 overflow-hidden radius-inner p-4 sm:p-5 space-y-4",style:{backgroundColor:Pe.cardRestBg,boxShadow:Wa(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,h)=>e.jsx(B,{color:t,className:"font-mono",children:g.toUpperCase()},h))]}),e.jsxs("span",{className:"type-data-xs text-fg-muted flex-shrink-0",children:["Bytes ",l,"-",i]})]}),e.jsx("div",{className:"min-w-0 overflow-hidden",children:c})]})}function on({advert:s,timestamp:a}){const t=a?de(a):de(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(me,{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(he,{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 dn({decoded:s,timestamp:a}){const t=a?de(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(Ct,{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(Vs,{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(he,{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(Z,{size:"compact",copy:!0,className:"inline-block",children:e.jsx("span",{className:"break-all text-xs",children:s.decryptedHex.toUpperCase()})})})]})]})]})})}function xn({decoded:s,timestamp:a,isLoading:t=!1,onDecrypted:n}){const l=a?de(a):"Unknown",[i,r]=u.useState(""),[c,x]=u.useState(!1),[g,h]=u.useState(null),[f,C]=u.useState(!1),b=u.useCallback(async()=>{if(!(!i.trim()||!s.ciphertextHex||!s.macHex)){x(!0),h(null);try{const o=parseInt(s.channelHash,16),_=us(s.macHex),P=us(s.ciphertextHex),d=await kt(i.trim(),o,_,P);if(d.success){const w=d.result.plaintext,m=new TextDecoder("utf-8",{fatal:!1}).decode(w.slice(5)),v=m.indexOf(": "),N={...s,channelName:d.result.channelName,decrypted:!0,timestamp:w[0]|w[1]<<8|w[2]<<16|w[3]<<24,flags:w[4],senderName:v>0?m.slice(0,v):void 0,text:v>0?m.slice(v+2):m};n==null||n(N),r(""),C(!1)}else h(d.error)}catch(o){h(o instanceof Error?o.message:"Unknown error")}finally{x(!1)}}},[i,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-Bor22S6-.js b/frontend/dist/assets/PacketObservatory-CrZKJNh3.js similarity index 99% rename from frontend/dist/assets/PacketObservatory-Bor22S6-.js rename to frontend/dist/assets/PacketObservatory-CrZKJNh3.js index 92bb1cd3..54da6f31 100644 --- a/frontend/dist/assets/PacketObservatory-Bor22S6-.js +++ b/frontend/dist/assets/PacketObservatory-CrZKJNh3.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-CtpzsDw6.js","assets/index-C8J8z7Af.js","assets/node-types-B5WxOxT2.js","assets/index-CqhZhFJJ.css"])))=>i.map(i=>d[i]); -import{cp as O,r as T,eZ as Fe,e_ as Ee,e$ as Oe,f0 as ze,bT as Be,f1 as Ie,f2 as Ge,f3 as Ke,f4 as Ue,bS as Ne,_ as ue,f5 as Ve,f6 as we,bZ as pe,j as e,f7 as G,f8 as K,f9 as U,eB as xe,fa as qe,$ as M,c9 as We,cm as Ce,cx as Ye,fb as Ze,fc as Xe,fd as Qe,fe as Je,ff as et,fg as J,fh as tt,fi as st,fj as nt,fk as he,ci as me,aq as Se,bN as rt,w as at,fl as lt,W as ot,aa as ct,fm as it,P as dt,dU as ut}from"./index-C8J8z7Af.js";import{usePipelineStore as Y}from"./usePipelineStore-CtpzsDw6.js";import{e as Te,p as pt,A as I,S as V,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-CBHOCw6k.js";import{m as ke,i as ft}from"./node-types-B5WxOxT2.js";import{a as gt}from"./payload-detail-BWHpd-ZF.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(f=>f.rssi).filter(f=>f!=null)],m=[t.snr,...r.map(f=>f.snr).filter(f=>f!=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):"",f=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:f};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:f};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),f){if(u.push(`first hop in target path: ${f}`),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:f};const g=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===f);if(g.length===1){const[k,$]=g[0],h=$.name||$.node_name||null;return u.push(`first hop ${f} → 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:f,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:f}}else g.length>1?u.push(`first hop ${f} matches ${g.length} neighbors (ambiguous)`):u.push(`first hop ${f} 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:f}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-CtpzsDw6.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-C8J8z7Af.js").then(t=>t.hw),__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),f=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ue(t.route),g=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${g}`:g,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=ft(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:f,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 g,k,$,h,y,p;const s=gt(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,f=(k=(g=o==null?void 0:o.config)==null?void 0:g.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?Ve([],x,m,f,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=fe(H,_,L,a,v),R=[H,..._+20?N:null}function fe(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 f=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,g=v===1,k=jt(t,l);let $=null;return k.isTrace&&($=vt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:f,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:g,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(U,{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(f=>f.wsState),c=xe(f=>f.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(V,{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(V,{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 f,u,v,N,g;const l=((f=t.pathHashes[n])==null?void 0:f.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(g=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:g.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,f]=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),f(performance.now()-H));const D=await Je(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,g]=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));g({success:!0,text:_})}else g({success:!1,error:p.error})}catch(p){g({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(V,{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),g(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:f,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(U,{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:f})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function ge(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:f,payloadVersion:u,isV1:v,isV2:N,analysis:g}=s,$=(t.type??t.payload_type)===et,h=g.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=[];g.byteLen&&H.push(`${g.byteLen}B`),H.push(g.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):g.pathHopCount>0&&H.push(`${g.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:f,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(V,{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:ge(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=g.pType!=null?`0x${g.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=ge(m),R=g.signalClass==="excellent"||g.signalClass==="good"?"green":g.signalClass==="fair"?"amber":"red",b=g.senderTier==="pubkey"?"green":g.senderTier==="prefix"?"amber":g.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:g.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:g.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:g.byteLen?`${g.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:g.advertType!=="unknown"?g.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:g.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:g.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:g.senderTier,group:"analysis",color:b},{fn:"_origin",value:g.origin,group:"analysis",color:g.origin==="tx_local"?"green":g.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:g.pathAvail?`${g.pathHopCount} hops`:"none",group:"analysis",color:g.pathAvail?"green":"zinc"},{fn:"_age",value:g.age,group:"analysis",color:g.age==="live"||g.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(V,{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(),f=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),g=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&&g,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!g,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(V,{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(U,{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"})]}),f.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(f.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(f.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 f=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 g=!!(f!=null&&f.zero_hop),k=(f==null?void 0:f.last_seen)??0;let $=0;if(g&&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=!!(f!=null&&f.latitude&&(f!=null&&f.longitude)&&(f.latitude!==0||f.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:g,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,f)=>f.total-m.total)}function Ut({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:f}=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)??[]:[],g=v?x.get(v)??[]:[],k=f.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=f.inferredType,y=f.advertType,p=f.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=f.pathLen,P=T.useMemo(()=>Kt(N,n,g,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,g,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(V,{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(U,{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 Vt={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=[Vt,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-C2CKtblH.js","assets/index-Dk8KEIKm.js","assets/node-types-SdzDwn2r.js","assets/index-CqhZhFJJ.css"])))=>i.map(i=>d[i]); +import{cp as O,r as T,eZ as Fe,e_ as Ee,e$ as Oe,f0 as ze,bT as Be,f1 as Ie,f2 as Ge,f3 as Ke,f4 as Ue,bS as Ne,_ as ue,f5 as Ve,f6 as we,bZ as pe,j as e,f7 as G,f8 as K,f9 as U,eB as xe,fa as qe,$ as M,c9 as We,cm as Ce,cx as Ye,fb as Ze,fc as Xe,fd as Qe,fe as Je,ff as et,fg as J,fh as tt,fi as st,fj as nt,fk as he,ci as me,aq as Se,bN as rt,w as at,fl as lt,W as ot,aa as ct,fm as it,P as dt,dU as ut}from"./index-Dk8KEIKm.js";import{usePipelineStore as Y}from"./usePipelineStore-C2CKtblH.js";import{e as Te,p as pt,A as I,S as V,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-CrKVF5BS.js";import{m as ke,i as ft}from"./node-types-SdzDwn2r.js";import{a as gt}from"./payload-detail-BR_z6q5h.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(f=>f.rssi).filter(f=>f!=null)],m=[t.snr,...r.map(f=>f.snr).filter(f=>f!=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):"",f=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:f};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:f};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),f){if(u.push(`first hop in target path: ${f}`),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:f};const g=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===f);if(g.length===1){const[k,$]=g[0],h=$.name||$.node_name||null;return u.push(`first hop ${f} → 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:f,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:f}}else g.length>1?u.push(`first hop ${f} matches ${g.length} neighbors (ambiguous)`):u.push(`first hop ${f} 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:f}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-C2CKtblH.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-Dk8KEIKm.js").then(t=>t.hw),__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),f=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ue(t.route),g=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${g}`:g,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=ft(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:f,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 g,k,$,h,y,p;const s=gt(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,f=(k=(g=o==null?void 0:o.config)==null?void 0:g.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?Ve([],x,m,f,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=fe(H,_,L,a,v),R=[H,..._+20?N:null}function fe(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 f=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,g=v===1,k=jt(t,l);let $=null;return k.isTrace&&($=vt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:f,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:g,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(U,{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(f=>f.wsState),c=xe(f=>f.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(V,{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(V,{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 f,u,v,N,g;const l=((f=t.pathHashes[n])==null?void 0:f.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(g=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:g.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,f]=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),f(performance.now()-H));const D=await Je(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,g]=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));g({success:!0,text:_})}else g({success:!1,error:p.error})}catch(p){g({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(V,{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),g(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:f,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(U,{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:f})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function ge(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:f,payloadVersion:u,isV1:v,isV2:N,analysis:g}=s,$=(t.type??t.payload_type)===et,h=g.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=[];g.byteLen&&H.push(`${g.byteLen}B`),H.push(g.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):g.pathHopCount>0&&H.push(`${g.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:f,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(V,{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:ge(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=g.pType!=null?`0x${g.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=ge(m),R=g.signalClass==="excellent"||g.signalClass==="good"?"green":g.signalClass==="fair"?"amber":"red",b=g.senderTier==="pubkey"?"green":g.senderTier==="prefix"?"amber":g.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:g.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:g.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:g.byteLen?`${g.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:g.advertType!=="unknown"?g.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:g.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:g.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:g.senderTier,group:"analysis",color:b},{fn:"_origin",value:g.origin,group:"analysis",color:g.origin==="tx_local"?"green":g.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:g.pathAvail?`${g.pathHopCount} hops`:"none",group:"analysis",color:g.pathAvail?"green":"zinc"},{fn:"_age",value:g.age,group:"analysis",color:g.age==="live"||g.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(V,{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(),f=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),g=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&&g,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!g,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(V,{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(U,{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"})]}),f.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(f.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(f.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 f=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 g=!!(f!=null&&f.zero_hop),k=(f==null?void 0:f.last_seen)??0;let $=0;if(g&&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=!!(f!=null&&f.latitude&&(f!=null&&f.longitude)&&(f.latitude!==0||f.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:g,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,f)=>f.total-m.total)}function Ut({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:f}=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)??[]:[],g=v?x.get(v)??[]:[],k=f.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=f.inferredType,y=f.advertType,p=f.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=f.pathLen,P=T.useMemo(()=>Kt(N,n,g,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,g,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(V,{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(U,{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 Vt={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=[Vt,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,f;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??((f=r.hash)==null?void 0:f.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"],fs={transport:"Transport",store:"Store",worker:"Workers",pipeline:"Pipeline",consumer:"Consumers"};function gs(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:gs(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]),f=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),g=T.useRef(null);T.useEffect(()=>{l&&g.current&&(g.current.scrollTop=g.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(U,{children:e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 space-y-3",children:[t?f?e.jsx("div",{className:"space-y-2",children:ms.map(h=>{const y=f.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:fs[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:g,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]),[f,u]=T.useState(""),[v,N]=T.useState(""),[g,k]=T.useState(!1),$=T.useRef(r);T.useEffect(()=>{g&&r!==$.current&&m.length>0&&(u(m[0].packet_hash),N("")),$.current=r},[r,g,m]),T.useEffect(()=>{!f&&m.length>0&&!v&&u(m[0].packet_hash)},[f,m,v]);const h=T.useMemo(()=>v.trim()?null:m.find(b=>b.packet_hash===f)??null,[f,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:f,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 ${g?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:g?"● 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(U,{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(U,{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:g}),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(Ut,{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-BBd1O-ot.js b/frontend/dist/assets/Packets-CILpbmC-.js similarity index 95% rename from frontend/dist/assets/Packets-BBd1O-ot.js rename to frontend/dist/assets/Packets-CILpbmC-.js index da05f30f..5dfe9228 100644 --- a/frontend/dist/assets/Packets-BBd1O-ot.js +++ b/frontend/dist/assets/Packets-CILpbmC-.js @@ -1 +1 @@ -import{r as c,aQ as _,aR as mt,aS as Re,aT as Je,aU as bt,aV as ue,aW as Qe,aX as ft,aY as vt,aZ as xt,a_ as he,a$ as gt,b0 as ht,b1 as we,b2 as q,b3 as yt,b4 as Me,b5 as J,b6 as ce,b7 as Fe,b8 as Pe,b9 as St,ba as Ze,bb as et,bc as ye,bd as Ie,be as Se,bf as Ct,bg as Ot,bh as wt,bi as De,bj as Nt,bk as Et,bl as Oe,bm as jt,bn as Pt,bo as It,bp as re,bq as Tt,br as X,bs as kt,bt as $t,bu as Rt,bv as Mt,bw as Ft,bx as Dt,by as _t,bz as At,bA as Vt,bB as Lt,bC as zt,bD as _e,j as n,c as Z,aB as Bt,a4 as Ht,bE as Ut,a5 as Gt,bF as qt,W as Kt,aa as Wt,ae as Yt,bG as Xt,af as Jt,ax as Qt,aO as Zt,ag as Ae,P as Ve,bH as Le,bI as ze,B as Ee,bJ as Be,f as He,bK as Ue,ab as eo}from"./index-C8J8z7Af.js";import{c as to}from"./node-types-B5WxOxT2.js";import{u as oo}from"./chevron-up-BhSn6i9S.js";import{c as G,p as so,a as xe,f as Ge,b as no,L as ao,S as be,s as lo,g as io,u as ro,d as co}from"./element-movement-DhaeUFJY.js";import{F as uo,y as po,R as mo,T as bo,w as qe,A as fo}from"./floating-DcVaWvZe.js";import{F as vo}from"./use-tree-walker-DrduKptm.js";import{u as Ke,s as xo}from"./frozen-BZ7OZfIg.js";import{g as tt,u as go,P as ho}from"./PacketList-qNmSxnCj.js";import{useGetDecodedContent as yo,useResolveSource as So}from"./usePipelineStore-CtpzsDw6.js";import{c as Co,a as Oo,D as wo,b as No}from"./AnalyzerFilterPanel-CBecqjNU.js";import{u as Eo,r as jo}from"./consumer-registry-BKgTBvt8.js";import{A as Po}from"./arrow-down-Dqy7bDoY.js";import{A as Io}from"./arrow-right-D_4v2CeG.js";import{P as To,a as ko,B as $o,C as We}from"./PageLayout-D_1HzH-E.js";import{T as Ro}from"./TimeRangeStepper-D6X8K2qC.js";import{M as Mo}from"./MqttModeBadge-D5EDDcC2.js";import{F as Ye}from"./funnel-CRYMLc9L.js";import{R as Fo}from"./route-BEiTCi9B.js";import{S as Do}from"./sparkles-vljvhdkN.js";import{S as _o}from"./search-BO7ZBfwt.js";import"./primitives-CBHOCw6k.js";import"./badge-colors-Dl76Mz8m.js";import"./chat-utils-C5p1i8vZ.js";import"./SignalIndicator-CpPs32QG.js";import"./arrow-up-CsqMGTbi.js";import"./chevron-right-ZaDPsavE.js";import"./payload-detail-BWHpd-ZF.js";import"./map-pin-ufrVZcS3.js";import"./circle-question-mark-CD6FHJ5H.js";import"./layers-Dy827Q5R.js";import"./hash-8dFF62ov.js";import"./clock-CTBG2e06.js";import"./activity-Bh2DzqDM.js";import"./useMapViewStore-CmYR40pV.js";import"./index-CSWZC0QG.js";import"./index-DAnUKwME.js";import"./shield-Gw0bk8jQ.js";import"./zap-8IJ4kWaK.js";function ot(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return mt(e,"blur",t=>{let l=t.target;Re(l)&&(o.current={value:l.value,selectionStart:l.selectionStart,selectionEnd:l.selectionEnd})}),_(()=>{if(!Je(e)&&Re(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 Ao=Object.defineProperty,Vo=(e,o,t)=>o in e?Ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Xe=(e,o,t)=>(Vo(e,typeof o!="symbol"?o+"":o,t),t),y=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y||{}),ee=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ee||{}),ne=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(ne||{}),st=(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))(st||{});function je(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,l=o(e.options.slice()),s=l.length>0&&l[0].dataRef.current.order!==null?l.sort((u,g)=>u.dataRef.current.order-g.dataRef.current.order):vt(l,u=>u.dataRef.current.domRef.current),i=t?s.indexOf(t):null;return i===-1&&(i=null),{options:s,activeOptionIndex:i}}let Lo={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?xe.Tracked(no(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:xe.Idle}}return{...e,comboboxState:0,inputPositionState:xe.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,l,s,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:v,disabled:S}=e.virtual,w=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>v,resolveActiveIndex:()=>{var x,p;return(p=(x=e.activeOptionIndex)!=null?x:v.findIndex(E=>!S(E)))!=null?p:null},resolveDisabled:S,resolveId(){throw new Error("Function not implemented.")}}),C=(s=o.trigger)!=null?s:2;return e.activeOptionIndex===w&&e.activationTrigger===C?e:{...e,activeOptionIndex:w,activationTrigger:C,isTyping:!1,__demoMode:!1}}let u=je(e);if(u.activeOptionIndex===null){let v=u.options.findIndex(S=>!S.dataRef.current.disabled);v!==-1&&(u.activeOptionIndex=v)}let g=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:v=>v.id,resolveDisabled:v=>v.dataRef.current.disabled}),d=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===g&&e.activationTrigger===d?e:{...e,...u,isTyping:!1,activeOptionIndex:g,activationTrigger:d,__demoMode:!1}},4:(e,o)=>{var t,l,s,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let u=o.payload,g=je(e,v=>(v.push(u),v));e.activeOptionIndex===null&&(s=(l=e.dataRef.current).isSelected)!=null&&s.call(l,o.payload.dataRef.current.value)&&(g.activeOptionIndex=g.options.indexOf(u));let d={...e,...g,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(d.activeOptionIndex=0),d},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(s=>s.id!==o.id)};let l=je(e,s=>{let i=s.findIndex(u=>u.id===o.id);return i!==-1&&s.splice(i,1),s});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 s=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?s=i:s=null}return{...e,activeOptionIndex:s,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:xe.Moved}}};class Te extends bt{constructor(o){super(o),Xe(this,"actions",{onChange:t=>{let{onChange:l,compare:s,mode:i,value:u}=this.state.dataRef.current;return ue(i,{0:()=>l==null?void 0:l(t),1:()=>{let g=u.slice(),d=g.findIndex(v=>s(v,t));return d===-1?g.push(t):g.splice(d,1),l==null?void 0:l(g)}})},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:G.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})}}),Xe(this,"selectors",{activeDescendantId:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(s=t.options.find(u=>!u.dataRef.current.disabled&&t.dataRef.current.compare(u.dataRef.current.value,t.virtual.options[i])))==null?void 0:s.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:s,disabled:i}=t.virtual,u=s.findIndex(g=>{var d;return!((d=i==null?void 0:i(g))!=null&&d)});if(u!==-1)return u}let l=t.options.findIndex(s=>!s.dataRef.current.disabled);if(l!==-1)return l}return t.activeOptionIndex},activeOption:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(s=(l=t.options[i])==null?void 0:l.dataRef.current.value)!=null?s:null},isActive:(t,l,s)=>{var i;let u=this.selectors.activeOptionIndex(t);return u===null?!1:t.virtual?u===t.dataRef.current.calculateIndex(l):((i=t.options[u])==null?void 0:i.id)===s},shouldScrollIntoView:(t,l,s)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,l,s)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,l=Qe.get(null);this.disposables.add(l.on(ft.Push,s=>{!l.selectors.isTop(s,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(so(l.inputElement,l.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:l=!1}){var s;return new Te({id:o,dataRef:{current:{}},comboboxState:l?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(s=t.disabled)!=null?s:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:l,inputPositionState:xe.Idle})}reduce(o,t){return ue(t.type,Lo,o,t)}}const nt=c.createContext(null);function Ce(e){let o=c.useContext(nt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,at),t}return o}function at({id:e,virtual:o=null,__demoMode:t=!1}){let l=c.useMemo(()=>Te.new({id:e,virtual:o,__demoMode:t}),[]);return xt(()=>l.dispose()),l}let ge=c.createContext(null);ge.displayName="ComboboxDataContext";function de(e){let o=c.useContext(ge);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return o}let lt=c.createContext(null);function zo(e){let o=Ce("VirtualProvider"),t=de("VirtualProvider"),{options:l}=t.virtual,s=q(o,x=>x.optionsElement),[i,u]=c.useMemo(()=>{let x=s;if(!x)return[0,0];let p=window.getComputedStyle(x);return[parseFloat(p.paddingBlockStart||p.paddingTop),parseFloat(p.paddingBlockEnd||p.paddingBottom)]},[s]),g=oo({enabled:l.length!==0,scrollPaddingStart:i,scrollPaddingEnd:u,count:l.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[d,v]=c.useState(0);re(()=>{v(x=>x+1)},[l]);let S=g.getVirtualItems(),w=q(o,x=>x.activationTrigger===ne.Pointer),C=q(o,o.selectors.activeOptionIndex);return S.length===0?null:X.createElement(lt.Provider,{value:g},X.createElement("div",{style:{position:"relative",width:"100%",height:`${g.getTotalSize()}px`},ref:x=>{x&&(w||C!==null&&l.length>C&&g.scrollToIndex(C))}},S.map(x=>{var p;return X.createElement(c.Fragment,{key:x.key},X.cloneElement((p=e.children)==null?void 0:p.call(e,{...e.slot,option:l[x.index]}),{key:`${d}-${x.key}`,"data-index":x.index,"aria-setsize":l.length,"aria-posinset":x.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${x.start}px)`,overflowAnchor:"none"}}))})))}let Bo=c.Fragment;function Ho(e,o){let t=c.useId(),l=Ft(),{value:s,defaultValue:i,onChange:u,form:g,name:d,by:v,invalid:S=!1,disabled:w=l||!1,onClose:C,__demoMode:x=!1,multiple:p=!1,immediate:E=!1,virtual:T=null,nullable:m,...A}=e,b=Dt(i),[j=p?[]:void 0,M]=_t(s,u,b),N=at({id:t,virtual:T,__demoMode:x}),V=c.useRef({static:!1,hold:!1}),$=co(v),F=_(I=>T?v===null?T.options.indexOf(I):T.options.findIndex(ae=>$(ae,I)):N.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),K=c.useCallback(I=>ue(H.mode,{[ee.Multi]:()=>j.some(ae=>$(ae,I)),[ee.Single]:()=>$(j,I)}),[j]),W=q(N,I=>I.virtual),O=_(()=>C==null?void 0:C()),H=c.useMemo(()=>({__demoMode:x,immediate:E,optionsPropsRef:V,value:j,defaultValue:b,disabled:w,invalid:S,mode:p?ee.Multi:ee.Single,virtual:T?W:null,onChange:M,isSelected:K,calculateIndex:F,compare:$,onClose:O}),[x,E,V,j,b,w,S,p,T,W,M,K,F,$,O]);re(()=>{var I;T&&N.send({type:st.UpdateVirtualConfiguration,options:T.options,disabled:(I=T.disabled)!=null?I:null})},[T,T==null?void 0:T.options,T==null?void 0:T.disabled]),re(()=>{N.state.dataRef.current=H},[H]);let[L,P,z,le]=q(N,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),se=Qe.get(null),te=q(se,c.useCallback(I=>se.selectors.isTop(I,t),[se,t]));At(te,[P,z,le],()=>N.actions.closeCombobox());let Q=q(N,N.selectors.activeOptionIndex),ie=q(N,N.selectors.activeOption),f=ye({open:L===y.Open,disabled:w,invalid:S,activeIndex:Q,activeOption:ie,value:j}),[Y,R]=Vt(),B=o===null?{}:{ref:o},k=c.useCallback(()=>{if(b!==void 0)return M==null?void 0:M(b)},[M,b]),U=Se();return X.createElement(R,{value:Y,props:{htmlFor:z==null?void 0:z.id},slot:{open:L===y.Open,disabled:w}},X.createElement(fo,null,X.createElement(ge.Provider,{value:H},X.createElement(nt.Provider,{value:N},X.createElement(Lt,{value:ue(L,{[y.Open]:Oe.Open,[y.Closed]:Oe.Closed})},d!=null&&X.createElement(zt,{disabled:w,data:j!=null?{[d]:j}:{},form:g,onReset:k}),U({ourProps:B,theirProps:A,slot:f,defaultTag:Bo,name:"Combobox"}))))))}let Uo="input";function Go(e,o){var t,l;let s=Ce("Combobox.Input"),i=de("Combobox.Input"),u=c.useId(),g=ht(),{id:d=g||`headlessui-combobox-input-${u}`,onChange:v,displayValue:S,disabled:w=i.disabled||!1,autoFocus:C=!1,type:x="text",...p}=e,E=c.useRef(null),T=we(E,o,uo(),s.actions.setInputElement),[m,A]=q(s,f=>[f.comboboxState,f.isTyping]),b=yt(),j=_(()=>{s.actions.onChange(null),s.state.optionsElement&&(s.state.optionsElement.scrollTop=0),s.actions.goToOption({focus:G.Nothing})}),M=c.useMemo(()=>{var f;return typeof S=="function"&&i.value!==void 0?(f=S(i.value))!=null?f:"":typeof i.value=="string"?i.value:""},[i.value,S]);Me(([f,Y],[R,B])=>{if(s.state.isTyping)return;let k=E.current;k&&((B===y.Open&&Y===y.Closed||f!==R)&&(k.value=f),requestAnimationFrame(()=>{if(s.state.isTyping||!k||Je(k))return;let{selectionStart:U,selectionEnd:I}=k;Math.abs((I??0)-(U??0))===0&&U===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[M,m,A]),Me(([f],[Y])=>{if(f===y.Open&&Y===y.Closed){if(s.state.isTyping)return;let R=E.current;if(!R)return;let B=R.value,{selectionStart:k,selectionEnd:U,selectionDirection:I}=R;R.value="",R.value=B,I!==null?R.setSelectionRange(k,U,I):R.setSelectionRange(k,U)}},[m]);let N=c.useRef(!1),V=_(()=>{N.current=!0}),$=_(()=>{b.nextFrame(()=>{N.current=!1})}),F=_(f=>{switch(s.actions.setIsTyping(!0),f.key){case J.Enter:if(s.state.comboboxState!==y.Open||N.current)return;if(f.preventDefault(),f.stopPropagation(),s.selectors.activeOptionIndex(s.state)===null){s.actions.closeCombobox();return}s.actions.selectActiveOption(),i.mode===ee.Single&&s.actions.closeCombobox();break;case J.ArrowDown:return f.preventDefault(),f.stopPropagation(),ue(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Next}),[y.Closed]:()=>s.actions.openCombobox()});case J.ArrowUp:return f.preventDefault(),f.stopPropagation(),ue(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Previous}),[y.Closed]:()=>{ce.flushSync(()=>s.actions.openCombobox()),i.value||s.actions.goToOption({focus:G.Last})}});case J.Home:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.PageUp:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.End:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.PageDown:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.Escape:return s.state.comboboxState!==y.Open?void 0:(f.preventDefault(),s.state.optionsElement&&!i.optionsPropsRef.current.static&&f.stopPropagation(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox());case J.Tab:if(s.actions.setIsTyping(!1),s.state.comboboxState!==y.Open)return;i.mode===ee.Single&&s.state.activationTrigger!==ne.Focus&&s.actions.selectActiveOption(),s.actions.closeCombobox();break}}),K=_(f=>{v==null||v(f),i.mode===ee.Single&&f.target.value===""&&j(),s.actions.openCombobox()}),W=_(f=>{var Y,R,B;let k=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);if(!((R=s.state.optionsElement)!=null&&R.contains(k))&&!((B=s.state.buttonElement)!=null&&B.contains(k))&&s.state.comboboxState===y.Open)return f.preventDefault(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox()}),O=_(f=>{var Y,R,B;let k=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);(R=s.state.buttonElement)!=null&&R.contains(k)||(B=s.state.optionsElement)!=null&&B.contains(k)||i.disabled||i.immediate&&s.state.comboboxState!==y.Open&&b.microTask(()=>{ce.flushSync(()=>s.actions.openCombobox()),s.actions.setActivationTrigger(ne.Focus)})}),H=Pe(),L=St(),{isFocused:P,focusProps:z}=Ze({autoFocus:C}),{isHovered:le,hoverProps:se}=et({isDisabled:w}),te=q(s,f=>f.optionsElement),Q=ye({open:m===y.Open,disabled:w,invalid:i.invalid,hover:le,focus:P,autofocus:C}),ie=Ie({ref:T,id:d,role:"combobox",type:x,"aria-controls":te==null?void 0:te.id,"aria-expanded":m===y.Open,"aria-activedescendant":q(s,s.selectors.activeDescendantId),"aria-labelledby":H,"aria-describedby":L,"aria-autocomplete":"list",defaultValue:(l=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?S==null?void 0:S(i.defaultValue):null)!=null?l:i.defaultValue,disabled:w||void 0,autoFocus:C,onCompositionStart:V,onCompositionEnd:$,onKeyDown:F,onChange:K,onFocus:O,onBlur:W},z,se);return Se()({ourProps:ie,theirProps:p,slot:Q,defaultTag:Uo,name:"Combobox.Input"})}let qo="button";function Ko(e,o){let t=Ce("Combobox.Button"),l=de("Combobox.Button"),[s,i]=c.useState(null),u=we(o,i,t.actions.setButtonElement),g=c.useId(),{id:d=`headlessui-combobox-button-${g}`,disabled:v=l.disabled||!1,autoFocus:S=!1,...w}=e,[C,x,p]=q(t,O=>[O.comboboxState,O.inputElement,O.optionsElement]),E=ot(x),T=C===y.Open;ao(T,{trigger:s,action:c.useCallback(O=>{if(s!=null&&s.contains(O.target))return be.Ignore;if(x!=null&&x.contains(O.target))return be.Ignore;let H=O.target.closest('[role="option"]:not([data-disabled])');return Ct(H)?be.Select(H):p!=null&&p.contains(O.target)?be.Ignore:be.Close},[s,x,p]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let m=_(O=>{switch(O.key){case J.Space:case J.Enter:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&ce.flushSync(()=>t.actions.openCombobox()),E();return;case J.ArrowDown:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.First})),E();return;case J.ArrowUp:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.Last})),E();return;case J.Escape:if(t.state.comboboxState!==y.Open)return;O.preventDefault(),t.state.optionsElement&&!l.optionsPropsRef.current.static&&O.stopPropagation(),ce.flushSync(()=>t.actions.closeCombobox()),E();return;default:return}}),A=lo(()=>{t.state.comboboxState===y.Open?t.actions.closeCombobox():t.actions.openCombobox(),E()}),b=Pe([d]),{isFocusVisible:j,focusProps:M}=Ze({autoFocus:S}),{isHovered:N,hoverProps:V}=et({isDisabled:v}),{pressed:$,pressProps:F}=Ot({disabled:v}),K=ye({open:C===y.Open,active:$||C===y.Open,disabled:v,invalid:l.invalid,value:l.value,hover:N,focus:j}),W=Ie({ref:u,id:d,type:wt(e,s),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":p==null?void 0:p.id,"aria-expanded":C===y.Open,"aria-labelledby":b,disabled:v||void 0,autoFocus:S,onKeyDown:m},A,M,V,F);return Se()({ourProps:W,theirProps:w,slot:K,defaultTag:qo,name:"Combobox.Button"})}let Wo="div",Yo=_e.RenderStrategy|_e.Static;function Xo(e,o){var t,l,s;let i=c.useId(),{id:u=`headlessui-combobox-options-${i}`,hold:g=!1,anchor:d,portal:v=!1,modal:S=!0,transition:w=!1,...C}=e,x=Ce("Combobox.Options"),p=de("Combobox.Options"),E=po(d);E&&(v=!0);let[T,m]=mo(E),[A,b]=c.useState(null),j=bo(),M=we(o,E?T:null,x.actions.setOptionsElement,b),[N,V,$,F,K]=q(x,D=>[D.comboboxState,D.inputElement,D.buttonElement,D.optionsElement,D.activationTrigger]),W=De(V||$),O=De(F),H=Nt(),[L,P]=Et(w,A,H!==null?(H&Oe.Open)===Oe.Open:N===y.Open);jt(L,V,x.actions.closeCombobox);let z=p.__demoMode?!1:S&&N===y.Open;Pt(z,O);let le=p.__demoMode?!1:S&&N===y.Open;It(le,{allowed:c.useCallback(()=>[V,$,F],[V,$,F])});let se=q(x,x.selectors.didInputMove)?!1:L;re(()=>{var D;p.optionsPropsRef.current.static=(D=e.static)!=null?D:!1},[p.optionsPropsRef,e.static]),re(()=>{p.optionsPropsRef.current.hold=g},[p.optionsPropsRef,g]),vo(N===y.Open,{container:F,accept(D){return D.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:D.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(D){D.setAttribute("role","none")}});let te=Pe([$==null?void 0:$.id]),Q=ye({open:N===y.Open,option:void 0}),ie=_(()=>{x.actions.setActivationTrigger(ne.Pointer)}),f=_(D=>{D.preventDefault(),x.actions.setActivationTrigger(ne.Pointer)}),Y=Ie(E?j():{},{"aria-labelledby":te,role:"listbox","aria-multiselectable":p.mode===ee.Multi?!0:void 0,id:u,ref:M,style:{...C.style,...m,"--input-width":qe(L,V,!0).width,"--button-width":qe(L,$,!0).width},onWheel:K===ne.Pointer?void 0:ie,onMouseDown:f,...Tt(P)}),R=L&&N===y.Closed&&!e.static,B=Ke(R,(t=p.virtual)==null?void 0:t.options),k=Ke(R,p.value),U=c.useCallback(D=>p.compare(k,D),[p.compare,k]),I=c.useMemo(()=>{if(!p.virtual)return p;if(B===void 0)throw new Error("Missing `options` in virtual mode");return B!==p.virtual.options?{...p,virtual:{...p.virtual,options:B}}:p},[p,B,(l=p.virtual)==null?void 0:l.options]);p.virtual&&Object.assign(C,{children:X.createElement(ge.Provider,{value:I},X.createElement(zo,{slot:Q},C.children))});let ae=Se(),Ne=c.useMemo(()=>p.mode===ee.Multi?p:{...p,isSelected:U},[p,U]);return X.createElement(kt,{enabled:v?e.static||L:!1,ownerDocument:W},X.createElement(ge.Provider,{value:Ne},ae({ourProps:Y,theirProps:{...C,children:X.createElement(xo,{freeze:R},typeof C.children=="function"?(s=C.children)==null?void 0:s.call(C,Q):C.children)},slot:Q,defaultTag:Wo,features:Yo,visible:se,name:"Combobox.Options"})))}let Jo="div";function Qo(e,o){var t,l,s;let i=de("Combobox.Option"),u=Ce("Combobox.Option"),g=c.useId(),{id:d=`headlessui-combobox-option-${g}`,value:v,disabled:S=(s=(l=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:l.call(t,v))!=null?s:!1,order:w=null,...C}=e,[x]=q(u,P=>[P.inputElement]),p=ot(x),E=q(u,c.useCallback(P=>u.selectors.isActive(P,v,d),[v,d])),T=i.isSelected(v),m=c.useRef(null),A=$t({disabled:S,value:v,domRef:m,order:w}),b=c.useContext(lt),j=we(o,m,b?b.measureElement:null),M=_(()=>{u.actions.setIsTyping(!1),u.actions.onChange(v)});re(()=>u.actions.registerOption(d,A),[A,d]);let N=q(u,c.useCallback(P=>u.selectors.shouldScrollIntoView(P,v,d),[v,d]));re(()=>{if(N)return Rt().requestAnimationFrame(()=>{var P,z;(z=(P=m.current)==null?void 0:P.scrollIntoView)==null||z.call(P,{block:"nearest"})})},[N,m]);let V=_(P=>{P.preventDefault(),P.button===io.Left&&(S||(M(),Mt()||requestAnimationFrame(()=>p()),i.mode===ee.Single&&u.actions.closeCombobox()))}),$=_(()=>{if(S)return u.actions.goToOption({focus:G.Nothing});let P=i.calculateIndex(v);u.actions.goToOption({focus:G.Specific,idx:P})}),F=ro(),K=_(P=>F.update(P)),W=_(P=>{if(!F.wasMoved(P)||S||E&&u.state.activationTrigger===ne.Pointer)return;let z=i.calculateIndex(v);u.actions.goToOption({focus:G.Specific,idx:z},ne.Pointer)}),O=_(P=>{F.wasMoved(P)&&(S||E&&(i.optionsPropsRef.current.hold||u.state.activationTrigger===ne.Pointer&&u.actions.goToOption({focus:G.Nothing})))}),H=ye({active:E,focus:E,selected:T,disabled:S}),L={id:d,ref:j,role:"option",tabIndex:S===!0?void 0:-1,"aria-disabled":S===!0?!0:void 0,"aria-selected":T,disabled:void 0,onMouseDown:V,onFocus:$,onPointerEnter:K,onMouseEnter:K,onPointerMove:W,onMouseMove:W,onPointerLeave:O,onMouseLeave:O};return Se()({ourProps:L,theirProps:C,slot:H,defaultTag:Jo,name:"Combobox.Option"})}let Zo=he(Ho),it=he(Ko),rt=he(Go),es=gt,ct=he(Xo),ut=he(Qo),ts=Object.assign(Zo,{Input:rt,Button:it,Label:es,Options:ct,Option:ut});function os({options:e,value:o,onChange:t,defaultValue:l,displayValue:s,filter:i,placeholder:u,disabled:g,invalid:d,name:v,"aria-label":S,className:w,children:C}){const[x,p]=c.useState(""),E=s??(b=>b!=null?String(b):""),m=i??((b,j)=>E(b).toLowerCase().includes(j.toLowerCase())),A=c.useMemo(()=>x?e.filter(b=>m(b,x)):e,[e,x,m]);return n.jsx(ts,{value:o,onChange:t,defaultValue:l,disabled:g,name:v,onClose:()=>p(""),children:n.jsxs("div",{className:Z("relative",w),children:[n.jsxs("div",{className:"relative",children:[n.jsx(rt,{"aria-label":S,displayValue:E,onChange:b=>p(b.target.value),placeholder:u,className:Z(["w-full radius-inner py-2 pl-3 pr-10","text-sm text-fg-primary placeholder:text-fg-muted","bg-input-bg",d?"border border-sys-red":"border border-input-border","ring-focus-inset","hover:border-edge-strong","disabled:opacity-40 disabled:pointer-events-none disabled:cursor-not-allowed","transition-colors"])}),n.jsx(it,{className:"absolute inset-y-0 right-0 flex items-center pr-3 group",children:n.jsx(Bt,{className:"w-4 h-4 text-fg-muted transition-transform duration-200 group-data-[open]:rotate-180"})})]}),n.jsx(ct,{anchor:"bottom start",transition:!0,className:Z(["w-[var(--input-width)] min-w-[180px]","max-h-60 overflow-y-auto overscroll-contain scroll-py-1","radius-inset p-1 mt-1","surface-elevated","focus:outline-none","transition-opacity","data-[closed]:opacity-0","data-[enter]:duration-150 data-[leave]:duration-100","z-50"]),children:A.length===0&&x!==""?n.jsx("div",{className:"px-3 py-2 text-sm text-fg-muted",children:"No results found"}):A.map((b,j)=>n.jsx(c.Fragment,{children:C(b)},j))})]})})}function ss({value:e,disabled:o,className:t,children:l}){return n.jsx(ut,{as:c.Fragment,value:e,disabled:o,children:({selected:s,focus:i})=>n.jsxs("div",{className:Z("flex items-center gap-2 px-3 py-2 radius-control cursor-default","text-sm",i&&"bg-sys-blue text-white",!i&&"text-fg-primary",s&&!i&&"text-sys-blue",o&&"opacity-50 cursor-not-allowed",t),children:[n.jsx("span",{className:"w-4 flex-shrink-0",children:s&&n.jsx(Ht,{className:"w-4 h-4"})}),n.jsx("span",{className:"truncate flex-1",children:l})]})})}function ns({className:e,...o}){return n.jsx("span",{...o,className:Z("truncate",e)})}function fe({value:e,onChange:o,options:t,placeholder:l,disabled:s,className:i,"aria-label":u}){const g=t.find(d=>d.value===e);return n.jsx(os,{options:t,value:g,onChange:d=>{d&&o(d.value)},displayValue:d=>(d==null?void 0:d.label)??"",filter:(d,v)=>d.label.toLowerCase().includes(v.toLowerCase()),placeholder:l,disabled:s,className:i,"aria-label":u,children:d=>n.jsx(ss,{value:d,disabled:d.disabled,children:n.jsx(ns,{children:d.label})})})}const dt=[{target:"PacketStats",fn:"type",minStage:1}];jo(dt);function ve({icon:e,label:o,value:t,color:l,percentage:s,onClick:i,active:u}){const g=i?"button":"div";return n.jsxs(g,{type:i?"button":void 0,onClick:i,className:Z("flex items-center gap-2",i&&"cursor-pointer rounded-lg px-1.5 -mx-1.5 py-0.5 -my-0.5 transition-colors",i&&!u&&"hover:bg-subtle-fill",u&&"bg-sys-blue/10 ring-1 ring-sys-blue/25"),children:[n.jsx("div",{className:Z("p-1.5 rounded-md",l),children:e}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-sm font-semibold text-fg-primary",children:t.toLocaleString()}),n.jsxs("span",{className:"text-xs text-fg-muted leading-tight",children:[o,s!==void 0&&n.jsxs("span",{className:"ml-1 opacity-70",children:["(",s,"%)"]})]})]})]})}function as({packets:e}){Eo(dt);const o=c.useMemo(()=>{let t=0,l=0,s=0;const i=new Set;let u=0,g=0;for(const w of e){switch(tt(w)){case"forward":t++;break;case"dropped":l++;break;case"duplicate":s++;break}w.src_hash&&i.add(w.src_hash),w.rssi&&(u+=w.rssi,g++)}const d=e.length,v=g>0?Math.round(u/g):0;return{total:d,rx:d,fwd:t,dropped:l,duplicate:s,uniqueSources:i.size,avgRssi:v,rxPercent:100,fwdPercent:d>0?Math.round(t/d*100):0,droppedPercent:d>0?Math.round(l/d*100):0}},[e]);return n.jsx("div",{className:"surface-base depth-raised rounded-2xl p-3 pr-4 flex flex-col gap-2.5",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:flex sm:items-center sm:justify-between sm:gap-6",children:[n.jsx(ve,{icon:n.jsx(Po,{className:"w-3.5 h-3.5 text-sys-blue"}),label:"Received",value:o.rx,color:"bg-sys-blue/10",percentage:o.rxPercent}),n.jsx(ve,{icon:n.jsx(Io,{className:"w-3.5 h-3.5 text-sys-green"}),label:"Forwarded",value:o.fwd,color:"bg-sys-green/10",percentage:o.fwdPercent}),n.jsx(ve,{icon:n.jsx(Ut,{className:"w-3.5 h-3.5 text-sys-red"}),label:"Dropped",value:o.dropped,color:"bg-sys-red/10",percentage:o.droppedPercent}),n.jsx(ve,{icon:n.jsx(Gt,{className:"w-3.5 h-3.5 text-fg-muted"}),label:"Duplicates",value:o.duplicate,color:"bg-subtle-fill"}),n.jsxs("div",{className:"hidden sm:flex items-center gap-6 ml-auto",children:[n.jsx(ve,{icon:n.jsx(qt,{className:"w-3.5 h-3.5 text-sys-indigo"}),label:"Sources",value:o.uniqueSources,color:"bg-sys-indigo/10"}),n.jsxs("div",{className:"flex flex-col items-end pr-1",children:[n.jsxs("span",{className:"type-data-sm text-fg-secondary",children:[o.avgRssi," dBm"]}),n.jsx("span",{className:"text-xs text-fg-muted",children:"Avg Signal"})]})]})]})})}const ls=c.memo(as);function Gs(){var ke,$e;const e=Kt(),o=Wt(),t=yo(),l=go(a=>a.requestChannel),s=Yt(),i=o==null?void 0:o.local_hash,u=o==null?void 0:o.neighbors,g=Xt(($e=(ke=o==null?void 0:o.config)==null?void 0:ke.mesh)==null?void 0:$e.path_hash_mode),d=Jt(),v=Qt(),w=Zt().isBackgroundLoading&&d>=5,[C,x]=c.useState(!1),[p,E]=c.useState(!0),T=c.useCallback(a=>E(a),[]),[m,A]=c.useState({status:"all"}),[b,j]=c.useState(Co),[M,N]=c.useState(""),[V,$]=c.useState(!1),F=c.useRef(null);c.useEffect(()=>{function a(r){F.current&&!F.current.contains(r.target)&&$(!1)}if(V)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[V]);const K=c.useMemo(()=>{const a=Math.floor(Date.now()/1e3),r=Ae[d].minutes;return{start:a-r*60,end:a}},[d]),W=c.useMemo(()=>{const a=(o==null?void 0:o.neighbors)??{};return Object.fromEntries(Object.entries(a).filter(([r])=>!s.has(r)))},[o==null?void 0:o.neighbors,s]),O=c.useMemo(()=>Object.entries(W).map(([a,r])=>{const h=to(r);return{hash:a,name:r.name??r.node_name??a.slice(0,8),type:h.type,label:h.label}}).sort((a,r)=>a.name.localeCompare(r.name)),[W]),H=c.useMemo(()=>{if(!M)return O;const a=M.toLowerCase();return O.filter(r=>r.name.toLowerCase().includes(a)||r.hash.toLowerCase().includes(a))},[O,M]),L=So(),P=c.useMemo(()=>Oo(e,b,L,K),[e,b,L,K]),z=c.useMemo(()=>[...P].sort((a,r)=>(r.timestamp??0)-(a.timestamp??0)),[P]),le=e.length===0,se=c.useMemo(()=>{let a=z;if(m.type!==void 0){const r=Ve[m.type];a=a.filter(h=>{const oe=h.type??h.payload_type,pe=h.payload_type_name;return oe===m.type||pe===r})}if(m.route!==void 0){const r=Le[m.route];a=a.filter(h=>{const oe=h.route??h.route_type,pe=h.route_type_name;return oe===m.route||pe===r})}return m.status&&m.status!=="all"&&(a=a.filter(r=>tt(r)===m.status)),m.signalMin!==void 0&&(a=a.filter(r=>r.rssi>=m.signalMin)),m.transportOnly&&(a=a.filter(r=>ze(r.route??r.route_type))),m.v2Only&&(a=a.filter(r=>r._packetVersion===1)),a},[z,m.type,m.route,m.status,m.signalMin,m.transportOnly,m.v2Only]),te=c.useMemo(()=>{let a=0,r=0;for(const oe of z)ze(oe.route??oe.route_type)&&a++,oe._packetVersion===1&&r++;const h=z.length;return{transport:a,v2:r,transportPct:h>0?Math.round(a/h*100):0,v2Pct:h>0?Math.round(r/h*100):0}},[z]),Q=(a,r)=>A(h=>({...h,[a]:r})),ie=()=>A({status:"all"}),f=m.type!==void 0||m.route!==void 0||m.status&&m.status!=="all"||m.signalMin!==void 0||m.transportOnly||m.v2Only,Y=c.useCallback(a=>{const r=new Set(b.deviceTypes);r.has(a)?r.delete(a):r.add(a),j(h=>({...h,deviceTypes:r}))},[b.deviceTypes]),R=c.useCallback(a=>{const r=new Set(b.nodeIds);r.has(a)?r.delete(a):r.add(a),j(h=>({...h,nodeIds:r})),N("")},[b.nodeIds]),B=c.useCallback(a=>{const r=new Set(b.nodeIds);r.delete(a);const h=new Set(b.disabledNodeIds);h.delete(a),j(oe=>({...oe,nodeIds:r,disabledNodeIds:h}))},[b.nodeIds,b.disabledNodeIds]),k=c.useCallback(a=>{const r=new Set(b.disabledNodeIds);r.has(a)?r.delete(a):r.add(a),j(h=>({...h,disabledNodeIds:r}))},[b.disabledNodeIds]),U=c.useCallback(()=>{j(a=>({...a,nodeFilterMode:a.nodeFilterMode==="source"?"observed":"source"}))},[]),I=c.useMemo(()=>{const a=new Map;for(const r of b.nodeIds){const h=W[r];a.set(r,(h==null?void 0:h.name)??(h==null?void 0:h.node_name)??r.slice(0,8))}return a},[b.nodeIds,W]),ae=c.useCallback((a,r)=>{j(h=>({...h,timeStart:a,timeEnd:r}))},[]),Ne=c.useCallback(()=>{A(a=>({...a,transportOnly:!a.transportOnly}))},[]),D=c.useCallback(()=>{A(a=>({...a,v2Only:!a.v2Only}))},[]);return n.jsxs(To,{children:[n.jsx(ko,{title:"Packet History",icon:n.jsx(Be,{}),subtitle:n.jsx(Mo,{}),controls:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ro,{ranges:Ae,selectedIndex:d,onSelect:v,isPending:w}),n.jsxs(Ee,{outline:!0,color:f?"primary":"muted",onClick:()=>x(!C),className:"sm:hidden",children:[n.jsx(Ye,{"data-slot":"icon"}),f&&n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sys-blue"})]})]})}),n.jsxs($o,{children:[n.jsxs(We,{neomorphic:!0,noPadding:!0,className:Z("overflow-visible transition-all duration-200 relative z-10",C?"max-h-[600px] opacity-100":"max-h-0 opacity-0 sm:max-h-[600px] sm:opacity-100"),children:[n.jsx(He,{listHeader:!0,icon:n.jsx(Ye,{className:"icon-sm"}),title:"Filters",titleExtra:n.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[n.jsxs("button",{type:"button",onClick:Ne,className:Z("inline-flex items-center gap-1 px-2.5 py-1 rounded-full type-data-xs font-medium transition-colors cursor-pointer select-none",m.transportOnly?"bg-sys-amber/15 text-sys-amber ring-1 ring-sys-amber/30":"bg-surface/80 depth-raised text-fg-muted hover:text-fg-secondary"),title:"Filter to transport-coded packets (T_FLOOD / T_DIRECT)",children:[n.jsx(Fo,{className:"w-3 h-3"}),n.jsx("span",{className:"hidden sm:inline",children:"Transport"}),n.jsx("span",{className:"tabular-nums",children:te.transport}),n.jsxs("span",{className:"opacity-60 hidden lg:inline",children:["(",te.transportPct,"%)"]})]}),n.jsxs("button",{type:"button",onClick:D,className:Z("inline-flex items-center gap-1 px-2.5 py-1 rounded-full type-data-xs font-medium transition-colors cursor-pointer select-none",m.v2Only?"bg-sys-teal/15 text-sys-teal ring-1 ring-sys-teal/30":"bg-surface/80 depth-raised text-fg-muted hover:text-fg-secondary"),title:"Filter to V2 protocol packets",children:[n.jsx(Do,{className:"w-3 h-3"}),n.jsx("span",{className:"hidden sm:inline",children:"V2"}),n.jsx("span",{className:"tabular-nums",children:te.v2}),n.jsxs("span",{className:"opacity-60 hidden lg:inline",children:["(",te.v2Pct,"%)"]})]})]}),actions:f?n.jsxs(Ee,{plain:!0,color:"muted",onClick:ie,className:"!text-xs !py-0.5 !px-1.5",children:[n.jsx(Ue,{"data-slot":"icon",className:"!w-3 !h-3"}),"Clear"]}):void 0}),n.jsxs("div",{className:"p-3 sm:p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-0.5 -mb-0.5 shrink-0",children:wo.map(({type:a,label:r,icon:h,buttonColor:oe,iconColor:pe,hoverClass:pt})=>{const me=b.deviceTypes.has(a);return n.jsxs(Ee,{color:me?oe:"zinc",outline:!me,className:`!h-8 !py-0 ${me?"":pt}`,onClick:()=>Y(a),title:`Filter by ${r}`,children:[n.jsx(h,{"data-slot":"icon",className:me?"":pe}),n.jsx("span",{className:`hidden sm:inline ${me?"":"text-fg-muted"}`,children:r})]},a)})}),n.jsx("div",{className:"w-px h-4 bg-edge-subtle shrink-0 hidden md:block"}),n.jsxs("div",{className:"relative flex items-center gap-1.5 flex-1 min-w-[120px] sm:min-w-[180px] h-8 px-2 rounded-md border border-edge-subtle bg-white/[0.03] transition-colors focus-within:border-sys-blue",ref:F,children:[n.jsx(_o,{className:"w-3 h-3 text-fg-muted/50 shrink-0"}),n.jsx("input",{type:"text",className:"flex-1 min-w-[60px] type-data-xs py-0.5 bg-transparent text-fg-secondary placeholder:text-fg-muted/40 border-none focus:outline-none",placeholder:"Search nodes...",value:M,onChange:a=>{N(a.target.value),$(!0)},onFocus:()=>$(!0)}),V&&H.length>0&&n.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 z-[200] surface-popover border border-edge-subtle radius-inner max-h-48 overflow-y-auto",children:H.slice(0,20).map(a=>{const r=b.nodeIds.has(a.hash);return n.jsxs("button",{type:"button",onClick:()=>R(a.hash),className:Z("w-full flex items-center gap-2 px-2.5 py-1.5 type-data-xs text-left transition-colors",r?"bg-sys-indigo/15 text-sys-indigo":"text-fg-secondary hover:bg-subtle-fill"),children:[n.jsx("span",{className:"flex-1 truncate",children:a.name}),n.jsx("span",{className:"text-fg-muted type-data-xs shrink-0",children:a.label})]},a.hash)})})]})]}),b.nodeIds.size>0&&n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[Array.from(b.nodeIds).map(a=>{const r=b.disabledNodeIds.has(a);return n.jsxs("span",{role:"button",tabIndex:0,onClick:()=>k(a),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),k(a))},className:Z("inline-flex items-center gap-1 px-2 py-0.5 rounded-full type-data-xs border transition-colors select-none",r?"bg-zinc-500/10 text-fg-muted border-edge-subtle cursor-pointer hover:bg-zinc-500/15":"bg-sys-indigo/15 text-sys-indigo border-sys-indigo/25 cursor-pointer hover:bg-sys-indigo/25"),title:a,children:[I.get(a)??a.slice(0,8),n.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),B(a)},className:"hover:text-fg-primary transition-colors -mr-0.5",title:"Remove from filter",children:n.jsx(Ue,{className:"w-3 h-3"})})]},a)}),n.jsx("button",{type:"button",onClick:U,className:Z("inline-flex items-center gap-1 px-2 py-0.5 rounded-full type-data-xs border transition-colors",b.nodeFilterMode==="observed"?"bg-sys-blue/15 text-sys-blue border-sys-blue/25 hover:bg-sys-blue/25":"bg-white/[0.04] text-fg-muted border-edge-subtle hover:text-fg-secondary hover:border-fg-muted/40"),title:b.nodeFilterMode==="source"?"Source Only — showing packets sent by selected node(s)":"Total Observed — showing all packets where selected node(s) appear (source, path, or destination)",children:b.nodeFilterMode==="source"?"Source Only":"Total Observed"})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-[140px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Type"}),n.jsx(fe,{value:m.type??"",onChange:a=>Q("type",a===""?void 0:Number(a)),options:[{value:"",label:"All Types"},...Object.entries(Ve).map(([a,r])=>({value:Number(a),label:r}))],placeholder:"Search types...","aria-label":"Filter by packet type"})]}),n.jsxs("div",{className:"flex-1 min-w-[140px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Route"}),n.jsx(fe,{value:m.route??"",onChange:a=>Q("route",a===""?void 0:Number(a)),options:[{value:"",label:"All Routes"},...Object.entries(Le).map(([a,r])=>({value:Number(a),label:r}))],placeholder:"Search routes...","aria-label":"Filter by route type"})]}),n.jsxs("div",{className:"flex-1 min-w-[140px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Status"}),n.jsx(fe,{value:m.status??"all",onChange:a=>Q("status",a),options:[{value:"all",label:"All Status"},{value:"rx",label:"Received"},{value:"forward",label:"Forwarded"},{value:"dropped",label:"Dropped"},{value:"duplicate",label:"Duplicate"}],placeholder:"Search status...","aria-label":"Filter by status"})]}),n.jsxs("div",{className:"flex-1 min-w-[130px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Signal"}),n.jsx(fe,{value:m.signalMin??"",onChange:a=>Q("signalMin",a===""?void 0:Number(a)),options:[{value:"",label:"Any Signal"},{value:-90,label:"Strong (≥-90)"},{value:-100,label:"Good (≥-100)"},{value:-110,label:"Fair (≥-110)"},{value:-120,label:"Weak (≥-120)"}],placeholder:"Search signal...","aria-label":"Filter by signal strength"})]}),n.jsxs("div",{className:"flex-1 min-w-[100px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Per Page"}),n.jsx(fe,{value:m.perPage??50,onChange:a=>Q("perPage",a),options:[{value:25,label:"25"},{value:50,label:"50"},{value:100,label:"100"},{value:200,label:"200"},{value:500,label:"500"},{value:1e3,label:"1K"}],placeholder:"Per page...","aria-label":"Packets per page"})]})]}),n.jsx("div",{className:"flex items-center gap-3 pt-1 border-t border-edge-subtle",children:n.jsx("div",{className:"flex-1 min-w-[120px]",children:n.jsx(No,{min:K.start,max:K.end,valueStart:b.timeStart,valueEnd:b.timeEnd,onChange:ae})})})]})]}),n.jsx(ls,{packets:se}),n.jsxs(We,{neomorphic:!0,noPadding:!0,className:"!overflow-visible",children:[n.jsx(He,{listHeader:!0,icon:n.jsx(Be,{className:"icon-sm"}),title:"Packet History",actions:n.jsx(eo,{enabled:p,onChange:T,label:"Hide Dupes",size:"sm"})}),n.jsx(ho,{packets:se,allPackets:e,localHash:i,pathHashSize:g,neighbors:u,resolveSource:L,getDecodedContent:t,onChannelClick:l,loading:le,showPagination:!0,perPage:m.perPage??50,hideDupes:p,emptyMessage:"No packets found"})]})]})]})}export{Gs as default}; +import{r as c,aQ as _,aR as mt,aS as Re,aT as Je,aU as bt,aV as ue,aW as Qe,aX as ft,aY as vt,aZ as xt,a_ as he,a$ as gt,b0 as ht,b1 as we,b2 as q,b3 as yt,b4 as Me,b5 as J,b6 as ce,b7 as Fe,b8 as Pe,b9 as St,ba as Ze,bb as et,bc as ye,bd as Ie,be as Se,bf as Ct,bg as Ot,bh as wt,bi as De,bj as Nt,bk as Et,bl as Oe,bm as jt,bn as Pt,bo as It,bp as re,bq as Tt,br as X,bs as kt,bt as $t,bu as Rt,bv as Mt,bw as Ft,bx as Dt,by as _t,bz as At,bA as Vt,bB as Lt,bC as zt,bD as _e,j as n,c as Z,aB as Bt,a4 as Ht,bE as Ut,a5 as Gt,bF as qt,W as Kt,aa as Wt,ae as Yt,bG as Xt,af as Jt,ax as Qt,aO as Zt,ag as Ae,P as Ve,bH as Le,bI as ze,B as Ee,bJ as Be,f as He,bK as Ue,ab as eo}from"./index-Dk8KEIKm.js";import{c as to}from"./node-types-SdzDwn2r.js";import{u as oo}from"./chevron-up-DzJVNs-c.js";import{c as G,p as so,a as xe,f as Ge,b as no,L as ao,S as be,s as lo,g as io,u as ro,d as co}from"./element-movement-CrHrmJVz.js";import{F as uo,y as po,R as mo,T as bo,w as qe,A as fo}from"./floating-DAdA6y7o.js";import{F as vo}from"./use-tree-walker-D-l3KkK-.js";import{u as Ke,s as xo}from"./frozen-DqtxZ1v6.js";import{g as tt,u as go,P as ho}from"./PacketList-CmrEXwog.js";import{useGetDecodedContent as yo,useResolveSource as So}from"./usePipelineStore-C2CKtblH.js";import{c as Co,a as Oo,D as wo,b as No}from"./AnalyzerFilterPanel-CwOmGxBn.js";import{u as Eo,r as jo}from"./consumer-registry-CTHycSys.js";import{A as Po}from"./arrow-down-B85BrN7t.js";import{A as Io}from"./arrow-right-vgcsVPr-.js";import{P as To,a as ko,B as $o,C as We}from"./PageLayout-CGcnsIyM.js";import{T as Ro}from"./TimeRangeStepper-CNBzSSfG.js";import{M as Mo}from"./MqttModeBadge-CijH65Eh.js";import{F as Ye}from"./funnel-B-Z6Air3.js";import{R as Fo}from"./route-CxDUYLxS.js";import{S as Do}from"./sparkles-CZBEDNRz.js";import{S as _o}from"./search-DgakOYk2.js";import"./primitives-CrKVF5BS.js";import"./badge-colors-Dl76Mz8m.js";import"./chat-utils-DAcFG23d.js";import"./SignalIndicator-DJ2WGJCI.js";import"./arrow-up-BhSGIVnk.js";import"./chevron-right-BugwEnle.js";import"./payload-detail-BR_z6q5h.js";import"./map-pin-6ZLH5iNg.js";import"./circle-question-mark-BNRkoCvq.js";import"./layers-g7u6rTYv.js";import"./hash-BaVtxU1B.js";import"./clock-BSYVhL7Q.js";import"./activity-D99FIjaW.js";import"./useMapViewStore-CNJAZ76M.js";import"./index-M6ru5Gad.js";import"./index-DMeWa3DH.js";import"./shield-61UHbj0K.js";import"./zap-B0O7nHBO.js";function ot(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return mt(e,"blur",t=>{let l=t.target;Re(l)&&(o.current={value:l.value,selectionStart:l.selectionStart,selectionEnd:l.selectionEnd})}),_(()=>{if(!Je(e)&&Re(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 Ao=Object.defineProperty,Vo=(e,o,t)=>o in e?Ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Xe=(e,o,t)=>(Vo(e,typeof o!="symbol"?o+"":o,t),t),y=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y||{}),ee=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ee||{}),ne=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(ne||{}),st=(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))(st||{});function je(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,l=o(e.options.slice()),s=l.length>0&&l[0].dataRef.current.order!==null?l.sort((u,g)=>u.dataRef.current.order-g.dataRef.current.order):vt(l,u=>u.dataRef.current.domRef.current),i=t?s.indexOf(t):null;return i===-1&&(i=null),{options:s,activeOptionIndex:i}}let Lo={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?xe.Tracked(no(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:xe.Idle}}return{...e,comboboxState:0,inputPositionState:xe.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,l,s,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:v,disabled:S}=e.virtual,w=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>v,resolveActiveIndex:()=>{var x,p;return(p=(x=e.activeOptionIndex)!=null?x:v.findIndex(E=>!S(E)))!=null?p:null},resolveDisabled:S,resolveId(){throw new Error("Function not implemented.")}}),C=(s=o.trigger)!=null?s:2;return e.activeOptionIndex===w&&e.activationTrigger===C?e:{...e,activeOptionIndex:w,activationTrigger:C,isTyping:!1,__demoMode:!1}}let u=je(e);if(u.activeOptionIndex===null){let v=u.options.findIndex(S=>!S.dataRef.current.disabled);v!==-1&&(u.activeOptionIndex=v)}let g=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:v=>v.id,resolveDisabled:v=>v.dataRef.current.disabled}),d=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===g&&e.activationTrigger===d?e:{...e,...u,isTyping:!1,activeOptionIndex:g,activationTrigger:d,__demoMode:!1}},4:(e,o)=>{var t,l,s,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let u=o.payload,g=je(e,v=>(v.push(u),v));e.activeOptionIndex===null&&(s=(l=e.dataRef.current).isSelected)!=null&&s.call(l,o.payload.dataRef.current.value)&&(g.activeOptionIndex=g.options.indexOf(u));let d={...e,...g,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(d.activeOptionIndex=0),d},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(s=>s.id!==o.id)};let l=je(e,s=>{let i=s.findIndex(u=>u.id===o.id);return i!==-1&&s.splice(i,1),s});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 s=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?s=i:s=null}return{...e,activeOptionIndex:s,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:xe.Moved}}};class Te extends bt{constructor(o){super(o),Xe(this,"actions",{onChange:t=>{let{onChange:l,compare:s,mode:i,value:u}=this.state.dataRef.current;return ue(i,{0:()=>l==null?void 0:l(t),1:()=>{let g=u.slice(),d=g.findIndex(v=>s(v,t));return d===-1?g.push(t):g.splice(d,1),l==null?void 0:l(g)}})},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:G.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})}}),Xe(this,"selectors",{activeDescendantId:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(s=t.options.find(u=>!u.dataRef.current.disabled&&t.dataRef.current.compare(u.dataRef.current.value,t.virtual.options[i])))==null?void 0:s.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:s,disabled:i}=t.virtual,u=s.findIndex(g=>{var d;return!((d=i==null?void 0:i(g))!=null&&d)});if(u!==-1)return u}let l=t.options.findIndex(s=>!s.dataRef.current.disabled);if(l!==-1)return l}return t.activeOptionIndex},activeOption:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(s=(l=t.options[i])==null?void 0:l.dataRef.current.value)!=null?s:null},isActive:(t,l,s)=>{var i;let u=this.selectors.activeOptionIndex(t);return u===null?!1:t.virtual?u===t.dataRef.current.calculateIndex(l):((i=t.options[u])==null?void 0:i.id)===s},shouldScrollIntoView:(t,l,s)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,l,s)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,l=Qe.get(null);this.disposables.add(l.on(ft.Push,s=>{!l.selectors.isTop(s,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(so(l.inputElement,l.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:l=!1}){var s;return new Te({id:o,dataRef:{current:{}},comboboxState:l?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(s=t.disabled)!=null?s:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:l,inputPositionState:xe.Idle})}reduce(o,t){return ue(t.type,Lo,o,t)}}const nt=c.createContext(null);function Ce(e){let o=c.useContext(nt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,at),t}return o}function at({id:e,virtual:o=null,__demoMode:t=!1}){let l=c.useMemo(()=>Te.new({id:e,virtual:o,__demoMode:t}),[]);return xt(()=>l.dispose()),l}let ge=c.createContext(null);ge.displayName="ComboboxDataContext";function de(e){let o=c.useContext(ge);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return o}let lt=c.createContext(null);function zo(e){let o=Ce("VirtualProvider"),t=de("VirtualProvider"),{options:l}=t.virtual,s=q(o,x=>x.optionsElement),[i,u]=c.useMemo(()=>{let x=s;if(!x)return[0,0];let p=window.getComputedStyle(x);return[parseFloat(p.paddingBlockStart||p.paddingTop),parseFloat(p.paddingBlockEnd||p.paddingBottom)]},[s]),g=oo({enabled:l.length!==0,scrollPaddingStart:i,scrollPaddingEnd:u,count:l.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[d,v]=c.useState(0);re(()=>{v(x=>x+1)},[l]);let S=g.getVirtualItems(),w=q(o,x=>x.activationTrigger===ne.Pointer),C=q(o,o.selectors.activeOptionIndex);return S.length===0?null:X.createElement(lt.Provider,{value:g},X.createElement("div",{style:{position:"relative",width:"100%",height:`${g.getTotalSize()}px`},ref:x=>{x&&(w||C!==null&&l.length>C&&g.scrollToIndex(C))}},S.map(x=>{var p;return X.createElement(c.Fragment,{key:x.key},X.cloneElement((p=e.children)==null?void 0:p.call(e,{...e.slot,option:l[x.index]}),{key:`${d}-${x.key}`,"data-index":x.index,"aria-setsize":l.length,"aria-posinset":x.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${x.start}px)`,overflowAnchor:"none"}}))})))}let Bo=c.Fragment;function Ho(e,o){let t=c.useId(),l=Ft(),{value:s,defaultValue:i,onChange:u,form:g,name:d,by:v,invalid:S=!1,disabled:w=l||!1,onClose:C,__demoMode:x=!1,multiple:p=!1,immediate:E=!1,virtual:T=null,nullable:m,...A}=e,b=Dt(i),[j=p?[]:void 0,M]=_t(s,u,b),N=at({id:t,virtual:T,__demoMode:x}),V=c.useRef({static:!1,hold:!1}),$=co(v),F=_(I=>T?v===null?T.options.indexOf(I):T.options.findIndex(ae=>$(ae,I)):N.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),K=c.useCallback(I=>ue(H.mode,{[ee.Multi]:()=>j.some(ae=>$(ae,I)),[ee.Single]:()=>$(j,I)}),[j]),W=q(N,I=>I.virtual),O=_(()=>C==null?void 0:C()),H=c.useMemo(()=>({__demoMode:x,immediate:E,optionsPropsRef:V,value:j,defaultValue:b,disabled:w,invalid:S,mode:p?ee.Multi:ee.Single,virtual:T?W:null,onChange:M,isSelected:K,calculateIndex:F,compare:$,onClose:O}),[x,E,V,j,b,w,S,p,T,W,M,K,F,$,O]);re(()=>{var I;T&&N.send({type:st.UpdateVirtualConfiguration,options:T.options,disabled:(I=T.disabled)!=null?I:null})},[T,T==null?void 0:T.options,T==null?void 0:T.disabled]),re(()=>{N.state.dataRef.current=H},[H]);let[L,P,z,le]=q(N,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),se=Qe.get(null),te=q(se,c.useCallback(I=>se.selectors.isTop(I,t),[se,t]));At(te,[P,z,le],()=>N.actions.closeCombobox());let Q=q(N,N.selectors.activeOptionIndex),ie=q(N,N.selectors.activeOption),f=ye({open:L===y.Open,disabled:w,invalid:S,activeIndex:Q,activeOption:ie,value:j}),[Y,R]=Vt(),B=o===null?{}:{ref:o},k=c.useCallback(()=>{if(b!==void 0)return M==null?void 0:M(b)},[M,b]),U=Se();return X.createElement(R,{value:Y,props:{htmlFor:z==null?void 0:z.id},slot:{open:L===y.Open,disabled:w}},X.createElement(fo,null,X.createElement(ge.Provider,{value:H},X.createElement(nt.Provider,{value:N},X.createElement(Lt,{value:ue(L,{[y.Open]:Oe.Open,[y.Closed]:Oe.Closed})},d!=null&&X.createElement(zt,{disabled:w,data:j!=null?{[d]:j}:{},form:g,onReset:k}),U({ourProps:B,theirProps:A,slot:f,defaultTag:Bo,name:"Combobox"}))))))}let Uo="input";function Go(e,o){var t,l;let s=Ce("Combobox.Input"),i=de("Combobox.Input"),u=c.useId(),g=ht(),{id:d=g||`headlessui-combobox-input-${u}`,onChange:v,displayValue:S,disabled:w=i.disabled||!1,autoFocus:C=!1,type:x="text",...p}=e,E=c.useRef(null),T=we(E,o,uo(),s.actions.setInputElement),[m,A]=q(s,f=>[f.comboboxState,f.isTyping]),b=yt(),j=_(()=>{s.actions.onChange(null),s.state.optionsElement&&(s.state.optionsElement.scrollTop=0),s.actions.goToOption({focus:G.Nothing})}),M=c.useMemo(()=>{var f;return typeof S=="function"&&i.value!==void 0?(f=S(i.value))!=null?f:"":typeof i.value=="string"?i.value:""},[i.value,S]);Me(([f,Y],[R,B])=>{if(s.state.isTyping)return;let k=E.current;k&&((B===y.Open&&Y===y.Closed||f!==R)&&(k.value=f),requestAnimationFrame(()=>{if(s.state.isTyping||!k||Je(k))return;let{selectionStart:U,selectionEnd:I}=k;Math.abs((I??0)-(U??0))===0&&U===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[M,m,A]),Me(([f],[Y])=>{if(f===y.Open&&Y===y.Closed){if(s.state.isTyping)return;let R=E.current;if(!R)return;let B=R.value,{selectionStart:k,selectionEnd:U,selectionDirection:I}=R;R.value="",R.value=B,I!==null?R.setSelectionRange(k,U,I):R.setSelectionRange(k,U)}},[m]);let N=c.useRef(!1),V=_(()=>{N.current=!0}),$=_(()=>{b.nextFrame(()=>{N.current=!1})}),F=_(f=>{switch(s.actions.setIsTyping(!0),f.key){case J.Enter:if(s.state.comboboxState!==y.Open||N.current)return;if(f.preventDefault(),f.stopPropagation(),s.selectors.activeOptionIndex(s.state)===null){s.actions.closeCombobox();return}s.actions.selectActiveOption(),i.mode===ee.Single&&s.actions.closeCombobox();break;case J.ArrowDown:return f.preventDefault(),f.stopPropagation(),ue(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Next}),[y.Closed]:()=>s.actions.openCombobox()});case J.ArrowUp:return f.preventDefault(),f.stopPropagation(),ue(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Previous}),[y.Closed]:()=>{ce.flushSync(()=>s.actions.openCombobox()),i.value||s.actions.goToOption({focus:G.Last})}});case J.Home:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.PageUp:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.End:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.PageDown:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.Escape:return s.state.comboboxState!==y.Open?void 0:(f.preventDefault(),s.state.optionsElement&&!i.optionsPropsRef.current.static&&f.stopPropagation(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox());case J.Tab:if(s.actions.setIsTyping(!1),s.state.comboboxState!==y.Open)return;i.mode===ee.Single&&s.state.activationTrigger!==ne.Focus&&s.actions.selectActiveOption(),s.actions.closeCombobox();break}}),K=_(f=>{v==null||v(f),i.mode===ee.Single&&f.target.value===""&&j(),s.actions.openCombobox()}),W=_(f=>{var Y,R,B;let k=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);if(!((R=s.state.optionsElement)!=null&&R.contains(k))&&!((B=s.state.buttonElement)!=null&&B.contains(k))&&s.state.comboboxState===y.Open)return f.preventDefault(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox()}),O=_(f=>{var Y,R,B;let k=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);(R=s.state.buttonElement)!=null&&R.contains(k)||(B=s.state.optionsElement)!=null&&B.contains(k)||i.disabled||i.immediate&&s.state.comboboxState!==y.Open&&b.microTask(()=>{ce.flushSync(()=>s.actions.openCombobox()),s.actions.setActivationTrigger(ne.Focus)})}),H=Pe(),L=St(),{isFocused:P,focusProps:z}=Ze({autoFocus:C}),{isHovered:le,hoverProps:se}=et({isDisabled:w}),te=q(s,f=>f.optionsElement),Q=ye({open:m===y.Open,disabled:w,invalid:i.invalid,hover:le,focus:P,autofocus:C}),ie=Ie({ref:T,id:d,role:"combobox",type:x,"aria-controls":te==null?void 0:te.id,"aria-expanded":m===y.Open,"aria-activedescendant":q(s,s.selectors.activeDescendantId),"aria-labelledby":H,"aria-describedby":L,"aria-autocomplete":"list",defaultValue:(l=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?S==null?void 0:S(i.defaultValue):null)!=null?l:i.defaultValue,disabled:w||void 0,autoFocus:C,onCompositionStart:V,onCompositionEnd:$,onKeyDown:F,onChange:K,onFocus:O,onBlur:W},z,se);return Se()({ourProps:ie,theirProps:p,slot:Q,defaultTag:Uo,name:"Combobox.Input"})}let qo="button";function Ko(e,o){let t=Ce("Combobox.Button"),l=de("Combobox.Button"),[s,i]=c.useState(null),u=we(o,i,t.actions.setButtonElement),g=c.useId(),{id:d=`headlessui-combobox-button-${g}`,disabled:v=l.disabled||!1,autoFocus:S=!1,...w}=e,[C,x,p]=q(t,O=>[O.comboboxState,O.inputElement,O.optionsElement]),E=ot(x),T=C===y.Open;ao(T,{trigger:s,action:c.useCallback(O=>{if(s!=null&&s.contains(O.target))return be.Ignore;if(x!=null&&x.contains(O.target))return be.Ignore;let H=O.target.closest('[role="option"]:not([data-disabled])');return Ct(H)?be.Select(H):p!=null&&p.contains(O.target)?be.Ignore:be.Close},[s,x,p]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let m=_(O=>{switch(O.key){case J.Space:case J.Enter:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&ce.flushSync(()=>t.actions.openCombobox()),E();return;case J.ArrowDown:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.First})),E();return;case J.ArrowUp:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.Last})),E();return;case J.Escape:if(t.state.comboboxState!==y.Open)return;O.preventDefault(),t.state.optionsElement&&!l.optionsPropsRef.current.static&&O.stopPropagation(),ce.flushSync(()=>t.actions.closeCombobox()),E();return;default:return}}),A=lo(()=>{t.state.comboboxState===y.Open?t.actions.closeCombobox():t.actions.openCombobox(),E()}),b=Pe([d]),{isFocusVisible:j,focusProps:M}=Ze({autoFocus:S}),{isHovered:N,hoverProps:V}=et({isDisabled:v}),{pressed:$,pressProps:F}=Ot({disabled:v}),K=ye({open:C===y.Open,active:$||C===y.Open,disabled:v,invalid:l.invalid,value:l.value,hover:N,focus:j}),W=Ie({ref:u,id:d,type:wt(e,s),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":p==null?void 0:p.id,"aria-expanded":C===y.Open,"aria-labelledby":b,disabled:v||void 0,autoFocus:S,onKeyDown:m},A,M,V,F);return Se()({ourProps:W,theirProps:w,slot:K,defaultTag:qo,name:"Combobox.Button"})}let Wo="div",Yo=_e.RenderStrategy|_e.Static;function Xo(e,o){var t,l,s;let i=c.useId(),{id:u=`headlessui-combobox-options-${i}`,hold:g=!1,anchor:d,portal:v=!1,modal:S=!0,transition:w=!1,...C}=e,x=Ce("Combobox.Options"),p=de("Combobox.Options"),E=po(d);E&&(v=!0);let[T,m]=mo(E),[A,b]=c.useState(null),j=bo(),M=we(o,E?T:null,x.actions.setOptionsElement,b),[N,V,$,F,K]=q(x,D=>[D.comboboxState,D.inputElement,D.buttonElement,D.optionsElement,D.activationTrigger]),W=De(V||$),O=De(F),H=Nt(),[L,P]=Et(w,A,H!==null?(H&Oe.Open)===Oe.Open:N===y.Open);jt(L,V,x.actions.closeCombobox);let z=p.__demoMode?!1:S&&N===y.Open;Pt(z,O);let le=p.__demoMode?!1:S&&N===y.Open;It(le,{allowed:c.useCallback(()=>[V,$,F],[V,$,F])});let se=q(x,x.selectors.didInputMove)?!1:L;re(()=>{var D;p.optionsPropsRef.current.static=(D=e.static)!=null?D:!1},[p.optionsPropsRef,e.static]),re(()=>{p.optionsPropsRef.current.hold=g},[p.optionsPropsRef,g]),vo(N===y.Open,{container:F,accept(D){return D.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:D.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(D){D.setAttribute("role","none")}});let te=Pe([$==null?void 0:$.id]),Q=ye({open:N===y.Open,option:void 0}),ie=_(()=>{x.actions.setActivationTrigger(ne.Pointer)}),f=_(D=>{D.preventDefault(),x.actions.setActivationTrigger(ne.Pointer)}),Y=Ie(E?j():{},{"aria-labelledby":te,role:"listbox","aria-multiselectable":p.mode===ee.Multi?!0:void 0,id:u,ref:M,style:{...C.style,...m,"--input-width":qe(L,V,!0).width,"--button-width":qe(L,$,!0).width},onWheel:K===ne.Pointer?void 0:ie,onMouseDown:f,...Tt(P)}),R=L&&N===y.Closed&&!e.static,B=Ke(R,(t=p.virtual)==null?void 0:t.options),k=Ke(R,p.value),U=c.useCallback(D=>p.compare(k,D),[p.compare,k]),I=c.useMemo(()=>{if(!p.virtual)return p;if(B===void 0)throw new Error("Missing `options` in virtual mode");return B!==p.virtual.options?{...p,virtual:{...p.virtual,options:B}}:p},[p,B,(l=p.virtual)==null?void 0:l.options]);p.virtual&&Object.assign(C,{children:X.createElement(ge.Provider,{value:I},X.createElement(zo,{slot:Q},C.children))});let ae=Se(),Ne=c.useMemo(()=>p.mode===ee.Multi?p:{...p,isSelected:U},[p,U]);return X.createElement(kt,{enabled:v?e.static||L:!1,ownerDocument:W},X.createElement(ge.Provider,{value:Ne},ae({ourProps:Y,theirProps:{...C,children:X.createElement(xo,{freeze:R},typeof C.children=="function"?(s=C.children)==null?void 0:s.call(C,Q):C.children)},slot:Q,defaultTag:Wo,features:Yo,visible:se,name:"Combobox.Options"})))}let Jo="div";function Qo(e,o){var t,l,s;let i=de("Combobox.Option"),u=Ce("Combobox.Option"),g=c.useId(),{id:d=`headlessui-combobox-option-${g}`,value:v,disabled:S=(s=(l=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:l.call(t,v))!=null?s:!1,order:w=null,...C}=e,[x]=q(u,P=>[P.inputElement]),p=ot(x),E=q(u,c.useCallback(P=>u.selectors.isActive(P,v,d),[v,d])),T=i.isSelected(v),m=c.useRef(null),A=$t({disabled:S,value:v,domRef:m,order:w}),b=c.useContext(lt),j=we(o,m,b?b.measureElement:null),M=_(()=>{u.actions.setIsTyping(!1),u.actions.onChange(v)});re(()=>u.actions.registerOption(d,A),[A,d]);let N=q(u,c.useCallback(P=>u.selectors.shouldScrollIntoView(P,v,d),[v,d]));re(()=>{if(N)return Rt().requestAnimationFrame(()=>{var P,z;(z=(P=m.current)==null?void 0:P.scrollIntoView)==null||z.call(P,{block:"nearest"})})},[N,m]);let V=_(P=>{P.preventDefault(),P.button===io.Left&&(S||(M(),Mt()||requestAnimationFrame(()=>p()),i.mode===ee.Single&&u.actions.closeCombobox()))}),$=_(()=>{if(S)return u.actions.goToOption({focus:G.Nothing});let P=i.calculateIndex(v);u.actions.goToOption({focus:G.Specific,idx:P})}),F=ro(),K=_(P=>F.update(P)),W=_(P=>{if(!F.wasMoved(P)||S||E&&u.state.activationTrigger===ne.Pointer)return;let z=i.calculateIndex(v);u.actions.goToOption({focus:G.Specific,idx:z},ne.Pointer)}),O=_(P=>{F.wasMoved(P)&&(S||E&&(i.optionsPropsRef.current.hold||u.state.activationTrigger===ne.Pointer&&u.actions.goToOption({focus:G.Nothing})))}),H=ye({active:E,focus:E,selected:T,disabled:S}),L={id:d,ref:j,role:"option",tabIndex:S===!0?void 0:-1,"aria-disabled":S===!0?!0:void 0,"aria-selected":T,disabled:void 0,onMouseDown:V,onFocus:$,onPointerEnter:K,onMouseEnter:K,onPointerMove:W,onMouseMove:W,onPointerLeave:O,onMouseLeave:O};return Se()({ourProps:L,theirProps:C,slot:H,defaultTag:Jo,name:"Combobox.Option"})}let Zo=he(Ho),it=he(Ko),rt=he(Go),es=gt,ct=he(Xo),ut=he(Qo),ts=Object.assign(Zo,{Input:rt,Button:it,Label:es,Options:ct,Option:ut});function os({options:e,value:o,onChange:t,defaultValue:l,displayValue:s,filter:i,placeholder:u,disabled:g,invalid:d,name:v,"aria-label":S,className:w,children:C}){const[x,p]=c.useState(""),E=s??(b=>b!=null?String(b):""),m=i??((b,j)=>E(b).toLowerCase().includes(j.toLowerCase())),A=c.useMemo(()=>x?e.filter(b=>m(b,x)):e,[e,x,m]);return n.jsx(ts,{value:o,onChange:t,defaultValue:l,disabled:g,name:v,onClose:()=>p(""),children:n.jsxs("div",{className:Z("relative",w),children:[n.jsxs("div",{className:"relative",children:[n.jsx(rt,{"aria-label":S,displayValue:E,onChange:b=>p(b.target.value),placeholder:u,className:Z(["w-full radius-inner py-2 pl-3 pr-10","text-sm text-fg-primary placeholder:text-fg-muted","bg-input-bg",d?"border border-sys-red":"border border-input-border","ring-focus-inset","hover:border-edge-strong","disabled:opacity-40 disabled:pointer-events-none disabled:cursor-not-allowed","transition-colors"])}),n.jsx(it,{className:"absolute inset-y-0 right-0 flex items-center pr-3 group",children:n.jsx(Bt,{className:"w-4 h-4 text-fg-muted transition-transform duration-200 group-data-[open]:rotate-180"})})]}),n.jsx(ct,{anchor:"bottom start",transition:!0,className:Z(["w-[var(--input-width)] min-w-[180px]","max-h-60 overflow-y-auto overscroll-contain scroll-py-1","radius-inset p-1 mt-1","surface-elevated","focus:outline-none","transition-opacity","data-[closed]:opacity-0","data-[enter]:duration-150 data-[leave]:duration-100","z-50"]),children:A.length===0&&x!==""?n.jsx("div",{className:"px-3 py-2 text-sm text-fg-muted",children:"No results found"}):A.map((b,j)=>n.jsx(c.Fragment,{children:C(b)},j))})]})})}function ss({value:e,disabled:o,className:t,children:l}){return n.jsx(ut,{as:c.Fragment,value:e,disabled:o,children:({selected:s,focus:i})=>n.jsxs("div",{className:Z("flex items-center gap-2 px-3 py-2 radius-control cursor-default","text-sm",i&&"bg-sys-blue text-white",!i&&"text-fg-primary",s&&!i&&"text-sys-blue",o&&"opacity-50 cursor-not-allowed",t),children:[n.jsx("span",{className:"w-4 flex-shrink-0",children:s&&n.jsx(Ht,{className:"w-4 h-4"})}),n.jsx("span",{className:"truncate flex-1",children:l})]})})}function ns({className:e,...o}){return n.jsx("span",{...o,className:Z("truncate",e)})}function fe({value:e,onChange:o,options:t,placeholder:l,disabled:s,className:i,"aria-label":u}){const g=t.find(d=>d.value===e);return n.jsx(os,{options:t,value:g,onChange:d=>{d&&o(d.value)},displayValue:d=>(d==null?void 0:d.label)??"",filter:(d,v)=>d.label.toLowerCase().includes(v.toLowerCase()),placeholder:l,disabled:s,className:i,"aria-label":u,children:d=>n.jsx(ss,{value:d,disabled:d.disabled,children:n.jsx(ns,{children:d.label})})})}const dt=[{target:"PacketStats",fn:"type",minStage:1}];jo(dt);function ve({icon:e,label:o,value:t,color:l,percentage:s,onClick:i,active:u}){const g=i?"button":"div";return n.jsxs(g,{type:i?"button":void 0,onClick:i,className:Z("flex items-center gap-2",i&&"cursor-pointer rounded-lg px-1.5 -mx-1.5 py-0.5 -my-0.5 transition-colors",i&&!u&&"hover:bg-subtle-fill",u&&"bg-sys-blue/10 ring-1 ring-sys-blue/25"),children:[n.jsx("div",{className:Z("p-1.5 rounded-md",l),children:e}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-sm font-semibold text-fg-primary",children:t.toLocaleString()}),n.jsxs("span",{className:"text-xs text-fg-muted leading-tight",children:[o,s!==void 0&&n.jsxs("span",{className:"ml-1 opacity-70",children:["(",s,"%)"]})]})]})]})}function as({packets:e}){Eo(dt);const o=c.useMemo(()=>{let t=0,l=0,s=0;const i=new Set;let u=0,g=0;for(const w of e){switch(tt(w)){case"forward":t++;break;case"dropped":l++;break;case"duplicate":s++;break}w.src_hash&&i.add(w.src_hash),w.rssi&&(u+=w.rssi,g++)}const d=e.length,v=g>0?Math.round(u/g):0;return{total:d,rx:d,fwd:t,dropped:l,duplicate:s,uniqueSources:i.size,avgRssi:v,rxPercent:100,fwdPercent:d>0?Math.round(t/d*100):0,droppedPercent:d>0?Math.round(l/d*100):0}},[e]);return n.jsx("div",{className:"surface-base depth-raised rounded-2xl p-3 pr-4 flex flex-col gap-2.5",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:flex sm:items-center sm:justify-between sm:gap-6",children:[n.jsx(ve,{icon:n.jsx(Po,{className:"w-3.5 h-3.5 text-sys-blue"}),label:"Received",value:o.rx,color:"bg-sys-blue/10",percentage:o.rxPercent}),n.jsx(ve,{icon:n.jsx(Io,{className:"w-3.5 h-3.5 text-sys-green"}),label:"Forwarded",value:o.fwd,color:"bg-sys-green/10",percentage:o.fwdPercent}),n.jsx(ve,{icon:n.jsx(Ut,{className:"w-3.5 h-3.5 text-sys-red"}),label:"Dropped",value:o.dropped,color:"bg-sys-red/10",percentage:o.droppedPercent}),n.jsx(ve,{icon:n.jsx(Gt,{className:"w-3.5 h-3.5 text-fg-muted"}),label:"Duplicates",value:o.duplicate,color:"bg-subtle-fill"}),n.jsxs("div",{className:"hidden sm:flex items-center gap-6 ml-auto",children:[n.jsx(ve,{icon:n.jsx(qt,{className:"w-3.5 h-3.5 text-sys-indigo"}),label:"Sources",value:o.uniqueSources,color:"bg-sys-indigo/10"}),n.jsxs("div",{className:"flex flex-col items-end pr-1",children:[n.jsxs("span",{className:"type-data-sm text-fg-secondary",children:[o.avgRssi," dBm"]}),n.jsx("span",{className:"text-xs text-fg-muted",children:"Avg Signal"})]})]})]})})}const ls=c.memo(as);function Gs(){var ke,$e;const e=Kt(),o=Wt(),t=yo(),l=go(a=>a.requestChannel),s=Yt(),i=o==null?void 0:o.local_hash,u=o==null?void 0:o.neighbors,g=Xt(($e=(ke=o==null?void 0:o.config)==null?void 0:ke.mesh)==null?void 0:$e.path_hash_mode),d=Jt(),v=Qt(),w=Zt().isBackgroundLoading&&d>=5,[C,x]=c.useState(!1),[p,E]=c.useState(!0),T=c.useCallback(a=>E(a),[]),[m,A]=c.useState({status:"all"}),[b,j]=c.useState(Co),[M,N]=c.useState(""),[V,$]=c.useState(!1),F=c.useRef(null);c.useEffect(()=>{function a(r){F.current&&!F.current.contains(r.target)&&$(!1)}if(V)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[V]);const K=c.useMemo(()=>{const a=Math.floor(Date.now()/1e3),r=Ae[d].minutes;return{start:a-r*60,end:a}},[d]),W=c.useMemo(()=>{const a=(o==null?void 0:o.neighbors)??{};return Object.fromEntries(Object.entries(a).filter(([r])=>!s.has(r)))},[o==null?void 0:o.neighbors,s]),O=c.useMemo(()=>Object.entries(W).map(([a,r])=>{const h=to(r);return{hash:a,name:r.name??r.node_name??a.slice(0,8),type:h.type,label:h.label}}).sort((a,r)=>a.name.localeCompare(r.name)),[W]),H=c.useMemo(()=>{if(!M)return O;const a=M.toLowerCase();return O.filter(r=>r.name.toLowerCase().includes(a)||r.hash.toLowerCase().includes(a))},[O,M]),L=So(),P=c.useMemo(()=>Oo(e,b,L,K),[e,b,L,K]),z=c.useMemo(()=>[...P].sort((a,r)=>(r.timestamp??0)-(a.timestamp??0)),[P]),le=e.length===0,se=c.useMemo(()=>{let a=z;if(m.type!==void 0){const r=Ve[m.type];a=a.filter(h=>{const oe=h.type??h.payload_type,pe=h.payload_type_name;return oe===m.type||pe===r})}if(m.route!==void 0){const r=Le[m.route];a=a.filter(h=>{const oe=h.route??h.route_type,pe=h.route_type_name;return oe===m.route||pe===r})}return m.status&&m.status!=="all"&&(a=a.filter(r=>tt(r)===m.status)),m.signalMin!==void 0&&(a=a.filter(r=>r.rssi>=m.signalMin)),m.transportOnly&&(a=a.filter(r=>ze(r.route??r.route_type))),m.v2Only&&(a=a.filter(r=>r._packetVersion===1)),a},[z,m.type,m.route,m.status,m.signalMin,m.transportOnly,m.v2Only]),te=c.useMemo(()=>{let a=0,r=0;for(const oe of z)ze(oe.route??oe.route_type)&&a++,oe._packetVersion===1&&r++;const h=z.length;return{transport:a,v2:r,transportPct:h>0?Math.round(a/h*100):0,v2Pct:h>0?Math.round(r/h*100):0}},[z]),Q=(a,r)=>A(h=>({...h,[a]:r})),ie=()=>A({status:"all"}),f=m.type!==void 0||m.route!==void 0||m.status&&m.status!=="all"||m.signalMin!==void 0||m.transportOnly||m.v2Only,Y=c.useCallback(a=>{const r=new Set(b.deviceTypes);r.has(a)?r.delete(a):r.add(a),j(h=>({...h,deviceTypes:r}))},[b.deviceTypes]),R=c.useCallback(a=>{const r=new Set(b.nodeIds);r.has(a)?r.delete(a):r.add(a),j(h=>({...h,nodeIds:r})),N("")},[b.nodeIds]),B=c.useCallback(a=>{const r=new Set(b.nodeIds);r.delete(a);const h=new Set(b.disabledNodeIds);h.delete(a),j(oe=>({...oe,nodeIds:r,disabledNodeIds:h}))},[b.nodeIds,b.disabledNodeIds]),k=c.useCallback(a=>{const r=new Set(b.disabledNodeIds);r.has(a)?r.delete(a):r.add(a),j(h=>({...h,disabledNodeIds:r}))},[b.disabledNodeIds]),U=c.useCallback(()=>{j(a=>({...a,nodeFilterMode:a.nodeFilterMode==="source"?"observed":"source"}))},[]),I=c.useMemo(()=>{const a=new Map;for(const r of b.nodeIds){const h=W[r];a.set(r,(h==null?void 0:h.name)??(h==null?void 0:h.node_name)??r.slice(0,8))}return a},[b.nodeIds,W]),ae=c.useCallback((a,r)=>{j(h=>({...h,timeStart:a,timeEnd:r}))},[]),Ne=c.useCallback(()=>{A(a=>({...a,transportOnly:!a.transportOnly}))},[]),D=c.useCallback(()=>{A(a=>({...a,v2Only:!a.v2Only}))},[]);return n.jsxs(To,{children:[n.jsx(ko,{title:"Packet History",icon:n.jsx(Be,{}),subtitle:n.jsx(Mo,{}),controls:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ro,{ranges:Ae,selectedIndex:d,onSelect:v,isPending:w}),n.jsxs(Ee,{outline:!0,color:f?"primary":"muted",onClick:()=>x(!C),className:"sm:hidden",children:[n.jsx(Ye,{"data-slot":"icon"}),f&&n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sys-blue"})]})]})}),n.jsxs($o,{children:[n.jsxs(We,{neomorphic:!0,noPadding:!0,className:Z("overflow-visible transition-all duration-200 relative z-10",C?"max-h-[600px] opacity-100":"max-h-0 opacity-0 sm:max-h-[600px] sm:opacity-100"),children:[n.jsx(He,{listHeader:!0,icon:n.jsx(Ye,{className:"icon-sm"}),title:"Filters",titleExtra:n.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[n.jsxs("button",{type:"button",onClick:Ne,className:Z("inline-flex items-center gap-1 px-2.5 py-1 rounded-full type-data-xs font-medium transition-colors cursor-pointer select-none",m.transportOnly?"bg-sys-amber/15 text-sys-amber ring-1 ring-sys-amber/30":"bg-surface/80 depth-raised text-fg-muted hover:text-fg-secondary"),title:"Filter to transport-coded packets (T_FLOOD / T_DIRECT)",children:[n.jsx(Fo,{className:"w-3 h-3"}),n.jsx("span",{className:"hidden sm:inline",children:"Transport"}),n.jsx("span",{className:"tabular-nums",children:te.transport}),n.jsxs("span",{className:"opacity-60 hidden lg:inline",children:["(",te.transportPct,"%)"]})]}),n.jsxs("button",{type:"button",onClick:D,className:Z("inline-flex items-center gap-1 px-2.5 py-1 rounded-full type-data-xs font-medium transition-colors cursor-pointer select-none",m.v2Only?"bg-sys-teal/15 text-sys-teal ring-1 ring-sys-teal/30":"bg-surface/80 depth-raised text-fg-muted hover:text-fg-secondary"),title:"Filter to V2 protocol packets",children:[n.jsx(Do,{className:"w-3 h-3"}),n.jsx("span",{className:"hidden sm:inline",children:"V2"}),n.jsx("span",{className:"tabular-nums",children:te.v2}),n.jsxs("span",{className:"opacity-60 hidden lg:inline",children:["(",te.v2Pct,"%)"]})]})]}),actions:f?n.jsxs(Ee,{plain:!0,color:"muted",onClick:ie,className:"!text-xs !py-0.5 !px-1.5",children:[n.jsx(Ue,{"data-slot":"icon",className:"!w-3 !h-3"}),"Clear"]}):void 0}),n.jsxs("div",{className:"p-3 sm:p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-0.5 -mb-0.5 shrink-0",children:wo.map(({type:a,label:r,icon:h,buttonColor:oe,iconColor:pe,hoverClass:pt})=>{const me=b.deviceTypes.has(a);return n.jsxs(Ee,{color:me?oe:"zinc",outline:!me,className:`!h-8 !py-0 ${me?"":pt}`,onClick:()=>Y(a),title:`Filter by ${r}`,children:[n.jsx(h,{"data-slot":"icon",className:me?"":pe}),n.jsx("span",{className:`hidden sm:inline ${me?"":"text-fg-muted"}`,children:r})]},a)})}),n.jsx("div",{className:"w-px h-4 bg-edge-subtle shrink-0 hidden md:block"}),n.jsxs("div",{className:"relative flex items-center gap-1.5 flex-1 min-w-[120px] sm:min-w-[180px] h-8 px-2 rounded-md border border-edge-subtle bg-white/[0.03] transition-colors focus-within:border-sys-blue",ref:F,children:[n.jsx(_o,{className:"w-3 h-3 text-fg-muted/50 shrink-0"}),n.jsx("input",{type:"text",className:"flex-1 min-w-[60px] type-data-xs py-0.5 bg-transparent text-fg-secondary placeholder:text-fg-muted/40 border-none focus:outline-none",placeholder:"Search nodes...",value:M,onChange:a=>{N(a.target.value),$(!0)},onFocus:()=>$(!0)}),V&&H.length>0&&n.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 z-[200] surface-popover border border-edge-subtle radius-inner max-h-48 overflow-y-auto",children:H.slice(0,20).map(a=>{const r=b.nodeIds.has(a.hash);return n.jsxs("button",{type:"button",onClick:()=>R(a.hash),className:Z("w-full flex items-center gap-2 px-2.5 py-1.5 type-data-xs text-left transition-colors",r?"bg-sys-indigo/15 text-sys-indigo":"text-fg-secondary hover:bg-subtle-fill"),children:[n.jsx("span",{className:"flex-1 truncate",children:a.name}),n.jsx("span",{className:"text-fg-muted type-data-xs shrink-0",children:a.label})]},a.hash)})})]})]}),b.nodeIds.size>0&&n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[Array.from(b.nodeIds).map(a=>{const r=b.disabledNodeIds.has(a);return n.jsxs("span",{role:"button",tabIndex:0,onClick:()=>k(a),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),k(a))},className:Z("inline-flex items-center gap-1 px-2 py-0.5 rounded-full type-data-xs border transition-colors select-none",r?"bg-zinc-500/10 text-fg-muted border-edge-subtle cursor-pointer hover:bg-zinc-500/15":"bg-sys-indigo/15 text-sys-indigo border-sys-indigo/25 cursor-pointer hover:bg-sys-indigo/25"),title:a,children:[I.get(a)??a.slice(0,8),n.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),B(a)},className:"hover:text-fg-primary transition-colors -mr-0.5",title:"Remove from filter",children:n.jsx(Ue,{className:"w-3 h-3"})})]},a)}),n.jsx("button",{type:"button",onClick:U,className:Z("inline-flex items-center gap-1 px-2 py-0.5 rounded-full type-data-xs border transition-colors",b.nodeFilterMode==="observed"?"bg-sys-blue/15 text-sys-blue border-sys-blue/25 hover:bg-sys-blue/25":"bg-white/[0.04] text-fg-muted border-edge-subtle hover:text-fg-secondary hover:border-fg-muted/40"),title:b.nodeFilterMode==="source"?"Source Only — showing packets sent by selected node(s)":"Total Observed — showing all packets where selected node(s) appear (source, path, or destination)",children:b.nodeFilterMode==="source"?"Source Only":"Total Observed"})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-[140px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Type"}),n.jsx(fe,{value:m.type??"",onChange:a=>Q("type",a===""?void 0:Number(a)),options:[{value:"",label:"All Types"},...Object.entries(Ve).map(([a,r])=>({value:Number(a),label:r}))],placeholder:"Search types...","aria-label":"Filter by packet type"})]}),n.jsxs("div",{className:"flex-1 min-w-[140px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Route"}),n.jsx(fe,{value:m.route??"",onChange:a=>Q("route",a===""?void 0:Number(a)),options:[{value:"",label:"All Routes"},...Object.entries(Le).map(([a,r])=>({value:Number(a),label:r}))],placeholder:"Search routes...","aria-label":"Filter by route type"})]}),n.jsxs("div",{className:"flex-1 min-w-[140px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Status"}),n.jsx(fe,{value:m.status??"all",onChange:a=>Q("status",a),options:[{value:"all",label:"All Status"},{value:"rx",label:"Received"},{value:"forward",label:"Forwarded"},{value:"dropped",label:"Dropped"},{value:"duplicate",label:"Duplicate"}],placeholder:"Search status...","aria-label":"Filter by status"})]}),n.jsxs("div",{className:"flex-1 min-w-[130px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Signal"}),n.jsx(fe,{value:m.signalMin??"",onChange:a=>Q("signalMin",a===""?void 0:Number(a)),options:[{value:"",label:"Any Signal"},{value:-90,label:"Strong (≥-90)"},{value:-100,label:"Good (≥-100)"},{value:-110,label:"Fair (≥-110)"},{value:-120,label:"Weak (≥-120)"}],placeholder:"Search signal...","aria-label":"Filter by signal strength"})]}),n.jsxs("div",{className:"flex-1 min-w-[100px]",children:[n.jsx("label",{className:"type-micro block mb-1",children:"Per Page"}),n.jsx(fe,{value:m.perPage??50,onChange:a=>Q("perPage",a),options:[{value:25,label:"25"},{value:50,label:"50"},{value:100,label:"100"},{value:200,label:"200"},{value:500,label:"500"},{value:1e3,label:"1K"}],placeholder:"Per page...","aria-label":"Packets per page"})]})]}),n.jsx("div",{className:"flex items-center gap-3 pt-1 border-t border-edge-subtle",children:n.jsx("div",{className:"flex-1 min-w-[120px]",children:n.jsx(No,{min:K.start,max:K.end,valueStart:b.timeStart,valueEnd:b.timeEnd,onChange:ae})})})]})]}),n.jsx(ls,{packets:se}),n.jsxs(We,{neomorphic:!0,noPadding:!0,className:"!overflow-visible",children:[n.jsx(He,{listHeader:!0,icon:n.jsx(Be,{className:"icon-sm"}),title:"Packet History",actions:n.jsx(eo,{enabled:p,onChange:T,label:"Hide Dupes",size:"sm"})}),n.jsx(ho,{packets:se,allPackets:e,localHash:i,pathHashSize:g,neighbors:u,resolveSource:L,getDecodedContent:t,onChannelClick:l,loading:le,showPagination:!0,perPage:m.perPage??50,hideDupes:p,emptyMessage:"No packets found"})]})]})]})}export{Gs as default}; diff --git a/frontend/dist/assets/PageLayout-D_1HzH-E.js b/frontend/dist/assets/PageLayout-CGcnsIyM.js similarity index 95% rename from frontend/dist/assets/PageLayout-D_1HzH-E.js rename to frontend/dist/assets/PageLayout-CGcnsIyM.js index ab4d4389..6dccf382 100644 --- a/frontend/dist/assets/PageLayout-D_1HzH-E.js +++ b/frontend/dist/assets/PageLayout-CGcnsIyM.js @@ -1 +1 @@ -import{j as e,c as m,aN as d,r as i,gF as o,a2 as f}from"./index-C8J8z7Af.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=d(),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(o.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(f,{...s})}export{g as B,h as C,p as P,j as a}; +import{j as e,c as m,aN as d,r as i,gF as o,a2 as f}from"./index-Dk8KEIKm.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=d(),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(o.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(f,{...s})}export{g as B,h as C,p as P,j as a}; diff --git a/frontend/dist/assets/PathMapMapLibre-YblSn0Q9.js b/frontend/dist/assets/PathMapMapLibre-DZCsJsTA.js similarity index 96% rename from frontend/dist/assets/PathMapMapLibre-YblSn0Q9.js rename to frontend/dist/assets/PathMapMapLibre-DZCsJsTA.js index d2b92069..e6c0ffbd 100644 --- a/frontend/dist/assets/PathMapMapLibre-YblSn0Q9.js +++ b/frontend/dist/assets/PathMapMapLibre-DZCsJsTA.js @@ -1 +1 @@ -import{r as a,d1 as ae,cc as ie,b_ as le,hb as de,Z as J,cf as ce,j as t,$ as K,c as G,hc as ue}from"./index-C8J8z7Af.js";import{M as pe,B as me,a as Y,P as fe}from"./BasemapLayer-BvoQWTC4.js";import{S as ge,L as he}from"./layer-DgtbTXVx.js";import{C as xe}from"./car-KA4-aUWv.js";import{H as be}from"./useMapViewStore-CmYR40pV.js";import"./index-CSWZC0QG.js";import"./index-DAnUKwME.js";const ye={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},x={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 z(){if(typeof document>"u")return x;const c=document.documentElement,r=getComputedStyle(c);return{nodeColor:C(r.getPropertyValue("--map-node-stroke").trim(),x.nodeColor),localColor:C(r.getPropertyValue("--map-local-color").trim(),x.localColor),hubColor:C(r.getPropertyValue("--map-hub-color").trim(),x.hubColor),edgeColor:C(r.getPropertyValue("--map-edge-rest").trim(),x.edgeColor),ambiguousColor:C(r.getPropertyValue("--sys-indigo").trim(),x.ambiguousColor),highlightColor:C(r.getPropertyValue("--sys-blue").trim(),x.highlightColor),sourceColor:C(r.getPropertyValue("--sys-green").trim(),x.sourceColor),destinationColor:C(r.getPropertyValue("--sys-blue").trim(),x.destinationColor)}}function Ce({prefix:c,isLocal:r,isSource:m,isDestination:$,isLastHop:b,isHighlighted:g,isWardrive:k,candidate:h,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":b?"amber":$?"purple":"blue";return k?t.jsxs("div",{className:G("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:G("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(xe,{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,h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.name})]})]}):t.jsx("div",{className:G("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(be,{className:"w-2.5 h-2.5 mr-1"}),c,n&&h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.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:$,onHoverHop:b,traceSnr:g}){const k=g!==void 0&&g.length>0,h=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=h.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:W,edges:I}=a.useMemo(()=>{const e=[],o=[],s=[],i=[],f=(p,R)=>p!==0||R!==0;let l=0,y=!1;return c.hops.forEach((p,R)=>{const Q=p.candidates.filter(d=>f(d.latitude,d.longitude));if(Q.length===0)return;const V=[...Q].sort((d,F)=>F.probability-d.probability),A=V[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=z();let B;y?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:y})}const te=p.isSource===!0,oe=p.isDestination===!0;y=A.isWardrive===!0,V.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:V.length,hopIndex:R,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=W.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[y,p]=l.position;ys&&(s=y),pf&&(f=p)}return[[i,o],[f,s]]},[W]),_=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=h.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=h.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 O=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:[!O&&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:O?1:0},children:t.jsxs(pe,{ref:h,initialViewState:{longitude:_[0],latitude:_[1],zoom:10},onLoad:H,style:{height:"100%",width:"100%"},mapStyle:ye,attributionControl:!1,children:[t.jsx(me,{mode:E}),I.map((e,o)=>t.jsx(ge,{id:`edge-${o}`,type:"geojson",data:q[o],children:t.jsx(he,{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(Y,{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=W.filter(s=>s.isPrimary),o=e.length>1?e.length-2:-1;return e.map((s,i)=>{const f=$===s.hopIndex,l=i===o&&!s.candidate.isLocal&&!s.isDestination;return t.jsx(Y,{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:()=>b==null?void 0:b(s.hopIndex),onLeave:()=>b==null?void 0:b(null),onClick:()=>ee(s)})},`${s.hopIndex}-${s.candidate.hash}`)})})(),n&&t.jsx(fe,{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=z();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:z().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,d1 as ae,cc as ie,b_ as le,hb as de,Z as J,cf as ce,j as t,$ as K,c as G,hc as ue}from"./index-Dk8KEIKm.js";import{M as pe,B as me,a as Y,P as fe}from"./BasemapLayer-snfcoHal.js";import{S as ge,L as he}from"./layer-CgHNe4F2.js";import{C as xe}from"./car-BJCuYr8A.js";import{H as be}from"./useMapViewStore-CNJAZ76M.js";import"./index-M6ru5Gad.js";import"./index-DMeWa3DH.js";const ye={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},x={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 z(){if(typeof document>"u")return x;const c=document.documentElement,r=getComputedStyle(c);return{nodeColor:C(r.getPropertyValue("--map-node-stroke").trim(),x.nodeColor),localColor:C(r.getPropertyValue("--map-local-color").trim(),x.localColor),hubColor:C(r.getPropertyValue("--map-hub-color").trim(),x.hubColor),edgeColor:C(r.getPropertyValue("--map-edge-rest").trim(),x.edgeColor),ambiguousColor:C(r.getPropertyValue("--sys-indigo").trim(),x.ambiguousColor),highlightColor:C(r.getPropertyValue("--sys-blue").trim(),x.highlightColor),sourceColor:C(r.getPropertyValue("--sys-green").trim(),x.sourceColor),destinationColor:C(r.getPropertyValue("--sys-blue").trim(),x.destinationColor)}}function Ce({prefix:c,isLocal:r,isSource:m,isDestination:$,isLastHop:b,isHighlighted:g,isWardrive:k,candidate:h,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":b?"amber":$?"purple":"blue";return k?t.jsxs("div",{className:G("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:G("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(xe,{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,h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.name})]})]}):t.jsx("div",{className:G("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(be,{className:"w-2.5 h-2.5 mr-1"}),c,n&&h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.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:$,onHoverHop:b,traceSnr:g}){const k=g!==void 0&&g.length>0,h=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=h.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:W,edges:I}=a.useMemo(()=>{const e=[],o=[],s=[],i=[],f=(p,R)=>p!==0||R!==0;let l=0,y=!1;return c.hops.forEach((p,R)=>{const Q=p.candidates.filter(d=>f(d.latitude,d.longitude));if(Q.length===0)return;const V=[...Q].sort((d,F)=>F.probability-d.probability),A=V[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=z();let B;y?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:y})}const te=p.isSource===!0,oe=p.isDestination===!0;y=A.isWardrive===!0,V.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:V.length,hopIndex:R,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=W.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[y,p]=l.position;ys&&(s=y),pf&&(f=p)}return[[i,o],[f,s]]},[W]),_=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=h.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=h.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 O=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:[!O&&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:O?1:0},children:t.jsxs(pe,{ref:h,initialViewState:{longitude:_[0],latitude:_[1],zoom:10},onLoad:H,style:{height:"100%",width:"100%"},mapStyle:ye,attributionControl:!1,children:[t.jsx(me,{mode:E}),I.map((e,o)=>t.jsx(ge,{id:`edge-${o}`,type:"geojson",data:q[o],children:t.jsx(he,{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(Y,{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=W.filter(s=>s.isPrimary),o=e.length>1?e.length-2:-1;return e.map((s,i)=>{const f=$===s.hopIndex,l=i===o&&!s.candidate.isLocal&&!s.isDestination;return t.jsx(Y,{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:()=>b==null?void 0:b(s.hopIndex),onLeave:()=>b==null?void 0:b(null),onClick:()=>ee(s)})},`${s.hopIndex}-${s.candidate.hash}`)})})(),n&&t.jsx(fe,{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=z();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:z().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/PolicyEngine-CiCiXSMW.js b/frontend/dist/assets/PolicyEngine-DTEUQ5zM.js similarity index 97% rename from frontend/dist/assets/PolicyEngine-CiCiXSMW.js rename to frontend/dist/assets/PolicyEngine-DTEUQ5zM.js index 7cd8bc30..7f5bb368 100644 --- a/frontend/dist/assets/PolicyEngine-CiCiXSMW.js +++ b/frontend/dist/assets/PolicyEngine-DTEUQ5zM.js @@ -1,4 +1,4 @@ -import{e as oe,dv as Z,r as h,j as e,B as m,S as $,f as v,cV as ce,a6 as de,I as D}from"./index-C8J8z7Af.js";import{P as pe,a as he,B as me,C as y}from"./PageLayout-D_1HzH-E.js";import{L as w,a as j}from"./listbox-BOcIoorq.js";import{R as k,C as P}from"./Grid-CfYPlwSW.js";import{P as Q}from"./plus-DWX8cdcI.js";import{T as Y}from"./trash-2-MzXRdjh-.js";import"./element-movement-DhaeUFJY.js";import"./floating-DcVaWvZe.js";import"./use-text-value-Bj-jCGjS.js";import"./frozen-BZ7OZfIg.js";/** +import{e as oe,dv as Z,r as h,j as e,B as m,S as $,f as v,cV as ce,a6 as de,I as D}from"./index-Dk8KEIKm.js";import{P as pe,a as he,B as me,C as y}from"./PageLayout-CGcnsIyM.js";import{L as w,a as j}from"./listbox-BpBYEakW.js";import{R as k,C as P}from"./Grid-CThL_TW5.js";import{P as Q}from"./plus-BQyrUsn7.js";import{T as Y}from"./trash-2-BNWAPzrN.js";import"./element-movement-CrHrmJVz.js";import"./floating-DAdA6y7o.js";import"./use-text-value-XAXtIZxt.js";import"./frozen-DqtxZ1v6.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RadioHardware-BO7_64oZ.js b/frontend/dist/assets/RadioHardware-B0jlEO3v.js similarity index 97% rename from frontend/dist/assets/RadioHardware-BO7_64oZ.js rename to frontend/dist/assets/RadioHardware-B0jlEO3v.js index 05ba6ba4..1010a07f 100644 --- a/frontend/dist/assets/RadioHardware-BO7_64oZ.js +++ b/frontend/dist/assets/RadioHardware-B0jlEO3v.js @@ -1,4 +1,4 @@ -import{e as Ce,aa as Se,aF as we,r as u,a1 as ke,j as e,R as Re,B as _,f as D,h as Te,$ as de,eL as ce,eM as oe,bK as Ie,dz as Q}from"./index-C8J8z7Af.js";import{r as Ee}from"./system-CzT5Ikli.js";import{g as Be,b as Fe}from"./setup-C1PWPTL6.js";import{i as He}from"./backup-D2yaW6qB.js";import{P as qe,a as Le,B as Ue,C as F}from"./PageLayout-D_1HzH-E.js";import{S as W,a as Y}from"./setting-field-DUdKGmIP.js";import{R as J,C as M}from"./Grid-CfYPlwSW.js";import{R as De}from"./rotate-cw-8-HjiytO.js";import{S as pe}from"./settings-2-BrtUmS4l.js";import{S as Me}from"./save-ChsI8Mf5.js";import"./wand-sparkles-CkPC71f7.js";import"./pencil-C5OSBhs0.js";/** +import{e as Ce,aa as Se,aF as we,r as u,a1 as ke,j as e,R as Re,B as _,f as D,h as Te,$ as de,eL as ce,eM as oe,bK as Ie,dz as Q}from"./index-Dk8KEIKm.js";import{r as Ee}from"./system-CChwfvfT.js";import{g as Be,b as Fe}from"./setup-aZlM24bl.js";import{i as He}from"./backup-CooFBfHx.js";import{P as qe,a as Le,B as Ue,C as F}from"./PageLayout-CGcnsIyM.js";import{S as W,a as Y}from"./setting-field-mByymMx9.js";import{R as J,C as M}from"./Grid-CThL_TW5.js";import{R as De}from"./rotate-cw-DeILC3U9.js";import{S as pe}from"./settings-2-CTbt3KT5.js";import{S as Me}from"./save-DrkPtb78.js";import"./wand-sparkles-Cfv_3ntm.js";import"./pencil-Cf1ve6Fc.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RfHealthCorrelation-DxrNjcLK.js b/frontend/dist/assets/RfHealthCorrelation-AsWuS5lw.js similarity index 96% rename from frontend/dist/assets/RfHealthCorrelation-DxrNjcLK.js rename to frontend/dist/assets/RfHealthCorrelation-AsWuS5lw.js index 962fddf3..7e2e4f4b 100644 --- a/frontend/dist/assets/RfHealthCorrelation-DxrNjcLK.js +++ b/frontend/dist/assets/RfHealthCorrelation-AsWuS5lw.js @@ -1,4 +1,4 @@ -import{e as se,aa as ae,W as le,r as j,ag as R,d3 as re,ai as ne,ah as ie,d4 as ce,d5 as oe,j as e,f as O,R as de,d6 as ue,ca as pe,c7 as me,bE as xe}from"./index-C8J8z7Af.js";import{P as he,a as ge,B as fe,C as N}from"./PageLayout-D_1HzH-E.js";import{L as X}from"./LightSparkline-DUJ9rwBo.js";import{T as ve}from"./TimeRangeStepper-D6X8K2qC.js";import{R as V,C as W}from"./Grid-CfYPlwSW.js";import"./chevron-right-ZaDPsavE.js";import"./floating-DcVaWvZe.js";/** +import{e as se,aa as ae,W as le,r as j,ag as R,d3 as re,ai as ne,ah as ie,d4 as ce,d5 as oe,j as e,f as O,R as de,d6 as ue,ca as pe,c7 as me,bE as xe}from"./index-Dk8KEIKm.js";import{P as he,a as ge,B as fe,C as N}from"./PageLayout-CGcnsIyM.js";import{L as X}from"./LightSparkline-eR-H8PYv.js";import{T as ve}from"./TimeRangeStepper-CNBzSSfG.js";import{R as V,C as W}from"./Grid-CThL_TW5.js";import"./chevron-right-BugwEnle.js";import"./floating-DAdA6y7o.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RoomServer-tRKXPbhi.js b/frontend/dist/assets/RoomServer-2UYqAd-A.js similarity index 97% rename from frontend/dist/assets/RoomServer-tRKXPbhi.js rename to frontend/dist/assets/RoomServer-2UYqAd-A.js index 5888a83c..b34d4174 100644 --- a/frontend/dist/assets/RoomServer-tRKXPbhi.js +++ b/frontend/dist/assets/RoomServer-2UYqAd-A.js @@ -1,4 +1,4 @@ -import{e as I,r as l,j as e,cv as G,R as De,c as A,ay as Ae,aH as $e,az as Ke,$ as U,I as P,eO as Fe,B as b,cb as we,aB as ie,V as Oe,f as te,a7 as Ce,a4 as W,a5 as Be,eP as Se,eQ as ze,bF as _e,eR as qe,eS as He,eT as Ve,eU as Ue,eV as We,eW as Ge,eX as Ye,eY as Ie,aa as Xe,W as Je,eJ as Qe,cx as ce}from"./index-C8J8z7Af.js";import{C as q,P as de,a as me,B as Ze}from"./PageLayout-D_1HzH-E.js";import{R as es,C as ue}from"./Grid-CfYPlwSW.js";import{c as ss,m as ts}from"./node-types-B5WxOxT2.js";import{R as as}from"./repeat-DFihKOPA.js";import{L as ns,a as rs,b as ls}from"./listbox-BOcIoorq.js";import{P as os}from"./plus-DWX8cdcI.js";import{F as E,L as D,D as is}from"./fieldset-Dw6uLZoo.js";import{M as Z}from"./map-pin-ufrVZcS3.js";import{T as Re}from"./trash-2-MzXRdjh-.js";import{S as ee,K as Y}from"./KeycapButton-LnaBrSq2.js";import{C as xe}from"./ConfirmModal-B5_l2g7c.js";import{S as cs,C as ds}from"./ChatBubble-DwkygOA9.js";import{e as ms,g as us,a as xs}from"./chat-utils-C5p1i8vZ.js";import{W as se}from"./wifi-5HVE8VPj.js";import{M as ps}from"./message-square-text-CwsdV-n7.js";import{K as hs}from"./key-round-C1SnbsaC.js";import"./element-movement-DhaeUFJY.js";import"./floating-DcVaWvZe.js";import"./use-text-value-Bj-jCGjS.js";import"./frozen-BZ7OZfIg.js";import"./keycap-sfx-ByZp-njj.js";/** +import{e as I,r as l,j as e,cv as G,R as De,c as A,ay as Ae,aH as $e,az as Ke,$ as U,I as P,eO as Fe,B as b,cb as we,aB as ie,V as Oe,f as te,a7 as Ce,a4 as W,a5 as Be,eP as Se,eQ as ze,bF as _e,eR as qe,eS as He,eT as Ve,eU as Ue,eV as We,eW as Ge,eX as Ye,eY as Ie,aa as Xe,W as Je,eJ as Qe,cx as ce}from"./index-Dk8KEIKm.js";import{C as q,P as de,a as me,B as Ze}from"./PageLayout-CGcnsIyM.js";import{R as es,C as ue}from"./Grid-CThL_TW5.js";import{c as ss,m as ts}from"./node-types-SdzDwn2r.js";import{R as as}from"./repeat-CCIOgB90.js";import{L as ns,a as rs,b as ls}from"./listbox-BpBYEakW.js";import{P as os}from"./plus-BQyrUsn7.js";import{F as E,L as D,D as is}from"./fieldset-BlgsvaPV.js";import{M as Z}from"./map-pin-6ZLH5iNg.js";import{T as Re}from"./trash-2-BNWAPzrN.js";import{S as ee,K as Y}from"./KeycapButton-BcsI7tsG.js";import{C as xe}from"./ConfirmModal-n8Se2h3L.js";import{S as cs,C as ds}from"./ChatBubble-4SEgCFK2.js";import{e as ms,g as us,a as xs}from"./chat-utils-DAcFG23d.js";import{W as se}from"./wifi-BW0hMh8T.js";import{M as ps}from"./message-square-text-hT1rOeOR.js";import{K as hs}from"./key-round-CDk8iwaD.js";import"./element-movement-CrHrmJVz.js";import"./floating-DAdA6y7o.js";import"./use-text-value-XAXtIZxt.js";import"./frozen-DqtxZ1v6.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/Sensors-B48mIFqz.js b/frontend/dist/assets/Sensors-Jac5JG2X.js similarity index 97% rename from frontend/dist/assets/Sensors-B48mIFqz.js rename to frontend/dist/assets/Sensors-Jac5JG2X.js index 56db961e..bec1798a 100644 --- a/frontend/dist/assets/Sensors-B48mIFqz.js +++ b/frontend/dist/assets/Sensors-Jac5JG2X.js @@ -1 +1 @@ -import{aa as $,cx as w,j as t,B as k,dz as C,aL as N,f as P}from"./index-C8J8z7Af.js";import{P as R,a as B,B as F,C as u}from"./PageLayout-D_1HzH-E.js";import{R as A,C as L}from"./Grid-CfYPlwSW.js";function d(e){return e==null?"n/a":typeof e=="boolean"?e?"true":"false":typeof e=="number"?Number.isFinite(e)?String(e):"n/a":typeof e=="string"?e:Array.isArray(e)?e.map(d).join(", "):Object.entries(e).map(([s,r])=>`${s}: ${d(r)}`).join(" · ")}function _(e,s,r){if(s&&typeof s=="object"&&!Array.isArray(s)){Object.entries(s).forEach(([a,n])=>_(e?`${e}.${a}`:a,n,r));return}r.push([e,d(s)])}function f(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function U(e){return typeof e=="string"&&e.trim()?e:null}function S(e,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:s.split(".").reduce((r,a)=>{if(!(!r||typeof r!="object"||Array.isArray(r)))return r[a]},e)}function l(e,s=1,r=""){const a=f(e);return a===null?"n/a":`${a.toLocaleString(void 0,{maximumFractionDigits:s})}${r}`}function c(e){const s=f(e);if(s===null)return"n/a";const r=["B","KB","MB","GB","TB"];let a=s,n=0;for(;a>=1024&&n0?`${r}d ${a}h ${n}m`:`${a}h ${n}m`}function O(e){const s=f(e);return s===null?"n/a":new Date(s*1e3).toLocaleString()}function T(e){const s=U(e);return s?new Date(s).toLocaleString():"n/a"}function p({label:e,value:s}){return t.jsxs("div",{className:"rounded-lg bg-subtle-fill px-3 py-2",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:e}),t.jsx("p",{className:"mt-0.5 text-sm font-semibold leading-tight text-fg-primary break-words",children:s})]})}function m({title:e,items:s}){return t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"type-label text-fg-muted",children:e}),t.jsx("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-3",children:s.map(([r,a])=>t.jsx(p,{label:r,value:a},r))})]})}function D({data:e}){var y,j,b;const s=S(e,"temperatures"),r=(s&&typeof s=="object"&&!Array.isArray(s)?Object.entries(s):Object.entries(e).filter(([i])=>i.startsWith("temperatures.")).map(([i,o])=>[i.replace("temperatures.",""),o])).map(([i,o])=>[i,f(o)]).filter(i=>i[1]!==null);if(r.length===0)return null;const a=r.filter(([i])=>i.startsWith("nvme_")),n=r.filter(([i])=>i.startsWith("coretemp_")),x=r.find(([i])=>i.includes("pch")),h=i=>i.length?Math.max(...i.map(([,o])=>o)):null,g=i=>i.length?i.reduce((o,[,v])=>o+v,0)/i.length:null;return t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"type-label text-fg-muted",children:"Temperatures"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-4",children:[t.jsx(p,{label:"NVMe max",value:h(a)===null?"n/a":`${(y=h(a))==null?void 0:y.toFixed(1)}°C`}),t.jsx(p,{label:"CPU max",value:h(n)===null?"n/a":`${(j=h(n))==null?void 0:j.toFixed(1)}°C`}),t.jsx(p,{label:"CPU average",value:g(n)===null?"n/a":`${(b=g(n))==null?void 0:b.toFixed(1)}°C`}),t.jsx(p,{label:"PCH",value:x?`${x[1].toFixed(1)}°C`:"n/a"})]}),t.jsxs("details",{className:"rounded-lg border border-edge-subtle bg-subtle-fill/50 px-3 py-2",children:[t.jsxs("summary",{className:"cursor-pointer type-data-xs text-fg-muted hover:text-fg-secondary",children:["Show all temperature sensors (",r.length,")"]}),t.jsx("div",{className:"mt-2 grid grid-cols-2 gap-1.5 md:grid-cols-3 xl:grid-cols-4",children:r.map(([i,o])=>t.jsxs("span",{className:"rounded-md bg-surface/70 px-2 py-1 type-data-xs text-fg-secondary",children:[i,": ",o.toFixed(1),"°C"]},i))})]})]})}function E({data:e}){const s=r=>S(e,r);return t.jsxs("div",{className:"space-y-4",children:[t.jsx(m,{title:"CPU",items:[["Usage",l(s("cpu.usage_percent"),1,"%")],["Cores",l(s("cpu.count"),0)],["Frequency",l(s("cpu.frequency"),0," MHz")],["Load avg",[s("cpu.load_avg.1min"),s("cpu.load_avg.5min"),s("cpu.load_avg.15min")].map(r=>l(r,2)).join(" / ")]]}),t.jsx(m,{title:"Memory",items:[["Usage",l(s("memory.usage_percent"),1,"%")],["Used",c(s("memory.used"))],["Available",c(s("memory.available"))],["Total",c(s("memory.total"))]]}),t.jsx(m,{title:"Disk",items:[["Usage",l(s("disk.usage_percent"),1,"%")],["Used",c(s("disk.used"))],["Free",c(s("disk.free"))],["Total",c(s("disk.total"))]]}),t.jsx(m,{title:"Network",items:[["Sent",c(s("network.bytes_sent"))],["Received",c(s("network.bytes_recv"))],["Packets sent",l(s("network.packets_sent"),0)],["Packets received",l(s("network.packets_recv"),0)]]}),t.jsx(m,{title:"System",items:[["Uptime",M(s("system.uptime"))],["Boot time",O(s("system.boot_time"))],["OS",d(s("system.os"))],["Kernel",d(s("system.kernel"))],["Architecture",d(s("system.arch"))]]}),t.jsx(D,{data:e})]})}function V({data:e}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx(m,{title:"Connection",items:[["Source",d(e.source)],["URL",d(e.url)]]}),t.jsx(m,{title:"GPS",items:[["Fix",e.fix_valid?"Valid":"No fix"],["Quality",l(e.fix_quality,0)],["Latitude",l(e.latitude,6)],["Longitude",l(e.longitude,6)],["Altitude",l(e.altitude_m,1," m")],["Satellites",`${l(e.satellites_used,0)} used / ${l(e.satellites_in_view,0)} view`],["Time",T(e.datetime_utc)],["Motion",`${l(e.speed_kmh,1," km/h")} · ${l(e.course_degrees,0,"°")}`]]}),t.jsx(m,{title:"Power",items:[["Battery",`${l(e.battery_percent,0,"%")} · ${l(e.battery_voltage_v,2," V")}`],["Battery mV",l(e.battery_voltage_mv,0," mV")],["Solar charge rate",l(e.solar_charge_rate_percent_per_hour,2,"%/hr")]]})]})}function G({data:e}){const s=[];return Object.entries(e).forEach(([r,a])=>_(r,a,s)),t.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge-subtle",children:t.jsx("table",{className:"min-w-full text-sm",children:t.jsxs("tbody",{children:[s.map(([r,a])=>t.jsxs("tr",{className:"border-t first:border-t-0 border-edge-subtle",children:[t.jsx("td",{className:"p-2 text-fg-primary font-medium",children:r}),t.jsx("td",{className:"p-2 text-fg-muted break-all",children:a})]},r)),s.length===0&&t.jsx("tr",{children:t.jsx("td",{className:"p-3 text-fg-muted",children:"No fields in payload"})})]})})})}function H({reading:e}){const s=e.data??{};return e.type==="hardware_stats"||e.name==="system-health"?t.jsx(E,{data:s}):e.type==="pymc_modem"?t.jsx(V,{data:s}):t.jsx(G,{data:s})}function W(){const e=$(),s=w(n=>n.fetchStats),r=e==null?void 0:e.sensors,a=(r==null?void 0:r.readings)??[];return t.jsxs(R,{children:[t.jsx(B,{title:"Sensor Readings",icon:t.jsx(N,{}),subtitle:t.jsx("p",{className:"type-body-sm text-fg-muted",children:"Generic Repeater sensor telemetry from the centralized stats store."}),controls:t.jsxs(k,{outline:!0,onClick:()=>s({force:!0}),children:[t.jsx(C,{"data-slot":"icon"}),"Refresh"]})}),t.jsxs(F,{ready:!0,children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Enabled"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.enabled?"Yes":r?"No":"n/a"})]}),t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Running"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.running?"Yes":r?"No":"n/a"})]}),t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Configured / Loaded"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r?`${r.configured??0} / ${r.loaded??0}`:"n/a"})]}),t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Poll Interval"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:typeof(r==null?void 0:r.poll_interval_seconds)=="number"?`${r.poll_interval_seconds}s`:"n/a"})]})]}),!r&&t.jsxs(u,{children:[t.jsx("p",{className:"type-body text-fg-primary",children:"Sensor data is not available yet."}),t.jsx("p",{className:"type-body-sm text-fg-muted mt-1",children:"This backend may not expose stats.sensors, or the Repeater is still starting."})]}),r&&a.length===0&&t.jsx(u,{children:t.jsx("p",{className:"type-body text-fg-primary",children:"Sensors are configured but no readings are available yet."})}),t.jsx(A,{template:"auto",children:a.map((n,x)=>t.jsx(L,{span:"full",lg:6,children:t.jsxs(u,{neomorphic:!0,children:[t.jsx(P,{title:n.name||`Sensor ${x+1}`,icon:t.jsx(N,{})}),t.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-fg-muted mb-4",children:[t.jsxs("span",{children:["Type: ",n.type||"unknown"]}),t.jsx("span",{className:n.ok?"text-sys-green":"text-sys-red",children:n.ok?"OK":"Error"}),t.jsx("span",{children:n.timestamp?new Date(n.timestamp).toLocaleString():"no timestamp"})]}),n.error&&t.jsx("p",{className:"type-body-sm text-sys-red mb-3",children:n.error}),t.jsx(H,{reading:n})]})},`${n.name??"sensor"}-${x}`))})]})]})}export{W as default}; +import{aa as $,cx as w,j as t,B as k,dz as C,aL as N,f as P}from"./index-Dk8KEIKm.js";import{P as R,a as B,B as F,C as u}from"./PageLayout-CGcnsIyM.js";import{R as A,C as L}from"./Grid-CThL_TW5.js";function d(e){return e==null?"n/a":typeof e=="boolean"?e?"true":"false":typeof e=="number"?Number.isFinite(e)?String(e):"n/a":typeof e=="string"?e:Array.isArray(e)?e.map(d).join(", "):Object.entries(e).map(([s,r])=>`${s}: ${d(r)}`).join(" · ")}function _(e,s,r){if(s&&typeof s=="object"&&!Array.isArray(s)){Object.entries(s).forEach(([a,n])=>_(e?`${e}.${a}`:a,n,r));return}r.push([e,d(s)])}function f(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function U(e){return typeof e=="string"&&e.trim()?e:null}function S(e,s){return Object.prototype.hasOwnProperty.call(e,s)?e[s]:s.split(".").reduce((r,a)=>{if(!(!r||typeof r!="object"||Array.isArray(r)))return r[a]},e)}function l(e,s=1,r=""){const a=f(e);return a===null?"n/a":`${a.toLocaleString(void 0,{maximumFractionDigits:s})}${r}`}function c(e){const s=f(e);if(s===null)return"n/a";const r=["B","KB","MB","GB","TB"];let a=s,n=0;for(;a>=1024&&n0?`${r}d ${a}h ${n}m`:`${a}h ${n}m`}function O(e){const s=f(e);return s===null?"n/a":new Date(s*1e3).toLocaleString()}function T(e){const s=U(e);return s?new Date(s).toLocaleString():"n/a"}function p({label:e,value:s}){return t.jsxs("div",{className:"rounded-lg bg-subtle-fill px-3 py-2",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:e}),t.jsx("p",{className:"mt-0.5 text-sm font-semibold leading-tight text-fg-primary break-words",children:s})]})}function m({title:e,items:s}){return t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"type-label text-fg-muted",children:e}),t.jsx("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-3",children:s.map(([r,a])=>t.jsx(p,{label:r,value:a},r))})]})}function D({data:e}){var y,j,b;const s=S(e,"temperatures"),r=(s&&typeof s=="object"&&!Array.isArray(s)?Object.entries(s):Object.entries(e).filter(([i])=>i.startsWith("temperatures.")).map(([i,o])=>[i.replace("temperatures.",""),o])).map(([i,o])=>[i,f(o)]).filter(i=>i[1]!==null);if(r.length===0)return null;const a=r.filter(([i])=>i.startsWith("nvme_")),n=r.filter(([i])=>i.startsWith("coretemp_")),x=r.find(([i])=>i.includes("pch")),h=i=>i.length?Math.max(...i.map(([,o])=>o)):null,g=i=>i.length?i.reduce((o,[,v])=>o+v,0)/i.length:null;return t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"type-label text-fg-muted",children:"Temperatures"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-4",children:[t.jsx(p,{label:"NVMe max",value:h(a)===null?"n/a":`${(y=h(a))==null?void 0:y.toFixed(1)}°C`}),t.jsx(p,{label:"CPU max",value:h(n)===null?"n/a":`${(j=h(n))==null?void 0:j.toFixed(1)}°C`}),t.jsx(p,{label:"CPU average",value:g(n)===null?"n/a":`${(b=g(n))==null?void 0:b.toFixed(1)}°C`}),t.jsx(p,{label:"PCH",value:x?`${x[1].toFixed(1)}°C`:"n/a"})]}),t.jsxs("details",{className:"rounded-lg border border-edge-subtle bg-subtle-fill/50 px-3 py-2",children:[t.jsxs("summary",{className:"cursor-pointer type-data-xs text-fg-muted hover:text-fg-secondary",children:["Show all temperature sensors (",r.length,")"]}),t.jsx("div",{className:"mt-2 grid grid-cols-2 gap-1.5 md:grid-cols-3 xl:grid-cols-4",children:r.map(([i,o])=>t.jsxs("span",{className:"rounded-md bg-surface/70 px-2 py-1 type-data-xs text-fg-secondary",children:[i,": ",o.toFixed(1),"°C"]},i))})]})]})}function E({data:e}){const s=r=>S(e,r);return t.jsxs("div",{className:"space-y-4",children:[t.jsx(m,{title:"CPU",items:[["Usage",l(s("cpu.usage_percent"),1,"%")],["Cores",l(s("cpu.count"),0)],["Frequency",l(s("cpu.frequency"),0," MHz")],["Load avg",[s("cpu.load_avg.1min"),s("cpu.load_avg.5min"),s("cpu.load_avg.15min")].map(r=>l(r,2)).join(" / ")]]}),t.jsx(m,{title:"Memory",items:[["Usage",l(s("memory.usage_percent"),1,"%")],["Used",c(s("memory.used"))],["Available",c(s("memory.available"))],["Total",c(s("memory.total"))]]}),t.jsx(m,{title:"Disk",items:[["Usage",l(s("disk.usage_percent"),1,"%")],["Used",c(s("disk.used"))],["Free",c(s("disk.free"))],["Total",c(s("disk.total"))]]}),t.jsx(m,{title:"Network",items:[["Sent",c(s("network.bytes_sent"))],["Received",c(s("network.bytes_recv"))],["Packets sent",l(s("network.packets_sent"),0)],["Packets received",l(s("network.packets_recv"),0)]]}),t.jsx(m,{title:"System",items:[["Uptime",M(s("system.uptime"))],["Boot time",O(s("system.boot_time"))],["OS",d(s("system.os"))],["Kernel",d(s("system.kernel"))],["Architecture",d(s("system.arch"))]]}),t.jsx(D,{data:e})]})}function V({data:e}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx(m,{title:"Connection",items:[["Source",d(e.source)],["URL",d(e.url)]]}),t.jsx(m,{title:"GPS",items:[["Fix",e.fix_valid?"Valid":"No fix"],["Quality",l(e.fix_quality,0)],["Latitude",l(e.latitude,6)],["Longitude",l(e.longitude,6)],["Altitude",l(e.altitude_m,1," m")],["Satellites",`${l(e.satellites_used,0)} used / ${l(e.satellites_in_view,0)} view`],["Time",T(e.datetime_utc)],["Motion",`${l(e.speed_kmh,1," km/h")} · ${l(e.course_degrees,0,"°")}`]]}),t.jsx(m,{title:"Power",items:[["Battery",`${l(e.battery_percent,0,"%")} · ${l(e.battery_voltage_v,2," V")}`],["Battery mV",l(e.battery_voltage_mv,0," mV")],["Solar charge rate",l(e.solar_charge_rate_percent_per_hour,2,"%/hr")]]})]})}function G({data:e}){const s=[];return Object.entries(e).forEach(([r,a])=>_(r,a,s)),t.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge-subtle",children:t.jsx("table",{className:"min-w-full text-sm",children:t.jsxs("tbody",{children:[s.map(([r,a])=>t.jsxs("tr",{className:"border-t first:border-t-0 border-edge-subtle",children:[t.jsx("td",{className:"p-2 text-fg-primary font-medium",children:r}),t.jsx("td",{className:"p-2 text-fg-muted break-all",children:a})]},r)),s.length===0&&t.jsx("tr",{children:t.jsx("td",{className:"p-3 text-fg-muted",children:"No fields in payload"})})]})})})}function H({reading:e}){const s=e.data??{};return e.type==="hardware_stats"||e.name==="system-health"?t.jsx(E,{data:s}):e.type==="pymc_modem"?t.jsx(V,{data:s}):t.jsx(G,{data:s})}function W(){const e=$(),s=w(n=>n.fetchStats),r=e==null?void 0:e.sensors,a=(r==null?void 0:r.readings)??[];return t.jsxs(R,{children:[t.jsx(B,{title:"Sensor Readings",icon:t.jsx(N,{}),subtitle:t.jsx("p",{className:"type-body-sm text-fg-muted",children:"Generic Repeater sensor telemetry from the centralized stats store."}),controls:t.jsxs(k,{outline:!0,onClick:()=>s({force:!0}),children:[t.jsx(C,{"data-slot":"icon"}),"Refresh"]})}),t.jsxs(F,{ready:!0,children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Enabled"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.enabled?"Yes":r?"No":"n/a"})]}),t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Running"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.running?"Yes":r?"No":"n/a"})]}),t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Configured / Loaded"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r?`${r.configured??0} / ${r.loaded??0}`:"n/a"})]}),t.jsxs(u,{compact:!0,className:"min-h-0 p-3",children:[t.jsx("p",{className:"type-data-xs text-fg-muted",children:"Poll Interval"}),t.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:typeof(r==null?void 0:r.poll_interval_seconds)=="number"?`${r.poll_interval_seconds}s`:"n/a"})]})]}),!r&&t.jsxs(u,{children:[t.jsx("p",{className:"type-body text-fg-primary",children:"Sensor data is not available yet."}),t.jsx("p",{className:"type-body-sm text-fg-muted mt-1",children:"This backend may not expose stats.sensors, or the Repeater is still starting."})]}),r&&a.length===0&&t.jsx(u,{children:t.jsx("p",{className:"type-body text-fg-primary",children:"Sensors are configured but no readings are available yet."})}),t.jsx(A,{template:"auto",children:a.map((n,x)=>t.jsx(L,{span:"full",lg:6,children:t.jsxs(u,{neomorphic:!0,children:[t.jsx(P,{title:n.name||`Sensor ${x+1}`,icon:t.jsx(N,{})}),t.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-fg-muted mb-4",children:[t.jsxs("span",{children:["Type: ",n.type||"unknown"]}),t.jsx("span",{className:n.ok?"text-sys-green":"text-sys-red",children:n.ok?"OK":"Error"}),t.jsx("span",{children:n.timestamp?new Date(n.timestamp).toLocaleString():"no timestamp"})]}),n.error&&t.jsx("p",{className:"type-body-sm text-sys-red mb-3",children:n.error}),t.jsx(H,{reading:n})]})},`${n.name??"sensor"}-${x}`))})]})]})}export{W as default}; diff --git a/frontend/dist/assets/Sessions-DeYOFEWZ.js b/frontend/dist/assets/Sessions-CHKcpdbs.js similarity index 97% rename from frontend/dist/assets/Sessions-DeYOFEWZ.js rename to frontend/dist/assets/Sessions-CHKcpdbs.js index 1d5bfb80..890e1ce3 100644 --- a/frontend/dist/assets/Sessions-DeYOFEWZ.js +++ b/frontend/dist/assets/Sessions-CHKcpdbs.js @@ -1,4 +1,4 @@ -import{e as g,r as l,fp as O,fq as Q,eo as U,j as e,B as j,a6 as M,a4 as J,dz as V,bF as C,S as T,c as v,bX as W,eQ as X,cW as Y,cG as Z,cv as ee,c3 as se}from"./index-C8J8z7Af.js";import{C as ae}from"./ConfirmModal-B5_l2g7c.js";import{P as te,a as le,B as ie,C as E}from"./PageLayout-D_1HzH-E.js";import{R as $,C as y}from"./Grid-CfYPlwSW.js";import{C as ne}from"./circle-question-mark-CD6FHJ5H.js";import{S as ce}from"./shield-Gw0bk8jQ.js";import{A as de}from"./antenna-uOteVbHn.js";import{T as F}from"./trash-2-MzXRdjh-.js";/** +import{e as g,r as l,fp as O,fq as Q,eo as U,j as e,B as j,a6 as M,a4 as J,dz as V,bF as C,S as T,c as v,bX as W,eQ as X,cW as Y,cG as Z,cv as ee,c3 as se}from"./index-Dk8KEIKm.js";import{C as ae}from"./ConfirmModal-n8Se2h3L.js";import{P as te,a as le,B as ie,C as E}from"./PageLayout-CGcnsIyM.js";import{R as $,C as y}from"./Grid-CThL_TW5.js";import{C as ne}from"./circle-question-mark-BNRkoCvq.js";import{S as ce}from"./shield-61UHbj0K.js";import{A as de}from"./antenna-BPUiILZz.js";import{T as F}from"./trash-2-BNWAPzrN.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Setup-BgsTUkwh.js b/frontend/dist/assets/Setup-CdUlog-z.js similarity index 95% rename from frontend/dist/assets/Setup-BgsTUkwh.js rename to frontend/dist/assets/Setup-CdUlog-z.js index 45bf9a5d..b9339755 100644 --- a/frontend/dist/assets/Setup-BgsTUkwh.js +++ b/frontend/dist/assets/Setup-CdUlog-z.js @@ -1,4 +1,4 @@ -import{e as q,r as a,j as e,f as P,R as A,S as M,B as z,h as I}from"./index-C8J8z7Af.js";import{P as Z,a as D,B as O,C as o}from"./PageLayout-D_1HzH-E.js";import{n as G,g as J,a as K,b as Q,s as V}from"./setup-C1PWPTL6.js";import{W as X}from"./wrench-DY1XOTkT.js";import{R as f,C as m}from"./Grid-CfYPlwSW.js";import{W as Y}from"./wifi-5HVE8VPj.js";/** +import{e as q,r as a,j as e,f as P,R as A,S as M,B as z,h as I}from"./index-Dk8KEIKm.js";import{P as Z,a as D,B as O,C as o}from"./PageLayout-CGcnsIyM.js";import{n as G,g as J,a as K,b as Q,s as V}from"./setup-aZlM24bl.js";import{W as X}from"./wrench-2g9NYn7s.js";import{R as f,C as m}from"./Grid-CThL_TW5.js";import{W as Y}from"./wifi-BW0hMh8T.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/SignalIndicator-CpPs32QG.js b/frontend/dist/assets/SignalIndicator-DJ2WGJCI.js similarity index 99% rename from frontend/dist/assets/SignalIndicator-CpPs32QG.js rename to frontend/dist/assets/SignalIndicator-DJ2WGJCI.js index b61d021b..14c5d4cb 100644 --- a/frontend/dist/assets/SignalIndicator-CpPs32QG.js +++ b/frontend/dist/assets/SignalIndicator-DJ2WGJCI.js @@ -1,4 +1,4 @@ -import{e as l,r as m,c as i,j as r,gx as j,dI as _,eg as k}from"./index-C8J8z7Af.js";/** +import{e as l,r as m,c as i,j as r,gx as j,dI as _,eg as k}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Statistics-CGBCr-zh.js b/frontend/dist/assets/Statistics-_Ds72uPG.js similarity index 98% rename from frontend/dist/assets/Statistics-CGBCr-zh.js rename to frontend/dist/assets/Statistics-_Ds72uPG.js index 619062e6..cba36928 100644 --- a/frontend/dist/assets/Statistics-CGBCr-zh.js +++ b/frontend/dist/assets/Statistics-_Ds72uPG.js @@ -1,4 +1,4 @@ -var Ht=Object.defineProperty;var Bt=(t,s,n)=>s in t?Ht(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var we=(t,s,n)=>Bt(t,typeof s!="symbol"?s+"":s,n);import{e as Oe,r as l,j as e,L as Ve,c as mt,P as _t,cH as Tt,cI as qe,y as Ie,cJ as $t,$ as Pe,cK as zt,cp as Te,cL as Wt,cM as Ut,z as Gt,ci as Vt,cN as qt,cO as Xt,cP as Kt,cQ as Yt,cR as Zt,cc as Qt,cS as Xe,cf as Jt,cT as es,cU as ts,f as Ee,cV as ss,bX as dt,c3 as ns,ah as Rt,ai as as,cW as is,bI as rs,aa as ls,ae as os,ad as cs,W as ms,aN as ds,aO as us,af as hs,ax as xs,cX as Ke,al as ps,cY as ut,au as fs,R as gs,cZ as ys}from"./index-C8J8z7Af.js";import{L as De}from"./layers-Dy827Q5R.js";import{u as lt,h as bs,r as ot}from"./consumer-registry-BKgTBvt8.js";import{e as js}from"./easing-CQ2FiqiW.js";import{C as Ye}from"./compass--Ql4hKkC.js";import{T as vs}from"./TimeRangeStepper-D6X8K2qC.js";import{C as be,P as Ns,a as ws,B as ks}from"./PageLayout-D_1HzH-E.js";import{A as Ze,D as ze}from"./DataValue-CWEIHPTl.js";import{C as Ss}from"./CollisionExplorerModal-bQOWAc0q.js";import{H as ht}from"./hash-8dFF62ov.js";import{L as We}from"./LightSparkline-DUJ9rwBo.js";import{A as Ms}from"./activity-Bh2DzqDM.js";import{c as Cs,a as As,A as _s}from"./AnalyzerFilterPanel-CBecqjNU.js";import{useResolveSource as Ts}from"./usePipelineStore-CtpzsDw6.js";import{M as Rs}from"./MqttModeBadge-D5EDDcC2.js";import{R as Ae,C as Le}from"./Grid-CfYPlwSW.js";import{S as Es}from"./settings-2-BrtUmS4l.js";import{N as Is}from"./network-BNx67sOl.js";import"./chevron-right-ZaDPsavE.js";import"./floating-DcVaWvZe.js";import"./index-CSWZC0QG.js";import"./index-DAnUKwME.js";import"./BasemapLayer-BvoQWTC4.js";import"./layer-DgtbTXVx.js";import"./map-pin-ufrVZcS3.js";import"./share-2-PheBENSj.js";import"./node-types-B5WxOxT2.js";import"./circle-question-mark-CD6FHJ5H.js";import"./funnel-CRYMLc9L.js";import"./search-BO7ZBfwt.js";/** +var Ht=Object.defineProperty;var Bt=(t,s,n)=>s in t?Ht(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var we=(t,s,n)=>Bt(t,typeof s!="symbol"?s+"":s,n);import{e as Oe,r as l,j as e,L as Ve,c as mt,P as _t,cH as Tt,cI as qe,y as Ie,cJ as $t,$ as Pe,cK as zt,cp as Te,cL as Wt,cM as Ut,z as Gt,ci as Vt,cN as qt,cO as Xt,cP as Kt,cQ as Yt,cR as Zt,cc as Qt,cS as Xe,cf as Jt,cT as es,cU as ts,f as Ee,cV as ss,bX as dt,c3 as ns,ah as Rt,ai as as,cW as is,bI as rs,aa as ls,ae as os,ad as cs,W as ms,aN as ds,aO as us,af as hs,ax as xs,cX as Ke,al as ps,cY as ut,au as fs,R as gs,cZ as ys}from"./index-Dk8KEIKm.js";import{L as De}from"./layers-g7u6rTYv.js";import{u as lt,h as bs,r as ot}from"./consumer-registry-CTHycSys.js";import{e as js}from"./easing-x6QsY02F.js";import{C as Ye}from"./compass-DJByH8FZ.js";import{T as vs}from"./TimeRangeStepper-CNBzSSfG.js";import{C as be,P as Ns,a as ws,B as ks}from"./PageLayout-CGcnsIyM.js";import{A as Ze,D as ze}from"./DataValue-D1URDV5k.js";import{C as Ss}from"./CollisionExplorerModal-5AGT-1cv.js";import{H as ht}from"./hash-BaVtxU1B.js";import{L as We}from"./LightSparkline-eR-H8PYv.js";import{A as Ms}from"./activity-D99FIjaW.js";import{c as Cs,a as As,A as _s}from"./AnalyzerFilterPanel-CwOmGxBn.js";import{useResolveSource as Ts}from"./usePipelineStore-C2CKtblH.js";import{M as Rs}from"./MqttModeBadge-CijH65Eh.js";import{R as Ae,C as Le}from"./Grid-CThL_TW5.js";import{S as Es}from"./settings-2-CTbt3KT5.js";import{N as Is}from"./network-BgtOii-i.js";import"./chevron-right-BugwEnle.js";import"./floating-DAdA6y7o.js";import"./index-M6ru5Gad.js";import"./index-DMeWa3DH.js";import"./BasemapLayer-snfcoHal.js";import"./layer-CgHNe4F2.js";import"./map-pin-6ZLH5iNg.js";import"./share-2-CopKWuTH.js";import"./node-types-SdzDwn2r.js";import"./circle-question-mark-BNRkoCvq.js";import"./funnel-B-Z6Air3.js";import"./search-DgakOYk2.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/System-BGDb6bt1.js b/frontend/dist/assets/System-DKJZzfFT.js similarity index 98% rename from frontend/dist/assets/System-BGDb6bt1.js rename to frontend/dist/assets/System-DKJZzfFT.js index e340145b..6509a15c 100644 --- a/frontend/dist/assets/System-BGDb6bt1.js +++ b/frontend/dist/assets/System-DKJZzfFT.js @@ -1,4 +1,4 @@ -import{e as ee,aG as A,V as B,r as l,Q as J,j as e,dZ as Y,c as F,bX as se,f as E,d_ as te,d$ as re,e0 as ne,e1 as ae,cH as oe,B as le,dz as ce,h as ie,e2 as de,e3 as G}from"./index-C8J8z7Af.js";import{C as P,P as me,a as ue,B as xe}from"./PageLayout-D_1HzH-E.js";import{A as fe}from"./arrow-up-CsqMGTbi.js";import{N as he}from"./network-BNx67sOl.js";import{A as pe}from"./arrow-down-Dqy7bDoY.js";import{T as ge}from"./thermometer-JkoQlooZ.js";import{A as L}from"./activity-Bh2DzqDM.js";import{R as H,C as $}from"./Grid-CfYPlwSW.js";/** +import{e as ee,aG as A,V as B,r as l,Q as J,j as e,dZ as Y,c as F,bX as se,f as E,d_ as te,d$ as re,e0 as ne,e1 as ae,cH as oe,B as le,dz as ce,h as ie,e2 as de,e3 as G}from"./index-Dk8KEIKm.js";import{C as P,P as me,a as ue,B as xe}from"./PageLayout-CGcnsIyM.js";import{A as fe}from"./arrow-up-BhSGIVnk.js";import{N as he}from"./network-BgtOii-i.js";import{A as pe}from"./arrow-down-B85BrN7t.js";import{T as ge}from"./thermometer-CwnqiDCo.js";import{A as L}from"./activity-D99FIjaW.js";import{R as H,C as $}from"./Grid-CThL_TW5.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Terminal-BBjIRbrg.js b/frontend/dist/assets/Terminal-BQAZsGyf.js similarity index 99% rename from frontend/dist/assets/Terminal-BBjIRbrg.js rename to frontend/dist/assets/Terminal-BQAZsGyf.js index 4b11805e..1ec19310 100644 --- a/frontend/dist/assets/Terminal-BBjIRbrg.js +++ b/frontend/dist/assets/Terminal-BQAZsGyf.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 M=(e,t,s)=>ja(e,typeof t!="symbol"?t+"":t,s);import{e as li,Z as is,V as ve,ec as Ka,ed as rt,ee as ei,ef as qa,eg as xo,dF as ko,dG as Va,a1 as Eo,eh as Ga,ei as Ya,ej as Xa,bG as Ja,ek as Za,cw as Qa,w as Ro,dE as el,bP as tl,el as sl,c8 as Bo,em as ce,bH as il,P as rl,c6 as nl,cx as xt,en as ol,eo as al,ep as ll,dx as hl,e3 as Ur,eq as vs,er as Lo,es as Do,et as Mo,j as m,ay as To,aH as $o,aA as jr,az as Ao,B as cl,r as U,d as _i,m as $s,eu as Kr,ev as qr,c$ as dl,ew as ul,c as ti,ex as fl,ey as _l,aa as pl,ez as ml,eA as gl,eB as vl}from"./index-C8J8z7Af.js";import{g as Sl}from"./transport-UEOv7eJu.js";import{r as yl}from"./system-CzT5Ikli.js";import{P as wl,B as bl,C as Cl}from"./PageLayout-D_1HzH-E.js";import{K as Po,S as xl}from"./KeycapButton-LnaBrSq2.js";import{S as Vr}from"./search-BO7ZBfwt.js";import{C as kl}from"./chevron-right-ZaDPsavE.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 M=(e,t,s)=>ja(e,typeof t!="symbol"?t+"":t,s);import{e as li,Z as is,V as ve,ec as Ka,ed as rt,ee as ei,ef as qa,eg as xo,dF as ko,dG as Va,a1 as Eo,eh as Ga,ei as Ya,ej as Xa,bG as Ja,ek as Za,cw as Qa,w as Ro,dE as el,bP as tl,el as sl,c8 as Bo,em as ce,bH as il,P as rl,c6 as nl,cx as xt,en as ol,eo as al,ep as ll,dx as hl,e3 as Ur,eq as vs,er as Lo,es as Do,et as Mo,j as m,ay as To,aH as $o,aA as jr,az as Ao,B as cl,r as U,d as _i,m as $s,eu as Kr,ev as qr,c$ as dl,ew as ul,c as ti,ex as fl,ey as _l,aa as pl,ez as ml,eA as gl,eB as vl}from"./index-Dk8KEIKm.js";import{g as Sl}from"./transport-DFMEelmb.js";import{r as yl}from"./system-CChwfvfT.js";import{P as wl,B as bl,C as Cl}from"./PageLayout-CGcnsIyM.js";import{K as Po,S as xl}from"./KeycapButton-BcsI7tsG.js";import{S as Vr}from"./search-DgakOYk2.js";import{C as kl}from"./chevron-right-BugwEnle.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/openhop-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`,Ha=`${Wt}32m`,Fr=`${Wt}33m`,Wr=`${Wt}31m`,Mf=`${Wt}36m`,Lt=`${Wt}90m`,Fa=`${Wt}1m`;function Xt(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 Tf(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?Fr:Ha,o=`${n}${"█".repeat(i)}${Oe}${Lt}${"░".repeat(r)}${Oe}`,a=`${s.toFixed(1)}%`.padStart(6);return`[${o}] ${n}${a}${Oe}`}function $f(e){return e>=80?`${Wr}${Fa}${e.toFixed(1)}°C${Oe}`:e>=60?`${Fr}${e.toFixed(1)}°C${Oe}`:`${Ha}${e.toFixed(1)}°C${Oe}`}const Cs=2,fo=" ";function Jt(e,t){const s=" ".repeat(Cs),i=t-Cs,r=fo.length,n=[];let o="",a=0;for(const h of e){const l=fu(h);a===0?(o=h,a=l):a+r+l<=i?(o+=fo+h,a+=r+l):(n.push(s+o),o=h,a=l)}return a>0&&n.push(s+o),n}function Af(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[` ${Mf}${Fa}${i}${Oe} ${Lt}${r}${Oe}`,` ${Lt}${"─".repeat(a)}${Oe}`,...Jt([b("Sys",y(n)),b("Svc",y(o)),b("Load",y(c))],s)]}function Pf(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=`${Xt(e.memory.used)}/${Xt(e.memory.total)}`,c=`${Xt(e.disk.used)}/${Xt(e.disk.total)}`,d=(_,f,p)=>{const g=Tf(f,r),k=o>=p.length?` ${Pe(p)}`:"";return` ${w(_.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 _=u.map(([f,p])=>`${Pe(f+":")} ${$f(p)}`);a.push(...Jt(_,t))}return a}function Nf(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([b("Mode",y(n)),b("Nbrs",`${y(String(r))}${Pe(`/${i}`)}`),b("Noise",y(o)),b("Air",y(`${a.toFixed(1)}%`))],t)),h.push(...Jt([b("RX",y(String(e.rx_count??0))),b("TX",y(String(e.tx_count??0))),b("FWD",y(String(e.forwarded_count??0))),b("Drop",y(String(e.dropped_count??0)))],t)),h.push(...Jt([b("RX/h",y(String(Math.round(e.rx_per_hour??0)))),b("FWD/h",y(String(Math.round(e.forwarded_per_hour??0))))],t)),h}function If(e,t){if(!e.network)return[];const s=["",` ${Lt}NET${Oe}`];return s.push(...Jt([b("TX",y(Xt(e.network.bytes_sent))),b("RX",y(Xt(e.network.bytes_recv))),b("Pkt",`${y(String(e.network.packets_sent))}${Pe("/")}${y(String(e.network.packets_recv))}`)],t)),s}function Of(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}`],_=(i?"PID".padEnd(o):"")+"CPU".padStart(r)+"MEM".padStart(n)+" NAME";u.push(` ${Pe(_)}`);for(const f of e.slice(0,d)){const p=i?Pe(String(f.pid).padEnd(o)):"",g=(t>=50?f.cpu_percent.toFixed(1):f.cpu_percent.toFixed(0)).padStart(r),k=(t>=50?f.memory_percent.toFixed(1):f.memory_percent.toFixed(0)).padStart(n),q=f.name.length>h?f.name.slice(0,h-1)+"…":f.name,H=f.cpu_percent>=50?Wr:f.cpu_percent>=20?Fr:"",T=H?`${H}${g}${Oe}`:g;u.push(` ${p}${T}${Pe(k)} ${q}`)}return u}function Hf(){return new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function _o(e,t,s,i,r){if(!e||!t)return` ${Lt}Waiting for data…${Oe}`;const n=Af(e,t,i),o=Pf(t,i),a=Nf(e,i),h=If(t,i),l=["",` ${Lt}${Hf()} · Ctrl+C to exit${Oe}`],c=[...n,...o,...a,...h,...l],d=r?wr(c,i):0,u=r?Math.max(0,r-d):void 0,_=Of(s,i,u),f=[...c.slice(0,-l.length),..._,...l];return r&&f.length>r&&(f.length=r),f.join(` `)}const Ff=3e3;class Wf extends ie{constructor(){super(...arguments);M(this,"name","top");M(this,"description","Live system overview (Ctrl+C to exit)");M(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"),` ${w("Live-updating system overview combining hardware")}`,` ${w("stats, mesh metrics, and running processes.")}`,` ${w("Refreshes every 3s. Press Ctrl+C to exit.")}`,"",B("top","start live display"),"",z("Sections"),` ${w("Header Node name, version, uptime, load average")}`,` ${w("Gauges CPU, memory, disk usage with bar charts")}`,` ${w("Mesh Mode, neighbors, packet counts, airtime")}`,` ${w("Network TCP/IP bytes and packet counters")}`,` ${w("Processes Top 8 processes by CPU usage")}`,"",z("Aliases"),` ${w("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)=>f.cpu_percent-_.cpu_percent))}catch{}if(!n.aborted){(l=s.enterFullscreen)==null||l.call(s);try{const d=s.write(_o(h,o,a,s.cols??r,s.rows));await new Promise(u=>{if(n.aborted){u();return}const _=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,_o(h,o,a,s.cols??r,s.rows))},f=setInterval(()=>{if(n.aborted){clearInterval(f),u();return}_()},Ff);n.addEventListener("abort",()=>{clearInterval(f),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 zf(e){const t=s=>e(s.detail);return Cr.addEventListener(xr,t),()=>Cr.removeEventListener(xr,t)}class Uf extends ie{constructor(){super(...arguments);M(this,"name","fortune");M(this,"description","Display a fortune on the header");M(this,"aliases",["lol"])}execute({output:s}){const i=zr();Wa(i),s.write(w(` ${i}`))}}const kr=new EventTarget,Er="party-time";function jf(){kr.dispatchEvent(new Event(Er))}function Kf(e){return kr.addEventListener(Er,e),()=>kr.removeEventListener(Er,e)}class qf extends ie{constructor(){super(...arguments);M(this,"name","partytime");M(this,"description","Party on, Garth!");M(this,"aliases",["party","excellent","waynesworld"])}execute({output:s}){jf(),Wa("PARTY 0N GARTH"),s.write(w(" SCHWING!"))}}class Vf extends ie{constructor(){super(...arguments);M(this,"name","ver");M(this,"description","Show version info");M(this,"aliases",["version"])}async execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("ver"),` ${w("Display openHop Repeater, core, and console version.")}`,` ${w('Equivalent to firmware serial CLI "ver" command.')}`,"",B("ver","show version"),"",z("Aliases"),` ${w("version")}`].join(` -`));return}const r=s.write("processing...","system");try{const n=await rt();s.update(r,[` ${b("openHop Repeater",y(`v${n.version||"?"}`))}`,` ${b("MeshCore",y(n.core_version||"?"))}`,` ${b("openHop Console",y("v0.9.335"))}`].join(` +`));return}const r=s.write("processing...","system");try{const n=await rt();s.update(r,[` ${b("openHop Repeater",y(`v${n.version||"?"}`))}`,` ${b("MeshCore",y(n.core_version||"?"))}`,` ${b("openHop Console",y("v0.9.336"))}`].join(` `),"value")}catch(n){s.update(r,`Error: ${n instanceof Error?n.message:"Command failed"}`,"error")}}}class Gf extends ie{constructor(){super(...arguments);M(this,"name","clock");M(this,"description","Show system UTC time")}execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("clock"),` ${w("Display the current system UTC time.")}`,` ${w('Equivalent to firmware serial CLI "clock" command.')}`,` ${w("Use to verify NTP sync and correlate packet timestamps.")}`,"",B("clock","show UTC time")].join(` `));return}const r=new Date;s.write([` ${b("UTC",y(r.toUTCString()))}`,` ${b("ISO",y(r.toISOString()))}`,` ${b("Unix",y(String(Math.floor(r.getTime()/1e3))))}`].join(` `),"value")}}class Yf extends ie{constructor(){super(...arguments);M(this,"name","stats-packets");M(this,"description","Packet counters")}async execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("stats-packets"),` ${w("Display packet counters: sent, received, forwarded, dropped.")}`,` ${w('Equivalent to firmware serial CLI "stats-packets" command.')}`,"",B("stats-packets","show packet counters")].join(` diff --git a/frontend/dist/assets/Test-D678G5-N.js b/frontend/dist/assets/Test-DmWI6JzW.js similarity index 99% rename from frontend/dist/assets/Test-D678G5-N.js rename to frontend/dist/assets/Test-DmWI6JzW.js index 48dc2cbb..40d66c33 100644 --- a/frontend/dist/assets/Test-D678G5-N.js +++ b/frontend/dist/assets/Test-DmWI6JzW.js @@ -1,4 +1,4 @@ -import{e as Ae,r as p,gB as _e,gC as Ie,ah as Be,ai as Ve,j as e,f as U,$ as ye,dz as He,d6 as qe,c as le,aB as We,W as Xe,aa as Ye,gD as ze,V as $,cp as O,x as Oe,c7 as Ge,bX as Je,N as me,Z,gE as Qe,Q as xe}from"./index-C8J8z7Af.js";import{C as Q,P as Ke,a as Ue,B as De}from"./PageLayout-D_1HzH-E.js";import{useResolveSource as Ze}from"./usePipelineStore-CtpzsDw6.js";import{C as et}from"./chevron-right-ZaDPsavE.js";import{R as se,C as ae}from"./Grid-CfYPlwSW.js";import"./node-types-B5WxOxT2.js";/** +import{e as Ae,r as p,gB as _e,gC as Ie,ah as Be,ai as Ve,j as e,f as U,$ as ye,dz as He,d6 as qe,c as le,aB as We,W as Xe,aa as Ye,gD as ze,V as $,cp as O,x as Oe,c7 as Ge,bX as Je,N as me,Z,gE as Qe,Q as xe}from"./index-Dk8KEIKm.js";import{C as Q,P as Ke,a as Ue,B as De}from"./PageLayout-CGcnsIyM.js";import{useResolveSource as Ze}from"./usePipelineStore-C2CKtblH.js";import{C as et}from"./chevron-right-BugwEnle.js";import{R as se,C as ae}from"./Grid-CThL_TW5.js";import"./node-types-SdzDwn2r.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/TimeRangeStepper-D6X8K2qC.js b/frontend/dist/assets/TimeRangeStepper-CNBzSSfG.js similarity index 98% rename from frontend/dist/assets/TimeRangeStepper-D6X8K2qC.js rename to frontend/dist/assets/TimeRangeStepper-CNBzSSfG.js index 739879ca..04034cb1 100644 --- a/frontend/dist/assets/TimeRangeStepper-D6X8K2qC.js +++ b/frontend/dist/assets/TimeRangeStepper-CNBzSSfG.js @@ -1,4 +1,4 @@ -import{aU as Ge,bf as ve,d7 as Le,d8 as $e,aW as Ve,aV as q,r as l,aZ as We,a_ as ee,b2 as z,b1 as U,aQ as k,b5 as W,d9 as se,da as _e,ba as He,bb as Ke,bg as Ye,bc as re,bh as Qe,bd as me,db as Be,dc as H,dd as M,de as A,df as he,dg as ge,be as le,br as x,dh as ye,di as Pe,bi as we,bp as Xe,bj as Fe,bk as Oe,bl as J,bm as Ze,bn as qe,bq as Ee,dj as ze,dk as Te,bs as Ue,dl as Je,dm as et,bt as Ie,dn as tt,dp as nt,dq as at,aR as ot,dr as st,bz as rt,ds as lt,dt as ut,du as je,bB as it,bD as ce,e as ct,j as I,c as V,d as dt,m as pt,c$ as ft}from"./index-C8J8z7Af.js";import{C as bt}from"./chevron-right-ZaDPsavE.js";import{F as vt,y as mt,R as ht,T as yt,w as Pt,A as $t}from"./floating-DcVaWvZe.js";var gt=Object.defineProperty,xt=(e,n,t)=>n in e?gt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n,t)=>(xt(e,typeof n!="symbol"?n+"":n,t),t),$=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))($||{}),St=(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))(St||{});let Ct={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 xe extends Ge{constructor(n){super(n),ke(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let b=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;b==null||b.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})}),ke(this,"selectors",{isPortalled:t=>{var b;if(!t.button||!t.panel)return!1;let h=(b=Le(t.button))!=null?b:document;for(let g of h.querySelectorAll("body > *"))if(Number(g==null?void 0:g.contains(t.button))^Number(g==null?void 0:g.contains(t.panel)))return!0;let v=$e(h),r=v.indexOf(t.button),a=(r+v.length-1)%v.length,C=(r+1)%v.length,y=v[a],s=v[C];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,b=Ve.get(null);this.on(0,()=>b.actions.push(t)),this.on(1,()=>b.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new xe({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 q(t.type,Ct,n,t)}}const Ne=l.createContext(null);function de(e){let n=l.useContext(Ne);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function wt({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>xe.new({id:e,__demoMode:n}),[]);return We(()=>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 It(){return l.useContext(pe)}let kt="div";function _t(e,n){var t;let b=l.useId(),{__demoMode:h=!1,...v}=e,r=wt({id:b,__demoMode:h}),a=l.useRef(null),C=U(n,Je(u=>{a.current=u})),[y,s,g,S,_]=z(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),w=et((t=a.current)!=null?t:s),p=Ie(S),d=Ie(_),f=l.useMemo(()=>({buttonId:p,panelId:d,close:r.actions.close}),[p,d,r]),P=De(),i=P==null?void 0:P.registerPopover,B=k(()=>{var u,F;let E=se((u=a.current)!=null?u:s);return(F=P==null?void 0:P.isFocusWithinPopoverGroup())!=null?F:E&&((s==null?void 0:s.contains(E))||(g==null?void 0:g.contains(E)))});l.useEffect(()=>i==null?void 0:i(f),[i,f]);let[te,ne]=tt(),G=nt(s),D=at({mainTreeNode:G,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});ot(w,"focus",u=>{var F,E,j,X,N,Z;u.target!==window&&st(u.target)&&r.state.popoverState===$.Open&&(B()||r.state.button&&r.state.panel&&(D.contains(u.target)||(E=(F=r.state.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&E.call(F,u.target)||(X=(j=r.state.afterPanelSentinel.current)==null?void 0:j.contains)!=null&&X.call(j,u.target)||(Z=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&Z.call(N,u.target)||r.actions.close()))},!0);let K=y===$.Open;rt(K,D.resolveContainers,(u,F)=>{r.actions.close(),lt(F,ut.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===$.Open,close:r.actions.refocusableClose}),oe=z(r,l.useCallback(u=>q(u.popoverState,{[$.Open]:J.Open,[$.Closed]:J.Closed}),[])),Y={ref:C},Q=le();return x.createElement(je,{node:G},x.createElement($t,null,x.createElement(pe.Provider,{value:null},x.createElement(Ne.Provider,{value:r},x.createElement(Te,{value:r.actions.refocusableClose},x.createElement(it,{value:oe},x.createElement(ne,null,Q({ourProps:Y,theirProps:v,slot:ae,defaultTag:kt,name:"Popover"}))))))))}let Bt="button";function Ft(e,n){let t=l.useId(),{id:b=`headlessui-popover-button-${t}`,disabled:h=!1,autoFocus:v=!1,...r}=e,a=de("Popover.Button"),[C,y,s,g,S,_,w]=z(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),p=l.useRef(null),d=`headlessui-focus-sentinel-${l.useId()}`,f=De(),P=f==null?void 0:f.closeOthers,i=It()!==null;l.useEffect(()=>{if(!i)return a.actions.setButtonId(b),()=>a.actions.setButtonId(null)},[i,b,a]);let[B]=l.useState(()=>Symbol()),te=U(p,n,vt(),k(o=>{if(!i){if(o)a.state.buttons.current.push(B);else{let c=a.state.buttons.current.indexOf(B);c!==-1&&a.state.buttons.current.splice(c,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=U(p,n),G=k(o=>{var c,O,T;if(i){if(a.state.popoverState===$.Closed)return;switch(o.key){case W.Space:case W.Enter:o.preventDefault(),(O=(c=o.target).click)==null||O.call(c),a.actions.close(),(T=a.state.button)==null||T.focus();break}}else switch(o.key){case W.Space:case W.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close();break;case W.Escape:if(a.state.popoverState!==$.Open)return P==null?void 0:P(a.state.buttonId);if(!p.current)return;let R=se(p.current);if(R&&!p.current.contains(R))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),D=k(o=>{i||o.key===W.Space&&o.preventDefault()}),K=k(o=>{var c,O;_e(o.currentTarget)||h||(i?(a.actions.close(),(c=a.state.button)==null||c.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close(),(O=a.state.button)==null||O.focus()))}),ae=k(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Y}=He({autoFocus:v}),{isHovered:Q,hoverProps:u}=Ke({isDisabled:h}),{pressed:F,pressProps:E}=Ye({disabled:h}),j=C===$.Open,X=re({open:j,active:F||j,disabled:h,hover:Q,focus:oe,autofocus:v}),N=Qe(e,s),Z=i?me({ref:ne,type:N,onKeyDown:G,onClick:K,disabled:h||void 0,autoFocus:v},Y,u,E):me({ref:te,id:g,type:N,"aria-expanded":C===$.Open,"aria-controls":S?_:void 0,disabled:h||void 0,autoFocus:v,onKeyDown:G,onKeyUp:D,onClick:K,onMouseDown:ae},Y,u,E),ue=Be(),fe=k(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function c(){q(ue.current,{[M.Forwards]:()=>H(o,A.First),[M.Backwards]:()=>H(o,A.Last)})===he.Error&&H($e(ge(a.state.button)).filter(O=>O.dataset.headlessuiFocusGuard!=="true"),q(ue.current,{[M.Forwards]:A.Next,[M.Backwards]:A.Previous}),{relativeTo:a.state.button})}c()}),m=le();return x.createElement(x.Fragment,null,m({ourProps:Z,theirProps:r,slot:X,defaultTag:Bt,name:"Popover.Button"}),j&&!i&&y&&x.createElement(ye,{id:d,ref:w,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Ot="div",Et=ce.RenderStrategy|ce.Static;function Re(e,n){let t=l.useId(),{id:b=`headlessui-popover-backdrop-${t}`,transition:h=!1,...v}=e,r=de("Popover.Backdrop"),a=z(r,l.useCallback(f=>f.popoverState,[])),[C,y]=l.useState(null),s=U(n,y),g=Fe(),[S,_]=Oe(h,C,g!==null?(g&J.Open)===J.Open:a===$.Open),w=k(f=>{if(_e(f.currentTarget))return f.preventDefault();r.actions.close()}),p=re({open:a===$.Open}),d={ref:s,id:b,"aria-hidden":!0,onClick:w,...Ee(_)};return le()({ourProps:d,theirProps:v,slot:p,defaultTag:Ot,features:Et,visible:S,name:"Popover.Backdrop"})}let Tt="div",jt=ce.RenderStrategy|ce.Static;function Nt(e,n){let t=l.useId(),{id:b=`headlessui-popover-panel-${t}`,focus:h=!1,anchor:v,portal:r=!1,modal:a=!1,transition:C=!1,...y}=e,s=de("Popover.Panel"),g=z(s,s.selectors.isPortalled),[S,_,w,p,d]=z(s,l.useCallback(m=>[m.popoverState,m.button,m.__demoMode,m.beforePanelSentinel,m.afterPanelSentinel],[])),f=`headlessui-focus-sentinel-before-${t}`,P=`headlessui-focus-sentinel-after-${t}`,i=l.useRef(null),B=mt(v),[te,ne]=ht(B),G=yt();B&&(r=!0);let[D,K]=l.useState(null),ae=U(i,n,B?te:null,s.actions.setPanel,K),oe=we(_),Y=we(i.current);Xe(()=>(s.actions.setPanelId(b),()=>s.actions.setPanelId(null)),[b,s]);let Q=Fe(),[u,F]=Oe(C,D,Q!==null?(Q&J.Open)===J.Open:S===$.Open);Ze(u,_,s.actions.close),qe(w?!1:a&&u,Y);let E=k(m=>{var o;switch(m.key){case W.Escape:if(s.state.popoverState!==$.Open||!i.current)return;let c=se(i.current);if(c&&!i.current.contains(c))return;m.preventDefault(),m.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var m;e.static||S===$.Closed&&((m=e.unmount)==null||m)&&s.actions.setPanel(null)},[S,e.unmount,e.static,s]),l.useEffect(()=>{if(w||!h||S!==$.Open||!i.current)return;let m=se(i.current);i.current.contains(m)||H(i.current,A.First)},[w,h,i.current,S]);let j=re({open:S===$.Open,close:s.actions.refocusableClose}),X=me(B?G():{},{ref:ae,id:b,onKeyDown:E,onBlur:h&&S===$.Open?m=>{var o,c,O,T,R;let L=m.relatedTarget;L&&i.current&&((o=i.current)!=null&&o.contains(L)||(s.actions.close(),((O=(c=p.current)==null?void 0:c.contains)!=null&&O.call(c,L)||(R=(T=d.current)==null?void 0:T.contains)!=null&&R.call(T,L))&&L.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":Pt(u,_,!0).width},...Ee(F)}),N=Be(),Z=k(()=>{let m=i.current;if(!m)return;function o(){q(N.current,{[M.Forwards]:()=>{var c;H(m,A.First)===he.Error&&((c=s.state.afterPanelSentinel.current)==null||c.focus())},[M.Backwards]:()=>{var c;(c=s.state.button)==null||c.focus({preventScroll:!0})}})}o()}),ue=k(()=>{let m=i.current;if(!m)return;function o(){q(N.current,{[M.Forwards]:()=>{var c;if(!s.state.button)return;let O=(c=ge(s.state.button))!=null?c:document.body,T=$e(O),R=T.indexOf(s.state.button),L=T.slice(0,R+1),ie=[...T.slice(R+1),...L];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,A.First,{sorted:!1})},[M.Backwards]:()=>{var c;H(m,A.Previous)===he.Error&&((c=s.state.button)==null||c.focus())}})}o()}),fe=le();return x.createElement(ze,null,x.createElement(pe.Provider,{value:b},x.createElement(Te,{value:s.actions.refocusableClose},x.createElement(Ue,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&g&&x.createElement(ye,{id:f,ref:p,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:Z}),fe({ourProps:X,theirProps:y,slot:j,defaultTag:Tt,features:jt,visible:u,name:"Popover.Panel"}),u&&g&&x.createElement(ye,{id:P,ref:d,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Dt="div";function Rt(e,n){let t=l.useRef(null),b=U(t,n),[h,v]=l.useState([]),r=k(p=>{v(d=>{let f=d.indexOf(p);if(f!==-1){let P=d.slice();return P.splice(f,1),P}return d})}),a=k(p=>(v(d=>[...d,p]),()=>r(p))),C=k(()=>{var p;let d=ge(t.current);if(!d)return!1;let f=se(t.current);return(p=t.current)!=null&&p.contains(f)?!0:h.some(P=>{var i,B;return((i=d.getElementById(P.buttonId.current))==null?void 0:i.contains(f))||((B=d.getElementById(P.panelId.current))==null?void 0:B.contains(f))})}),y=k(p=>{for(let d of h)d.buttonId.current!==p&&d.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:C,closeOthers:y}),[a,r,C,y]),g=re({}),S=e,_={ref:b},w=le();return x.createElement(je,null,x.createElement(Se.Provider,{value:s},w({ourProps:_,theirProps:S,slot:g,defaultTag:Dt,name:"Popover.Group"})))}let Mt=ee(_t),Me=ee(Ft),At=ee(Re),Gt=ee(Re),Ae=ee(Nt),Lt=ee(Rt),Vt=Object.assign(Mt,{Button:Me,Backdrop:Gt,Overlay:At,Panel:Ae,Group:Lt});/** +import{aU as Ge,bf as ve,d7 as Le,d8 as $e,aW as Ve,aV as q,r as l,aZ as We,a_ as ee,b2 as z,b1 as U,aQ as k,b5 as W,d9 as se,da as _e,ba as He,bb as Ke,bg as Ye,bc as re,bh as Qe,bd as me,db as Be,dc as H,dd as M,de as A,df as he,dg as ge,be as le,br as x,dh as ye,di as Pe,bi as we,bp as Xe,bj as Fe,bk as Oe,bl as J,bm as Ze,bn as qe,bq as Ee,dj as ze,dk as Te,bs as Ue,dl as Je,dm as et,bt as Ie,dn as tt,dp as nt,dq as at,aR as ot,dr as st,bz as rt,ds as lt,dt as ut,du as je,bB as it,bD as ce,e as ct,j as I,c as V,d as dt,m as pt,c$ as ft}from"./index-Dk8KEIKm.js";import{C as bt}from"./chevron-right-BugwEnle.js";import{F as vt,y as mt,R as ht,T as yt,w as Pt,A as $t}from"./floating-DAdA6y7o.js";var gt=Object.defineProperty,xt=(e,n,t)=>n in e?gt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n,t)=>(xt(e,typeof n!="symbol"?n+"":n,t),t),$=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))($||{}),St=(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))(St||{});let Ct={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 xe extends Ge{constructor(n){super(n),ke(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let b=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;b==null||b.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})}),ke(this,"selectors",{isPortalled:t=>{var b;if(!t.button||!t.panel)return!1;let h=(b=Le(t.button))!=null?b:document;for(let g of h.querySelectorAll("body > *"))if(Number(g==null?void 0:g.contains(t.button))^Number(g==null?void 0:g.contains(t.panel)))return!0;let v=$e(h),r=v.indexOf(t.button),a=(r+v.length-1)%v.length,C=(r+1)%v.length,y=v[a],s=v[C];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,b=Ve.get(null);this.on(0,()=>b.actions.push(t)),this.on(1,()=>b.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new xe({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 q(t.type,Ct,n,t)}}const Ne=l.createContext(null);function de(e){let n=l.useContext(Ne);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function wt({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>xe.new({id:e,__demoMode:n}),[]);return We(()=>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 It(){return l.useContext(pe)}let kt="div";function _t(e,n){var t;let b=l.useId(),{__demoMode:h=!1,...v}=e,r=wt({id:b,__demoMode:h}),a=l.useRef(null),C=U(n,Je(u=>{a.current=u})),[y,s,g,S,_]=z(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),w=et((t=a.current)!=null?t:s),p=Ie(S),d=Ie(_),f=l.useMemo(()=>({buttonId:p,panelId:d,close:r.actions.close}),[p,d,r]),P=De(),i=P==null?void 0:P.registerPopover,B=k(()=>{var u,F;let E=se((u=a.current)!=null?u:s);return(F=P==null?void 0:P.isFocusWithinPopoverGroup())!=null?F:E&&((s==null?void 0:s.contains(E))||(g==null?void 0:g.contains(E)))});l.useEffect(()=>i==null?void 0:i(f),[i,f]);let[te,ne]=tt(),G=nt(s),D=at({mainTreeNode:G,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});ot(w,"focus",u=>{var F,E,j,X,N,Z;u.target!==window&&st(u.target)&&r.state.popoverState===$.Open&&(B()||r.state.button&&r.state.panel&&(D.contains(u.target)||(E=(F=r.state.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&E.call(F,u.target)||(X=(j=r.state.afterPanelSentinel.current)==null?void 0:j.contains)!=null&&X.call(j,u.target)||(Z=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&Z.call(N,u.target)||r.actions.close()))},!0);let K=y===$.Open;rt(K,D.resolveContainers,(u,F)=>{r.actions.close(),lt(F,ut.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===$.Open,close:r.actions.refocusableClose}),oe=z(r,l.useCallback(u=>q(u.popoverState,{[$.Open]:J.Open,[$.Closed]:J.Closed}),[])),Y={ref:C},Q=le();return x.createElement(je,{node:G},x.createElement($t,null,x.createElement(pe.Provider,{value:null},x.createElement(Ne.Provider,{value:r},x.createElement(Te,{value:r.actions.refocusableClose},x.createElement(it,{value:oe},x.createElement(ne,null,Q({ourProps:Y,theirProps:v,slot:ae,defaultTag:kt,name:"Popover"}))))))))}let Bt="button";function Ft(e,n){let t=l.useId(),{id:b=`headlessui-popover-button-${t}`,disabled:h=!1,autoFocus:v=!1,...r}=e,a=de("Popover.Button"),[C,y,s,g,S,_,w]=z(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),p=l.useRef(null),d=`headlessui-focus-sentinel-${l.useId()}`,f=De(),P=f==null?void 0:f.closeOthers,i=It()!==null;l.useEffect(()=>{if(!i)return a.actions.setButtonId(b),()=>a.actions.setButtonId(null)},[i,b,a]);let[B]=l.useState(()=>Symbol()),te=U(p,n,vt(),k(o=>{if(!i){if(o)a.state.buttons.current.push(B);else{let c=a.state.buttons.current.indexOf(B);c!==-1&&a.state.buttons.current.splice(c,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=U(p,n),G=k(o=>{var c,O,T;if(i){if(a.state.popoverState===$.Closed)return;switch(o.key){case W.Space:case W.Enter:o.preventDefault(),(O=(c=o.target).click)==null||O.call(c),a.actions.close(),(T=a.state.button)==null||T.focus();break}}else switch(o.key){case W.Space:case W.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close();break;case W.Escape:if(a.state.popoverState!==$.Open)return P==null?void 0:P(a.state.buttonId);if(!p.current)return;let R=se(p.current);if(R&&!p.current.contains(R))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),D=k(o=>{i||o.key===W.Space&&o.preventDefault()}),K=k(o=>{var c,O;_e(o.currentTarget)||h||(i?(a.actions.close(),(c=a.state.button)==null||c.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close(),(O=a.state.button)==null||O.focus()))}),ae=k(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Y}=He({autoFocus:v}),{isHovered:Q,hoverProps:u}=Ke({isDisabled:h}),{pressed:F,pressProps:E}=Ye({disabled:h}),j=C===$.Open,X=re({open:j,active:F||j,disabled:h,hover:Q,focus:oe,autofocus:v}),N=Qe(e,s),Z=i?me({ref:ne,type:N,onKeyDown:G,onClick:K,disabled:h||void 0,autoFocus:v},Y,u,E):me({ref:te,id:g,type:N,"aria-expanded":C===$.Open,"aria-controls":S?_:void 0,disabled:h||void 0,autoFocus:v,onKeyDown:G,onKeyUp:D,onClick:K,onMouseDown:ae},Y,u,E),ue=Be(),fe=k(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function c(){q(ue.current,{[M.Forwards]:()=>H(o,A.First),[M.Backwards]:()=>H(o,A.Last)})===he.Error&&H($e(ge(a.state.button)).filter(O=>O.dataset.headlessuiFocusGuard!=="true"),q(ue.current,{[M.Forwards]:A.Next,[M.Backwards]:A.Previous}),{relativeTo:a.state.button})}c()}),m=le();return x.createElement(x.Fragment,null,m({ourProps:Z,theirProps:r,slot:X,defaultTag:Bt,name:"Popover.Button"}),j&&!i&&y&&x.createElement(ye,{id:d,ref:w,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Ot="div",Et=ce.RenderStrategy|ce.Static;function Re(e,n){let t=l.useId(),{id:b=`headlessui-popover-backdrop-${t}`,transition:h=!1,...v}=e,r=de("Popover.Backdrop"),a=z(r,l.useCallback(f=>f.popoverState,[])),[C,y]=l.useState(null),s=U(n,y),g=Fe(),[S,_]=Oe(h,C,g!==null?(g&J.Open)===J.Open:a===$.Open),w=k(f=>{if(_e(f.currentTarget))return f.preventDefault();r.actions.close()}),p=re({open:a===$.Open}),d={ref:s,id:b,"aria-hidden":!0,onClick:w,...Ee(_)};return le()({ourProps:d,theirProps:v,slot:p,defaultTag:Ot,features:Et,visible:S,name:"Popover.Backdrop"})}let Tt="div",jt=ce.RenderStrategy|ce.Static;function Nt(e,n){let t=l.useId(),{id:b=`headlessui-popover-panel-${t}`,focus:h=!1,anchor:v,portal:r=!1,modal:a=!1,transition:C=!1,...y}=e,s=de("Popover.Panel"),g=z(s,s.selectors.isPortalled),[S,_,w,p,d]=z(s,l.useCallback(m=>[m.popoverState,m.button,m.__demoMode,m.beforePanelSentinel,m.afterPanelSentinel],[])),f=`headlessui-focus-sentinel-before-${t}`,P=`headlessui-focus-sentinel-after-${t}`,i=l.useRef(null),B=mt(v),[te,ne]=ht(B),G=yt();B&&(r=!0);let[D,K]=l.useState(null),ae=U(i,n,B?te:null,s.actions.setPanel,K),oe=we(_),Y=we(i.current);Xe(()=>(s.actions.setPanelId(b),()=>s.actions.setPanelId(null)),[b,s]);let Q=Fe(),[u,F]=Oe(C,D,Q!==null?(Q&J.Open)===J.Open:S===$.Open);Ze(u,_,s.actions.close),qe(w?!1:a&&u,Y);let E=k(m=>{var o;switch(m.key){case W.Escape:if(s.state.popoverState!==$.Open||!i.current)return;let c=se(i.current);if(c&&!i.current.contains(c))return;m.preventDefault(),m.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var m;e.static||S===$.Closed&&((m=e.unmount)==null||m)&&s.actions.setPanel(null)},[S,e.unmount,e.static,s]),l.useEffect(()=>{if(w||!h||S!==$.Open||!i.current)return;let m=se(i.current);i.current.contains(m)||H(i.current,A.First)},[w,h,i.current,S]);let j=re({open:S===$.Open,close:s.actions.refocusableClose}),X=me(B?G():{},{ref:ae,id:b,onKeyDown:E,onBlur:h&&S===$.Open?m=>{var o,c,O,T,R;let L=m.relatedTarget;L&&i.current&&((o=i.current)!=null&&o.contains(L)||(s.actions.close(),((O=(c=p.current)==null?void 0:c.contains)!=null&&O.call(c,L)||(R=(T=d.current)==null?void 0:T.contains)!=null&&R.call(T,L))&&L.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":Pt(u,_,!0).width},...Ee(F)}),N=Be(),Z=k(()=>{let m=i.current;if(!m)return;function o(){q(N.current,{[M.Forwards]:()=>{var c;H(m,A.First)===he.Error&&((c=s.state.afterPanelSentinel.current)==null||c.focus())},[M.Backwards]:()=>{var c;(c=s.state.button)==null||c.focus({preventScroll:!0})}})}o()}),ue=k(()=>{let m=i.current;if(!m)return;function o(){q(N.current,{[M.Forwards]:()=>{var c;if(!s.state.button)return;let O=(c=ge(s.state.button))!=null?c:document.body,T=$e(O),R=T.indexOf(s.state.button),L=T.slice(0,R+1),ie=[...T.slice(R+1),...L];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,A.First,{sorted:!1})},[M.Backwards]:()=>{var c;H(m,A.Previous)===he.Error&&((c=s.state.button)==null||c.focus())}})}o()}),fe=le();return x.createElement(ze,null,x.createElement(pe.Provider,{value:b},x.createElement(Te,{value:s.actions.refocusableClose},x.createElement(Ue,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&g&&x.createElement(ye,{id:f,ref:p,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:Z}),fe({ourProps:X,theirProps:y,slot:j,defaultTag:Tt,features:jt,visible:u,name:"Popover.Panel"}),u&&g&&x.createElement(ye,{id:P,ref:d,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Dt="div";function Rt(e,n){let t=l.useRef(null),b=U(t,n),[h,v]=l.useState([]),r=k(p=>{v(d=>{let f=d.indexOf(p);if(f!==-1){let P=d.slice();return P.splice(f,1),P}return d})}),a=k(p=>(v(d=>[...d,p]),()=>r(p))),C=k(()=>{var p;let d=ge(t.current);if(!d)return!1;let f=se(t.current);return(p=t.current)!=null&&p.contains(f)?!0:h.some(P=>{var i,B;return((i=d.getElementById(P.buttonId.current))==null?void 0:i.contains(f))||((B=d.getElementById(P.panelId.current))==null?void 0:B.contains(f))})}),y=k(p=>{for(let d of h)d.buttonId.current!==p&&d.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:C,closeOthers:y}),[a,r,C,y]),g=re({}),S=e,_={ref:b},w=le();return x.createElement(je,null,x.createElement(Se.Provider,{value:s},w({ourProps:_,theirProps:S,slot:g,defaultTag:Dt,name:"Popover.Group"})))}let Mt=ee(_t),Me=ee(Ft),At=ee(Re),Gt=ee(Re),Ae=ee(Nt),Lt=ee(Rt),Vt=Object.assign(Mt,{Button:Me,Backdrop:Gt,Overlay:At,Panel:Ae,Group:Lt});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/activity-Bh2DzqDM.js b/frontend/dist/assets/activity-D99FIjaW.js similarity index 89% rename from frontend/dist/assets/activity-Bh2DzqDM.js rename to frontend/dist/assets/activity-D99FIjaW.js index 0483d056..f6eb86f9 100644 --- a/frontend/dist/assets/activity-Bh2DzqDM.js +++ b/frontend/dist/assets/activity-D99FIjaW.js @@ -1,4 +1,4 @@ -import{e as t}from"./index-C8J8z7Af.js";/** +import{e as t}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/antenna-uOteVbHn.js b/frontend/dist/assets/antenna-BPUiILZz.js similarity index 91% rename from frontend/dist/assets/antenna-uOteVbHn.js rename to frontend/dist/assets/antenna-BPUiILZz.js index 0cb4e9fd..3da4eecf 100644 --- a/frontend/dist/assets/antenna-uOteVbHn.js +++ b/frontend/dist/assets/antenna-BPUiILZz.js @@ -1,4 +1,4 @@ -import{e}from"./index-C8J8z7Af.js";/** +import{e}from"./index-Dk8KEIKm.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-Dqy7bDoY.js b/frontend/dist/assets/arrow-down-B85BrN7t.js similarity index 86% rename from frontend/dist/assets/arrow-down-Dqy7bDoY.js rename to frontend/dist/assets/arrow-down-B85BrN7t.js index eb0c76cd..d7cc4271 100644 --- a/frontend/dist/assets/arrow-down-Dqy7bDoY.js +++ b/frontend/dist/assets/arrow-down-B85BrN7t.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-C8J8z7Af.js";/** +import{e as o}from"./index-Dk8KEIKm.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-D_4v2CeG.js b/frontend/dist/assets/arrow-right-vgcsVPr-.js similarity index 86% rename from frontend/dist/assets/arrow-right-D_4v2CeG.js rename to frontend/dist/assets/arrow-right-vgcsVPr-.js index abb51c90..75244ef5 100644 --- a/frontend/dist/assets/arrow-right-D_4v2CeG.js +++ b/frontend/dist/assets/arrow-right-vgcsVPr-.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-C8J8z7Af.js";/** +import{e as o}from"./index-Dk8KEIKm.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-CsqMGTbi.js b/frontend/dist/assets/arrow-up-BhSGIVnk.js similarity index 86% rename from frontend/dist/assets/arrow-up-CsqMGTbi.js rename to frontend/dist/assets/arrow-up-BhSGIVnk.js index f8d792b5..bdf90f4e 100644 --- a/frontend/dist/assets/arrow-up-CsqMGTbi.js +++ b/frontend/dist/assets/arrow-up-BhSGIVnk.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-C8J8z7Af.js";/** +import{e as o}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/backup-D2yaW6qB.js b/frontend/dist/assets/backup-CooFBfHx.js similarity index 79% rename from frontend/dist/assets/backup-D2yaW6qB.js rename to frontend/dist/assets/backup-CooFBfHx.js index 572ef9e6..b3a72e97 100644 --- a/frontend/dist/assets/backup-D2yaW6qB.js +++ b/frontend/dist/assets/backup-CooFBfHx.js @@ -1 +1 @@ -import{dv as i}from"./index-C8J8z7Af.js";async function o(t=!1){return i(`/api/config_export${t?"?include_secrets=true":""}`)}async function r(t){return i("/api/config_import",{method:"POST",body:JSON.stringify({config:t})})}async function s(){return i("/api/identity_export")}export{s as a,o as e,r as i}; +import{dv as i}from"./index-Dk8KEIKm.js";async function o(t=!1){return i(`/api/config_export${t?"?include_secrets=true":""}`)}async function r(t){return i("/api/config_import",{method:"POST",body:JSON.stringify({config:t})})}async function s(){return i("/api/identity_export")}export{s as a,o as e,r as i}; diff --git a/frontend/dist/assets/car-KA4-aUWv.js b/frontend/dist/assets/car-BJCuYr8A.js similarity index 92% rename from frontend/dist/assets/car-KA4-aUWv.js rename to frontend/dist/assets/car-BJCuYr8A.js index 779b0c3a..9042f3a0 100644 --- a/frontend/dist/assets/car-KA4-aUWv.js +++ b/frontend/dist/assets/car-BJCuYr8A.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C8J8z7Af.js";/** +import{e as c}from"./index-Dk8KEIKm.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-C5p1i8vZ.js b/frontend/dist/assets/chat-utils-DAcFG23d.js similarity index 97% rename from frontend/dist/assets/chat-utils-C5p1i8vZ.js rename to frontend/dist/assets/chat-utils-DAcFG23d.js index 6a631364..3013408a 100644 --- a/frontend/dist/assets/chat-utils-C5p1i8vZ.js +++ b/frontend/dist/assets/chat-utils-DAcFG23d.js @@ -1 +1 @@ -import{r as g,Z as d,V as l}from"./index-C8J8z7Af.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,V as l}from"./index-Dk8KEIKm.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-BxJI0DsK.js b/frontend/dist/assets/check-check-BfFB-ozy.js similarity index 88% rename from frontend/dist/assets/check-check-BxJI0DsK.js rename to frontend/dist/assets/check-check-BfFB-ozy.js index 6f614f26..10a27479 100644 --- a/frontend/dist/assets/check-check-BxJI0DsK.js +++ b/frontend/dist/assets/check-check-BfFB-ozy.js @@ -1,4 +1,4 @@ -import{e}from"./index-C8J8z7Af.js";/** +import{e}from"./index-Dk8KEIKm.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-ZaDPsavE.js b/frontend/dist/assets/chevron-right-BugwEnle.js similarity index 85% rename from frontend/dist/assets/chevron-right-ZaDPsavE.js rename to frontend/dist/assets/chevron-right-BugwEnle.js index 9d54e53c..580093f7 100644 --- a/frontend/dist/assets/chevron-right-ZaDPsavE.js +++ b/frontend/dist/assets/chevron-right-BugwEnle.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-C8J8z7Af.js";/** +import{e as o}from"./index-Dk8KEIKm.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-BhSn6i9S.js b/frontend/dist/assets/chevron-up-DzJVNs-c.js similarity index 99% rename from frontend/dist/assets/chevron-up-BhSn6i9S.js rename to frontend/dist/assets/chevron-up-DzJVNs-c.js index e6df9e7f..ffd253f3 100644 --- a/frontend/dist/assets/chevron-up-BhSn6i9S.js +++ b/frontend/dist/assets/chevron-up-DzJVNs-c.js @@ -1,4 +1,4 @@ -import{r as x,b6 as F,e as R}from"./index-C8J8z7Af.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-CkWx_yNx.js b/frontend/dist/assets/circle-alert-CkK66Qaq.js similarity index 90% rename from frontend/dist/assets/circle-alert-CkWx_yNx.js rename to frontend/dist/assets/circle-alert-CkK66Qaq.js index efb9268a..ce81767b 100644 --- a/frontend/dist/assets/circle-alert-CkWx_yNx.js +++ b/frontend/dist/assets/circle-alert-CkK66Qaq.js @@ -1,4 +1,4 @@ -import{e}from"./index-C8J8z7Af.js";/** +import{e}from"./index-Dk8KEIKm.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-CD6FHJ5H.js b/frontend/dist/assets/circle-question-mark-BNRkoCvq.js similarity index 89% rename from frontend/dist/assets/circle-question-mark-CD6FHJ5H.js rename to frontend/dist/assets/circle-question-mark-BNRkoCvq.js index a4ed350b..760b9039 100644 --- a/frontend/dist/assets/circle-question-mark-CD6FHJ5H.js +++ b/frontend/dist/assets/circle-question-mark-BNRkoCvq.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C8J8z7Af.js";/** +import{e as c}from"./index-Dk8KEIKm.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-Bv_ZsQj9.js b/frontend/dist/assets/circle-stop-DA7KtBFF.js similarity index 94% rename from frontend/dist/assets/circle-stop-Bv_ZsQj9.js rename to frontend/dist/assets/circle-stop-DA7KtBFF.js index 07eff828..1b664211 100644 --- a/frontend/dist/assets/circle-stop-Bv_ZsQj9.js +++ b/frontend/dist/assets/circle-stop-DA7KtBFF.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C8J8z7Af.js";/** +import{e as c}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/clock-CTBG2e06.js b/frontend/dist/assets/clock-BSYVhL7Q.js similarity index 87% rename from frontend/dist/assets/clock-CTBG2e06.js rename to frontend/dist/assets/clock-BSYVhL7Q.js index 442e43ab..39ef6217 100644 --- a/frontend/dist/assets/clock-CTBG2e06.js +++ b/frontend/dist/assets/clock-BSYVhL7Q.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C8J8z7Af.js";/** +import{e as c}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/compass--Ql4hKkC.js b/frontend/dist/assets/compass-DJByH8FZ.js similarity index 89% rename from frontend/dist/assets/compass--Ql4hKkC.js rename to frontend/dist/assets/compass-DJByH8FZ.js index 35f6eb82..916bedfb 100644 --- a/frontend/dist/assets/compass--Ql4hKkC.js +++ b/frontend/dist/assets/compass-DJByH8FZ.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C8J8z7Af.js";/** +import{e as c}from"./index-Dk8KEIKm.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-BKgTBvt8.js b/frontend/dist/assets/consumer-registry-CTHycSys.js similarity index 92% rename from frontend/dist/assets/consumer-registry-BKgTBvt8.js rename to frontend/dist/assets/consumer-registry-CTHycSys.js index c926123a..ddf3e64c 100644 --- a/frontend/dist/assets/consumer-registry-BKgTBvt8.js +++ b/frontend/dist/assets/consumer-registry-CTHycSys.js @@ -1 +1 @@ -import{c2 as n,r as i}from"./index-C8J8z7Af.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{c2 as n,r as i}from"./index-Dk8KEIKm.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/easing-CQ2FiqiW.js b/frontend/dist/assets/easing-x6QsY02F.js similarity index 57% rename from frontend/dist/assets/easing-CQ2FiqiW.js rename to frontend/dist/assets/easing-x6QsY02F.js index 7a354ad3..e810185d 100644 --- a/frontend/dist/assets/easing-CQ2FiqiW.js +++ b/frontend/dist/assets/easing-x6QsY02F.js @@ -1 +1 @@ -import{ha as a}from"./index-C8J8z7Af.js";const e=a(.65,0,.35,1),t=a(.33,1,.68,1),c=a(.33,.67,.67,1),u=a(.76,0,.24,1);export{t as a,e as b,c,u as e}; +import{ha as a}from"./index-Dk8KEIKm.js";const e=a(.65,0,.35,1),t=a(.33,1,.68,1),c=a(.33,.67,.67,1),u=a(.76,0,.24,1);export{t as a,e as b,c,u as e}; diff --git a/frontend/dist/assets/element-movement-DhaeUFJY.js b/frontend/dist/assets/element-movement-CrHrmJVz.js similarity index 97% rename from frontend/dist/assets/element-movement-DhaeUFJY.js rename to frontend/dist/assets/element-movement-CrHrmJVz.js index a0386b5b..a72f156b 100644 --- a/frontend/dist/assets/element-movement-DhaeUFJY.js +++ b/frontend/dist/assets/element-movement-CrHrmJVz.js @@ -1 +1 @@ -import{r as o,aQ as p,da as v,gy as b,gz as $,dr as m,bu as x}from"./index-C8J8z7Af.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,h=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 k(e){return[e.screenX,e.screenY]}function j(){let e=o.useRef([-1,-1]);return{wasMoved(t){let n=k(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=k(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 z(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,P as a,T as b,S as c,D as d,z as f,w as g,F as p,M as s,j as u}; +import{r as o,aQ as p,da as v,gy as b,gz as $,dr as m,bu as x}from"./index-Dk8KEIKm.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,h=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 k(e){return[e.screenX,e.screenY]}function j(){let e=o.useRef([-1,-1]);return{wasMoved(t){let n=k(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=k(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 z(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,P as a,T as b,S as c,D as d,z as f,w as g,F as p,M as s,j as u}; diff --git a/frontend/dist/assets/fieldset-Dw6uLZoo.js b/frontend/dist/assets/fieldset-BlgsvaPV.js similarity index 80% rename from frontend/dist/assets/fieldset-Dw6uLZoo.js rename to frontend/dist/assets/fieldset-BlgsvaPV.js index 9ff46695..f465aeb0 100644 --- a/frontend/dist/assets/fieldset-Dw6uLZoo.js +++ b/frontend/dist/assets/fieldset-BlgsvaPV.js @@ -1 +1 @@ -import{j as t,dV as l,c as i,a$ as n,fO as c}from"./index-C8J8z7Af.js";function x({disabled:e,className:s,children:a}){return t.jsx(l,{disabled:e,className:i("flex flex-col gap-2",s),children:a})}function m({required:e,className:s,children:a,...r}){return t.jsxs(n,{className:i("text-sm font-medium text-fg-primary select-none","data-[disabled]:opacity-50",r.title&&"cursor-help",s),...r,children:[a,e&&t.jsx("span",{className:"text-sys-red ml-0.5","aria-hidden":"true",children:"*"})]})}function o({className:e,children:s,...a}){return t.jsx(c,{className:i("text-sm text-fg-muted","data-[disabled]:opacity-50",e),...a,children:s})}export{o as D,x as F,m as L}; +import{j as t,dV as l,c as i,a$ as n,fO as c}from"./index-Dk8KEIKm.js";function x({disabled:e,className:s,children:a}){return t.jsx(l,{disabled:e,className:i("flex flex-col gap-2",s),children:a})}function m({required:e,className:s,children:a,...r}){return t.jsxs(n,{className:i("text-sm font-medium text-fg-primary select-none","data-[disabled]:opacity-50",r.title&&"cursor-help",s),...r,children:[a,e&&t.jsx("span",{className:"text-sys-red ml-0.5","aria-hidden":"true",children:"*"})]})}function o({className:e,children:s,...a}){return t.jsx(c,{className:i("text-sm text-fg-muted","data-[disabled]:opacity-50",e),...a,children:s})}export{o as D,x as F,m as L}; diff --git a/frontend/dist/assets/floating-DcVaWvZe.js b/frontend/dist/assets/floating-DAdA6y7o.js similarity index 99% rename from frontend/dist/assets/floating-DcVaWvZe.js rename to frontend/dist/assets/floating-DAdA6y7o.js index 8e2ff17e..c4384285 100644 --- a/frontend/dist/assets/floating-DcVaWvZe.js +++ b/frontend/dist/assets/floating-DAdA6y7o.js @@ -1 +1 @@ -import{r as g,bp as ot,bu as de,b6 as ct,gA as me,bf as ge,aQ as Kt,b3 as he}from"./index-C8J8z7Af.js";function Dt(t){if(t===null)return{width:0,height:0};let{width:e,height:n}=t.getBoundingClientRect();return{width:e,height:n}}function Nn(t,e,n=!1){let[o,r]=g.useState(()=>Dt(e));return ot(()=>{if(!e||!t)return;let i=de();return i.requestAnimationFrame(function s(){i.requestAnimationFrame(s),r(l=>{let c=Dt(e);return c.width===l.width&&c.height===l.height?l:c})}),()=>{i.dispose()}},[e,t]),n?{width:`${o.width}px`,height:`${o.height}px`}:o}function dt(){return typeof window<"u"}function Q(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function j(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return dt()?t instanceof Node||t instanceof B(t).Node:!1}function $(t){return dt()?t instanceof Element||t instanceof B(t).Element:!1}function _(t){return dt()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Lt(t){return!dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const pe=new Set(["inline","contents"]);function rt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=W(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!pe.has(r)}const we=new Set(["table","td","th"]);function xe(t){return we.has(Q(t))}const ye=[":popover-open",":modal"];function mt(t){return ye.some(e=>{try{return t.matches(e)}catch{return!1}})}const ve=["transform","translate","scale","rotate","perspective"],be=["transform","translate","scale","rotate","perspective","filter"],Re=["paint","layout","strict","content"];function Et(t){const e=Ot(),n=$(t)?W(t):t;return ve.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||be.some(o=>(n.willChange||"").includes(o))||Re.some(o=>(n.contain||"").includes(o))}function Ce(t){let e=q(t);for(;_(e)&&!J(e);){if(Et(e))return e;if(mt(e))return null;e=q(e)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Se=new Set(["html","body","#document"]);function J(t){return Se.has(Q(t))}function W(t){return B(t).getComputedStyle(t)}function gt(t){return $(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(Q(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||j(t);return Lt(e)?e.host:e}function Jt(t){const e=q(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&rt(e)?e:Jt(e)}function et(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=B(r);if(i){const l=Ct(s);return e.concat(s,s.visualViewport||[],rt(r)?r:[],l&&n?et(l):[])}return e.concat(r,et(r,[],n))}function Ct(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ae(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:o}=e;return n+"/"+o}).join(" "):navigator.userAgent}const U=Math.min,D=Math.max,nt=Math.round,st=Math.floor,V=t=>({x:t,y:t}),Ee={left:"right",right:"left",bottom:"top",top:"bottom"},Oe={start:"end",end:"start"};function Ht(t,e,n){return D(t,U(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function Qt(t){return t==="x"?"y":"x"}function Zt(t){return t==="y"?"height":"width"}const Te=new Set(["top","bottom"]);function Y(t){return Te.has(X(t))?"y":"x"}function te(t){return Qt(Y(t))}function Fe(t,e,n){n===void 0&&(n=!1);const o=it(t),r=te(t),i=Zt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=ft(s)),[s,ft(s)]}function Me(t){const e=ft(t);return[St(t),e,St(e)]}function St(t){return t.replace(/start|end/g,e=>Oe[e])}const $t=["left","right"],kt=["right","left"],Pe=["top","bottom"],De=["bottom","top"];function Le(t,e,n){switch(t){case"top":case"bottom":return n?e?kt:$t:e?$t:kt;case"left":case"right":return e?Pe:De;default:return[]}}function He(t,e,n,o){const r=it(t);let i=Le(X(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(St)))),i}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Ee[e])}function $e(t){return{top:0,right:0,bottom:0,left:0,...t}}function ke(t){return typeof t!="number"?$e(t):{top:t,right:t,bottom:t,left:t}}function at(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function It(t,e,n){let{reference:o,floating:r}=t;const i=Y(e),s=te(e),l=Zt(s),c=X(e),f=i==="y",a=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[l]/2-r[l]/2;let u;switch(c){case"top":u={x:a,y:o.y-r.height};break;case"bottom":u={x:a,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:m};break;case"left":u={x:o.x-r.width,y:m};break;default:u={x:o.x,y:o.y}}switch(it(e)){case"start":u[s]-=h*(n&&f?-1:1);break;case"end":u[s]+=h*(n&&f?-1:1);break}return u}const Ie=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:a,y:m}=It(f,o,c),h=o,u={},d=0;for(let p=0;pF<=0)){var O,k;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,z=A[F];if(z&&(!(m==="alignment"?v!==Y(z):!1)||T.every(C=>Y(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:z}};let M=(k=T.filter(I=>I.overflows[0]<=0).sort((I,C)=>I.overflows[1]-C.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(u){case"bestFit":{var P;const I=(P=T.filter(C=>{if(S){const E=Y(C.placement);return E===v||E==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(E=>E>0).reduce((E,H)=>E+H,0)]).sort((C,E)=>C[1]-E[1])[0])==null?void 0:P[0];I&&(M=I);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}},Ne=new Set(["left","top"]);async function We(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),l=it(n),c=Y(n)==="y",f=Ne.has(s)?-1:1,a=i&&c?-1:1,m=Z(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),c?{x:u*a,y:h*f}:{x:h*f,y:u*a}}const Ve=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:l}=e,c=await We(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},_e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:y,y:v}=w;return{x:y,y:v}}},...c}=Z(t,e),f={x:n,y:o},a=await ht(e,c),m=Y(X(r)),h=Qt(m);let u=f[h],d=f[m];if(i){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=u+a[w],x=u-a[y];u=Ht(v,u,x)}if(s){const w=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=d+a[w],x=d-a[y];d=Ht(v,d,x)}const p=l.fn({...e,[h]:u,[m]:d});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:i,[m]:s}}}}}},je=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:l}=e,{apply:c=()=>{},...f}=Z(t,e),a=await ht(e,f),m=X(r),h=it(r),u=Y(r)==="y",{width:d,height:p}=i.floating;let w,y;m==="top"||m==="bottom"?(w=m,y=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(y=m,w=h==="end"?"top":"bottom");const v=p-a.top-a.bottom,x=d-a.left-a.right,b=U(p-a[w],v),R=U(d-a[y],x),S=!e.middlewareData.shift;let A=b,L=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(A=v),S&&!h){const T=D(a.left,0),O=D(a.right,0),k=D(a.top,0),P=D(a.bottom,0);u?L=d-2*(T!==0||O!==0?T+O:D(a.left,a.right)):A=p-2*(k!==0||P!==0?k+P:D(a.top,a.bottom))}await c({...e,availableWidth:L,availableHeight:A});const N=await s.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function ee(t){const e=W(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=_(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,l=nt(n)!==i||nt(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Tt(t){return $(t)?t:t.contextElement}function G(t){const e=Tt(t);if(!_(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ee(e);let s=(i?nt(n.width):n.width)/o,l=(i?nt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const ze=V(0);function ne(t){const e=B(t);return!Ot()||!e.visualViewport?ze:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function K(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Tt(t);let s=V(1);e&&(o?$(o)&&(s=G(o)):s=G(t));const l=Ye(i,n,o)?ne(i):V(0);let c=(r.left+l.x)/s.x,f=(r.top+l.y)/s.y,a=r.width/s.x,m=r.height/s.y;if(i){const h=B(i),u=o&&$(o)?B(o):o;let d=h,p=Ct(d);for(;p&&o&&u!==d;){const w=G(p),y=p.getBoundingClientRect(),v=W(p),x=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*w.x,b=y.top+(p.clientTop+parseFloat(v.paddingTop))*w.y;c*=w.x,f*=w.y,a*=w.x,m*=w.y,c+=x,f+=b,d=B(p),p=Ct(d)}}return at({width:a,height:m,x:c,y:f})}function pt(t,e){const n=gt(t).scrollLeft;return e?e.left+n:K(j(t)).left+n}function oe(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-pt(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function qe(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=j(o),l=e?mt(e.floating):!1;if(o===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},f=V(1);const a=V(0),m=_(o);if((m||!m&&!i)&&((Q(o)!=="body"||rt(s))&&(c=gt(o)),_(o))){const u=K(o);f=G(o),a.x=u.x+o.clientLeft,a.y=u.y+o.clientTop}const h=s&&!m&&!i?oe(s,c):V(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+a.x+h.x,y:n.y*f.y-c.scrollTop*f.y+a.y+h.y}}function Xe(t){return Array.from(t.getClientRects())}function Ue(t){const e=j(t),n=gt(t),o=t.ownerDocument.body,r=D(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=D(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+pt(t);const l=-n.scrollTop;return W(o).direction==="rtl"&&(s+=D(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}const Bt=25;function Ke(t,e){const n=B(t),o=j(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(r){i=r.width,s=r.height;const a=Ot();(!a||a&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const f=pt(o);if(f<=0){const a=o.ownerDocument,m=a.body,h=getComputedStyle(m),u=a.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,d=Math.abs(o.clientWidth-m.clientWidth-u);d<=Bt&&(i-=d)}else f<=Bt&&(i+=f);return{width:i,height:s,x:l,y:c}}const Ge=new Set(["absolute","fixed"]);function Je(t,e){const n=K(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?G(t):V(1),s=t.clientWidth*i.x,l=t.clientHeight*i.y,c=r*i.x,f=o*i.y;return{width:s,height:l,x:c,y:f}}function Nt(t,e,n){let o;if(e==="viewport")o=Ke(t,n);else if(e==="document")o=Ue(j(t));else if($(e))o=Je(e,n);else{const r=ne(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return at(o)}function re(t,e){const n=q(t);return n===e||!$(n)||J(n)?!1:W(n).position==="fixed"||re(n,e)}function Qe(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(l=>$(l)&&Q(l)!=="body"),r=null;const i=W(t).position==="fixed";let s=i?q(t):t;for(;$(s)&&!J(s);){const l=W(s),c=Et(s);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&Ge.has(r.position)||rt(s)&&!c&&re(t,s))?o=o.filter(a=>a!==s):r=l,s=q(s)}return e.set(t,o),o}function Ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mt(e)?[]:Qe(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((f,a)=>{const m=Nt(e,a,r);return f.top=D(m.top,f.top),f.right=U(m.right,f.right),f.bottom=U(m.bottom,f.bottom),f.left=D(m.left,f.left),f},Nt(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tn(t){const{width:e,height:n}=ee(t);return{width:e,height:n}}function en(t,e,n){const o=_(e),r=j(e),i=n==="fixed",s=K(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=V(0);function f(){c.x=pt(r)}if(o||!o&&!i)if((Q(e)!=="body"||rt(r))&&(l=gt(e)),o){const u=K(e,!0,i,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else r&&f();i&&!o&&r&&f();const a=r&&!o&&!i?oe(r,l):V(0),m=s.left+l.scrollLeft-c.x-a.x,h=s.top+l.scrollTop-c.y-a.y;return{x:m,y:h,width:s.width,height:s.height}}function xt(t){return W(t).position==="static"}function Wt(t,e){if(!_(t)||W(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return j(t)===n&&(n=n.ownerDocument.body),n}function ie(t,e){const n=B(t);if(mt(t))return n;if(!_(t)){let r=q(t);for(;r&&!J(r);){if($(r)&&!xt(r))return r;r=q(r)}return n}let o=Wt(t,e);for(;o&&xe(o)&&xt(o);)o=Wt(o,e);return o&&J(o)&&xt(o)&&!Et(o)?n:o||Ce(t)||n}const nn=async function(t){const e=this.getOffsetParent||ie,n=this.getDimensions,o=await n(t.floating);return{reference:en(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function on(t){return W(t).direction==="rtl"}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:qe,getDocumentElement:j,getClippingRect:Ze,getOffsetParent:ie,getElementRects:nn,getClientRects:Xe,getDimensions:tn,getScale:G,isElement:$,isRTL:on};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function sn(t,e){let n=null,o;const r=j(t);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const f=t.getBoundingClientRect(),{left:a,top:m,width:h,height:u}=f;if(l||e(),!h||!u)return;const d=st(m),p=st(r.clientWidth-(a+h)),w=st(r.clientHeight-(m+u)),y=st(a),x={rootMargin:-d+"px "+-p+"px "+-w+"px "+-y+"px",threshold:D(0,U(1,c))||1};let b=!0;function R(S){const A=S[0].intersectionRatio;if(A!==c){if(!b)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!se(f,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(R,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,x)}n.observe(t)}return s(!0),i}function ln(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=Tt(t),a=r||i?[...f?et(f):[],...et(e)]:[];a.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const m=f&&l?sn(f,n):null;let h=-1,u=null;s&&(u=new ResizeObserver(y=>{let[v]=y;v&&v.target===f&&u&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),f&&!c&&u.observe(f),u.observe(e));let d,p=c?K(t):null;c&&w();function w(){const y=K(t);p&&!se(p,y)&&n(),p=y,d=requestAnimationFrame(w)}return n(),()=>{var y;a.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(y=u)==null||y.disconnect(),u=null,c&&cancelAnimationFrame(d)}}const yt=ht,cn=Ve,fn=_e,an=Be,un=je,dn=(t,e,n)=>{const o=new Map,r={platform:rn,...n},i={...r.platform,_c:o};return Ie(t,e,{...r,platform:i})};var mn=typeof document<"u",gn=function(){},lt=mn?g.useLayoutEffect:gn;function ut(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ut(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&t.$$typeof)&&!ut(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function le(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=le(t);return Math.round(e*n)/n}function vt(t){const e=g.useRef(t);return lt(()=>{e.current=t}),e}function hn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:f}=t,[a,m]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,u]=g.useState(o);ut(h,o)||u(o);const[d,p]=g.useState(null),[w,y]=g.useState(null),v=g.useCallback(C=>{C!==S.current&&(S.current=C,p(C))},[]),x=g.useCallback(C=>{C!==A.current&&(A.current=C,y(C))},[]),b=i||d,R=s||w,S=g.useRef(null),A=g.useRef(null),L=g.useRef(a),N=c!=null,T=vt(c),O=vt(r),k=vt(f),P=g.useCallback(()=>{if(!S.current||!A.current)return;const C={placement:e,strategy:n,middleware:h};O.current&&(C.platform=O.current),dn(S.current,A.current,C).then(E=>{const H={...E,isPositioned:k.current!==!1};F.current&&!ut(L.current,H)&&(L.current=H,ct.flushSync(()=>{m(H)}))})},[h,e,n,O,k]);lt(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,m(C=>({...C,isPositioned:!1})))},[f]);const F=g.useRef(!1);lt(()=>(F.current=!0,()=>{F.current=!1}),[]),lt(()=>{if(b&&(S.current=b),R&&(A.current=R),b&&R){if(T.current)return T.current(b,R,P);P()}},[b,R,P,T,N]);const z=g.useMemo(()=>({reference:S,floating:A,setReference:v,setFloating:x}),[v,x]),M=g.useMemo(()=>({reference:b,floating:R}),[b,R]),I=g.useMemo(()=>{const C={position:n,left:0,top:0};if(!M.floating)return C;const E=Vt(M.floating,a.x),H=Vt(M.floating,a.y);return l?{...C,transform:"translate("+E+"px, "+H+"px)",...le(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:H}},[n,l,M.floating,a.x,a.y]);return g.useMemo(()=>({...a,update:P,refs:z,elements:M,floatingStyles:I}),[a,P,z,M,I])}const ce=(t,e)=>({...cn(t),options:[t,e]}),pn=(t,e)=>({...fn(t),options:[t,e]}),wn=(t,e)=>({...an(t),options:[t,e]}),xn=(t,e)=>({...un(t),options:[t,e]}),fe={...me},yn=fe.useInsertionEffect,vn=yn||(t=>t());function ae(t){const e=g.useRef(()=>{});return vn(()=>{e.current=t}),g.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+bn++;function Rn(){const[t,e]=g.useState(()=>_t?jt():void 0);return At(()=>{t==null&&e(jt())},[]),g.useEffect(()=>{_t=!0},[]),t}const Cn=fe.useId,Sn=Cn||Rn;function An(){const t=new Map;return{emit(e,n){var o;(o=t.get(e))==null||o.forEach(r=>r(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var o;t.set(e,((o=t.get(e))==null?void 0:o.filter(r=>r!==n))||[])}}}const En=g.createContext(null),On=g.createContext(null),Tn=()=>{var t;return((t=g.useContext(En))==null?void 0:t.id)||null},Fn=()=>g.useContext(On),Mn="data-floating-ui-focusable";function Pn(t){const{open:e=!1,onOpenChange:n,elements:o}=t,r=Sn(),i=g.useRef({}),[s]=g.useState(()=>An()),l=Tn()!=null,[c,f]=g.useState(o.reference),a=ae((u,d,p)=>{i.current.openEvent=u?d:void 0,s.emit("openchange",{open:u,event:d,reason:p,nested:l}),n==null||n(u,d,p)}),m=g.useMemo(()=>({setPositionReference:f}),[]),h=g.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return g.useMemo(()=>({dataRef:i,open:e,onOpenChange:a,elements:h,events:s,floatingId:r,refs:m}),[e,a,h,s,r,m])}function Dn(t){t===void 0&&(t={});const{nodeId:e}=t,n=Pn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||n,r=o.elements,[i,s]=g.useState(null),[l,c]=g.useState(null),a=(r==null?void 0:r.domReference)||i,m=g.useRef(null),h=Fn();At(()=>{a&&(m.current=a)},[a]);const u=hn({...t,elements:{...r,...l&&{reference:l}}}),d=g.useCallback(x=>{const b=$(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),u.refs.setReference(b)},[u.refs]),p=g.useCallback(x=>{($(x)||x===null)&&(m.current=x,s(x)),($(u.refs.reference.current)||u.refs.reference.current===null||x!==null&&!$(x))&&u.refs.setReference(x)},[u.refs]),w=g.useMemo(()=>({...u.refs,setReference:p,setPositionReference:d,domReference:m}),[u.refs,p,d]),y=g.useMemo(()=>({...u.elements,domReference:a}),[u.elements,a]),v=g.useMemo(()=>({...u,...o,refs:w,elements:y,nodeId:e}),[u,w,y,e,o]);return At(()=>{o.dataRef.current.floatingContext=v;const x=h==null?void 0:h.nodesRef.current.find(b=>b.id===e);x&&(x.context=v)}),g.useMemo(()=>({...u,context:v,refs:w,elements:y}),[u,w,y,v])}const zt="active",Yt="selected";function bt(t,e,n){const o=new Map,r=n==="item";let i=t;if(r&&t){const{[zt]:s,[Yt]:l,...c}=t;i=c}return{...n==="floating"&&{tabIndex:-1,[Mn]:""},...i,...e.map(s=>{const l=s?s[n]:null;return typeof l=="function"?t?l(t):null:l}).concat(t).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[f,a]=c;if(!(r&&[zt,Yt].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof a=="function"){var m;(m=o.get(f))==null||m.push(a),s[f]=function(){for(var h,u=arguments.length,d=new Array(u),p=0;pw(...d)).find(w=>w!==void 0)}}}else s[f]=a}),s),{})}}function Ln(t){t===void 0&&(t=[]);const e=t.map(l=>l==null?void 0:l.reference),n=t.map(l=>l==null?void 0:l.floating),o=t.map(l=>l==null?void 0:l.item),r=g.useCallback(l=>bt(l,t,"reference"),e),i=g.useCallback(l=>bt(l,t,"floating"),n),s=g.useCallback(l=>bt(l,t,"item"),o);return g.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}function qt(t,e){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:e}}}}const Hn=t=>({name:"inner",options:t,async fn(e){const{listRef:n,overflowRef:o,onFallbackChange:r,offset:i=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:f,...a}=Z(t,e),{rects:m,elements:{floating:h}}=e,u=n.current[s],d=(f==null?void 0:f.current)||h,p=h.clientTop||d.clientTop,w=h.clientTop!==0,y=d.clientTop!==0,v=h===d;if(!u)return{};const x={...e,...await ce(-u.offsetTop-h.clientTop-m.reference.height/2-u.offsetHeight/2-i).fn(e)},b=await yt(qt(x,d.scrollHeight+p+h.clientTop),a),R=await yt(x,{...a,elementContext:"reference"}),S=D(0,b.top),A=x.y+S,T=(d.scrollHeight>d.clientHeight?O=>O:nt)(D(0,d.scrollHeight+(w&&v||y?p*2:0)-S-D(0,b.bottom)));if(d.style.maxHeight=T+"px",d.scrollTop=S,r){const O=d.offsetHeight=-c||R.bottom>=-c;ct.flushSync(()=>r(O))}return o&&(o.current=await yt(qt({...x,y:A},d.offsetHeight+p+h.clientTop),a)),{y:A}}});function $n(t,e){const{open:n,elements:o}=t,{enabled:r=!0,overflowRef:i,scrollRef:s,onChange:l}=e,c=ae(l),f=g.useRef(!1),a=g.useRef(null),m=g.useRef(null);g.useEffect(()=>{if(!r)return;function u(p){if(p.ctrlKey||!d||i.current==null)return;const w=p.deltaY,y=i.current.top>=-.5,v=i.current.bottom>=-.5,x=d.scrollHeight-d.clientHeight,b=w<0?-1:1,R=w<0?"max":"min";d.scrollHeight<=d.clientHeight||(!y&&w>0||!v&&w<0?(p.preventDefault(),ct.flushSync(()=>{c(S=>S+Math[R](w,x*b))})):/firefox/i.test(Ae())&&(d.scrollTop+=w))}const d=(s==null?void 0:s.current)||o.floating;if(n&&d)return d.addEventListener("wheel",u),requestAnimationFrame(()=>{a.current=d.scrollTop,i.current!=null&&(m.current={...i.current})}),()=>{a.current=null,m.current=null,d.removeEventListener("wheel",u)}},[r,n,o.floating,i,s,c]);const h=g.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const u=(s==null?void 0:s.current)||o.floating;if(!(!i.current||!u||!f.current)){if(a.current!==null){const d=u.scrollTop-a.current;(i.current.bottom<-.5&&d<-1||i.current.top<-.5&&d>1)&&ct.flushSync(()=>c(p=>p+d))}requestAnimationFrame(()=>{a.current=u.scrollTop})}}}),[o.floating,c,i,s]);return g.useMemo(()=>r?{floating:h}:{},[r,h])}let tt=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});tt.displayName="FloatingContext";let Ft=g.createContext(null);Ft.displayName="PlacementContext";function Wn(t){return g.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function Vn(){return g.useContext(tt).setReference}function _n(){return g.useContext(tt).getReferenceProps}function jn(){let{getFloatingProps:t,slot:e}=g.useContext(tt);return g.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function zn(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=g.useContext(Ft),n=g.useMemo(()=>t,[JSON.stringify(t,(r,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);ot(()=>{e==null||e(n??null)},[e,n]);let o=g.useContext(tt);return g.useMemo(()=>[o.setFloating,t?o.styles:{}],[o.setFloating,t,o.styles])}let Xt=4;function Yn({children:t,enabled:e=!0}){let[n,o]=g.useState(null),[r,i]=g.useState(0),s=g.useRef(null),[l,c]=g.useState(null);kn(l);let f=e&&n!==null&&l!==null,{to:a="bottom",gap:m=0,offset:h=0,padding:u=0,inner:d}=In(n,l),[p,w="center"]=a.split(" ");ot(()=>{f&&i(0)},[f]);let{refs:y,floatingStyles:v,context:x}=Dn({open:f,placement:p==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${p}`:`${p}-${w}`,strategy:"absolute",transform:!1,middleware:[ce({mainAxis:p==="selection"?0:m,crossAxis:h}),pn({padding:u}),p!=="selection"&&wn({padding:u}),p==="selection"&&d?Hn({...d,padding:u,overflowRef:s,offset:r,minItemsVisible:Xt,referenceOverflowThreshold:u,onFallbackChange(O){var k,P;if(!O)return;let F=x.elements.floating;if(!F)return;let z=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,M=Math.min(Xt,F.childElementCount),I=0,C=0;for(let E of(P=(k=x.elements.floating)==null?void 0:k.childNodes)!=null?P:[])if(ge(E)){let H=E.offsetTop,Mt=H+E.clientHeight+z,wt=F.scrollTop,Pt=wt+F.clientHeight;if(H>=wt&&Mt<=Pt)M--;else{C=Math.max(0,Math.min(Mt,Pt)-Math.max(H,wt)),I=E.clientHeight;break}}M>=1&&i(E=>{let H=I*M-C+z;return E>=H?E:H})}}):null,xn({padding:u,apply({availableWidth:O,availableHeight:k,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${k}px)`})}})].filter(Boolean),whileElementsMounted:ln}),[b=p,R=w]=x.placement.split("-");p==="selection"&&(b="selection");let S=g.useMemo(()=>({anchor:[b,R].filter(Boolean).join(" ")}),[b,R]),A=$n(x,{overflowRef:s,onChange:i}),{getReferenceProps:L,getFloatingProps:N}=Ln([A]),T=Kt(O=>{c(O),y.setFloating(O)});return g.createElement(Ft.Provider,{value:o},g.createElement(tt.Provider,{value:{setFloating:T,setReference:y.setReference,styles:v,getReferenceProps:L,getFloatingProps:N,slot:S}},t))}function kn(t){ot(()=>{if(!t)return;let e=new MutationObserver(()=>{let n=window.getComputedStyle(t).maxHeight,o=parseFloat(n);if(isNaN(o))return;let r=parseInt(n);isNaN(r)||o!==r&&(t.style.maxHeight=`${Math.ceil(o)}px`)});return e.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[t])}function In(t,e){var n,o,r;let i=Rt((n=t==null?void 0:t.gap)!=null?n:"var(--anchor-gap, 0)",e),s=Rt((o=t==null?void 0:t.offset)!=null?o:"var(--anchor-offset, 0)",e),l=Rt((r=t==null?void 0:t.padding)!=null?r:"var(--anchor-padding, 0)",e);return{...t,gap:i,offset:s,padding:l}}function Rt(t,e,n=void 0){let o=he(),r=Kt((c,f)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!f)return[n,null];let a=Ut(c,f);return[a,m=>{let h=ue(c);{let u=h.map(d=>window.getComputedStyle(f).getPropertyValue(d));o.requestAnimationFrame(function d(){o.nextFrame(d);let p=!1;for(let[y,v]of h.entries()){let x=window.getComputedStyle(f).getPropertyValue(v);if(u[y]!==x){u[y]=x,p=!0;break}}if(!p)return;let w=Ut(c,f);a!==w&&(m(w),a=w)})}return o.dispose}]}return[n,null]}),i=g.useMemo(()=>r(t,e)[0],[t,e]),[s=i,l]=g.useState();return ot(()=>{let[c,f]=r(t,e);if(l(c),!!f)return f(l)},[t,e]),s}function ue(t){let e=/var\((.*)\)/.exec(t);if(e){let n=e[1].indexOf(",");if(n===-1)return[e[1]];let o=e[1].slice(0,n).trim(),r=e[1].slice(n+1).trim();return r?[o,...ue(r)]:[o]}return[]}function Ut(t,e){let n=document.createElement("div");e.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",t,"important");let o=parseFloat(window.getComputedStyle(n).marginTop)||0;return e.removeChild(n),o}export{Yn as A,Vn as F,zn as R,jn as T,_n as b,Nn as w,Wn as y}; +import{r as g,bp as ot,bu as de,b6 as ct,gA as me,bf as ge,aQ as Kt,b3 as he}from"./index-Dk8KEIKm.js";function Dt(t){if(t===null)return{width:0,height:0};let{width:e,height:n}=t.getBoundingClientRect();return{width:e,height:n}}function Nn(t,e,n=!1){let[o,r]=g.useState(()=>Dt(e));return ot(()=>{if(!e||!t)return;let i=de();return i.requestAnimationFrame(function s(){i.requestAnimationFrame(s),r(l=>{let c=Dt(e);return c.width===l.width&&c.height===l.height?l:c})}),()=>{i.dispose()}},[e,t]),n?{width:`${o.width}px`,height:`${o.height}px`}:o}function dt(){return typeof window<"u"}function Q(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function j(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return dt()?t instanceof Node||t instanceof B(t).Node:!1}function $(t){return dt()?t instanceof Element||t instanceof B(t).Element:!1}function _(t){return dt()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Lt(t){return!dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const pe=new Set(["inline","contents"]);function rt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=W(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!pe.has(r)}const we=new Set(["table","td","th"]);function xe(t){return we.has(Q(t))}const ye=[":popover-open",":modal"];function mt(t){return ye.some(e=>{try{return t.matches(e)}catch{return!1}})}const ve=["transform","translate","scale","rotate","perspective"],be=["transform","translate","scale","rotate","perspective","filter"],Re=["paint","layout","strict","content"];function Et(t){const e=Ot(),n=$(t)?W(t):t;return ve.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||be.some(o=>(n.willChange||"").includes(o))||Re.some(o=>(n.contain||"").includes(o))}function Ce(t){let e=q(t);for(;_(e)&&!J(e);){if(Et(e))return e;if(mt(e))return null;e=q(e)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Se=new Set(["html","body","#document"]);function J(t){return Se.has(Q(t))}function W(t){return B(t).getComputedStyle(t)}function gt(t){return $(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(Q(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||j(t);return Lt(e)?e.host:e}function Jt(t){const e=q(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&rt(e)?e:Jt(e)}function et(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=B(r);if(i){const l=Ct(s);return e.concat(s,s.visualViewport||[],rt(r)?r:[],l&&n?et(l):[])}return e.concat(r,et(r,[],n))}function Ct(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ae(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:o}=e;return n+"/"+o}).join(" "):navigator.userAgent}const U=Math.min,D=Math.max,nt=Math.round,st=Math.floor,V=t=>({x:t,y:t}),Ee={left:"right",right:"left",bottom:"top",top:"bottom"},Oe={start:"end",end:"start"};function Ht(t,e,n){return D(t,U(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function Qt(t){return t==="x"?"y":"x"}function Zt(t){return t==="y"?"height":"width"}const Te=new Set(["top","bottom"]);function Y(t){return Te.has(X(t))?"y":"x"}function te(t){return Qt(Y(t))}function Fe(t,e,n){n===void 0&&(n=!1);const o=it(t),r=te(t),i=Zt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=ft(s)),[s,ft(s)]}function Me(t){const e=ft(t);return[St(t),e,St(e)]}function St(t){return t.replace(/start|end/g,e=>Oe[e])}const $t=["left","right"],kt=["right","left"],Pe=["top","bottom"],De=["bottom","top"];function Le(t,e,n){switch(t){case"top":case"bottom":return n?e?kt:$t:e?$t:kt;case"left":case"right":return e?Pe:De;default:return[]}}function He(t,e,n,o){const r=it(t);let i=Le(X(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(St)))),i}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Ee[e])}function $e(t){return{top:0,right:0,bottom:0,left:0,...t}}function ke(t){return typeof t!="number"?$e(t):{top:t,right:t,bottom:t,left:t}}function at(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function It(t,e,n){let{reference:o,floating:r}=t;const i=Y(e),s=te(e),l=Zt(s),c=X(e),f=i==="y",a=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[l]/2-r[l]/2;let u;switch(c){case"top":u={x:a,y:o.y-r.height};break;case"bottom":u={x:a,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:m};break;case"left":u={x:o.x-r.width,y:m};break;default:u={x:o.x,y:o.y}}switch(it(e)){case"start":u[s]-=h*(n&&f?-1:1);break;case"end":u[s]+=h*(n&&f?-1:1);break}return u}const Ie=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:a,y:m}=It(f,o,c),h=o,u={},d=0;for(let p=0;pF<=0)){var O,k;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,z=A[F];if(z&&(!(m==="alignment"?v!==Y(z):!1)||T.every(C=>Y(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:z}};let M=(k=T.filter(I=>I.overflows[0]<=0).sort((I,C)=>I.overflows[1]-C.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(u){case"bestFit":{var P;const I=(P=T.filter(C=>{if(S){const E=Y(C.placement);return E===v||E==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(E=>E>0).reduce((E,H)=>E+H,0)]).sort((C,E)=>C[1]-E[1])[0])==null?void 0:P[0];I&&(M=I);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}},Ne=new Set(["left","top"]);async function We(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),l=it(n),c=Y(n)==="y",f=Ne.has(s)?-1:1,a=i&&c?-1:1,m=Z(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),c?{x:u*a,y:h*f}:{x:h*f,y:u*a}}const Ve=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:l}=e,c=await We(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},_e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:y,y:v}=w;return{x:y,y:v}}},...c}=Z(t,e),f={x:n,y:o},a=await ht(e,c),m=Y(X(r)),h=Qt(m);let u=f[h],d=f[m];if(i){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=u+a[w],x=u-a[y];u=Ht(v,u,x)}if(s){const w=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=d+a[w],x=d-a[y];d=Ht(v,d,x)}const p=l.fn({...e,[h]:u,[m]:d});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:i,[m]:s}}}}}},je=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:l}=e,{apply:c=()=>{},...f}=Z(t,e),a=await ht(e,f),m=X(r),h=it(r),u=Y(r)==="y",{width:d,height:p}=i.floating;let w,y;m==="top"||m==="bottom"?(w=m,y=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(y=m,w=h==="end"?"top":"bottom");const v=p-a.top-a.bottom,x=d-a.left-a.right,b=U(p-a[w],v),R=U(d-a[y],x),S=!e.middlewareData.shift;let A=b,L=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(A=v),S&&!h){const T=D(a.left,0),O=D(a.right,0),k=D(a.top,0),P=D(a.bottom,0);u?L=d-2*(T!==0||O!==0?T+O:D(a.left,a.right)):A=p-2*(k!==0||P!==0?k+P:D(a.top,a.bottom))}await c({...e,availableWidth:L,availableHeight:A});const N=await s.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function ee(t){const e=W(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=_(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,l=nt(n)!==i||nt(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Tt(t){return $(t)?t:t.contextElement}function G(t){const e=Tt(t);if(!_(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ee(e);let s=(i?nt(n.width):n.width)/o,l=(i?nt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const ze=V(0);function ne(t){const e=B(t);return!Ot()||!e.visualViewport?ze:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function K(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Tt(t);let s=V(1);e&&(o?$(o)&&(s=G(o)):s=G(t));const l=Ye(i,n,o)?ne(i):V(0);let c=(r.left+l.x)/s.x,f=(r.top+l.y)/s.y,a=r.width/s.x,m=r.height/s.y;if(i){const h=B(i),u=o&&$(o)?B(o):o;let d=h,p=Ct(d);for(;p&&o&&u!==d;){const w=G(p),y=p.getBoundingClientRect(),v=W(p),x=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*w.x,b=y.top+(p.clientTop+parseFloat(v.paddingTop))*w.y;c*=w.x,f*=w.y,a*=w.x,m*=w.y,c+=x,f+=b,d=B(p),p=Ct(d)}}return at({width:a,height:m,x:c,y:f})}function pt(t,e){const n=gt(t).scrollLeft;return e?e.left+n:K(j(t)).left+n}function oe(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-pt(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function qe(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=j(o),l=e?mt(e.floating):!1;if(o===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},f=V(1);const a=V(0),m=_(o);if((m||!m&&!i)&&((Q(o)!=="body"||rt(s))&&(c=gt(o)),_(o))){const u=K(o);f=G(o),a.x=u.x+o.clientLeft,a.y=u.y+o.clientTop}const h=s&&!m&&!i?oe(s,c):V(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+a.x+h.x,y:n.y*f.y-c.scrollTop*f.y+a.y+h.y}}function Xe(t){return Array.from(t.getClientRects())}function Ue(t){const e=j(t),n=gt(t),o=t.ownerDocument.body,r=D(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=D(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+pt(t);const l=-n.scrollTop;return W(o).direction==="rtl"&&(s+=D(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}const Bt=25;function Ke(t,e){const n=B(t),o=j(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(r){i=r.width,s=r.height;const a=Ot();(!a||a&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const f=pt(o);if(f<=0){const a=o.ownerDocument,m=a.body,h=getComputedStyle(m),u=a.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,d=Math.abs(o.clientWidth-m.clientWidth-u);d<=Bt&&(i-=d)}else f<=Bt&&(i+=f);return{width:i,height:s,x:l,y:c}}const Ge=new Set(["absolute","fixed"]);function Je(t,e){const n=K(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?G(t):V(1),s=t.clientWidth*i.x,l=t.clientHeight*i.y,c=r*i.x,f=o*i.y;return{width:s,height:l,x:c,y:f}}function Nt(t,e,n){let o;if(e==="viewport")o=Ke(t,n);else if(e==="document")o=Ue(j(t));else if($(e))o=Je(e,n);else{const r=ne(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return at(o)}function re(t,e){const n=q(t);return n===e||!$(n)||J(n)?!1:W(n).position==="fixed"||re(n,e)}function Qe(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(l=>$(l)&&Q(l)!=="body"),r=null;const i=W(t).position==="fixed";let s=i?q(t):t;for(;$(s)&&!J(s);){const l=W(s),c=Et(s);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&Ge.has(r.position)||rt(s)&&!c&&re(t,s))?o=o.filter(a=>a!==s):r=l,s=q(s)}return e.set(t,o),o}function Ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mt(e)?[]:Qe(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((f,a)=>{const m=Nt(e,a,r);return f.top=D(m.top,f.top),f.right=U(m.right,f.right),f.bottom=U(m.bottom,f.bottom),f.left=D(m.left,f.left),f},Nt(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tn(t){const{width:e,height:n}=ee(t);return{width:e,height:n}}function en(t,e,n){const o=_(e),r=j(e),i=n==="fixed",s=K(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=V(0);function f(){c.x=pt(r)}if(o||!o&&!i)if((Q(e)!=="body"||rt(r))&&(l=gt(e)),o){const u=K(e,!0,i,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else r&&f();i&&!o&&r&&f();const a=r&&!o&&!i?oe(r,l):V(0),m=s.left+l.scrollLeft-c.x-a.x,h=s.top+l.scrollTop-c.y-a.y;return{x:m,y:h,width:s.width,height:s.height}}function xt(t){return W(t).position==="static"}function Wt(t,e){if(!_(t)||W(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return j(t)===n&&(n=n.ownerDocument.body),n}function ie(t,e){const n=B(t);if(mt(t))return n;if(!_(t)){let r=q(t);for(;r&&!J(r);){if($(r)&&!xt(r))return r;r=q(r)}return n}let o=Wt(t,e);for(;o&&xe(o)&&xt(o);)o=Wt(o,e);return o&&J(o)&&xt(o)&&!Et(o)?n:o||Ce(t)||n}const nn=async function(t){const e=this.getOffsetParent||ie,n=this.getDimensions,o=await n(t.floating);return{reference:en(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function on(t){return W(t).direction==="rtl"}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:qe,getDocumentElement:j,getClippingRect:Ze,getOffsetParent:ie,getElementRects:nn,getClientRects:Xe,getDimensions:tn,getScale:G,isElement:$,isRTL:on};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function sn(t,e){let n=null,o;const r=j(t);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const f=t.getBoundingClientRect(),{left:a,top:m,width:h,height:u}=f;if(l||e(),!h||!u)return;const d=st(m),p=st(r.clientWidth-(a+h)),w=st(r.clientHeight-(m+u)),y=st(a),x={rootMargin:-d+"px "+-p+"px "+-w+"px "+-y+"px",threshold:D(0,U(1,c))||1};let b=!0;function R(S){const A=S[0].intersectionRatio;if(A!==c){if(!b)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!se(f,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(R,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,x)}n.observe(t)}return s(!0),i}function ln(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=Tt(t),a=r||i?[...f?et(f):[],...et(e)]:[];a.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const m=f&&l?sn(f,n):null;let h=-1,u=null;s&&(u=new ResizeObserver(y=>{let[v]=y;v&&v.target===f&&u&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),f&&!c&&u.observe(f),u.observe(e));let d,p=c?K(t):null;c&&w();function w(){const y=K(t);p&&!se(p,y)&&n(),p=y,d=requestAnimationFrame(w)}return n(),()=>{var y;a.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(y=u)==null||y.disconnect(),u=null,c&&cancelAnimationFrame(d)}}const yt=ht,cn=Ve,fn=_e,an=Be,un=je,dn=(t,e,n)=>{const o=new Map,r={platform:rn,...n},i={...r.platform,_c:o};return Ie(t,e,{...r,platform:i})};var mn=typeof document<"u",gn=function(){},lt=mn?g.useLayoutEffect:gn;function ut(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ut(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&t.$$typeof)&&!ut(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function le(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=le(t);return Math.round(e*n)/n}function vt(t){const e=g.useRef(t);return lt(()=>{e.current=t}),e}function hn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:f}=t,[a,m]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,u]=g.useState(o);ut(h,o)||u(o);const[d,p]=g.useState(null),[w,y]=g.useState(null),v=g.useCallback(C=>{C!==S.current&&(S.current=C,p(C))},[]),x=g.useCallback(C=>{C!==A.current&&(A.current=C,y(C))},[]),b=i||d,R=s||w,S=g.useRef(null),A=g.useRef(null),L=g.useRef(a),N=c!=null,T=vt(c),O=vt(r),k=vt(f),P=g.useCallback(()=>{if(!S.current||!A.current)return;const C={placement:e,strategy:n,middleware:h};O.current&&(C.platform=O.current),dn(S.current,A.current,C).then(E=>{const H={...E,isPositioned:k.current!==!1};F.current&&!ut(L.current,H)&&(L.current=H,ct.flushSync(()=>{m(H)}))})},[h,e,n,O,k]);lt(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,m(C=>({...C,isPositioned:!1})))},[f]);const F=g.useRef(!1);lt(()=>(F.current=!0,()=>{F.current=!1}),[]),lt(()=>{if(b&&(S.current=b),R&&(A.current=R),b&&R){if(T.current)return T.current(b,R,P);P()}},[b,R,P,T,N]);const z=g.useMemo(()=>({reference:S,floating:A,setReference:v,setFloating:x}),[v,x]),M=g.useMemo(()=>({reference:b,floating:R}),[b,R]),I=g.useMemo(()=>{const C={position:n,left:0,top:0};if(!M.floating)return C;const E=Vt(M.floating,a.x),H=Vt(M.floating,a.y);return l?{...C,transform:"translate("+E+"px, "+H+"px)",...le(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:H}},[n,l,M.floating,a.x,a.y]);return g.useMemo(()=>({...a,update:P,refs:z,elements:M,floatingStyles:I}),[a,P,z,M,I])}const ce=(t,e)=>({...cn(t),options:[t,e]}),pn=(t,e)=>({...fn(t),options:[t,e]}),wn=(t,e)=>({...an(t),options:[t,e]}),xn=(t,e)=>({...un(t),options:[t,e]}),fe={...me},yn=fe.useInsertionEffect,vn=yn||(t=>t());function ae(t){const e=g.useRef(()=>{});return vn(()=>{e.current=t}),g.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+bn++;function Rn(){const[t,e]=g.useState(()=>_t?jt():void 0);return At(()=>{t==null&&e(jt())},[]),g.useEffect(()=>{_t=!0},[]),t}const Cn=fe.useId,Sn=Cn||Rn;function An(){const t=new Map;return{emit(e,n){var o;(o=t.get(e))==null||o.forEach(r=>r(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var o;t.set(e,((o=t.get(e))==null?void 0:o.filter(r=>r!==n))||[])}}}const En=g.createContext(null),On=g.createContext(null),Tn=()=>{var t;return((t=g.useContext(En))==null?void 0:t.id)||null},Fn=()=>g.useContext(On),Mn="data-floating-ui-focusable";function Pn(t){const{open:e=!1,onOpenChange:n,elements:o}=t,r=Sn(),i=g.useRef({}),[s]=g.useState(()=>An()),l=Tn()!=null,[c,f]=g.useState(o.reference),a=ae((u,d,p)=>{i.current.openEvent=u?d:void 0,s.emit("openchange",{open:u,event:d,reason:p,nested:l}),n==null||n(u,d,p)}),m=g.useMemo(()=>({setPositionReference:f}),[]),h=g.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return g.useMemo(()=>({dataRef:i,open:e,onOpenChange:a,elements:h,events:s,floatingId:r,refs:m}),[e,a,h,s,r,m])}function Dn(t){t===void 0&&(t={});const{nodeId:e}=t,n=Pn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||n,r=o.elements,[i,s]=g.useState(null),[l,c]=g.useState(null),a=(r==null?void 0:r.domReference)||i,m=g.useRef(null),h=Fn();At(()=>{a&&(m.current=a)},[a]);const u=hn({...t,elements:{...r,...l&&{reference:l}}}),d=g.useCallback(x=>{const b=$(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),u.refs.setReference(b)},[u.refs]),p=g.useCallback(x=>{($(x)||x===null)&&(m.current=x,s(x)),($(u.refs.reference.current)||u.refs.reference.current===null||x!==null&&!$(x))&&u.refs.setReference(x)},[u.refs]),w=g.useMemo(()=>({...u.refs,setReference:p,setPositionReference:d,domReference:m}),[u.refs,p,d]),y=g.useMemo(()=>({...u.elements,domReference:a}),[u.elements,a]),v=g.useMemo(()=>({...u,...o,refs:w,elements:y,nodeId:e}),[u,w,y,e,o]);return At(()=>{o.dataRef.current.floatingContext=v;const x=h==null?void 0:h.nodesRef.current.find(b=>b.id===e);x&&(x.context=v)}),g.useMemo(()=>({...u,context:v,refs:w,elements:y}),[u,w,y,v])}const zt="active",Yt="selected";function bt(t,e,n){const o=new Map,r=n==="item";let i=t;if(r&&t){const{[zt]:s,[Yt]:l,...c}=t;i=c}return{...n==="floating"&&{tabIndex:-1,[Mn]:""},...i,...e.map(s=>{const l=s?s[n]:null;return typeof l=="function"?t?l(t):null:l}).concat(t).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[f,a]=c;if(!(r&&[zt,Yt].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof a=="function"){var m;(m=o.get(f))==null||m.push(a),s[f]=function(){for(var h,u=arguments.length,d=new Array(u),p=0;pw(...d)).find(w=>w!==void 0)}}}else s[f]=a}),s),{})}}function Ln(t){t===void 0&&(t=[]);const e=t.map(l=>l==null?void 0:l.reference),n=t.map(l=>l==null?void 0:l.floating),o=t.map(l=>l==null?void 0:l.item),r=g.useCallback(l=>bt(l,t,"reference"),e),i=g.useCallback(l=>bt(l,t,"floating"),n),s=g.useCallback(l=>bt(l,t,"item"),o);return g.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}function qt(t,e){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:e}}}}const Hn=t=>({name:"inner",options:t,async fn(e){const{listRef:n,overflowRef:o,onFallbackChange:r,offset:i=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:f,...a}=Z(t,e),{rects:m,elements:{floating:h}}=e,u=n.current[s],d=(f==null?void 0:f.current)||h,p=h.clientTop||d.clientTop,w=h.clientTop!==0,y=d.clientTop!==0,v=h===d;if(!u)return{};const x={...e,...await ce(-u.offsetTop-h.clientTop-m.reference.height/2-u.offsetHeight/2-i).fn(e)},b=await yt(qt(x,d.scrollHeight+p+h.clientTop),a),R=await yt(x,{...a,elementContext:"reference"}),S=D(0,b.top),A=x.y+S,T=(d.scrollHeight>d.clientHeight?O=>O:nt)(D(0,d.scrollHeight+(w&&v||y?p*2:0)-S-D(0,b.bottom)));if(d.style.maxHeight=T+"px",d.scrollTop=S,r){const O=d.offsetHeight=-c||R.bottom>=-c;ct.flushSync(()=>r(O))}return o&&(o.current=await yt(qt({...x,y:A},d.offsetHeight+p+h.clientTop),a)),{y:A}}});function $n(t,e){const{open:n,elements:o}=t,{enabled:r=!0,overflowRef:i,scrollRef:s,onChange:l}=e,c=ae(l),f=g.useRef(!1),a=g.useRef(null),m=g.useRef(null);g.useEffect(()=>{if(!r)return;function u(p){if(p.ctrlKey||!d||i.current==null)return;const w=p.deltaY,y=i.current.top>=-.5,v=i.current.bottom>=-.5,x=d.scrollHeight-d.clientHeight,b=w<0?-1:1,R=w<0?"max":"min";d.scrollHeight<=d.clientHeight||(!y&&w>0||!v&&w<0?(p.preventDefault(),ct.flushSync(()=>{c(S=>S+Math[R](w,x*b))})):/firefox/i.test(Ae())&&(d.scrollTop+=w))}const d=(s==null?void 0:s.current)||o.floating;if(n&&d)return d.addEventListener("wheel",u),requestAnimationFrame(()=>{a.current=d.scrollTop,i.current!=null&&(m.current={...i.current})}),()=>{a.current=null,m.current=null,d.removeEventListener("wheel",u)}},[r,n,o.floating,i,s,c]);const h=g.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const u=(s==null?void 0:s.current)||o.floating;if(!(!i.current||!u||!f.current)){if(a.current!==null){const d=u.scrollTop-a.current;(i.current.bottom<-.5&&d<-1||i.current.top<-.5&&d>1)&&ct.flushSync(()=>c(p=>p+d))}requestAnimationFrame(()=>{a.current=u.scrollTop})}}}),[o.floating,c,i,s]);return g.useMemo(()=>r?{floating:h}:{},[r,h])}let tt=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});tt.displayName="FloatingContext";let Ft=g.createContext(null);Ft.displayName="PlacementContext";function Wn(t){return g.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function Vn(){return g.useContext(tt).setReference}function _n(){return g.useContext(tt).getReferenceProps}function jn(){let{getFloatingProps:t,slot:e}=g.useContext(tt);return g.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function zn(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=g.useContext(Ft),n=g.useMemo(()=>t,[JSON.stringify(t,(r,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);ot(()=>{e==null||e(n??null)},[e,n]);let o=g.useContext(tt);return g.useMemo(()=>[o.setFloating,t?o.styles:{}],[o.setFloating,t,o.styles])}let Xt=4;function Yn({children:t,enabled:e=!0}){let[n,o]=g.useState(null),[r,i]=g.useState(0),s=g.useRef(null),[l,c]=g.useState(null);kn(l);let f=e&&n!==null&&l!==null,{to:a="bottom",gap:m=0,offset:h=0,padding:u=0,inner:d}=In(n,l),[p,w="center"]=a.split(" ");ot(()=>{f&&i(0)},[f]);let{refs:y,floatingStyles:v,context:x}=Dn({open:f,placement:p==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${p}`:`${p}-${w}`,strategy:"absolute",transform:!1,middleware:[ce({mainAxis:p==="selection"?0:m,crossAxis:h}),pn({padding:u}),p!=="selection"&&wn({padding:u}),p==="selection"&&d?Hn({...d,padding:u,overflowRef:s,offset:r,minItemsVisible:Xt,referenceOverflowThreshold:u,onFallbackChange(O){var k,P;if(!O)return;let F=x.elements.floating;if(!F)return;let z=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,M=Math.min(Xt,F.childElementCount),I=0,C=0;for(let E of(P=(k=x.elements.floating)==null?void 0:k.childNodes)!=null?P:[])if(ge(E)){let H=E.offsetTop,Mt=H+E.clientHeight+z,wt=F.scrollTop,Pt=wt+F.clientHeight;if(H>=wt&&Mt<=Pt)M--;else{C=Math.max(0,Math.min(Mt,Pt)-Math.max(H,wt)),I=E.clientHeight;break}}M>=1&&i(E=>{let H=I*M-C+z;return E>=H?E:H})}}):null,xn({padding:u,apply({availableWidth:O,availableHeight:k,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${k}px)`})}})].filter(Boolean),whileElementsMounted:ln}),[b=p,R=w]=x.placement.split("-");p==="selection"&&(b="selection");let S=g.useMemo(()=>({anchor:[b,R].filter(Boolean).join(" ")}),[b,R]),A=$n(x,{overflowRef:s,onChange:i}),{getReferenceProps:L,getFloatingProps:N}=Ln([A]),T=Kt(O=>{c(O),y.setFloating(O)});return g.createElement(Ft.Provider,{value:o},g.createElement(tt.Provider,{value:{setFloating:T,setReference:y.setReference,styles:v,getReferenceProps:L,getFloatingProps:N,slot:S}},t))}function kn(t){ot(()=>{if(!t)return;let e=new MutationObserver(()=>{let n=window.getComputedStyle(t).maxHeight,o=parseFloat(n);if(isNaN(o))return;let r=parseInt(n);isNaN(r)||o!==r&&(t.style.maxHeight=`${Math.ceil(o)}px`)});return e.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[t])}function In(t,e){var n,o,r;let i=Rt((n=t==null?void 0:t.gap)!=null?n:"var(--anchor-gap, 0)",e),s=Rt((o=t==null?void 0:t.offset)!=null?o:"var(--anchor-offset, 0)",e),l=Rt((r=t==null?void 0:t.padding)!=null?r:"var(--anchor-padding, 0)",e);return{...t,gap:i,offset:s,padding:l}}function Rt(t,e,n=void 0){let o=he(),r=Kt((c,f)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!f)return[n,null];let a=Ut(c,f);return[a,m=>{let h=ue(c);{let u=h.map(d=>window.getComputedStyle(f).getPropertyValue(d));o.requestAnimationFrame(function d(){o.nextFrame(d);let p=!1;for(let[y,v]of h.entries()){let x=window.getComputedStyle(f).getPropertyValue(v);if(u[y]!==x){u[y]=x,p=!0;break}}if(!p)return;let w=Ut(c,f);a!==w&&(m(w),a=w)})}return o.dispose}]}return[n,null]}),i=g.useMemo(()=>r(t,e)[0],[t,e]),[s=i,l]=g.useState();return ot(()=>{let[c,f]=r(t,e);if(l(c),!!f)return f(l)},[t,e]),s}function ue(t){let e=/var\((.*)\)/.exec(t);if(e){let n=e[1].indexOf(",");if(n===-1)return[e[1]];let o=e[1].slice(0,n).trim(),r=e[1].slice(n+1).trim();return r?[o,...ue(r)]:[o]}return[]}function Ut(t,e){let n=document.createElement("div");e.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",t,"important");let o=parseFloat(window.getComputedStyle(n).marginTop)||0;return e.removeChild(n),o}export{Yn as A,Vn as F,zn as R,jn as T,_n as b,Nn as w,Wn as y}; diff --git a/frontend/dist/assets/folder-lock-DvltIKzr.js b/frontend/dist/assets/folder-lock-CojF4hzD.js similarity index 91% rename from frontend/dist/assets/folder-lock-DvltIKzr.js rename to frontend/dist/assets/folder-lock-CojF4hzD.js index a082f26f..8af39805 100644 --- a/frontend/dist/assets/folder-lock-DvltIKzr.js +++ b/frontend/dist/assets/folder-lock-CojF4hzD.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-C8J8z7Af.js";/** +import{e as a}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/frozen-BZ7OZfIg.js b/frontend/dist/assets/frozen-DqtxZ1v6.js similarity index 78% rename from frontend/dist/assets/frozen-BZ7OZfIg.js rename to frontend/dist/assets/frozen-DqtxZ1v6.js index bda366dd..a9d77d08 100644 --- a/frontend/dist/assets/frozen-BZ7OZfIg.js +++ b/frontend/dist/assets/frozen-DqtxZ1v6.js @@ -1 +1 @@ -import{br as l,r as o}from"./index-C8J8z7Af.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{br as l,r as o}from"./index-Dk8KEIKm.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-CRYMLc9L.js b/frontend/dist/assets/funnel-B-Z6Air3.js similarity index 90% rename from frontend/dist/assets/funnel-CRYMLc9L.js rename to frontend/dist/assets/funnel-B-Z6Air3.js index 9150dfa4..e730ba0d 100644 --- a/frontend/dist/assets/funnel-CRYMLc9L.js +++ b/frontend/dist/assets/funnel-B-Z6Air3.js @@ -1,4 +1,4 @@ -import{e}from"./index-C8J8z7Af.js";/** +import{e}from"./index-Dk8KEIKm.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-ChtBrERo.js b/frontend/dist/assets/git-branch-Dye45Z4B.js similarity index 90% rename from frontend/dist/assets/git-branch-ChtBrERo.js rename to frontend/dist/assets/git-branch-Dye45Z4B.js index 9929aa85..d1df10b6 100644 --- a/frontend/dist/assets/git-branch-ChtBrERo.js +++ b/frontend/dist/assets/git-branch-Dye45Z4B.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-C8J8z7Af.js";/** +import{e as c}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/hash-8dFF62ov.js b/frontend/dist/assets/hash-BaVtxU1B.js similarity index 91% rename from frontend/dist/assets/hash-8dFF62ov.js rename to frontend/dist/assets/hash-BaVtxU1B.js index 488be453..ec243cf2 100644 --- a/frontend/dist/assets/hash-8dFF62ov.js +++ b/frontend/dist/assets/hash-BaVtxU1B.js @@ -1,4 +1,4 @@ -import{e}from"./index-C8J8z7Af.js";/** +import{e}from"./index-Dk8KEIKm.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/index-DAnUKwME.js b/frontend/dist/assets/index-DMeWa3DH.js similarity index 98% rename from frontend/dist/assets/index-DAnUKwME.js rename to frontend/dist/assets/index-DMeWa3DH.js index f2c2123e..79ee10a5 100644 --- a/frontend/dist/assets/index-DAnUKwME.js +++ b/frontend/dist/assets/index-DMeWa3DH.js @@ -1 +1 @@ -import{gP as tt,gQ as et,gR as nt,gS as it,gT as st,gU as at,o as Z,gV as rt,gW as ot,gX as lt,gY as ut,gZ as ct,g_ as ft,g$ as mt,h0 as ht,h1 as gt,h2 as pt,h3 as C,h4 as dt,h5 as yt,h6 as At}from"./index-C8J8z7Af.js";const St=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function $(t,e){return tt(t)?t[St(0,t.length,e)]:t}class Et{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;ii.attachTimeline(e));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Q(this.animations,"duration")}get iterationDuration(){return Q(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Q(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Vt extends Et{then(e,n){return this.finished.finally(e).then(()=>{})}}function vt(t,e){return t in e}class Dt extends et{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(vt(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return nt()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function W(t){return typeof t=="object"&&!Array.isArray(t)}function J(t,e,n,i){return t==null?[]:typeof t=="string"&&W(e)?it(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function Tt(t,e,n){return t*(e+1)}function U(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Mt(t,e,n){for(let i=0;ie&&s.at{const r=It(p),{delay:x=0,times:d=rt(r),type:L=e.type||"keyframes",repeat:K,repeatType:Rt,repeatDelay:_t=0,...q}=M;let{ease:E=e.ease||"easeOut",duration:y}=M;const j=typeof x=="function"?x(v,O):x,P=r.length,R=ut(L)?L:s==null?void 0:s[L||"keyframes"];if(P<=2&&R){let w=100;if(P===2&&Nt(r)){const G=r[1]-r[0];w=Math.abs(G)}const N={...e,...q};y!==void 0&&(N.duration=ct(y));const B=ot(N,w,R);E=B.ease,y=B.duration}y??(y=o);const _=u+j;d.length===1&&d[0]===0&&(d[1]=1);const z=d.length-r.length;if(z>0&<(d,z),r.length===1&&r.unshift(null),K){y=Tt(y,K);const w=[...r],N=[...d];E=Array.isArray(E)?[...E]:[E];const B=[...E];for(let G=0;G{for(const V in D){const h=D[V];h.sort(xt);const c=[],f=[],T=[];for(let v=0;vtypeof t=="number",Nt=t=>t.every(Kt);function Bt(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=mt(t)&&!ht(t)?new gt(e):new pt(e);n.mount(t),C.set(t,n)}function Ct(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Dt(e);n.mount(t),C.set(t,n)}function Lt(t,e){return Z(t)||typeof t=="number"||typeof t=="string"&&!W(e)}function k(t,e,n,i){const s=[];if(Lt(t,e))s.push(dt(t,W(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const o=J(t,e,i),a=o.length;for(let l=0;l{i.push(...k(l,o,a))}),i}function jt(t){return Array.isArray(t)&&t.some(Array.isArray)}function Pt(t){function e(n,i,s){let o=[],a;if(jt(n))o=Wt(n,i,t);else{const{onComplete:g,...A}=s||{};typeof g=="function"&&(a=g),o=k(n,i,A,t)}const l=new Vt(o);return a&&l.finished.then(a),l}return e}const Ht=Pt();export{Ht as a}; +import{gP as tt,gQ as et,gR as nt,gS as it,gT as st,gU as at,o as Z,gV as rt,gW as ot,gX as lt,gY as ut,gZ as ct,g_ as ft,g$ as mt,h0 as ht,h1 as gt,h2 as pt,h3 as C,h4 as dt,h5 as yt,h6 as At}from"./index-Dk8KEIKm.js";const St=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function $(t,e){return tt(t)?t[St(0,t.length,e)]:t}class Et{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;ii.attachTimeline(e));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Q(this.animations,"duration")}get iterationDuration(){return Q(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Q(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Vt extends Et{then(e,n){return this.finished.finally(e).then(()=>{})}}function vt(t,e){return t in e}class Dt extends et{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(vt(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return nt()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function W(t){return typeof t=="object"&&!Array.isArray(t)}function J(t,e,n,i){return t==null?[]:typeof t=="string"&&W(e)?it(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function Tt(t,e,n){return t*(e+1)}function U(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Mt(t,e,n){for(let i=0;ie&&s.at{const r=It(p),{delay:x=0,times:d=rt(r),type:L=e.type||"keyframes",repeat:K,repeatType:Rt,repeatDelay:_t=0,...q}=M;let{ease:E=e.ease||"easeOut",duration:y}=M;const j=typeof x=="function"?x(v,O):x,P=r.length,R=ut(L)?L:s==null?void 0:s[L||"keyframes"];if(P<=2&&R){let w=100;if(P===2&&Nt(r)){const G=r[1]-r[0];w=Math.abs(G)}const N={...e,...q};y!==void 0&&(N.duration=ct(y));const B=ot(N,w,R);E=B.ease,y=B.duration}y??(y=o);const _=u+j;d.length===1&&d[0]===0&&(d[1]=1);const z=d.length-r.length;if(z>0&<(d,z),r.length===1&&r.unshift(null),K){y=Tt(y,K);const w=[...r],N=[...d];E=Array.isArray(E)?[...E]:[E];const B=[...E];for(let G=0;G{for(const V in D){const h=D[V];h.sort(xt);const c=[],f=[],T=[];for(let v=0;vtypeof t=="number",Nt=t=>t.every(Kt);function Bt(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=mt(t)&&!ht(t)?new gt(e):new pt(e);n.mount(t),C.set(t,n)}function Ct(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Dt(e);n.mount(t),C.set(t,n)}function Lt(t,e){return Z(t)||typeof t=="number"||typeof t=="string"&&!W(e)}function k(t,e,n,i){const s=[];if(Lt(t,e))s.push(dt(t,W(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const o=J(t,e,i),a=o.length;for(let l=0;l{i.push(...k(l,o,a))}),i}function jt(t){return Array.isArray(t)&&t.some(Array.isArray)}function Pt(t){function e(n,i,s){let o=[],a;if(jt(n))o=Wt(n,i,t);else{const{onComplete:g,...A}=s||{};typeof g=="function"&&(a=g),o=k(n,i,A,t)}const l=new Vt(o);return a&&l.finished.then(a),l}return e}const Ht=Pt();export{Ht as a}; diff --git a/frontend/dist/assets/index-C8J8z7Af.js b/frontend/dist/assets/index-Dk8KEIKm.js similarity index 69% rename from frontend/dist/assets/index-C8J8z7Af.js rename to frontend/dist/assets/index-Dk8KEIKm.js index 3aeb44a3..ac011acf 100644 --- a/frontend/dist/assets/index-C8J8z7Af.js +++ b/frontend/dist/assets/index-Dk8KEIKm.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-BgsTUkwh.js","assets/PageLayout-D_1HzH-E.js","assets/setup-C1PWPTL6.js","assets/wrench-DY1XOTkT.js","assets/Grid-CfYPlwSW.js","assets/wifi-5HVE8VPj.js","assets/Dashboard-Cvvu9N9z.js","assets/consumer-registry-BKgTBvt8.js","assets/DataValue-CWEIHPTl.js","assets/index-CSWZC0QG.js","assets/index-DAnUKwME.js","assets/node-types-B5WxOxT2.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-qNmSxnCj.js","assets/chevron-up-BhSn6i9S.js","assets/primitives-CBHOCw6k.js","assets/badge-colors-Dl76Mz8m.js","assets/chat-utils-C5p1i8vZ.js","assets/SignalIndicator-CpPs32QG.js","assets/arrow-up-CsqMGTbi.js","assets/arrow-right-D_4v2CeG.js","assets/arrow-down-Dqy7bDoY.js","assets/chevron-right-ZaDPsavE.js","assets/payload-detail-BWHpd-ZF.js","assets/map-pin-ufrVZcS3.js","assets/circle-question-mark-CD6FHJ5H.js","assets/layers-Dy827Q5R.js","assets/hash-8dFF62ov.js","assets/clock-CTBG2e06.js","assets/route-BEiTCi9B.js","assets/activity-Bh2DzqDM.js","assets/useMapViewStore-CmYR40pV.js","assets/shield-Gw0bk8jQ.js","assets/TimeRangeStepper-D6X8K2qC.js","assets/floating-DcVaWvZe.js","assets/zap-8IJ4kWaK.js","assets/usePipelineStore-CtpzsDw6.js","assets/LightSparkline-DUJ9rwBo.js","assets/link-scoring-BlhmfUap.js","assets/timer-BVd5WQSE.js","assets/AutoConfigureDialog-CVadgP9a.js","assets/wand-sparkles-CkPC71f7.js","assets/ChatBubble-DwkygOA9.js","assets/message-square-text-CwsdV-n7.js","assets/message-square-CZnvv13e.js","assets/MqttModeBadge-D5EDDcC2.js","assets/Packets-BBd1O-ot.js","assets/element-movement-DhaeUFJY.js","assets/use-tree-walker-DrduKptm.js","assets/frozen-BZ7OZfIg.js","assets/AnalyzerFilterPanel-CBecqjNU.js","assets/funnel-CRYMLc9L.js","assets/search-BO7ZBfwt.js","assets/sparkles-vljvhdkN.js","assets/Contacts-BxFskpCD.js","assets/listbox-BOcIoorq.js","assets/use-text-value-Bj-jCGjS.js","assets/CollisionExplorerModal-bQOWAc0q.js","assets/BasemapLayer-BvoQWTC4.js","assets/layer-DgtbTXVx.js","assets/share-2-PheBENSj.js","assets/map-pin-off-COAzJaWC.js","assets/target-BJQI0xG9.js","assets/trash-2-MzXRdjh-.js","assets/ConfirmModal-B5_l2g7c.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-CGBCr-zh.js","assets/easing-CQ2FiqiW.js","assets/compass--Ql4hKkC.js","assets/settings-2-BrtUmS4l.js","assets/network-BNx67sOl.js","assets/RfHealthCorrelation-DxrNjcLK.js","assets/GPSDiagnostics-D4qyRZvV.js","assets/satellite-oFalh_20.js","assets/Sensors-B48mIFqz.js","assets/CADCalibration-DlKXekH3.js","assets/system-CzT5Ikli.js","assets/save-ChsI8Mf5.js","assets/MeshGraph-BvCtLSUf.js","assets/max-DNf2hxWM.js","assets/variants-CSW2-RVV.js","assets/git-branch-ChtBrERo.js","assets/rotate-ccw-CH2KviiM.js","assets/System-BGDb6bt1.js","assets/thermometer-JkoQlooZ.js","assets/Logs-DeiDk3ov.js","assets/circle-stop-Bv_ZsQj9.js","assets/Terminal-BBjIRbrg.js","assets/transport-UEOv7eJu.js","assets/KeycapButton-LnaBrSq2.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-DiItfVqY.js","assets/setting-field-DUdKGmIP.js","assets/pencil-C5OSBhs0.js","assets/repeat-DFihKOPA.js","assets/antenna-uOteVbHn.js","assets/folder-lock-DvltIKzr.js","assets/plus-DWX8cdcI.js","assets/key-round-C1SnbsaC.js","assets/RoomServer-tRKXPbhi.js","assets/fieldset-Dw6uLZoo.js","assets/PacketObservatory-Bor22S6-.js","assets/Sessions-DeYOFEWZ.js","assets/Mqtt-T5trP6l_.js","assets/check-check-BxJI0DsK.js","assets/wifi-off-DYd4qfYe.js","assets/Observer-jT6ZkA2J.js","assets/maintenance-C116ce5C.js","assets/rotate-cw-8-HjiytO.js","assets/PolicyEngine-CiCiXSMW.js","assets/DatabaseManagement-Dz64hdQo.js","assets/MemoryDebug-CviboBHK.js","assets/BackupRestore-B5tynF_C.js","assets/backup-D2yaW6qB.js","assets/upload-DE3acz7s.js","assets/RadioHardware-BO7_64oZ.js","assets/Companion-BVi91xoL.js","assets/circle-alert-CkWx_yNx.js","assets/Test-D678G5-N.js"])))=>i.map(i=>d[i]); -var dR=Object.defineProperty;var oS=e=>{throw TypeError(e)};var fR=(e,t,n)=>t in e?dR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>fR(e,typeof t!="symbol"?t+"":t,n),Y0=(e,t,n)=>t.has(e)||oS("Cannot "+n);var he=(e,t,n)=>(Y0(e,t,"read from private field"),n?n.call(e):t.get(e)),nn=(e,t,n)=>t.has(e)?oS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>(Y0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),yt=(e,t,n)=>(Y0(e,t,"access private method"),n);var kp=(e,t,n,r)=>({set _(s){Tt(e,t,s,n)},get _(){return he(e,t,r)}});function hR(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 pR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X0={exports:{}},xd={},Q0={exports:{}},Gt={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-CdUlog-z.js","assets/PageLayout-CGcnsIyM.js","assets/setup-aZlM24bl.js","assets/wrench-2g9NYn7s.js","assets/Grid-CThL_TW5.js","assets/wifi-BW0hMh8T.js","assets/Dashboard-C-JGUZGD.js","assets/consumer-registry-CTHycSys.js","assets/DataValue-D1URDV5k.js","assets/index-M6ru5Gad.js","assets/index-DMeWa3DH.js","assets/node-types-SdzDwn2r.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-CmrEXwog.js","assets/chevron-up-DzJVNs-c.js","assets/primitives-CrKVF5BS.js","assets/badge-colors-Dl76Mz8m.js","assets/chat-utils-DAcFG23d.js","assets/SignalIndicator-DJ2WGJCI.js","assets/arrow-up-BhSGIVnk.js","assets/arrow-right-vgcsVPr-.js","assets/arrow-down-B85BrN7t.js","assets/chevron-right-BugwEnle.js","assets/payload-detail-BR_z6q5h.js","assets/map-pin-6ZLH5iNg.js","assets/circle-question-mark-BNRkoCvq.js","assets/layers-g7u6rTYv.js","assets/hash-BaVtxU1B.js","assets/clock-BSYVhL7Q.js","assets/route-CxDUYLxS.js","assets/activity-D99FIjaW.js","assets/useMapViewStore-CNJAZ76M.js","assets/shield-61UHbj0K.js","assets/TimeRangeStepper-CNBzSSfG.js","assets/floating-DAdA6y7o.js","assets/zap-B0O7nHBO.js","assets/usePipelineStore-C2CKtblH.js","assets/LightSparkline-eR-H8PYv.js","assets/link-scoring-DySzFC0u.js","assets/timer-DxeOkv-V.js","assets/AutoConfigureDialog-CH58tL57.js","assets/wand-sparkles-Cfv_3ntm.js","assets/ChatBubble-4SEgCFK2.js","assets/message-square-text-hT1rOeOR.js","assets/message-square-KCaAXVVf.js","assets/MqttModeBadge-CijH65Eh.js","assets/Packets-CILpbmC-.js","assets/element-movement-CrHrmJVz.js","assets/use-tree-walker-D-l3KkK-.js","assets/frozen-DqtxZ1v6.js","assets/AnalyzerFilterPanel-CwOmGxBn.js","assets/funnel-B-Z6Air3.js","assets/search-DgakOYk2.js","assets/sparkles-CZBEDNRz.js","assets/Contacts-DIeFu4lF.js","assets/listbox-BpBYEakW.js","assets/use-text-value-XAXtIZxt.js","assets/CollisionExplorerModal-5AGT-1cv.js","assets/BasemapLayer-snfcoHal.js","assets/layer-CgHNe4F2.js","assets/share-2-CopKWuTH.js","assets/map-pin-off-DSyO3Y2C.js","assets/target-Djl_t-RI.js","assets/trash-2-BNWAPzrN.js","assets/ConfirmModal-n8Se2h3L.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-_Ds72uPG.js","assets/easing-x6QsY02F.js","assets/compass-DJByH8FZ.js","assets/settings-2-CTbt3KT5.js","assets/network-BgtOii-i.js","assets/RfHealthCorrelation-AsWuS5lw.js","assets/GPSDiagnostics-B-z1YN9k.js","assets/satellite-COoSp6TF.js","assets/Sensors-Jac5JG2X.js","assets/CADCalibration-CGIGz84J.js","assets/system-CChwfvfT.js","assets/save-DrkPtb78.js","assets/MeshGraph-D4AwE2ti.js","assets/max-zrNGYgli.js","assets/variants-bcpM0cYI.js","assets/git-branch-Dye45Z4B.js","assets/rotate-ccw-BQDcEa4l.js","assets/System-DKJZzfFT.js","assets/thermometer-CwnqiDCo.js","assets/Logs-nUEk6i_Z.js","assets/circle-stop-DA7KtBFF.js","assets/Terminal-BQAZsGyf.js","assets/transport-DFMEelmb.js","assets/KeycapButton-BcsI7tsG.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-YvAayUtY.js","assets/setting-field-mByymMx9.js","assets/pencil-Cf1ve6Fc.js","assets/repeat-CCIOgB90.js","assets/antenna-BPUiILZz.js","assets/folder-lock-CojF4hzD.js","assets/plus-BQyrUsn7.js","assets/key-round-CDk8iwaD.js","assets/RoomServer-2UYqAd-A.js","assets/fieldset-BlgsvaPV.js","assets/PacketObservatory-CrZKJNh3.js","assets/Sessions-CHKcpdbs.js","assets/Mqtt-Bj_t7IzQ.js","assets/check-check-BfFB-ozy.js","assets/wifi-off-Dyij-7Es.js","assets/Observer-B3mst5X7.js","assets/maintenance-BwN0Nmu4.js","assets/rotate-cw-DeILC3U9.js","assets/PolicyEngine-DTEUQ5zM.js","assets/DatabaseManagement-DJ7JfUIQ.js","assets/MemoryDebug-DQikeVuR.js","assets/BackupRestore-B0l04Qsd.js","assets/backup-CooFBfHx.js","assets/upload-L_Eq4fFX.js","assets/RadioHardware-B0jlEO3v.js","assets/Companion-Cq3cjcyh.js","assets/circle-alert-CkK66Qaq.js","assets/Test-DmWI6JzW.js"])))=>i.map(i=>d[i]); +var gR=Object.defineProperty;var lS=e=>{throw TypeError(e)};var yR=(e,t,n)=>t in e?gR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>yR(e,typeof t!="symbol"?t+"":t,n),Y0=(e,t,n)=>t.has(e)||lS("Cannot "+n);var he=(e,t,n)=>(Y0(e,t,"read from private field"),n?n.call(e):t.get(e)),nn=(e,t,n)=>t.has(e)?lS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>(Y0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),yt=(e,t,n)=>(Y0(e,t,"access private method"),n);var kp=(e,t,n,r)=>({set _(s){Tt(e,t,s,n)},get _(){return he(e,t,r)}});function bR(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 vR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X0={exports:{}},kd={},Q0={exports:{}},Gt={};/** * @license React * react.production.min.js * @@ -7,7 +7,7 @@ var dR=Object.defineProperty;var oS=e=>{throw TypeError(e)};var fR=(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 mR(){if(iS)return Gt;iS=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(q){return q===null||typeof q!="object"?null:(q=h&&q[h]||q["@@iterator"],typeof q=="function"?q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function w(q,V,X){this.props=q,this.context=V,this.refs=b,this.updater=X||g}w.prototype.isReactComponent={},w.prototype.setState=function(q,V){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,V,"setState")},w.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function C(){}C.prototype=w.prototype;function v(q,V,X){this.props=q,this.context=V,this.refs=b,this.updater=X||g}var x=v.prototype=new C;x.constructor=v,y(x,w.prototype),x.isPureReactComponent=!0;var _=Array.isArray,S=Object.prototype.hasOwnProperty,R={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function k(q,V,X){var ye,te={},xe=null,re=null;if(V!=null)for(ye in V.ref!==void 0&&(re=V.ref),V.key!==void 0&&(xe=""+V.key),V)S.call(V,ye)&&!O.hasOwnProperty(ye)&&(te[ye]=V[ye]);var se=arguments.length-2;if(se===1)te.children=X;else if(1{throw TypeError(e)};var fR=(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 lS;function gR(){if(lS)return xd;lS=1;var e=$g(),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 xd.Fragment=n,xd.jsx=i,xd.jsxs=i,xd}var cS;function yR(){return cS||(cS=1,X0.exports=gR()),X0.exports}var A=yR(),T=$g();const at=pR(T),uS=hR({__proto__:null,default:at},[T]);var Sp={},J0={exports:{}},As={},Z0={exports:{}},eb={};/** + */var dS;function ER(){if(dS)return kd;dS=1;var e=$g(),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 kd.Fragment=n,kd.jsx=i,kd.jsxs=i,kd}var fS;function CR(){return fS||(fS=1,X0.exports=ER()),X0.exports}var A=CR(),T=$g();const at=vR(T),hS=bR({__proto__:null,default:at},[T]);var Sp={},J0={exports:{}},As={},Z0={exports:{}},eb={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var dR=Object.defineProperty;var oS=e=>{throw TypeError(e)};var fR=(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 dS;function bR(){return dS||(dS=1,(function(e){function t(G,ee){var Y=G.length;G.push(ee);e:for(;0>>1,V=G[q];if(0>>1;qs(te,Y))xes(re,te)?(G[q]=re,G[xe]=Y,q=xe):(G[q]=te,G[ye]=Y,q=ye);else if(xes(re,Y))G[q]=re,G[xe]=Y,q=xe;else break e}}return ee}function s(G,ee){var Y=G.sortIndex-ee.sortIndex;return Y!==0?Y:G.id-ee.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 ee=n(u);ee!==null;){if(ee.callback===null)r(u);else if(ee.startTime<=G)r(u),ee.sortIndex=ee.expirationTime,t(c,ee);else break;ee=n(u)}}function _(G){if(b=!1,x(G),!y)if(n(c)!==null)y=!0,K(S);else{var ee=n(u);ee!==null&&H(_,ee.startTime-G)}}function S(G,ee){y=!1,b&&(b=!1,C(k),k=-1),g=!0;var Y=p;try{for(x(ee),h=n(c);h!==null&&(!(h.expirationTime>ee)||G&&!I());){var q=h.callback;if(typeof q=="function"){h.callback=null,p=h.priorityLevel;var V=q(h.expirationTime<=ee);ee=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(c)&&r(c),x(ee)}else r(c);h=n(c)}if(h!==null)var X=!0;else{var ye=n(u);ye!==null&&H(_,ye.startTime-ee),X=!1}return X}finally{h=null,p=Y,g=!1}}var R=!1,O=null,k=-1,D=5,B=-1;function I(){return!(e.unstable_now()-BG||125q?(G.sortIndex=Y,t(u,G),n(c)===null&&G===n(u)&&(b?(C(k),k=-1):b=!0,H(_,Y-q))):(G.sortIndex=V,t(c,G),y||g||(y=!0,K(S))),G},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(G){var ee=p;return function(){var Y=p;p=ee;try{return G.apply(this,arguments)}finally{p=Y}}}})(eb)),eb}var fS;function vR(){return fS||(fS=1,Z0.exports=bR()),Z0.exports}/** + */var pS;function xR(){return pS||(pS=1,(function(e){function t(G,ee){var Y=G.length;G.push(ee);e:for(;0>>1,V=G[q];if(0>>1;qs(te,Y))xes(re,te)?(G[q]=re,G[xe]=Y,q=xe):(G[q]=te,G[ye]=Y,q=ye);else if(xes(re,Y))G[q]=re,G[xe]=Y,q=xe;else break e}}return ee}function s(G,ee){var Y=G.sortIndex-ee.sortIndex;return Y!==0?Y:G.id-ee.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 ee=n(u);ee!==null;){if(ee.callback===null)r(u);else if(ee.startTime<=G)r(u),ee.sortIndex=ee.expirationTime,t(c,ee);else break;ee=n(u)}}function _(G){if(b=!1,x(G),!y)if(n(c)!==null)y=!0,K(S);else{var ee=n(u);ee!==null&&H(_,ee.startTime-G)}}function S(G,ee){y=!1,b&&(b=!1,C(k),k=-1),g=!0;var Y=p;try{for(x(ee),h=n(c);h!==null&&(!(h.expirationTime>ee)||G&&!I());){var q=h.callback;if(typeof q=="function"){h.callback=null,p=h.priorityLevel;var V=q(h.expirationTime<=ee);ee=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(c)&&r(c),x(ee)}else r(c);h=n(c)}if(h!==null)var X=!0;else{var ye=n(u);ye!==null&&H(_,ye.startTime-ee),X=!1}return X}finally{h=null,p=Y,g=!1}}var R=!1,j=null,k=-1,D=5,B=-1;function I(){return!(e.unstable_now()-BG||125q?(G.sortIndex=Y,t(u,G),n(c)===null&&G===n(u)&&(b?(C(k),k=-1):b=!0,H(_,Y-q))):(G.sortIndex=V,t(c,G),y||g||(y=!0,K(S))),G},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(G){var ee=p;return function(){var Y=p;p=ee;try{return G.apply(this,arguments)}finally{p=Y}}}})(eb)),eb}var mS;function kR(){return mS||(mS=1,Z0.exports=xR()),Z0.exports}/** * @license React * react-dom.production.min.js * @@ -31,14 +31,14 @@ var dR=Object.defineProperty;var oS=e=>{throw TypeError(e)};var fR=(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 hS;function wR(){if(hS)return As;hS=1;var e=$g(),t=vR();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,P,j,J){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=J}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||!(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,O,J){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=O,this.removeEmptyString=J}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||!(2ge||P[J]!==j[ge]){var Se=` -`+P[J].replace(" at new "," at ");return l.displayName&&Se.includes("")&&(Se=Se.replace("",l.displayName)),Se}while(1<=J&&0<=ge);break}}}finally{X=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?V(l):""}function te(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=ye(l.type,!1),l;case 11:return l=ye(l.type.render,!1),l;case 1:return l=ye(l.type,!0),l;default:return""}}function xe(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 O:return"Fragment";case R:return"Portal";case D:return"Profiler";case k:return"StrictMode";case $:return"Suspense";case z:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case I: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:xe(l.type)||"Memo";case K:d=l._payload,l=l._init;try{return xe(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 xe(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 Ce(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function ne(l){var d=Ce(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(J){E=""+J,j.call(this,J)}}),Object.defineProperty(l,d,{enumerable:m.enumerable}),{getValue:function(){return E},setValue:function(J){E=""+J},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function de(l){l._valueTracker||(l._valueTracker=ne(l))}function ve(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var m=d.getValue(),E="";return l&&(E=Ce(l)?l.checked?"true":"false":l.value),l=E,l!==m?(d.setValue(l),!0):!1}function Pe(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 ie(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 ke(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 Be(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"||Pe(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var Oe=Array.isArray;function Ee(l,d,m,E){if(l=l.options,d){d={};for(var P=0;P"+d.valueOf().toString()+"",d=N.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function ae(l,d){if(d){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=d;return}}l.textContent=d}var pe={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},we=["Webkit","ms","Moz","O"];Object.keys(pe).forEach(function(l){we.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),pe[d]=pe[l]})});function ce(l,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||pe.hasOwnProperty(l)&&pe[l]?(""+d).trim():d+"px"}function me(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 Qe=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(Qe[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 Zt=null,xt=null,Ht=null;function kt(l){if(l=ld(l)){if(typeof Zt!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Oh(d),Zt(l.stateNode,l.type,d))}}function Wt(l){xt?Ht?Ht.push(l):Ht=[l]:xt=l}function en(){if(xt){var l=xt,d=Ht;if(Ht=xt=null,kt(l),d)for(l=0;l>>=0,l===0?32:31-(qu(l)/Ur|0)|0}var rl=64,Qi=4194304;function Ji(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 dc(l,d){var m=l.pendingLanes;if(m===0)return 0;var E=0,P=l.suspendedLanes,j=l.pingedLanes,J=m&268435455;if(J!==0){var ge=J&~P;ge!==0?E=Ji(ge):(j&=J,j!==0&&(E=Ji(j)))}else J=m&~P,J!==0?E=Ji(J):j!==0&&(E=Ji(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 Zi(l,d,m){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-ts(d),l[d]=m}function Yu(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=vi),Ph=" ",Ec=!1;function W(l,d){switch(l){case"keyup":return Zn.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var le=!1;function fe(l,d){switch(l){case"compositionend":return Z(d);case"keypress":return d.which!==32?null:(Ec=!0,Ph);case"textInput":return l=d.data,l===Ph&&Ec?null:l;default:return null}}function Ae(l,d){if(le)return l==="compositionend"||!wc&&W(l,d)?(l=Ls(),Is=Zu=Rs=null,le=!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 Vr(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Vr(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function os(){for(var l=window,d=Pe();d instanceof l.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)l=d.contentWindow;else break;d=Pe(l.document)}return d}function is(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 Zs(l){var d=os(),m=l.focusedElem,E=l.selectionRange;if(d!==m&&m&&m.ownerDocument&&Vr(m.ownerDocument.documentElement,m)){if(E!==null&&is(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=js(m,j);var J=js(m,E);P&&J&&(l.rangeCount!==1||l.anchorNode!==P.node||l.anchorOffset!==P.offset||l.focusNode!==J.node||l.focusOffset!==J.offset)&&(d=d.createRange(),d.setStart(P.node,P.offset),l.removeAllRanges(),j>E?(l.addRange(d),l.extend(J.node,J.offset)):(d.setEnd(J.node,J.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,ur=null,wo=null,or=null,Cc=!1;function dx(l,d,m){var E=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Cc||ur==null||ur!==Pe(E)||(E=ur,"selectionStart"in E&&is(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}),or&&Ar(or,E)||(or=E,E=Lh(wo,"onSelect"),0_c||(l.current=qy[_c],qy[_c]=null,_c--)}function _n(l,d){_c++,qy[_c]=l.current,l.current=d}var ha={},Hr=fa(ha),Es=fa(!1),pl=ha;function Dc(l,d){var m=l.type.contextTypes;if(!m)return ha;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 $h(){Bn(Es),Bn(Hr)}function _x(l,d,m){if(Hr.current!==ha)throw Error(n(168));_n(Hr,d),_n(Es,m)}function Dx(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 Uh(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ha,pl=Hr.current,_n(Hr,l),_n(Es,Es.current),!0}function Tx(l,d,m){var E=l.stateNode;if(!E)throw Error(n(169));m?(l=Dx(l,d,pl),E.__reactInternalMemoizedMergedChildContext=l,Bn(Es),Bn(Hr),_n(Hr,l)):Bn(Es),_n(Es,m)}var Ei=null,zh=!1,Gy=!1;function Bx(l){Ei===null?Ei=[l]:Ei.push(l)}function B9(l){zh=!0,Bx(l)}function pa(){if(!Gy&&Ei!==null){Gy=!0;var l=0,d=Xt;try{var m=Ei;for(Xt=1;l>=J,P-=J,Ci=1<<32-ts(d)+P|m<It?(Tr=Dt,Dt=null):Tr=Dt.sibling;var an=Je(Re,Dt,je[It],it);if(an===null){Dt===null&&(Dt=Tr);break}l&&Dt&&an.alternate===null&&d(Re,Dt),De=j(an,De,It),_t===null?Ct=an:_t.sibling=an,_t=an,Dt=Tr}if(It===je.length)return m(Re,Dt),Nn&&gl(Re,It),Ct;if(Dt===null){for(;ItIt?(Tr=Dt,Dt=null):Tr=Dt.sibling;var xa=Je(Re,Dt,an.value,it);if(xa===null){Dt===null&&(Dt=Tr);break}l&&Dt&&xa.alternate===null&&d(Re,Dt),De=j(xa,De,It),_t===null?Ct=xa:_t.sibling=xa,_t=xa,Dt=Tr}if(an.done)return m(Re,Dt),Nn&&gl(Re,It),Ct;if(Dt===null){for(;!an.done;It++,an=je.next())an=tt(Re,an.value,it),an!==null&&(De=j(an,De,It),_t===null?Ct=an:_t.sibling=an,_t=an);return Nn&&gl(Re,It),Ct}for(Dt=E(Re,Dt);!an.done;It++,an=je.next())an=ht(Dt,Re,It,an.value,it),an!==null&&(l&&an.alternate!==null&&Dt.delete(an.key===null?It:an.key),De=j(an,De,It),_t===null?Ct=an:_t.sibling=an,_t=an);return l&&Dt.forEach(function(uR){return d(Re,uR)}),Nn&&gl(Re,It),Ct}function ir(Re,De,je,it){if(typeof je=="object"&&je!==null&&je.type===O&&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===O){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&&Lx(Ct)===_t.type){m(Re,_t.sibling),De=P(_t,je.props),De.ref=cd(Re,_t,je),De.return=Re,Re=De;break e}m(Re,_t);break}else d(Re,_t);_t=_t.sibling}je.type===O?(De=kl(je.props.children,Re.mode,it,je.key),De.return=Re,Re=De):(it=gp(je.type,je.key,je.props,null,Re.mode,it),it.ref=cd(Re,De,je),it.return=Re,Re=it)}return J(Re);case R: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=H0(je,Re.mode,it),De.return=Re,Re=De}return J(Re);case K:return _t=je._init,ir(Re,De,_t(je._payload),it)}if(Oe(je))return bt(Re,De,je,it);if(ee(je))return wt(Re,De,je,it);qh(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=V0(je,Re.mode,it),De.return=Re,Re=De),J(Re)):m(Re,De)}return ir}var Pc=Nx(!0),jx=Nx(!1),Gh=fa(null),Kh=null,Mc=null,Zy=null;function e0(){Zy=Mc=Kh=null}function t0(l){var d=Gh.current;Bn(Gh),l._currentValue=d}function n0(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 Rc(l,d){Kh=l,Zy=Mc=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(xs=!0),l.firstContext=null)}function no(l){var d=l._currentValue;if(Zy!==l)if(l={context:l,memoizedValue:d,next:null},Mc===null){if(Kh===null)throw Error(n(308));Mc=l,Kh.dependencies={lanes:0,firstContext:l}}else Mc=Mc.next=l;return d}var yl=null;function r0(l){yl===null?yl=[l]:yl.push(l)}function Ox(l,d,m,E){var P=d.interleaved;return P===null?(m.next=m,r0(d)):(m.next=P.next,P.next=m),d.interleaved=m,ki(l,E)}function ki(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 ma=!1;function s0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $x(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 Si(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function ga(l,d,m){var E=l.updateQueue;if(E===null)return null;if(E=E.shared,(tn&2)!==0){var P=E.pending;return P===null?d.next=d:(d.next=P.next,P.next=d),E.pending=d,ki(l,m)}return P=E.interleaved,P===null?(d.next=d,r0(E)):(d.next=P.next,P.next=d),E.interleaved=d,ki(l,m)}function Yh(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,ea(l,m)}}function Ux(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 J={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};j===null?P=j=J:j=j.next=J,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 Xh(l,d,m,E){var P=l.updateQueue;ma=!1;var j=P.firstBaseUpdate,J=P.lastBaseUpdate,ge=P.shared.pending;if(ge!==null){P.shared.pending=null;var Se=ge,Ue=Se.next;Se.next=null,J===null?j=Ue:J.next=Ue,J=Se;var et=l.alternate;et!==null&&(et=et.updateQueue,ge=et.lastBaseUpdate,ge!==J&&(ge===null?et.firstBaseUpdate=Ue:ge.next=Ue,et.lastBaseUpdate=Se))}if(j!==null){var tt=P.baseState;J=0,et=Ue=Se=null,ge=j;do{var Je=ge.lane,ht=ge.eventTime;if((E&Je)===Je){et!==null&&(et=et.next={eventTime:ht,lane:0,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null});e:{var bt=l,wt=ge;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:ma=!0}}ge.callback!==null&&ge.lane!==0&&(l.flags|=64,Je=P.effects,Je===null?P.effects=[ge]:Je.push(ge))}else ht={eventTime:ht,lane:Je,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null},et===null?(Ue=et=ht,Se=tt):et=et.next=ht,J|=Je;if(ge=ge.next,ge===null){if(ge=P.shared.pending,ge===null)break;Je=ge,ge=Je.next,Je.next=null,P.lastBaseUpdate=Je,P.shared.pending=null}}while(!0);if(et===null&&(Se=tt),P.baseState=Se,P.firstBaseUpdate=Ue,P.lastBaseUpdate=et,d=P.shared.interleaved,d!==null){P=d;do J|=P.lane,P=P.next;while(P!==d)}else j===null&&(P.shared.lanes=0);wl|=J,l.lanes=J,l.memoizedState=tt}}function zx(l,d,m){if(l=d.effects,d.effects=null,l!==null)for(d=0;dm?m:4,l(!0);var E=c0.transition;c0.transition={};try{l(!1),d()}finally{Xt=m,c0.transition=E}}function ak(){return ro().memoizedState}function R9(l,d,m){var E=wa(l);if(m={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null},lk(l))ck(d,m);else if(m=Ox(l,d,m,E),m!==null){var P=ls();So(m,l,E,P),uk(m,d,E)}}function I9(l,d,m){var E=wa(l),P={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null};if(lk(l))ck(d,P);else{var j=l.alternate;if(l.lanes===0&&(j===null||j.lanes===0)&&(j=d.lastRenderedReducer,j!==null))try{var J=d.lastRenderedState,ge=j(J,m);if(P.hasEagerState=!0,P.eagerState=ge,kn(ge,J)){var Se=d.interleaved;Se===null?(P.next=P,r0(d)):(P.next=Se.next,Se.next=P),d.interleaved=P;return}}catch{}finally{}m=Ox(l,d,P,E),m!==null&&(P=ls(),So(m,l,E,P),uk(m,d,E))}}function lk(l){var d=l.alternate;return l===qn||d!==null&&d===qn}function ck(l,d){hd=Zh=!0;var m=l.pending;m===null?d.next=d:(d.next=m.next,m.next=d),l.pending=d}function uk(l,d,m){if((m&4194240)!==0){var E=d.lanes;E&=l.pendingLanes,m|=E,d.lanes=m,ea(l,m)}}var np={readContext:no,useCallback:Wr,useContext:Wr,useEffect:Wr,useImperativeHandle:Wr,useInsertionEffect:Wr,useLayoutEffect:Wr,useMemo:Wr,useReducer:Wr,useRef:Wr,useState:Wr,useDebugValue:Wr,useDeferredValue:Wr,useTransition:Wr,useMutableSource:Wr,useSyncExternalStore:Wr,useId:Wr,unstable_isNewReconciler:!1},L9={readContext:no,useCallback:function(l,d){return Go().memoizedState=[l,d===void 0?null:d],l},useContext:no,useEffect:Zx,useImperativeHandle:function(l,d,m){return m=m!=null?m.concat([l]):null,ep(4194308,4,nk.bind(null,d,l),m)},useLayoutEffect:function(l,d){return ep(4194308,4,l,d)},useInsertionEffect:function(l,d){return ep(4,2,l,d)},useMemo:function(l,d){var m=Go();return d=d===void 0?null:d,l=l(),m.memoizedState=[l,d],l},useReducer:function(l,d,m){var E=Go();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=R9.bind(null,qn,l),[E.memoizedState,l]},useRef:function(l){var d=Go();return l={current:l},d.memoizedState=l},useState:Qx,useDebugValue:g0,useDeferredValue:function(l){return Go().memoizedState=l},useTransition:function(){var l=Qx(!1),d=l[0];return l=M9.bind(null,l[1]),Go().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,m){var E=qn,P=Go();if(Nn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=d(),Dr===null)throw Error(n(349));(vl&30)!==0||qx(E,d,m)}P.memoizedState=m;var j={value:m,getSnapshot:d};return P.queue=j,Zx(Kx.bind(null,E,j,l),[l]),E.flags|=2048,gd(9,Gx.bind(null,E,j,m,d),void 0,null),m},useId:function(){var l=Go(),d=Dr.identifierPrefix;if(Nn){var m=xi,E=Ci;m=(E&~(1<<32-ts(E)-1)).toString(32)+m,d=":"+d+"R"+m,m=pd++,0<\/script>",l=l.removeChild(l.firstChild)):typeof E.is=="string"?l=J.createElement(m,{is:E.is}):(l=J.createElement(m),m==="select"&&(J=l,E.multiple?J.multiple=!0:E.size&&(J.size=E.size))):l=J.createElementNS(l,m),l[Wo]=d,l[ad]=E,Bk(l,d,!1,!1),d.stateNode=l;e:{switch(J=nt(m,E),m){case"dialog":Tn("cancel",l),Tn("close",l),P=E;break;case"iframe":case"object":case"embed":Tn("load",l),P=E;break;case"video":case"audio":for(P=0;POc&&(d.flags|=128,E=!0,yd(j,!1),d.lanes=4194304)}else{if(!E)if(l=Qh(J),l!==null){if(d.flags|=128,E=!0,m=l.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),yd(j,!0),j.tail===null&&j.tailMode==="hidden"&&!J.alternate&&!Nn)return qr(d),null}else 2*xn()-j.renderingStartTime>Oc&&m!==1073741824&&(d.flags|=128,E=!0,yd(j,!1),d.lanes=4194304);j.isBackwards?(J.sibling=d.child,d.child=J):(m=j.last,m!==null?m.sibling=J:d.child=J,j.last=J)}return j.tail!==null?(d=j.tail,j.rendering=d,j.tail=d.sibling,j.renderingStartTime=xn(),d.sibling=null,m=Wn.current,_n(Wn,E?m&1|2:m&1),d):(qr(d),null);case 22:case 23:return $0(),E=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==E&&(d.flags|=8192),E&&(d.mode&1)!==0?(Us&1073741824)!==0&&(qr(d),d.subtreeFlags&6&&(d.flags|=8192)):qr(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function H9(l,d){switch(Yy(d),d.tag){case 1:return Cs(d.type)&&$h(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Ic(),Bn(Es),Bn(Hr),l0(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return i0(d),null;case 13:if(Bn(Wn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Fc()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Bn(Wn),null;case 4:return Ic(),null;case 10:return t0(d.type._context),null;case 22:case 23:return $0(),null;case 24:return null;default:return null}}var ip=!1,Gr=!1,W9=typeof WeakSet=="function"?WeakSet:Set,gt=null;function Nc(l,d){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(E){er(l,d,E)}else m.current=null}function D0(l,d,m){try{m()}catch(E){er(l,d,E)}}var Mk=!1;function q9(l,d){if($y=mn,l=os(),is(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 J=0,ge=-1,Se=-1,Ue=0,et=0,tt=l,Je=null;t:for(;;){for(var ht;tt!==m||P!==0&&tt.nodeType!==3||(ge=J+P),tt!==j||E!==0&&tt.nodeType!==3||(Se=J+E),tt.nodeType===3&&(J+=tt.nodeValue.length),(ht=tt.firstChild)!==null;)Je=tt,tt=ht;for(;;){if(tt===l)break t;if(Je===m&&++Ue===P&&(ge=J),Je===j&&++et===E&&(Se=J),(ht=tt.nextSibling)!==null)break;tt=Je,Je=tt.parentNode}tt=ht}m=ge===-1||Se===-1?null:{start:ge,end:Se}}else m=null}m=m||{start:0,end:0}}else m=null;for(Uy={focusedElem:l,selectionRange:m},mn=!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,ir=bt.memoizedState,Re=d.stateNode,De=Re.getSnapshotBeforeUpdate(d.elementType===d.type?wt:Co(d.type,wt),ir);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){er(d,d.return,it)}if(l=d.sibling,l!==null){l.return=d.return,gt=l;break}gt=d.return}return bt=Mk,Mk=!1,bt}function bd(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&&D0(d,m,j)}P=P.next}while(P!==E)}}function ap(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 T0(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 Rk(l){var d=l.alternate;d!==null&&(l.alternate=null,Rk(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Wo],delete d[ad],delete d[Wy],delete d[D9],delete d[T9])),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 Ik(l){return l.tag===5||l.tag===3||l.tag===4}function Lk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Ik(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 B0(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=jh));else if(E!==4&&(l=l.child,l!==null))for(B0(l,d,m),l=l.sibling;l!==null;)B0(l,d,m),l=l.sibling}function F0(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(F0(l,d,m),l=l.sibling;l!==null;)F0(l,d,m),l=l.sibling}var Lr=null,xo=!1;function ya(l,d,m){for(m=m.child;m!==null;)Nk(l,d,m),m=m.sibling}function Nk(l,d,m){if(ys&&typeof ys.onCommitFiberUnmount=="function")try{ys.onCommitFiberUnmount(Xi,m)}catch{}switch(m.tag){case 5:Gr||Nc(m,d);case 6:var E=Lr,P=xo;Lr=null,ya(l,d,m),Lr=E,xo=P,Lr!==null&&(xo?(l=Lr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):Lr.removeChild(m.stateNode));break;case 18:Lr!==null&&(xo?(l=Lr,m=m.stateNode,l.nodeType===8?Hy(l.parentNode,m):l.nodeType===1&&Hy(l,m),aa(l)):Hy(Lr,m.stateNode));break;case 4:E=Lr,P=xo,Lr=m.stateNode.containerInfo,xo=!0,ya(l,d,m),Lr=E,xo=P;break;case 0:case 11:case 14:case 15:if(!Gr&&(E=m.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){P=E=E.next;do{var j=P,J=j.destroy;j=j.tag,J!==void 0&&((j&2)!==0||(j&4)!==0)&&D0(m,d,J),P=P.next}while(P!==E)}ya(l,d,m);break;case 1:if(!Gr&&(Nc(m,d),E=m.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=m.memoizedProps,E.state=m.memoizedState,E.componentWillUnmount()}catch(ge){er(m,d,ge)}ya(l,d,m);break;case 21:ya(l,d,m);break;case 22:m.mode&1?(Gr=(E=Gr)||m.memoizedState!==null,ya(l,d,m),Gr=E):ya(l,d,m);break;default:ya(l,d,m)}}function jk(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new W9),d.forEach(function(E){var P=tR.bind(null,l,E);m.has(E)||(m.add(E),E.then(P,P))})}}function ko(l,d){var m=d.deletions;if(m!==null)for(var E=0;EP&&(P=J),E&=~j}if(E=P,E=xn()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*K9(E/1960))-E,10l?16:l,va===null)var E=!1;else{if(l=va,va=null,fp=0,(tn&6)!==0)throw Error(n(331));var P=tn;for(tn|=4,gt=l.current;gt!==null;){var j=gt,J=j.child;if((gt.flags&16)!==0){var ge=j.deletions;if(ge!==null){for(var Se=0;Sexn()-R0?Cl(l,0):M0|=m),Ss(l,d)}function Qk(l,d){d===0&&((l.mode&1)===0?d=1:(d=Qi,Qi<<=1,(Qi&130023424)===0&&(Qi=4194304)));var m=ls();l=ki(l,d),l!==null&&(Zi(l,d,m),Ss(l,m))}function eR(l){var d=l.memoizedState,m=0;d!==null&&(m=d.retryLane),Qk(l,m)}function tR(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),Qk(l,m)}var Jk;Jk=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,z9(l,d,m);xs=(l.flags&131072)!==0}else xs=!1,Nn&&(d.flags&1048576)!==0&&Fx(d,Hh,d.index);switch(d.lanes=0,d.tag){case 2:var E=d.type;op(l,d),l=d.pendingProps;var P=Dc(d,Hr.current);Rc(d,m),P=d0(null,d,E,l,P,m);var j=f0();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,Uh(d)):j=!1,d.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,s0(d),P.updater=rp,d.stateNode=P,P._reactInternals=d,b0(d,E,l,m),d=C0(null,d,E,!0,j,m)):(d.tag=0,Nn&&j&&Ky(d),as(null,d,P,m),d=d.child),d;case 16:E=d.elementType;e:{switch(op(l,d),l=d.pendingProps,P=E._init,E=P(E._payload),d.type=E,P=d.tag=rR(E),l=Co(E,l),P){case 0:d=E0(null,d,E,l,m);break e;case 1:d=kk(null,d,E,l,m);break e;case 11:d=vk(null,d,E,l,m);break e;case 14:d=wk(null,d,E,Co(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:Co(E,P),E0(l,d,E,P,m);case 1:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Co(E,P),kk(l,d,E,P,m);case 3:e:{if(Sk(d),l===null)throw Error(n(387));E=d.pendingProps,j=d.memoizedState,P=j.element,$x(l,d),Xh(d,E,null,m);var J=d.memoizedState;if(E=J.element,j.isDehydrated)if(j={element:E,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},d.updateQueue.baseState=j,d.memoizedState=j,d.flags&256){P=Lc(Error(n(423)),d),d=Ak(l,d,E,m,P);break e}else if(E!==P){P=Lc(Error(n(424)),d),d=Ak(l,d,E,m,P);break e}else for($s=da(d.stateNode.containerInfo.firstChild),Os=d,Nn=!0,Eo=null,m=jx(d,null,E,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Fc(),E===P){d=Ai(l,d,m);break e}as(l,d,E,m)}d=d.child}return d;case 5:return Vx(d),l===null&&Qy(d),E=d.type,P=d.pendingProps,j=l!==null?l.memoizedProps:null,J=P.children,zy(E,P)?J=null:j!==null&&zy(E,j)&&(d.flags|=32),xk(l,d),as(l,d,J,m),d.child;case 6:return l===null&&Qy(d),null;case 13:return _k(l,d,m);case 4:return o0(d,d.stateNode.containerInfo),E=d.pendingProps,l===null?d.child=Pc(d,null,E,m):as(l,d,E,m),d.child;case 11:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Co(E,P),vk(l,d,E,P,m);case 7:return as(l,d,d.pendingProps,m),d.child;case 8:return as(l,d,d.pendingProps.children,m),d.child;case 12:return as(l,d,d.pendingProps.children,m),d.child;case 10:e:{if(E=d.type._context,P=d.pendingProps,j=d.memoizedProps,J=P.value,_n(Gh,E._currentValue),E._currentValue=J,j!==null)if(kn(j.value,J)){if(j.children===P.children&&!Es.current){d=Ai(l,d,m);break e}}else for(j=d.child,j!==null&&(j.return=d);j!==null;){var ge=j.dependencies;if(ge!==null){J=j.child;for(var Se=ge.firstContext;Se!==null;){if(Se.context===E){if(j.tag===1){Se=Si(-1,m&-m),Se.tag=2;var Ue=j.updateQueue;if(Ue!==null){Ue=Ue.shared;var et=Ue.pending;et===null?Se.next=Se:(Se.next=et.next,et.next=Se),Ue.pending=Se}}j.lanes|=m,Se=j.alternate,Se!==null&&(Se.lanes|=m),n0(j.return,m,d),ge.lanes|=m;break}Se=Se.next}}else if(j.tag===10)J=j.type===d.type?null:j.child;else if(j.tag===18){if(J=j.return,J===null)throw Error(n(341));J.lanes|=m,ge=J.alternate,ge!==null&&(ge.lanes|=m),n0(J,m,d),J=j.sibling}else J=j.child;if(J!==null)J.return=j;else for(J=j;J!==null;){if(J===d){J=null;break}if(j=J.sibling,j!==null){j.return=J.return,J=j;break}J=J.return}j=J}as(l,d,P.children,m),d=d.child}return d;case 9:return P=d.type,E=d.pendingProps.children,Rc(d,m),P=no(P),E=E(P),d.flags|=1,as(l,d,E,m),d.child;case 14:return E=d.type,P=Co(E,d.pendingProps),P=Co(E.type,P),wk(l,d,E,P,m);case 15:return Ek(l,d,d.type,d.pendingProps,m);case 17:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Co(E,P),op(l,d),d.tag=1,Cs(E)?(l=!0,Uh(d)):l=!1,Rc(d,m),fk(d,E,P),b0(d,E,P,m),C0(null,d,E,!0,l,m);case 19:return Tk(l,d,m);case 22:return Ck(l,d,m)}throw Error(n(156,d.tag))};function Zk(l,d){return rr(l,d)}function nR(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 oo(l,d,m,E){return new nR(l,d,m,E)}function z0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function rR(l){if(typeof l=="function")return z0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===U)return 14}return 2}function Ca(l,d){var m=l.alternate;return m===null?(m=oo(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 gp(l,d,m,E,P,j){var J=2;if(E=l,typeof l=="function")z0(l)&&(J=1);else if(typeof l=="string")J=5;else e:switch(l){case O:return kl(m.children,P,j,d);case k:J=8,P|=8;break;case D:return l=oo(12,m,d,P|2),l.elementType=D,l.lanes=j,l;case $:return l=oo(13,m,d,P),l.elementType=$,l.lanes=j,l;case z:return l=oo(19,m,d,P),l.elementType=z,l.lanes=j,l;case H:return yp(m,P,j,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case B:J=10;break e;case I:J=9;break e;case L:J=11;break e;case U:J=14;break e;case K:J=16,E=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=oo(J,m,d,P),d.elementType=l,d.type=E,d.lanes=j,d}function kl(l,d,m,E){return l=oo(7,l,E,d),l.lanes=m,l}function yp(l,d,m,E){return l=oo(22,l,E,d),l.elementType=H,l.lanes=m,l.stateNode={isHidden:!1},l}function V0(l,d,m){return l=oo(6,l,null,d),l.lanes=m,l}function H0(l,d,m){return d=oo(4,l.children!==null?l.children:[],l.key,d),d.lanes=m,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function sR(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=Ku(0),this.expirationTimes=Ku(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ku(0),this.identifierPrefix=E,this.onRecoverableError=P,this.mutableSourceEagerHydrationData=null}function W0(l,d,m,E,P,j,J,ge,Se){return l=new sR(l,d,m,ge,Se),d===1?(d=1,j===!0&&(d|=8)):d=0,j=oo(3,null,null,d),l.current=j,j.stateNode=l,j.memoizedState={element:E,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},s0(j),l}function oR(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(),J0.exports=wR(),J0.exports}var mS;function ER(){if(mS)return Sp;mS=1;var e=d6();return Sp.createRoot=e.createRoot,Sp.hydrateRoot=e.hydrateRoot,Sp}var CR=ER();/** +`),O=E.stack.split(` +`),J=P.length-1,ge=O.length-1;1<=J&&0<=ge&&P[J]!==O[ge];)ge--;for(;1<=J&&0<=ge;J--,ge--)if(P[J]!==O[ge]){if(J!==1||ge!==1)do if(J--,ge--,0>ge||P[J]!==O[ge]){var Se=` +`+P[J].replace(" at new "," at ");return l.displayName&&Se.includes("")&&(Se=Se.replace("",l.displayName)),Se}while(1<=J&&0<=ge);break}}}finally{X=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?V(l):""}function te(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=ye(l.type,!1),l;case 11:return l=ye(l.type.render,!1),l;case 1:return l=ye(l.type,!0),l;default:return""}}function xe(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 j:return"Fragment";case R:return"Portal";case D:return"Profiler";case k:return"StrictMode";case $:return"Suspense";case z:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case I: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:xe(l.type)||"Memo";case K:d=l._payload,l=l._init;try{return xe(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 xe(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 Ce(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function ne(l){var d=Ce(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,O=m.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return P.call(this)},set:function(J){E=""+J,O.call(this,J)}}),Object.defineProperty(l,d,{enumerable:m.enumerable}),{getValue:function(){return E},setValue:function(J){E=""+J},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function de(l){l._valueTracker||(l._valueTracker=ne(l))}function ve(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var m=d.getValue(),E="";return l&&(E=Ce(l)?l.checked?"true":"false":l.value),l=E,l!==m?(d.setValue(l),!0):!1}function Pe(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 ie(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 ke(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 Be(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"||Pe(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var Oe=Array.isArray;function Ee(l,d,m,E){if(l=l.options,d){d={};for(var P=0;P"+d.valueOf().toString()+"",d=N.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function ae(l,d){if(d){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=d;return}}l.textContent=d}var pe={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},we=["Webkit","ms","Moz","O"];Object.keys(pe).forEach(function(l){we.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),pe[d]=pe[l]})});function ce(l,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||pe.hasOwnProperty(l)&&pe[l]?(""+d).trim():d+"px"}function me(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 Qe=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(Qe[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 Zt=null,xt=null,Ht=null;function kt(l){if(l=cd(l)){if(typeof Zt!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Oh(d),Zt(l.stateNode,l.type,d))}}function Wt(l){xt?Ht?Ht.push(l):Ht=[l]:xt=l}function en(){if(xt){var l=xt,d=Ht;if(Ht=xt=null,kt(l),d)for(l=0;l>>=0,l===0?32:31-(Gu(l)/Ur|0)|0}var rl=64,Ji=4194304;function Zi(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 fc(l,d){var m=l.pendingLanes;if(m===0)return 0;var E=0,P=l.suspendedLanes,O=l.pingedLanes,J=m&268435455;if(J!==0){var ge=J&~P;ge!==0?E=Zi(ge):(O&=J,O!==0&&(E=Zi(O)))}else J=m&~P,J!==0?E=Zi(J):O!==0&&(E=Zi(O));if(E===0)return 0;if(d!==0&&d!==E&&(d&P)===0&&(P=E&-E,O=d&-d,P>=O||P===16&&(O&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 ea(l,d,m){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-ts(d),l[d]=m}function Xu(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=vi),Ph=" ",Cc=!1;function W(l,d){switch(l){case"keyup":return Zn.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var le=!1;function fe(l,d){switch(l){case"compositionend":return Z(d);case"keypress":return d.which!==32?null:(Cc=!0,Ph);case"textInput":return l=d.data,l===Ph&&Cc?null:l;default:return null}}function Ae(l,d){if(le)return l==="compositionend"||!Ec&&W(l,d)?(l=Ls(),Is=ed=Rs=null,le=!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 Vr(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Vr(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function os(){for(var l=window,d=Pe();d instanceof l.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)l=d.contentWindow;else break;d=Pe(l.document)}return d}function is(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 Zs(l){var d=os(),m=l.focusedElem,E=l.selectionRange;if(d!==m&&m&&m.ownerDocument&&Vr(m.ownerDocument.documentElement,m)){if(E!==null&&is(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,O=Math.min(E.start,P);E=E.end===void 0?O:Math.min(E.end,P),!l.extend&&O>E&&(P=E,E=O,O=P),P=js(m,O);var J=js(m,E);P&&J&&(l.rangeCount!==1||l.anchorNode!==P.node||l.anchorOffset!==P.offset||l.focusNode!==J.node||l.focusOffset!==J.offset)&&(d=d.createRange(),d.setStart(P.node,P.offset),l.removeAllRanges(),O>E?(l.addRange(d),l.extend(J.node,J.offset)):(d.setEnd(J.node,J.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,ur=null,wo=null,or=null,xc=!1;function px(l,d,m){var E=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;xc||ur==null||ur!==Pe(E)||(E=ur,"selectionStart"in E&&is(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}),or&&Ar(or,E)||(or=E,E=Lh(wo,"onSelect"),0Dc||(l.current=qy[Dc],qy[Dc]=null,Dc--)}function _n(l,d){Dc++,qy[Dc]=l.current,l.current=d}var pa={},Hr=ha(pa),Es=ha(!1),pl=pa;function Tc(l,d){var m=l.type.contextTypes;if(!m)return pa;var E=l.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===d)return E.__reactInternalMemoizedMaskedChildContext;var P={},O;for(O in m)P[O]=d[O];return E&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=P),P}function Cs(l){return l=l.childContextTypes,l!=null}function $h(){Bn(Es),Bn(Hr)}function Bx(l,d,m){if(Hr.current!==pa)throw Error(n(168));_n(Hr,d),_n(Es,m)}function Fx(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 Uh(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||pa,pl=Hr.current,_n(Hr,l),_n(Es,Es.current),!0}function Px(l,d,m){var E=l.stateNode;if(!E)throw Error(n(169));m?(l=Fx(l,d,pl),E.__reactInternalMemoizedMergedChildContext=l,Bn(Es),Bn(Hr),_n(Hr,l)):Bn(Es),_n(Es,m)}var Ei=null,zh=!1,Gy=!1;function Mx(l){Ei===null?Ei=[l]:Ei.push(l)}function I9(l){zh=!0,Mx(l)}function ma(){if(!Gy&&Ei!==null){Gy=!0;var l=0,d=Xt;try{var m=Ei;for(Xt=1;l>=J,P-=J,Ci=1<<32-ts(d)+P|m<It?(Tr=Dt,Dt=null):Tr=Dt.sibling;var an=Je(Re,Dt,je[It],it);if(an===null){Dt===null&&(Dt=Tr);break}l&&Dt&&an.alternate===null&&d(Re,Dt),De=O(an,De,It),_t===null?Ct=an:_t.sibling=an,_t=an,Dt=Tr}if(It===je.length)return m(Re,Dt),Nn&&gl(Re,It),Ct;if(Dt===null){for(;ItIt?(Tr=Dt,Dt=null):Tr=Dt.sibling;var ka=Je(Re,Dt,an.value,it);if(ka===null){Dt===null&&(Dt=Tr);break}l&&Dt&&ka.alternate===null&&d(Re,Dt),De=O(ka,De,It),_t===null?Ct=ka:_t.sibling=ka,_t=ka,Dt=Tr}if(an.done)return m(Re,Dt),Nn&&gl(Re,It),Ct;if(Dt===null){for(;!an.done;It++,an=je.next())an=tt(Re,an.value,it),an!==null&&(De=O(an,De,It),_t===null?Ct=an:_t.sibling=an,_t=an);return Nn&&gl(Re,It),Ct}for(Dt=E(Re,Dt);!an.done;It++,an=je.next())an=ht(Dt,Re,It,an.value,it),an!==null&&(l&&an.alternate!==null&&Dt.delete(an.key===null?It:an.key),De=O(an,De,It),_t===null?Ct=an:_t.sibling=an,_t=an);return l&&Dt.forEach(function(mR){return d(Re,mR)}),Nn&&gl(Re,It),Ct}function ir(Re,De,je,it){if(typeof je=="object"&&je!==null&&je.type===j&&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===j){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&&Ox(Ct)===_t.type){m(Re,_t.sibling),De=P(_t,je.props),De.ref=ud(Re,_t,je),De.return=Re,Re=De;break e}m(Re,_t);break}else d(Re,_t);_t=_t.sibling}je.type===j?(De=kl(je.props.children,Re.mode,it,je.key),De.return=Re,Re=De):(it=gp(je.type,je.key,je.props,null,Re.mode,it),it.ref=ud(Re,De,je),it.return=Re,Re=it)}return J(Re);case R: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=H0(je,Re.mode,it),De.return=Re,Re=De}return J(Re);case K:return _t=je._init,ir(Re,De,_t(je._payload),it)}if(Oe(je))return bt(Re,De,je,it);if(ee(je))return wt(Re,De,je,it);qh(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=V0(je,Re.mode,it),De.return=Re,Re=De),J(Re)):m(Re,De)}return ir}var Mc=$x(!0),Ux=$x(!1),Gh=ha(null),Kh=null,Rc=null,Zy=null;function e0(){Zy=Rc=Kh=null}function t0(l){var d=Gh.current;Bn(Gh),l._currentValue=d}function n0(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 Ic(l,d){Kh=l,Zy=Rc=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(xs=!0),l.firstContext=null)}function no(l){var d=l._currentValue;if(Zy!==l)if(l={context:l,memoizedValue:d,next:null},Rc===null){if(Kh===null)throw Error(n(308));Rc=l,Kh.dependencies={lanes:0,firstContext:l}}else Rc=Rc.next=l;return d}var yl=null;function r0(l){yl===null?yl=[l]:yl.push(l)}function zx(l,d,m,E){var P=d.interleaved;return P===null?(m.next=m,r0(d)):(m.next=P.next,P.next=m),d.interleaved=m,ki(l,E)}function ki(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 ga=!1;function s0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vx(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 Si(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function ya(l,d,m){var E=l.updateQueue;if(E===null)return null;if(E=E.shared,(tn&2)!==0){var P=E.pending;return P===null?d.next=d:(d.next=P.next,P.next=d),E.pending=d,ki(l,m)}return P=E.interleaved,P===null?(d.next=d,r0(E)):(d.next=P.next,P.next=d),E.interleaved=d,ki(l,m)}function Yh(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,ta(l,m)}}function Hx(l,d){var m=l.updateQueue,E=l.alternate;if(E!==null&&(E=E.updateQueue,m===E)){var P=null,O=null;if(m=m.firstBaseUpdate,m!==null){do{var J={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};O===null?P=O=J:O=O.next=J,m=m.next}while(m!==null);O===null?P=O=d:O=O.next=d}else P=O=d;m={baseState:E.baseState,firstBaseUpdate:P,lastBaseUpdate:O,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 Xh(l,d,m,E){var P=l.updateQueue;ga=!1;var O=P.firstBaseUpdate,J=P.lastBaseUpdate,ge=P.shared.pending;if(ge!==null){P.shared.pending=null;var Se=ge,Ue=Se.next;Se.next=null,J===null?O=Ue:J.next=Ue,J=Se;var et=l.alternate;et!==null&&(et=et.updateQueue,ge=et.lastBaseUpdate,ge!==J&&(ge===null?et.firstBaseUpdate=Ue:ge.next=Ue,et.lastBaseUpdate=Se))}if(O!==null){var tt=P.baseState;J=0,et=Ue=Se=null,ge=O;do{var Je=ge.lane,ht=ge.eventTime;if((E&Je)===Je){et!==null&&(et=et.next={eventTime:ht,lane:0,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null});e:{var bt=l,wt=ge;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:ga=!0}}ge.callback!==null&&ge.lane!==0&&(l.flags|=64,Je=P.effects,Je===null?P.effects=[ge]:Je.push(ge))}else ht={eventTime:ht,lane:Je,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null},et===null?(Ue=et=ht,Se=tt):et=et.next=ht,J|=Je;if(ge=ge.next,ge===null){if(ge=P.shared.pending,ge===null)break;Je=ge,ge=Je.next,Je.next=null,P.lastBaseUpdate=Je,P.shared.pending=null}}while(!0);if(et===null&&(Se=tt),P.baseState=Se,P.firstBaseUpdate=Ue,P.lastBaseUpdate=et,d=P.shared.interleaved,d!==null){P=d;do J|=P.lane,P=P.next;while(P!==d)}else O===null&&(P.shared.lanes=0);wl|=J,l.lanes=J,l.memoizedState=tt}}function Wx(l,d,m){if(l=d.effects,d.effects=null,l!==null)for(d=0;dm?m:4,l(!0);var E=c0.transition;c0.transition={};try{l(!1),d()}finally{Xt=m,c0.transition=E}}function uk(){return ro().memoizedState}function O9(l,d,m){var E=Ea(l);if(m={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null},dk(l))fk(d,m);else if(m=zx(l,d,m,E),m!==null){var P=ls();So(m,l,E,P),hk(m,d,E)}}function $9(l,d,m){var E=Ea(l),P={lane:E,action:m,hasEagerState:!1,eagerState:null,next:null};if(dk(l))fk(d,P);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var J=d.lastRenderedState,ge=O(J,m);if(P.hasEagerState=!0,P.eagerState=ge,kn(ge,J)){var Se=d.interleaved;Se===null?(P.next=P,r0(d)):(P.next=Se.next,Se.next=P),d.interleaved=P;return}}catch{}finally{}m=zx(l,d,P,E),m!==null&&(P=ls(),So(m,l,E,P),hk(m,d,E))}}function dk(l){var d=l.alternate;return l===qn||d!==null&&d===qn}function fk(l,d){pd=Zh=!0;var m=l.pending;m===null?d.next=d:(d.next=m.next,m.next=d),l.pending=d}function hk(l,d,m){if((m&4194240)!==0){var E=d.lanes;E&=l.pendingLanes,m|=E,d.lanes=m,ta(l,m)}}var np={readContext:no,useCallback:Wr,useContext:Wr,useEffect:Wr,useImperativeHandle:Wr,useInsertionEffect:Wr,useLayoutEffect:Wr,useMemo:Wr,useReducer:Wr,useRef:Wr,useState:Wr,useDebugValue:Wr,useDeferredValue:Wr,useTransition:Wr,useMutableSource:Wr,useSyncExternalStore:Wr,useId:Wr,unstable_isNewReconciler:!1},U9={readContext:no,useCallback:function(l,d){return Go().memoizedState=[l,d===void 0?null:d],l},useContext:no,useEffect:nk,useImperativeHandle:function(l,d,m){return m=m!=null?m.concat([l]):null,ep(4194308,4,ok.bind(null,d,l),m)},useLayoutEffect:function(l,d){return ep(4194308,4,l,d)},useInsertionEffect:function(l,d){return ep(4,2,l,d)},useMemo:function(l,d){var m=Go();return d=d===void 0?null:d,l=l(),m.memoizedState=[l,d],l},useReducer:function(l,d,m){var E=Go();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=O9.bind(null,qn,l),[E.memoizedState,l]},useRef:function(l){var d=Go();return l={current:l},d.memoizedState=l},useState:ek,useDebugValue:g0,useDeferredValue:function(l){return Go().memoizedState=l},useTransition:function(){var l=ek(!1),d=l[0];return l=j9.bind(null,l[1]),Go().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,m){var E=qn,P=Go();if(Nn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=d(),Dr===null)throw Error(n(349));(vl&30)!==0||Yx(E,d,m)}P.memoizedState=m;var O={value:m,getSnapshot:d};return P.queue=O,nk(Qx.bind(null,E,O,l),[l]),E.flags|=2048,yd(9,Xx.bind(null,E,O,m,d),void 0,null),m},useId:function(){var l=Go(),d=Dr.identifierPrefix;if(Nn){var m=xi,E=Ci;m=(E&~(1<<32-ts(E)-1)).toString(32)+m,d=":"+d+"R"+m,m=md++,0<\/script>",l=l.removeChild(l.firstChild)):typeof E.is=="string"?l=J.createElement(m,{is:E.is}):(l=J.createElement(m),m==="select"&&(J=l,E.multiple?J.multiple=!0:E.size&&(J.size=E.size))):l=J.createElementNS(l,m),l[Wo]=d,l[ld]=E,Mk(l,d,!1,!1),d.stateNode=l;e:{switch(J=nt(m,E),m){case"dialog":Tn("cancel",l),Tn("close",l),P=E;break;case"iframe":case"object":case"embed":Tn("load",l),P=E;break;case"video":case"audio":for(P=0;P$c&&(d.flags|=128,E=!0,bd(O,!1),d.lanes=4194304)}else{if(!E)if(l=Qh(J),l!==null){if(d.flags|=128,E=!0,m=l.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),bd(O,!0),O.tail===null&&O.tailMode==="hidden"&&!J.alternate&&!Nn)return qr(d),null}else 2*xn()-O.renderingStartTime>$c&&m!==1073741824&&(d.flags|=128,E=!0,bd(O,!1),d.lanes=4194304);O.isBackwards?(J.sibling=d.child,d.child=J):(m=O.last,m!==null?m.sibling=J:d.child=J,O.last=J)}return O.tail!==null?(d=O.tail,O.rendering=d,O.tail=d.sibling,O.renderingStartTime=xn(),d.sibling=null,m=Wn.current,_n(Wn,E?m&1|2:m&1),d):(qr(d),null);case 22:case 23:return $0(),E=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==E&&(d.flags|=8192),E&&(d.mode&1)!==0?(Us&1073741824)!==0&&(qr(d),d.subtreeFlags&6&&(d.flags|=8192)):qr(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function Y9(l,d){switch(Yy(d),d.tag){case 1:return Cs(d.type)&&$h(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Lc(),Bn(Es),Bn(Hr),l0(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return i0(d),null;case 13:if(Bn(Wn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Pc()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Bn(Wn),null;case 4:return Lc(),null;case 10:return t0(d.type._context),null;case 22:case 23:return $0(),null;case 24:return null;default:return null}}var ip=!1,Gr=!1,X9=typeof WeakSet=="function"?WeakSet:Set,gt=null;function jc(l,d){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(E){er(l,d,E)}else m.current=null}function D0(l,d,m){try{m()}catch(E){er(l,d,E)}}var Lk=!1;function Q9(l,d){if($y=mn,l=os(),is(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,O=E.focusNode;E=E.focusOffset;try{m.nodeType,O.nodeType}catch{m=null;break e}var J=0,ge=-1,Se=-1,Ue=0,et=0,tt=l,Je=null;t:for(;;){for(var ht;tt!==m||P!==0&&tt.nodeType!==3||(ge=J+P),tt!==O||E!==0&&tt.nodeType!==3||(Se=J+E),tt.nodeType===3&&(J+=tt.nodeValue.length),(ht=tt.firstChild)!==null;)Je=tt,tt=ht;for(;;){if(tt===l)break t;if(Je===m&&++Ue===P&&(ge=J),Je===O&&++et===E&&(Se=J),(ht=tt.nextSibling)!==null)break;tt=Je,Je=tt.parentNode}tt=ht}m=ge===-1||Se===-1?null:{start:ge,end:Se}}else m=null}m=m||{start:0,end:0}}else m=null;for(Uy={focusedElem:l,selectionRange:m},mn=!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,ir=bt.memoizedState,Re=d.stateNode,De=Re.getSnapshotBeforeUpdate(d.elementType===d.type?wt:Co(d.type,wt),ir);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){er(d,d.return,it)}if(l=d.sibling,l!==null){l.return=d.return,gt=l;break}gt=d.return}return bt=Lk,Lk=!1,bt}function vd(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 O=P.destroy;P.destroy=void 0,O!==void 0&&D0(d,m,O)}P=P.next}while(P!==E)}}function ap(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 T0(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 Nk(l){var d=l.alternate;d!==null&&(l.alternate=null,Nk(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Wo],delete d[ld],delete d[Wy],delete d[M9],delete d[R9])),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 jk(l){return l.tag===5||l.tag===3||l.tag===4}function Ok(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||jk(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 B0(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=jh));else if(E!==4&&(l=l.child,l!==null))for(B0(l,d,m),l=l.sibling;l!==null;)B0(l,d,m),l=l.sibling}function F0(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(F0(l,d,m),l=l.sibling;l!==null;)F0(l,d,m),l=l.sibling}var Lr=null,xo=!1;function ba(l,d,m){for(m=m.child;m!==null;)$k(l,d,m),m=m.sibling}function $k(l,d,m){if(ys&&typeof ys.onCommitFiberUnmount=="function")try{ys.onCommitFiberUnmount(Qi,m)}catch{}switch(m.tag){case 5:Gr||jc(m,d);case 6:var E=Lr,P=xo;Lr=null,ba(l,d,m),Lr=E,xo=P,Lr!==null&&(xo?(l=Lr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):Lr.removeChild(m.stateNode));break;case 18:Lr!==null&&(xo?(l=Lr,m=m.stateNode,l.nodeType===8?Hy(l.parentNode,m):l.nodeType===1&&Hy(l,m),la(l)):Hy(Lr,m.stateNode));break;case 4:E=Lr,P=xo,Lr=m.stateNode.containerInfo,xo=!0,ba(l,d,m),Lr=E,xo=P;break;case 0:case 11:case 14:case 15:if(!Gr&&(E=m.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){P=E=E.next;do{var O=P,J=O.destroy;O=O.tag,J!==void 0&&((O&2)!==0||(O&4)!==0)&&D0(m,d,J),P=P.next}while(P!==E)}ba(l,d,m);break;case 1:if(!Gr&&(jc(m,d),E=m.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=m.memoizedProps,E.state=m.memoizedState,E.componentWillUnmount()}catch(ge){er(m,d,ge)}ba(l,d,m);break;case 21:ba(l,d,m);break;case 22:m.mode&1?(Gr=(E=Gr)||m.memoizedState!==null,ba(l,d,m),Gr=E):ba(l,d,m);break;default:ba(l,d,m)}}function Uk(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new X9),d.forEach(function(E){var P=iR.bind(null,l,E);m.has(E)||(m.add(E),E.then(P,P))})}}function ko(l,d){var m=d.deletions;if(m!==null)for(var E=0;EP&&(P=J),E&=~O}if(E=P,E=xn()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*Z9(E/1960))-E,10l?16:l,wa===null)var E=!1;else{if(l=wa,wa=null,fp=0,(tn&6)!==0)throw Error(n(331));var P=tn;for(tn|=4,gt=l.current;gt!==null;){var O=gt,J=O.child;if((gt.flags&16)!==0){var ge=O.deletions;if(ge!==null){for(var Se=0;Sexn()-R0?Cl(l,0):M0|=m),Ss(l,d)}function eS(l,d){d===0&&((l.mode&1)===0?d=1:(d=Ji,Ji<<=1,(Ji&130023424)===0&&(Ji=4194304)));var m=ls();l=ki(l,d),l!==null&&(ea(l,d,m),Ss(l,m))}function oR(l){var d=l.memoizedState,m=0;d!==null&&(m=d.retryLane),eS(l,m)}function iR(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),eS(l,m)}var tS;tS=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,G9(l,d,m);xs=(l.flags&131072)!==0}else xs=!1,Nn&&(d.flags&1048576)!==0&&Rx(d,Hh,d.index);switch(d.lanes=0,d.tag){case 2:var E=d.type;op(l,d),l=d.pendingProps;var P=Tc(d,Hr.current);Ic(d,m),P=d0(null,d,E,l,P,m);var O=f0();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)?(O=!0,Uh(d)):O=!1,d.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,s0(d),P.updater=rp,d.stateNode=P,P._reactInternals=d,b0(d,E,l,m),d=C0(null,d,E,!0,O,m)):(d.tag=0,Nn&&O&&Ky(d),as(null,d,P,m),d=d.child),d;case 16:E=d.elementType;e:{switch(op(l,d),l=d.pendingProps,P=E._init,E=P(E._payload),d.type=E,P=d.tag=lR(E),l=Co(E,l),P){case 0:d=E0(null,d,E,l,m);break e;case 1:d=_k(null,d,E,l,m);break e;case 11:d=Ck(null,d,E,l,m);break e;case 14:d=xk(null,d,E,Co(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:Co(E,P),E0(l,d,E,P,m);case 1:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Co(E,P),_k(l,d,E,P,m);case 3:e:{if(Dk(d),l===null)throw Error(n(387));E=d.pendingProps,O=d.memoizedState,P=O.element,Vx(l,d),Xh(d,E,null,m);var J=d.memoizedState;if(E=J.element,O.isDehydrated)if(O={element:E,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},d.updateQueue.baseState=O,d.memoizedState=O,d.flags&256){P=Nc(Error(n(423)),d),d=Tk(l,d,E,m,P);break e}else if(E!==P){P=Nc(Error(n(424)),d),d=Tk(l,d,E,m,P);break e}else for($s=fa(d.stateNode.containerInfo.firstChild),Os=d,Nn=!0,Eo=null,m=Ux(d,null,E,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Pc(),E===P){d=Ai(l,d,m);break e}as(l,d,E,m)}d=d.child}return d;case 5:return qx(d),l===null&&Qy(d),E=d.type,P=d.pendingProps,O=l!==null?l.memoizedProps:null,J=P.children,zy(E,P)?J=null:O!==null&&zy(E,O)&&(d.flags|=32),Ak(l,d),as(l,d,J,m),d.child;case 6:return l===null&&Qy(d),null;case 13:return Bk(l,d,m);case 4:return o0(d,d.stateNode.containerInfo),E=d.pendingProps,l===null?d.child=Mc(d,null,E,m):as(l,d,E,m),d.child;case 11:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Co(E,P),Ck(l,d,E,P,m);case 7:return as(l,d,d.pendingProps,m),d.child;case 8:return as(l,d,d.pendingProps.children,m),d.child;case 12:return as(l,d,d.pendingProps.children,m),d.child;case 10:e:{if(E=d.type._context,P=d.pendingProps,O=d.memoizedProps,J=P.value,_n(Gh,E._currentValue),E._currentValue=J,O!==null)if(kn(O.value,J)){if(O.children===P.children&&!Es.current){d=Ai(l,d,m);break e}}else for(O=d.child,O!==null&&(O.return=d);O!==null;){var ge=O.dependencies;if(ge!==null){J=O.child;for(var Se=ge.firstContext;Se!==null;){if(Se.context===E){if(O.tag===1){Se=Si(-1,m&-m),Se.tag=2;var Ue=O.updateQueue;if(Ue!==null){Ue=Ue.shared;var et=Ue.pending;et===null?Se.next=Se:(Se.next=et.next,et.next=Se),Ue.pending=Se}}O.lanes|=m,Se=O.alternate,Se!==null&&(Se.lanes|=m),n0(O.return,m,d),ge.lanes|=m;break}Se=Se.next}}else if(O.tag===10)J=O.type===d.type?null:O.child;else if(O.tag===18){if(J=O.return,J===null)throw Error(n(341));J.lanes|=m,ge=J.alternate,ge!==null&&(ge.lanes|=m),n0(J,m,d),J=O.sibling}else J=O.child;if(J!==null)J.return=O;else for(J=O;J!==null;){if(J===d){J=null;break}if(O=J.sibling,O!==null){O.return=J.return,J=O;break}J=J.return}O=J}as(l,d,P.children,m),d=d.child}return d;case 9:return P=d.type,E=d.pendingProps.children,Ic(d,m),P=no(P),E=E(P),d.flags|=1,as(l,d,E,m),d.child;case 14:return E=d.type,P=Co(E,d.pendingProps),P=Co(E.type,P),xk(l,d,E,P,m);case 15:return kk(l,d,d.type,d.pendingProps,m);case 17:return E=d.type,P=d.pendingProps,P=d.elementType===E?P:Co(E,P),op(l,d),d.tag=1,Cs(E)?(l=!0,Uh(d)):l=!1,Ic(d,m),mk(d,E,P),b0(d,E,P,m),C0(null,d,E,!0,l,m);case 19:return Pk(l,d,m);case 22:return Sk(l,d,m)}throw Error(n(156,d.tag))};function nS(l,d){return rr(l,d)}function aR(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 oo(l,d,m,E){return new aR(l,d,m,E)}function z0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function lR(l){if(typeof l=="function")return z0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===U)return 14}return 2}function xa(l,d){var m=l.alternate;return m===null?(m=oo(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 gp(l,d,m,E,P,O){var J=2;if(E=l,typeof l=="function")z0(l)&&(J=1);else if(typeof l=="string")J=5;else e:switch(l){case j:return kl(m.children,P,O,d);case k:J=8,P|=8;break;case D:return l=oo(12,m,d,P|2),l.elementType=D,l.lanes=O,l;case $:return l=oo(13,m,d,P),l.elementType=$,l.lanes=O,l;case z:return l=oo(19,m,d,P),l.elementType=z,l.lanes=O,l;case H:return yp(m,P,O,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case B:J=10;break e;case I:J=9;break e;case L:J=11;break e;case U:J=14;break e;case K:J=16,E=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=oo(J,m,d,P),d.elementType=l,d.type=E,d.lanes=O,d}function kl(l,d,m,E){return l=oo(7,l,E,d),l.lanes=m,l}function yp(l,d,m,E){return l=oo(22,l,E,d),l.elementType=H,l.lanes=m,l.stateNode={isHidden:!1},l}function V0(l,d,m){return l=oo(6,l,null,d),l.lanes=m,l}function H0(l,d,m){return d=oo(4,l.children!==null?l.children:[],l.key,d),d.lanes=m,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function cR(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=Yu(0),this.expirationTimes=Yu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yu(0),this.identifierPrefix=E,this.onRecoverableError=P,this.mutableSourceEagerHydrationData=null}function W0(l,d,m,E,P,O,J,ge,Se){return l=new cR(l,d,m,ge,Se),d===1?(d=1,O===!0&&(d|=8)):d=0,O=oo(3,null,null,d),l.current=O,O.stateNode=l,O.memoizedState={element:E,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},s0(O),l}function uR(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(),J0.exports=SR(),J0.exports}var bS;function AR(){if(bS)return Sp;bS=1;var e=m6();return Sp.createRoot=e.createRoot,Sp.hydrateRoot=e.hydrateRoot,Sp}var _R=AR();/** * 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 gS="popstate";function xR(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return B1("",{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:Sf(s)}return SR(t,n,null,e)}function On(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kR(){return Math.random().toString(36).substring(2,10)}function yS(e,t){return{usr:e.state,key:e.key,idx:t}}function B1(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Su(t):t,state:n,key:t&&t.key||r||kR()}}function Sf({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 Su(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 SR(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=B1(b.location,w,C);u=f()+1;let x=yS(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=B1(b.location,w,C);u=f();let x=yS(v,u),_=b.createHref(v);i.replaceState(x,"",_),o&&c&&c({action:a,location:b.location,delta:0})}function y(w){return AR(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(gS,h),c=w,()=>{s.removeEventListener(gS,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 AR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),On(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Sf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function f6(e,t,n="/"){return _R(e,t,n,!1)}function _R(e,t,n,r){let s=typeof t=="string"?Su(t):t,o=Ui(s.pathname||"/",n);if(o==null)return null;let i=h6(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;On(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=Ii([r,f.relativePath]),p=n.concat(f);i.children&&i.children.length>0&&(On(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),h6(i.children,t,p,h,c)),!(i.path==null&&!i.index)&&t.push({path:h,score:IR(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 p6(i.path))o(i,a,!0,u)}),t}function p6(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=p6(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:LR(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var TR=/^:[\w-]+$/,BR=3,FR=2,PR=1,MR=10,RR=-2,bS=e=>e==="*";function IR(e,t){let n=e.split("/"),r=n.length;return n.some(bS)&&(r+=RR),t&&(r+=FR),n.filter(s=>!bS(s)).reduce((s,o)=>s+(TR.test(o)?BR:o===""?PR:MR),r)}function LR(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 NR(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 jR(e,t=!1,n=!0){qs(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 OR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qs(!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 Ui(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 $R=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UR=e=>$R.test(e);function zR(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Su(e):e,o;if(n)if(UR(n))o=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),qs(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?o=vS(n.substring(1),"/"):o=vS(n,t)}else o=t;return{pathname:o,search:WR(r),hash:qR(s)}}function vS(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 tb(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 VR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function K2(e){let t=VR(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Y2(e,t,n,r=!1){let s;typeof e=="string"?s=Su(e):(s={...e},On(!s.pathname||!s.pathname.includes("?"),tb("?","pathname","search",s)),On(!s.pathname||!s.pathname.includes("#"),tb("#","pathname","hash",s)),On(!s.search||!s.search.includes("#"),tb("#","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=zR(s,a),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}var Ii=e=>e.join("/").replace(/\/\/+/g,"/"),HR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),WR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function GR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function KR(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var m6=["POST","PUT","PATCH","DELETE"];new Set(m6);var YR=["GET",...m6];new Set(YR);var Au=T.createContext(null);Au.displayName="DataRouter";var Ug=T.createContext(null);Ug.displayName="DataRouterState";T.createContext(!1);var g6=T.createContext({isTransitioning:!1});g6.displayName="ViewTransition";var XR=T.createContext(new Map);XR.displayName="Fetchers";var QR=T.createContext(null);QR.displayName="Await";var yo=T.createContext(null);yo.displayName="Navigation";var Uf=T.createContext(null);Uf.displayName="Location";var fi=T.createContext({outlet:null,matches:[],isDataRoute:!1});fi.displayName="Route";var X2=T.createContext(null);X2.displayName="RouteError";function JR(e,{relative:t}={}){On(_u(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=T.useContext(yo),{hash:s,pathname:o,search:i}=Vf(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Ii([n,o])),r.createHref({pathname:a,search:i,hash:s})}function _u(){return T.useContext(Uf)!=null}function bo(){return On(_u(),"useLocation() may be used only in the context of a component."),T.useContext(Uf).location}var y6="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function b6(e){T.useContext(yo).static||T.useLayoutEffect(e)}function zf(){let{isDataRoute:e}=T.useContext(fi);return e?d7():ZR()}function ZR(){On(_u(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(Au),{basename:t,navigator:n}=T.useContext(yo),{matches:r}=T.useContext(fi),{pathname:s}=bo(),o=JSON.stringify(K2(r)),i=T.useRef(!1);return b6(()=>{i.current=!0}),T.useCallback((c,u={})=>{if(qs(i.current,y6),!i.current)return;if(typeof c=="number"){n.go(c);return}let f=Y2(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ii([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}T.createContext(null);function Vf(e,{relative:t}={}){let{matches:n}=T.useContext(fi),{pathname:r}=bo(),s=JSON.stringify(K2(n));return T.useMemo(()=>Y2(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function e7(e,t){return v6(e,t)}function v6(e,t,n,r,s){var v;On(_u(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=T.useContext(yo),{matches:i}=T.useContext(fi),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||"";w6(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 vS="popstate";function DR(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return M1("",{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:Af(s)}return BR(t,n,null,e)}function On(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TR(){return Math.random().toString(36).substring(2,10)}function wS(e,t){return{usr:e.state,key:e.key,idx:t}}function M1(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Au(t):t,state:n,key:t&&t.key||r||TR()}}function Af({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 Au(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 BR(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=M1(b.location,w,C);u=f()+1;let x=wS(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=M1(b.location,w,C);u=f();let x=wS(v,u),_=b.createHref(v);i.replaceState(x,"",_),o&&c&&c({action:a,location:b.location,delta:0})}function y(w){return FR(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(vS,h),c=w,()=>{s.removeEventListener(vS,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 FR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),On(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Af(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function g6(e,t,n="/"){return PR(e,t,n,!1)}function PR(e,t,n,r){let s=typeof t=="string"?Au(t):t,o=zi(s.pathname||"/",n);if(o==null)return null;let i=y6(e);MR(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;On(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=Li([r,f.relativePath]),p=n.concat(f);i.children&&i.children.length>0&&(On(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),y6(i.children,t,p,h,c)),!(i.path==null&&!i.index)&&t.push({path:h,score:$R(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 b6(i.path))o(i,a,!0,u)}),t}function b6(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=b6(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 MR(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:UR(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var RR=/^:[\w-]+$/,IR=3,LR=2,NR=1,jR=10,OR=-2,ES=e=>e==="*";function $R(e,t){let n=e.split("/"),r=n.length;return n.some(ES)&&(r+=OR),t&&(r+=LR),n.filter(s=>!ES(s)).reduce((s,o)=>s+(RR.test(o)?IR:o===""?NR:jR),r)}function UR(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 zR(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 VR(e,t=!1,n=!0){qs(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 HR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qs(!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 zi(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 WR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qR=e=>WR.test(e);function GR(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Au(e):e,o;if(n)if(qR(n))o=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),qs(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?o=CS(n.substring(1),"/"):o=CS(n,t)}else o=t;return{pathname:o,search:XR(r),hash:QR(s)}}function CS(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 tb(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 KR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Q2(e){let t=KR(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function J2(e,t,n,r=!1){let s;typeof e=="string"?s=Au(e):(s={...e},On(!s.pathname||!s.pathname.includes("?"),tb("?","pathname","search",s)),On(!s.pathname||!s.pathname.includes("#"),tb("#","pathname","hash",s)),On(!s.search||!s.search.includes("#"),tb("#","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=GR(s,a),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}var Li=e=>e.join("/").replace(/\/\/+/g,"/"),YR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),XR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function JR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ZR(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var v6=["POST","PUT","PATCH","DELETE"];new Set(v6);var e7=["GET",...v6];new Set(e7);var _u=T.createContext(null);_u.displayName="DataRouter";var Ug=T.createContext(null);Ug.displayName="DataRouterState";T.createContext(!1);var w6=T.createContext({isTransitioning:!1});w6.displayName="ViewTransition";var t7=T.createContext(new Map);t7.displayName="Fetchers";var n7=T.createContext(null);n7.displayName="Await";var yo=T.createContext(null);yo.displayName="Navigation";var Uf=T.createContext(null);Uf.displayName="Location";var fi=T.createContext({outlet:null,matches:[],isDataRoute:!1});fi.displayName="Route";var Z2=T.createContext(null);Z2.displayName="RouteError";function r7(e,{relative:t}={}){On(Du(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=T.useContext(yo),{hash:s,pathname:o,search:i}=Vf(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Li([n,o])),r.createHref({pathname:a,search:i,hash:s})}function Du(){return T.useContext(Uf)!=null}function bo(){return On(Du(),"useLocation() may be used only in the context of a component."),T.useContext(Uf).location}var E6="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function C6(e){T.useContext(yo).static||T.useLayoutEffect(e)}function zf(){let{isDataRoute:e}=T.useContext(fi);return e?g7():s7()}function s7(){On(Du(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(_u),{basename:t,navigator:n}=T.useContext(yo),{matches:r}=T.useContext(fi),{pathname:s}=bo(),o=JSON.stringify(Q2(r)),i=T.useRef(!1);return C6(()=>{i.current=!0}),T.useCallback((c,u={})=>{if(qs(i.current,E6),!i.current)return;if(typeof c=="number"){n.go(c);return}let f=J2(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Li([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}T.createContext(null);function Vf(e,{relative:t}={}){let{matches:n}=T.useContext(fi),{pathname:r}=bo(),s=JSON.stringify(Q2(n));return T.useMemo(()=>J2(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function o7(e,t){return x6(e,t)}function x6(e,t,n,r,s){var v;On(Du(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=T.useContext(yo),{matches:i}=T.useContext(fi),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||"";k6(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=bo(),g;if(t){let x=typeof t=="string"?Su(t):t;On(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=f6(e,{pathname:b});qs(h||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),qs(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=o7(w&&w.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Ii([f,o.encodeLocation?o.encodeLocation(x.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?f:Ii([f,o.encodeLocation?o.encodeLocation(x.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),i,n,r,s);return t&&C?T.createElement(Uf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},C):C}function t7(){let e=u7(),t=GR(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=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:o},"ErrorBoundary")," or"," ",T.createElement("code",{style:o},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:s},n):null,i)}var n7=T.createElement(t7,null),r7=class extends T.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?T.createElement(fi.Provider,{value:this.props.routeContext},T.createElement(X2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function s7({routeContext:e,match:t,children:n}){let r=T.useContext(Au);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(fi.Provider,{value:e},n)}function o7(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);On(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:KR(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||n7,a&&(c<0&&p===0?(w6("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=T.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=f,T.createElement(s7,{match:h,routeContext:{outlet:f,matches:C,isDataRoute:n!=null},children:x})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?T.createElement(r7,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:v(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:u}):v()},null)}function Q2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function i7(e){let t=T.useContext(Au);return On(t,Q2(e)),t}function a7(e){let t=T.useContext(Ug);return On(t,Q2(e)),t}function l7(e){let t=T.useContext(fi);return On(t,Q2(e)),t}function J2(e){let t=l7(e),n=t.matches[t.matches.length-1];return On(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function c7(){return J2("useRouteId")}function u7(){var r;let e=T.useContext(X2),t=a7("useRouteError"),n=J2("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function d7(){let{router:e}=i7("useNavigate"),t=J2("useNavigate"),n=T.useRef(!1);return b6(()=>{n.current=!0}),T.useCallback(async(s,o={})=>{qs(n.current,y6),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var wS={};function w6(e,t,n){!t&&!wS[e]&&(wS[e]=!0,qs(!1,n))}T.memo(f7);function f7({routes:e,future:t,state:n,unstable_onError:r}){return v6(e,void 0,n,r,t)}function Ds({to:e,replace:t,state:n,relative:r}){On(_u()," may be used only in the context of a component.");let{static:s}=T.useContext(yo);qs(!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}=T.useContext(fi),{pathname:i}=bo(),a=zf(),c=Y2(e,K2(o),i,r==="path"),u=JSON.stringify(c);return T.useEffect(()=>{a(JSON.parse(u),{replace:t,state:n,relative:r})},[a,u,r,t,n]),null}function zt(e){On(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function h7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,unstable_useTransitions:i}){On(!_u(),"You cannot render a inside another . You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=T.useMemo(()=>({basename:a,navigator:s,static:o,unstable_useTransitions:i,future:{}}),[a,s,o,i]);typeof n=="string"&&(n=Su(n));let{pathname:u="/",search:f="",hash:h="",state:p=null,key:g="default"}=n,y=T.useMemo(()=>{let b=Ui(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 qs(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:T.createElement(yo.Provider,{value:c},T.createElement(Uf.Provider,{children:t,value:y}))}function ES({children:e,location:t}){return e7(F1(e),t)}function F1(e,t=[]){let n=[];return T.Children.forEach(e,(r,s)=>{if(!T.isValidElement(r))return;let o=[...t,s];if(r.type===T.Fragment){n.push.apply(n,F1(r.props.children,o));return}On(r.type===zt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),On(!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=F1(r.props.children,o)),n.push(i)}),n}var Cm="get",xm="application/x-www-form-urlencoded";function zg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function p7(e){return zg(e)&&e.tagName.toLowerCase()==="button"}function m7(e){return zg(e)&&e.tagName.toLowerCase()==="form"}function g7(e){return zg(e)&&e.tagName.toLowerCase()==="input"}function y7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function b7(e,t){return e.button===0&&(!t||t==="_self")&&!y7(e)}function P1(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 v7(e,t){let n=P1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var Ap=null;function w7(){if(Ap===null)try{new FormData(document.createElement("form"),0),Ap=!1}catch{Ap=!0}return Ap}var E7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nb(e){return e!=null&&!E7.has(e)?(qs(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${xm}"`),null):e}function C7(e,t){let n,r,s,o,i;if(m7(e)){let a=e.getAttribute("action");r=a?Ui(a,t):null,n=e.getAttribute("method")||Cm,s=nb(e.getAttribute("enctype"))||xm,o=new FormData(e)}else if(p7(e)||g7(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a