diff --git a/frontend/dist/VERSION b/frontend/dist/VERSION index 3d6d1116..0032cd80 100644 --- a/frontend/dist/VERSION +++ b/frontend/dist/VERSION @@ -1 +1 @@ -0.9.307 +0.9.308 diff --git a/frontend/dist/assets/AnalyzerFilterPanel-Cx2An8MF.js b/frontend/dist/assets/AnalyzerFilterPanel-DX4fviv1.js similarity index 98% rename from frontend/dist/assets/AnalyzerFilterPanel-Cx2An8MF.js rename to frontend/dist/assets/AnalyzerFilterPanel-DX4fviv1.js index 72c9af0a..d657f7c7 100644 --- a/frontend/dist/assets/AnalyzerFilterPanel-Cx2An8MF.js +++ b/frontend/dist/assets/AnalyzerFilterPanel-DX4fviv1.js @@ -1,4 +1,4 @@ -import{d as U,am as J,a8 as q,ck as G,r as d,j as n,bK as K,B as Q}from"./index-DZK2INMD.js";import{c as V}from"./node-types-Cj1JOOlq.js";import{M as Y}from"./monitor-smartphone-BKehVovy.js";import{C as Z}from"./circle-question-mark-BdE_X9p5.js";import{F as W}from"./funnel-ClRHq7Ic.js";import{S as ee}from"./search-DRsZhueb.js";/** +import{d as U,am as J,a8 as q,ck as G,r as d,j as n,bK as K,B as Q}from"./index-B9Nfzawy.js";import{c as V}from"./node-types-D2DQet2e.js";import{M as Y}from"./monitor-smartphone-zVB5GYa6.js";import{C as Z}from"./circle-question-mark-Br2ku42v.js";import{F as W}from"./funnel-DOec69-r.js";import{S as ee}from"./search-BrfwwyYC.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/AutoConfigureDialog-Biwer_fL.js b/frontend/dist/assets/AutoConfigureDialog-D-tiCDMu.js similarity index 98% rename from frontend/dist/assets/AutoConfigureDialog-Biwer_fL.js rename to frontend/dist/assets/AutoConfigureDialog-D-tiCDMu.js index 168c956f..892d0a13 100644 --- a/frontend/dist/assets/AutoConfigureDialog-Biwer_fL.js +++ b/frontend/dist/assets/AutoConfigureDialog-D-tiCDMu.js @@ -1,4 +1,4 @@ -import{d as J,j as e,a5 as V,a8 as X,dh as W,ec as U,r as h,ei as Z,aA as ee,aI as ae,aB as te,a0 as G,B as M,c as k,aC as se}from"./index-DZK2INMD.js";import{C as le}from"./PageLayout-F1v-IzhG.js";import{D as K}from"./DataBox-BEDP2Kxh.js";import{T as ne}from"./triangle-alert-z32LI9zM.js";import{A as re}from"./arrow-right-BW1lsEoU.js";/** +import{d as J,j as e,a5 as V,a8 as X,dh as W,ec as U,r as h,ei as Z,aA as ee,aI as ae,aB as te,a0 as G,B as M,c as k,aC as se}from"./index-B9Nfzawy.js";import{C as le}from"./PageLayout-Da0xfaXb.js";import{D as K}from"./DataBox-CCBd3sT4.js";import{T as ne}from"./triangle-alert-_KPqiYkd.js";import{A as re}from"./arrow-right-BbRfzTpf.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/BasemapLayer-DFBOwIT2.js b/frontend/dist/assets/BasemapLayer--gGy0d8r.js similarity index 99% rename from frontend/dist/assets/BasemapLayer-DFBOwIT2.js rename to frontend/dist/assets/BasemapLayer--gGy0d8r.js index 4cec14a6..1e4a74ff 100644 --- a/frontend/dist/assets/BasemapLayer-DFBOwIT2.js +++ b/frontend/dist/assets/BasemapLayer--gGy0d8r.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DZK2INMD.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); -import{r as a,_ as Z,b9 as j}from"./index-DZK2INMD.js";const W=a.createContext(null);function B(){var s;const e=(s=a.useContext(W))==null?void 0:s.maps,t=a.useContext(b);return a.useMemo(()=>({...e,current:t==null?void 0:t.map}),[e,t])}function V(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&s===r}function v(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=t[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const i of q)i in r&&(o[i]=r[i])}return o||s});return{...e,layers:n}}const U={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"},F={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"},$=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],G=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class M{constructor(t,n,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[F[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||T(this._map.transform);const r=this.props[N[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=T(o),z(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=t,this.props=n,this._initialize(s)}get map(){return this._map}setProps(t){const n=this.props;this.props=t;const s=this._updateSettings(t,n),o=this._updateSize(t),r=this._updateViewState(t);this._updateStyle(t,n),this._updateStyleComponents(t),this._updateHandlers(t,n),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const s=M.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(n.className=r.className;r.childNodes.length>0;)n.appendChild(r.childNodes[0]);o._container=n;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(n)),s.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:c}=t;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(t){const{props:n}=this,{mapStyle:s=U}=n,o={...n,...n.initialViewState,container:t,style:O(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}),n.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,n.gl)}const i=new this._MapClass(o);r.padding&&i.setPadding(r.padding),n.cursor&&(i.getCanvas().style.cursor=n.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 F)i.on(c,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),M.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){const{viewState:n}=t;if(n){const s=this._map;if(n.width!==s.transform.width||n.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(t){const n=this._map,s=n.transform;if(!n.isMoving()){const r=z(s,t);if(Object.keys(r).length>0)return this._internalUpdate=!0,n.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(t,n){const s=this._map;let o=!1;for(const r of $)if(r in t&&!v(t[r],n[r])){o=!0;const i=s[`set${r[0].toUpperCase()}${r.slice(1)}`];i==null||i.call(s,t[r])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:s=U,styleDiffing:o=!0}=t,r={diff:o};"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(O(s),r)}}_updateStyleComponents({light:t,projection:n,sky:s,terrain:o}){var c,u;const r=this._map,i=this._styleComponents;r.style._loaded&&(t&&!v(t,i.light)&&(i.light=t,r.setLight(t)),n&&!v(n,i.projection)&&n!==((c=i.projection)==null?void 0:c.type)&&(i.projection=typeof n=="string"?{type:n}:n,(u=r.setProjection)==null||u.call(r,i.projection)),s&&!v(s,i.sky)&&(i.sky=s,r.setSky(s)),o!==void 0&&!v(o,i.terrain)&&(!o||r.getSource(o.source))&&(i.terrain=o,r.setTerrain(o)))}_updateHandlers(t,n){const s=this._map;for(const o of G){const r=t[o]??!0,i=n[o]??!0;v(r,i)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(t){const n=this._map,{interactiveLayerIds:s=[]}=this.props;try{return n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(t.point),u=c.length>0;!u&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=c,u&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}}M.savedMaps=[];const K=["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 t=e.map,n={getMap:()=>t};for(const s of Y(t))!(s in n)&&!K.includes(s)&&(n[s]=t[s].bind(t));return n}function Y(e){const t=new Set;let n=e;for(;n;){for(const s of Object.getOwnPropertyNames(n))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&t.add(s);n=Object.getPrototypeOf(n)}return Array.from(t)}const X=typeof document<"u"?a.useLayoutEffect:a.useEffect;function Q(e,t){const{RTLTextPlugin:n,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:c=!0}=typeof n=="string"?{pluginUrl:n}:n;e.setRTLTextPlugin(i,u=>{u&&console.error(u)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const b=a.createContext(null);function ee(e,t){const n=a.useContext(W),[s,o]=a.useState(null),r=a.useRef(),{current:i}=a.useRef({mapLib:null,map:null});a.useEffect(()=>{const l=e.mapLib;let d=!0,f;return Promise.resolve(l||Z(()=>import("./maplibre-gl-DqQq8w-m.js").then(m=>m.m),__vite__mapDeps([0,1]))).then(m=>{if(!d)return;if(!m)throw new Error("Invalid mapLib");const y="Map"in m?m:m.default;if(!y.Map)throw new Error("Invalid mapLib");Q(y,e),e.reuseMaps&&(f=M.reuse(e,r.current)),f||(f=new M(y.Map,e,r.current)),i.map=J(f),i.mapLib=y,o(f),n==null||n.onMapMount(i.map,e.id)}).catch(m=>{const{onError:y}=e;y?y({type:"error",target:null,originalEvent:null,error:m}):console.error(m)}),()=>{d=!1,f&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?f.recycle():f.destroy())}},[]),X(()=>{s&&s.setProps(e)}),a.useImperativeHandle(t,()=>i.map,[s]);const c=a.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),u={height:"100%"};return a.createElement("div",{id:e.id,ref:r,style:c},s&&a.createElement(b.Provider,{value:i},a.createElement("div",{"mapboxgl-children":"",style:u},e.children)))}const _e=a.forwardRef(ee),te=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function L(e,t){if(!e||!t)return;const n=e.style;for(const s in t){const o=t[s];Number.isFinite(o)&&!te.test(s)?n[s]=`${o}px`:n[s]=o}}function H(e,t){if(e===t)return null;const n=D(e),s=D(t),o=[];for(const r of s)n.has(r)||o.push(r);for(const r of n)s.has(r)||o.push(r);return o.length===0?null:o}function D(e){return new Set(e?e.trim().split(/\s+/):[])}const Le=a.memo(a.forwardRef((e,t)=>{const{map:n,mapLib:s}=a.useContext(b),o=a.useRef({props:e}),r=a.useMemo(()=>{let E=!1;a.Children.forEach(e.children,g=>{g&&(E=!0)});const k={...e,element:E?document.createElement("div"):void 0},p=new s.Marker(k);return p.setLngLat([e.longitude,e.latitude]),p.getElement().addEventListener("click",g=>{var h,_;(_=(h=o.current.props).onClick)==null||_.call(h,{type:"click",target:p,originalEvent:g})}),p.on("dragstart",g=>{var _,S;const h=g;h.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragStart)==null||S.call(_,h)}),p.on("drag",g=>{var _,S;const h=g;h.lngLat=r.getLngLat(),(S=(_=o.current.props).onDrag)==null||S.call(_,h)}),p.on("dragend",g=>{var _,S;const h=g;h.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragEnd)==null||S.call(_,h)}),p},[]);a.useEffect(()=>(r.addTo(n.getMap()),()=>{r.remove()}),[]);const{longitude:i,latitude:c,offset:u,style:l,draggable:d=!1,popup:f=null,rotation:m=0,rotationAlignment:y="auto",pitchAlignment:C="auto"}=e;a.useEffect(()=>{L(r.getElement(),l)},[l]),a.useImperativeHandle(t,()=>r,[]);const P=o.current.props;(r.getLngLat().lng!==i||r.getLngLat().lat!==c)&&r.setLngLat([i,c]),u&&!V(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==d&&r.setDraggable(d),r.getRotation()!==m&&r.setRotation(m),r.getRotationAlignment()!==y&&r.setRotationAlignment(y),r.getPitchAlignment()!==C&&r.setPitchAlignment(C),r.getPopup()!==f&&r.setPopup(f);const x=H(P.className,e.className);if(x)for(const E of x)r.toggleClassName(E);return o.current.props=e,j.createPortal(e.children,r.getElement())})),Ce=a.memo(a.forwardRef((e,t)=>{const{map:n,mapLib:s}=a.useContext(b),o=a.useMemo(()=>document.createElement("div"),[]),r=a.useRef({props:e}),i=a.useMemo(()=>{const c={...e},u=new s.Popup(c);return u.setLngLat([e.longitude,e.latitude]),u.once("open",l=>{var d,f;(f=(d=r.current.props).onOpen)==null||f.call(d,l)}),u},[]);if(a.useEffect(()=>{const c=u=>{var l,d;(d=(l=r.current.props).onClose)==null||d.call(l,u)};return i.on("close",c),i.setDOMContent(o).addTo(n.getMap()),()=>{i.off("close",c),i.isOpen()&&i.remove()}},[]),a.useEffect(()=>{L(i.getElement(),e.style)},[e.style]),a.useImperativeHandle(t,()=>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&&!v(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 u=H(c.className,e.className);if(u)for(const l of u)i.toggleClassName(l);r.current.props=e}return j.createPortal(e.children,o)}));function w(e,t,n,s){const o=a.useContext(b),r=a.useMemo(()=>e(o),[]);return a.useEffect(()=>{const i=t,c=null,u=typeof t=="function"?t:null,{map:l}=o;return l.hasControl(r)||(l.addControl(r,i==null?void 0:i.position),c&&c(o)),()=>{u&&u(o),l.hasControl(r)&&l.removeControl(r)}},[]),r}function ne(e){const t=w(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(ne);function oe(e){const t=w(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return a.useEffect(()=>{L(t._controlContainer,e.style)},[e.style]),null}a.memo(oe);function re(e,t){const n=a.useRef({props:e}),s=w(({mapLib:o})=>{const r=new o.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on("geolocate",c=>{var u,l;(l=(u=n.current.props).onGeolocate)==null||l.call(u,c)}),r.on("error",c=>{var u,l;(l=(u=n.current.props).onError)==null||l.call(u,c)}),r.on("outofmaxbounds",c=>{var u,l;(l=(u=n.current.props).onOutOfMaxBounds)==null||l.call(u,c)}),r.on("trackuserlocationstart",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationStart)==null||l.call(u,c)}),r.on("trackuserlocationend",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationEnd)==null||l.call(u,c)}),r},{position:e.position});return n.current.props=e,a.useImperativeHandle(t,()=>s,[]),a.useEffect(()=>{L(s._container,e.style)},[e.style]),null}a.memo(a.forwardRef(re));function se(e){const t=w(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(se);function ie(e){const t=w(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),n=a.useRef(e),s=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&t.setUnit(e.unit),a.useEffect(()=>{L(t._container,o)},[o]),null}const Se=a.memo(ie);function ae(e){const t=w(({mapLib:n})=>new n.TerrainControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(ae);function ce(e){const t=w(({mapLib:n})=>new n.LogoControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(ce);function R(e,t){if(!e)throw new Error(t)}let le=0;function ue(e,t,n){if(e.style&&e.style._loaded){const s={...n};return delete s.id,delete s.children,e.addSource(t,s),e.getSource(t)}return null}function fe(e,t,n){var i,c,u;R(t.id===n.id,"source id changed"),R(t.type===n.type,"source type changed");let s="",o=0;for(const l in t)l!=="children"&&l!=="id"&&!v(n[l],t[l])&&(s=l,o++);if(!o)return;const r=t.type;if(r==="geojson")e.setData(t.data);else if(r==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else switch(s){case"coordinates":(i=e.setCoordinates)==null||i.call(e,t.coordinates);break;case"url":(c=e.setUrl)==null||c.call(e,t.url);break;case"tiles":(u=e.setTiles)==null||u.call(e,t.tiles);break;default:console.warn(`Unable to update prop: ${s}`)}}function Ee(e){const t=a.useContext(b).map.getMap(),n=a.useRef(e),[,s]=a.useState(0),o=a.useMemo(()=>e.id||`jsx-source-${le++}`,[]);a.useEffect(()=>{if(t){const i=()=>setTimeout(()=>s(c=>c+1),0);return t.on("styledata",i),i(),()=>{var c;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(o)){const u=(c=t.getStyle())==null?void 0:c.layers;if(u)for(const l of u)l.source===o&&t.removeLayer(l.id);t.removeSource(o)}}}},[t]);let r=t&&t.style&&t.getSource(o);return r?fe(r,e,n.current):r=ue(t,o,e),n.current=e,r&&a.Children.map(e.children,i=>i&&a.cloneElement(i,{source:o}))||null}function de(e,t,n,s){if(R(n.id===s.id,"layer id changed"),R(n.type===s.type,"layer type changed"),n.type==="custom"||s.type==="custom")return;const{layout:o={},paint:r={},filter:i,minzoom:c,maxzoom:u,beforeId:l}=n;if(l!==s.beforeId&&e.moveLayer(t,l),o!==s.layout){const d=s.layout||{};for(const f in o)v(o[f],d[f])||e.setLayoutProperty(t,f,o[f]);for(const f in d)o.hasOwnProperty(f)||e.setLayoutProperty(t,f,void 0)}if(r!==s.paint){const d=s.paint||{};for(const f in r)v(r[f],d[f])||e.setPaintProperty(t,f,r[f]);for(const f in d)r.hasOwnProperty(f)||e.setPaintProperty(t,f,void 0)}v(i,s.filter)||e.setFilter(t,i),(c!==s.minzoom||u!==s.maxzoom)&&e.setLayerZoomRange(t,c,u)}function me(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const s={...n,id:t};delete s.beforeId,e.addLayer(s,n.beforeId)}}let ye=0;function be(e){const t=a.useContext(b).map.getMap(),n=a.useRef(e),[,s]=a.useState(0),o=a.useMemo(()=>e.id||`jsx-layer-${ye++}`,[]);if(a.useEffect(()=>{if(t){const i=()=>s(c=>c+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{de(t,o,e,n.current)}catch(i){console.warn(i)}else me(t,o,e);return n.current=e,null}const he={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},ge={light:"basemap-light-",dark:"basemap-dark-"},I={};async function pe(e){if(I[e])return I[e];const n=await(await fetch(he[e])).json();return I[e]=n,n}function we({mode:e}){const{current:t}=B(),[n,s]=a.useState(null),o=a.useRef({light:!1,dark:!1}),r=a.useRef({light:[],dark:[]});a.useEffect(()=>{const l=()=>{var y;const m=(y=t==null?void 0:t.getMap)==null?void 0:y.call(t);m&&!n&&s(m)};l();const d=setInterval(l,50),f=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(f)}},[t,n]);const i=a.useCallback(async(l,d,f)=>{var E,k;if(o.current[d])return;const m=ge[d],y=await pe(d),C=[];for(const[p,g]of Object.entries(y.sources||{})){const h=m+p;l.getSource(h)||l.addSource(h,g)}const x=(k=(((E=l.getStyle())==null?void 0:E.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:k.id;for(const p of y.layers||[]){const g=m+p.id;if(C.push(g),l.getLayer(g))continue;const h={...p,id:g};"source"in h&&typeof h.source=="string"&&(h.source=m+h.source),h.layout||(h.layout={}),h.layout.visibility=f?"visible":"none";try{l.addLayer(h,x)}catch(_){console.warn(`[BasemapLayer] Failed to add layer ${g}:`,_)}}r.current[d]=C,o.current[d]=!0},[]),c=a.useCallback((l,d,f)=>{const m=r.current[d],y=f?"visible":"none";for(const C of m)if(l.getLayer(C))try{l.setLayoutProperty(C,"visibility",y)}catch{}},[]),u=a.useCallback(l=>{var m;const f=(((m=l.getStyle())==null?void 0:m.layers)||[]).filter(y=>!y.id.startsWith("basemap-light-")&&!y.id.startsWith("basemap-dark-"));for(const y of f)try{l.moveLayer(y.id)}catch{}},[]);return a.useEffect(()=>{if(!n)return;const l=d=>{n.hasImage(d.id)||n.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return n.on("styleimagemissing",l),()=>{n.off("styleimagemissing",l)}},[n]),a.useEffect(()=>{if(!n)return;let l=!1;const d=async()=>{if(!l)try{await Promise.all([i(n,"light",e==="light"),i(n,"dark",e==="dark")]),l||u(n)}catch(m){console.error("[BasemapLayer] Setup error:",m)}};n.isStyleLoaded()?d():(n.once("style.load",d),n.once("load",()=>{!l&&!o.current.light&&d()}));const f=()=>{l||setTimeout(()=>{!l&&o.current.light&&o.current.dark&&u(n)},100)};return n.on("styledata",f),()=>{l=!0,n.off("styledata",f)}},[n,i,u,e]),a.useEffect(()=>{n&&(!o.current.light||!o.current.dark||(c(n,"light",e==="light"),c(n,"dark",e==="dark")))},[n,e,c]),null}export{we as B,be as L,_e as M,Ce as P,Ee as S,Le as a,Se as b,B as u}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B9Nfzawy.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); +import{r as a,_ as Z,b9 as j}from"./index-B9Nfzawy.js";const W=a.createContext(null);function B(){var s;const e=(s=a.useContext(W))==null?void 0:s.maps,t=a.useContext(b);return a.useMemo(()=>({...e,current:t==null?void 0:t.map}),[e,t])}function V(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&s===r}function v(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=t[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const i of q)i in r&&(o[i]=r[i])}return o||s});return{...e,layers:n}}const U={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"},F={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"},$=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],G=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class M{constructor(t,n,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[F[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||T(this._map.transform);const r=this.props[N[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=T(o),z(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=t,this.props=n,this._initialize(s)}get map(){return this._map}setProps(t){const n=this.props;this.props=t;const s=this._updateSettings(t,n),o=this._updateSize(t),r=this._updateViewState(t);this._updateStyle(t,n),this._updateStyleComponents(t),this._updateHandlers(t,n),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const s=M.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(n.className=r.className;r.childNodes.length>0;)n.appendChild(r.childNodes[0]);o._container=n;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(n)),s.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:c}=t;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(t){const{props:n}=this,{mapStyle:s=U}=n,o={...n,...n.initialViewState,container:t,style:O(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}),n.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,n.gl)}const i=new this._MapClass(o);r.padding&&i.setPadding(r.padding),n.cursor&&(i.getCanvas().style.cursor=n.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 F)i.on(c,this._onEvent);this._map=i}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),M.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){const{viewState:n}=t;if(n){const s=this._map;if(n.width!==s.transform.width||n.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(t){const n=this._map,s=n.transform;if(!n.isMoving()){const r=z(s,t);if(Object.keys(r).length>0)return this._internalUpdate=!0,n.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(t,n){const s=this._map;let o=!1;for(const r of $)if(r in t&&!v(t[r],n[r])){o=!0;const i=s[`set${r[0].toUpperCase()}${r.slice(1)}`];i==null||i.call(s,t[r])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:s=U,styleDiffing:o=!0}=t,r={diff:o};"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(O(s),r)}}_updateStyleComponents({light:t,projection:n,sky:s,terrain:o}){var c,u;const r=this._map,i=this._styleComponents;r.style._loaded&&(t&&!v(t,i.light)&&(i.light=t,r.setLight(t)),n&&!v(n,i.projection)&&n!==((c=i.projection)==null?void 0:c.type)&&(i.projection=typeof n=="string"?{type:n}:n,(u=r.setProjection)==null||u.call(r,i.projection)),s&&!v(s,i.sky)&&(i.sky=s,r.setSky(s)),o!==void 0&&!v(o,i.terrain)&&(!o||r.getSource(o.source))&&(i.terrain=o,r.setTerrain(o)))}_updateHandlers(t,n){const s=this._map;for(const o of G){const r=t[o]??!0,i=n[o]??!0;v(r,i)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(t){const n=this._map,{interactiveLayerIds:s=[]}=this.props;try{return n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(t.point),u=c.length>0;!u&&i&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=c,u&&!i&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}}M.savedMaps=[];const K=["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 t=e.map,n={getMap:()=>t};for(const s of Y(t))!(s in n)&&!K.includes(s)&&(n[s]=t[s].bind(t));return n}function Y(e){const t=new Set;let n=e;for(;n;){for(const s of Object.getOwnPropertyNames(n))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&t.add(s);n=Object.getPrototypeOf(n)}return Array.from(t)}const X=typeof document<"u"?a.useLayoutEffect:a.useEffect;function Q(e,t){const{RTLTextPlugin:n,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:c=!0}=typeof n=="string"?{pluginUrl:n}:n;e.setRTLTextPlugin(i,u=>{u&&console.error(u)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const b=a.createContext(null);function ee(e,t){const n=a.useContext(W),[s,o]=a.useState(null),r=a.useRef(),{current:i}=a.useRef({mapLib:null,map:null});a.useEffect(()=>{const l=e.mapLib;let d=!0,f;return Promise.resolve(l||Z(()=>import("./maplibre-gl-DisS89O_.js").then(m=>m.m),__vite__mapDeps([0,1]))).then(m=>{if(!d)return;if(!m)throw new Error("Invalid mapLib");const y="Map"in m?m:m.default;if(!y.Map)throw new Error("Invalid mapLib");Q(y,e),e.reuseMaps&&(f=M.reuse(e,r.current)),f||(f=new M(y.Map,e,r.current)),i.map=J(f),i.mapLib=y,o(f),n==null||n.onMapMount(i.map,e.id)}).catch(m=>{const{onError:y}=e;y?y({type:"error",target:null,originalEvent:null,error:m}):console.error(m)}),()=>{d=!1,f&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?f.recycle():f.destroy())}},[]),X(()=>{s&&s.setProps(e)}),a.useImperativeHandle(t,()=>i.map,[s]);const c=a.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),u={height:"100%"};return a.createElement("div",{id:e.id,ref:r,style:c},s&&a.createElement(b.Provider,{value:i},a.createElement("div",{"mapboxgl-children":"",style:u},e.children)))}const _e=a.forwardRef(ee),te=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function L(e,t){if(!e||!t)return;const n=e.style;for(const s in t){const o=t[s];Number.isFinite(o)&&!te.test(s)?n[s]=`${o}px`:n[s]=o}}function H(e,t){if(e===t)return null;const n=D(e),s=D(t),o=[];for(const r of s)n.has(r)||o.push(r);for(const r of n)s.has(r)||o.push(r);return o.length===0?null:o}function D(e){return new Set(e?e.trim().split(/\s+/):[])}const Le=a.memo(a.forwardRef((e,t)=>{const{map:n,mapLib:s}=a.useContext(b),o=a.useRef({props:e}),r=a.useMemo(()=>{let E=!1;a.Children.forEach(e.children,g=>{g&&(E=!0)});const k={...e,element:E?document.createElement("div"):void 0},p=new s.Marker(k);return p.setLngLat([e.longitude,e.latitude]),p.getElement().addEventListener("click",g=>{var h,_;(_=(h=o.current.props).onClick)==null||_.call(h,{type:"click",target:p,originalEvent:g})}),p.on("dragstart",g=>{var _,S;const h=g;h.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragStart)==null||S.call(_,h)}),p.on("drag",g=>{var _,S;const h=g;h.lngLat=r.getLngLat(),(S=(_=o.current.props).onDrag)==null||S.call(_,h)}),p.on("dragend",g=>{var _,S;const h=g;h.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragEnd)==null||S.call(_,h)}),p},[]);a.useEffect(()=>(r.addTo(n.getMap()),()=>{r.remove()}),[]);const{longitude:i,latitude:c,offset:u,style:l,draggable:d=!1,popup:f=null,rotation:m=0,rotationAlignment:y="auto",pitchAlignment:C="auto"}=e;a.useEffect(()=>{L(r.getElement(),l)},[l]),a.useImperativeHandle(t,()=>r,[]);const P=o.current.props;(r.getLngLat().lng!==i||r.getLngLat().lat!==c)&&r.setLngLat([i,c]),u&&!V(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==d&&r.setDraggable(d),r.getRotation()!==m&&r.setRotation(m),r.getRotationAlignment()!==y&&r.setRotationAlignment(y),r.getPitchAlignment()!==C&&r.setPitchAlignment(C),r.getPopup()!==f&&r.setPopup(f);const x=H(P.className,e.className);if(x)for(const E of x)r.toggleClassName(E);return o.current.props=e,j.createPortal(e.children,r.getElement())})),Ce=a.memo(a.forwardRef((e,t)=>{const{map:n,mapLib:s}=a.useContext(b),o=a.useMemo(()=>document.createElement("div"),[]),r=a.useRef({props:e}),i=a.useMemo(()=>{const c={...e},u=new s.Popup(c);return u.setLngLat([e.longitude,e.latitude]),u.once("open",l=>{var d,f;(f=(d=r.current.props).onOpen)==null||f.call(d,l)}),u},[]);if(a.useEffect(()=>{const c=u=>{var l,d;(d=(l=r.current.props).onClose)==null||d.call(l,u)};return i.on("close",c),i.setDOMContent(o).addTo(n.getMap()),()=>{i.off("close",c),i.isOpen()&&i.remove()}},[]),a.useEffect(()=>{L(i.getElement(),e.style)},[e.style]),a.useImperativeHandle(t,()=>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&&!v(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 u=H(c.className,e.className);if(u)for(const l of u)i.toggleClassName(l);r.current.props=e}return j.createPortal(e.children,o)}));function w(e,t,n,s){const o=a.useContext(b),r=a.useMemo(()=>e(o),[]);return a.useEffect(()=>{const i=t,c=null,u=typeof t=="function"?t:null,{map:l}=o;return l.hasControl(r)||(l.addControl(r,i==null?void 0:i.position),c&&c(o)),()=>{u&&u(o),l.hasControl(r)&&l.removeControl(r)}},[]),r}function ne(e){const t=w(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(ne);function oe(e){const t=w(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return a.useEffect(()=>{L(t._controlContainer,e.style)},[e.style]),null}a.memo(oe);function re(e,t){const n=a.useRef({props:e}),s=w(({mapLib:o})=>{const r=new o.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on("geolocate",c=>{var u,l;(l=(u=n.current.props).onGeolocate)==null||l.call(u,c)}),r.on("error",c=>{var u,l;(l=(u=n.current.props).onError)==null||l.call(u,c)}),r.on("outofmaxbounds",c=>{var u,l;(l=(u=n.current.props).onOutOfMaxBounds)==null||l.call(u,c)}),r.on("trackuserlocationstart",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationStart)==null||l.call(u,c)}),r.on("trackuserlocationend",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationEnd)==null||l.call(u,c)}),r},{position:e.position});return n.current.props=e,a.useImperativeHandle(t,()=>s,[]),a.useEffect(()=>{L(s._container,e.style)},[e.style]),null}a.memo(a.forwardRef(re));function se(e){const t=w(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(se);function ie(e){const t=w(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),n=a.useRef(e),s=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&t.setUnit(e.unit),a.useEffect(()=>{L(t._container,o)},[o]),null}const Se=a.memo(ie);function ae(e){const t=w(({mapLib:n})=>new n.TerrainControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(ae);function ce(e){const t=w(({mapLib:n})=>new n.LogoControl(e),{position:e.position});return a.useEffect(()=>{L(t._container,e.style)},[e.style]),null}a.memo(ce);function R(e,t){if(!e)throw new Error(t)}let le=0;function ue(e,t,n){if(e.style&&e.style._loaded){const s={...n};return delete s.id,delete s.children,e.addSource(t,s),e.getSource(t)}return null}function fe(e,t,n){var i,c,u;R(t.id===n.id,"source id changed"),R(t.type===n.type,"source type changed");let s="",o=0;for(const l in t)l!=="children"&&l!=="id"&&!v(n[l],t[l])&&(s=l,o++);if(!o)return;const r=t.type;if(r==="geojson")e.setData(t.data);else if(r==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else switch(s){case"coordinates":(i=e.setCoordinates)==null||i.call(e,t.coordinates);break;case"url":(c=e.setUrl)==null||c.call(e,t.url);break;case"tiles":(u=e.setTiles)==null||u.call(e,t.tiles);break;default:console.warn(`Unable to update prop: ${s}`)}}function Ee(e){const t=a.useContext(b).map.getMap(),n=a.useRef(e),[,s]=a.useState(0),o=a.useMemo(()=>e.id||`jsx-source-${le++}`,[]);a.useEffect(()=>{if(t){const i=()=>setTimeout(()=>s(c=>c+1),0);return t.on("styledata",i),i(),()=>{var c;if(t.off("styledata",i),t.style&&t.style._loaded&&t.getSource(o)){const u=(c=t.getStyle())==null?void 0:c.layers;if(u)for(const l of u)l.source===o&&t.removeLayer(l.id);t.removeSource(o)}}}},[t]);let r=t&&t.style&&t.getSource(o);return r?fe(r,e,n.current):r=ue(t,o,e),n.current=e,r&&a.Children.map(e.children,i=>i&&a.cloneElement(i,{source:o}))||null}function de(e,t,n,s){if(R(n.id===s.id,"layer id changed"),R(n.type===s.type,"layer type changed"),n.type==="custom"||s.type==="custom")return;const{layout:o={},paint:r={},filter:i,minzoom:c,maxzoom:u,beforeId:l}=n;if(l!==s.beforeId&&e.moveLayer(t,l),o!==s.layout){const d=s.layout||{};for(const f in o)v(o[f],d[f])||e.setLayoutProperty(t,f,o[f]);for(const f in d)o.hasOwnProperty(f)||e.setLayoutProperty(t,f,void 0)}if(r!==s.paint){const d=s.paint||{};for(const f in r)v(r[f],d[f])||e.setPaintProperty(t,f,r[f]);for(const f in d)r.hasOwnProperty(f)||e.setPaintProperty(t,f,void 0)}v(i,s.filter)||e.setFilter(t,i),(c!==s.minzoom||u!==s.maxzoom)&&e.setLayerZoomRange(t,c,u)}function me(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const s={...n,id:t};delete s.beforeId,e.addLayer(s,n.beforeId)}}let ye=0;function be(e){const t=a.useContext(b).map.getMap(),n=a.useRef(e),[,s]=a.useState(0),o=a.useMemo(()=>e.id||`jsx-layer-${ye++}`,[]);if(a.useEffect(()=>{if(t){const i=()=>s(c=>c+1);return t.on("styledata",i),i(),()=>{t.off("styledata",i),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{de(t,o,e,n.current)}catch(i){console.warn(i)}else me(t,o,e);return n.current=e,null}const he={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},ge={light:"basemap-light-",dark:"basemap-dark-"},I={};async function pe(e){if(I[e])return I[e];const n=await(await fetch(he[e])).json();return I[e]=n,n}function we({mode:e}){const{current:t}=B(),[n,s]=a.useState(null),o=a.useRef({light:!1,dark:!1}),r=a.useRef({light:[],dark:[]});a.useEffect(()=>{const l=()=>{var y;const m=(y=t==null?void 0:t.getMap)==null?void 0:y.call(t);m&&!n&&s(m)};l();const d=setInterval(l,50),f=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(f)}},[t,n]);const i=a.useCallback(async(l,d,f)=>{var E,k;if(o.current[d])return;const m=ge[d],y=await pe(d),C=[];for(const[p,g]of Object.entries(y.sources||{})){const h=m+p;l.getSource(h)||l.addSource(h,g)}const x=(k=(((E=l.getStyle())==null?void 0:E.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:k.id;for(const p of y.layers||[]){const g=m+p.id;if(C.push(g),l.getLayer(g))continue;const h={...p,id:g};"source"in h&&typeof h.source=="string"&&(h.source=m+h.source),h.layout||(h.layout={}),h.layout.visibility=f?"visible":"none";try{l.addLayer(h,x)}catch(_){console.warn(`[BasemapLayer] Failed to add layer ${g}:`,_)}}r.current[d]=C,o.current[d]=!0},[]),c=a.useCallback((l,d,f)=>{const m=r.current[d],y=f?"visible":"none";for(const C of m)if(l.getLayer(C))try{l.setLayoutProperty(C,"visibility",y)}catch{}},[]),u=a.useCallback(l=>{var m;const f=(((m=l.getStyle())==null?void 0:m.layers)||[]).filter(y=>!y.id.startsWith("basemap-light-")&&!y.id.startsWith("basemap-dark-"));for(const y of f)try{l.moveLayer(y.id)}catch{}},[]);return a.useEffect(()=>{if(!n)return;const l=d=>{n.hasImage(d.id)||n.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return n.on("styleimagemissing",l),()=>{n.off("styleimagemissing",l)}},[n]),a.useEffect(()=>{if(!n)return;let l=!1;const d=async()=>{if(!l)try{await Promise.all([i(n,"light",e==="light"),i(n,"dark",e==="dark")]),l||u(n)}catch(m){console.error("[BasemapLayer] Setup error:",m)}};n.isStyleLoaded()?d():(n.once("style.load",d),n.once("load",()=>{!l&&!o.current.light&&d()}));const f=()=>{l||setTimeout(()=>{!l&&o.current.light&&o.current.dark&&u(n)},100)};return n.on("styledata",f),()=>{l=!0,n.off("styledata",f)}},[n,i,u,e]),a.useEffect(()=>{n&&(!o.current.light||!o.current.dark||(c(n,"light",e==="light"),c(n,"dark",e==="dark")))},[n,e,c]),null}export{we as B,be as L,_e as M,Ce as P,Ee as S,Le as a,Se as b,B as u}; diff --git a/frontend/dist/assets/ChatBubble-BfbDZnhb.js b/frontend/dist/assets/ChatBubble-fzIllzhe.js similarity index 93% rename from frontend/dist/assets/ChatBubble-BfbDZnhb.js rename to frontend/dist/assets/ChatBubble-fzIllzhe.js index d70deeb1..80700bdd 100644 --- a/frontend/dist/assets/ChatBubble-BfbDZnhb.js +++ b/frontend/dist/assets/ChatBubble-fzIllzhe.js @@ -1,4 +1,4 @@ -import{d as h,r as u,j as e,c as t}from"./index-DZK2INMD.js";import{e as f,g as p,a as g,b as j,f as b}from"./chat-utils-B9fA4l9w.js";/** +import{d as h,r as u,j as e,c as t}from"./index-B9Nfzawy.js";import{e as f,g as p,a as g,b as j,f as b}from"./chat-utils-CXtTpLY5.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/CollisionExplorerModal-Cb8lVNAn.js b/frontend/dist/assets/CollisionExplorerModal-J7HE0WX3.js similarity index 97% rename from frontend/dist/assets/CollisionExplorerModal-Cb8lVNAn.js rename to frontend/dist/assets/CollisionExplorerModal-J7HE0WX3.js index 83abd211..3f31eb5e 100644 --- a/frontend/dist/assets/CollisionExplorerModal-Cb8lVNAn.js +++ b/frontend/dist/assets/CollisionExplorerModal-J7HE0WX3.js @@ -1,4 +1,4 @@ -import{d as k,r as c,a4 as L,ca as S,a9 as H,j as e,aA as R,aB as B,cS as T,bX as E,c as N,R as w,a1 as _,Y as D,$ as I,ck as P}from"./index-DZK2INMD.js";import{M as z,B as W,S as q,L as U,a as A}from"./BasemapLayer-DFBOwIT2.js";import{T as F}from"./triangle-alert-z32LI9zM.js";import{M as Y}from"./map-pin-qwXb-K8z.js";import{M as $}from"./monitor-smartphone-BKehVovy.js";/** +import{d as k,r as c,a4 as L,ca as S,a9 as H,j as e,aA as R,aB as B,cS as T,bX as E,c as N,R as w,a1 as _,Y as D,$ as I,ck as P}from"./index-B9Nfzawy.js";import{M as z,B as W,S as q,L as U,a as A}from"./BasemapLayer--gGy0d8r.js";import{T as F}from"./triangle-alert-_KPqiYkd.js";import{M as Y}from"./map-pin-Z2xK57U6.js";import{M as $}from"./monitor-smartphone-zVB5GYa6.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Configuration-Bw_n7Cvf.js b/frontend/dist/assets/Configuration-CUBGWMgN.js similarity index 98% rename from frontend/dist/assets/Configuration-Bw_n7Cvf.js rename to frontend/dist/assets/Configuration-CUBGWMgN.js index fd5c9b64..87f40679 100644 --- a/frontend/dist/assets/Configuration-Bw_n7Cvf.js +++ b/frontend/dist/assets/Configuration-CUBGWMgN.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{d as pe,r as s,j as e,c,ed as Et,cL as fe,a0 as B,Y as X,bK as Y,aC as et,ec as Ae,ee as nt,ef as tt,_ as Ee,a6 as J,D as cs,S as ds,eg as us,a5 as U,cm as lt,eh as ms,B as I,ei as Rt,R as xs,V as Vt,ej as fs,ek as Mt,el as ps,em as hs,en as ys,a8 as gs,eo as Ue,I as bs,$ as js,a1 as vs}from"./index-DZK2INMD.js";import{g as Ns,a as ks,c as ws,r as Ss,s as _s,b as Cs,u as Ts,d as Fs}from"./system-OzsQQeV5.js";import{C as Es}from"./ConfirmModal-CkTTKNiq.js";import{W as st,A as Rs,a as Ms,S as Ds,N as As}from"./AutoConfigureDialog-Biwer_fL.js";import{i as Is,g as Ps,s as Ls,a as Ks,k as Os}from"./keycap-sfx-ByZp-njj.js";import{C as W,P as zs,a as Vs,B as Hs}from"./PageLayout-F1v-IzhG.js";import{T as Ht}from"./trash-2-B1qiliQL.js";import{R as $s}from"./rotate-ccw-BgriCY_m.js";import{S as qs}from"./shield-tOGn5YjL.js";import{R as Bs,K as Dt}from"./repeat-BAyKJWpi.js";import{T as Me}from"./triangle-alert-z32LI9zM.js";import{R as ee,C as ce}from"./Grid-TGa3qLqq.js";import{A as Gs}from"./antenna-DwKMmyHW.js";import{P as At}from"./plus-Dm1LTbFN.js";import{C as Us}from"./circle-check-DiKh03Ex.js";import{R as Ws}from"./refresh-cw-DzrjsyBC.js";import{C as Xs}from"./chevron-right-DYHNTpxG.js";import"./DataBox-BEDP2Kxh.js";import"./arrow-right-BW1lsEoU.js";/** +import{d as pe,r as s,j as e,c,ed as Et,cL as fe,a0 as B,Y as X,bK as Y,aC as et,ec as Ae,ee as nt,ef as tt,_ as Ee,a6 as J,D as cs,S as ds,eg as us,a5 as U,cm as lt,eh as ms,B as I,ei as Rt,R as xs,V as Vt,ej as fs,ek as Mt,el as ps,em as hs,en as ys,a8 as gs,eo as Ue,I as bs,$ as js,a1 as vs}from"./index-B9Nfzawy.js";import{g as Ns,a as ks,c as ws,r as Ss,s as _s,b as Cs,u as Ts,d as Fs}from"./system-D2aLg2mB.js";import{C as Es}from"./ConfirmModal-CsrIdG-V.js";import{W as st,A as Rs,a as Ms,S as Ds,N as As}from"./AutoConfigureDialog-D-tiCDMu.js";import{i as Is,g as Ps,s as Ls,a as Ks,k as Os}from"./keycap-sfx-ByZp-njj.js";import{C as W,P as zs,a as Vs,B as Hs}from"./PageLayout-Da0xfaXb.js";import{T as Ht}from"./trash-2-BxrPvo_t.js";import{R as $s}from"./rotate-ccw-BwcqAp9U.js";import{S as qs}from"./shield-5eYUHkwt.js";import{R as Bs,K as Dt}from"./repeat-C00vzJTj.js";import{T as Me}from"./triangle-alert-_KPqiYkd.js";import{R as ee,C as ce}from"./Grid-CbgS5PRh.js";import{A as Gs}from"./antenna-DHhoJnxo.js";import{P as At}from"./plus-B7jylh_n.js";import{C as Us}from"./circle-check-m0ROsc83.js";import{R as Ws}from"./refresh-cw-hB3ADAmy.js";import{C as Xs}from"./chevron-right-jwX-OOTu.js";import"./DataBox-CCBd3sT4.js";import"./arrow-right-BbRfzTpf.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConfirmModal-CkTTKNiq.js b/frontend/dist/assets/ConfirmModal-CsrIdG-V.js similarity index 84% rename from frontend/dist/assets/ConfirmModal-CkTTKNiq.js rename to frontend/dist/assets/ConfirmModal-CsrIdG-V.js index 365e2ffe..63806c50 100644 --- a/frontend/dist/assets/ConfirmModal-CkTTKNiq.js +++ b/frontend/dist/assets/ConfirmModal-CsrIdG-V.js @@ -1 +1 @@ -import{r as d,j as s,aA as m,aI as x,c as f,aB as g,eq as C,B as a}from"./index-DZK2INMD.js";import{T as j}from"./triangle-alert-z32LI9zM.js";const p={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},u={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:o="default",onConfirm:c,onCancel:e}){return s.jsxs(m,{open:n,onClose:e,size:"sm",children:[s.jsx(x,{icon:s.jsx(j,{className:f("w-5 h-5",p[o])}),title:r,onClose:e}),s.jsx(g,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(C,{children:[s.jsx(a,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(a,{color:u[o],onClick:c,className:"flex-1",children:t})]})]})}const y=d.memo(N);export{y as C}; +import{r as d,j as s,aA as m,aI as x,c as f,aB as g,eq as C,B as a}from"./index-B9Nfzawy.js";import{T as j}from"./triangle-alert-_KPqiYkd.js";const p={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},u={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:o="default",onConfirm:c,onCancel:e}){return s.jsxs(m,{open:n,onClose:e,size:"sm",children:[s.jsx(x,{icon:s.jsx(j,{className:f("w-5 h-5",p[o])}),title:r,onClose:e}),s.jsx(g,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(C,{children:[s.jsx(a,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(a,{color:u[o],onClick:c,className:"flex-1",children:t})]})]})}const y=d.memo(N);export{y as C}; diff --git a/frontend/dist/assets/Contacts-DVusfR1A.js b/frontend/dist/assets/Contacts-DgMcpPLG.js similarity index 82% rename from frontend/dist/assets/Contacts-DVusfR1A.js rename to frontend/dist/assets/Contacts-DgMcpPLG.js index fc93ce6d..5c778a3b 100644 --- a/frontend/dist/assets/Contacts-DVusfR1A.js +++ b/frontend/dist/assets/Contacts-DgMcpPLG.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-ChNfqbt-.js","assets/index-DZK2INMD.js","assets/BasemapLayer-DFBOwIT2.js","assets/consumer-registry-C58OO1Zb.js","assets/link-scoring-D2b5sONh.js","assets/ConfirmModal-CkTTKNiq.js","assets/triangle-alert-z32LI9zM.js","assets/max-BIfJ_m_6.js","assets/download-7zuVGrrm.js","assets/database-DWx780B3.js","assets/useMapViewStore-DGeq1iXE.js","assets/index-C-Mp31KV.js","assets/refresh-cw-DzrjsyBC.js","assets/target-CMbN1GDb.js","assets/funnel-ClRHq7Ic.js","assets/plus-Dm1LTbFN.js","assets/easing-D7lsSq8M.js","assets/zap-CV3qJZPu.js","assets/trash-2-B1qiliQL.js","assets/wifi-off-Dpiws8OL.js","assets/wifi-DPjA-ySX.js","assets/clock-CZYZYW0y.js","assets/chevron-right-DYHNTpxG.js","assets/LightSparkline-D9e7Om82.js","assets/badge-colors-BNUqIXCA.js","assets/map-pin-qwXb-K8z.js","assets/node-types-Cj1JOOlq.js","assets/usePipelineStore-BRm0f890.js","assets/ping-BIr2soBi.js","assets/PageLayout-F1v-IzhG.js","assets/listbox-DR8wL7aQ.js","assets/element-movement-BZO5MqZi.js","assets/MqttModeBadge-CK543WcH.js","assets/chat-utils-B9fA4l9w.js","assets/SignalIndicator-BlRL2nuG.js","assets/CollisionExplorerModal-Cb8lVNAn.js","assets/monitor-smartphone-BKehVovy.js","assets/DataBox-BEDP2Kxh.js","assets/circle-question-mark-BdE_X9p5.js","assets/network-CfluO-Ty.js","assets/arrow-right-BW1lsEoU.js","assets/activity-F7Po-3Al.js","assets/search-DRsZhueb.js","assets/index-BSz_JZ6w.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); -import{d as P,ap as ss,j as e,r as a,_ as ts,ch as Ee,ci as Fe,am as oe,Y as ke,ax as Pe,cj as ns,ck as he,a8 as pe,R as k,cl as as,a0 as Oe,cm as rs,aa as os,cn as cs,co as is,cp as ls,a9 as ds,cq as ms,cr as xs,ab as us,ay as ps,ac as Ne,cs as hs,ct as fs,bG as re,W as gs,I as js,bK as ys,c as we}from"./index-DZK2INMD.js";import{useDiscoveredNodes as bs}from"./usePipelineStore-BRm0f890.js";import{p as Ns}from"./ping-BIr2soBi.js";import{c as Ce}from"./node-types-Cj1JOOlq.js";import{P as vs,a as ws,B as ks}from"./PageLayout-F1v-IzhG.js";import{L as Cs,a as ue}from"./listbox-DR8wL7aQ.js";import{T as Te,M as Ms}from"./MqttModeBadge-CK543WcH.js";import{u as Ss,e as _s,f as Rs,r as Ps}from"./consumer-registry-C58OO1Zb.js";import{e as Ts,g as Ls,a as $s}from"./chat-utils-B9fA4l9w.js";import{b as Es}from"./SignalIndicator-BlRL2nuG.js";import{C as Fs,S as Os}from"./CollisionExplorerModal-Cb8lVNAn.js";import{E as zs,T as Hs}from"./target-CMbN1GDb.js";import{D as Ds}from"./DataBox-BEDP2Kxh.js";import{C as X}from"./badge-colors-BNUqIXCA.js";import{C as ze}from"./circle-question-mark-BdE_X9p5.js";import{N as As}from"./network-CfluO-Ty.js";import{A as Is}from"./arrow-right-BW1lsEoU.js";import{A as He}from"./activity-F7Po-3Al.js";import{T as Bs}from"./trash-2-B1qiliQL.js";import{C as qs}from"./ConfirmModal-CkTTKNiq.js";import{M as Le}from"./monitor-smartphone-BKehVovy.js";import{M as Vs}from"./map-pin-qwXb-K8z.js";import{S as Us}from"./search-DRsZhueb.js";import{C as Ws}from"./clock-CZYZYW0y.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-DqVXnaaM.js","assets/index-B9Nfzawy.js","assets/BasemapLayer--gGy0d8r.js","assets/consumer-registry-B_rYsmHo.js","assets/link-scoring-353AdDOu.js","assets/ConfirmModal-CsrIdG-V.js","assets/triangle-alert-_KPqiYkd.js","assets/max-BFwmL_H9.js","assets/download-BaEmSLqY.js","assets/database-CSUiI1CG.js","assets/useMapViewStore-CAlaFCdd.js","assets/index-CHkxpv0k.js","assets/refresh-cw-hB3ADAmy.js","assets/target-74Dm2pEA.js","assets/funnel-DOec69-r.js","assets/plus-B7jylh_n.js","assets/easing-VuIK-HqT.js","assets/zap-DME89Nfc.js","assets/trash-2-BxrPvo_t.js","assets/wifi-off-DoZXnx54.js","assets/wifi-BpM3uttU.js","assets/clock-CCOO2GB9.js","assets/chevron-right-jwX-OOTu.js","assets/LightSparkline-DTXOFhS4.js","assets/badge-colors-BNUqIXCA.js","assets/map-pin-Z2xK57U6.js","assets/node-types-D2DQet2e.js","assets/usePipelineStore-Dto_OrsT.js","assets/ping-kFEBCmQp.js","assets/PageLayout-Da0xfaXb.js","assets/listbox-DV2L-QZw.js","assets/element-movement-C8Yd7NWa.js","assets/MqttModeBadge-Bgn-nTpu.js","assets/chat-utils-CXtTpLY5.js","assets/SignalIndicator-BAKXIHs1.js","assets/CollisionExplorerModal-J7HE0WX3.js","assets/monitor-smartphone-zVB5GYa6.js","assets/DataBox-CCBd3sT4.js","assets/circle-question-mark-Br2ku42v.js","assets/network-BCB-csrZ.js","assets/arrow-right-BbRfzTpf.js","assets/activity-CcUqK62Y.js","assets/search-BrfwwyYC.js","assets/index-BSz_JZ6w.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); +import{d as P,ap as ss,j as e,r as a,_ as ts,ch as Ee,ci as Fe,am as oe,Y as ke,ax as Pe,cj as ns,ck as he,a8 as ue,R as k,cl as as,a0 as Oe,cm as rs,aa as os,cn as cs,co as is,cp as ls,a9 as ds,cq as ms,cr as xs,ab as ps,ay as us,ac as Ne,cs as hs,ct as fs,bG as re,W as gs,I as js,bK as ys,c as we}from"./index-B9Nfzawy.js";import{useDiscoveredNodes as bs}from"./usePipelineStore-Dto_OrsT.js";import{p as Ns}from"./ping-kFEBCmQp.js";import{c as Ce}from"./node-types-D2DQet2e.js";import{P as vs,a as ws,B as ks}from"./PageLayout-Da0xfaXb.js";import{L as Cs,a as pe}from"./listbox-DV2L-QZw.js";import{T as Te,M as Ms}from"./MqttModeBadge-Bgn-nTpu.js";import{u as Ss,e as _s,f as Rs,r as Ps}from"./consumer-registry-B_rYsmHo.js";import{e as Ts,g as Ls,a as $s}from"./chat-utils-CXtTpLY5.js";import{b as Es}from"./SignalIndicator-BAKXIHs1.js";import{C as Fs,S as Os}from"./CollisionExplorerModal-J7HE0WX3.js";import{E as zs,T as Hs}from"./target-74Dm2pEA.js";import{D as Ds}from"./DataBox-CCBd3sT4.js";import{C as X}from"./badge-colors-BNUqIXCA.js";import{C as ze}from"./circle-question-mark-Br2ku42v.js";import{N as As}from"./network-BCB-csrZ.js";import{A as Is}from"./arrow-right-BbRfzTpf.js";import{A as He}from"./activity-CcUqK62Y.js";import{T as Bs}from"./trash-2-BxrPvo_t.js";import{C as qs}from"./ConfirmModal-CsrIdG-V.js";import{M as Le}from"./monitor-smartphone-zVB5GYa6.js";import{M as Vs}from"./map-pin-Z2xK57U6.js";import{S as Us}from"./search-BrfwwyYC.js";import{C as Ws}from"./clock-CCOO2GB9.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -49,4 +49,4 @@ import{d as P,ap as ss,j as e,r as a,_ as ts,ch as Ee,ci as Fe,am as oe,Y as ke, * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dt=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],mt=P("trending-down",dt);class xt extends a.Component{constructor(c){super(c),this.state={hasError:!1}}static getDerivedStateFromError(c){return{hasError:!0,error:c}}render(){var c;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:((c=this.state.error)==null?void 0:c.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 ut=a.lazy(()=>ts(()=>import("./ContactsMapMapLibre-ChNfqbt-.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]))),$e=()=>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 pt({neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:p,highlightedGhost:d}){return ss()===!1?e.jsx($e,{}):e.jsx(xt,{children:e.jsx(a.Suspense,{fallback:e.jsx($e,{}),children:e.jsx(ut,{neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:p,highlightedGhost:d})})})}function ht({hash:o,className:c="",size:f="sm",collisionInfo:x,isViterbiResolved:g}){const v=Ee(),p=Fe(),[d,T]=a.useState(!1),S=a.useMemo(()=>oe(o),[o]),L=a.useMemo(()=>x!==void 0?x:S?v.find(j=>j.prefix===S)??null:null,[S,v,x]),$=g??(p.totalPaths>0&&p.avgPathConfidence>=.7),O=a.useCallback(j=>{j.preventDefault(),j.stopPropagation(),T(!0)},[]),B=a.useCallback(()=>{T(!1)},[]);if(!L)return null;const w=f==="sm"?"w-3.5 h-3.5":"w-4 h-4",D=$?"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",_=$?`Prefix conflict resolved by Viterbi HMM (${(p.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${L.candidateCount} nodes share prefix "${S}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:O,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${D} ${c}`,title:_,"aria-label":`View prefix conflict for ${S}${$?" (Viterbi resolved)":""}`,children:$?e.jsxs("span",{className:"relative",children:[e.jsx(zs,{className:w}),e.jsx(ke,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(et,{className:w})}),e.jsx(Fs,{isOpen:d,prefix:L.prefix,candidateHashes:L.candidateHashes,onClose:B})]})}const ft=a.memo(ht),Ae=[{target:"Contacts",fn:"name",minStage:1,when:_s},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Rs}];Ps(Ae);function gt(o){return o<1e3?`${Math.round(o)}m`:`${(o/1e3).toFixed(1)}km`}function jt({hash:o,contact:c,isHub:f,isNeighbor:x,distance:g,centrality:v,sparklineData:p,neighborSignal:d,collisionInfo:T,isViterbiResolved:S,isPinging:L,isPingingThis:$,pingResult:O,pingError:B,gatewayInfo:w,lastForwarderPrefix:D,isMobile:_,pathStability:j,onRowClick:E,onPing:fe,onRemove:q}){Ss(Ae);const Z=c.latitude&&c.longitude&&c.latitude!==0&&c.longitude!==0,h=c.node_name||c.name||"Unknown",V=x&&d,z=Ce(c),{isRepeater:U,isCompanion:b,isRoomServer:W,isClient:J,label:ee}=z,ge=x?`${ee} — Direct RF contact (zero-hop neighbor)`:`${ee} — Flood routing (multi-hop via mesh)`,G=c.first_seen?Pe(c.first_seen).replace(/ ago$/i," old"):null;return e.jsxs("div",{className:`contacts-grid-row ${f?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${Z?"cursor-pointer hover:bg-subtle-fill":""}`,onClick:()=>E(o),children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[V&&(d==null?void 0:d.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${ns(d.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:ge,children:(()=>{if(W&&U)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(he,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(Os,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(W)return e.jsx(he,{className:"w-5 h-5 text-sys-pink"});if(U)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(pe,{className:"w-3.5 h-3.5 text-sys-blue"})});if((b||J)&&h!=="Unknown"){const{emoji:y,cleanName:H}=Ts(h);return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",style:{backgroundColor:Ls(H)},children:y?e.jsx("span",{className:"text-sm leading-none",children:y}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:$s(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}),x&&e.jsx(k,{color:X.neighbor,compact:!0,className:"flex-shrink-0",children:"NBR"}),f&&e.jsxs(k,{color:X.hub,compact:!0,className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(As,{className:"w-3 h-3"}),"HUB"]}),U&&e.jsx(k,{color:X.repeater,compact:!0,className:"flex-shrink-0",children:"RPT"}),W&&e.jsx(k,{color:X.room,compact:!0,className:"flex-shrink-0",children:"ROOM"}),b&&e.jsx(k,{color:X.companion,compact:!0,className:"flex-shrink-0",children:"COMP"}),J&&e.jsx(k,{color:X.client,compact:!0,className:"flex-shrink-0",children:"CLIENT"}),_&&e.jsxs(k,{color:"cyan",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",children:[e.jsx(ot,{className:"w-2.5 h-2.5"}),"MOBILE"]}),!Z&&e.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0 text-fg-muted/50",title:"No GPS location provided",children:e.jsx(at,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Ds,{copy:!0,size:"compact",truncate:[8,6],children:o}),e.jsx(ft,{hash:o,collisionInfo:T,isViterbiResolved:S}),!x&&w&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Via ${w.name||w.prefix} (${w.hopCount} hop${w.hopCount!==1?"s":""})`,children:[e.jsx(Is,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:w.prefix}),w.hopCount>1&&e.jsxs("span",{className:"opacity-60",children:["+",w.hopCount-1]})]}),D&&!x&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Last forwarded by ${D}`,children:[e.jsx(Qs,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:D})]}),j!=null&&j!==0&&e.jsx(k,{color:j>0?"green":"amber",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:j>0?"Path stability improving":"Path stability declining",children:j>0?e.jsx(as,{className:"w-2.5 h-2.5"}):e.jsx(mt,{className:"w-2.5 h-2.5"})}),p.length>0&&(()=>{const y=p.reduce((je,se)=>je+se.count,0);if(y===0)return null;const H=y/24;return e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`${y} packets in last 24h (~${H.toFixed(1)}/hr)`,children:[e.jsx(it,{className:"w-2.5 h-2.5"}),e.jsxs("span",{children:[H<1?"<1":H.toFixed(0),"/hr"]})]})})(),G&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0 opacity-70",title:`First discovered ${G}`,children:[e.jsx(Zs,{className:"w-2.5 h-2.5"}),e.jsx("span",{children:G})]})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[V&&(d==null?void 0:d.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Es,{rssi:d.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(d.avgRssi)})]}),V&&(d==null?void 0:d.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[d.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:g!=null&&e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:gt(g)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:v>0&&e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"w-3 h-3 text-sys-indigo"}),e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[(v*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:c.last_seen?Pe(c.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[x&&e.jsx(e.Fragment,{children:O?e.jsxs("div",{className:"flex items-center gap-1 text-sys-green",title:`RTT: ${O.rtt_ms.toFixed(0)}ms`,children:[e.jsx(ke,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"type-data-xs hidden sm:inline",children:[O.snr_db.toFixed(1),"dB"]})]}):B?e.jsx("span",{className:"text-sys-red text-xs",title:B,children:"✗"}):e.jsx("button",{onClick:y=>fe(o,y),disabled:L,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:$?e.jsx(Oe,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Hs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:y=>{y.stopPropagation(),q(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(Bs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const yt=a.memo(jt),bt=6371e3,Nt=[],vt=[{field:"lastHeard",icon:Ws,label:"Recent"},{field:"distance",icon:De,label:"Distance"},{field:"centrality",icon:He,label:"Centrality"}];function wt(o){switch(o){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function kt(o){const c=Ce(o);return wt(c.type)}function ve(o,c){const{color:f="primary",border:x=!1}=c??{};return we("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",o?f==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",x&&(o?f==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function Ct(o,c,f,x){const g=(f-o)*Math.PI/180,v=(x-c)*Math.PI/180,p=Math.sin(g/2)*Math.sin(g/2)+Math.cos(o*Math.PI/180)*Math.cos(f*Math.PI/180)*Math.sin(v/2)*Math.sin(v/2),d=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return bt*d}function Mt(){const{stats:o}=rs(),c=os(),f=cs(),x=is(),g=ls(),v=ds(),p=ms(),d=xs(),T=us(),S=ps(),L=Ne[T],$=Ee(),O=Fe(),B=hs(),w=O.totalPaths>0&&O.avgPathConfidence>=.7,D=a.useMemo(()=>{const s=new Map;for(const t of $)s.set(t.prefix,t);return s},[$]),[_,j]=a.useState(null),[E,fe]=a.useState("lastHeard"),[q,Z]=a.useState("desc"),[h,V]=a.useState(""),[z,U]=a.useState(!1),[b,W]=a.useState(new Set),[J,ee]=a.useState(!1),[ge,G]=a.useState(null),[y,H]=a.useState(null),[je,se]=a.useState(new Map),[Ie,te]=a.useState(new Map),[C,Be]=a.useState(25),[Q,ce]=a.useState(25),ye=a.useRef(null),ne=a.useMemo(()=>(o==null?void 0:o.neighbors)??{},[o==null?void 0:o.neighbors]),be=bs(),ie=a.useMemo(()=>{if(be.size===0)return ne;const s=new Set;for(const n of Object.keys(ne))s.add((n.startsWith("0x")?n.slice(2):n).toLowerCase());let t=null;for(const[n,r]of be){const i=(n.startsWith("0x")?n.slice(2):n).toLowerCase();s.has(i)||(t||(t={...ne}),t[n]={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 t??ne},[ne,be]),A=a.useMemo(()=>{const t=Date.now()/1e3-L.minutes*60;return Object.fromEntries(Object.entries(ie).filter(([n,r])=>c.has(n)?!1:(r.last_seen??0)>=t))},[ie,c,L.minutes]),R=fs(),K=o==null?void 0:o.local_hash,qe=a.useMemo(()=>{const s=new Map;if(!K||p.size===0)return s;for(const[t,n]of p)if(t.endsWith(`→${K}`)&&n.hops.length>1){const r=t.split("→")[0],i=n.hops[n.hops.length-1];s.set(r,i)}return s},[p,K]),le=a.useMemo(()=>{const s=new Map;if(!(R!=null&&R.latitude)||!(R!=null&&R.longitude))return s;for(const[t,n]of Object.entries(A))n.latitude&&n.longitude&&n.latitude!==0&&n.longitude!==0?s.set(t,Ct(R.latitude,R.longitude,n.latitude,n.longitude)):s.set(t,null);return s},[A,R]),{neighborHashSet:de,neighborSignalMap:Ve}=a.useMemo(()=>{const s=new Set,t=new Map;for(const n of v)s.add(n.hash),t.set(n.hash,{avgRssi:n.avgRssi,avgSnr:n.avgSnr});return{neighborHashSet:s,neighborSignalMap:t}},[v]),Me=a.useMemo(()=>{const s=h.toLowerCase().trim(),t=s==="neighbor"||s==="neighbors",n=z||t,r=b.size>0;return Object.fromEntries(Object.entries(A).filter(([i,l])=>{if(r){const M=kt(l);if(!b.has(M))return!1}if(n&&!de.has(i))return!1;if(t||!s)return!0;const I=(l.node_name||l.name||"").toLowerCase(),N=oe(i).toLowerCase();return I.includes(s)||N.includes(s)||i.toLowerCase().includes(s)}))},[A,h,z,de,b]),u=a.useMemo(()=>{const s=Object.entries(Me),t=h.toLowerCase().trim(),n=t.length===2&&/^[0-9a-f]{2}$/i.test(t);return s.sort(([r,i],[l,I])=>{if(n){const M=oe(r).toLowerCase(),F=oe(l).toLowerCase(),ae=M===t,me=F===t;if(ae&&!me)return-1;if(me&&!ae)return 1}let N=0;switch(E){case"lastHeard":N=(i.last_seen||0)-(I.last_seen||0);break;case"distance":{const M=le.get(r)??null,F=le.get(l)??null;M===null&&F===null?N=0:M===null?N=1:F===null?N=-1:N=M-F;break}case"centrality":{const M=g.get(r)||0,F=g.get(l)||0;N=M-F;break}}return q==="desc"?-N:N})},[Me,E,q,le,g,h]),m=a.useMemo(()=>{let s=0,t=0,n=0,r=0,i=0;for(const[,l]of u){const I=Ce(l),N=l.latitude&&l.longitude&&l.latitude!==0&&l.longitude!==0;switch(I.type){case"room_server":n++;break;case"repeater":t++;break;case"companion":s++;break;case"unknown":i++;break}N&&r++}return{companions:s,repeaters:t,roomServers:n,total:u.length,withLocation:r,unknown:i}},[u]),Ue=a.useMemo(()=>new Set(x),[x]),Se=a.useMemo(()=>C===0?u:u.slice(0,Q),[u,Q,C]);a.useEffect(()=>{ce(C||u.length)},[E,q,h,z,b,C,u.length]),a.useEffect(()=>{const s=t=>{t.target.closest("[data-dropdown]")||ee(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),a.useEffect(()=>{if(C===0)return;const s=new IntersectionObserver(t=>{t[0].isIntersecting&&QMath.min(n+C,u.length))},{threshold:.1,rootMargin:"100px"});return ye.current&&s.observe(ye.current),()=>s.disconnect()},[C,Q,u.length]);const We=a.useCallback(s=>{Be(s),ce(s||u.length)},[u.length]),Ge=a.useCallback(s=>{E===s?Z(t=>t==="desc"?"asc":"desc"):(fe(s),Z("desc"))},[E]),Qe=a.useCallback(s=>{const t=A[s];t!=null&&t.latitude&&(t!=null&&t.longitude)&&t.latitude!==0&&t.longitude!==0&&G(s)},[A]),Ke=a.useCallback(()=>{G(null)},[]),Ye=a.useCallback((s,t)=>{j({hash:s,name:t})},[]),Xe=a.useCallback(async(s,t)=>{if(t.stopPropagation(),!y){H(s),se(n=>{const r=new Map(n);return r.delete(s),r}),te(n=>{const r=new Map(n);return r.delete(s),r});try{const n=s.startsWith("0x")?s.slice(0,4):`0x${s.slice(0,2)}`,r=await Ns(n,30);r.success&&r.data?(se(i=>new Map(i).set(s,r.data)),setTimeout(()=>{se(i=>{const l=new Map(i);return l.delete(s),l})},1e4)):(te(i=>new Map(i).set(s,r.error||"Ping failed")),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3))}catch(n){const r=n instanceof Error?n.message:"Ping failed";te(i=>new Map(i).set(s,r)),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3)}finally{H(null)}}},[y]);return e.jsxs(vs,{children:[e.jsx(ws,{title:"Contacts",icon:e.jsx(re,{}),subtitle:e.jsx(Ms,{}),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(re,{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(pe,{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(Le,{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(he,{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(Vs,{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(re,{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(pe,{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(Le,{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(he,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S})})]})}),e.jsxs(ks,{children:[e.jsx(pt,{neighbors:A,localNode:R??void 0,localHash:K,onRemoveNode:f,selectedNodeHash:ge,onNodeSelected:Ke}),e.jsxs(gs,{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(re,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(js,{type:"search",size:"sm",value:h,onChange:s=>V(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Us,{className:"w-3.5 h-3.5"}),trailingIcon:h?e.jsx("button",{onClick:()=>{V(""),(h.toLowerCase().trim()==="neighbor"||h.toLowerCase().trim()==="neighbors")&&U(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(ys,{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:()=>ee(!J),className:ve(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(tt,{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})]}),J&&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:t})=>e.jsxs("button",{onClick:()=>{W(n=>{const r=new Set(n);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(ke,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:t})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>W(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"})]})]})]}),de.size>0&&e.jsxs("button",{onClick:()=>U(!z),className:ve(z,{color:"success",border:!0}),title:z?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(pe,{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:[vt.map(({field:s,icon:t,label:n})=>e.jsxs("button",{onClick:()=>Ge(s),className:ve(E===s),title:`Sort by ${n.toLowerCase()}`,children:[e.jsx(t,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:n}),E===s&&e.jsx(Ys,{className:we("w-3 h-3",q==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Cs,{value:C,onChange:We,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(ue,{value:25,children:"25"}),e.jsx(ue,{value:50,children:"50"}),e.jsx(ue,{value:100,children:"100"}),e.jsx(ue,{value:0,children:"All"})]})]})]}),u.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",children:Se.map(([s,t])=>{const n=oe(s),r=Ue.has(s),i=de.has(s),l=le.get(s)??null,I=g.get(s)||0,N=i?Ve.get(s):void 0,M=n?D.get(n)??null:null,F=B.get(s)??Nt;let ae=null;if(!i&&K&&p.size>0){const Je=`${s}→${K}`,xe=p.get(Je);if(xe&&xe.hops.length>0){const _e=xe.hops[0],Re=Object.keys(ie).find(es=>es.toUpperCase().startsWith(_e.toUpperCase())),Y=Re?ie[Re]:null;ae={prefix:_e,name:(Y==null?void 0:Y.node_name)??(Y==null?void 0:Y.name)??null,hopCount:xe.hopCount}}}const me=d.has(s),Ze=qe.get(s)??null;return e.jsx(yt,{hash:s,contact:t,isHub:r,isNeighbor:i,distance:l,centrality:I,sparklineData:F,neighborSignal:N,collisionInfo:M,isViterbiResolved:w,isPinging:y!==null,isPingingThis:y===s,pingResult:je.get(s),pingError:Ie.get(s),gatewayInfo:ae,lastForwarderPrefix:Ze,isMobile:me,onRowClick:Qe,onPing:Xe,onRemove:Ye},s)})}),C>0&&Q0&&Qce(s=>Math.min(s+C,u.length)),className:"text-sys-blue hover:text-sys-blue/80 transition-base",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(re,{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:!!_,title:"Remove Contact",message:`Are you sure you would like to remove ${(_==null?void 0:_.name)||"this contact"}?`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{_&&f(_.hash),j(null)},onCancel:()=>j(null)})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,default:Mt},Symbol.toStringTag,{value:"Module"}));export{Xt as C,ft as P,De as R,mt as T}; + */const dt=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],mt=P("trending-down",dt);class xt extends a.Component{constructor(c){super(c),this.state={hasError:!1}}static getDerivedStateFromError(c){return{hasError:!0,error:c}}render(){var c;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:((c=this.state.error)==null?void 0:c.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 pt=a.lazy(()=>ts(()=>import("./ContactsMapMapLibre-DqVXnaaM.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]))),$e=()=>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 ut({neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:u,highlightedGhost:d}){return ss()===!1?e.jsx($e,{}):e.jsx(xt,{children:e.jsx(a.Suspense,{fallback:e.jsx($e,{}),children:e.jsx(pt,{neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:u,highlightedGhost:d})})})}function ht({hash:o,className:c="",size:f="sm",collisionInfo:x,isViterbiResolved:g}){const v=Ee(),u=Fe(),[d,T]=a.useState(!1),S=a.useMemo(()=>oe(o),[o]),L=a.useMemo(()=>x!==void 0?x:S?v.find(j=>j.prefix===S)??null:null,[S,v,x]),$=g??(u.totalPaths>0&&u.avgPathConfidence>=.7),O=a.useCallback(j=>{j.preventDefault(),j.stopPropagation(),T(!0)},[]),B=a.useCallback(()=>{T(!1)},[]);if(!L)return null;const w=f==="sm"?"w-3.5 h-3.5":"w-4 h-4",D=$?"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",_=$?`Prefix conflict resolved by Viterbi HMM (${(u.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${L.candidateCount} nodes share prefix "${S}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:O,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${D} ${c}`,title:_,"aria-label":`View prefix conflict for ${S}${$?" (Viterbi resolved)":""}`,children:$?e.jsxs("span",{className:"relative",children:[e.jsx(zs,{className:w}),e.jsx(ke,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(et,{className:w})}),e.jsx(Fs,{isOpen:d,prefix:L.prefix,candidateHashes:L.candidateHashes,onClose:B})]})}const ft=a.memo(ht),Ae=[{target:"Contacts",fn:"name",minStage:1,when:_s},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Rs}];Ps(Ae);function gt(o){return o<1e3?`${Math.round(o)}m`:`${(o/1e3).toFixed(1)}km`}function jt({hash:o,contact:c,isHub:f,isNeighbor:x,distance:g,centrality:v,sparklineData:u,neighborSignal:d,collisionInfo:T,isViterbiResolved:S,isPinging:L,isPingingThis:$,pingResult:O,pingError:B,gatewayInfo:w,lastForwarderPrefix:D,isMobile:_,pathStability:j,onRowClick:E,onPing:fe,onRemove:q}){Ss(Ae);const Z=c.latitude&&c.longitude&&c.latitude!==0&&c.longitude!==0,h=c.node_name||c.name||"Unknown",V=x&&d,z=Ce(c),{isRepeater:U,isCompanion:b,isRoomServer:W,isClient:J,label:ee}=z,ge=x?`${ee} — Direct RF contact (zero-hop neighbor)`:`${ee} — Flood routing (multi-hop via mesh)`,G=c.first_seen?Pe(c.first_seen).replace(/ ago$/i," old"):null;return e.jsxs("div",{className:`contacts-grid-row ${f?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${Z?"cursor-pointer hover:bg-subtle-fill":""}`,onClick:()=>E(o),children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[V&&(d==null?void 0:d.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${ns(d.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:ge,children:(()=>{if(W&&U)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(he,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(Os,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(W)return e.jsx(he,{className:"w-5 h-5 text-sys-pink"});if(U)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(ue,{className:"w-3.5 h-3.5 text-sys-blue"})});if((b||J)&&h!=="Unknown"){const{emoji:y,cleanName:H}=Ts(h);return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",style:{backgroundColor:Ls(H)},children:y?e.jsx("span",{className:"text-sm leading-none",children:y}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:$s(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}),x&&e.jsx(k,{color:X.neighbor,compact:!0,className:"flex-shrink-0",children:"NBR"}),f&&e.jsxs(k,{color:X.hub,compact:!0,className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(As,{className:"w-3 h-3"}),"HUB"]}),U&&e.jsx(k,{color:X.repeater,compact:!0,className:"flex-shrink-0",children:"RPT"}),W&&e.jsx(k,{color:X.room,compact:!0,className:"flex-shrink-0",children:"ROOM"}),b&&e.jsx(k,{color:X.companion,compact:!0,className:"flex-shrink-0",children:"COMP"}),J&&e.jsx(k,{color:X.client,compact:!0,className:"flex-shrink-0",children:"CLIENT"}),_&&e.jsxs(k,{color:"cyan",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",children:[e.jsx(ot,{className:"w-2.5 h-2.5"}),"MOBILE"]}),!Z&&e.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0 text-fg-muted/50",title:"No GPS location provided",children:e.jsx(at,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Ds,{copy:!0,size:"compact",truncate:[8,6],children:o}),e.jsx(ft,{hash:o,collisionInfo:T,isViterbiResolved:S}),!x&&w&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Via ${w.name||w.prefix} (${w.hopCount} hop${w.hopCount!==1?"s":""})`,children:[e.jsx(Is,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:w.prefix}),w.hopCount>1&&e.jsxs("span",{className:"opacity-60",children:["+",w.hopCount-1]})]}),D&&!x&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Last forwarded by ${D}`,children:[e.jsx(Qs,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:D})]}),j!=null&&j!==0&&e.jsx(k,{color:j>0?"green":"amber",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:j>0?"Path stability improving":"Path stability declining",children:j>0?e.jsx(as,{className:"w-2.5 h-2.5"}):e.jsx(mt,{className:"w-2.5 h-2.5"})}),u.length>0&&(()=>{const y=u.reduce((je,se)=>je+se.count,0);if(y===0)return null;const H=y/24;return e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`${y} packets in last 24h (~${H.toFixed(1)}/hr)`,children:[e.jsx(it,{className:"w-2.5 h-2.5"}),e.jsxs("span",{children:[H<1?"<1":H.toFixed(0),"/hr"]})]})})(),G&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0 opacity-70",title:`First discovered ${G}`,children:[e.jsx(Zs,{className:"w-2.5 h-2.5"}),e.jsx("span",{children:G})]})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[V&&(d==null?void 0:d.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Es,{rssi:d.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(d.avgRssi)})]}),V&&(d==null?void 0:d.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[d.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:g!=null&&e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:gt(g)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:v>0&&e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"w-3 h-3 text-sys-indigo"}),e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[(v*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:c.last_seen?Pe(c.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[x&&e.jsx(e.Fragment,{children:O?e.jsxs("div",{className:"flex items-center gap-1 text-sys-green",title:`RTT: ${O.rtt_ms.toFixed(0)}ms`,children:[e.jsx(ke,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"type-data-xs hidden sm:inline",children:[O.snr_db.toFixed(1),"dB"]})]}):B?e.jsx("span",{className:"text-sys-red text-xs",title:B,children:"✗"}):e.jsx("button",{onClick:y=>fe(o,y),disabled:L,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:$?e.jsx(Oe,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Hs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:y=>{y.stopPropagation(),q(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(Bs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const yt=a.memo(jt),bt=6371e3,Nt=[],vt=[{field:"lastHeard",icon:Ws,label:"Recent"},{field:"distance",icon:De,label:"Distance"},{field:"centrality",icon:He,label:"Centrality"}];function wt(o){switch(o){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function kt(o){const c=Ce(o);return wt(c.type)}function ve(o,c){const{color:f="primary",border:x=!1}=c??{};return we("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",o?f==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",x&&(o?f==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function Ct(o,c,f,x){const g=(f-o)*Math.PI/180,v=(x-c)*Math.PI/180,u=Math.sin(g/2)*Math.sin(g/2)+Math.cos(o*Math.PI/180)*Math.cos(f*Math.PI/180)*Math.sin(v/2)*Math.sin(v/2),d=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return bt*d}function Mt(){const{stats:o}=rs(),c=os(),f=cs(),x=is(),g=ls(),v=ds(),u=ms(),d=xs(),T=ps(),S=us(),L=Ne[T],$=Ee(),O=Fe(),B=hs(),w=O.totalPaths>0&&O.avgPathConfidence>=.7,D=a.useMemo(()=>{const s=new Map;for(const t of $)s.set(t.prefix,t);return s},[$]),[_,j]=a.useState(null),[E,fe]=a.useState("lastHeard"),[q,Z]=a.useState("desc"),[h,V]=a.useState(""),[z,U]=a.useState(!1),[b,W]=a.useState(new Set),[J,ee]=a.useState(!1),[ge,G]=a.useState(null),[y,H]=a.useState(null),[je,se]=a.useState(new Map),[Ie,te]=a.useState(new Map),[C,Be]=a.useState(25),[Q,ce]=a.useState(25),ye=a.useRef(null),ne=a.useMemo(()=>(o==null?void 0:o.neighbors)??{},[o==null?void 0:o.neighbors]),be=bs(),ie=a.useMemo(()=>{if(be.size===0)return ne;const s=new Set;for(const n of Object.keys(ne))s.add((n.startsWith("0x")?n.slice(2):n).toLowerCase());let t=null;for(const[n,r]of be){const i=(n.startsWith("0x")?n.slice(2):n).toLowerCase();s.has(i)||(t||(t={...ne}),t[n]={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 t??ne},[ne,be]),A=a.useMemo(()=>{const t=Date.now()/1e3-L.minutes*60;return Object.fromEntries(Object.entries(ie).filter(([n,r])=>c.has(n)?!1:(r.last_seen??0)>=t))},[ie,c,L.minutes]),R=fs(),K=o==null?void 0:o.local_hash,qe=a.useMemo(()=>{const s=new Map;if(!K||u.size===0)return s;for(const[t,n]of u)if(t.endsWith(`→${K}`)&&n.hops.length>1){const r=t.split("→")[0],i=n.hops[n.hops.length-1];s.set(r,i)}return s},[u,K]),le=a.useMemo(()=>{const s=new Map;if(!(R!=null&&R.latitude)||!(R!=null&&R.longitude))return s;for(const[t,n]of Object.entries(A))n.latitude&&n.longitude&&n.latitude!==0&&n.longitude!==0?s.set(t,Ct(R.latitude,R.longitude,n.latitude,n.longitude)):s.set(t,null);return s},[A,R]),{neighborHashSet:de,neighborSignalMap:Ve}=a.useMemo(()=>{const s=new Set,t=new Map;for(const n of v)s.add(n.hash),t.set(n.hash,{avgRssi:n.avgRssi,avgSnr:n.avgSnr});return{neighborHashSet:s,neighborSignalMap:t}},[v]),Me=a.useMemo(()=>{const s=h.toLowerCase().trim(),t=s==="neighbor"||s==="neighbors",n=z||t,r=b.size>0;return Object.fromEntries(Object.entries(A).filter(([i,l])=>{if(r){const M=kt(l);if(!b.has(M))return!1}if(n&&!de.has(i))return!1;if(t||!s)return!0;const I=(l.node_name||l.name||"").toLowerCase(),N=oe(i).toLowerCase();return I.includes(s)||N.includes(s)||i.toLowerCase().includes(s)}))},[A,h,z,de,b]),p=a.useMemo(()=>{const s=Object.entries(Me),t=h.toLowerCase().trim(),n=t.length===2&&/^[0-9a-f]{2}$/i.test(t);return s.sort(([r,i],[l,I])=>{if(n){const M=oe(r).toLowerCase(),F=oe(l).toLowerCase(),ae=M===t,me=F===t;if(ae&&!me)return-1;if(me&&!ae)return 1}let N=0;switch(E){case"lastHeard":N=(i.last_seen||0)-(I.last_seen||0);break;case"distance":{const M=le.get(r)??null,F=le.get(l)??null;M===null&&F===null?N=0:M===null?N=1:F===null?N=-1:N=M-F;break}case"centrality":{const M=g.get(r)||0,F=g.get(l)||0;N=M-F;break}}return q==="desc"?-N:N})},[Me,E,q,le,g,h]),m=a.useMemo(()=>{let s=0,t=0,n=0,r=0,i=0;for(const[,l]of p){const I=Ce(l),N=l.latitude&&l.longitude&&l.latitude!==0&&l.longitude!==0;switch(I.type){case"room_server":n++;break;case"repeater":t++;break;case"companion":s++;break;case"unknown":i++;break}N&&r++}return{companions:s,repeaters:t,roomServers:n,total:p.length,withLocation:r,unknown:i}},[p]),Ue=a.useMemo(()=>new Set(x),[x]),Se=a.useMemo(()=>C===0?p:p.slice(0,Q),[p,Q,C]);a.useEffect(()=>{ce(C||p.length)},[E,q,h,z,b,C,p.length]),a.useEffect(()=>{const s=t=>{t.target.closest("[data-dropdown]")||ee(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),a.useEffect(()=>{if(C===0)return;const s=new IntersectionObserver(t=>{t[0].isIntersecting&&QMath.min(n+C,p.length))},{threshold:.1,rootMargin:"100px"});return ye.current&&s.observe(ye.current),()=>s.disconnect()},[C,Q,p.length]);const We=a.useCallback(s=>{Be(s),ce(s||p.length)},[p.length]),Ge=a.useCallback(s=>{E===s?Z(t=>t==="desc"?"asc":"desc"):(fe(s),Z("desc"))},[E]),Qe=a.useCallback(s=>{const t=A[s];t!=null&&t.latitude&&(t!=null&&t.longitude)&&t.latitude!==0&&t.longitude!==0&&G(s)},[A]),Ke=a.useCallback(()=>{G(null)},[]),Ye=a.useCallback((s,t)=>{j({hash:s,name:t})},[]),Xe=a.useCallback(async(s,t)=>{if(t.stopPropagation(),!y){H(s),se(n=>{const r=new Map(n);return r.delete(s),r}),te(n=>{const r=new Map(n);return r.delete(s),r});try{const n=s.startsWith("0x")?s.slice(0,4):`0x${s.slice(0,2)}`,r=await Ns(n,30);r.success&&r.data?(se(i=>new Map(i).set(s,r.data)),setTimeout(()=>{se(i=>{const l=new Map(i);return l.delete(s),l})},1e4)):(te(i=>new Map(i).set(s,r.error||"Ping failed")),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3))}catch(n){const r=n instanceof Error?n.message:"Ping failed";te(i=>new Map(i).set(s,r)),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3)}finally{H(null)}}},[y]);return e.jsxs(vs,{children:[e.jsx(ws,{title:"Contacts",icon:e.jsx(re,{}),subtitle:e.jsx(Ms,{}),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(re,{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(ue,{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(Le,{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(he,{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(Vs,{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(re,{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(ue,{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(Le,{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(he,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S})})]})}),e.jsxs(ks,{children:[e.jsx(ut,{neighbors:A,localNode:R??void 0,localHash:K,onRemoveNode:f,selectedNodeHash:ge,onNodeSelected:Ke}),e.jsxs(gs,{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(re,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(js,{type:"search",size:"sm",value:h,onChange:s=>V(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Us,{className:"w-3.5 h-3.5"}),trailingIcon:h?e.jsx("button",{onClick:()=>{V(""),(h.toLowerCase().trim()==="neighbor"||h.toLowerCase().trim()==="neighbors")&&U(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(ys,{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:()=>ee(!J),className:ve(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(tt,{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})]}),J&&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:t})=>e.jsxs("button",{onClick:()=>{W(n=>{const r=new Set(n);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(ke,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:t})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>W(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"})]})]})]}),de.size>0&&e.jsxs("button",{onClick:()=>U(!z),className:ve(z,{color:"success",border:!0}),title:z?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(ue,{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:[vt.map(({field:s,icon:t,label:n})=>e.jsxs("button",{onClick:()=>Ge(s),className:ve(E===s),title:`Sort by ${n.toLowerCase()}`,children:[e.jsx(t,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:n}),E===s&&e.jsx(Ys,{className:we("w-3 h-3",q==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Cs,{value:C,onChange:We,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(pe,{value:25,children:"25"}),e.jsx(pe,{value:50,children:"50"}),e.jsx(pe,{value:100,children:"100"}),e.jsx(pe,{value:0,children:"All"})]})]})]}),p.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",children:Se.map(([s,t])=>{const n=oe(s),r=Ue.has(s),i=de.has(s),l=le.get(s)??null,I=g.get(s)||0,N=i?Ve.get(s):void 0,M=n?D.get(n)??null:null,F=B.get(s)??Nt;let ae=null;if(!i&&K&&u.size>0){const Je=`${s}→${K}`,xe=u.get(Je);if(xe&&xe.hops.length>0){const _e=xe.hops[0],Re=Object.keys(ie).find(es=>es.toUpperCase().startsWith(_e.toUpperCase())),Y=Re?ie[Re]:null;ae={prefix:_e,name:(Y==null?void 0:Y.node_name)??(Y==null?void 0:Y.name)??null,hopCount:xe.hopCount}}}const me=d.has(s),Ze=qe.get(s)??null;return e.jsx(yt,{hash:s,contact:t,isHub:r,isNeighbor:i,distance:l,centrality:I,sparklineData:F,neighborSignal:N,collisionInfo:M,isViterbiResolved:w,isPinging:y!==null,isPingingThis:y===s,pingResult:je.get(s),pingError:Ie.get(s),gatewayInfo:ae,lastForwarderPrefix:Ze,isMobile:me,onRowClick:Qe,onPing:Xe,onRemove:Ye},s)})}),C>0&&Q0&&Qce(s=>Math.min(s+C,p.length)),className:"text-sys-blue hover:text-sys-blue/80 transition-base",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(re,{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:!!_,title:"Remove Contact",message:`Remove ${(_==null?void 0:_.name)||"this contact"} from the contacts list? The node will reappear if it advertises again.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{_&&f(_.hash),j(null)},onCancel:()=>j(null)})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,default:Mt},Symbol.toStringTag,{value:"Module"}));export{Xt as C,ft as P,De as R,mt as T}; diff --git a/frontend/dist/assets/ContactsMapMapLibre-ChNfqbt-.js b/frontend/dist/assets/ContactsMapMapLibre-DqVXnaaM.js similarity index 99% rename from frontend/dist/assets/ContactsMapMapLibre-ChNfqbt-.js rename to frontend/dist/assets/ContactsMapMapLibre-DqVXnaaM.js index fbc503fb..bf8fba53 100644 --- a/frontend/dist/assets/ContactsMapMapLibre-ChNfqbt-.js +++ b/frontend/dist/assets/ContactsMapMapLibre-DqVXnaaM.js @@ -1,4 +1,4 @@ -import{d as L0,al as na,r as j,fA as sa,cm as ia,de as oa,df as la,j as m,aA as fo,dg as aa,aB as ho,m as qt,Y as Hr,c as zr,a0 as Gn,L as s0,Z as hr,fB as Un,fC as mo,fD as ua,cc as ca,ci as fa,ck as ha,an as po,aC as go,A as v0,b as gr,B as Lt,dv as da,ce as ls,D as Ls,S as Ns,dl as yo,q as xo,cS as wo,a8 as vo,bK as Gr,bG as ai,fE as bo,N as ma,a4 as pa,du as ga,fF as ya,ax as ko,bQ as ui,bS as xa,$ as Vn,a1 as Wn,cg as wa,b9 as va,eK as Co,fG as ba,cl as ka,fH as Ca,fI as Ea,aP as Eo,R as mt,fJ as Sa,fK as So,am as pr,cv as Ma,fL as Mo,fM as Bo,c4 as Ba,fy as Da,c7 as _a,dj as Do,dm as Ta,a9 as ja,fN as Ra,eW as Ia,fO as as,fP as La}from"./index-DZK2INMD.js";import{u as q0,S as I0,L as Zt,M as Na,b as Fa,B as Pa}from"./BasemapLayer-DFBOwIT2.js";import{u as _o,r as To,e as ci,f as fi,g as Qa}from"./consumer-registry-C58OO1Zb.js";import{L as Fn,c as Oa}from"./link-scoring-D2b5sONh.js";import{C as za}from"./ConfirmModal-CkTTKNiq.js";import{b as Ha,e as Ga,a as jo,m as hi,s as Ua,G as xs,f as Va,M as Wa,E as Ya,u as Ka,c as $a,h as Za,i as qa,j as Ja}from"./max-BIfJ_m_6.js";import{D as Ro}from"./download-7zuVGrrm.js";import{D as Xa}from"./database-DWx780B3.js";import{H as Au,A as un,D as di,p as eu,c as tu,u as or}from"./useMapViewStore-DGeq1iXE.js";import{R as Io}from"./refresh-cw-DzrjsyBC.js";import{E as Lo}from"./target-CMbN1GDb.js";import{F as ru}from"./funnel-ClRHq7Ic.js";import{P as nu}from"./plus-Dm1LTbFN.js";import{C as su,a as No,b as ws,c as iu}from"./easing-D7lsSq8M.js";import{Z as ou}from"./zap-CV3qJZPu.js";import{T as lu}from"./trash-2-B1qiliQL.js";import{W as au}from"./wifi-off-Dpiws8OL.js";import{W as uu}from"./wifi-DPjA-ySX.js";import{C as Fo}from"./clock-CZYZYW0y.js";import{C as cu}from"./chevron-right-DYHNTpxG.js";import{T as fu,P as Po,R as hu}from"./Contacts-DVusfR1A.js";import{L as du}from"./LightSparkline-D9e7Om82.js";import{H as On,C as i0,N as mu,a as pu}from"./badge-colors-BNUqIXCA.js";import{M as gu}from"./map-pin-qwXb-K8z.js";import{c as mi}from"./node-types-Cj1JOOlq.js";import"./triangle-alert-z32LI9zM.js";import"./index-C-Mp31KV.js";import"./usePipelineStore-BRm0f890.js";import"./ping-BIr2soBi.js";import"./PageLayout-F1v-IzhG.js";import"./listbox-DR8wL7aQ.js";import"./element-movement-BZO5MqZi.js";import"./MqttModeBadge-CK543WcH.js";import"./chat-utils-B9fA4l9w.js";import"./SignalIndicator-BlRL2nuG.js";import"./CollisionExplorerModal-Cb8lVNAn.js";import"./monitor-smartphone-BKehVovy.js";import"./DataBox-BEDP2Kxh.js";import"./circle-question-mark-BdE_X9p5.js";import"./network-CfluO-Ty.js";import"./arrow-right-BW1lsEoU.js";import"./activity-F7Po-3Al.js";import"./search-DRsZhueb.js";/** +import{d as L0,al as na,r as j,fA as sa,cm as ia,de as oa,df as la,j as m,aA as fo,dg as aa,aB as ho,m as qt,Y as Hr,c as zr,a0 as Gn,L as s0,Z as hr,fB as Un,fC as mo,fD as ua,cc as ca,ci as fa,ck as ha,an as po,aC as go,A as v0,b as gr,B as Lt,dv as da,ce as ls,D as Ls,S as Ns,dl as yo,q as xo,cS as wo,a8 as vo,bK as Gr,bG as ai,fE as bo,N as ma,a4 as pa,du as ga,fF as ya,ax as ko,bQ as ui,bS as xa,$ as Vn,a1 as Wn,cg as wa,b9 as va,eK as Co,fG as ba,cl as ka,fH as Ca,fI as Ea,aP as Eo,R as mt,fJ as Sa,fK as So,am as pr,cv as Ma,fL as Mo,fM as Bo,c4 as Ba,fy as Da,c7 as _a,dj as Do,dm as Ta,a9 as ja,fN as Ra,eW as Ia,fO as as,fP as La}from"./index-B9Nfzawy.js";import{u as q0,S as I0,L as Zt,M as Na,b as Fa,B as Pa}from"./BasemapLayer--gGy0d8r.js";import{u as _o,r as To,e as ci,f as fi,g as Qa}from"./consumer-registry-B_rYsmHo.js";import{L as Fn,c as Oa}from"./link-scoring-353AdDOu.js";import{C as za}from"./ConfirmModal-CsrIdG-V.js";import{b as Ha,e as Ga,a as jo,m as hi,s as Ua,G as xs,f as Va,M as Wa,E as Ya,u as Ka,c as $a,h as Za,i as qa,j as Ja}from"./max-BFwmL_H9.js";import{D as Ro}from"./download-BaEmSLqY.js";import{D as Xa}from"./database-CSUiI1CG.js";import{H as Au,A as un,D as di,p as eu,c as tu,u as or}from"./useMapViewStore-CAlaFCdd.js";import{R as Io}from"./refresh-cw-hB3ADAmy.js";import{E as Lo}from"./target-74Dm2pEA.js";import{F as ru}from"./funnel-DOec69-r.js";import{P as nu}from"./plus-B7jylh_n.js";import{C as su,a as No,b as ws,c as iu}from"./easing-VuIK-HqT.js";import{Z as ou}from"./zap-DME89Nfc.js";import{T as lu}from"./trash-2-BxrPvo_t.js";import{W as au}from"./wifi-off-DoZXnx54.js";import{W as uu}from"./wifi-BpM3uttU.js";import{C as Fo}from"./clock-CCOO2GB9.js";import{C as cu}from"./chevron-right-jwX-OOTu.js";import{T as fu,P as Po,R as hu}from"./Contacts-DgMcpPLG.js";import{L as du}from"./LightSparkline-DTXOFhS4.js";import{H as On,C as i0,N as mu,a as pu}from"./badge-colors-BNUqIXCA.js";import{M as gu}from"./map-pin-Z2xK57U6.js";import{c as mi}from"./node-types-D2DQet2e.js";import"./triangle-alert-_KPqiYkd.js";import"./index-CHkxpv0k.js";import"./usePipelineStore-Dto_OrsT.js";import"./ping-kFEBCmQp.js";import"./PageLayout-Da0xfaXb.js";import"./listbox-DV2L-QZw.js";import"./element-movement-C8Yd7NWa.js";import"./MqttModeBadge-Bgn-nTpu.js";import"./chat-utils-CXtTpLY5.js";import"./SignalIndicator-BAKXIHs1.js";import"./CollisionExplorerModal-J7HE0WX3.js";import"./monitor-smartphone-zVB5GYa6.js";import"./DataBox-CCBd3sT4.js";import"./circle-question-mark-Br2ku42v.js";import"./network-BCB-csrZ.js";import"./arrow-right-BbRfzTpf.js";import"./activity-CcUqK62Y.js";import"./search-BrfwwyYC.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -122,4 +122,4 @@ set direct.txdelay ${D.toFixed(1)}`;await Wn(L),T(!0),setTimeout(()=>T(!1),1500) `),Qe=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Xe=new Map;function Be(d){var w=Xe.get(d);if(w===void 0){if(!Qe.test(d))throw Error(c(65,d));w=E("<"+d),Xe.set(d,w)}return w}var Ge=E("");function ot(d,w,B,F,tA){switch(w){case"select":d.push(Be("select"));var X=null,dA=null;for(we in B)if(O.call(B,we)){var BA=B[we];if(BA!=null)switch(we){case"children":X=BA;break;case"dangerouslySetInnerHTML":dA=BA;break;case"defaultValue":case"value":break;default:Ee(d,F,we,BA)}}return d.push(Me),Ze(d,dA,X),X;case"option":dA=tA.selectedValue,d.push(Be("option"));var te=BA=null,ke=null,we=null;for(X in B)if(O.call(B,X)){var We=B[X];if(We!=null)switch(X){case"children":BA=We;break;case"selected":ke=We;break;case"dangerouslySetInnerHTML":we=We;break;case"value":te=We;default:Ee(d,F,X,We)}}if(dA!=null)if(B=te!==null?""+te:Je(BA),CA(dA)){for(F=0;F"),Jt=E(''),N0=E(""),J0=E(''),Ut=E(""),E0=E(""),X0=E("");function pA(d,w,B){if(x(d,J0),B===null)throw Error(c(395));return x(d,B),C(d,C0)}var f0=E('"),o0=E('"),Ct=E('"),Pt=E(''),rA=E(""),gA=E(''),xA=E(""),t=E(''),ge=E(""),De=E(''),$A=E("");function xe(d,w,B,F){switch(B.insertionMode){case 0:case 1:return x(d,f0),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,ut);case 2:return x(d,o0),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,qe);case 3:return x(d,Ct),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,A0);case 4:return x(d,Pt),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,pt);case 5:return x(d,gA),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,RA);case 6:return x(d,t),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,b);case 7:return x(d,De),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,Ve);default:throw Error(c(397))}}function lt(d,w){switch(w.insertionMode){case 0:case 1:return C(d,Pe);case 2:return C(d,vt);case 3:return C(d,bt);case 4:return C(d,rA);case 5:return C(d,xA);case 6:return C(d,ge);case 7:return C(d,$A);default:throw Error(c(397))}}var _e=E('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),ie=E('$RS("'),rt=E('","'),Qt=E('")<\/script>'),h0=E('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),gt=E('$RC("'),Te=E('","'),at=E('")<\/script>'),Ne=E('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),et=E('$RX("'),P0=E('"'),yt=E(")<\/script>"),ZA=E(","),S=/[<\u2028\u2029]/g;function OA(d){return JSON.stringify(d).replace(S,function(w){switch(w){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var Ot=Object.assign,S0=Symbol.for("react.element"),l0=Symbol.for("react.portal"),a0=Symbol.for("react.fragment"),M0=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),Et=Symbol.for("react.provider"),d0=Symbol.for("react.context"),m0=Symbol.for("react.forward_ref"),Q0=Symbol.for("react.suspense"),B0=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),_=Symbol.for("react.scope"),P=Symbol.for("react.debug_trace_mode"),J=Symbol.for("react.legacy_hidden"),K=Symbol.for("react.default_value"),aA=Symbol.iterator;function _A(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case a0:return"Fragment";case l0:return"Portal";case k:return"Profiler";case M0:return"StrictMode";case Q0:return"Suspense";case B0:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case d0:return(d.displayName||"Context")+".Consumer";case Et:return(d._context.displayName||"Context")+".Provider";case m0:var w=d.render;return d=d.displayName,d||(d=w.displayName||w.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case h:return w=d.displayName||null,w!==null?w:_A(d.type)||"Memo";case v:w=d._payload,d=d._init;try{return _A(d(w))}catch{}}return null}var XA={};function Ae(d,w){if(d=d.contextTypes,!d)return XA;var B={},F;for(F in d)B[F]=w[F];return B}var fe=null;function Ue(d,w){if(d!==w){d.context._currentValue=d.parentValue,d=d.parent;var B=w.parent;if(d===null){if(B!==null)throw Error(c(401))}else{if(B===null)throw Error(c(401));Ue(d,B)}w.context._currentValue=w.value}}function St(d){d.context._currentValue=d.parentValue,d=d.parent,d!==null&&St(d)}function Mt(d){var w=d.parent;w!==null&&Mt(w),d.context._currentValue=d.value}function xt(d,w){if(d.context._currentValue=d.parentValue,d=d.parent,d===null)throw Error(c(402));d.depth===w.depth?Ue(d,w):xt(d,w)}function je(d,w){var B=w.parent;if(B===null)throw Error(c(402));d.depth===B.depth?Ue(d,B):je(d,B),w.context._currentValue=w.value}function Bt(d){var w=fe;w!==d&&(w===null?Mt(d):d===null?St(w):w.depth===d.depth?Ue(w,d):w.depth>d.depth?xt(w,d):je(w,d),fe=d)}var p0={isMounted:function(){return!1},enqueueSetState:function(d,w){d=d._reactInternals,d.queue!==null&&d.queue.push(w)},enqueueReplaceState:function(d,w){d=d._reactInternals,d.replace=!0,d.queue=[w]},enqueueForceUpdate:function(){}};function u0(d,w,B,F){var tA=d.state!==void 0?d.state:null;d.updater=p0,d.props=B,d.state=tA;var X={queue:[],replace:!1};d._reactInternals=X;var dA=w.contextType;if(d.context=typeof dA=="object"&&dA!==null?dA._currentValue:F,dA=w.getDerivedStateFromProps,typeof dA=="function"&&(dA=dA(B,tA),tA=dA==null?tA:Ot({},tA,dA),d.state=tA),typeof w.getDerivedStateFromProps!="function"&&typeof d.getSnapshotBeforeUpdate!="function"&&(typeof d.UNSAFE_componentWillMount=="function"||typeof d.componentWillMount=="function"))if(w=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),w!==d.state&&p0.enqueueReplaceState(d,d.state,null),X.queue!==null&&0>=dA,tA-=dA,{id:1<<32-D0(w)+tA|B<>>=0,d===0?32:31-(er(d)/tr|0)|0}function Vr(d,w){return d===w&&(d!==0||1/d===1/w)||d!==d&&w!==w}var Wr=typeof Object.is=="function"?Object.is:Vr,zt=null,rr=null,g0=null,Fe=null,y0=!1,_0=!1,H=0,sA=null,yA=0;function LA(){if(zt===null)throw Error(c(321));return zt}function WA(){if(0d.progressiveChunkSize)F.rootSegmentID=d.nextSegmentId++,d.completedBoundaries.push(F),pA(w,d.responseState,F.id),Er(d,w,B);else{if(C(w,N0),B=F.completedSegments,B.length!==1)throw Error(c(391));Sr(d,w,B[0])}return C(w,E0)}function nr(d,w,B){return xe(w,d.responseState,B.formatContext,B.id),Sr(d,w,B),lt(w,B.formatContext)}function gn(d,w,B){for(var F=B.completedSegments,tA=0;tA=p1?2:y>=m1?1:0}const $t=2,y1=Ho*$t,eo=Cs*$t;function x1(u){const c=Un(),g=(Q,D,E=0,L=!1)=>{const O=y1,z=document.createElement("canvas");z.width=O,z.height=O;const $=z.getContext("2d",L?{colorSpace:"display-p3"}:void 0),V=O/2,AA=O/2,oA=O/2-2-E/2;return $.beginPath(),$.arc(V,AA,oA,0,Math.PI*2),$.fillStyle=Q,$.fill(),D&&E>0&&($.strokeStyle=D,$.lineWidth=E*$t,$.stroke()),$.shadowColor="rgba(0,0,0,0.3)",$.shadowBlur=2*$t,$.shadowOffsetY=1*$t,{data:$.getImageData(0,0,O,O),pixelRatio:$t}},y=(Q,D=!1)=>{const E=eo,L=document.createElement("canvas");L.width=E,L.height=E;const O=L.getContext("2d",D?{colorSpace:"display-p3"}:void 0),z=E/2,$=E/2,V=Cs*.35*$t;return O.strokeStyle=Q,O.lineWidth=2.5*$t,O.lineCap="round",O.lineJoin="round",O.beginPath(),O.moveTo(z-V,$),O.lineTo(z,$-V),O.lineTo(z+V,$),O.stroke(),O.beginPath(),O.moveTo(z-V*.7,$),O.lineTo(z-V*.7,$+V*.7),O.lineTo(z+V*.7,$+V*.7),O.lineTo(z+V*.7,$),O.stroke(),O.beginPath(),O.moveTo(z-V*.2,$+V*.7),O.lineTo(z-V*.2,$+V*.2),O.lineTo(z+V*.2,$+V*.2),O.lineTo(z+V*.2,$+V*.7),O.stroke(),{data:O.getImageData(0,0,E,E),pixelRatio:$t}},x=(Q,D)=>{const E=eo,L=document.createElement("canvas");L.width=E,L.height=E;const O=L.getContext("2d"),z=E/2,$=E/2,V=Cs*.35*$t;return O.strokeStyle=Q,O.lineWidth=2.5*$t,O.lineCap="round",O.lineJoin="round",D&&(O.fillStyle=D),O.beginPath(),O.roundRect(z-V,$-V*.6,V*1.6,V*1.2,3*$t),D&&O.fill(),O.stroke(),O.beginPath(),O.moveTo(z-V*.3,$+V*.6),O.lineTo(z-V*.6,$+V),O.lineTo(z,$+V*.6),O.stroke(),{data:O.getImageData(0,0,E,E),pixelRatio:$t}},C="#00FF00",T={[Re.standard]:g(c.nodeFill),[Re.standardNeighbor]:g(c.neighborColor),[Re.hub]:g(c.hubColor),[Re.hubNeighbor]:g(c.neighborColor),[Re.gateway]:g(c.gatewayColor),[Re.gatewayNeighbor]:g(c.neighborColor),[Re.mobile]:g("transparent",c.mobileColor,2.5),[Re.mobileNeighbor]:g(c.neighborColor),[Re.roomServer]:x(c.roomColor),[Re.roomServerNeighbor]:x(c.neighborColor,"#1a1a1c"),[Re.local]:y(c.localColor),[Re.stale5Day]:g(Ao.tier1),[Re.stale10Day]:g(Ao.tier2),[Re.blinkBlack]:g("#000000"),[Re.blinkBlackLocal]:y("#000000"),[Re.blink]:g(C,void 0,0,!0),[Re.blinkLocal]:y(C,!0)};for(const[Q,D]of Object.entries(T))try{u.hasImage(Q)&&u.removeImage(Q),u.addImage(Q,D.data,{pixelRatio:D.pixelRatio})}catch{}}function to(u){var g;const c=(g=u.contact_type)==null?void 0:g.toLowerCase();return c==="room server"||c==="room_server"||c==="room"||c==="server"}function ro(u){return u.startsWith("0x")?u.slice(2,4).toUpperCase():u.slice(0,2).toUpperCase()}function w1({neighborsWithLocation:u,localNode:c,localHash:g,zeroHopNeighbors:y,lastHopNeighborMap:x,meshTopology:C,hoveredMarker:T,onMarkerHover:Q,getNodeOpacity:D,shouldShowNode:E,openPopupId:L,onOpenPopup:O,onClosePopup:z,onNodeClick:$,blinkingNodes:V}){const{current:AA}=q0(),oA=j.useRef(!1),[eA,Y]=j.useState(!1);j.useEffect(()=>{var KA;const uA=(KA=AA==null?void 0:AA.getMap)==null?void 0:KA.call(AA);if(!uA)return;const hA=()=>{try{x1(uA),oA.current=!0,eA||Y(!0)}catch(UA){console.warn("Failed to load node marker icons:",UA)}};uA.isStyleLoaded()?hA():uA.once("style.load",hA);const jA=()=>{uA.hasImage(Re.standard)||hA()};uA.on("styledata",jA);const MA=()=>{oA.current=!1,hA()},VA=new MutationObserver(UA=>{for(const Ie of UA)if(Ie.attributeName==="data-theme"){setTimeout(MA,100);break}});VA.observe(document.documentElement,{attributes:!0});const ue=document.querySelector("[data-basemap]");let JA=null;return ue&&(JA=new MutationObserver(UA=>{for(const Ie of UA)if(Ie.attributeName==="data-basemap"){setTimeout(MA,100);break}}),JA.observe(ue,{attributes:!0})),()=>{uA.off("styledata",jA),VA.disconnect(),JA==null||JA.disconnect()}},[AA,eA]);const cA=j.useMemo(()=>{var jA;const uA=[],hA=[...u].sort(([MA,VA],[ue,JA])=>{const KA=(UA,Ie)=>{var Le;return to(Ie)?5e3:y.has(UA)?3e3:C.hubNodes.includes(UA)?2e3:(Le=C.gatewayNodes)!=null&&Le.includes(UA)?1e3:0};return KA(MA,VA)-KA(ue,JA)});for(const[MA,VA]of hA){if(!VA.latitude||!VA.longitude)continue;if(g){const Ze=g.startsWith("0x")?g.slice(2,4).toLowerCase():g.slice(0,2).toLowerCase(),Je=MA.startsWith("0x")?MA.slice(2,4).toLowerCase():MA.slice(0,2).toLowerCase();if(Ze===Je||MA===g)continue}const ue=E(MA),JA=D(MA,ue);if(JA<=.01)continue;const KA=y.has(MA),UA=C.hubNodes.includes(MA),Ie=((jA=C.gatewayNodes)==null?void 0:jA.includes(MA))??!1,Le=C.mobileNodes.includes(MA),se=to(VA),pe=C.centrality.get(MA)||0,be=x.get(MA),$e=VA.last_seen||(be==null?void 0:be.lastSeen),Ce=g1($e),Ee=Ce>0;let Me=JA;Ce===2?Me=Math.min(JA,.25):Ce===1&&(Me=Math.min(JA,.5));let ye="standard";se?ye="roomServer":UA?ye="hub":Ie?ye="gateway":Le&&(ye="mobile"),uA.push({type:"Feature",geometry:{type:"Point",coordinates:[VA.longitude,VA.latitude]},properties:{hash:MA,name:VA.node_name||VA.name||"Unknown",hashPrefix:ro(MA),iconType:ye,isNeighbor:KA,isHub:UA,isGateway:Ie,isMobile:Le,isRoomServer:se,isStale:Ee,staleTier:Ce,isZeroHop:KA,opacity:Me,blinkIntensity:0,lastSeenTimestamp:$e,centrality:pe}})}return{type:"FeatureCollection",features:uA}},[u,g,y,x,C,D,E]),lA=j.useMemo(()=>!(c!=null&&c.latitude)||!(c!=null&&c.longitude)?{type:"FeatureCollection",features:[]}:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[c.longitude,c.latitude]},properties:{hash:"local",name:c.name,hashPrefix:g?ro(g):"",iconType:"local",isNeighbor:!1,isHub:!1,isGateway:!1,isMobile:!1,isRoomServer:!1,isStale:!1,staleTier:0,isZeroHop:!1,opacity:1,blinkIntensity:0,centrality:0}}]},[c,g]),bA=j.useRef(L);j.useEffect(()=>{bA.current=L},[L]);const iA=j.useCallback(uA=>{var MA;if(!uA.features||uA.features.length===0)return;const jA=(MA=uA.features[0].properties)==null?void 0:MA.hash;jA&&(bA.current===jA?z==null||z():O&&O(jA),$&&jA!=="local"&&$(jA))},[O,z,$]),fA=j.useCallback(uA=>{var MA,VA;if(!uA.features||uA.features.length===0)return;const hA=(MA=AA==null?void 0:AA.getMap)==null?void 0:MA.call(AA);hA&&(hA.getCanvas().style.cursor="pointer");const jA=(VA=uA.features[0].properties)==null?void 0:VA.hash;jA&&Q(jA)},[AA,Q]),DA=j.useCallback(()=>{var hA;const uA=(hA=AA==null?void 0:AA.getMap)==null?void 0:hA.call(AA);uA&&(uA.getCanvas().style.cursor=""),Q(null)},[AA,Q]);j.useEffect(()=>{var jA;const uA=(jA=AA==null?void 0:AA.getMap)==null?void 0:jA.call(AA);if(!uA||!eA)return;const hA=[_s,Ts];for(const MA of hA)uA.on("click",MA,iA),uA.on("mouseenter",MA,fA),uA.on("mouseleave",MA,DA);return()=>{for(const MA of hA)uA.off("click",MA,iA),uA.off("mouseenter",MA,fA),uA.off("mouseleave",MA,DA)}},[AA,eA,iA,fA,DA]);const TA=j.useRef(cA),CA=j.useRef(lA);j.useEffect(()=>{TA.current=cA,CA.current=lA},[cA,lA]),j.useEffect(()=>{var MA;const uA=(MA=AA==null?void 0:AA.getMap)==null?void 0:MA.call(AA);if(!uA||!eA||!V||V.size===0)return;const hA=uA.getSource(ln),jA=uA.getSource(`${ln}-local`);if(!(!hA&&!jA)){if(hA){const VA=TA.current;let ue=!1;const JA=VA.features.map(KA=>{const UA=V.get(KA.properties.hash)??0;return UA!==KA.properties.blinkIntensity?(ue=!0,{...KA,properties:{...KA.properties,blinkIntensity:UA}}):KA});ue&&hA.setData({type:"FeatureCollection",features:JA})}if(jA&&g){const VA=V.get(g)??0,ue=CA.current;ue.features.length>0&&ue.features[0].properties.blinkIntensity!==VA&&jA.setData({type:"FeatureCollection",features:[{...ue.features[0],properties:{...ue.features[0].properties,blinkIntensity:VA}}]})}}},[AA,eA,V,g]);const mA=j.useMemo(()=>{if(!L)return{type:"FeatureCollection",features:[]};if(L==="local"&&(c!=null&&c.latitude)&&(c!=null&&c.longitude))return{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[c.longitude,c.latitude]},properties:{hash:"local"}}]};const uA=cA.features.find(hA=>hA.properties.hash===L);return uA?{type:"FeatureCollection",features:[{type:"Feature",geometry:uA.geometry,properties:{hash:uA.properties.hash}}]}:{type:"FeatureCollection",features:[]}},[L,c,cA]);if(!eA)return null;const NA=Un().localColor||"#F59E0B",FA=["case",[">",["get","blinkIntensity"],.66],Re.blink,[">",["get","blinkIntensity"],.33],Re.blinkBlack,["==",["get","staleTier"],2],Re.stale10Day,["==",["get","staleTier"],1],Re.stale5Day,["==",["get","iconType"],"roomServer"],["case",["get","isNeighbor"],Re.roomServerNeighbor,Re.roomServer],["==",["get","iconType"],"hub"],["case",["get","isNeighbor"],Re.hubNeighbor,Re.hub],["==",["get","iconType"],"gateway"],["case",["get","isNeighbor"],Re.gatewayNeighbor,Re.gateway],["==",["get","iconType"],"mobile"],["case",["get","isNeighbor"],Re.mobileNeighbor,Re.mobile],["case",["get","isNeighbor"],Re.standardNeighbor,Re.standard]],GA=["interpolate",["linear"],["zoom"],Xi,.25,Ji,1],vA=["get","opacity"];return m.jsxs(m.Fragment,{children:[m.jsx(I0,{id:ln,type:"geojson",data:cA,children:m.jsx(Zt,{id:_s,type:"symbol",layout:{"icon-image":FA,"icon-size":GA,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"symbol-sort-key":["get","opacity"]},paint:{"icon-opacity":vA}})}),m.jsx(I0,{id:`${ln}-local`,type:"geojson",data:lA,children:m.jsx(Zt,{id:Ts,type:"symbol",layout:{"icon-image":["case",[">",["get","blinkIntensity"],.66],Re.blinkLocal,[">",["get","blinkIntensity"],.33],Re.blinkBlackLocal,Re.local],"icon-size":GA,"icon-allow-overlap":!0,"icon-ignore-placement":!0},paint:{"icon-opacity":1}})}),m.jsx(I0,{id:`${ln}-selection`,type:"geojson",data:mA,children:m.jsx(Zt,{id:"node-markers-selection-ring",type:"circle",paint:{"circle-radius":["interpolate",["linear"],["zoom"],Xi,4,Ji,14],"circle-color":"transparent","circle-stroke-color":NA,"circle-stroke-width":2.5,"circle-stroke-opacity":.85}})})]})}const v1=[_s,Ts],js="topology-validated-edges-native",Rs="topology-weak-edges-native",Is="neighbor-edges-native",no="topology-weak-edges-native",Nn="topology-validated-edges-native",gs="neighbor-edges-native",ys={type:"FeatureCollection",features:[]},an={"line-cap":"round","line-join":"round"},so={"line-color":"transparent","line-width":16,"line-opacity":0};function b1(u,c,g,y,x,C){const T=Fs(),Q=u!==null,D=x&&x.size>0,E=C&&C.size>0,L=D?Array.from(x):[],O=E?Array.from(C):[],z=c,$=.5,AA=(()=>{if(z<=0)return["get","baseColor"];const IA=1-z*.5;return["case",[">=",["get","brightnessScore"],IA],"#FFFFFF",["get","baseColor"]]})(),eA=z<=0?1:["max",.1,["+",1,["*",z,3,["-",["get","brightnessScore"],$]]]],cA=D?["in",["get","key"],["literal",L]]:E?["in",["get","key"],["literal",O]]:Q?["==",["get","key"],u]:!1,lA=Q||D||E,bA=T.edges.hoverLoop,iA=T.edges.highlight;return{"line-color":lA?["case",cA,D?bA:E?iA:["get","hoverColor"],AA]:AA,"line-width":lA?["case",cA,["max",["*",["get","baseWidth"],g,1.3],3.5],["*",["get","baseWidth"],g]]:["*",["get","baseWidth"],g],"line-opacity":["case",["<",["get","brightnessScore"],y],0,lA?["case",cA,["min",["*",["get","baseOpacity"],1.25],1],["*",["get","baseOpacity"],eA,.35]]:["*",["get","baseOpacity"],eA]]}}const k1=10,C1=6;function E1(u){const c=u!==null,{YELLOW:g,GREEN:y,RED:x,GRAY:C}=Fn,T=["to-number",["get","listenerScore"],0],Q=["to-number",["get","loudScore"],0],E=["/",T,["max",["+",T,Q],1]],L=["case",["all",["==",T,0],["==",Q,0]],C,[">=",E,.97],y,["<=",E,.03],x,["interpolate",["linear"],E,.03,x,.5,g,.97,y]],O=.2,oA=["*",["+",O,["*",["to-number",["get","trafficWeight"],0],1-O]],8],eA=5,Y=c?["case",["==",["get","key"],u],["max",oA,eA],oA]:oA,cA=c?["case",["==",["get","key"],u],["max",["*",oA,.25],eA*.25],["*",oA,.25]]:["*",oA,.25];return{"line-color":L,"line-width":["interpolate",["linear"],["zoom"],C1,cA,k1,Y],"line-opacity":c?["case",["==",["get","key"],u],1,.35]:.9}}function S1({showTopology:u,isExiting:c,hoveredEdgeKey:g,highlightedLoopEdges:y,highlightedFocusEdges:x,onEdgeHover:C,onLoopHover:T,loops:Q=[],neighborNames:D={},opacityBias:E=.5,widthMultiplier:L=1,trafficFilter:O=0,showNeighborLines:z=!0,disableHover:$=!1}){const{current:V}=q0(),AA=u||c,oA=!0,eA=z?"visible":"none",Y=$||c,cA=j.useRef(null),lA=j.useRef(Y),bA=j.useRef(new Map),iA=j.useRef(D),fA=j.useRef(T);j.useLayoutEffect(()=>{lA.current=Y,iA.current=D,fA.current=T});const DA=j.useMemo(()=>Lu(Q),[Q]);j.useLayoutEffect(()=>{bA.current=DA},[DA]);const TA=j.useCallback(vA=>{var MA,VA;if(lA.current||!vA.features||vA.features.length===0)return;const hA=vA.features[0].properties;if(!(hA!=null&&hA.key))return;const jA=hA.key;if(jA!==cA.current){cA.current=jA;const ue=hA.isNeighborEdge===!0||hA.isNeighborEdge==="true",JA=hA.isLoopEdge===!0||hA.isLoopEdge==="true";if(ue){const KA={key:jA,fromName:"Local",toName:hA.name,certainCount:Number(hA.packetCount)||0,confidence:1,isBackbone:!1,isLoopEdge:!1,isDirectPath:!0,isZeroHop:!0,symmetryRatio:1,dominantDirection:"balanced",isHubConnection:!1};C(jA,[vA.lngLat.lng,vA.lngLat.lat],KA),(MA=fA.current)==null||MA.call(fA,null)}else if(JA&&fA.current){const KA=bA.current.get(jA)??[];if(KA.length>0){const UA=new Set;for(const pe of KA)for(const be of pe.edgeKeys)UA.add(be);const Le=KA[0].nodes.map(pe=>iA.current[pe]||pe.substring(0,4)),se={loops:KA,highlightedEdgeKeys:UA,hoveredEdgeKey:jA,nodeNames:Le};fA.current(se,[vA.lngLat.lng,vA.lngLat.lat]),C(jA)}else{const UA={key:jA,fromName:hA.fromName,toName:hA.toName,certainCount:Number(hA.certainCount),confidence:Number(hA.confidence),isBackbone:hA.isBackbone===!0||hA.isBackbone==="true",isLoopEdge:!0,isDirectPath:hA.isDirectPath===!0||hA.isDirectPath==="true",isZeroHop:hA.isZeroHop===!0||hA.isZeroHop==="true",symmetryRatio:Number(hA.symmetryRatio),dominantDirection:hA.dominantDirection,isHubConnection:hA.isHubConnection===!0||hA.isHubConnection==="true"};C(jA,[vA.lngLat.lng,vA.lngLat.lat],UA)}}else{const KA={key:jA,fromName:hA.fromName,toName:hA.toName,certainCount:Number(hA.certainCount),confidence:Number(hA.confidence),isBackbone:hA.isBackbone===!0||hA.isBackbone==="true",isLoopEdge:JA,isDirectPath:hA.isDirectPath===!0||hA.isDirectPath==="true",isZeroHop:hA.isZeroHop===!0||hA.isZeroHop==="true",symmetryRatio:Number(hA.symmetryRatio),dominantDirection:hA.dominantDirection,isHubConnection:hA.isHubConnection===!0||hA.isHubConnection==="true"};C(jA,[vA.lngLat.lng,vA.lngLat.lat],KA),(VA=fA.current)==null||VA.call(fA,null)}}},[C]),CA=j.useCallback(()=>{var vA;cA.current!==null&&(cA.current=null,C(null),(vA=fA.current)==null||vA.call(fA,null))},[C]);j.useEffect(()=>{var MA;const vA=(MA=V==null?void 0:V.getMap)==null?void 0:MA.call(V);if(!vA||!AA)return;const uA="topology-validated-edges-hitarea-native",hA=()=>{try{return vA.getStyle()&&vA.getLayer(uA)}catch{return!1}},jA=()=>hA()?(vA.on("mousemove",uA,TA),vA.on("mouseleave",uA,CA),!0):!1;if(!jA()){const VA=()=>{jA()&&vA.off("styledata",VA)};return vA.on("styledata",VA),()=>{try{vA.off("styledata",VA),hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}}return()=>{try{hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}},[V,AA,TA,CA]),j.useEffect(()=>{var MA;const vA=(MA=V==null?void 0:V.getMap)==null?void 0:MA.call(V);if(!vA||!oA||!z)return;const uA="neighbor-edges-hitarea-native",hA=()=>{try{return vA.getStyle()&&vA.getLayer(uA)}catch{return!1}},jA=()=>hA()?(vA.on("mousemove",uA,TA),vA.on("mouseleave",uA,CA),!0):!1;if(!jA()){const VA=()=>{jA()&&vA.off("styledata",VA)};return vA.on("styledata",VA),()=>{try{vA.off("styledata",VA),hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}}return()=>{try{hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}},[V,oA,z,TA,CA]),j.useEffect(()=>{var JA;const vA=(JA=V==null?void 0:V.getMap)==null?void 0:JA.call(V);if(!vA)return;let uA=null;const hA=(KA,UA)=>{try{if(vA.getLayer(KA)&&vA.getLayer(UA))return vA.moveLayer(KA,UA),!0}catch{}return!1},jA=()=>{try{if(!vA.getLayer("node-markers-layer"))return;hA(gs,"node-markers-layer"),hA("neighbor-edges-hitarea-native",gs),(hA(Nn,"neighbor-edges-hitarea-native")||hA(Nn,"node-markers-layer"))&&hA("topology-validated-edges-hitarea-native",Nn),hA(no,"topology-validated-edges-hitarea-native")}catch{}},MA=()=>{uA&&clearTimeout(uA),uA=setTimeout(jA,50)},VA=setTimeout(jA,100);vA.on("styledata",MA);const ue=KA=>{(KA.sourceId===js||KA.sourceId===Rs||KA.sourceId===Is)&&MA()};return vA.on("sourcedata",ue),()=>{clearTimeout(VA),uA&&clearTimeout(uA);try{vA.off("styledata",MA),vA.off("sourcedata",ue)}catch{}}},[V,AA,oA,z]);const mA=Y?null:g,FA=b1(mA,E,L,O,Y?null:y,x??null),GA=E1(mA);return m.jsxs(m.Fragment,{children:[AA&&m.jsx(I0,{id:Rs,type:"geojson",data:ys,children:m.jsx(Zt,{id:no,type:"line",paint:FA,layout:{...an,visibility:eA}})}),AA&&m.jsxs(I0,{id:js,type:"geojson",data:ys,children:[m.jsx(Zt,{id:"topology-validated-edges-hitarea-native",type:"line",paint:so,layout:{...an,visibility:eA}}),m.jsx(Zt,{id:Nn,type:"line",paint:FA,layout:{...an,visibility:eA}})]}),m.jsxs(I0,{id:Is,type:"geojson",data:ys,children:[m.jsx(Zt,{id:"neighbor-edges-hitarea-native",type:"line",paint:so,layout:{...an,visibility:eA}}),m.jsx(Zt,{id:gs,type:"line",paint:GA,layout:{...an,visibility:eA}})]})]})}const M1=["topology-validated-edges-hitarea-native","topology-validated-edges-native","topology-weak-edges-native","neighbor-edges-hitarea-native","neighbor-edges-native"];function B1({targetHash:u,nodeCoordinates:c,onComplete:g}){const{current:y}=q0(),x=j.useRef(null);return j.useEffect(()=>{if(!y||!u||u===x.current)return;const C=c.get(u);if(!C)return;const T=y.getMap();T.isMoving()&&T.stop(),x.current=u;const[Q,D]=C;y.flyTo({center:[D,Q],zoom:10,duration:2500,essential:!0}),setTimeout(()=>{g==null||g()},2600)},[u,c,y,g]),null}function D1({highlightedEdgeKey:u,validatedPolylines:c,weakPolylines:g,onEnsureTopology:y}){const{current:x}=q0(),C=j.useRef(null);return j.useEffect(()=>{if(!x||!u||u===C.current)return;C.current=u,y();const T=c.find(z=>z.edge.key===u)||g.find(z=>z.edge.key===u);if(!T||x.getMap().isMoving())return;const D=(T.from[0]+T.to[0])/2,E=(T.from[1]+T.to[1])/2,L=x.getZoom(),O=Math.max(L,11);x.easeTo({center:[E,D],zoom:O,duration:500})},[u,c,g,x,y]),null}const io="link-quality-edges",_1="link-quality-edges-layer",Qn="link-quality-edges-hitarea",oo={type:"FeatureCollection",features:[]};function T1(u,c){return uDa(),[]),E=j.useMemo(()=>!u||C.length===0||T.size===0?oo:j1(C,c,g,D,Q),[u,C,T.size,c,g,D,Q]);j.useEffect(()=>{if(!x)return;const O=x.getMap();if(O)try{const z=O.getSource(io);z&&"setData"in z&&(z.setData(E),O.triggerRepaint())}catch{}},[E,x]);const L=u?"visible":"none";return m.jsxs(I0,{id:io,type:"geojson",data:oo,children:[m.jsx(Zt,{id:_1,type:"line",layout:{...lo,visibility:L},paint:R1}),m.jsx(Zt,{id:Qn,type:"line",layout:{...lo,visibility:L},paint:I1})]})}const N1="rgba(167, 139, 250, 0.15)",ao=500,F1=.5,uo=2e3,co=1500,P1=1e3;function Q1(u,c,g,y=64){const x=[],T=g/6371e3*(180/Math.PI),Q=T/Math.cos(c*Math.PI/180);for(let D=0;D<=y;D++){const E=D/y*2*Math.PI,L=u+Q*Math.cos(E),O=c+T*Math.sin(E);x.push([L,O])}return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[x]}}}function O1({ghost:u,neighborCoordinates:c,onHighlightedNeighborsChange:g}){const{current:y}=q0(),x=j.useRef(null),C=j.useRef(null),T=j.useMemo(()=>u?new Set(u.commonNeighbors):new Set,[u]);j.useEffect(()=>{g==null||g(T)},[T,g]);const Q=j.useMemo(()=>{if(!(u!=null&&u.commonNeighbors)||u.commonNeighbors.length<2)return uo*4;let L=0;const O=[];for(const z of u.commonNeighbors){const $=c.get(z);$&&O.push($)}u.estimatedLocation&&O.push([u.estimatedLocation.lat,u.estimatedLocation.lon]);for(let z=0;zL&&(L=V)}return Math.max(L,ao*4)},[u,c]),D=j.useMemo(()=>{if(!(u!=null&&u.estimatedLocation))return{type:"FeatureCollection",features:[]};const{lat:L,lon:O,uncertaintyM:z}=u.estimatedLocation,$=Q*F1,V=z>0?z:uo,AA=Math.max(ao,Math.min(V,$));return{type:"FeatureCollection",features:[Q1(O,L,AA)]}},[u,Q]);if(j.useEffect(()=>{if(!y)return;const L=y.getMap();if(u&&u.prefix!==C.current){if(C.current=u.prefix,!x.current&&L.getZoom()>3){const z=L.getCenter();x.current={center:[z.lng,z.lat],zoom:L.getZoom(),pitch:L.getPitch(),bearing:L.getBearing()}}const O=[];for(const z of u.commonNeighbors){const $=c.get(z);$&&O.push([$[1],$[0]])}if(u.estimatedLocation&&O.push([u.estimatedLocation.lon,u.estimatedLocation.lat]),O.length>0){const z=()=>{var $;if(L.isMoving()){setTimeout(z,100);return}if(O.length===1)y.flyTo({center:O[0],zoom:13,duration:co});else{let V=1/0,AA=-1/0,oA=1/0,eA=-1/0;for(const[Y,cA]of O)V=Math.min(V,Y),AA=Math.max(AA,Y),oA=Math.min(oA,cA),eA=Math.max(eA,cA);if(($=u.estimatedLocation)!=null&&$.uncertaintyM){const Y=u.estimatedLocation.uncertaintyM/111e3;V-=Y,AA+=Y,oA-=Y,eA+=Y}y.fitBounds([[V,oA],[AA,eA]],{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,duration:co})}};setTimeout(z,50)}}if(!u&&C.current!==null&&(C.current=null,x.current)){const O=x.current,z=()=>{if(L.isMoving()){setTimeout(z,100);return}y.flyTo({center:O.center,zoom:O.zoom,pitch:O.pitch,bearing:O.bearing,duration:P1}),x.current=null};setTimeout(z,50)}},[u,y,c]),!(u!=null&&u.estimatedLocation))return null;const E={"fill-color":N1,"fill-opacity":.8};return m.jsx(I0,{id:"ghost-uncertainty-circle",type:"geojson",data:D,children:m.jsx(Zt,{id:"ghost-uncertainty-fill",type:"fill",paint:E})})}const il=[{target:"Map",fn:"gps",minStage:1,when:ci},{target:"Map",fn:"_advertNodeType",minStage:1,when:ci},{target:"Topology",fn:"traceHops",minStage:1,when:fi},{target:"Topology",fn:"path.entries",minStage:1,when:Qa},{target:"Topology",fn:"traceSrc",minStage:1,when:fi}];To(il);const z1={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},H1={longitude:0,latitude:0,zoom:2};function G1(u,c,g,y){return Do(u,c,g,y)/1e3}function U1(u,c){if(u.length<=2)return u;let g,y;if(c!=null&&c.latitude&&(c!=null&&c.longitude))g=c.latitude,y=c.longitude;else{let E=0,L=0;for(const[O,z]of u)E+=O,L+=z;g=E/u.length,y=L/u.length}const x=u.map(([E,L])=>({pos:[E,L],dist:G1(g,y,E,L)}));x.sort((E,L)=>E.dist-L.dist);const C=Math.floor(x.length/2),T=x[C].dist,Q=Math.max(T*3,50),D=x.filter(E=>E.dist<=Q).map(E=>E.pos);return D.length0&&(z=Math.floor(Math.log2(360/O*1.2)),z=Math.max(1,Math.min(14,z))),z=Math.min(z+1,12),{longitude:Q,latitude:D,zoom:z}}function W1(u,c,g,y){var x;if(c){const C=c.loops[0],T=c.loops.length,Q=[{label:"hops",value:C.size},{label:"seen",value:C.minCertainCount}],D=[];return C.includesLocal&&D.push({text:"★ Includes your node",color:"text-sys-amber"}),T>1&&D.push({text:`+${T-1} overlapping`,color:"text-sys-indigo/70"}),{type:"loop",title:{icon:"⟳",text:`Redundant Path${T>1?"s":""}`,color:"text-sys-indigo"},subtitle:{text:`${c.nodeNames.join(" → ")} → ${c.nodeNames[0]}`,color:"text-fg-secondary",mono:!0},stats:Q,badges:D}}if((u==null?void 0:u.type)==="neighbor"){const C=u.properties,T=[];C.rssi!==void 0&&C.rssi!==null&&T.push({label:"RSSI",value:`${Math.round(C.rssi)} dBm`,unit:C.hasAvgRssi?"avg":void 0}),C.snr!==void 0&&C.snr!==null&&T.push({label:"SNR",value:`${Number(C.snr).toFixed(1)} dB`,unit:C.hasAvgSnr?"avg":void 0});const Q=C.listenerScore??0,D=C.loudScore??0,E=Q>0||D>0;return E&&(T.push({label:"listener",value:Q,color:"text-sys-green"}),T.push({label:"loud",value:D,color:"text-sys-red"})),C.packetCount!==void 0&&!E&&T.push({label:"packets",value:Number(C.packetCount).toLocaleString()}),{type:"neighbor",title:{icon:"●",text:C.prefix?`${C.name} (${C.prefix})`:C.name,color:"text-sys-amber"},subtitle:{text:"Direct RF Neighbor",color:"text-sys-amber/70"},stats:T,badges:[]}}if((u==null?void 0:u.type)==="topology"){const C=u.properties,T=g>0?Number(C.certainCount)/g:0,Q=[{label:"validations",value:C.certainCount},{label:"of max traffic",value:`${Math.round(T*100)}%`},{label:"confidence",value:`${Math.round(Number(C.confidence)*100)}%`}];if(C.symmetryRatio!==void 0&&C.symmetryRatio<1){const L=C.dominantDirection==="forward"?"→":C.dominantDirection==="reverse"?"←":"↔";Q.push({label:"symmetric",value:`${L} ${Math.round(C.symmetryRatio*100)}%`,color:"text-fg-muted"})}const D=(x=y==null?void 0:y.get(C.key))==null?void 0:x.traceQuality;if(D!=null&&D.composite){const L=D.composite;Q.push({label:"trace SNR",value:`${L.mean.toFixed(1)} dB`,unit:`n=${L.count}`,color:L.mean>=10?"text-sys-green":L.mean>=0?"text-sys-amber":"text-sys-red"}),D.asymmetryDb!=null&&D.asymmetryDb>1&&Q.push({label:"asymmetry",value:`${D.asymmetryDb.toFixed(1)} dB`,color:D.asymmetryDb>5?"text-sys-red":"text-sys-amber"})}const E=[];if(C.isBackbone&&E.push({text:"Backbone",color:"text-zinc-300"}),C.isLoopEdge&&E.push({text:"Redundant",color:"text-sys-indigo"}),C.isDirectPath&&E.push({text:"Direct Path",color:"text-sys-teal"}),D){const L=D.quality==="excellent"||D.quality==="good"?"text-sys-green":D.quality==="fair"?"text-sys-amber":D.quality==="poor"||D.quality==="critical"?"text-sys-red":"text-fg-muted";D.quality!=="unknown"&&E.push({text:`TRACE ${D.quality}`,color:L})}return{type:"topology",title:{icon:"",text:`${C.fromName} ↔ ${C.toName}`,color:"text-fg-primary"},stats:Q,badges:E}}return null}function Y1({data:u}){const c=u.subtitle&&u.type==="loop",g=u.subtitle&&u.type!=="loop";return m.jsxs("div",{className:"w-[540px]",children:[m.jsxs("div",{className:"flex items-center justify-between h-5",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.title.icon&&m.jsx("span",{className:`${u.title.color} text-base leading-none flex-shrink-0`,children:u.title.icon}),m.jsx("span",{className:`${u.title.color} font-semibold text-[13px] truncate`,children:u.title.text}),g&&m.jsx("span",{className:`${u.subtitle.color} text-[11px] flex-shrink-0`,children:u.subtitle.text})]}),u.badges.length>0&&m.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:u.badges.map((y,x)=>m.jsx("span",{className:`${y.color} text-[11px] font-medium`,children:y.text},x))})]}),c&&m.jsx("div",{className:"h-4 mt-0.5 overflow-hidden",children:m.jsx("span",{className:"type-data-xs text-fg-muted truncate block",children:u.subtitle.text})}),m.jsx("div",{className:`flex items-center gap-4 h-4 ${c?"mt-1":"mt-1.5"} text-[11px]`,children:u.stats.map((y,x)=>m.jsxs("span",{className:"whitespace-nowrap",children:[m.jsx("span",{className:`font-mono tabular-nums font-semibold ${y.color??"text-fg-primary"}`,children:y.value}),m.jsx("span",{className:"text-fg-muted ml-1",children:y.label}),y.unit&&m.jsx("span",{className:"text-fg-muted/50 ml-0.5",children:y.unit})]},x))})]})}function Fh({neighbors:u,localNode:c,localHash:g,onRemoveNode:y,selectedNodeHash:x,onNodeSelected:C,highlightedEdgeKey:T,highlightedGhost:Q}){_o(il);const D=j.useRef(null),E=Ta(),L=ja(),O=Eo(),z=Ra(),$=Ia(),V=Bo(),[AA,oA]=j.useState(!1),eA=or(H=>H.viewState),Y=or(H=>H.toggles),cA=or(H=>H.hasAnalyzed),lA=or(H=>H.setViewState),bA=or(H=>H.setToggle),iA=or(H=>H.setHasAnalyzed),fA=or(H=>H.modalMapOpen),DA=as(H=>H.preloadFromNodes),TA=as(H=>H.isLoading),CA=as(H=>H.terrainGrid),mA=g??z,IA=j.useMemo(()=>{const H=[];for(const[,sA]of Object.entries(u))sA.latitude&&sA.longitude&&H.push([sA.latitude,sA.longitude]);return H},[u]),NA=j.useMemo(()=>V1(IA,c),[IA,c]),[FA,GA]=j.useState(()=>eA??NA??H1),vA=j.useCallback(H=>{GA(H),queueMicrotask(()=>lA(H))},[lA]),uA=j.useRef(!!eA);j.useEffect(()=>{!uA.current&&NA&&!eA?(GA(NA),queueMicrotask(()=>lA(NA)),uA.current=!0,setTimeout(()=>oA(!0),50)):eA&&setTimeout(()=>oA(!0),50)},[NA,eA,lA]);const[hA,jA]=j.useState(!1),[MA,VA]=j.useState(()=>Y.showTopology&&!O.topologyLoadComplete?!1:Y.showTopology),[ue,JA]=j.useState(Y.showNeighborLines),[KA,UA]=j.useState(!1),[Ie,Le]=j.useState(Y.showMinCut),[se,pe]=j.useState(rf),[be,$e]=j.useState(Y.show3DTerrain),[Ce,Ee]=j.useState(Y.showLinkQuality),[Me,ye]=j.useState(()=>Y.nodeFilters.length>0?Y.nodeFilters:[...un]),Ze=j.useCallback(H=>{VA(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showTopology",yA)),yA})},[bA]),Je=j.useCallback(H=>{JA(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showNeighborLines",yA)),yA})},[bA]),At=j.useCallback(H=>{Le(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showMinCut",yA)),yA})},[bA]),nt=j.useCallback(H=>{$e(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("show3DTerrain",yA)),yA})},[bA]),kt=j.useCallback(H=>{Ee(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showLinkQuality",yA)),yA})},[bA]),Qe=j.useCallback(H=>{ye(H),queueMicrotask(()=>bA("nodeFilters",H))},[bA]),[Xe,Be]=j.useState(null),[Ge,ot]=j.useState(null),[Ft,k0]=j.useState(null),[Jt,Xt]=j.useState(null),[N0]=j.useState(0),[J0]=j.useState(.5),[C0]=j.useState(0),[Ut,E0]=j.useState(null),[X0,c0]=j.useState(""),[Ar,F0]=j.useState(!1),[pA,f0]=j.useState(!1),[ut,Pe]=j.useState(()=>cA&&!O.topologyLoadComplete?!1:cA);j.useEffect(()=>{if(O.topologyLoadComplete)return;const H=cA&&!ut,sA=Y.showTopology&&!MA;!H&&!sA||queueMicrotask(()=>{H&&iA(!1),sA&&bA("showTopology",!1)})},[cA,Y.showTopology,O.topologyLoadComplete,ut,MA,iA,bA]);const o0=j.useCallback(H=>{Pe(H),queueMicrotask(()=>iA(H))},[iA]),[qe,vt]=j.useState(null),Ct=j.useCallback(H=>vt(H),[]),A0=j.useCallback(()=>vt(null),[]),[,bt]=j.useState(new Set),Pt=cn(H=>H.coveragePoints),pt=cn(H=>H.isVisible),rA=cn(H=>H.brightness),gA=cn(H=>H.openModal),RA=wf(),xA=vf(),t=wo(),b=La(),ge=j.useRef(!1);j.useEffect(()=>{Pt.length>0&&pt&&!ge.current&&(Je(!1),ge.current=!0)},[Pt.length,pt]);const De=j.useRef(null);j.useEffect(()=>{if(x&&x!==De.current){De.current=x;const H=setTimeout(()=>{vt(x)},1250);return()=>clearTimeout(H)}},[x]);const[Ve,$A]=j.useState(null),[xe,lt]=j.useState(null),_e=j.useCallback((H,sA,yA)=>{ot(H),H&&sA&&yA?$A({longitude:sA[0],latitude:sA[1],type:"topology",properties:{key:yA.key,fromName:yA.fromName,toName:yA.toName,certainCount:yA.certainCount,confidence:yA.confidence,isBackbone:yA.isBackbone,isLoopEdge:yA.isLoopEdge,isDirectPath:yA.isDirectPath,isHubConnection:yA.isHubConnection,symmetryRatio:yA.symmetryRatio,dominantDirection:yA.dominantDirection}}):H||$A(null)},[]),ie=j.useCallback((H,sA)=>{lt(H),H&&$A(null)},[]),rt=j.useMemo(()=>{var WA;if(!MA||!Xe||Ge)return null;const H=E.loops;if(H.length===0)return null;const sA=Iu(Xe,H,E.edgeMap);if(sA.loops.length===0)return null;const LA=sA.loops[0].nodes.map(he=>{var oe,Oe;return he===mA?"You":((oe=u[he])==null?void 0:oe.node_name)||((Oe=u[he])==null?void 0:Oe.name)||he.substring(0,4)});return{loops:sA.loops,highlightedEdgeKeys:sA.highlightedEdgeKeys,hoveredEdgeKey:((WA=sA.sortedEdges[0])==null?void 0:WA.key)||"",nodeNames:LA}},[MA,Xe,Ge,E.loops,E.edgeMap,u,mA]);j.useEffect(()=>{Ge||lt(rt)},[rt,Ge]);const Qt=j.useMemo(()=>{const H={};for(const[sA,yA]of Object.entries(u))H[sA]=yA.node_name||yA.name||sA.substring(0,4);return mA&&(H[mA]="You"),H},[u,mA]),h0=j.useMemo(()=>{const H=new Map;for(const[sA,yA]of Object.entries(u)){const LA=sA.slice(0,2).toUpperCase(),WA=yA.node_name||yA.name||LA;H.set(LA,WA)}return mA&&H.set(mA.slice(0,2).toUpperCase(),"You"),H},[u,mA]),gt=j.useMemo(()=>Object.entries(u).filter(([,H])=>H.latitude&&H.longitude),[u]),Te=j.useMemo(()=>{const H=new Map;mA&&(c!=null&&c.latitude)&&(c!=null&&c.longitude)&&H.set(mA,[c.latitude,c.longitude]);for(const[sA,yA]of gt)yA.latitude&&yA.longitude&&H.set(sA,[yA.latitude,yA.longitude]);return H},[mA,c,gt]),at=j.useMemo(()=>{const H=new Map;for(const sA of L)sA.status!=="expired"&&H.set(sA.hash,{hash:sA.hash,prefix:sA.prefix,count:sA.count,avgRssi:sA.avgRssi,avgSnr:sA.avgSnr,lastSeen:sA.lastSeen,confidence:1,status:sA.status});return H},[L]),Ne=j.useMemo(()=>{var sA,yA;const H=new Set;for(const LA of at.keys())(sA=u[LA])!=null&&sA.latitude&&((yA=u[LA])!=null&&yA.longitude)&&H.add(LA);return H},[at,u]),et=ks(),P0=j.useMemo(()=>{if(Ne.size===0||!mA)return new Map;if(et.length===0)return new Map;const H=pr(mA);return Oa(et,Ne,H).scores},[Ne,mA,et]),yt=j.useMemo(()=>{var wt;if(!qe)return null;if(qe==="local"&&c)return{isLocal:!0,name:c.name,hash:mA,hashPrefix:mA?pr(mA):"",longitude:c.longitude,latitude:c.latitude};const H=u[qe];if(!H)return null;const sA=Ne.has(qe),yA=E.hubNodes.includes(qe),LA=((wt=E.gatewayNodes)==null?void 0:wt.includes(qe))??!1,WA=E.mobileNodes.includes(qe),he=mi(H),oe=at.get(qe),Oe=E.fullAffinity.get(qe),ze=E.txDelayRecommendations.get(qe);return{isLocal:!1,hash:qe,hashPrefix:pr(qe),name:H.node_name||H.name||"Unknown",isHub:yA,isGateway:LA,isBackbone:(ze==null?void 0:ze.networkRole)==="backbone",isZeroHop:sA,isMobile:WA,isRoomServer:he.isRoomServer,isStale:(()=>{const ct=H.last_seen||(oe==null?void 0:oe.lastSeen);return ct?(Date.now()-ct*1e3)/(1e3*60*60*24)>=5:!1})(),lastSeenTimestamp:H.last_seen||(oe==null?void 0:oe.lastSeen),centrality:E.centrality.get(qe)||0,affinity:Oe,meanSnr:(oe==null?void 0:oe.avgSnr)??void 0,meanRssi:(oe==null?void 0:oe.avgRssi)??void 0,neighbor:H,txDelayRec:ze}},[qe,c,mA,u,Ne,E,at]),ZA=j.useCallback(H=>mA?!!(H.fromHash===mA&&Ne.has(H.toHash)||H.toHash===mA&&Ne.has(H.fromHash)):!1,[mA,Ne]),S=j.useMemo(()=>{var sA,yA;if(L.length===0||!mA)return[];if(O.backgroundLoadComplete)return[];const H=[];for(const LA of L){if(LA.status==="expired"||!((sA=u[LA.hash])!=null&&sA.latitude)||!((yA=u[LA.hash])!=null&&yA.longitude))continue;const WA=[mA,LA.hash].sort(),he=`${WA[0]}~${WA[1]}`;H.push({fromHash:mA,toHash:LA.hash,key:he,packetCount:LA.count,avgConfidence:1,strength:.8,avgRecency:1,hopDistanceFromLocal:0,isHubConnection:!1,isCertain:!0,certainCount:LA.count,isLoopEdge:!1,forwardCount:LA.count,reverseCount:0,symmetryRatio:0,dominantDirection:"forward",floodCount:LA.count,directCount:0,isDirectPathEdge:!1,isZeroHop:!0,avgRssi:LA.avgRssi,avgSnr:LA.avgSnr})}return H},[L,mA,O.backgroundLoadComplete,u]),OA=j.useMemo(()=>{const H=[];if(S.length>0&&!O.backgroundLoadComplete){for(const sA of S){const yA=Te.get(sA.fromHash),LA=Te.get(sA.toHash);yA&&LA&&H.push({from:yA,to:LA,edge:sA})}return H}for(const sA of E.validatedEdges){if(ZA(sA))continue;const yA=Te.get(sA.fromHash),LA=Te.get(sA.toHash);yA&&LA&&H.push({from:yA,to:LA,edge:sA})}return H},[E.validatedEdges,Te,ZA,S,O.backgroundLoadComplete]),Ot=j.useMemo(()=>{const H=[];for(const sA of E.weakEdges){if(ZA(sA))continue;const yA=Te.get(sA.fromHash),LA=Te.get(sA.toHash);yA&&LA&&H.push({from:yA,to:LA,edge:sA})}return H},[E.weakEdges,Te,ZA]),S0=j.useMemo(()=>{if(!(c!=null&&c.latitude)||!(c!=null&&c.longitude))return[];const H=[],sA=[c.latitude,c.longitude],yA=new Map;for(const WA of E.lastHopNeighbors)yA.set(WA.hash,WA.count);const LA=new Map;for(const WA of L)LA.set(WA.hash,WA.count);for(const WA of Ne){const he=u[WA];if(!(he!=null&&he.latitude)||!(he!=null&&he.longitude))continue;const oe=LA.get(WA),Oe=yA.get(WA);H.push({from:sA,to:[he.latitude,he.longitude],hash:WA,neighbor:he,lastHopData:at.get(WA)??null,rxAdvertCount:oe,txProxyCount:Oe})}return H},[c,Ne,u,at,E.lastHopNeighbors,L]),l0=j.useMemo(()=>new Set(E.loopEdgeKeys),[E.loopEdgeKeys]),a0=j.useMemo(()=>new Set(E.backboneEdges),[E.backboneEdges]),M0=j.useMemo(()=>{if(!Ft)return null;const H=E.validatedEdges.filter(WA=>WA.fromHash===Ft||WA.toHash===Ft);if(H.length===0)return null;const sA=[...H].sort((WA,he)=>he.certainCount-WA.certainCount),yA=Math.max(1,Math.ceil(sA.length*.2)),LA=sA.slice(0,yA);return new Set(LA.map(WA=>WA.key))},[Ft,E.validatedEdges]),k=j.useMemo(()=>{let H=0;if(S.length>0&&!O.backgroundLoadComplete){for(const sA of S)sA.certainCount>H&&(H=sA.certainCount);return H||1}for(const sA of E.validatedEdges)sA.certainCount>H&&(H=sA.certainCount);return H||1},[E.validatedEdges,S,O.backgroundLoadComplete]),Et=j.useMemo(()=>{if(E.validatedEdges.length===0)return null;const H=new Set;for(const LA of E.validatedEdges)H.add(LA.fromHash),H.add(LA.toHash);const sA=Array.from(H).filter(LA=>Te.has(LA)).sort();if(sA.length<3)return null;const yA=new Map;for(const LA of sA){const WA=Te.get(LA);WA&&yA.set(LA,WA)}return Ja(E.validatedEdges,sA,yA,E.edgeBetweenness)},[E.validatedEdges,Te,E.edgeBetweenness]),d0=j.useCallback(()=>{At(H=>{const sA=!H;if(sA&&Et&&D.current){const yA=D.current.getMap();if(!yA)return sA;let LA=1/0,WA=-1/0,he=1/0,oe=-1/0,Oe=!1;for(const[,ze]of Et.communities)for(const wt of ze){const ct=Te.get(wt);if(ct){const[tt,Dt]=ct;he=Math.min(he,tt),oe=Math.max(oe,tt),LA=Math.min(LA,Dt),WA=Math.max(WA,Dt),Oe=!0}}Oe&&yA.fitBounds([[LA,he],[WA,oe]],{padding:{top:60,bottom:100,left:60,right:320},duration:800,maxZoom:14})}return sA})},[Et,Te]),m0=j.useRef(null);j.useLayoutEffect(()=>{var H,sA;m0.current=((sA=(H=D.current)==null?void 0:H.getMap)==null?void 0:sA.call(H))??null});const Q0=ks();c1({map:m0,nodeCoordinates:Te,packets:Q0,localHash:mA,neighbors:u,meshTopology:E,enabled:RA});const{isExiting:B0,isAnimating:h,resetAnimationState:v}=K2({map:m0,showTopology:MA,validatedPolylines:OA,weakPolylines:Ot,maxCertainCount:k,loopEdgeKeys:l0,backboneEdgeKeys:a0,highlightedEdgeKey:T,neighbors:u,validatedSourceId:js,weakSourceId:Rs,neighborPolylines:S0,showNeighborLines:ue,neighborSourceId:Is,neighborLinkScores:P0,basemapMode:t}),_=j.useMemo(()=>{const H=new Set;for(const sA of E.hubNodes){H.add(sA);for(const yA of E.validatedEdges)yA.fromHash===sA&&H.add(yA.toHash),yA.toHash===sA&&H.add(yA.fromHash)}return H},[E.hubNodes,E.validatedEdges]),P=j.useMemo(()=>{const H=new Set;if(!g)return H;for(const sA of E.validatedEdges)sA.fromHash===g&&H.add(sA.toHash),sA.toHash===g&&H.add(sA.fromHash);return H},[g,E.validatedEdges]),J=j.useMemo(()=>{const H=new Map;for(const[sA,yA]of gt)H.set(sA,mi(yA).type);return H},[gt]),K=j.useMemo(()=>{let H=0,sA=0,yA=0;for(const[,LA]of J)LA==="repeater"?H++:LA==="companion"||LA==="unknown"?sA++:LA==="room_server"&&yA++;return{repeater:H,companion:sA,room_server:yA,hubs:E.hubNodes.length,direct:Ne.size}},[J,E.hubNodes.length,Ne.size]),aA=j.useMemo(()=>new Set(Me),[Me]),{getNodeOpacity:_A}=$2({activeFilters:aA,neighborHashes:gt.map(([H])=>H),hubConnectedNodes:_,directNodeSet:Ne,localConnectedNodes:P,nodeTypeMap:J,showTopology:MA}),{blinkingNodes:XA,blinkColor:Ae}=X2({neighbors:u,localHash:g,enabled:RA}),fe=j.useCallback(H=>{if(aA.size===0)return!1;const sA=J.get(H)??"unknown";return!!(aA.has("repeater")&&sA==="repeater"||aA.has("companion")&&(sA==="companion"||sA==="unknown")||aA.has("room_server")&&sA==="room_server"||aA.has("direct")&&Ne.has(H)||aA.has("hubs")&&_.has(H))},[aA,J,Ne,_]),Ue=j.useCallback(()=>{f0(!0),F0(!0)},[]),St=j.useCallback(()=>{ut?Ze(H=>!H):Ue()},[ut,Ue]),Mt=j.useCallback(H=>{vA(H.viewState),(H.viewState.pitch??0)>10&&!be&&nt(!0)},[be]),xt=j.useCallback(()=>{jA(H=>{var LA,WA,he,oe,Oe,ze,wt;const sA=!H,yA=(he=(WA=(LA=D.current)==null?void 0:LA.getContainer())==null?void 0:WA.closest(".map-container-fullscreen, .map-container-16-9"))==null?void 0:he.parentElement;return sA?yA&&document.fullscreenEnabled?(oe=yA.requestFullscreen)==null||oe.call(yA).catch(()=>{}):yA&&document.webkitFullscreenEnabled&&((Oe=yA.webkitRequestFullscreen)==null||Oe.call(yA)):document.fullscreenElement?(ze=document.exitFullscreen)==null||ze.call(document).catch(()=>{}):document.webkitFullscreenElement&&((wt=document.webkitExitFullscreen)==null||wt.call(document)),sA})},[]),je=j.useCallback(()=>{const H=Me.length>=un.length;Qe(H?[]:[...un])},[Me,Qe]),Bt=j.useCallback(H=>{Me.length>=un.length?Qe([H]):Me.includes(H)?Qe(Me.filter(yA=>yA!==H)):Qe([...Me,H])},[Me,Qe]),p0=j.useCallback(()=>{Je(H=>!H)},[]),u0=j.useCallback(()=>{UA(H=>!H)},[]),O0=j.useCallback(()=>{kt(H=>{const sA=!H;return sA||Xt(null),sA})},[]),e0=j.useCallback(()=>{nt(H=>{const sA=!H;if(D.current){const yA=D.current.getMap();yA&&yA.stop()}if(sA&&D.current){const yA=D.current.getMap();yA&&yA.easeTo({pitch:45,duration:1500,easing:No})}if(!sA&&D.current){const yA=D.current.getMap();yA&&yA.easeTo({pitch:0,bearing:0,duration:800,easing:iu})}return sA})},[]),D0=j.useCallback(()=>{MA||Ze(!0)},[MA]),er=j.useCallback((H,sA)=>{E0(H),c0(sA)},[]),tr=j.useCallback(()=>{Ut&&y&&y(Ut),E0(null),c0("")},[Ut,y]),Ur=j.useMemo(()=>[...M1,...v1,...Ce?[Qn]:[]],[Ce]),Vr=j.useCallback(H=>{var yA;if((yA=H.features)==null?void 0:yA.some(LA=>{var WA,he;return(he=(WA=LA.layer)==null?void 0:WA.id)==null?void 0:he.startsWith("node-markers-")})){$A(null),ot(null);return}if(Ce&&H.features&&H.features.length>0){const LA=H.features.find(WA=>{var he;return((he=WA.layer)==null?void 0:he.id)===Qn});if(LA!=null&&LA.properties){const{fromHash:WA,toHash:he}=LA.properties;if(WA&&he){const oe=V.find(Oe=>Oe.nodeA.hash===WA&&Oe.nodeB.hash===he||Oe.nodeA.hash===he&&Oe.nodeB.hash===WA);if(oe){Xt(oe),vt(null);return}}}}vt(null),$A(null),ot(null),k0(null),Xt(null)},[Ce,V]),Wr=j.useCallback(H=>{k0(sA=>sA===H?null:H),Xt(null)},[]),zt=j.useCallback(H=>{var Oe,ze,wt;if(!H.features||H.features.length===0)return;if(H.features.some(ct=>{var tt,Dt;return(Dt=(tt=ct.layer)==null?void 0:tt.id)==null?void 0:Dt.startsWith("node-markers-")})){Ge&&(ot(null),$A(null));return}if(Ce&&H.features.some(ct=>{var tt;return((tt=ct.layer)==null?void 0:tt.id)===Qn})){try{(Oe=D.current)!=null&&Oe.getCanvas()&&(D.current.getCanvas().style.cursor="pointer")}catch{}return}const yA=H.features.find(ct=>{var Dt;const tt=(Dt=ct.layer)==null?void 0:Dt.id;return(tt==null?void 0:tt.startsWith("topology-"))||(tt==null?void 0:tt.startsWith("neighbor-"))});if(!yA)return;const LA=(ze=yA.layer)==null?void 0:ze.id,WA=yA.properties;if(!(WA!=null&&WA.key))return;const he=LA==null?void 0:LA.startsWith("topology-"),oe=LA==null?void 0:LA.startsWith("neighbor-");if(he||oe){const ct=WA.key.replace(/-loop[12]$/,"");ot(ct),H.lngLat&&$A({longitude:H.lngLat.lng,latitude:H.lngLat.lat,type:he?"topology":"neighbor",properties:WA})}try{(wt=D.current)!=null&&wt.getCanvas()&&(D.current.getCanvas().style.cursor="pointer")}catch{}},[Ge,Ce]),rr=j.useCallback(()=>{var H;ot(null),$A(null);try{(H=D.current)!=null&&H.getCanvas()&&(D.current.getCanvas().style.cursor="")}catch{}},[]),g0=hA?"map-container-fullscreen":"map-container-16-9",Fe=IA.length>0||(c==null?void 0:c.latitude)&&(c==null?void 0:c.longitude),y0=!AA||!Fe,_0=Fe;return m.jsxs("div",{className:`relative ${g0} ${hA?"":"rounded-2xl overflow-hidden"}`,role:"application","aria-label":"Mesh network contacts map","aria-describedby":"map-instructions","data-basemap":t,children:[m.jsx("span",{id:"map-instructions",className:"sr-only",children:"Interactive map showing mesh network contacts. Use mouse or touch to pan and zoom. Press Tab to navigate map controls. Press Escape to exit fullscreen mode."}),y0&&m.jsx("div",{className:"absolute inset-0 z-50 surface-base rounded-2xl flex items-center justify-center","aria-hidden":"true",children:m.jsxs("div",{className:"flex flex-col items-center gap-3",children:[m.jsx("div",{className:"w-6 h-6 border-2 border-sys-blue border-t-transparent rounded-full animate-spin"}),m.jsx("span",{className:"text-sm text-fg-muted",children:"Loading map..."})]})}),_0&&m.jsx("div",{className:`relative w-full h-full ${hA?"":"rounded-[1.125rem] overflow-hidden"} ${y0?"opacity-0":"opacity-100 transition-opacity duration-300"}`,style:fA?{visibility:"hidden"}:void 0,children:m.jsxs(Na,{ref:D,...FA,onMove:Mt,mapStyle:z1,style:{width:"100%",height:"100%"},attributionControl:!1,interactiveLayerIds:Ur,onMouseMove:zt,onMouseLeave:rr,onClick:Vr,onError:H=>{console.error("MapLibre error:",H.error)},onIdle:()=>{if(!CA&&!TA&&D.current){const H=D.current.getMap();if(H){const sA=Object.values(u).filter(yA=>yA.latitude&&yA.longitude).map(yA=>({latitude:yA.latitude,longitude:yA.longitude}));c!=null&&c.latitude&&(c!=null&&c.longitude)&&sA.push({latitude:c.latitude,longitude:c.longitude}),sA.length>0&&DA(sA,H)}}},children:[m.jsx(Fa,{position:"bottom-right"}),m.jsx(Pa,{mode:t}),m.jsx(x2,{enabled:be,exaggeration:4}),m.jsx(y2,{coveragePoints:Pt,visible:Pt.length>0&&pt,terrainEnabled:be,brightness:rA,basemapMode:t}),m.jsx(G2,{partition:Et,nodeCoordinates:Te,visible:Ie&&ut,opacity:se.opacity,bandwidth:se.bandwidth,threshold:se.threshold,strokeWidth:se.strokeWidth}),m.jsx(S1,{showTopology:MA,isExiting:B0,hoveredEdgeKey:Ge,highlightedLoopEdges:xe==null?void 0:xe.highlightedEdgeKeys,highlightedFocusEdges:M0,onEdgeHover:_e,onLoopHover:ie,loops:E.loops,neighborNames:Qt,opacityBias:N0,widthMultiplier:J0,trafficFilter:C0,showNeighborLines:ue,disableHover:h||pA}),m.jsx(L1,{visible:Ce,nodeCoordinates:Te,focusedNodeHash:Ft,basemapMode:t}),x&&m.jsx(B1,{targetHash:x,nodeCoordinates:Te,onComplete:C}),T&&m.jsx(D1,{highlightedEdgeKey:T,validatedPolylines:OA,weakPolylines:Ot,onEnsureTopology:D0}),m.jsx(O1,{ghost:Q??null,neighborCoordinates:Te,onHighlightedNeighborsChange:bt}),m.jsx(w1,{neighborsWithLocation:gt,localNode:c,localHash:g,zeroHopNeighbors:Ne,lastHopNeighborMap:at,meshTopology:E,hoveredMarker:Xe,onMarkerHover:Be,getNodeOpacity:_A,shouldShowNode:fe,openPopupId:qe,onOpenPopup:Ct,onClosePopup:A0,onNodeClick:Wr,blinkingNodes:XA,blinkColor:Ae})]})}),(()=>{const H=W1(Ve?{type:Ve.type,properties:Ve.properties}:null,xe,k,E.edgeMap);return H&&m.jsx("div",{className:"map-edge-tooltip",children:m.jsx("div",{className:"map-control-surface map-edge-tooltip-inner",children:m.jsx(Y1,{data:H})})})})(),m.jsx(yc,{mapRef:D,showNeighborLines:ue,onToggleNeighborLines:p0,hasNeighborPolylines:S0.length>0,nodeFilters:Me,onToggleFilter:Bt,onToggleAll:je,filterCounts:K,showCoverage:KA,onToggleCoverage:u0,showMinCut:Ie,onToggleMinCut:d0,hasMinCutData:ut&&Et!==null&&Et.numCommunities>1,show3DTerrain:be,onToggle3DTerrain:e0,basemapMode:t,onToggleBasemap:b,isFullscreen:hA,onToggleFullscreen:xt,showLinkQuality:Ce,onToggleLinkQuality:O0,hasTraceLinks:$}),m.jsx(yf,{data:yt,localNode:c,localColor:Un().localColor,onClose:A0,onRemove:y?er:void 0}),Ce&&Jt&&m.jsx(ff,{pair:Jt,onClose:()=>Xt(null),prefixToName:h0}),m.jsxs("div",{className:"map-legend-stack",children:[m.jsxs("div",{className:"map-tool-row",children:[m.jsx(Ec,{isActive:MA,hasAnalyzed:ut,isLoading:pA,onClick:St,basemapMode:t}),m.jsx(Tc,{isActive:RA,onClick:xA,basemapMode:t}),m.jsx(Fc,{isActive:Pt.length>0&&pt,onClick:gA,basemapMode:t})]}),m.jsx(mc,{showTopology:MA,validatedPolylineCount:OA.length,filteredNeighborCount:gt.length,hasLocalNode:!!(c!=null&&c.latitude&&(c!=null&&c.longitude)),meshTopology:E,zeroHopNeighbors:Ne,neighborsWithLocation:gt,basemapMode:t})]}),m.jsx(za,{isOpen:Ut!==null,onCancel:()=>E0(null),onConfirm:tr,title:"Remove Node?",message:`Remove "${X0}" from the contacts list? This will hide the node until it sends a new packet.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger"}),m.jsx(sc,{isOpen:Ar,onClose:()=>{F0(!1),f0(!1),v(),o0(!0),setTimeout(()=>Ze(!0),uc)}}),m.jsx(tf,{}),m.jsx(nf,{visible:Ie&&ut,onClose:()=>At(!1),settings:se,onSettingsChange:pe,partition:Et,totalNodes:Object.keys(u).length,basemapMode:t})]})}export{Fh as default}; +`&&d.push(kt),X;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":d.push(Be(w));for(var jt in B)if(O.call(B,jt)&&(X=B[jt],X!=null))switch(jt){case"children":case"dangerouslySetInnerHTML":throw Error(c(399,w));default:Ee(d,F,jt,X)}return d.push(ye),null;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 nt(d,B,w,F);case"html":return tA.insertionMode===0&&d.push(Ge),nt(d,B,w,F);default:if(w.indexOf("-")===-1&&typeof B.is!="string")return nt(d,B,w,F);d.push(Be(w)),dA=X=null;for(ke in B)if(O.call(B,ke)&&(BA=B[ke],BA!=null))switch(ke){case"children":X=BA;break;case"dangerouslySetInnerHTML":dA=BA;break;case"style":se(d,F,BA);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:AA(ke)&&typeof BA!="function"&&typeof BA!="symbol"&&d.push(pe,D(ke),be,D(fA(BA)),$e)}return d.push(Me),Ze(d,dA,X),X}}var Ft=E(""),Jt=E(''),N0=E(""),J0=E(''),Ut=E(""),E0=E(""),X0=E("");function pA(d,w,B){if(x(d,J0),B===null)throw Error(c(395));return x(d,B),C(d,C0)}var f0=E('"),o0=E('"),Ct=E('"),Pt=E(''),rA=E(""),gA=E(''),xA=E(""),t=E(''),ge=E(""),De=E(''),$A=E("");function xe(d,w,B,F){switch(B.insertionMode){case 0:case 1:return x(d,f0),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,ut);case 2:return x(d,o0),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,qe);case 3:return x(d,Ct),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,A0);case 4:return x(d,Pt),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,pt);case 5:return x(d,gA),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,RA);case 6:return x(d,t),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,b);case 7:return x(d,De),x(d,w.segmentPrefix),x(d,D(F.toString(16))),C(d,Ve);default:throw Error(c(397))}}function lt(d,w){switch(w.insertionMode){case 0:case 1:return C(d,Pe);case 2:return C(d,vt);case 3:return C(d,bt);case 4:return C(d,rA);case 5:return C(d,xA);case 6:return C(d,ge);case 7:return C(d,$A);default:throw Error(c(397))}}var _e=E('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),ie=E('$RS("'),rt=E('","'),Qt=E('")<\/script>'),h0=E('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),gt=E('$RC("'),Te=E('","'),at=E('")<\/script>'),Ne=E('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),et=E('$RX("'),P0=E('"'),yt=E(")<\/script>"),ZA=E(","),S=/[<\u2028\u2029]/g;function OA(d){return JSON.stringify(d).replace(S,function(w){switch(w){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var Ot=Object.assign,S0=Symbol.for("react.element"),l0=Symbol.for("react.portal"),a0=Symbol.for("react.fragment"),M0=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),Et=Symbol.for("react.provider"),d0=Symbol.for("react.context"),m0=Symbol.for("react.forward_ref"),Q0=Symbol.for("react.suspense"),B0=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),_=Symbol.for("react.scope"),P=Symbol.for("react.debug_trace_mode"),J=Symbol.for("react.legacy_hidden"),K=Symbol.for("react.default_value"),aA=Symbol.iterator;function _A(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case a0:return"Fragment";case l0:return"Portal";case k:return"Profiler";case M0:return"StrictMode";case Q0:return"Suspense";case B0:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case d0:return(d.displayName||"Context")+".Consumer";case Et:return(d._context.displayName||"Context")+".Provider";case m0:var w=d.render;return d=d.displayName,d||(d=w.displayName||w.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case h:return w=d.displayName||null,w!==null?w:_A(d.type)||"Memo";case v:w=d._payload,d=d._init;try{return _A(d(w))}catch{}}return null}var XA={};function Ae(d,w){if(d=d.contextTypes,!d)return XA;var B={},F;for(F in d)B[F]=w[F];return B}var fe=null;function Ue(d,w){if(d!==w){d.context._currentValue=d.parentValue,d=d.parent;var B=w.parent;if(d===null){if(B!==null)throw Error(c(401))}else{if(B===null)throw Error(c(401));Ue(d,B)}w.context._currentValue=w.value}}function St(d){d.context._currentValue=d.parentValue,d=d.parent,d!==null&&St(d)}function Mt(d){var w=d.parent;w!==null&&Mt(w),d.context._currentValue=d.value}function xt(d,w){if(d.context._currentValue=d.parentValue,d=d.parent,d===null)throw Error(c(402));d.depth===w.depth?Ue(d,w):xt(d,w)}function je(d,w){var B=w.parent;if(B===null)throw Error(c(402));d.depth===B.depth?Ue(d,B):je(d,B),w.context._currentValue=w.value}function Bt(d){var w=fe;w!==d&&(w===null?Mt(d):d===null?St(w):w.depth===d.depth?Ue(w,d):w.depth>d.depth?xt(w,d):je(w,d),fe=d)}var p0={isMounted:function(){return!1},enqueueSetState:function(d,w){d=d._reactInternals,d.queue!==null&&d.queue.push(w)},enqueueReplaceState:function(d,w){d=d._reactInternals,d.replace=!0,d.queue=[w]},enqueueForceUpdate:function(){}};function u0(d,w,B,F){var tA=d.state!==void 0?d.state:null;d.updater=p0,d.props=B,d.state=tA;var X={queue:[],replace:!1};d._reactInternals=X;var dA=w.contextType;if(d.context=typeof dA=="object"&&dA!==null?dA._currentValue:F,dA=w.getDerivedStateFromProps,typeof dA=="function"&&(dA=dA(B,tA),tA=dA==null?tA:Ot({},tA,dA),d.state=tA),typeof w.getDerivedStateFromProps!="function"&&typeof d.getSnapshotBeforeUpdate!="function"&&(typeof d.UNSAFE_componentWillMount=="function"||typeof d.componentWillMount=="function"))if(w=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),w!==d.state&&p0.enqueueReplaceState(d,d.state,null),X.queue!==null&&0>=dA,tA-=dA,{id:1<<32-D0(w)+tA|B<>>=0,d===0?32:31-(er(d)/tr|0)|0}function Vr(d,w){return d===w&&(d!==0||1/d===1/w)||d!==d&&w!==w}var Wr=typeof Object.is=="function"?Object.is:Vr,zt=null,rr=null,g0=null,Fe=null,y0=!1,_0=!1,H=0,sA=null,yA=0;function LA(){if(zt===null)throw Error(c(321));return zt}function WA(){if(0d.progressiveChunkSize)F.rootSegmentID=d.nextSegmentId++,d.completedBoundaries.push(F),pA(w,d.responseState,F.id),Er(d,w,B);else{if(C(w,N0),B=F.completedSegments,B.length!==1)throw Error(c(391));Sr(d,w,B[0])}return C(w,E0)}function nr(d,w,B){return xe(w,d.responseState,B.formatContext,B.id),Sr(d,w,B),lt(w,B.formatContext)}function gn(d,w,B){for(var F=B.completedSegments,tA=0;tA=p1?2:y>=m1?1:0}const $t=2,y1=Ho*$t,eo=Cs*$t;function x1(u){const c=Un(),g=(Q,D,E=0,L=!1)=>{const O=y1,z=document.createElement("canvas");z.width=O,z.height=O;const $=z.getContext("2d",L?{colorSpace:"display-p3"}:void 0),V=O/2,AA=O/2,oA=O/2-2-E/2;return $.beginPath(),$.arc(V,AA,oA,0,Math.PI*2),$.fillStyle=Q,$.fill(),D&&E>0&&($.strokeStyle=D,$.lineWidth=E*$t,$.stroke()),$.shadowColor="rgba(0,0,0,0.3)",$.shadowBlur=2*$t,$.shadowOffsetY=1*$t,{data:$.getImageData(0,0,O,O),pixelRatio:$t}},y=(Q,D=!1)=>{const E=eo,L=document.createElement("canvas");L.width=E,L.height=E;const O=L.getContext("2d",D?{colorSpace:"display-p3"}:void 0),z=E/2,$=E/2,V=Cs*.35*$t;return O.strokeStyle=Q,O.lineWidth=2.5*$t,O.lineCap="round",O.lineJoin="round",O.beginPath(),O.moveTo(z-V,$),O.lineTo(z,$-V),O.lineTo(z+V,$),O.stroke(),O.beginPath(),O.moveTo(z-V*.7,$),O.lineTo(z-V*.7,$+V*.7),O.lineTo(z+V*.7,$+V*.7),O.lineTo(z+V*.7,$),O.stroke(),O.beginPath(),O.moveTo(z-V*.2,$+V*.7),O.lineTo(z-V*.2,$+V*.2),O.lineTo(z+V*.2,$+V*.2),O.lineTo(z+V*.2,$+V*.7),O.stroke(),{data:O.getImageData(0,0,E,E),pixelRatio:$t}},x=(Q,D)=>{const E=eo,L=document.createElement("canvas");L.width=E,L.height=E;const O=L.getContext("2d"),z=E/2,$=E/2,V=Cs*.35*$t;return O.strokeStyle=Q,O.lineWidth=2.5*$t,O.lineCap="round",O.lineJoin="round",D&&(O.fillStyle=D),O.beginPath(),O.roundRect(z-V,$-V*.6,V*1.6,V*1.2,3*$t),D&&O.fill(),O.stroke(),O.beginPath(),O.moveTo(z-V*.3,$+V*.6),O.lineTo(z-V*.6,$+V),O.lineTo(z,$+V*.6),O.stroke(),{data:O.getImageData(0,0,E,E),pixelRatio:$t}},C="#00FF00",T={[Re.standard]:g(c.nodeFill),[Re.standardNeighbor]:g(c.neighborColor),[Re.hub]:g(c.hubColor),[Re.hubNeighbor]:g(c.neighborColor),[Re.gateway]:g(c.gatewayColor),[Re.gatewayNeighbor]:g(c.neighborColor),[Re.mobile]:g("transparent",c.mobileColor,2.5),[Re.mobileNeighbor]:g(c.neighborColor),[Re.roomServer]:x(c.roomColor),[Re.roomServerNeighbor]:x(c.neighborColor,"#1a1a1c"),[Re.local]:y(c.localColor),[Re.stale5Day]:g(Ao.tier1),[Re.stale10Day]:g(Ao.tier2),[Re.blinkBlack]:g("#000000"),[Re.blinkBlackLocal]:y("#000000"),[Re.blink]:g(C,void 0,0,!0),[Re.blinkLocal]:y(C,!0)};for(const[Q,D]of Object.entries(T))try{u.hasImage(Q)&&u.removeImage(Q),u.addImage(Q,D.data,{pixelRatio:D.pixelRatio})}catch{}}function to(u){var g;const c=(g=u.contact_type)==null?void 0:g.toLowerCase();return c==="room server"||c==="room_server"||c==="room"||c==="server"}function ro(u){return u.startsWith("0x")?u.slice(2,4).toUpperCase():u.slice(0,2).toUpperCase()}function w1({neighborsWithLocation:u,localNode:c,localHash:g,zeroHopNeighbors:y,lastHopNeighborMap:x,meshTopology:C,hoveredMarker:T,onMarkerHover:Q,getNodeOpacity:D,shouldShowNode:E,openPopupId:L,onOpenPopup:O,onClosePopup:z,onNodeClick:$,blinkingNodes:V}){const{current:AA}=q0(),oA=j.useRef(!1),[eA,Y]=j.useState(!1);j.useEffect(()=>{var KA;const uA=(KA=AA==null?void 0:AA.getMap)==null?void 0:KA.call(AA);if(!uA)return;const hA=()=>{try{x1(uA),oA.current=!0,eA||Y(!0)}catch(UA){console.warn("Failed to load node marker icons:",UA)}};uA.isStyleLoaded()?hA():uA.once("style.load",hA);const jA=()=>{uA.hasImage(Re.standard)||hA()};uA.on("styledata",jA);const MA=()=>{oA.current=!1,hA()},VA=new MutationObserver(UA=>{for(const Ie of UA)if(Ie.attributeName==="data-theme"){setTimeout(MA,100);break}});VA.observe(document.documentElement,{attributes:!0});const ue=document.querySelector("[data-basemap]");let JA=null;return ue&&(JA=new MutationObserver(UA=>{for(const Ie of UA)if(Ie.attributeName==="data-basemap"){setTimeout(MA,100);break}}),JA.observe(ue,{attributes:!0})),()=>{uA.off("styledata",jA),VA.disconnect(),JA==null||JA.disconnect()}},[AA,eA]);const cA=j.useMemo(()=>{var jA;const uA=[],hA=[...u].sort(([MA,VA],[ue,JA])=>{const KA=(UA,Ie)=>{var Le;return to(Ie)?5e3:y.has(UA)?3e3:C.hubNodes.includes(UA)?2e3:(Le=C.gatewayNodes)!=null&&Le.includes(UA)?1e3:0};return KA(MA,VA)-KA(ue,JA)});for(const[MA,VA]of hA){if(!VA.latitude||!VA.longitude)continue;if(g){const Ze=g.startsWith("0x")?g.slice(2,4).toLowerCase():g.slice(0,2).toLowerCase(),Je=MA.startsWith("0x")?MA.slice(2,4).toLowerCase():MA.slice(0,2).toLowerCase();if(Ze===Je||MA===g)continue}const ue=E(MA),JA=D(MA,ue);if(JA<=.01)continue;const KA=y.has(MA),UA=C.hubNodes.includes(MA),Ie=((jA=C.gatewayNodes)==null?void 0:jA.includes(MA))??!1,Le=C.mobileNodes.includes(MA),se=to(VA),pe=C.centrality.get(MA)||0,be=x.get(MA),$e=VA.last_seen||(be==null?void 0:be.lastSeen),Ce=g1($e),Ee=Ce>0;let Me=JA;Ce===2?Me=Math.min(JA,.25):Ce===1&&(Me=Math.min(JA,.5));let ye="standard";se?ye="roomServer":UA?ye="hub":Ie?ye="gateway":Le&&(ye="mobile"),uA.push({type:"Feature",geometry:{type:"Point",coordinates:[VA.longitude,VA.latitude]},properties:{hash:MA,name:VA.node_name||VA.name||"Unknown",hashPrefix:ro(MA),iconType:ye,isNeighbor:KA,isHub:UA,isGateway:Ie,isMobile:Le,isRoomServer:se,isStale:Ee,staleTier:Ce,isZeroHop:KA,opacity:Me,blinkIntensity:0,lastSeenTimestamp:$e,centrality:pe}})}return{type:"FeatureCollection",features:uA}},[u,g,y,x,C,D,E]),lA=j.useMemo(()=>!(c!=null&&c.latitude)||!(c!=null&&c.longitude)?{type:"FeatureCollection",features:[]}:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[c.longitude,c.latitude]},properties:{hash:"local",name:c.name,hashPrefix:g?ro(g):"",iconType:"local",isNeighbor:!1,isHub:!1,isGateway:!1,isMobile:!1,isRoomServer:!1,isStale:!1,staleTier:0,isZeroHop:!1,opacity:1,blinkIntensity:0,centrality:0}}]},[c,g]),bA=j.useRef(L);j.useEffect(()=>{bA.current=L},[L]);const iA=j.useCallback(uA=>{var MA;if(!uA.features||uA.features.length===0)return;const jA=(MA=uA.features[0].properties)==null?void 0:MA.hash;jA&&(bA.current===jA?z==null||z():O&&O(jA),$&&jA!=="local"&&$(jA))},[O,z,$]),fA=j.useCallback(uA=>{var MA,VA;if(!uA.features||uA.features.length===0)return;const hA=(MA=AA==null?void 0:AA.getMap)==null?void 0:MA.call(AA);hA&&(hA.getCanvas().style.cursor="pointer");const jA=(VA=uA.features[0].properties)==null?void 0:VA.hash;jA&&Q(jA)},[AA,Q]),DA=j.useCallback(()=>{var hA;const uA=(hA=AA==null?void 0:AA.getMap)==null?void 0:hA.call(AA);uA&&(uA.getCanvas().style.cursor=""),Q(null)},[AA,Q]);j.useEffect(()=>{var jA;const uA=(jA=AA==null?void 0:AA.getMap)==null?void 0:jA.call(AA);if(!uA||!eA)return;const hA=[_s,Ts];for(const MA of hA)uA.on("click",MA,iA),uA.on("mouseenter",MA,fA),uA.on("mouseleave",MA,DA);return()=>{for(const MA of hA)uA.off("click",MA,iA),uA.off("mouseenter",MA,fA),uA.off("mouseleave",MA,DA)}},[AA,eA,iA,fA,DA]);const TA=j.useRef(cA),CA=j.useRef(lA);j.useEffect(()=>{TA.current=cA,CA.current=lA},[cA,lA]),j.useEffect(()=>{var MA;const uA=(MA=AA==null?void 0:AA.getMap)==null?void 0:MA.call(AA);if(!uA||!eA||!V||V.size===0)return;const hA=uA.getSource(ln),jA=uA.getSource(`${ln}-local`);if(!(!hA&&!jA)){if(hA){const VA=TA.current;let ue=!1;const JA=VA.features.map(KA=>{const UA=V.get(KA.properties.hash)??0;return UA!==KA.properties.blinkIntensity?(ue=!0,{...KA,properties:{...KA.properties,blinkIntensity:UA}}):KA});ue&&hA.setData({type:"FeatureCollection",features:JA})}if(jA&&g){const VA=V.get(g)??0,ue=CA.current;ue.features.length>0&&ue.features[0].properties.blinkIntensity!==VA&&jA.setData({type:"FeatureCollection",features:[{...ue.features[0],properties:{...ue.features[0].properties,blinkIntensity:VA}}]})}}},[AA,eA,V,g]);const mA=j.useMemo(()=>{if(!L)return{type:"FeatureCollection",features:[]};if(L==="local"&&(c!=null&&c.latitude)&&(c!=null&&c.longitude))return{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[c.longitude,c.latitude]},properties:{hash:"local"}}]};const uA=cA.features.find(hA=>hA.properties.hash===L);return uA?{type:"FeatureCollection",features:[{type:"Feature",geometry:uA.geometry,properties:{hash:uA.properties.hash}}]}:{type:"FeatureCollection",features:[]}},[L,c,cA]);if(!eA)return null;const NA=Un().localColor||"#F59E0B",FA=["case",[">",["get","blinkIntensity"],.66],Re.blink,[">",["get","blinkIntensity"],.33],Re.blinkBlack,["==",["get","staleTier"],2],Re.stale10Day,["==",["get","staleTier"],1],Re.stale5Day,["==",["get","iconType"],"roomServer"],["case",["get","isNeighbor"],Re.roomServerNeighbor,Re.roomServer],["==",["get","iconType"],"hub"],["case",["get","isNeighbor"],Re.hubNeighbor,Re.hub],["==",["get","iconType"],"gateway"],["case",["get","isNeighbor"],Re.gatewayNeighbor,Re.gateway],["==",["get","iconType"],"mobile"],["case",["get","isNeighbor"],Re.mobileNeighbor,Re.mobile],["case",["get","isNeighbor"],Re.standardNeighbor,Re.standard]],GA=["interpolate",["linear"],["zoom"],Xi,.25,Ji,1],vA=["get","opacity"];return m.jsxs(m.Fragment,{children:[m.jsx(I0,{id:ln,type:"geojson",data:cA,children:m.jsx(Zt,{id:_s,type:"symbol",layout:{"icon-image":FA,"icon-size":GA,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"symbol-sort-key":["get","opacity"]},paint:{"icon-opacity":vA}})}),m.jsx(I0,{id:`${ln}-local`,type:"geojson",data:lA,children:m.jsx(Zt,{id:Ts,type:"symbol",layout:{"icon-image":["case",[">",["get","blinkIntensity"],.66],Re.blinkLocal,[">",["get","blinkIntensity"],.33],Re.blinkBlackLocal,Re.local],"icon-size":GA,"icon-allow-overlap":!0,"icon-ignore-placement":!0},paint:{"icon-opacity":1}})}),m.jsx(I0,{id:`${ln}-selection`,type:"geojson",data:mA,children:m.jsx(Zt,{id:"node-markers-selection-ring",type:"circle",paint:{"circle-radius":["interpolate",["linear"],["zoom"],Xi,4,Ji,14],"circle-color":"transparent","circle-stroke-color":NA,"circle-stroke-width":2.5,"circle-stroke-opacity":.85}})})]})}const v1=[_s,Ts],js="topology-validated-edges-native",Rs="topology-weak-edges-native",Is="neighbor-edges-native",no="topology-weak-edges-native",Nn="topology-validated-edges-native",gs="neighbor-edges-native",ys={type:"FeatureCollection",features:[]},an={"line-cap":"round","line-join":"round"},so={"line-color":"transparent","line-width":16,"line-opacity":0};function b1(u,c,g,y,x,C){const T=Fs(),Q=u!==null,D=x&&x.size>0,E=C&&C.size>0,L=D?Array.from(x):[],O=E?Array.from(C):[],z=c,$=.5,AA=(()=>{if(z<=0)return["get","baseColor"];const IA=1-z*.5;return["case",[">=",["get","brightnessScore"],IA],"#FFFFFF",["get","baseColor"]]})(),eA=z<=0?1:["max",.1,["+",1,["*",z,3,["-",["get","brightnessScore"],$]]]],cA=D?["in",["get","key"],["literal",L]]:E?["in",["get","key"],["literal",O]]:Q?["==",["get","key"],u]:!1,lA=Q||D||E,bA=T.edges.hoverLoop,iA=T.edges.highlight;return{"line-color":lA?["case",cA,D?bA:E?iA:["get","hoverColor"],AA]:AA,"line-width":lA?["case",cA,["max",["*",["get","baseWidth"],g,1.3],3.5],["*",["get","baseWidth"],g]]:["*",["get","baseWidth"],g],"line-opacity":["case",["<",["get","brightnessScore"],y],0,lA?["case",cA,["min",["*",["get","baseOpacity"],1.25],1],["*",["get","baseOpacity"],eA,.35]]:["*",["get","baseOpacity"],eA]]}}const k1=10,C1=6;function E1(u){const c=u!==null,{YELLOW:g,GREEN:y,RED:x,GRAY:C}=Fn,T=["to-number",["get","listenerScore"],0],Q=["to-number",["get","loudScore"],0],E=["/",T,["max",["+",T,Q],1]],L=["case",["all",["==",T,0],["==",Q,0]],C,[">=",E,.97],y,["<=",E,.03],x,["interpolate",["linear"],E,.03,x,.5,g,.97,y]],O=.2,oA=["*",["+",O,["*",["to-number",["get","trafficWeight"],0],1-O]],8],eA=5,Y=c?["case",["==",["get","key"],u],["max",oA,eA],oA]:oA,cA=c?["case",["==",["get","key"],u],["max",["*",oA,.25],eA*.25],["*",oA,.25]]:["*",oA,.25];return{"line-color":L,"line-width":["interpolate",["linear"],["zoom"],C1,cA,k1,Y],"line-opacity":c?["case",["==",["get","key"],u],1,.35]:.9}}function S1({showTopology:u,isExiting:c,hoveredEdgeKey:g,highlightedLoopEdges:y,highlightedFocusEdges:x,onEdgeHover:C,onLoopHover:T,loops:Q=[],neighborNames:D={},opacityBias:E=.5,widthMultiplier:L=1,trafficFilter:O=0,showNeighborLines:z=!0,disableHover:$=!1}){const{current:V}=q0(),AA=u||c,oA=!0,eA=z?"visible":"none",Y=$||c,cA=j.useRef(null),lA=j.useRef(Y),bA=j.useRef(new Map),iA=j.useRef(D),fA=j.useRef(T);j.useLayoutEffect(()=>{lA.current=Y,iA.current=D,fA.current=T});const DA=j.useMemo(()=>Lu(Q),[Q]);j.useLayoutEffect(()=>{bA.current=DA},[DA]);const TA=j.useCallback(vA=>{var MA,VA;if(lA.current||!vA.features||vA.features.length===0)return;const hA=vA.features[0].properties;if(!(hA!=null&&hA.key))return;const jA=hA.key;if(jA!==cA.current){cA.current=jA;const ue=hA.isNeighborEdge===!0||hA.isNeighborEdge==="true",JA=hA.isLoopEdge===!0||hA.isLoopEdge==="true";if(ue){const KA={key:jA,fromName:"Local",toName:hA.name,certainCount:Number(hA.packetCount)||0,confidence:1,isBackbone:!1,isLoopEdge:!1,isDirectPath:!0,isZeroHop:!0,symmetryRatio:1,dominantDirection:"balanced",isHubConnection:!1};C(jA,[vA.lngLat.lng,vA.lngLat.lat],KA),(MA=fA.current)==null||MA.call(fA,null)}else if(JA&&fA.current){const KA=bA.current.get(jA)??[];if(KA.length>0){const UA=new Set;for(const pe of KA)for(const be of pe.edgeKeys)UA.add(be);const Le=KA[0].nodes.map(pe=>iA.current[pe]||pe.substring(0,4)),se={loops:KA,highlightedEdgeKeys:UA,hoveredEdgeKey:jA,nodeNames:Le};fA.current(se,[vA.lngLat.lng,vA.lngLat.lat]),C(jA)}else{const UA={key:jA,fromName:hA.fromName,toName:hA.toName,certainCount:Number(hA.certainCount),confidence:Number(hA.confidence),isBackbone:hA.isBackbone===!0||hA.isBackbone==="true",isLoopEdge:!0,isDirectPath:hA.isDirectPath===!0||hA.isDirectPath==="true",isZeroHop:hA.isZeroHop===!0||hA.isZeroHop==="true",symmetryRatio:Number(hA.symmetryRatio),dominantDirection:hA.dominantDirection,isHubConnection:hA.isHubConnection===!0||hA.isHubConnection==="true"};C(jA,[vA.lngLat.lng,vA.lngLat.lat],UA)}}else{const KA={key:jA,fromName:hA.fromName,toName:hA.toName,certainCount:Number(hA.certainCount),confidence:Number(hA.confidence),isBackbone:hA.isBackbone===!0||hA.isBackbone==="true",isLoopEdge:JA,isDirectPath:hA.isDirectPath===!0||hA.isDirectPath==="true",isZeroHop:hA.isZeroHop===!0||hA.isZeroHop==="true",symmetryRatio:Number(hA.symmetryRatio),dominantDirection:hA.dominantDirection,isHubConnection:hA.isHubConnection===!0||hA.isHubConnection==="true"};C(jA,[vA.lngLat.lng,vA.lngLat.lat],KA),(VA=fA.current)==null||VA.call(fA,null)}}},[C]),CA=j.useCallback(()=>{var vA;cA.current!==null&&(cA.current=null,C(null),(vA=fA.current)==null||vA.call(fA,null))},[C]);j.useEffect(()=>{var MA;const vA=(MA=V==null?void 0:V.getMap)==null?void 0:MA.call(V);if(!vA||!AA)return;const uA="topology-validated-edges-hitarea-native",hA=()=>{try{return vA.getStyle()&&vA.getLayer(uA)}catch{return!1}},jA=()=>hA()?(vA.on("mousemove",uA,TA),vA.on("mouseleave",uA,CA),!0):!1;if(!jA()){const VA=()=>{jA()&&vA.off("styledata",VA)};return vA.on("styledata",VA),()=>{try{vA.off("styledata",VA),hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}}return()=>{try{hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}},[V,AA,TA,CA]),j.useEffect(()=>{var MA;const vA=(MA=V==null?void 0:V.getMap)==null?void 0:MA.call(V);if(!vA||!oA||!z)return;const uA="neighbor-edges-hitarea-native",hA=()=>{try{return vA.getStyle()&&vA.getLayer(uA)}catch{return!1}},jA=()=>hA()?(vA.on("mousemove",uA,TA),vA.on("mouseleave",uA,CA),!0):!1;if(!jA()){const VA=()=>{jA()&&vA.off("styledata",VA)};return vA.on("styledata",VA),()=>{try{vA.off("styledata",VA),hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}}return()=>{try{hA()&&(vA.off("mousemove",uA,TA),vA.off("mouseleave",uA,CA))}catch{}}},[V,oA,z,TA,CA]),j.useEffect(()=>{var JA;const vA=(JA=V==null?void 0:V.getMap)==null?void 0:JA.call(V);if(!vA)return;let uA=null;const hA=(KA,UA)=>{try{if(vA.getLayer(KA)&&vA.getLayer(UA))return vA.moveLayer(KA,UA),!0}catch{}return!1},jA=()=>{try{if(!vA.getLayer("node-markers-layer"))return;hA(gs,"node-markers-layer"),hA("neighbor-edges-hitarea-native",gs),(hA(Nn,"neighbor-edges-hitarea-native")||hA(Nn,"node-markers-layer"))&&hA("topology-validated-edges-hitarea-native",Nn),hA(no,"topology-validated-edges-hitarea-native")}catch{}},MA=()=>{uA&&clearTimeout(uA),uA=setTimeout(jA,50)},VA=setTimeout(jA,100);vA.on("styledata",MA);const ue=KA=>{(KA.sourceId===js||KA.sourceId===Rs||KA.sourceId===Is)&&MA()};return vA.on("sourcedata",ue),()=>{clearTimeout(VA),uA&&clearTimeout(uA);try{vA.off("styledata",MA),vA.off("sourcedata",ue)}catch{}}},[V,AA,oA,z]);const mA=Y?null:g,FA=b1(mA,E,L,O,Y?null:y,x??null),GA=E1(mA);return m.jsxs(m.Fragment,{children:[AA&&m.jsx(I0,{id:Rs,type:"geojson",data:ys,children:m.jsx(Zt,{id:no,type:"line",paint:FA,layout:{...an,visibility:eA}})}),AA&&m.jsxs(I0,{id:js,type:"geojson",data:ys,children:[m.jsx(Zt,{id:"topology-validated-edges-hitarea-native",type:"line",paint:so,layout:{...an,visibility:eA}}),m.jsx(Zt,{id:Nn,type:"line",paint:FA,layout:{...an,visibility:eA}})]}),m.jsxs(I0,{id:Is,type:"geojson",data:ys,children:[m.jsx(Zt,{id:"neighbor-edges-hitarea-native",type:"line",paint:so,layout:{...an,visibility:eA}}),m.jsx(Zt,{id:gs,type:"line",paint:GA,layout:{...an,visibility:eA}})]})]})}const M1=["topology-validated-edges-hitarea-native","topology-validated-edges-native","topology-weak-edges-native","neighbor-edges-hitarea-native","neighbor-edges-native"];function B1({targetHash:u,nodeCoordinates:c,onComplete:g}){const{current:y}=q0(),x=j.useRef(null);return j.useEffect(()=>{if(!y||!u||u===x.current)return;const C=c.get(u);if(!C)return;const T=y.getMap();T.isMoving()&&T.stop(),x.current=u;const[Q,D]=C;y.flyTo({center:[D,Q],zoom:10,duration:2500,essential:!0}),setTimeout(()=>{g==null||g()},2600)},[u,c,y,g]),null}function D1({highlightedEdgeKey:u,validatedPolylines:c,weakPolylines:g,onEnsureTopology:y}){const{current:x}=q0(),C=j.useRef(null);return j.useEffect(()=>{if(!x||!u||u===C.current)return;C.current=u,y();const T=c.find(z=>z.edge.key===u)||g.find(z=>z.edge.key===u);if(!T||x.getMap().isMoving())return;const D=(T.from[0]+T.to[0])/2,E=(T.from[1]+T.to[1])/2,L=x.getZoom(),O=Math.max(L,11);x.easeTo({center:[E,D],zoom:O,duration:500})},[u,c,g,x,y]),null}const io="link-quality-edges",_1="link-quality-edges-layer",Qn="link-quality-edges-hitarea",oo={type:"FeatureCollection",features:[]};function T1(u,c){return uDa(),[]),E=j.useMemo(()=>!u||C.length===0||T.size===0?oo:j1(C,c,g,D,Q),[u,C,T.size,c,g,D,Q]);j.useEffect(()=>{if(!x)return;const O=x.getMap();if(O)try{const z=O.getSource(io);z&&"setData"in z&&(z.setData(E),O.triggerRepaint())}catch{}},[E,x]);const L=u?"visible":"none";return m.jsxs(I0,{id:io,type:"geojson",data:oo,children:[m.jsx(Zt,{id:_1,type:"line",layout:{...lo,visibility:L},paint:R1}),m.jsx(Zt,{id:Qn,type:"line",layout:{...lo,visibility:L},paint:I1})]})}const N1="rgba(167, 139, 250, 0.15)",ao=500,F1=.5,uo=2e3,co=1500,P1=1e3;function Q1(u,c,g,y=64){const x=[],T=g/6371e3*(180/Math.PI),Q=T/Math.cos(c*Math.PI/180);for(let D=0;D<=y;D++){const E=D/y*2*Math.PI,L=u+Q*Math.cos(E),O=c+T*Math.sin(E);x.push([L,O])}return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[x]}}}function O1({ghost:u,neighborCoordinates:c,onHighlightedNeighborsChange:g}){const{current:y}=q0(),x=j.useRef(null),C=j.useRef(null),T=j.useMemo(()=>u?new Set(u.commonNeighbors):new Set,[u]);j.useEffect(()=>{g==null||g(T)},[T,g]);const Q=j.useMemo(()=>{if(!(u!=null&&u.commonNeighbors)||u.commonNeighbors.length<2)return uo*4;let L=0;const O=[];for(const z of u.commonNeighbors){const $=c.get(z);$&&O.push($)}u.estimatedLocation&&O.push([u.estimatedLocation.lat,u.estimatedLocation.lon]);for(let z=0;zL&&(L=V)}return Math.max(L,ao*4)},[u,c]),D=j.useMemo(()=>{if(!(u!=null&&u.estimatedLocation))return{type:"FeatureCollection",features:[]};const{lat:L,lon:O,uncertaintyM:z}=u.estimatedLocation,$=Q*F1,V=z>0?z:uo,AA=Math.max(ao,Math.min(V,$));return{type:"FeatureCollection",features:[Q1(O,L,AA)]}},[u,Q]);if(j.useEffect(()=>{if(!y)return;const L=y.getMap();if(u&&u.prefix!==C.current){if(C.current=u.prefix,!x.current&&L.getZoom()>3){const z=L.getCenter();x.current={center:[z.lng,z.lat],zoom:L.getZoom(),pitch:L.getPitch(),bearing:L.getBearing()}}const O=[];for(const z of u.commonNeighbors){const $=c.get(z);$&&O.push([$[1],$[0]])}if(u.estimatedLocation&&O.push([u.estimatedLocation.lon,u.estimatedLocation.lat]),O.length>0){const z=()=>{var $;if(L.isMoving()){setTimeout(z,100);return}if(O.length===1)y.flyTo({center:O[0],zoom:13,duration:co});else{let V=1/0,AA=-1/0,oA=1/0,eA=-1/0;for(const[Y,cA]of O)V=Math.min(V,Y),AA=Math.max(AA,Y),oA=Math.min(oA,cA),eA=Math.max(eA,cA);if(($=u.estimatedLocation)!=null&&$.uncertaintyM){const Y=u.estimatedLocation.uncertaintyM/111e3;V-=Y,AA+=Y,oA-=Y,eA+=Y}y.fitBounds([[V,oA],[AA,eA]],{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,duration:co})}};setTimeout(z,50)}}if(!u&&C.current!==null&&(C.current=null,x.current)){const O=x.current,z=()=>{if(L.isMoving()){setTimeout(z,100);return}y.flyTo({center:O.center,zoom:O.zoom,pitch:O.pitch,bearing:O.bearing,duration:P1}),x.current=null};setTimeout(z,50)}},[u,y,c]),!(u!=null&&u.estimatedLocation))return null;const E={"fill-color":N1,"fill-opacity":.8};return m.jsx(I0,{id:"ghost-uncertainty-circle",type:"geojson",data:D,children:m.jsx(Zt,{id:"ghost-uncertainty-fill",type:"fill",paint:E})})}const il=[{target:"Map",fn:"gps",minStage:1,when:ci},{target:"Map",fn:"_advertNodeType",minStage:1,when:ci},{target:"Topology",fn:"traceHops",minStage:1,when:fi},{target:"Topology",fn:"path.entries",minStage:1,when:Qa},{target:"Topology",fn:"traceSrc",minStage:1,when:fi}];To(il);const z1={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},H1={longitude:0,latitude:0,zoom:2};function G1(u,c,g,y){return Do(u,c,g,y)/1e3}function U1(u,c){if(u.length<=2)return u;let g,y;if(c!=null&&c.latitude&&(c!=null&&c.longitude))g=c.latitude,y=c.longitude;else{let E=0,L=0;for(const[O,z]of u)E+=O,L+=z;g=E/u.length,y=L/u.length}const x=u.map(([E,L])=>({pos:[E,L],dist:G1(g,y,E,L)}));x.sort((E,L)=>E.dist-L.dist);const C=Math.floor(x.length/2),T=x[C].dist,Q=Math.max(T*3,50),D=x.filter(E=>E.dist<=Q).map(E=>E.pos);return D.length0&&(z=Math.floor(Math.log2(360/O*1.2)),z=Math.max(1,Math.min(14,z))),z=Math.min(z+1,12),{longitude:Q,latitude:D,zoom:z}}function W1(u,c,g,y){var x;if(c){const C=c.loops[0],T=c.loops.length,Q=[{label:"hops",value:C.size},{label:"seen",value:C.minCertainCount}],D=[];return C.includesLocal&&D.push({text:"★ Includes your node",color:"text-sys-amber"}),T>1&&D.push({text:`+${T-1} overlapping`,color:"text-sys-indigo/70"}),{type:"loop",title:{icon:"⟳",text:`Redundant Path${T>1?"s":""}`,color:"text-sys-indigo"},subtitle:{text:`${c.nodeNames.join(" → ")} → ${c.nodeNames[0]}`,color:"text-fg-secondary",mono:!0},stats:Q,badges:D}}if((u==null?void 0:u.type)==="neighbor"){const C=u.properties,T=[];C.rssi!==void 0&&C.rssi!==null&&T.push({label:"RSSI",value:`${Math.round(C.rssi)} dBm`,unit:C.hasAvgRssi?"avg":void 0}),C.snr!==void 0&&C.snr!==null&&T.push({label:"SNR",value:`${Number(C.snr).toFixed(1)} dB`,unit:C.hasAvgSnr?"avg":void 0});const Q=C.listenerScore??0,D=C.loudScore??0,E=Q>0||D>0;return E&&(T.push({label:"listener",value:Q,color:"text-sys-green"}),T.push({label:"loud",value:D,color:"text-sys-red"})),C.packetCount!==void 0&&!E&&T.push({label:"packets",value:Number(C.packetCount).toLocaleString()}),{type:"neighbor",title:{icon:"●",text:C.prefix?`${C.name} (${C.prefix})`:C.name,color:"text-sys-amber"},subtitle:{text:"Direct RF Neighbor",color:"text-sys-amber/70"},stats:T,badges:[]}}if((u==null?void 0:u.type)==="topology"){const C=u.properties,T=g>0?Number(C.certainCount)/g:0,Q=[{label:"validations",value:C.certainCount},{label:"of max traffic",value:`${Math.round(T*100)}%`},{label:"confidence",value:`${Math.round(Number(C.confidence)*100)}%`}];if(C.symmetryRatio!==void 0&&C.symmetryRatio<1){const L=C.dominantDirection==="forward"?"→":C.dominantDirection==="reverse"?"←":"↔";Q.push({label:"symmetric",value:`${L} ${Math.round(C.symmetryRatio*100)}%`,color:"text-fg-muted"})}const D=(x=y==null?void 0:y.get(C.key))==null?void 0:x.traceQuality;if(D!=null&&D.composite){const L=D.composite;Q.push({label:"trace SNR",value:`${L.mean.toFixed(1)} dB`,unit:`n=${L.count}`,color:L.mean>=10?"text-sys-green":L.mean>=0?"text-sys-amber":"text-sys-red"}),D.asymmetryDb!=null&&D.asymmetryDb>1&&Q.push({label:"asymmetry",value:`${D.asymmetryDb.toFixed(1)} dB`,color:D.asymmetryDb>5?"text-sys-red":"text-sys-amber"})}const E=[];if(C.isBackbone&&E.push({text:"Backbone",color:"text-zinc-300"}),C.isLoopEdge&&E.push({text:"Redundant",color:"text-sys-indigo"}),C.isDirectPath&&E.push({text:"Direct Path",color:"text-sys-teal"}),D){const L=D.quality==="excellent"||D.quality==="good"?"text-sys-green":D.quality==="fair"?"text-sys-amber":D.quality==="poor"||D.quality==="critical"?"text-sys-red":"text-fg-muted";D.quality!=="unknown"&&E.push({text:`TRACE ${D.quality}`,color:L})}return{type:"topology",title:{icon:"",text:`${C.fromName} ↔ ${C.toName}`,color:"text-fg-primary"},stats:Q,badges:E}}return null}function Y1({data:u}){const c=u.subtitle&&u.type==="loop",g=u.subtitle&&u.type!=="loop";return m.jsxs("div",{className:"w-[540px]",children:[m.jsxs("div",{className:"flex items-center justify-between h-5",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.title.icon&&m.jsx("span",{className:`${u.title.color} text-base leading-none flex-shrink-0`,children:u.title.icon}),m.jsx("span",{className:`${u.title.color} font-semibold text-[13px] truncate`,children:u.title.text}),g&&m.jsx("span",{className:`${u.subtitle.color} text-[11px] flex-shrink-0`,children:u.subtitle.text})]}),u.badges.length>0&&m.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:u.badges.map((y,x)=>m.jsx("span",{className:`${y.color} text-[11px] font-medium`,children:y.text},x))})]}),c&&m.jsx("div",{className:"h-4 mt-0.5 overflow-hidden",children:m.jsx("span",{className:"type-data-xs text-fg-muted truncate block",children:u.subtitle.text})}),m.jsx("div",{className:`flex items-center gap-4 h-4 ${c?"mt-1":"mt-1.5"} text-[11px]`,children:u.stats.map((y,x)=>m.jsxs("span",{className:"whitespace-nowrap",children:[m.jsx("span",{className:`font-mono tabular-nums font-semibold ${y.color??"text-fg-primary"}`,children:y.value}),m.jsx("span",{className:"text-fg-muted ml-1",children:y.label}),y.unit&&m.jsx("span",{className:"text-fg-muted/50 ml-0.5",children:y.unit})]},x))})]})}function Fh({neighbors:u,localNode:c,localHash:g,onRemoveNode:y,selectedNodeHash:x,onNodeSelected:C,highlightedEdgeKey:T,highlightedGhost:Q}){_o(il);const D=j.useRef(null),E=Ta(),L=ja(),O=Eo(),z=Ra(),$=Ia(),V=Bo(),[AA,oA]=j.useState(!1),eA=or(H=>H.viewState),Y=or(H=>H.toggles),cA=or(H=>H.hasAnalyzed),lA=or(H=>H.setViewState),bA=or(H=>H.setToggle),iA=or(H=>H.setHasAnalyzed),fA=or(H=>H.modalMapOpen),DA=as(H=>H.preloadFromNodes),TA=as(H=>H.isLoading),CA=as(H=>H.terrainGrid),mA=g??z,IA=j.useMemo(()=>{const H=[];for(const[,sA]of Object.entries(u))sA.latitude&&sA.longitude&&H.push([sA.latitude,sA.longitude]);return H},[u]),NA=j.useMemo(()=>V1(IA,c),[IA,c]),[FA,GA]=j.useState(()=>eA??NA??H1),vA=j.useCallback(H=>{GA(H),queueMicrotask(()=>lA(H))},[lA]),uA=j.useRef(!!eA);j.useEffect(()=>{!uA.current&&NA&&!eA?(GA(NA),queueMicrotask(()=>lA(NA)),uA.current=!0,setTimeout(()=>oA(!0),50)):eA&&setTimeout(()=>oA(!0),50)},[NA,eA,lA]);const[hA,jA]=j.useState(!1),[MA,VA]=j.useState(()=>Y.showTopology&&!O.topologyLoadComplete?!1:Y.showTopology),[ue,JA]=j.useState(Y.showNeighborLines),[KA,UA]=j.useState(!1),[Ie,Le]=j.useState(Y.showMinCut),[se,pe]=j.useState(rf),[be,$e]=j.useState(Y.show3DTerrain),[Ce,Ee]=j.useState(Y.showLinkQuality),[Me,ye]=j.useState(()=>Y.nodeFilters.length>0?Y.nodeFilters:[...un]),Ze=j.useCallback(H=>{VA(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showTopology",yA)),yA})},[bA]),Je=j.useCallback(H=>{JA(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showNeighborLines",yA)),yA})},[bA]),At=j.useCallback(H=>{Le(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showMinCut",yA)),yA})},[bA]),nt=j.useCallback(H=>{$e(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("show3DTerrain",yA)),yA})},[bA]),kt=j.useCallback(H=>{Ee(sA=>{const yA=typeof H=="function"?H(sA):H;return queueMicrotask(()=>bA("showLinkQuality",yA)),yA})},[bA]),Qe=j.useCallback(H=>{ye(H),queueMicrotask(()=>bA("nodeFilters",H))},[bA]),[Xe,Be]=j.useState(null),[Ge,ot]=j.useState(null),[Ft,k0]=j.useState(null),[Jt,Xt]=j.useState(null),[N0]=j.useState(0),[J0]=j.useState(.5),[C0]=j.useState(0),[Ut,E0]=j.useState(null),[X0,c0]=j.useState(""),[Ar,F0]=j.useState(!1),[pA,f0]=j.useState(!1),[ut,Pe]=j.useState(()=>cA&&!O.topologyLoadComplete?!1:cA);j.useEffect(()=>{if(O.topologyLoadComplete)return;const H=cA&&!ut,sA=Y.showTopology&&!MA;!H&&!sA||queueMicrotask(()=>{H&&iA(!1),sA&&bA("showTopology",!1)})},[cA,Y.showTopology,O.topologyLoadComplete,ut,MA,iA,bA]);const o0=j.useCallback(H=>{Pe(H),queueMicrotask(()=>iA(H))},[iA]),[qe,vt]=j.useState(null),Ct=j.useCallback(H=>vt(H),[]),A0=j.useCallback(()=>vt(null),[]),[,bt]=j.useState(new Set),Pt=cn(H=>H.coveragePoints),pt=cn(H=>H.isVisible),rA=cn(H=>H.brightness),gA=cn(H=>H.openModal),RA=wf(),xA=vf(),t=wo(),b=La(),ge=j.useRef(!1);j.useEffect(()=>{Pt.length>0&&pt&&!ge.current&&(Je(!1),ge.current=!0)},[Pt.length,pt]);const De=j.useRef(null);j.useEffect(()=>{if(x&&x!==De.current){De.current=x;const H=setTimeout(()=>{vt(x)},1250);return()=>clearTimeout(H)}},[x]);const[Ve,$A]=j.useState(null),[xe,lt]=j.useState(null),_e=j.useCallback((H,sA,yA)=>{ot(H),H&&sA&&yA?$A({longitude:sA[0],latitude:sA[1],type:"topology",properties:{key:yA.key,fromName:yA.fromName,toName:yA.toName,certainCount:yA.certainCount,confidence:yA.confidence,isBackbone:yA.isBackbone,isLoopEdge:yA.isLoopEdge,isDirectPath:yA.isDirectPath,isHubConnection:yA.isHubConnection,symmetryRatio:yA.symmetryRatio,dominantDirection:yA.dominantDirection}}):H||$A(null)},[]),ie=j.useCallback((H,sA)=>{lt(H),H&&$A(null)},[]),rt=j.useMemo(()=>{var WA;if(!MA||!Xe||Ge)return null;const H=E.loops;if(H.length===0)return null;const sA=Iu(Xe,H,E.edgeMap);if(sA.loops.length===0)return null;const LA=sA.loops[0].nodes.map(he=>{var oe,Oe;return he===mA?"You":((oe=u[he])==null?void 0:oe.node_name)||((Oe=u[he])==null?void 0:Oe.name)||he.substring(0,4)});return{loops:sA.loops,highlightedEdgeKeys:sA.highlightedEdgeKeys,hoveredEdgeKey:((WA=sA.sortedEdges[0])==null?void 0:WA.key)||"",nodeNames:LA}},[MA,Xe,Ge,E.loops,E.edgeMap,u,mA]);j.useEffect(()=>{Ge||lt(rt)},[rt,Ge]);const Qt=j.useMemo(()=>{const H={};for(const[sA,yA]of Object.entries(u))H[sA]=yA.node_name||yA.name||sA.substring(0,4);return mA&&(H[mA]="You"),H},[u,mA]),h0=j.useMemo(()=>{const H=new Map;for(const[sA,yA]of Object.entries(u)){const LA=sA.slice(0,2).toUpperCase(),WA=yA.node_name||yA.name||LA;H.set(LA,WA)}return mA&&H.set(mA.slice(0,2).toUpperCase(),"You"),H},[u,mA]),gt=j.useMemo(()=>Object.entries(u).filter(([,H])=>H.latitude&&H.longitude),[u]),Te=j.useMemo(()=>{const H=new Map;mA&&(c!=null&&c.latitude)&&(c!=null&&c.longitude)&&H.set(mA,[c.latitude,c.longitude]);for(const[sA,yA]of gt)yA.latitude&&yA.longitude&&H.set(sA,[yA.latitude,yA.longitude]);return H},[mA,c,gt]),at=j.useMemo(()=>{const H=new Map;for(const sA of L)sA.status!=="expired"&&H.set(sA.hash,{hash:sA.hash,prefix:sA.prefix,count:sA.count,avgRssi:sA.avgRssi,avgSnr:sA.avgSnr,lastSeen:sA.lastSeen,confidence:1,status:sA.status});return H},[L]),Ne=j.useMemo(()=>{var sA,yA;const H=new Set;for(const LA of at.keys())(sA=u[LA])!=null&&sA.latitude&&((yA=u[LA])!=null&&yA.longitude)&&H.add(LA);return H},[at,u]),et=ks(),P0=j.useMemo(()=>{if(Ne.size===0||!mA)return new Map;if(et.length===0)return new Map;const H=pr(mA);return Oa(et,Ne,H).scores},[Ne,mA,et]),yt=j.useMemo(()=>{var wt;if(!qe)return null;if(qe==="local"&&c)return{isLocal:!0,name:c.name,hash:mA,hashPrefix:mA?pr(mA):"",longitude:c.longitude,latitude:c.latitude};const H=u[qe];if(!H)return null;const sA=Ne.has(qe),yA=E.hubNodes.includes(qe),LA=((wt=E.gatewayNodes)==null?void 0:wt.includes(qe))??!1,WA=E.mobileNodes.includes(qe),he=mi(H),oe=at.get(qe),Oe=E.fullAffinity.get(qe),ze=E.txDelayRecommendations.get(qe);return{isLocal:!1,hash:qe,hashPrefix:pr(qe),name:H.node_name||H.name||"Unknown",isHub:yA,isGateway:LA,isBackbone:(ze==null?void 0:ze.networkRole)==="backbone",isZeroHop:sA,isMobile:WA,isRoomServer:he.isRoomServer,isStale:(()=>{const ct=H.last_seen||(oe==null?void 0:oe.lastSeen);return ct?(Date.now()-ct*1e3)/(1e3*60*60*24)>=5:!1})(),lastSeenTimestamp:H.last_seen||(oe==null?void 0:oe.lastSeen),centrality:E.centrality.get(qe)||0,affinity:Oe,meanSnr:(oe==null?void 0:oe.avgSnr)??void 0,meanRssi:(oe==null?void 0:oe.avgRssi)??void 0,neighbor:H,txDelayRec:ze}},[qe,c,mA,u,Ne,E,at]),ZA=j.useCallback(H=>mA?!!(H.fromHash===mA&&Ne.has(H.toHash)||H.toHash===mA&&Ne.has(H.fromHash)):!1,[mA,Ne]),S=j.useMemo(()=>{var sA,yA;if(L.length===0||!mA)return[];if(O.backgroundLoadComplete)return[];const H=[];for(const LA of L){if(LA.status==="expired"||!((sA=u[LA.hash])!=null&&sA.latitude)||!((yA=u[LA.hash])!=null&&yA.longitude))continue;const WA=[mA,LA.hash].sort(),he=`${WA[0]}~${WA[1]}`;H.push({fromHash:mA,toHash:LA.hash,key:he,packetCount:LA.count,avgConfidence:1,strength:.8,avgRecency:1,hopDistanceFromLocal:0,isHubConnection:!1,isCertain:!0,certainCount:LA.count,isLoopEdge:!1,forwardCount:LA.count,reverseCount:0,symmetryRatio:0,dominantDirection:"forward",floodCount:LA.count,directCount:0,isDirectPathEdge:!1,isZeroHop:!0,avgRssi:LA.avgRssi,avgSnr:LA.avgSnr})}return H},[L,mA,O.backgroundLoadComplete,u]),OA=j.useMemo(()=>{const H=[];if(S.length>0&&!O.backgroundLoadComplete){for(const sA of S){const yA=Te.get(sA.fromHash),LA=Te.get(sA.toHash);yA&&LA&&H.push({from:yA,to:LA,edge:sA})}return H}for(const sA of E.validatedEdges){if(ZA(sA))continue;const yA=Te.get(sA.fromHash),LA=Te.get(sA.toHash);yA&&LA&&H.push({from:yA,to:LA,edge:sA})}return H},[E.validatedEdges,Te,ZA,S,O.backgroundLoadComplete]),Ot=j.useMemo(()=>{const H=[];for(const sA of E.weakEdges){if(ZA(sA))continue;const yA=Te.get(sA.fromHash),LA=Te.get(sA.toHash);yA&&LA&&H.push({from:yA,to:LA,edge:sA})}return H},[E.weakEdges,Te,ZA]),S0=j.useMemo(()=>{if(!(c!=null&&c.latitude)||!(c!=null&&c.longitude))return[];const H=[],sA=[c.latitude,c.longitude],yA=new Map;for(const WA of E.lastHopNeighbors)yA.set(WA.hash,WA.count);const LA=new Map;for(const WA of L)LA.set(WA.hash,WA.count);for(const WA of Ne){const he=u[WA];if(!(he!=null&&he.latitude)||!(he!=null&&he.longitude))continue;const oe=LA.get(WA),Oe=yA.get(WA);H.push({from:sA,to:[he.latitude,he.longitude],hash:WA,neighbor:he,lastHopData:at.get(WA)??null,rxAdvertCount:oe,txProxyCount:Oe})}return H},[c,Ne,u,at,E.lastHopNeighbors,L]),l0=j.useMemo(()=>new Set(E.loopEdgeKeys),[E.loopEdgeKeys]),a0=j.useMemo(()=>new Set(E.backboneEdges),[E.backboneEdges]),M0=j.useMemo(()=>{if(!Ft)return null;const H=E.validatedEdges.filter(WA=>WA.fromHash===Ft||WA.toHash===Ft);if(H.length===0)return null;const sA=[...H].sort((WA,he)=>he.certainCount-WA.certainCount),yA=Math.max(1,Math.ceil(sA.length*.2)),LA=sA.slice(0,yA);return new Set(LA.map(WA=>WA.key))},[Ft,E.validatedEdges]),k=j.useMemo(()=>{let H=0;if(S.length>0&&!O.backgroundLoadComplete){for(const sA of S)sA.certainCount>H&&(H=sA.certainCount);return H||1}for(const sA of E.validatedEdges)sA.certainCount>H&&(H=sA.certainCount);return H||1},[E.validatedEdges,S,O.backgroundLoadComplete]),Et=j.useMemo(()=>{if(E.validatedEdges.length===0)return null;const H=new Set;for(const LA of E.validatedEdges)H.add(LA.fromHash),H.add(LA.toHash);const sA=Array.from(H).filter(LA=>Te.has(LA)).sort();if(sA.length<3)return null;const yA=new Map;for(const LA of sA){const WA=Te.get(LA);WA&&yA.set(LA,WA)}return Ja(E.validatedEdges,sA,yA,E.edgeBetweenness)},[E.validatedEdges,Te,E.edgeBetweenness]),d0=j.useCallback(()=>{At(H=>{const sA=!H;if(sA&&Et&&D.current){const yA=D.current.getMap();if(!yA)return sA;let LA=1/0,WA=-1/0,he=1/0,oe=-1/0,Oe=!1;for(const[,ze]of Et.communities)for(const wt of ze){const ct=Te.get(wt);if(ct){const[tt,Dt]=ct;he=Math.min(he,tt),oe=Math.max(oe,tt),LA=Math.min(LA,Dt),WA=Math.max(WA,Dt),Oe=!0}}Oe&&yA.fitBounds([[LA,he],[WA,oe]],{padding:{top:60,bottom:100,left:60,right:320},duration:800,maxZoom:14})}return sA})},[Et,Te]),m0=j.useRef(null);j.useLayoutEffect(()=>{var H,sA;m0.current=((sA=(H=D.current)==null?void 0:H.getMap)==null?void 0:sA.call(H))??null});const Q0=ks();c1({map:m0,nodeCoordinates:Te,packets:Q0,localHash:mA,neighbors:u,meshTopology:E,enabled:RA});const{isExiting:B0,isAnimating:h,resetAnimationState:v}=K2({map:m0,showTopology:MA,validatedPolylines:OA,weakPolylines:Ot,maxCertainCount:k,loopEdgeKeys:l0,backboneEdgeKeys:a0,highlightedEdgeKey:T,neighbors:u,validatedSourceId:js,weakSourceId:Rs,neighborPolylines:S0,showNeighborLines:ue,neighborSourceId:Is,neighborLinkScores:P0,basemapMode:t}),_=j.useMemo(()=>{const H=new Set;for(const sA of E.hubNodes){H.add(sA);for(const yA of E.validatedEdges)yA.fromHash===sA&&H.add(yA.toHash),yA.toHash===sA&&H.add(yA.fromHash)}return H},[E.hubNodes,E.validatedEdges]),P=j.useMemo(()=>{const H=new Set;if(!g)return H;for(const sA of E.validatedEdges)sA.fromHash===g&&H.add(sA.toHash),sA.toHash===g&&H.add(sA.fromHash);return H},[g,E.validatedEdges]),J=j.useMemo(()=>{const H=new Map;for(const[sA,yA]of gt)H.set(sA,mi(yA).type);return H},[gt]),K=j.useMemo(()=>{let H=0,sA=0,yA=0;for(const[,LA]of J)LA==="repeater"?H++:LA==="companion"||LA==="unknown"?sA++:LA==="room_server"&&yA++;return{repeater:H,companion:sA,room_server:yA,hubs:E.hubNodes.length,direct:Ne.size}},[J,E.hubNodes.length,Ne.size]),aA=j.useMemo(()=>new Set(Me),[Me]),{getNodeOpacity:_A}=$2({activeFilters:aA,neighborHashes:gt.map(([H])=>H),hubConnectedNodes:_,directNodeSet:Ne,localConnectedNodes:P,nodeTypeMap:J,showTopology:MA}),{blinkingNodes:XA,blinkColor:Ae}=X2({neighbors:u,localHash:g,enabled:RA}),fe=j.useCallback(H=>{if(aA.size===0)return!1;const sA=J.get(H)??"unknown";return!!(aA.has("repeater")&&sA==="repeater"||aA.has("companion")&&(sA==="companion"||sA==="unknown")||aA.has("room_server")&&sA==="room_server"||aA.has("direct")&&Ne.has(H)||aA.has("hubs")&&_.has(H))},[aA,J,Ne,_]),Ue=j.useCallback(()=>{f0(!0),F0(!0)},[]),St=j.useCallback(()=>{ut?Ze(H=>!H):Ue()},[ut,Ue]),Mt=j.useCallback(H=>{vA(H.viewState),(H.viewState.pitch??0)>10&&!be&&nt(!0)},[be]),xt=j.useCallback(()=>{jA(H=>{var LA,WA,he,oe,Oe,ze,wt;const sA=!H,yA=(he=(WA=(LA=D.current)==null?void 0:LA.getContainer())==null?void 0:WA.closest(".map-container-fullscreen, .map-container-16-9"))==null?void 0:he.parentElement;return sA?yA&&document.fullscreenEnabled?(oe=yA.requestFullscreen)==null||oe.call(yA).catch(()=>{}):yA&&document.webkitFullscreenEnabled&&((Oe=yA.webkitRequestFullscreen)==null||Oe.call(yA)):document.fullscreenElement?(ze=document.exitFullscreen)==null||ze.call(document).catch(()=>{}):document.webkitFullscreenElement&&((wt=document.webkitExitFullscreen)==null||wt.call(document)),sA})},[]),je=j.useCallback(()=>{const H=Me.length>=un.length;Qe(H?[]:[...un])},[Me,Qe]),Bt=j.useCallback(H=>{Me.length>=un.length?Qe([H]):Me.includes(H)?Qe(Me.filter(yA=>yA!==H)):Qe([...Me,H])},[Me,Qe]),p0=j.useCallback(()=>{Je(H=>!H)},[]),u0=j.useCallback(()=>{UA(H=>!H)},[]),O0=j.useCallback(()=>{kt(H=>{const sA=!H;return sA||Xt(null),sA})},[]),e0=j.useCallback(()=>{nt(H=>{const sA=!H;if(D.current){const yA=D.current.getMap();yA&&yA.stop()}if(sA&&D.current){const yA=D.current.getMap();yA&&yA.easeTo({pitch:45,duration:1500,easing:No})}if(!sA&&D.current){const yA=D.current.getMap();yA&&yA.easeTo({pitch:0,bearing:0,duration:800,easing:iu})}return sA})},[]),D0=j.useCallback(()=>{MA||Ze(!0)},[MA]),er=j.useCallback((H,sA)=>{E0(H),c0(sA)},[]),tr=j.useCallback(()=>{Ut&&y&&y(Ut),E0(null),c0("")},[Ut,y]),Ur=j.useMemo(()=>[...M1,...v1,...Ce?[Qn]:[]],[Ce]),Vr=j.useCallback(H=>{var yA;if((yA=H.features)==null?void 0:yA.some(LA=>{var WA,he;return(he=(WA=LA.layer)==null?void 0:WA.id)==null?void 0:he.startsWith("node-markers-")})){$A(null),ot(null);return}if(Ce&&H.features&&H.features.length>0){const LA=H.features.find(WA=>{var he;return((he=WA.layer)==null?void 0:he.id)===Qn});if(LA!=null&&LA.properties){const{fromHash:WA,toHash:he}=LA.properties;if(WA&&he){const oe=V.find(Oe=>Oe.nodeA.hash===WA&&Oe.nodeB.hash===he||Oe.nodeA.hash===he&&Oe.nodeB.hash===WA);if(oe){Xt(oe),vt(null);return}}}}vt(null),$A(null),ot(null),k0(null),Xt(null)},[Ce,V]),Wr=j.useCallback(H=>{k0(sA=>sA===H?null:H),Xt(null)},[]),zt=j.useCallback(H=>{var Oe,ze,wt;if(!H.features||H.features.length===0)return;if(H.features.some(ct=>{var tt,Dt;return(Dt=(tt=ct.layer)==null?void 0:tt.id)==null?void 0:Dt.startsWith("node-markers-")})){Ge&&(ot(null),$A(null));return}if(Ce&&H.features.some(ct=>{var tt;return((tt=ct.layer)==null?void 0:tt.id)===Qn})){try{(Oe=D.current)!=null&&Oe.getCanvas()&&(D.current.getCanvas().style.cursor="pointer")}catch{}return}const yA=H.features.find(ct=>{var Dt;const tt=(Dt=ct.layer)==null?void 0:Dt.id;return(tt==null?void 0:tt.startsWith("topology-"))||(tt==null?void 0:tt.startsWith("neighbor-"))});if(!yA)return;const LA=(ze=yA.layer)==null?void 0:ze.id,WA=yA.properties;if(!(WA!=null&&WA.key))return;const he=LA==null?void 0:LA.startsWith("topology-"),oe=LA==null?void 0:LA.startsWith("neighbor-");if(he||oe){const ct=WA.key.replace(/-loop[12]$/,"");ot(ct),H.lngLat&&$A({longitude:H.lngLat.lng,latitude:H.lngLat.lat,type:he?"topology":"neighbor",properties:WA})}try{(wt=D.current)!=null&&wt.getCanvas()&&(D.current.getCanvas().style.cursor="pointer")}catch{}},[Ge,Ce]),rr=j.useCallback(()=>{var H;ot(null),$A(null);try{(H=D.current)!=null&&H.getCanvas()&&(D.current.getCanvas().style.cursor="")}catch{}},[]),g0=hA?"map-container-fullscreen":"map-container-16-9",Fe=IA.length>0||(c==null?void 0:c.latitude)&&(c==null?void 0:c.longitude),y0=!AA||!Fe,_0=Fe;return m.jsxs("div",{className:`relative ${g0} ${hA?"":"rounded-2xl overflow-hidden"}`,role:"application","aria-label":"Mesh network contacts map","aria-describedby":"map-instructions","data-basemap":t,children:[m.jsx("span",{id:"map-instructions",className:"sr-only",children:"Interactive map showing mesh network contacts. Use mouse or touch to pan and zoom. Press Tab to navigate map controls. Press Escape to exit fullscreen mode."}),y0&&m.jsx("div",{className:"absolute inset-0 z-50 surface-base rounded-2xl flex items-center justify-center","aria-hidden":"true",children:m.jsxs("div",{className:"flex flex-col items-center gap-3",children:[m.jsx("div",{className:"w-6 h-6 border-2 border-sys-blue border-t-transparent rounded-full animate-spin"}),m.jsx("span",{className:"text-sm text-fg-muted",children:"Loading map..."})]})}),_0&&m.jsx("div",{className:`relative w-full h-full ${hA?"":"rounded-[1.125rem] overflow-hidden"} ${y0?"opacity-0":"opacity-100 transition-opacity duration-300"}`,style:fA?{visibility:"hidden"}:void 0,children:m.jsxs(Na,{ref:D,...FA,onMove:Mt,mapStyle:z1,style:{width:"100%",height:"100%"},attributionControl:!1,interactiveLayerIds:Ur,onMouseMove:zt,onMouseLeave:rr,onClick:Vr,onError:H=>{console.error("MapLibre error:",H.error)},onIdle:()=>{if(!CA&&!TA&&D.current){const H=D.current.getMap();if(H){const sA=Object.values(u).filter(yA=>yA.latitude&&yA.longitude).map(yA=>({latitude:yA.latitude,longitude:yA.longitude}));c!=null&&c.latitude&&(c!=null&&c.longitude)&&sA.push({latitude:c.latitude,longitude:c.longitude}),sA.length>0&&DA(sA,H)}}},children:[m.jsx(Fa,{position:"bottom-right"}),m.jsx(Pa,{mode:t}),m.jsx(x2,{enabled:be,exaggeration:4}),m.jsx(y2,{coveragePoints:Pt,visible:Pt.length>0&&pt,terrainEnabled:be,brightness:rA,basemapMode:t}),m.jsx(G2,{partition:Et,nodeCoordinates:Te,visible:Ie&&ut,opacity:se.opacity,bandwidth:se.bandwidth,threshold:se.threshold,strokeWidth:se.strokeWidth}),m.jsx(S1,{showTopology:MA,isExiting:B0,hoveredEdgeKey:Ge,highlightedLoopEdges:xe==null?void 0:xe.highlightedEdgeKeys,highlightedFocusEdges:M0,onEdgeHover:_e,onLoopHover:ie,loops:E.loops,neighborNames:Qt,opacityBias:N0,widthMultiplier:J0,trafficFilter:C0,showNeighborLines:ue,disableHover:h||pA}),m.jsx(L1,{visible:Ce,nodeCoordinates:Te,focusedNodeHash:Ft,basemapMode:t}),x&&m.jsx(B1,{targetHash:x,nodeCoordinates:Te,onComplete:C}),T&&m.jsx(D1,{highlightedEdgeKey:T,validatedPolylines:OA,weakPolylines:Ot,onEnsureTopology:D0}),m.jsx(O1,{ghost:Q??null,neighborCoordinates:Te,onHighlightedNeighborsChange:bt}),m.jsx(w1,{neighborsWithLocation:gt,localNode:c,localHash:g,zeroHopNeighbors:Ne,lastHopNeighborMap:at,meshTopology:E,hoveredMarker:Xe,onMarkerHover:Be,getNodeOpacity:_A,shouldShowNode:fe,openPopupId:qe,onOpenPopup:Ct,onClosePopup:A0,onNodeClick:Wr,blinkingNodes:XA,blinkColor:Ae})]})}),(()=>{const H=W1(Ve?{type:Ve.type,properties:Ve.properties}:null,xe,k,E.edgeMap);return H&&m.jsx("div",{className:"map-edge-tooltip",children:m.jsx("div",{className:"map-control-surface map-edge-tooltip-inner",children:m.jsx(Y1,{data:H})})})})(),m.jsx(yc,{mapRef:D,showNeighborLines:ue,onToggleNeighborLines:p0,hasNeighborPolylines:S0.length>0,nodeFilters:Me,onToggleFilter:Bt,onToggleAll:je,filterCounts:K,showCoverage:KA,onToggleCoverage:u0,showMinCut:Ie,onToggleMinCut:d0,hasMinCutData:ut&&Et!==null&&Et.numCommunities>1,show3DTerrain:be,onToggle3DTerrain:e0,basemapMode:t,onToggleBasemap:b,isFullscreen:hA,onToggleFullscreen:xt,showLinkQuality:Ce,onToggleLinkQuality:O0,hasTraceLinks:$}),m.jsx(yf,{data:yt,localNode:c,localColor:Un().localColor,onClose:A0,onRemove:y?er:void 0}),Ce&&Jt&&m.jsx(ff,{pair:Jt,onClose:()=>Xt(null),prefixToName:h0}),m.jsxs("div",{className:"map-legend-stack",children:[m.jsxs("div",{className:"map-tool-row",children:[m.jsx(Ec,{isActive:MA,hasAnalyzed:ut,isLoading:pA,onClick:St,basemapMode:t}),m.jsx(Tc,{isActive:RA,onClick:xA,basemapMode:t}),m.jsx(Fc,{isActive:Pt.length>0&&pt,onClick:gA,basemapMode:t})]}),m.jsx(mc,{showTopology:MA,validatedPolylineCount:OA.length,filteredNeighborCount:gt.length,hasLocalNode:!!(c!=null&&c.latitude&&(c!=null&&c.longitude)),meshTopology:E,zeroHopNeighbors:Ne,neighborsWithLocation:gt,basemapMode:t})]}),m.jsx(za,{isOpen:Ut!==null,onCancel:()=>E0(null),onConfirm:tr,title:"Remove Node?",message:`Remove "${X0}" from the contacts list? The node will reappear if it advertises again.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger"}),m.jsx(sc,{isOpen:Ar,onClose:()=>{F0(!1),f0(!1),v(),o0(!0),setTimeout(()=>Ze(!0),uc)}}),m.jsx(tf,{}),m.jsx(nf,{visible:Ie&&ut,onClose:()=>At(!1),settings:se,onSettingsChange:pe,partition:Et,totalNodes:Object.keys(u).length,basemapMode:t})]})}export{Fh as default}; diff --git a/frontend/dist/assets/Dashboard-C9aRadqs.js b/frontend/dist/assets/Dashboard-B603mHUm.js similarity index 98% rename from frontend/dist/assets/Dashboard-C9aRadqs.js rename to frontend/dist/assets/Dashboard-B603mHUm.js index 65efa134..e6852a51 100644 --- a/frontend/dist/assets/Dashboard-C9aRadqs.js +++ b/frontend/dist/assets/Dashboard-B603mHUm.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DZK2INMD.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); -import{d as Z,e as js,f as Rt,h as At,J as ws,k as Ns,n as vs,o as Ee,p as ks,r as f,M as Ms,q as Cs,_ as st,t as nt,v as Pt,w as Lt,x as Ts,y as te,z as Ss,j as t,A as Ke,m as ge,S as $t,D as Ft,U as _s,E as Bs,F as Pe,P as Ds,G as Rs,H as K,K as As,L as Y,N as we,O as Et,Q as It,R as ne,T as Ps,V as Ls,W as je,X as $s,Y as at,$ as Fs,a0 as Le,a1 as Es,a2 as Is,a3 as Hs,a4 as ie,a5 as Ht,a6 as zt,a7 as zs,B as $e,a8 as Ot,a9 as Gt,aa as Os,ab as Ne,ac as Q,ad as Wt,ae as qt,af as Gs,ag as Ws,ah as qs,ai as Xs,aj as Vs,ak as Ie,u as Xt,al as Us,am as ot,an as me,ao as Me,ap as Vt,aq as Ys,ar as Ce,as as Js,at as Zs,au as Ks,av as rt,aw as Qs,c as J,ax as en,ay as Ut,az as it,aA as Yt,aB as Jt,aC as tn,aD as ve,aE as sn,aF as nn,aG as an,aH as Qe,aI as on,aJ as Zt,aK as Kt,aL as rn,aM as ln,Z as lt,aN as cn,aO as dn,aP as un,aQ as ct}from"./index-DZK2INMD.js";import{C as dt,P as mn,a as fn,B as pn}from"./PageLayout-F1v-IzhG.js";import{u as fe,r as pe,h as hn,a as xn,b as gn,i as yn}from"./consumer-registry-C58OO1Zb.js";import{A as re,D as Ye}from"./DataValue-C6Gh85-I.js";import{c as bn}from"./node-types-Cj1JOOlq.js";import{b as Qt,c as ye,a as jn,d as wn,F as Te}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as Nn,u as Je,P as vn,T as kn,C as es}from"./PacketList-DyZLMo3F.js";import{useGetDecodedContent as Mn,useResolveSource as Cn}from"./usePipelineStore-BRm0f890.js";import{A as ut}from"./arrow-right-BW1lsEoU.js";import{T as ts,M as Tn}from"./MqttModeBadge-CK543WcH.js";import{L as ss}from"./LightSparkline-D9e7Om82.js";import{c as Sn}from"./link-scoring-D2b5sONh.js";import{Z as _n}from"./zap-CV3qJZPu.js";import{W as Bn,A as Dn,N as Rn}from"./AutoConfigureDialog-Biwer_fL.js";import{g as An,e as He,a as Pn,f as Ln}from"./chat-utils-B9fA4l9w.js";import{M as ns,C as $n}from"./ChatBubble-BfbDZnhb.js";import{C as mt}from"./chevron-right-DYHNTpxG.js";import{H as Fn}from"./hash-Bx-gtxz0.js";import{M as En}from"./message-square-Cb8LlwAg.js";import{S as In}from"./shield-check-8Y0lJQvU.js";import{u as ue}from"./index-C-Mp31KV.js";import{H as Hn}from"./useMapViewStore-DGeq1iXE.js";import{R as ft}from"./Grid-TGa3qLqq.js";import"./chevron-up-Bm8_AtG8.js";import"./primitives-NoSyYVE-.js";import"./badge-colors-BNUqIXCA.js";import"./SignalIndicator-BlRL2nuG.js";import"./arrow-up-DJJcQ7dG.js";import"./map-pin-qwXb-K8z.js";import"./circle-question-mark-BdE_X9p5.js";import"./triangle-alert-z32LI9zM.js";import"./DataBox-BEDP2Kxh.js";import"./layers-Bh2LK6a1.js";import"./clock-CZYZYW0y.js";import"./activity-F7Po-3Al.js";import"./circle-check-DiKh03Ex.js";import"./database-DWx780B3.js";import"./shield-tOGn5YjL.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B9Nfzawy.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); +import{d as Z,e as js,f as Rt,h as At,J as ws,k as Ns,n as vs,o as Ee,p as ks,r as f,M as Ms,q as Cs,_ as st,t as nt,v as Pt,w as Lt,x as Ts,y as te,z as Ss,j as t,A as Ke,m as ge,S as $t,D as Ft,U as _s,E as Bs,F as Pe,P as Ds,G as Rs,H as K,K as As,L as Y,N as we,O as Et,Q as It,R as ne,T as Ps,V as Ls,W as je,X as $s,Y as at,$ as Fs,a0 as Le,a1 as Es,a2 as Is,a3 as Hs,a4 as ie,a5 as Ht,a6 as zt,a7 as zs,B as $e,a8 as Ot,a9 as Gt,aa as Os,ab as Ne,ac as Q,ad as Wt,ae as qt,af as Gs,ag as Ws,ah as qs,ai as Xs,aj as Vs,ak as Ie,u as Xt,al as Us,am as ot,an as me,ao as Me,ap as Vt,aq as Ys,ar as Ce,as as Js,at as Zs,au as Ks,av as rt,aw as Qs,c as J,ax as en,ay as Ut,az as it,aA as Yt,aB as Jt,aC as tn,aD as ve,aE as sn,aF as nn,aG as an,aH as Qe,aI as on,aJ as Zt,aK as Kt,aL as rn,aM as ln,Z as lt,aN as cn,aO as dn,aP as un,aQ as ct}from"./index-B9Nfzawy.js";import{C as dt,P as mn,a as fn,B as pn}from"./PageLayout-Da0xfaXb.js";import{u as fe,r as pe,h as hn,a as xn,b as gn,i as yn}from"./consumer-registry-B_rYsmHo.js";import{A as re,D as Ye}from"./DataValue-Ddo4mrzf.js";import{c as bn}from"./node-types-D2DQet2e.js";import{b as Qt,c as ye,a as jn,d as wn,F as Te}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as Nn,u as Je,P as vn,T as kn,C as es}from"./PacketList-CO1EDTYK.js";import{useGetDecodedContent as Mn,useResolveSource as Cn}from"./usePipelineStore-Dto_OrsT.js";import{A as ut}from"./arrow-right-BbRfzTpf.js";import{T as ts,M as Tn}from"./MqttModeBadge-Bgn-nTpu.js";import{L as ss}from"./LightSparkline-DTXOFhS4.js";import{c as Sn}from"./link-scoring-353AdDOu.js";import{Z as _n}from"./zap-DME89Nfc.js";import{W as Bn,A as Dn,N as Rn}from"./AutoConfigureDialog-D-tiCDMu.js";import{g as An,e as He,a as Pn,f as Ln}from"./chat-utils-CXtTpLY5.js";import{M as ns,C as $n}from"./ChatBubble-fzIllzhe.js";import{C as mt}from"./chevron-right-jwX-OOTu.js";import{H as Fn}from"./hash-fRZDKNyT.js";import{M as En}from"./message-square-C9xeBmVh.js";import{S as In}from"./shield-check-Bx84Eo-l.js";import{u as ue}from"./index-CHkxpv0k.js";import{H as Hn}from"./useMapViewStore-CAlaFCdd.js";import{R as ft}from"./Grid-CbgS5PRh.js";import"./chevron-up-DvNDOaHb.js";import"./primitives-DkuSh1mR.js";import"./badge-colors-BNUqIXCA.js";import"./SignalIndicator-BAKXIHs1.js";import"./arrow-up-1am5_GF2.js";import"./map-pin-Z2xK57U6.js";import"./circle-question-mark-Br2ku42v.js";import"./triangle-alert-_KPqiYkd.js";import"./DataBox-CCBd3sT4.js";import"./layers-DHyjQOGN.js";import"./clock-CCOO2GB9.js";import"./activity-CcUqK62Y.js";import"./circle-check-m0ROsc83.js";import"./database-CSUiI1CG.js";import"./shield-5eYUHkwt.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -59,7 +59,7 @@ import{d as Z,e as js,f as Rt,h as At,J as ws,k as Ns,n as vs,o as Ee,p as ks,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aa=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],oa=Z("timer",aa);function ra(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],c=e[3+o],i=js(r,a,c);return n?i(s):i}function ia(e,n,o={}){const s=e.get();let r=null,a=s,c;const i=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,d=()=>{r&&(r.stop(),r=null)},u=()=>{d();const m=gt(e.get()),j=gt(a);m!==j&&(r=new ws({keyframes:[m,j],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:c}))};if(e.attach((m,j)=>{a=m,c=l=>j(xt(l,i)),Rt.postRender(()=>{var l;u(),(l=e.events.animationStart)==null||l.notify(),r==null||r.then(()=>{var x;(x=e.events.animationComplete)==null||x.notify()})})},d),At(n)){const m=n.on("change",l=>e.set(xt(l,i))),j=e.on("destroy",m);return()=>{m(),j()}}return d}function xt(e,n){return n?e+n:e}function gt(e){return typeof e=="number"?e:parseFloat(e)}function is(e,n){const o=ue(n()),s=()=>o.set(n());return s(),Ns(()=>{const r=()=>Rt.preRender(s,!1,!0),a=e.map(c=>c.on("change",r));return()=>{a.forEach(c=>c()),vs(s)}}),o}function la(e){Ee.current=[],e();const n=is(Ee.current,e);return Ee.current=void 0,n}function ca(e,n,o,s){if(typeof e=="function")return la(e);const a=ra(n,o,s);return Array.isArray(e)?yt(e,a):yt([e],([c])=>a(c))}function yt(e,n){const o=ks(()=>[]);return is(e,()=>{o.length=0;const s=e.length;for(let r=0;rAt(e)?e.get():e;if(o)return ca(s);const r=ue(s());return f.useInsertionEffect(()=>ia(r,e,n),[r,JSON.stringify(n)]),r}function Se(e,n={}){return da(e,{type:"spring",...n})}const oe=Cs(()=>({result:null,isComputing:!1})),ua=500,ma=300;let ce=null,_e=null;function fa(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 pa(){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 ha(e,n,o,s){const r=pa();if(!r)return;const a=e.length,c=new Float64Array(a),i=new Float64Array(a),d=new Uint16Array(a),u=new Uint8Array(a),m=new Uint8Array(a),j=new Uint8Array(a),l=new Uint8Array(a),x=new Float32Array(a),v=new Float32Array(a),h=new Uint32Array(a),y=new Map;let T=0;for(let D=0;DparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function xa(e,n,o){const s={...e,received:[...e.received],unique_received:[...e.unique_received],transmitted:[...e.transmitted],forwarded:[...e.forwarded],dropped:[...e.dropped],receivedBytesBuckets:e.receivedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:c,bucket_count:i}=e,d=new Set;for(const m of n){const j=m.timestamp??0;if(ja)continue;const l=Math.floor((j-r)/c);if(l<0||l>=i)continue;d.has(l)||(d.add(l),s.received[l]={...s.received[l]},s.unique_received[l]={...s.unique_received[l]},s.transmitted[l]={...s.transmitted[l]},s.forwarded[l]={...s.forwarded[l]},s.dropped[l]={...s.dropped[l]});const x=Pt(m,o),v=m.length??m.payload_length??0,h=m.type??m.payload_type??0,y=m.packet_origin;y==="tx_local"?(s.transmitted[l].count++,s.transmitted[l].airtime_ms+=x):y==="tx_forward"||m.transmitted?(s.forwarded[l].count++,s.forwarded[l].airtime_ms+=x,s.forwardedBytesBuckets[l].bytesByType[h]=(s.forwardedBytesBuckets[l].bytesByType[h]??0)+v,s.forwardedBytesBuckets[l].totalBytes+=v,s.forwardedBytesBuckets[l].countByType[h]=(s.forwardedBytesBuckets[l].countByType[h]??0)+1,s.forwardedBytesBuckets[l].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+v,s.totalForwardedCount++):m.drop_reason&&(s.dropped[l].count++,s.dropped[l].airtime_ms+=x,s.droppedBytesBuckets[l].bytesByType[h]=(s.droppedBytesBuckets[l].bytesByType[h]??0)+v,s.droppedBytesBuckets[l].totalBytes+=v,s.droppedBytesBuckets[l].countByType[h]=(s.droppedBytesBuckets[l].countByType[h]??0)+1,s.droppedBytesBuckets[l].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+v,s.totalDroppedCount++),y!=="tx_local"&&(s.received[l].count++,s.received[l].airtime_ms+=x,s.unique_received[l].count++,s.unique_received[l].airtime_ms+=x,s.receivedBytesBuckets[l].bytesByType[h]=(s.receivedBytesBuckets[l].bytesByType[h]??0)+v,s.receivedBytesBuckets[l].totalBytes+=v,s.receivedBytesBuckets[l].countByType[h]=(s.receivedBytesBuckets[l].countByType[h]??0)+1,s.receivedBytesBuckets[l].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+v,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=v)}const u=s.time_range_minutes/60;return s.kbPerHour=u>0?Math.round(s.totalReceivedBytes/1024/u):0,s.forwardedRatePerHour=u>0?Math.round(s.totalForwardedCount/u):0,s.droppedRatePerHour=u>0?Math.round(s.totalDroppedCount/u):0,s.receivedActiveTypes=ze(s.receivedTotalByType),s.forwardedActiveTypes=ze(s.forwardedTotalByType),s.droppedActiveTypes=ze(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([st(()=>import("./index-DZK2INMD.js").then(e=>e.gi),__vite__mapDeps([0,1])),st(()=>import("./index-DZK2INMD.js").then(e=>e.gh),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(c=>{const i=c.packets.length,d=c.globalTimeRangeIndex,u=fa(c.stats);if(i===s&&d===r&&u===a)return;const m=s,j=r,l=a;if(s=i,r=d,a=u,i===0)return;const x=o[d]??o[4],v=x.minutes,h=x.buckets,y=c.stats,T=nt(y),S=i-m,D=d!==j,k=u!==l,N=oe.getState().result;if(!D&&!k&&S>0&&S{_e=null;const p=e.useStore.getState();if(p.packets.length===0||!p.stats)return;const B=o[p.globalTimeRangeIndex]??o[4],C=nt(p.stats);ha(p.packets,B.minutes,B.buckets,C)},ma)})});const ga=()=>oe(e=>e.result),ls=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:hn}];pe(ls);function ya(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function bt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const he=32,Oe=20,ba=[.25,.5,.75,1];function ja({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){fe(ls);const r=Lt(),[a,c]=f.useState(null),[i,d]=f.useState(null),[u,m]=f.useState(null),j=f.useCallback((k,N,b)=>{c(N),d(b)},[]),l=e.length>0&&n.length>0,x=a?ya(a.start):null,v=a?bt(a.start):"",h=u!==null&&x!==null&&u!==x;x!==u&&m(x);const y=f.useMemo(()=>Ts(e),[e]),T=s==="count"?te:Ss,S=f.useMemo(()=>y===0?[]:ba.map(k=>({pct:k,label:T(Math.round(y*k)),pos:(1-k)*100})),[y,T]),D=f.useMemo(()=>{if(e.length===0)return[];const k=e.length,N=Math.max(1,Math.floor(k/6)),b=[];for(let p=0;pt.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${b}%`,transform:k===1?"none":"translateY(-50%)",right:0},children:N},k))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:he,right:0,top:0,bottom:Oe},children:l&&t.jsx(_s,{buckets:e,activeTypes:n,gridColor:r.grid,axisTickColor:r.axisTick,onHover:j,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:he,height:Oe},"aria-hidden":"true",children:D.map((k,N)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${k.pos}%`,transform:N===0?"none":N===D.length-1?"translateX(-100%)":"translateX(-50%)"},children:k.label},N))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:l&&t.jsx(Bs,{activeTypes:n,totalByType:o,formatMode:s})})]})}const jt={top:8,right:8,bottom:28,left:48},wt={top:0,right:0,bottom:0,left:0};let Be=null,Nt=0;const wa=1e3;function Na(){const e=performance.now();return Be&&e-Nth&&(h=w),_>y&&(y=_)}h===0&&y===0?(h=1,y=1):h===0?h=1:y===0&&(y=1);const T=h*1.05,S=y*1.05,D=T+S;let k=T/D;k=Math.max(Fe,Math.min(1-Fe,k));const N=i-m,b=k*N,p=(1-k)*N,B=a+b,C=a+b+m,R=a+b+m/2;for(let g=0;g0)for(const $ of s){const M=P[$]??0;if(M===0)continue;const F=M/T*b,E=_-F;e.fillStyle=Pe($),e.fillRect(w,E,l,F),_=E}let L=C;const A=o[g].countByType;if(v[g]>0){const $=A[K]??0;if($>0){const M=$/S*p;e.fillStyle=Pe(K),e.fillRect(w,L,l,M),L+=M}for(const M of s){if(M===K)continue;const F=A[M]??0;if(F===0)continue;const E=F/S*p;e.fillStyle=Pe(M),e.fillRect(w,L,l,E),L+=E}}}return{baselineY:R,fwdHalf:b,drpHalf:p,fwdCeil:T,drpCeil:S,gapPx:m}}function ka(e,n,o,s,r,a,c,i,d,u,m=!1){if(n.length===0)return;const{baselineY:j,fwdHalf:l,drpHalf:x,fwdCeil:v,drpCeil:h,gapPx:y}=d,T=Na(),S=j-Math.ceil(y/2),D=j+Math.floor(y/2);e.save(),e.strokeStyle=c,e.lineWidth=1*u,e.setLineDash([]);const k=[.5,1];for(const N of k){const b=Math.round(S-N*l)+.5;e.beginPath(),e.moveTo(o,b),e.lineTo(o+r,b),e.stroke();const p=Math.round(D+N*x)+.5;e.beginPath(),e.moveTo(o,p),e.lineTo(o+r,p),e.stroke()}if(e.restore(),e.clearRect(o,j-Math.ceil(y/2),r,y),!m){e.save(),e.font=`bold ${10*u}px ${T}`,e.textAlign="left";const N=4*u,b=2*u;for(const p of k){const B=Math.round(v*p),C=Math.round(h*p),R=p===1,g=S-p*l,w=D+p*x;B>0&&(e.fillStyle=Y.green,e.globalAlpha=.7,R?(e.textBaseline="top",e.fillText(te(B),N,g+b)):(e.textBaseline="middle",e.fillText(te(B),N,g))),C>0&&(e.fillStyle=Y.red,e.globalAlpha=.7,R?(e.textBaseline="bottom",e.fillText(te(C),N,w-b)):(e.textBaseline="middle",e.fillText(te(C),N,w)))}e.globalAlpha=1,e.restore()}if(!m){e.save(),e.font=`${12*u}px ${T}`,e.fillStyle=i,e.textBaseline="top",e.textAlign="center";const N=8*u,b=n.length,p=Math.max(1,Math.floor(b/6)),B=r/b;for(let C=0;C{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const c=s===K?"CRC":Ds[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:Pe(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:c}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",te(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",te(a)]})]})]},s)})})}function Ca(e,n,o){const s=e.length;let r=0,a=0;for(let m=0;mr&&(r=j),l>a&&(a=l)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const c=r*1.05,i=a*1.05,d=c+i;let u=c/d;return u=Math.max(Fe,Math.min(1-Fe,u)),{fwdMax:Math.round(c),drpMax:Math.round(i),fwdFrac:u}}function Ta({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:c=!1}){const i=f.useRef(null),d=f.useRef(null),u=f.useRef(e),m=f.useRef(n),j=f.useRef(o),l=f.useRef(c);u.current=e,m.current=n,j.current=o,l.current=c;const x=c?wt:jt,v=typeof document<"u"&&document.documentElement.dataset.mode!=="light",h=r||(v?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),y=a||(v?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),T=f.useRef({gridColor:h,axisTickColor:y});T.current={gridColor:h,axisTickColor:y};const S=e.length,D=f.useMemo(()=>{const b=e.map(B=>B.start),p=e.map(()=>1);return[b,p]},[S]),k=f.useCallback(b=>{if(!i.current||e.length===0)return;const p=i.current.getBoundingClientRect(),B=b.clientX-p.left,C=c?wt:jt,R=C.left,g=p.width-C.left-C.right,_=(B-R)/g;if(_<0||_>1){s==null||s(null,null,null);return}const P=Math.min(e.length-1,Math.max(0,Math.floor(_*e.length)));s==null||s(P,e[P],_)},[e,s]),N=f.useCallback(()=>{s==null||s(null,null,null)},[s]);return f.useEffect(()=>{if(!i.current||S===0)return;const b=i.current;let p=null;const B=Rs(()=>{const C=b.getBoundingClientRect(),R=Math.floor(C.width)||400,g=Math.floor(C.height)||200,w={width:R,height:g,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:[P=>{const L=P.ctx,{left:A,top:$,width:M,height:F}=P.bbox,E=window.devicePixelRatio||1,z=T.current,I=va(L,u.current,m.current,j.current,A,$,M,F);ka(L,u.current,A,$,M,F,z.gridColor,z.axisTickColor,I,E,l.current)}]}},_=new As(w,D,b);d.current=_,p=new ResizeObserver(()=>{const P=b.getBoundingClientRect();P.width>0&&P.height>0&&d.current&&d.current.setSize({width:Math.floor(P.width),height:Math.floor(P.height)})}),p.observe(b)});return()=>{var C;B(),p==null||p.disconnect(),(C=d.current)==null||C.destroy(),d.current=null}},[S]),f.useEffect(()=>{d.current&&d.current.redraw()},[e,n,o]),e.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted",children:"No data available"}):t.jsx("div",{ref:i,className:"w-full h-full",onMouseMove:k,onMouseLeave:N})}const Sa=f.memo(Ta),cs=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];pe(cs);function _a(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function vt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const xe=32,Ge=20,Ba=[.5,1];function Da({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:c,crcHistory:i,receivedCount:d,forwardedTotalByType:u,droppedTotalByType:m,startTime:j,bucketDurationSeconds:l,bucketCount:x,timeRangeMinutes:v}){fe(cs);const h=Lt(),y=we(),[T,S]=f.useState(null),[D,k]=f.useState(null),[N,b]=f.useState(null),p=f.useCallback((G,H,V)=>{S(H),k(V)},[]),B=Math.max(1,v/60),C=f.useMemo(()=>Et(y,B),[y,B]),R=f.useMemo(()=>C?It(C):0,[C]),g=Math.round(R*10)/10,w=Math.round((C==null?void 0:C.avgBackoffMs)??0),{fwdMirror:_,drpMirror:P,allTypes:L,fwdTotals:A,drpTotals:$}=f.useMemo(()=>{const G=e.map(X=>({start:X.start,end:X.end,countByType:{...X.countByType}})),H=new Array(x).fill(0);for(const X of i){const ee=Math.floor((X.timestamp-j)/l);ee>=0&&ee({start:X.start,end:X.end,countByType:{...X.countByType,...H[ee]>0?{[K]:H[ee]}:{}}})),U=new Set([...o,...s]);c>0&&U.add(K);const se={...u},ae={...m};c>0&&(ae[K]=c);const ke=[...U].sort((X,ee)=>{const bs=(se[X]??0)+(ae[X]??0);return(se[ee]??0)+(ae[ee]??0)-bs});return{fwdMirror:G,drpMirror:V,allTypes:ke,fwdTotals:se,drpTotals:ae}},[e,n,o,s,i,c,j,l,x,u,m]),M=L.length>0&&_.length>0,F=T?_a(T.start):null,E=T?vt(T.start):"",z=N!==null&&F!==null&&N!==F;F!==N&&b(F);const I=f.useMemo(()=>M?Ca(_,P,L):null,[M,_,P,L]),W=f.useMemo(()=>{if(!I)return[];const{fwdMax:G,drpMax:H,fwdFrac:V}=I,U=[];for(const se of Ba){const ae=Math.round(G*se);if(ae>0){const X=(1-se)*V*100;U.push({label:te(ae),pos:X,color:"green"})}const ke=Math.round(H*se);if(ke>0){const X=(V+se*(1-V))*100;U.push({label:te(ke),pos:X,color:"red"})}}return U},[I]),O=f.useMemo(()=>{if(_.length===0)return[];const G=_.length,H=Math.max(1,Math.floor(G/6)),V=[];for(let U=0;Ut.jsx("span",{className:`type-data-xs text-right pr-1.5 ${V==="green"?"text-sys-green/70":"text-sys-red/70"}`,style:{position:"absolute",top:`${H}%`,transform:H<=1?"none":H>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:G},U))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:Ge},children:[M&&I&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${I.fwdFrac*100}%`,background:"var(--sys-blue)",opacity:.1}}),M&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{top:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ht,{className:"w-3 h-3 text-sys-green"}),t.jsx("span",{children:"FWD"})]}),t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{bottom:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(pt,{className:"w-3 h-3 text-sys-red"}),t.jsx("span",{children:"DROP"})]})]}),t.jsx("div",{className:`absolute inset-0 flex items-center transition-opacity duration-300 ${M?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":M,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,H)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${G}%`}},`u${H}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${M?"opacity-100":"opacity-0"}`,children:M&&t.jsx(Sa,{forwardedBuckets:_,droppedBuckets:P,allTypes:L,gridColor:h.grid,axisTickColor:h.axisTick,onHover:p,externalAxes:!0})}),M&&I&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${I.fwdFrac*100}%`,background:"var(--sys-red)",opacity:.1}})]}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:xe,height:Ge},"aria-hidden":"true",children:O.map((G,H)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${G.pos}%`,transform:H===0?"none":H===O.length-1?"translateX(-100%)":"translateX(-50%)"},children:G.label},H))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:M&&t.jsx(Ma,{allTypes:L,forwardedTotalByType:A,droppedTotalByType:$})})]})}const Ra=2,Aa=1;function Pa(e,n,o){const s=d=>(d==null?void 0:d.reduce((u,m)=>u+m.count,0))??0,r=s(n),a=s(o),c=r||(e==null?void 0:e.rx_count)||1,i=a||(e==null?void 0:e.dropped_count)||0;return c>0?i/(c+i)*100:0}function La(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,c)=>a+c.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,c=n.length*o*1e3;return a/c*100}if(e){const r=(e.uptime_seconds||1)*1e3;return(e.total_airtime_ms||e.airtime_used_ms||0)/r*100}return 0}function kt(e,n,o){return jn(Math.max(n,Math.min(o,e)))}function $a(e,n,o,s,r){let a=Qt(e);n>20?a+=Te*2:n>12&&(a+=Te),o>8&&(a+=Te);const c=kt(a,0,Ra);let i=wn(e);o>8&&(i+=Te);const d=kt(i,0,Aa),u=ye(c),m=ye(d),j=s!==null?ye(s):null;let l="stable";return j!==null&&(u>j?l="increase":u{if(u!=="applying"){m("applying");try{const H=await Ls({tx_delay_factor:O,direct_tx_delay_factor:G});H!=null&&H.success?(m("success"),setTimeout(()=>m("idle"),2e3)):(m("error"),setTimeout(()=>m("idle"),2500))}catch{m("error"),setTimeout(()=>m("idle"),2500)}}},[u]);if(!c)return t.jsx(je,{children:t.jsx($s,{})});const x=10080*60,h=Math.floor(Date.now()/1e3)-x,y=Object.values((e==null?void 0:e.neighbors)??{}).filter(O=>O.zero_hop&&O.last_seen>=h&&bn(O).isRepeater).length,T=j.filter(O=>O.status==="active"||O.lastSeen>=h).length,S=Math.max(y,T),D=Pa(e,n,o),k=La(e,s,r),N=((z=(E=e==null?void 0:e.config)==null?void 0:E.delays)==null?void 0:z.tx_delay_factor)??null,b=((W=(I=e==null?void 0:e.config)==null?void 0:I.delays)==null?void 0:W.direct_tx_delay_factor)??null,p=$a(S,D,k,N),B=S!==1,C=Qt(S),R=[`${S} repeater${B?"s":""} heard in the last 7 days (base ×${C.toFixed(1)}).`];p.floodFactor===C&&D<=12&&k<=8?R.push("No modifiers applied — network looks healthy."):(D>20?R.push(`High duplicate rate (${D.toFixed(1)}%) suggests frequent collisions — window widened.`):D>12&&R.push(`Elevated duplicate rate (${D.toFixed(1)}%) — window widened one step.`),k>8&&R.push(`Channel is busy (${k.toFixed(1)}% TX util) — extra spacing added.`));const g=[`Direct uses one forwarder — ×${p.directFactor.toFixed(1)} backoff for channel contention.`];k>8&&g.push("Busy channel — small extra backoff.");const w=[`Flood ×${p.floodFactor.toFixed(1)} (${p.floodSlots} slot${p.floodSlots!==1?"s":""})`,...R,"",`Direct ×${p.directFactor.toFixed(1)}`,...g,"","Click to copy CLI commands"].join(` + */const aa=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],oa=Z("timer",aa);function ra(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],c=e[3+o],i=js(r,a,c);return n?i(s):i}function ia(e,n,o={}){const s=e.get();let r=null,a=s,c;const i=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,d=()=>{r&&(r.stop(),r=null)},u=()=>{d();const m=gt(e.get()),j=gt(a);m!==j&&(r=new ws({keyframes:[m,j],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:c}))};if(e.attach((m,j)=>{a=m,c=l=>j(xt(l,i)),Rt.postRender(()=>{var l;u(),(l=e.events.animationStart)==null||l.notify(),r==null||r.then(()=>{var x;(x=e.events.animationComplete)==null||x.notify()})})},d),At(n)){const m=n.on("change",l=>e.set(xt(l,i))),j=e.on("destroy",m);return()=>{m(),j()}}return d}function xt(e,n){return n?e+n:e}function gt(e){return typeof e=="number"?e:parseFloat(e)}function is(e,n){const o=ue(n()),s=()=>o.set(n());return s(),Ns(()=>{const r=()=>Rt.preRender(s,!1,!0),a=e.map(c=>c.on("change",r));return()=>{a.forEach(c=>c()),vs(s)}}),o}function la(e){Ee.current=[],e();const n=is(Ee.current,e);return Ee.current=void 0,n}function ca(e,n,o,s){if(typeof e=="function")return la(e);const a=ra(n,o,s);return Array.isArray(e)?yt(e,a):yt([e],([c])=>a(c))}function yt(e,n){const o=ks(()=>[]);return is(e,()=>{o.length=0;const s=e.length;for(let r=0;rAt(e)?e.get():e;if(o)return ca(s);const r=ue(s());return f.useInsertionEffect(()=>ia(r,e,n),[r,JSON.stringify(n)]),r}function Se(e,n={}){return da(e,{type:"spring",...n})}const oe=Cs(()=>({result:null,isComputing:!1})),ua=500,ma=300;let ce=null,_e=null;function fa(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 pa(){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 ha(e,n,o,s){const r=pa();if(!r)return;const a=e.length,c=new Float64Array(a),i=new Float64Array(a),d=new Uint16Array(a),u=new Uint8Array(a),m=new Uint8Array(a),j=new Uint8Array(a),l=new Uint8Array(a),x=new Float32Array(a),v=new Float32Array(a),h=new Uint32Array(a),y=new Map;let T=0;for(let D=0;DparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function xa(e,n,o){const s={...e,received:[...e.received],unique_received:[...e.unique_received],transmitted:[...e.transmitted],forwarded:[...e.forwarded],dropped:[...e.dropped],receivedBytesBuckets:e.receivedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(m=>({...m,bytesByType:{...m.bytesByType},countByType:{...m.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:c,bucket_count:i}=e,d=new Set;for(const m of n){const j=m.timestamp??0;if(ja)continue;const l=Math.floor((j-r)/c);if(l<0||l>=i)continue;d.has(l)||(d.add(l),s.received[l]={...s.received[l]},s.unique_received[l]={...s.unique_received[l]},s.transmitted[l]={...s.transmitted[l]},s.forwarded[l]={...s.forwarded[l]},s.dropped[l]={...s.dropped[l]});const x=Pt(m,o),v=m.length??m.payload_length??0,h=m.type??m.payload_type??0,y=m.packet_origin;y==="tx_local"?(s.transmitted[l].count++,s.transmitted[l].airtime_ms+=x):y==="tx_forward"||m.transmitted?(s.forwarded[l].count++,s.forwarded[l].airtime_ms+=x,s.forwardedBytesBuckets[l].bytesByType[h]=(s.forwardedBytesBuckets[l].bytesByType[h]??0)+v,s.forwardedBytesBuckets[l].totalBytes+=v,s.forwardedBytesBuckets[l].countByType[h]=(s.forwardedBytesBuckets[l].countByType[h]??0)+1,s.forwardedBytesBuckets[l].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+v,s.totalForwardedCount++):m.drop_reason&&(s.dropped[l].count++,s.dropped[l].airtime_ms+=x,s.droppedBytesBuckets[l].bytesByType[h]=(s.droppedBytesBuckets[l].bytesByType[h]??0)+v,s.droppedBytesBuckets[l].totalBytes+=v,s.droppedBytesBuckets[l].countByType[h]=(s.droppedBytesBuckets[l].countByType[h]??0)+1,s.droppedBytesBuckets[l].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+v,s.totalDroppedCount++),y!=="tx_local"&&(s.received[l].count++,s.received[l].airtime_ms+=x,s.unique_received[l].count++,s.unique_received[l].airtime_ms+=x,s.receivedBytesBuckets[l].bytesByType[h]=(s.receivedBytesBuckets[l].bytesByType[h]??0)+v,s.receivedBytesBuckets[l].totalBytes+=v,s.receivedBytesBuckets[l].countByType[h]=(s.receivedBytesBuckets[l].countByType[h]??0)+1,s.receivedBytesBuckets[l].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+v,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=v)}const u=s.time_range_minutes/60;return s.kbPerHour=u>0?Math.round(s.totalReceivedBytes/1024/u):0,s.forwardedRatePerHour=u>0?Math.round(s.totalForwardedCount/u):0,s.droppedRatePerHour=u>0?Math.round(s.totalDroppedCount/u):0,s.receivedActiveTypes=ze(s.receivedTotalByType),s.forwardedActiveTypes=ze(s.forwardedTotalByType),s.droppedActiveTypes=ze(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([st(()=>import("./index-B9Nfzawy.js").then(e=>e.gi),__vite__mapDeps([0,1])),st(()=>import("./index-B9Nfzawy.js").then(e=>e.gh),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(c=>{const i=c.packets.length,d=c.globalTimeRangeIndex,u=fa(c.stats);if(i===s&&d===r&&u===a)return;const m=s,j=r,l=a;if(s=i,r=d,a=u,i===0)return;const x=o[d]??o[4],v=x.minutes,h=x.buckets,y=c.stats,T=nt(y),S=i-m,D=d!==j,k=u!==l,N=oe.getState().result;if(!D&&!k&&S>0&&S{_e=null;const p=e.useStore.getState();if(p.packets.length===0||!p.stats)return;const B=o[p.globalTimeRangeIndex]??o[4],C=nt(p.stats);ha(p.packets,B.minutes,B.buckets,C)},ma)})});const ga=()=>oe(e=>e.result),ls=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:hn}];pe(ls);function ya(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function bt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const he=32,Oe=20,ba=[.25,.5,.75,1];function ja({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){fe(ls);const r=Lt(),[a,c]=f.useState(null),[i,d]=f.useState(null),[u,m]=f.useState(null),j=f.useCallback((k,N,b)=>{c(N),d(b)},[]),l=e.length>0&&n.length>0,x=a?ya(a.start):null,v=a?bt(a.start):"",h=u!==null&&x!==null&&u!==x;x!==u&&m(x);const y=f.useMemo(()=>Ts(e),[e]),T=s==="count"?te:Ss,S=f.useMemo(()=>y===0?[]:ba.map(k=>({pct:k,label:T(Math.round(y*k)),pos:(1-k)*100})),[y,T]),D=f.useMemo(()=>{if(e.length===0)return[];const k=e.length,N=Math.max(1,Math.floor(k/6)),b=[];for(let p=0;pt.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${b}%`,transform:k===1?"none":"translateY(-50%)",right:0},children:N},k))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:he,right:0,top:0,bottom:Oe},children:l&&t.jsx(_s,{buckets:e,activeTypes:n,gridColor:r.grid,axisTickColor:r.axisTick,onHover:j,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:he,height:Oe},"aria-hidden":"true",children:D.map((k,N)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${k.pos}%`,transform:N===0?"none":N===D.length-1?"translateX(-100%)":"translateX(-50%)"},children:k.label},N))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:l&&t.jsx(Bs,{activeTypes:n,totalByType:o,formatMode:s})})]})}const jt={top:8,right:8,bottom:28,left:48},wt={top:0,right:0,bottom:0,left:0};let Be=null,Nt=0;const wa=1e3;function Na(){const e=performance.now();return Be&&e-Nth&&(h=w),_>y&&(y=_)}h===0&&y===0?(h=1,y=1):h===0?h=1:y===0&&(y=1);const T=h*1.05,S=y*1.05,D=T+S;let k=T/D;k=Math.max(Fe,Math.min(1-Fe,k));const N=i-m,b=k*N,p=(1-k)*N,B=a+b,C=a+b+m,R=a+b+m/2;for(let g=0;g0)for(const $ of s){const M=P[$]??0;if(M===0)continue;const F=M/T*b,E=_-F;e.fillStyle=Pe($),e.fillRect(w,E,l,F),_=E}let L=C;const A=o[g].countByType;if(v[g]>0){const $=A[K]??0;if($>0){const M=$/S*p;e.fillStyle=Pe(K),e.fillRect(w,L,l,M),L+=M}for(const M of s){if(M===K)continue;const F=A[M]??0;if(F===0)continue;const E=F/S*p;e.fillStyle=Pe(M),e.fillRect(w,L,l,E),L+=E}}}return{baselineY:R,fwdHalf:b,drpHalf:p,fwdCeil:T,drpCeil:S,gapPx:m}}function ka(e,n,o,s,r,a,c,i,d,u,m=!1){if(n.length===0)return;const{baselineY:j,fwdHalf:l,drpHalf:x,fwdCeil:v,drpCeil:h,gapPx:y}=d,T=Na(),S=j-Math.ceil(y/2),D=j+Math.floor(y/2);e.save(),e.strokeStyle=c,e.lineWidth=1*u,e.setLineDash([]);const k=[.5,1];for(const N of k){const b=Math.round(S-N*l)+.5;e.beginPath(),e.moveTo(o,b),e.lineTo(o+r,b),e.stroke();const p=Math.round(D+N*x)+.5;e.beginPath(),e.moveTo(o,p),e.lineTo(o+r,p),e.stroke()}if(e.restore(),e.clearRect(o,j-Math.ceil(y/2),r,y),!m){e.save(),e.font=`bold ${10*u}px ${T}`,e.textAlign="left";const N=4*u,b=2*u;for(const p of k){const B=Math.round(v*p),C=Math.round(h*p),R=p===1,g=S-p*l,w=D+p*x;B>0&&(e.fillStyle=Y.green,e.globalAlpha=.7,R?(e.textBaseline="top",e.fillText(te(B),N,g+b)):(e.textBaseline="middle",e.fillText(te(B),N,g))),C>0&&(e.fillStyle=Y.red,e.globalAlpha=.7,R?(e.textBaseline="bottom",e.fillText(te(C),N,w-b)):(e.textBaseline="middle",e.fillText(te(C),N,w)))}e.globalAlpha=1,e.restore()}if(!m){e.save(),e.font=`${12*u}px ${T}`,e.fillStyle=i,e.textBaseline="top",e.textAlign="center";const N=8*u,b=n.length,p=Math.max(1,Math.floor(b/6)),B=r/b;for(let C=0;C{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const c=s===K?"CRC":Ds[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:Pe(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:c}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",te(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",te(a)]})]})]},s)})})}function Ca(e,n,o){const s=e.length;let r=0,a=0;for(let m=0;mr&&(r=j),l>a&&(a=l)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const c=r*1.05,i=a*1.05,d=c+i;let u=c/d;return u=Math.max(Fe,Math.min(1-Fe,u)),{fwdMax:Math.round(c),drpMax:Math.round(i),fwdFrac:u}}function Ta({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:c=!1}){const i=f.useRef(null),d=f.useRef(null),u=f.useRef(e),m=f.useRef(n),j=f.useRef(o),l=f.useRef(c);u.current=e,m.current=n,j.current=o,l.current=c;const x=c?wt:jt,v=typeof document<"u"&&document.documentElement.dataset.mode!=="light",h=r||(v?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),y=a||(v?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),T=f.useRef({gridColor:h,axisTickColor:y});T.current={gridColor:h,axisTickColor:y};const S=e.length,D=f.useMemo(()=>{const b=e.map(B=>B.start),p=e.map(()=>1);return[b,p]},[S]),k=f.useCallback(b=>{if(!i.current||e.length===0)return;const p=i.current.getBoundingClientRect(),B=b.clientX-p.left,C=c?wt:jt,R=C.left,g=p.width-C.left-C.right,_=(B-R)/g;if(_<0||_>1){s==null||s(null,null,null);return}const P=Math.min(e.length-1,Math.max(0,Math.floor(_*e.length)));s==null||s(P,e[P],_)},[e,s]),N=f.useCallback(()=>{s==null||s(null,null,null)},[s]);return f.useEffect(()=>{if(!i.current||S===0)return;const b=i.current;let p=null;const B=Rs(()=>{const C=b.getBoundingClientRect(),R=Math.floor(C.width)||400,g=Math.floor(C.height)||200,w={width:R,height:g,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:[P=>{const L=P.ctx,{left:A,top:$,width:M,height:F}=P.bbox,E=window.devicePixelRatio||1,z=T.current,I=va(L,u.current,m.current,j.current,A,$,M,F);ka(L,u.current,A,$,M,F,z.gridColor,z.axisTickColor,I,E,l.current)}]}},_=new As(w,D,b);d.current=_,p=new ResizeObserver(()=>{const P=b.getBoundingClientRect();P.width>0&&P.height>0&&d.current&&d.current.setSize({width:Math.floor(P.width),height:Math.floor(P.height)})}),p.observe(b)});return()=>{var C;B(),p==null||p.disconnect(),(C=d.current)==null||C.destroy(),d.current=null}},[S]),f.useEffect(()=>{d.current&&d.current.redraw()},[e,n,o]),e.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted",children:"No data available"}):t.jsx("div",{ref:i,className:"w-full h-full",onMouseMove:k,onMouseLeave:N})}const Sa=f.memo(Ta),cs=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];pe(cs);function _a(e){const o=new Date(e*1e3).getHours();return o>=6&&o<18}function vt(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const xe=32,Ge=20,Ba=[.5,1];function Da({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:c,crcHistory:i,receivedCount:d,forwardedTotalByType:u,droppedTotalByType:m,startTime:j,bucketDurationSeconds:l,bucketCount:x,timeRangeMinutes:v}){fe(cs);const h=Lt(),y=we(),[T,S]=f.useState(null),[D,k]=f.useState(null),[N,b]=f.useState(null),p=f.useCallback((G,H,V)=>{S(H),k(V)},[]),B=Math.max(1,v/60),C=f.useMemo(()=>Et(y,B),[y,B]),R=f.useMemo(()=>C?It(C):0,[C]),g=Math.round(R*10)/10,w=Math.round((C==null?void 0:C.avgBackoffMs)??0),{fwdMirror:_,drpMirror:P,allTypes:L,fwdTotals:A,drpTotals:$}=f.useMemo(()=>{const G=e.map(X=>({start:X.start,end:X.end,countByType:{...X.countByType}})),H=new Array(x).fill(0);for(const X of i){const ee=Math.floor((X.timestamp-j)/l);ee>=0&&ee({start:X.start,end:X.end,countByType:{...X.countByType,...H[ee]>0?{[K]:H[ee]}:{}}})),U=new Set([...o,...s]);c>0&&U.add(K);const se={...u},ae={...m};c>0&&(ae[K]=c);const ke=[...U].sort((X,ee)=>{const bs=(se[X]??0)+(ae[X]??0);return(se[ee]??0)+(ae[ee]??0)-bs});return{fwdMirror:G,drpMirror:V,allTypes:ke,fwdTotals:se,drpTotals:ae}},[e,n,o,s,i,c,j,l,x,u,m]),M=L.length>0&&_.length>0,F=T?_a(T.start):null,E=T?vt(T.start):"",z=N!==null&&F!==null&&N!==F;F!==N&&b(F);const I=f.useMemo(()=>M?Ca(_,P,L):null,[M,_,P,L]),W=f.useMemo(()=>{if(!I)return[];const{fwdMax:G,drpMax:H,fwdFrac:V}=I,U=[];for(const se of Ba){const ae=Math.round(G*se);if(ae>0){const X=(1-se)*V*100;U.push({label:te(ae),pos:X,color:"green"})}const ke=Math.round(H*se);if(ke>0){const X=(V+se*(1-V))*100;U.push({label:te(ke),pos:X,color:"red"})}}return U},[I]),O=f.useMemo(()=>{if(_.length===0)return[];const G=_.length,H=Math.max(1,Math.floor(G/6)),V=[];for(let U=0;Ut.jsx("span",{className:`type-data-xs text-right pr-1.5 ${V==="green"?"text-sys-green/70":"text-sys-red/70"}`,style:{position:"absolute",top:`${H}%`,transform:H<=1?"none":H>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:G},U))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:Ge},children:[M&&I&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${I.fwdFrac*100}%`,background:"var(--sys-blue)",opacity:.1}}),M&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{top:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ht,{className:"w-3 h-3 text-sys-green"}),t.jsx("span",{children:"FWD"})]}),t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{bottom:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(pt,{className:"w-3 h-3 text-sys-red"}),t.jsx("span",{children:"DROP"})]})]}),t.jsx("div",{className:`absolute inset-0 flex items-center transition-opacity duration-300 ${M?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":M,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,H)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${G}%`}},`u${H}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${M?"opacity-100":"opacity-0"}`,children:M&&t.jsx(Sa,{forwardedBuckets:_,droppedBuckets:P,allTypes:L,gridColor:h.grid,axisTickColor:h.axisTick,onHover:p,externalAxes:!0})}),M&&I&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${I.fwdFrac*100}%`,background:"var(--sys-red)",opacity:.1}})]}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:xe,height:Ge},"aria-hidden":"true",children:O.map((G,H)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${G.pos}%`,transform:H===0?"none":H===O.length-1?"translateX(-100%)":"translateX(-50%)"},children:G.label},H))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:M&&t.jsx(Ma,{allTypes:L,forwardedTotalByType:A,droppedTotalByType:$})})]})}const Ra=2,Aa=1;function Pa(e,n,o){const s=d=>(d==null?void 0:d.reduce((u,m)=>u+m.count,0))??0,r=s(n),a=s(o),c=r||(e==null?void 0:e.rx_count)||1,i=a||(e==null?void 0:e.dropped_count)||0;return c>0?i/(c+i)*100:0}function La(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,c)=>a+c.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,c=n.length*o*1e3;return a/c*100}if(e){const r=(e.uptime_seconds||1)*1e3;return(e.total_airtime_ms||e.airtime_used_ms||0)/r*100}return 0}function kt(e,n,o){return jn(Math.max(n,Math.min(o,e)))}function $a(e,n,o,s,r){let a=Qt(e);n>20?a+=Te*2:n>12&&(a+=Te),o>8&&(a+=Te);const c=kt(a,0,Ra);let i=wn(e);o>8&&(i+=Te);const d=kt(i,0,Aa),u=ye(c),m=ye(d),j=s!==null?ye(s):null;let l="stable";return j!==null&&(u>j?l="increase":u{if(u!=="applying"){m("applying");try{const H=await Ls({tx_delay_factor:O,direct_tx_delay_factor:G});H!=null&&H.success?(m("success"),setTimeout(()=>m("idle"),2e3)):(m("error"),setTimeout(()=>m("idle"),2500))}catch{m("error"),setTimeout(()=>m("idle"),2500)}}},[u]);if(!c)return t.jsx(je,{children:t.jsx($s,{})});const x=10080*60,h=Math.floor(Date.now()/1e3)-x,y=Object.values((e==null?void 0:e.neighbors)??{}).filter(O=>O.zero_hop&&O.last_seen>=h&&bn(O).isRepeater).length,T=j.filter(O=>O.status==="active"||O.lastSeen>=h).length,S=Math.max(y,T),D=Pa(e,n,o),k=La(e,s,r),N=((z=(E=e==null?void 0:e.config)==null?void 0:E.delays)==null?void 0:z.tx_delay_factor)??null,b=((W=(I=e==null?void 0:e.config)==null?void 0:I.delays)==null?void 0:W.direct_tx_delay_factor)??null,p=$a(S,D,k,N),B=S!==1,C=Qt(S),R=[`${S} repeater${B?"s":""} heard in the last 7 days (base ×${C.toFixed(1)}).`];p.floodFactor===C&&D<=12&&k<=8?R.push("No modifiers applied — network looks healthy."):(D>20?R.push(`High duplicate rate (${D.toFixed(1)}%) suggests frequent collisions — window widened.`):D>12&&R.push(`Elevated duplicate rate (${D.toFixed(1)}%) — window widened one step.`),k>8&&R.push(`Channel is busy (${k.toFixed(1)}% TX util) — extra spacing added.`));const g=[`Direct uses one forwarder — ×${p.directFactor.toFixed(1)} backoff for channel contention.`];k>8&&g.push("Busy channel — small extra backoff.");const w=[`Flood ×${p.floodFactor.toFixed(1)} (${p.floodSlots} slot${p.floodSlots!==1?"s":""})`,...R,"",`Direct ×${p.directFactor.toFixed(1)}`,...g,"","Click to copy CLI commands"].join(` `),_=N!==null?ye(N):null,P=b!==null?ye(b):null,L=_!==null&&p.floodSlots!==_,A=P!==null&&p.directSlots!==P,$=L||A,M=async()=>{const O=`set txdelay ${p.floodFactor.toFixed(1)} set direct.txdelay ${p.directFactor.toFixed(1)}`;await Es(O),d(!0),setTimeout(()=>d(!1),1500)},F=()=>l(p.floodFactor,p.directFactor);return t.jsxs(je,{children:[t.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3 flex-wrap",children:[t.jsx(Nn,{className:"w-4 h-4 text-icon-card-title flex-shrink-0"}),t.jsx("span",{className:"type-micro",children:"DELAY DOCTOR"}),a&&t.jsx(ne,{color:"zinc",className:"hidden sm:inline-flex",children:a})]}),t.jsxs("button",{onClick:M,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:w,children:[t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-fg-primary",children:t.jsxs(Ye,{children:["×",p.floodFactor.toFixed(1)]})}),t.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Flood"})]}),t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-sys-blue",children:t.jsxs(Ye,{children:["×",p.directFactor.toFixed(1)]})}),t.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Direct"})]}),t.jsx("div",{className:"flex items-center self-center opacity-0 group-hover:opacity-100 transition-opacity",children:i?t.jsx(at,{className:"w-4 h-4 text-sys-green"}):t.jsx(Fs,{className:"w-4 h-4 text-fg-muted"})})]}),t.jsx("div",{className:"flex-1 py-2",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Dupe"}),t.jsxs("div",{className:`data-box data-box-fill data-box-left ${p.duplicateRate>8?"text-status-warning":""}`,children:[p.duplicateRate.toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"TX Util"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[p.txUtilization.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:"pt-2 mt-auto",children:t.jsxs("div",{className:"flex items-end justify-between gap-2",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"data-box-label",children:"Current"}),t.jsx("div",{className:"flex gap-2",children:N!==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:["×",N.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:["×",(b==null?void 0:b.toFixed(2))??"—"]})})]}):t.jsx("span",{className:"text-sm text-fg-muted",children:"No config"})})]}),$&&t.jsxs("button",{onClick:F,disabled:u==="applying"||u==="success",className:`flex items-center gap-1.5 px-2.5 py-1.5 radius-inner type-micro font-medium transition-base ${u==="success"?"bg-sys-green/15 text-sys-green":u==="error"?"bg-sys-red/15 text-sys-red":u==="applying"?"bg-subtle-fill text-fg-muted":"bg-sys-blue/10 text-sys-blue hover:bg-sys-blue/20"}`,title:`Apply ×${p.floodFactor.toFixed(1)} flood, ×${p.directFactor.toFixed(1)} direct`,children:[u==="success"?"Rx'd":u==="error"?"Failed":"Apply",u==="applying"?t.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}):u==="success"?t.jsx(at,{className:"w-3.5 h-3.5"}):t.jsxs("span",{className:"relative inline-flex items-end w-6 h-3.5",children:[t.jsx(Kn,{className:"w-3.5 h-3.5 absolute left-0 bottom-0"}),t.jsx(na,{className:"w-3 h-3 absolute right-0 bottom-0"})]})]})]})})]})}const ds=[{target:"RecentPackets",fn:"rssi",minStage:1},{target:"RecentPackets",fn:"snr",minStage:1}];pe(ds);const Ea=25;function Ia(){fe(ds);const e=we(),n=Is(),o=Hs(),s=ie(),r=Mn(),a=Je(x=>x.requestChannel),[c,i]=f.useState(!0),d=f.useCallback(x=>i(x),[]),u=f.useMemo(()=>[...e.length<=100?e:e.slice(-100)].sort((v,h)=>(h.timestamp??0)-(v.timestamp??0)),[e]),m=s==null?void 0:s.local_hash,j=s==null?void 0:s.neighbors,l=Cn();return t.jsxs(je,{noPadding:!0,className:"!overflow-visible",children:[t.jsx(Ht,{listHeader:!0,icon:t.jsx(Ot,{}),title:"Recent Packets",actions:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(zt,{enabled:c,onChange:d,label:"Hide Dupes",size:"sm"}),o&&t.jsx(zs,{showLabel:!0}),t.jsxs($e,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(ut,{"data-slot":"icon"})]})]})}),t.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-1",children:t.jsx(vn,{packets:u,allPackets:e,localHash:m,neighbors:j,resolveSource:l,getDecodedContent:r,onChannelClick:a,loading:n,maxPackets:Ea,showPagination:!1,flashNewest:!0,hideDupes:c,emptyMessage:"No packets received",footerAction:t.jsxs($e,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(ut,{"data-slot":"icon"})]})})})]})}const Ha={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function za({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:Ha[e]})})})}function Oa(){return t.jsx("div",{className:"mini-widget-loading",children:t.jsx("div",{className:"mini-widget-loading-spinner"})})}function Ga({message:e}){return t.jsx("div",{className:"mini-widget-error",children:t.jsx("span",{title:e,children:"No data"})})}function le({title:e,icon:n,value:o,unit:s,valueSize:r="md",status:a,subtitle:c,subtitleValue:i,trend:d,headerRight:u,children:m,isLoading:j=!1,error:l,className:x="",onClick:v,isLoaded:h}){const y=["mini-widget-value",r==="lg"&&"mini-widget-value-lg",r==="sm"&&"mini-widget-value-sm"].filter(Boolean).join(" "),T=["mini-widget",x].filter(Boolean).join(" ");return t.jsxs(je,{noPadding:!0,className:T,onClick:v,isLoaded:h,children:[t.jsxs("div",{className:"mini-widget-header",children:[n,t.jsx("span",{className:"mini-widget-title",children:e}),a&&a!=="unknown"&&t.jsx("div",{className:`mini-widget-status-dot ${a}`}),d&&t.jsx(za,{trend:d}),u&&t.jsx("span",{className:"ml-auto flex items-center",children:u})]}),j?t.jsx(Oa,{}):l?t.jsx(Ga,{message:l}):t.jsxs("div",{className:"mini-widget-content",children:[(o!==void 0||c||i)&&t.jsxs("div",{className:"mini-widget-value-row",children:[o!==void 0&&t.jsxs("div",{className:y,children:[typeof o=="number"?t.jsx(re,{value:o,className:"font-mono tabular-nums",priority:"medium",format:Number.isInteger(o)?void 0:{minimumFractionDigits:1,maximumFractionDigits:1}}):t.jsx(Ye,{children:o}),s&&t.jsx("span",{className:"mini-widget-unit",children:s})]}),(c||i)&&t.jsxs("span",{className:"mini-widget-badge-group",children:[c&&!i&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:c}),c&&i&&t.jsx("span",{className:"mini-widget-subtitle truncate",children:c}),i&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:i})]})]}),m]})]})}const Wa={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},us={baselineMedian:null,baselineP10:null,baselineP90:null,currentMedian:null,currentSampleCount:0,delta:0,slope:0,jitter:0,penalty:0,penaltyReason:null,computedAt:0,isReliable:!1};function Ze(e,n){if(e.length===0)return null;const o=[...e].sort((c,i)=>c-i),s=n/100*(o.length-1),r=Math.floor(s),a=Math.ceil(s);return r===a?o[r]:o[r]+(o[a]-o[r])*(s-r)}function Mt(e){return Ze(e,50)}function qa(e){if(e.length<2)return 0;const n=e.reduce((r,a)=>r+a,0)/e.length,s=e.map(r=>Math.pow(r-n,2)).reduce((r,a)=>r+a,0)/e.length;return Math.sqrt(s)}function Xa(e){if(e.length<2)return 0;const n=e.length;let o=0,s=0,r=0,a=0;const c=e[0].timestamp;for(const d of e){const u=(d.timestamp-c)/3600,m=d.value;o+=u,s+=m,r+=u*m,a+=u*u}const i=n*a-o*o;return Math.abs(i)<1e-4?0:(n*r-o*s)/i}function Va(e,n,o){const s=Wa;return e>=s.DELTA_CRITICAL?[2,`Noise floor ${e.toFixed(1)} dB above baseline`]:n>=s.SLOPE_CRITICAL?[2,`Noise floor rising ${n.toFixed(1)} dB/hour`]:o>=s.JITTER_CRITICAL?[2,`Noise floor unstable (±${o.toFixed(1)} dB)`]:e>=s.DELTA_WARNING?[1,`Noise floor ${e.toFixed(1)} dB above baseline`]:n>=s.SLOPE_WARNING?[1,`Noise floor rising ${n.toFixed(1)} dB/hour`]:o>=s.JITTER_WARNING?[1,`Noise floor variable (±${o.toFixed(1)} dB)`]:[0,null]}function Ua(e){if(e.length===0)return{...us,computedAt:Math.floor(Date.now()/1e3)};const n=Math.floor(Date.now()/1e3),o=e.filter(y=>Number.isFinite(y)),s=e.length>0?[e[e.length-1]]:[],r=e.slice(-4).filter(y=>Number.isFinite(y)),a=Mt(o),c=Ze(o,10),i=Ze(o,90),d=Mt(s),u=d!==null&&c!==null?d-c:0,m=r.map((y,T)=>({timestamp:n-(r.length-1-T)*3600,value:y})),j=Xa(m),l=qa(r),x=o.length>=12,[v,h]=x?Va(u,j,l):[0,null];return{baselineMedian:a,baselineP10:c,baselineP90:i,currentMedian:d,currentSampleCount:s.length,delta:u,slope:j,jitter:l,penalty:v,penaltyReason:h,computedAt:n,isReliable:x}}const Ya={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],noiseFloorWindowHistory:[],linkQuality:null,channelHealth:null,nfTrend:us,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},ms=f.createContext(Ya);function Ja({children:e}){var P;const n=ie(),o=we(),s=Gt(),r=Os(),a=Ne(),c=Q[a],i=Math.max(1,c.minutes/60),d=n===null,[u,m]=f.useState(null),j=f.useCallback(async()=>{try{const L=await Wt(Math.ceil(i));if(L.success&&L.data){m(L.data.history);return}const A=await qt(Math.ceil(i));A.success&&A.data&&A.data.count>0&&m(null)}catch{}},[i]);f.useEffect(()=>{j();const L=setInterval(j,6e4);return()=>clearInterval(L)},[j]);const l=f.useMemo(()=>Et(o,i,u),[o,i,u]),x=(n==null?void 0:n.noise_floor_dbm)??null,v=f.useMemo(()=>Gs(x)?x:null,[x]),h=f.useMemo(()=>{var A;const L=(A=n==null?void 0:n.config)==null?void 0:A.radio;return L?{sf:L.spreading_factor??7,bwHz:L.bandwidth??125e3}:null},[(P=n==null?void 0:n.config)==null?void 0:P.radio]),y=Ws(i),T=qs(i),S=n==null?void 0:n.neighbors,D=f.useMemo(()=>Object.fromEntries(Object.entries(S??{}).filter(([A])=>!r.has(A))),[S,r]),k=f.useMemo(()=>s.filter(L=>!r.has(L.hash)),[s,r]),N=f.useMemo(()=>Ua(y),[y]),b=f.useMemo(()=>Xs(k,D,h),[k,D,h]),p=f.useMemo(()=>Vs(l,v,b),[l,v,b]),[B,C]=f.useState({noiseFloor:null,networkScore:null,channelHealth:null}),R=f.useRef(0);f.useEffect(()=>{const L=()=>{const $=Date.now();$-R.current>3e4&&(R.current=$,C({noiseFloor:v,networkScore:(b==null?void 0:b.networkScore)??null,channelHealth:(p==null?void 0:p.score)??null}))};L();const A=setInterval(L,5e3);return()=>clearInterval(A)},[v,b==null?void 0:b.networkScore,p==null?void 0:p.score]);const g=f.useMemo(()=>({noiseFloor:{current:v,previous:B.noiseFloor,trend:v!==null?Ie(v,B.noiseFloor,2,!0):"stable"},networkScore:{current:(b==null?void 0:b.networkScore)??0,previous:B.networkScore,trend:Ie((b==null?void 0:b.networkScore)??0,B.networkScore,3,!1)},channelHealth:{current:(p==null?void 0:p.score)??0,previous:B.channelHealth,trend:Ie((p==null?void 0:p.score)??0,B.channelHealth,3,!1)}}),[v,b==null?void 0:b.networkScore,p==null?void 0:p.score,B]),_={lbtStats:l,noiseFloor:v,sparklineNoiseFloor:y,noiseFloorWindowHistory:T,linkQuality:b,channelHealth:p,nfTrend:N,radioConfig:h,trends:g,stats:n,recentPackets:o,quickNeighbors:s,isLoading:d,error:null,refresh:async()=>{}};return t.jsx(ms.Provider,{value:_,children:e})}function et(){const e=f.useContext(ms);if(e===void 0)throw new Error("useLBTData must be used within an LBTDataProvider");return e}function Za(e){return e<100?"excellent":e<250?"good":e<500?"fair":e<1e3?"congested":"critical"}function Ka(e){return e===0?"No backoffs":"Retries"}function Qa(e,n){return e===0?void 0:`${n.toFixed(0)}%`}function eo(){const{lbtStats:e,isLoading:n,error:o}=et(),s=Xt(),r=(e==null?void 0:e.avgBackoffMs)??0,a=(e==null?void 0:e.retryRate)??0,c=e?Za(r):"unknown",i=e==null?void 0:e.sparklineBackoff,d=f.useMemo(()=>!i||i.length<2?[]:i.map((u,m)=>({timestamp:Date.now()-(i.length-1-m)*36e5,count:u})),[i]);return t.jsx(le,{title:"LBT Backoff",icon:t.jsx(oa,{className:"mini-widget-icon"}),value:Math.round(r),unit:"ms",status:c,subtitle:e?Ka(r):void 0,subtitleValue:e?Qa(r,a):void 0,isLoading:n,error:o,onClick:()=>s("/packets"),children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(ss,{data:d,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}const fs=[{target:"LinkLeaders",fn:"path",minStage:1,when:xn},{target:"LinkLeaders",fn:"src_hash",minStage:1,when:gn}];pe(fs);function to(){fe(fs);const e=Xt(),n=Gt(),o=we(),s=ie(),r=Ne(),c=Q[r].minutes*60,i=Us(),d=f.useMemo(()=>{if(i===0)return o;const p=i-c;return o.filter(B=>B.timestamp>=p)},[o,c,i]),u=s===null,m=s!=null&&s.local_hash?ot(s.local_hash):"",j=(s==null?void 0:s.neighbors)??{},{neighborHashes:l,neighborNames:x}=f.useMemo(()=>{const p=new Set,B=new Map;for(const C of n){p.add(C.hash);const R=j[C.hash],g=(R==null?void 0:R.name)||(R==null?void 0:R.node_name)||C.prefix;B.set(C.hash,g)}return{neighborHashes:p,neighborNames:B}},[n,j]),v=f.useMemo(()=>{if(l.size===0||d.length===0||!m)return{champion:null,listener:null,loudest:null};const{scores:p}=Sn(d,l,m),B=[];for(const[w,_]of p)_.blendedScore!==0&&B.push({..._,name:x.get(w)??ot(w)});let C=null,R=null,g=null;for(const w of B)(!C||w.blendedScore>C.blendedScore)&&(C=w),(!R||w.listenerScore>R.listenerScore)&&(R=w),(!g||w.loudScore>g.loudScore)&&(g=w);return{champion:C,listener:R,loudest:g}},[d,l,m,x]),h=p=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",p.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Blended Score: ",p.blendedScore,t.jsx("span",{className:"text-fg-muted/60 ml-1",children:"(Listener + Loud)"})]}),t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5",children:[t.jsxs("div",{children:["Listener: ",p.listenerScore,"/100 (",p.listenerCount," shared paths)"]}),t.jsxs("div",{children:["Loud: ",p.loudScore,"/100 (",p.loudCount," packets relayed)"]})]})]}),y=p=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",p.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",p.listenerScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[p.listenerCount," packets where they heard your transmissions"]})})]}),T=p=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",p.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",p.loudScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[p.loudCount," packets they relayed directly to you"]})})]}),{champion:S,listener:D,loudest:k}=v,b=S||D||k?t.jsxs("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:[S&&t.jsx(me,{content:h(S),children:t.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[t.jsx(kn,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-map-neighbor-color flex-shrink-0"}),t.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:S.name}),t.jsx("span",{className:"text-map-neighbor-color pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:S.blendedScore})]})}),D&&t.jsx(me,{content:y(D),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(os,{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:D.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:D.listenerScore})]})}),k&&t.jsx(me,{content:T(k),children:t.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[t.jsx(Jn,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),t.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:k.name}),t.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:k.loudScore})]})})]}):n.length===0?t.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No direct neighbors"}):t.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No routing data yet"});return t.jsx(le,{title:"Link Leaders",icon:t.jsx(ea,{className:"mini-widget-icon"}),isLoading:u,onClick:()=>e("/contacts"),children:b})}function so(e){return e<15?"excellent":e<30?"good":e<45?"fair":e<60?"congested":"critical"}function no(e){return e<15?"Clear channel":e<30?"Light traffic":e<45?"Moderate traffic":e<60?"Heavy traffic":e<75?"Congested":"Severe congestion"}function ao(){const{lbtStats:e,isLoading:n,error:o}=et(),s=e?It(e):0,r=e?so(s):"unknown",a=(e==null?void 0:e.maxBackoffMs)??0,c=e?a>200?"Peak":no(s):void 0,i=e&&a>200?`${Math.round(a)}ms`:void 0,d=e==null?void 0:e.sparklineCollisionRisk,u=f.useMemo(()=>!d||d.length<2?[]:d.map((j,l)=>({timestamp:Date.now()-(d.length-1-l)*36e5,count:j})),[d]),m=Math.round(s*10)/10;return t.jsx(le,{title:"Collision Risk",icon:t.jsx(_n,{className:"mini-widget-icon"}),value:m,unit:"%",status:r,subtitle:c,subtitleValue:i,isLoading:n,error:o,children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(ss,{data:u,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function oo(e){return e<30?"excellent":e<50?"good":e<70?"fair":e<90?"congested":"critical"}function ro(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function io(){var h,y;const[e,n]=f.useState(!1),[o]=f.useState(0),{stats:s,lbtStats:r,isLoading:a}=et(),c=((y=(h=s==null?void 0:s.config)==null?void 0:h.duty_cycle)==null?void 0:y.enforcement_enabled)??!1,i=f.useMemo(()=>{if(!s)return null;if(!c){const N=s.airtime_used_ms??0,b=s.max_airtime_ms??1,p=b>0?N/b*100:0;return{usedMs:N,maxMs:b,remainingMs:Math.max(0,b-N),utilizationPercent:p}}const T=s.airtime_used_ms??0,S=s.max_airtime_ms??1,D=s.airtime_remaining_ms??0,k=s.utilization_percent??(S>0?T/S*100:0);return{usedMs:T,maxMs:S,remainingMs:D,utilizationPercent:k}},[s,c]),d=f.useMemo(()=>{if(!r||r.totalPacketsWithLBT===0)return 100;const T=r.totalPacketsWithLBT-r.packetsWithRetries,S=r.totalPacketsWithLBT;return T/S*100},[r]),u=(i==null?void 0:i.utilizationPercent)??0,m=oo(u),j=(i==null?void 0:i.remainingMs)??0,l=d<95?"1st Try":"Remaining",x=d<95?`${d.toFixed(0)}%`:ro(j),v=i?t.jsx("div",{className:"mini-widget-progress mt-auto",children:t.jsx("div",{className:`mini-widget-progress-bar ${m}`,style:{width:`${Math.min(u,100)}%`}})}):null;return t.jsx(le,{title:"Duty Cycle",icon:t.jsx(Ot,{className:"mini-widget-icon"}),value:u.toFixed(1),unit:"%",status:m,subtitle:l,subtitleValue:x,isLoading:a,children:v})}function lo(){return t.jsxs("div",{className:"mini-widget",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(Me,{className:"w-4 h-4"}),t.jsx(Me,{className:"h-3 w-16"})]}),t.jsx(Me,{className:"h-7 w-12 mt-2"}),t.jsx(Me,{className:"h-3 w-20 mt-2"})]})}function co(){return t.jsx("div",{className:"widget-row",children:Array.from({length:5}).map((e,n)=>t.jsx(lo,{},n))})}const ps=[{target:"MeshHealth",fn:"type",minStage:1}];pe(ps);function uo({className:e="",isLoaded:n,leading:o}){fe(ps);const s=Vt(),r=n??s??!0;return t.jsxs("div",{className:`mesh-health-container relative ${e}`,children:[t.jsxs("div",{className:"mesh-health-header",children:[t.jsx(Ys,{className:"w-4 h-4 text-sys-blue"}),t.jsx("span",{className:"type-label text-fg-muted",children:"MESH HEALTH"})]}),r?t.jsx(Ja,{children:t.jsxs("div",{className:"widget-row",children:[o&&t.jsx("div",{className:"widget-leading",children:o}),t.jsx(eo,{}),t.jsx(ao,{}),t.jsx(io,{}),t.jsx(to,{})]})}):t.jsx(co,{})]})}const hs=[{target:"PublicChannel",fn:"decrypt",minStage:2,when:yn}];pe(hs);let xs="",gs="",Ct="";function mo(){const e=new Date,n=e.toDateString();if(n!==Ct){Ct=n,xs=n;const o=new Date(e);o.setDate(o.getDate()-1),gs=o.toDateString()}}function fo(e){mo();const n=new Date(e*1e3).toDateString();return n===xs?"Today":n===gs?"Yesterday":new Date(e*1e3).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})}function po(e,n,o){return`${e||""}|${n}|${o}`}function ho(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 xo=f.memo(function({message:n,onChannelClick:o,isChannelSelected:s}){const r=n.channelName||n.channelHash.slice(0,6);return t.jsx("div",{style:{transform:"translateZ(0)",willChange:"transform"},children:t.jsx($n,{senderName:n.senderName||"Unknown",text:n.text,timestamp:n.timestamp,nameAccessory:t.jsx(es,{channelName:r,active:s,onClick:()=>o==null?void 0:o(n.channelHash)})})})},ho);function go({open:e,onClose:n,messages:o,onLoadMore:s,hasMoreToLoad:r,isDecoding:a,initialChannel:c}){const i=f.useRef(null),d=f.useRef(!0),u=Ne(),m=Ut(),j=f.useRef(!1);f.useEffect(()=>{e?(j.current=!0,it.resume()):j.current&&it.pause()},[e]);const l=f.useMemo(()=>{const g=Date.now()/1e3,w=Q[u].minutes,_=g-w*60;return[...o].filter(P=>P.timestamp>=_).sort((P,L)=>P.timestamp-L.timestamp)},[o,u]),x=f.useCallback(()=>{const g=i.current;g&&(d.current=g.scrollTop>=-50)},[]),v=f.useMemo(()=>{const g=new Map;for(const w of l){const _=w.channelHash,P=g.get(_);P?P.count++:g.set(_,{name:w.channelName||w.channelHash.slice(0,6),hash:w.channelHash,count:1})}return Array.from(g.values()).sort((w,_)=>_.count-w.count)},[l]),h=v.length,[y,T]=f.useState(null),[S,D]=f.useState(!1);f.useEffect(()=>{e&&c&&T(c)},[e,c]);const k=f.useCallback(()=>{s(y,v)},[s,y,v]),N=f.useMemo(()=>y?l.filter(g=>g.channelHash===y):l,[l,y]),b=f.useMemo(()=>{const g=[];let w="";for(const _ of N){const P=fo(_.timestamp);P!==w&&(g.push({type:"date",date:P}),w=P),g.push({type:"message",message:_})}return g},[N]);f.useLayoutEffect(()=>{const g=i.current;g&&d.current&&(g.scrollTop=0)},[N.length]);const p=19,B=v.slice(0,p),C=v.slice(p),R=C.length>0;return t.jsx(Yt,{open:e,onClose:n,size:"lg",motionPlus:!0,solid:!0,children:t.jsxs(Jt,{className:"p-0 flex flex-col h-[80vh] max-h-[700px] rounded-2xl",children:[t.jsx("div",{className:"flex-shrink-0 px-4 sm:px-5 py-3 sm:py-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ns,{className:"size-5 text-icon-card-title flex-shrink-0"}),t.jsx("h2",{className:"type-micro",children:"Public Channels"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ts,{ranges:Q,selectedIndex:u,onSelect:m,size:"sm"}),t.jsx("button",{onClick:n,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"}),t.jsx("button",{onClick:n,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:t.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}),t.jsx("div",{className:"flex-shrink-0 px-3 pb-2 relative z-10 isolate",style:{minHeight:h>0?void 0:0},children:h>0&&t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsxs("button",{onClick:()=>T(null),className:J("px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",y===null?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:["All ",h]}),B.map(g=>t.jsx("button",{onClick:()=>T(g.hash),className:J("flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",y===g.hash?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:t.jsx("span",{className:"truncate max-w-[80px]",children:g.name})},g.hash)),R&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{onClick:()=>D(!S),className:J("flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",S||C.some(g=>g.hash===y)?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:["+",C.length,t.jsx(tn,{className:J("size-3 transition-transform",S&&"rotate-180")})]}),S&&t.jsx("div",{className:J("absolute top-full left-0 mt-1 z-50","min-w-[140px] max-h-[200px] overflow-y-auto","p-1 rounded-lg","bg-elevated backdrop-blur-xl","ring-1 ring-edge-subtle shadow-xl"),children:C.map(g=>t.jsxs("button",{onClick:()=>{T(g.hash),D(!1)},className:J("w-full flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-all text-left",y===g.hash?"bg-sys-blue/20 text-sys-blue":"text-fg-secondary hover:bg-subtle-fill-strong"),children:[t.jsx(Fn,{className:"size-2.5 opacity-60 flex-shrink-0"}),t.jsx("span",{className:"truncate",children:g.name}),t.jsxs("span",{className:"opacity-60 ml-auto",children:["(",g.count,")"]})]},g.hash))})]})]})}),t.jsx("div",{ref:i,onScroll:x,className:J("flex-1 overflow-y-auto overflow-x-hidden","mx-3 mb-3 rounded-md","bg-body","ring-1 ring-inset ring-edge-subtle","flex flex-col-reverse"),children:a&&N.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] text-fg-muted px-4 py-4",children:[t.jsx(Le,{className:"size-12 mb-4 text-sys-indigo animate-spin"}),t.jsx("p",{className:"text-lg font-medium",children:"Loading messages..."})]}):N.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] text-fg-muted px-4 py-4",children:[t.jsx(En,{className:"size-16 mb-4 opacity-20"}),t.jsx("p",{className:"text-lg font-medium",children:"No messages yet"}),t.jsx("p",{className:"text-sm mt-1 opacity-70",children:y?"No messages in this channel":"Public channel messages will appear here"})]}):t.jsxs("div",{className:"px-4 py-4",children:[r&&t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("button",{onClick:k,disabled:a,className:J("px-4 py-1.5 rounded-full","text-[11px] font-medium","ring-1 ring-inset",a?"bg-subtle-fill text-fg-muted ring-edge-subtle cursor-wait":"bg-sys-blue/10 text-sys-blue ring-sys-blue/20 hover:bg-sys-blue/20 hover:ring-sys-blue/30"),children:a?t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(Le,{className:"size-3 animate-spin"}),"Loading..."]}):"Load older messages"})}),b.map((g,w)=>{if(g.type==="date")return t.jsx("div",{className:"flex justify-center my-4",children:t.jsx("span",{className:J("px-3.5 py-1.5 rounded-full","bg-subtle-fill backdrop-blur-sm","text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:g.date})},`date-${g.date}-${w}`);const _=`msg-${g.message.timestamp}-${g.message.senderName||"anon"}-${g.message.channelHash}`;return t.jsx("div",{className:"mb-3",children:t.jsx(xo,{message:g.message,onChannelClick:T,isChannelSelected:y===g.message.channelHash})},_)})]})}),t.jsx("div",{className:"flex-shrink-0 px-5 py-2 text-center",children:t.jsxs("p",{className:"text-[11px] text-fg-muted",children:[N.length," messages · ",h," ",h===1?"channel":"channels",a&&t.jsxs("span",{className:"ml-2 text-sys-indigo",children:[t.jsx(Le,{className:"inline size-3 animate-spin mr-1"}),"Decrypting..."]})]})})]})})}function yo(e){const n=[],o=new Set;for(const s of e.values()){const r=s.decoded;if(!r||!r.decrypted||r.macCorrupted||!r.text)continue;const a=po(r.senderName,r.channelHash,r.text);o.has(a)||(o.add(a),n.push({timestamp:s.timestamp,channelName:r.channelName,channelHash:r.channelHash,senderName:r.senderName,text:r.text,rssi:s.rssi,snr:s.snr}))}return n}function bo({isLoaded:e}){const n=Vt(),o=e??n??!0;fe(hs);const s=we(),[r,a]=f.useState(!1),[c,i]=f.useState(null),d=Ne(),u=f.useCallback(()=>{i(null),a(!0),Ce.getState().queueDecryption(s)},[s]),m=Je(B=>B.requestedHash),j=Je(B=>B.clearRequest);f.useEffect(()=>{m&&(i(m),a(!0),Ce.getState().queueDecryption(s),j())},[m,j,s]);const l=Js(),x=Zs(),v=Ks(),h=f.useMemo(()=>yo(l),[l]),y=f.useMemo(()=>{const B=Date.now()/1e3,C=Q[d].minutes,R=B-C*60;return h.filter(g=>g.timestamp>=R)},[h,d]),T=f.useMemo(()=>y.length===0?null:y.reduce((B,C)=>C.timestamp>B.timestamp?C:B),[y]),S=x.isDecoding,k=f.useMemo(()=>{const B=Date.now()/1e3,C=Q[d].minutes,R=B-C*60,g=new Set;let w=0;for(const _ of s)(_.type??_.payload_type)===rt.GRP_TXT&&((_.timestamp??0){const B=Date.now()/1e3,C=Q[d].minutes,R=B-C*60;for(const g of s)if((g.type??g.payload_type)===rt.GRP_TXT&&!((g.timestamp??0){if(!S){if(B){const R=C.find(g=>g.hash===B);if(R){console.log(`[PublicChannelCard] Fast-path load for #${R.name}`),Ce.getState().queueChannelDecryption(s,R.name);return}}Ce.getState().queueDecryption(s)}},[s,S]);return o?t.jsxs(t.Fragment,{children:[t.jsx("div",{onClick:u,className:J("group cursor-pointer rounded-2xl transition-all duration-150","bg-surface/80 backdrop-blur-lg depth-raised","hover:bg-subtle-fill","px-3 py-2.5 sm:px-4 sm:py-3"),children:t.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",children:[t.jsx(ns,{className:"size-4 text-icon-card-title flex-shrink-0"}),t.jsx("span",{className:"type-micro",children:"CHAT ACTIVITY"}),k>0&&t.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-subtle-fill ring-1 ring-inset ring-edge-subtle text-sm tabular-nums text-fg-secondary",children:k}),t.jsx(mt,{className:"size-4 text-fg-muted group-hover:text-sys-indigo transition-colors ml-auto sm:hidden"})]}),t.jsxs("div",{className:"flex items-center gap-2 sm:gap-1.5 min-w-0 overflow-hidden",children:[t.jsx(Ke,{mode:"wait",initial:!1,children:T?t.jsxs(ge.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.2,ease:[.4,0,.2,1]},className:"flex items-center gap-2 sm:gap-1.5 min-w-0",children:[T.channelName&&t.jsx("span",{className:"hidden sm:inline-flex",children:t.jsx(es,{channelName:T.channelName})}),t.jsx("div",{className:"hidden sm:flex w-[30px] h-[30px] rounded-full items-center justify-center flex-shrink-0 ring-1 ring-edge-subtle",style:{backgroundColor:An(He(T.senderName||"").cleanName)},children:He(T.senderName||"").emoji?t.jsx("span",{className:"text-base",children:He(T.senderName||"").emoji}):t.jsx("span",{className:"text-white text-xs font-bold tracking-tighter",children:Pn(T.senderName||"")})}),t.jsx("div",{className:"inline-flex items-center px-3 py-1.5 rounded-2xl rounded-tr-md bg-[#007AFF] shadow-sm min-w-0 flex-1 sm:flex-initial sm:max-w-xs sm:-ml-px",children:t.jsx("span",{className:"text-sm text-white truncate tracking-wide",children:Ln(T.text)})}),t.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-subtle-fill ring-1 ring-inset ring-edge-subtle text-sm tabular-nums text-fg-secondary flex-shrink-0",children:en(T.timestamp)})]},`msg-${T.timestamp}-${T.senderName}-${T.channelHash}`):v?t.jsx(ge.span,{initial:{opacity:0},animate:{opacity:1},className:"text-sm text-fg-muted italic",children:"No messages yet"},"empty"):t.jsxs(ge.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,y:-16},transition:{duration:.15},className:"flex items-center gap-2 sm:gap-1.5",children:[t.jsx("div",{className:"hidden sm:block w-8 h-4 rounded bg-subtle-fill-strong animate-pulse"}),t.jsx("div",{className:"hidden sm:block w-[30px] h-[30px] rounded-full bg-subtle-fill-strong animate-pulse"}),t.jsx("div",{className:"h-8 w-32 sm:w-48 rounded-2xl bg-subtle-fill-strong animate-pulse"}),t.jsx("div",{className:"w-12 h-6 rounded-md bg-subtle-fill-strong animate-pulse"})]},"skeleton")}),t.jsx(mt,{className:"size-4 text-fg-muted group-hover:text-sys-indigo transition-colors flex-shrink-0 hidden sm:block ml-1"})]})]})}),t.jsx(go,{open:r,onClose:()=>a(!1),messages:h,onLoadMore:p,hasMoreToLoad:b,isDecoding:S,initialChannel:c})]}):t.jsx("div",{className:"h-14 rounded-xl bg-elevated/50 animate-pulse"})}const q=2,jo=2,De=5,Re=4,be=20,We=Qe(Y.cyan),qe=Qe(Y.amber),Xe=Qe(Y.red);function tt(e,n,o){const s=o.length;if(s===0)return null;let r=0,a=0;for(let N=0;Nr&&(r=b);const p=o[N].newlyGuarded.length;p>a&&(a=p)}if(r===0&&a===0)return null;const c=Math.max(1,De-a),i=r>0?Math.max(1,Math.ceil(r/c)):1,d=e-Re*2,u=n-Re*2,m=(d-q*(be-1))/be,j=(u-q*(De-1))/De,l=Math.max(3,Math.min(m,j)),x=l+q,v=s,h=0,y=be*x-q,T=Re+(d-y)/2,S=De*x-q,D=Re+(u-S),k=Math.min(jo,l/3);return{quantum:i,tileSize:l,colStep:x,visibleCols:v,startIdx:h,offsetX:T,offsetY:D,gridH:S,r:k}}function wo(e,n,o,s,r){e.clearRect(0,0,o*(window.devicePixelRatio||1),s*(window.devicePixelRatio||1));const a=tt(o,s,n);if(a)for(let c=0;c0?(h=a.offsetY+a.gridH-d*a.colStep+q,y=d*a.colStep-q):v==="dropped"&&u>0?(h=a.offsetY+a.gridH-(d+u)*a.colStep+q,y=u*a.colStep-q):v==="guarded"&&m>0&&(h=a.offsetY+a.gridH-j*a.colStep+q,y=m*a.colStep-q),y>0&&(e.beginPath(),e.roundRect(l-1,h-1,a.tileSize+2,y+2,a.r+1),e.stroke()),e.restore()}}}function No(e,n,o,s,r){const a=tt(o,s,r);if(!a)return null;const c=Math.floor((e-a.offsetX+q/2)/a.colStep);if(c<0||c>=a.visibleCols)return null;const i=r[a.startIdx+c],d=Math.ceil(i.allowedDelta/a.quantum),u=Math.ceil(i.droppedDelta/a.quantum),m=i.newlyGuarded.length,j=d+u+m;if(j===0)return null;const l=a.offsetX+c*a.colStep;if(el+a.tileSize)return null;const x=a.offsetY+a.gridH,v=x-d*a.colStep+q,h=x-(d+u)*a.colStep+q,y=x-j*a.colStep+q;return m>0&&n>=y&&n0&&n>=h&&n0&&n>=v&&n<=x?{col:c,segment:"allowed"}:null}function Ve(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const de=5;function vo(e){if(e<60)return`${Math.round(e)}s`;if(e<3600)return`${Math.floor(e/60)}m`;const n=Math.floor(e/3600),o=Math.floor(e%3600/60);return o>0?`${n}h ${o}m`:`${n}h`}function ko(e,n,o,s){const r=e.allowedDelta+e.droppedDelta;if(n==="allowed")return t.jsxs("div",{className:"min-w-[120px] space-y-1",children:[t.jsx("div",{className:"text-[10px] text-fg-muted tabular-nums",children:Ve(e.ts)}),t.jsxs("div",{className:"text-xs tabular-nums",children:[t.jsx("span",{className:"text-sys-cyan font-medium",children:e.allowedDelta}),t.jsx("span",{className:"text-fg-muted",children:" adverts allowed"})]}),e.trackedCount>0&&t.jsxs("div",{className:"text-[10px] text-fg-muted tabular-nums",children:[e.trackedCount," sources tracked"]}),r>0&&t.jsxs("div",{className:"text-[10px] text-fg-muted tabular-nums",children:[Math.round(e.allowedDelta/r*100),"% of traffic"]})]});if(n==="dropped"){const a=r>0?Math.round(e.droppedDelta/r*100):0,c=a-o;return t.jsxs("div",{className:"min-w-[140px] max-w-[240px] space-y-1",children:[t.jsx("div",{className:"text-[10px] text-fg-muted tabular-nums",children:Ve(e.ts)}),t.jsxs("div",{className:"text-xs tabular-nums",children:[t.jsx("span",{className:"text-sys-amber font-medium",children:e.droppedDelta}),t.jsx("span",{className:"text-fg-muted",children:" adverts dropped"})]}),r>0&&t.jsxs("div",{className:"text-[10px] tabular-nums",children:[t.jsxs("span",{className:a>50?"text-sys-amber":"text-fg-muted",children:[a,"% drop rate"]}),Math.abs(c)>=5&&t.jsxs("span",{className:c>0?"text-sys-amber":"text-sys-cyan",children:[" ","(",c>0?"+":"",c,"% vs avg)"]})]}),e.drops.length>0&&t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:[e.drops.slice(0,de).map((i,d)=>t.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[t.jsx("span",{className:"font-mono truncate",children:i.name||i.pubkey.slice(0,8)}),t.jsx("span",{className:"text-fg-muted text-[10px] truncate flex-shrink-0 max-w-[100px]",children:i.reason})]},`${i.pubkey}-${d}`)),e.drops.length>de&&t.jsxs("div",{className:"text-[10px] text-fg-muted",children:["+",e.drops.length-de," more"]})]})]})}return t.jsxs("div",{className:"min-w-[140px] max-w-[220px] space-y-1",children:[t.jsx("div",{className:"text-[10px] text-fg-muted tabular-nums",children:Ve(e.ts)}),t.jsxs("div",{className:"text-xs text-sys-red font-medium",children:[e.newlyGuarded.length," newly guarded"]}),e.newlyGuarded.length>0&&t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:[e.newlyGuarded.slice(0,de).map(a=>t.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[t.jsx("span",{className:"font-mono truncate",children:s(a.pubkey)}),t.jsx("span",{className:"text-fg-muted tabular-nums flex-shrink-0",children:vo(a.remaining)})]},a.pubkey)),e.newlyGuarded.length>de&&t.jsxs("div",{className:"text-[10px] text-fg-muted",children:["+",e.newlyGuarded.length-de," more"]})]})]})}function Mo(e){if(e.length<=be)return e;const n=Math.ceil(e.length/be),o=[];for(let s=0;sMo(n),[n]),s=f.useRef(null),r=f.useRef(null),{show:a,hide:c,updatePosition:i}=nn(),d=f.useRef(!1),u=f.useRef(null),m=ie(),j=an(),[l,x]=f.useState(!1),v=(g=(R=m==null?void 0:m.config)==null?void 0:R.repeater)==null?void 0:g.advert_rate_limit,h=(_=(w=m==null?void 0:m.config)==null?void 0:w.repeater)==null?void 0:_.advert_penalty_box,y=(L=(P=m==null?void 0:m.config)==null?void 0:P.repeater)==null?void 0:L.advert_adaptive,T=(e==null?void 0:e.stats.adverts_allowed)??0,S=(e==null?void 0:e.stats.adverts_dropped)??0,D=f.useMemo(()=>{const A=new Set;for(const $ of o)for(const M of $.newlyGuarded)A.add(M.pubkey);return A.size},[o]),k=f.useMemo(()=>{const A=new Map;for(const M of(e==null?void 0:e.recent_drops)??[])M.name&&A.set(M.pubkey,M.name);const $=(m==null?void 0:m.neighbors)??{};for(const[M,F]of Object.entries($))if(!A.has(M)){const E=F.name||F.node_name;E&&A.set(M,E)}return M=>A.get(M)||M.slice(0,8)},[e==null?void 0:e.recent_drops,m==null?void 0:m.neighbors]),N=f.useMemo(()=>{let A=0,$=0;for(const F of o)A+=F.allowedDelta,$+=F.droppedDelta;const M=A+$;return M>0?Math.round($/M*100):0},[o]),b="10m",p=f.useCallback(()=>{const A=s.current,$=r.current;if(!A||!$)return;const M=$.getBoundingClientRect(),F=window.devicePixelRatio||1,E=Math.floor(M.width),z=Math.floor(M.height);if(E===0||z===0)return;A.width=E*F,A.height=z*F,A.style.width=`${E}px`,A.style.height=`${z}px`;const I=A.getContext("2d");I&&(I.scale(F,F),wo(I,o,E,z,u.current))},[o]);f.useEffect(()=>{p();const A=new ResizeObserver(()=>p());return r.current&&A.observe(r.current),()=>A.disconnect()},[p]);const B=f.useCallback(A=>{const $=r.current;if(!$||o.length===0)return;const M=$.getBoundingClientRect(),F=Math.floor(M.width),E=Math.floor(M.height),z=A.clientX-M.left,I=A.clientY-M.top,W=No(z,I,F,E,o);if(!W){u.current&&(u.current=null,p()),d.current&&(d.current=!1,c());return}const O=u.current;(!O||O.col!==W.col||O.segment!==W.segment)&&(u.current=W,p());const G=tt(F,E,o);if(!G)return;const H=o[G.startIdx+W.col],V=ko(H,W.segment,N,k);d.current?i(A.clientX,A.clientY):d.current=!0,a(V,A.clientX,A.clientY)},[o,N,k,a,c,i,p]),C=f.useCallback(()=>{u.current&&(u.current=null,p()),d.current&&(d.current=!1,c())},[c,p]);return t.jsxs(je,{noPadding:!0,isLoaded:!0,className:"mini-widget overflow-hidden flex flex-col",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(In,{className:"mini-widget-icon"}),t.jsx("span",{className:"mini-widget-title",children:"Advert Decisions"}),t.jsx(ne,{color:"zinc",children:b})]}),t.jsx("div",{ref:r,className:"h-28 mx-2 overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",onMouseMove:B,onMouseLeave:C,children:o.length>0?t.jsx("canvas",{ref:s,className:"block w-full h-full"}):t.jsx("div",{className:"flex items-center justify-center w-full h-full text-xs text-fg-muted",children:"Waiting for data…"})}),t.jsxs("div",{className:"grid grid-cols-2 gap-x-3 sm:gap-x-4 gap-y-1 px-3 py-2.5 type-data-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"shrink-0 w-3 h-3 rounded-xs bg-sys-cyan"}),t.jsx("span",{className:"text-fg-secondary uppercase tracking-wide whitespace-nowrap",children:"Allow"}),t.jsx("span",{className:"tabular-nums text-fg-muted shrink-0",children:t.jsx(re,{value:T,priority:"low"})})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"shrink-0 w-3 h-3 rounded-xs bg-sys-amber"}),t.jsx("span",{className:"text-fg-secondary uppercase tracking-wide whitespace-nowrap",children:"Drop"}),t.jsx("span",{className:"tabular-nums text-fg-muted shrink-0",children:t.jsx(re,{value:S,priority:"low"})})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"shrink-0 w-3 h-3 rounded-xs bg-sys-red"}),t.jsx("span",{className:"text-fg-secondary uppercase tracking-wide whitespace-nowrap",children:"In Jail"}),t.jsx("span",{className:"tabular-nums text-fg-muted shrink-0",children:D})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"shrink-0 w-3 h-3 rounded-xs bg-zinc-500/30"}),t.jsx("span",{className:"text-fg-secondary uppercase tracking-wide whitespace-nowrap",children:"Tracked"}),t.jsx("span",{className:"tabular-nums text-fg-muted shrink-0",children:(e==null?void 0:e.tracked_pubkeys)??0})]})]}),t.jsx("div",{className:"mt-auto px-2 pb-2",children:t.jsxs($e,{color:"primary",outline:!0,className:"w-full justify-center",onClick:()=>x(!0),children:[t.jsx(Bn,{"data-slot":"icon"}),"Adapt"]})}),t.jsx(Dn,{open:l,onClose:()=>x(!1),currentConfig:{tokenBucket:v,penaltyBox:h,adaptive:y},onApplied:async()=>{await j({force:!0}).catch(()=>{})}})]})}const To=f.memo(Co);function Tt(e){if(e<60)return`${Math.round(e)}s`;if(e<3600)return`${Math.floor(e/60)}m`;const n=Math.floor(e/3600),o=Math.floor(e%3600/60);return o>0?`${n}h ${o}m`:`${n}h`}function So(){const e=ve(),n=ie();return{all:f.useMemo(()=>{if(!(e!=null&&e.active_penalties))return[];const s=new Map;for(const i of e.recent_drops??[])i.name&&s.set(i.pubkey,i.name);const r=(n==null?void 0:n.neighbors)??{};for(const[i,d]of Object.entries(r))if(!s.has(i)){const u=d.name||d.node_name;u&&s.set(i,u)}const a=new Map,c=new Map;for(const i of e.recent_drops??[])a.has(i.pubkey)||a.set(i.pubkey,i.reason),c.set(i.pubkey,(c.get(i.pubkey)??0)+1);return Object.entries(e.active_penalties).sort(([,i],[,d])=>d-i).map(([i,d])=>({pubkey:i,name:s.get(i)||i.slice(0,8),remaining:d,reason:a.get(i),dropCount:c.get(i)??0}))},[e,n==null?void 0:n.neighbors]),isLoading:!e,penaltyCount:e?Object.keys(e.active_penalties??{}).length:0}}function ys({offender:e,rank:n}){const o=n===0;return t.jsx(me,{content:t.jsxs("div",{className:"max-w-[260px]",children:[t.jsx("div",{className:"font-semibold mb-1",children:e.name}),t.jsx("div",{className:"text-fg-muted text-xs font-mono mb-1",children:e.pubkey}),t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5 text-xs",children:[t.jsxs("div",{children:["Penalty: ",Tt(e.remaining)," remaining"]}),e.reason&&t.jsxs("div",{children:["Reason: ",e.reason]}),t.jsxs("div",{children:["Recent drops: ",e.dropCount]})]})]}),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("span",{className:`font-mono truncate flex-1 min-w-0 ${o?"font-semibold text-sys-red":"text-fg-muted"}`,children:e.name}),t.jsx("span",{className:`pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right ${o?"text-sys-red":"text-fg-muted"}`,children:Tt(e.remaining)})]})})}function _o({open:e,onClose:n,offenders:o}){return t.jsxs(Yt,{open:e,onClose:n,size:"sm",children:[t.jsx(on,{icon:t.jsx(rs,{size:20}),title:`Penalty Box (${o.length})`,onClose:n}),t.jsx(Jt,{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:o.length===0?t.jsx("div",{className:"text-center text-sm text-fg-muted py-4",children:"No active penalties"}):o.map(s=>t.jsx(ys,{offender:s},s.pubkey))})]})}function Bo(){const{all:e,isLoading:n,penaltyCount:o}=So(),s=ve(),[r,a]=f.useState(!1),c=f.useCallback(()=>a(!0),[]),i=f.useCallback(()=>a(!1),[]),d=e.slice(0,3),u=(s==null?void 0:s.recent_drops)??[],m=o===0&&u.length>0&&!n,j=u.slice(0,3);return t.jsxs(t.Fragment,{children:[t.jsxs(le,{title:"Most Wanted",icon:t.jsx(rs,{className:"mini-widget-icon"}),isLoading:n,isLoaded:!0,children:[d.length>0?t.jsx("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:d.map((l,x)=>t.jsx(ys,{offender:l,rank:x},l.pubkey))}):m?t.jsx("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:j.map((l,x)=>t.jsx(me,{content:t.jsxs("div",{className:"max-w-[260px]",children:[t.jsx("div",{className:"font-semibold mb-1",children:l.name||l.pubkey}),t.jsx("div",{className:"text-fg-muted text-xs font-mono mb-1",children:l.pubkey}),t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 text-xs",children:[t.jsxs("div",{children:["Reason: ",l.reason]}),t.jsxs("div",{children:[Math.round(l.seconds_ago),"s ago"]})]})]}),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("span",{className:`font-mono truncate flex-1 min-w-0 ${x===0?"font-semibold text-sys-amber":"text-fg-muted"}`,children:l.name||l.pubkey.slice(0,8)}),t.jsx("span",{className:`pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right truncate ${x===0?"text-sys-amber":"text-fg-muted"}`,children:l.reason.replace(/^Token bucket: /,"").replace(/^Penalty: /,"")})]})},l.pubkey))}):o===0&&!n?t.jsx("div",{className:"flex items-center justify-center text-xs text-fg-muted mt-auto",children:"No active penalties"}):null,o>0?t.jsxs("div",{className:"flex items-center mt-auto pt-0.5",children:[t.jsxs("span",{className:"text-[10px] text-fg-muted tabular-nums",children:[o," in penalty box"]}),o>3&&t.jsx($e,{plain:!0,className:"ml-auto text-[10px] text-sys-blue hover:underline",onClick:c,children:"Show All"})]}):m?t.jsx("div",{className:"flex items-center mt-auto pt-0.5",children:t.jsxs("span",{className:"text-[10px] text-sys-amber tabular-nums",children:[u.length," recent drop",u.length!==1?"s":""]})}):null]}),t.jsx(_o,{open:r,onClose:i,offenders:e})]})}const St=[{key:"quiet",color:Y.green,label:"Quiet"},{key:"normal",color:Y.blue,label:"Normal"},{key:"busy",color:Y.amber,label:"Busy"},{key:"congested",color:Y.red,label:"Congested"}],_t={quiet:"text-sys-green",normal:"text-sys-blue",busy:"text-sys-amber",congested:"text-sys-red"},Bt=2,Do=4;function Ro(e,n,o,s){const{quietMax:r,normalMax:a,busyMax:c,ewmaValue:i}=n;e.clearRect(0,0,o,s);const d=Math.max(c*2,i*1.3,c+.5),u=Bt*3,m=o-u,j=[{start:0,end:r,color:Y.green},{start:r,end:a,color:Y.blue},{start:a,end:c,color:Y.amber},{start:c,end:d,color:Y.red}],l=[];let x=0;for(const C of j){const R=(C.end-C.start)/d*m;l.push({...C,px:x,pw:R}),x+=R+Bt}const v=8,h=v,y=s-v-2;for(const C of l)e.fillStyle=C.color,e.globalAlpha=1,e.beginPath(),e.roundRect(C.px,h,C.pw,y,Do),e.fill();function T(C){const R=Math.max(0,Math.min(C,d));for(const w of l)if(R<=w.end){const _=w.end>w.start?(R-w.start)/(w.end-w.start):0;return w.px+_*w.pw}const g=l[l.length-1];return g.px+g.pw}const S=T(i),D=4,k=4,N=h-1,b=h+y+1,p=lt[900],B=lt[200];e.fillStyle=p,e.beginPath(),e.moveTo(S-k,N-D),e.lineTo(S+k,N-D),e.lineTo(S,N),e.closePath(),e.fill(),e.fillStyle=B,e.beginPath(),e.moveTo(S-(k-1),N-D+.5),e.lineTo(S+(k-1),N-D+.5),e.lineTo(S,N-.5),e.closePath(),e.fill();for(const[C,R]of[[p,-1],[B,0],[p,1]])e.strokeStyle=C,e.lineWidth=1,e.beginPath(),e.moveTo(S+R,N),e.lineTo(S+R,b),e.stroke()}const Ae={stiffness:120,damping:20,mass:.8};function Ao(){var g,w,_,P,L,A,$;const e=ve(),n=Zt(),o=Kt(),s=rn(),r=ie(),a=f.useRef(null),c=f.useRef(null),i=(w=(g=r==null?void 0:r.config)==null?void 0:g.repeater)==null?void 0:w.advert_adaptive,d=(e==null?void 0:e.adaptive.current_tier)??"normal",u=e==null?void 0:e.adaptive.pending_tier,m=!!u&&u!==d,j=((_=i==null?void 0:i.thresholds)==null?void 0:_.quiet_max)??.05,l=((P=i==null?void 0:i.thresholds)==null?void 0:P.normal_max)??.2,x=((L=i==null?void 0:i.thresholds)==null?void 0:L.busy_max)??.5,v=ue(s),h=Se(v,Ae),y=ue(j),T=ue(l),S=ue(x),D=Se(y,Ae),k=Se(T,Ae),N=Se(S,Ae);f.useEffect(()=>{v.set(s)},[s,v]),f.useEffect(()=>{y.set(j)},[j,y]),f.useEffect(()=>{T.set(l)},[l,T]),f.useEffect(()=>{S.set(x)},[x,S]);const b=f.useCallback(()=>{const M=a.current,F=c.current;if(!M||!F)return;const E=F.getBoundingClientRect(),z=window.devicePixelRatio||1,I=Math.floor(E.width),W=Math.floor(E.height);if(I===0||W===0)return;M.width=I*z,M.height=W*z,M.style.width=`${I}px`,M.style.height=`${W}px`;const O=M.getContext("2d");O&&(O.scale(z,z),Ro(O,{quietMax:D.get(),normalMax:k.get(),busyMax:N.get(),ewmaValue:h.get()},I,W))},[D,k,N,h]);f.useEffect(()=>{const M=[h.on("change",()=>b()),D.on("change",()=>b()),k.on("change",()=>b()),N.on("change",()=>b())];return()=>M.forEach(F=>F())},[h,D,k,N,b]),f.useEffect(()=>{b();const M=new ResizeObserver(()=>b());return c.current&&M.observe(c.current),()=>M.disconnect()},[b]);const p=((A=St.find(M=>M.key===d))==null?void 0:A.label)??d,B=_t[d]??"text-fg-muted",C=!e&&!o,R=o&&!n;return t.jsxs(le,{title:"Adaptive Tier",icon:t.jsx(ln,{className:"mini-widget-icon"}),isLoading:C,isLoaded:!0,error:R?"Adaptive tier data unavailable":null,headerRight:t.jsxs("span",{className:"text-[10px] text-fg-muted tabular-nums",children:[t.jsx("span",{className:"data-box data-box-compact",children:s.toFixed(2)}),t.jsx("span",{className:"ml-0.5 text-fg-muted/60",children:"adv/min"})]}),children:[t.jsx("div",{ref:c,className:"w-full h-8 sm:h-10 md:h-12",children:t.jsx("canvas",{ref:a,className:"block w-full h-full"})}),t.jsxs("div",{className:J("data-box data-box-fill text-center font-semibold uppercase tracking-wide mt-1",B),children:[p,m&&t.jsxs("span",{className:J("ml-1.5 text-[10px] font-normal animate-pulse",_t[u]??"text-fg-muted"),children:["→ ",(($=St.find(M=>M.key===u))==null?void 0:$.label)??u]})]})]})}const Po=f.memo(Ao);function Dt(e){if(e<60)return`${e}s`;if(e<3600){const s=Math.floor(e/60),r=e%60;return r>0?`${s}m ${r}s`:`${s}m`}const n=Math.floor(e/3600),o=Math.floor(e%3600/60);return o>0?`${n}h ${o}m`:`${n}h`}function Lo(){var l;const e=ve(),n=((e==null?void 0:e.stats.drop_rate)??0)*100,o=(e==null?void 0:e.stats.adverts_allowed)??0,s=(e==null?void 0:e.stats.adverts_dropped)??0,r=(e==null?void 0:e.tracked_pubkeys)??0,a=(e==null?void 0:e.effective_limits)??null,c=((l=e==null?void 0:e.metrics)==null?void 0:l.duplicate_ratio_ewma)??0,i=(e==null?void 0:e.stats.adverts_duplicate_reheard)??0,d=o+s,u=d>0?o/d*100:100,m=!e,j=d>0?s/d*100:0;return t.jsx(le,{title:"Drop Rate",icon:t.jsx(as,{className:"mini-widget-icon"}),value:Math.round(n),unit:"%",isLoading:m,isLoaded:!0,headerRight:t.jsxs("span",{className:"text-[10px] text-fg-muted tabular-nums",children:["Tracked ",t.jsx("span",{className:"data-box data-box-compact ml-0.5",children:r})]}),children:d>0&&t.jsx(me,{content:t.jsxs("div",{className:"min-w-[140px] space-y-1",children:[t.jsx("div",{className:"text-xs text-fg-secondary font-medium",children:"Effective Limits"}),a?t.jsxs("div",{className:"space-y-0.5 text-[10px] tabular-nums",children:[t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("span",{className:"text-fg-muted",children:"Bucket"}),t.jsxs("span",{children:[a.bucket_capacity," tokens"]})]}),t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("span",{className:"text-fg-muted",children:"Refill"}),t.jsxs("span",{children:[a.refill_tokens," / ",Dt(a.refill_interval_seconds)]})]}),a.min_interval_seconds>0&&t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("span",{className:"text-fg-muted",children:"Min interval"}),t.jsx("span",{children:Dt(a.min_interval_seconds)})]})]}):t.jsx("div",{className:"text-[10px] text-fg-muted",children:"Limits not available"}),t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5 text-[10px] tabular-nums",children:[t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("span",{className:"text-fg-muted",children:"Tracked"}),t.jsxs("span",{children:[r," pubkey",r!==1?"s":""]})]}),i>0&&t.jsxs("div",{className:"flex justify-between gap-3",children:[t.jsx("span",{className:"text-fg-muted",children:"Deduped"}),t.jsxs("span",{children:[i.toLocaleString()," (",Math.round(c*100),"%)"]})]})]})]}),children:t.jsxs("div",{className:"w-full mt-auto cursor-default",children:[t.jsxs("div",{className:"flex h-1.5 gap-0.5",children:[t.jsx("div",{className:"h-full rounded-full bg-sys-cyan transition-all duration-500",style:{width:`${u}%`}}),t.jsx("div",{className:"h-full rounded-full bg-sys-red transition-all duration-500",style:{width:`${j}%`}})]}),t.jsxs("div",{className:"flex justify-between mt-0.5",children:[t.jsx("span",{className:"type-data-xs text-sys-cyan/70 tabular-nums",children:o.toLocaleString()}),t.jsx("span",{className:"type-data-xs text-sys-red/70 tabular-nums",children:s.toLocaleString()})]})]})})})}const $o="/assets/spam-can-JZXwgFOy.svg",Fo=1376,Ue=768,Eo=[{x:0,w:280,stretch:!1},{x:280,w:4,stretch:!0},{x:284,w:808,stretch:!1},{x:1092,w:4,stretch:!0},{x:1096,w:280,stretch:!1}];function Io(){return t.jsx("div",{className:"relative h-full w-full overflow-hidden rounded-[var(--radius-card)]",children:t.jsx("div",{className:"absolute inset-0 flex",children:Eo.map(({x:e,w:n,stretch:o})=>t.jsx("svg",{viewBox:`${e} 0 ${n} ${Ue}`,preserveAspectRatio:"none",style:o?{height:"100%",flex:"1 1 0",minWidth:0}:{height:"100%",aspectRatio:`${n} / ${Ue}`,flexShrink:0},children:t.jsx("image",{href:$o,width:Fo,height:Ue})},e))})})}const Ho=f.memo(Io);function zo(){const e=Zt();return!Kt()||!e?null:t.jsxs("div",{className:"mesh-health-container relative",children:[t.jsxs("div",{className:"mesh-health-header",children:[t.jsx(Vn,{className:"w-4 h-4 text-sys-blue"}),t.jsx("span",{className:"type-label text-fg-muted",children:"SPAMGUARD"})]}),t.jsxs("div",{className:"widget-row",children:[t.jsx("div",{className:"widget-leading",children:t.jsx(To,{})}),t.jsx(Po,{}),t.jsx(Lo,{}),t.jsx(Bo,{}),t.jsx(Ho,{})]})]})}function Tr(){var g;const e=ie(),n=cn(),o=dn(),s=ga(),r=f.useRef(!1);o&&!r.current&&(r.current=!0);const a=r.current,c=Ne(),i=Ut(),d=un(),u=Q[c]??Q[4],m=d.isBackgroundLoading&&c>=5,[j,l]=f.useState([]),[x,v]=f.useState(0),[h,y]=f.useState(()=>localStorage.getItem("rx-crc-overlay")==="true"),T=f.useCallback(()=>{y(w=>{const _=!w;return localStorage.setItem("rx-crc-overlay",String(_)),_})},[]),[S,D]=f.useState(()=>localStorage.getItem("rx-analytics-view")==="true"),k=f.useCallback(w=>{D(w),localStorage.setItem("rx-analytics-view",String(w))},[]);f.useEffect(()=>{const w=u.minutes/60;Promise.all([qt(w),Wt(w,5e4)]).then(([_,P])=>{var L,A;v((_.success&&((L=_.data)==null?void 0:L.count)!=null?_.data.count:P.success&&((A=P.data)==null?void 0:A.count)!=null?P.data.count:0)??0),l(P.success&&P.data?P.data.history:[])})},[u.minutes]);const N=f.useMemo(()=>{const w=z=>(z==null?void 0:z.reduce((I,W)=>I+W.count,0))??0,_=w(s==null?void 0:s.received),P=w(s==null?void 0:s.unique_received),L=w(s==null?void 0:s.forwarded),A=w(s==null?void 0:s.dropped),$=w(s==null?void 0:s.transmitted),M=((s==null?void 0:s.time_range_minutes)??u.minutes)/60,F=M>0?Math.round(_/M):0,E=M>0?Math.round(L/M):0;return{received:_,uniqueReceived:P,forwarded:L,dropped:A,transmitted:$,rxPerHour:F,fwdPerHour:E}},[s,u.minutes]),b=f.useMemo(()=>s?{totalBytes:s.totalReceivedBytes,kbPerHour:s.kbPerHour}:{totalBytes:0,kbPerHour:0},[s]),p=f.useMemo(()=>{if(!s)return[];const{receivedBytesBuckets:w,start_time:_,bucket_duration_seconds:P,bucket_count:L}=s,A=new Array(L).fill(0);for(const $ of j){const M=Math.floor(($.timestamp-_)/P);M>=0&&M({start:$.start,end:$.end,bytesByType:{...$.countByType,...h&&A[M]>0?{[K]:A[M]}:{}},totalBytes:$.totalCount}))},[s,j,h]),B=f.useMemo(()=>{if(!s)return[];const{receivedCountByType:w}=s,_=Object.keys(w).map(P=>parseInt(P,10)).filter(P=>(w[P]??0)>0).sort((P,L)=>(w[L]??0)-(w[P]??0));return h&&x>0&&_.unshift(K),_},[s,x,h]),C=f.useMemo(()=>{if(!s)return{};const w={...s.receivedCountByType??{}};return h&&x>0&&(w[K]=x),w},[s,x,h]),R=(e==null?void 0:e.node_name)??((g=e==null?void 0:e.config)==null?void 0:g.node_name)??"Unknown Node";return f.useEffect(()=>{R&&R!=="Unknown Node"&&(document.title=`pyMC: ${R}`)},[R]),n?t.jsxs(dt,{neomorphic:!0,className:"p-8 text-center",children:[t.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Failed to connect to backend"}),t.jsx("p",{className:"type-body text-fg-muted",children:n}),t.jsx("p",{className:"type-data-sm text-fg-muted mt-4",children:"Make sure the backend is running on port 8000"})]}):t.jsxs(mn,{children:[t.jsx(fn,{title:R,icon:t.jsx(Hn,{}),subtitle:t.jsx(Tn,{}),controls:t.jsx(ts,{ranges:Q,selectedIndex:c,onSelect:i,isPending:m})}),t.jsxs(pn,{ready:a,children:[t.jsx(bo,{}),t.jsx(ft,{template:"hero-auto",children:t.jsxs(dt,{neomorphic:!0,children:[t.jsx(Ht,{icon:t.jsx(as,{}),title:"PACKETS RECEIVED",badge:u.label,badgeColor:"zinc",titleExtra:t.jsx(zt,{enabled:S,onChange:k,size:"sm",label:t.jsx("span",{className:"font-mono text-xs text-fg-muted uppercase tracking-wide",children:"Advanced"})}),actions:a?t.jsx("div",{className:"flex items-center gap-1.5",children:S?t.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"CRC errors — packets corrupted during radio transmission",children:[t.jsx(ct,{className:"w-3.5 h-3.5 text-sys-red"}),t.jsxs("span",{children:["CRC ",x.toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:T,className:"p-1 rounded hover:bg-zinc-500/20 active:bg-zinc-500/30 transition-colors touch-manipulation",title:h?"Hide CRC Errors":"Show CRC Errors","aria-label":h?"Hide CRC error overlay":"Show CRC error overlay","aria-pressed":h,children:t.jsx(ct,{className:`w-3.5 h-3.5 transition-colors ${h?"text-sys-red":"text-fg-muted"}`})}),t.jsxs("div",{className:"data-box",children:[b.kbPerHour," KB/hr"]})]})}):void 0}),t.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:S?t.jsx(Da,{forwardedBuckets:(s==null?void 0:s.forwardedBytesBuckets)??[],droppedBuckets:(s==null?void 0:s.droppedBytesBuckets)??[],forwardedActiveTypes:(s==null?void 0:s.forwardedActiveTypes)??[],droppedActiveTypes:(s==null?void 0:s.droppedActiveTypes)??[],forwardedCount:N.forwarded,droppedCount:N.dropped,crcCount:x,crcHistory:j,receivedCount:N.received,forwardedTotalByType:(s==null?void 0:s.forwardedTotalByType)??{},droppedTotalByType:(s==null?void 0:s.droppedTotalByType)??{},startTime:(s==null?void 0:s.start_time)??0,bucketDurationSeconds:(s==null?void 0:s.bucket_duration_seconds)??1,bucketCount:(s==null?void 0:s.bucket_count)??0,timeRangeMinutes:u.minutes}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-8",children:[t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsx("div",{className:"type-data-xl text-fg-primary",children:a?t.jsx(re,{value:N.received,className:"font-mono tabular-nums",priority:"high"}):t.jsx("span",{className:"opacity-30",children:"—"})}),t.jsx(ne,{color:"zinc",className:"mb-0.5 sm:mb-1",children:"Total Rx"})]}),t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsx("div",{className:"type-data-xl text-fg-primary",children:a?t.jsx(re,{value:N.uniqueReceived,className:"font-mono tabular-nums",priority:"high"}):t.jsx("span",{className:"opacity-30",children:"—"})}),t.jsx(ne,{color:"zinc",className:"mb-0.5 sm:mb-1",children:"Unique"})]})]}),t.jsx("div",{className:"mt-2 flex-1 min-h-0",children:t.jsx(ja,{buckets:p,activeTypes:B,totalByType:C,mode:"count"})})]})})]})}),t.jsx(uo,{leading:t.jsx(Fa,{stats:e,localHash:e==null?void 0:e.local_hash,receivedBuckets:s==null?void 0:s.received,droppedBuckets:s==null?void 0:s.dropped,forwardedBuckets:s==null?void 0:s.forwarded,bucketDurationSeconds:s==null?void 0:s.bucket_duration_seconds,timeRangeLabel:u.label})}),t.jsx(zo,{}),t.jsx(Ia,{}),e&&t.jsx(ft,{template:"auto",children:t.jsx(Rn,{nodeName:R,repeaterVersion:e.version,coreVersion:e.core_version,localHash:e.local_hash,publicKey:e.public_key})})]})]})}export{Tr as default}; diff --git a/frontend/dist/assets/DataBox-BEDP2Kxh.js b/frontend/dist/assets/DataBox-CCBd3sT4.js similarity index 91% rename from frontend/dist/assets/DataBox-BEDP2Kxh.js rename to frontend/dist/assets/DataBox-CCBd3sT4.js index b548778e..38d7279f 100644 --- a/frontend/dist/assets/DataBox-BEDP2Kxh.js +++ b/frontend/dist/assets/DataBox-CCBd3sT4.js @@ -1 +1 @@ -import{r as i,a1 as S,j as e,c as s,Y as T,$}from"./index-DZK2INMD.js";const k={standard:"w-3 h-3",compact:"w-2.5 h-2.5",responsive:"w-2.5 h-2.5 sm:w-3 sm:h-3"};function D({children:a,copyValue:g,copy:n=!1,size:r="standard",className:u,title:f,color:x,truncate:l}){const[d,m]=i.useState(!1),[w,y]=i.useState(!1),p=i.useRef(null),o=g??(typeof a=="string"?a:""),C=k[r],h=(()=>{if(!l||typeof a!="string")return a;const t=a,[c,j]=l===!0?[6,4]:l;return t.length<=c+j+3?t:`${t.slice(0,c)}…${t.slice(-j)}`})(),N=i.useCallback(async t=>{if(!n)return;t.preventDefault(),t.stopPropagation(),p.current&&clearTimeout(p.current);const c=await S(o);m(!0),p.current=setTimeout(()=>m(!1),2e3),c||console.warn("Copy may have failed for:",o.slice(0,16)+"...")},[n,o]),v=r==="compact"?"data-box-compact":r==="responsive"?"data-box-responsive":"",b=n?f||`Click to copy: ${o}`:f;return n?e.jsxs("button",{type:"button",onClick:N,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:s("data-box interactive",v,"cursor-pointer select-none gap-1","hover-bg",x,u),title:b,"aria-label":`Copy ${o}`,children:[e.jsx("span",{className:s("transition-colors duration-200",d?"text-sys-green":""),children:h}),e.jsx("span",{className:s("flex items-center justify-center",r==="compact"?"w-3 h-3":"w-3.5 h-3.5"),children:d?e.jsx(T,{className:s("text-sys-green",C)}):e.jsx($,{className:s("transition-opacity duration-200",w?"opacity-70":"opacity-40",C)})})]}):e.jsx("span",{className:s("data-box",v,x,u),title:b,children:h})}export{D}; +import{r as i,a1 as S,j as e,c as s,Y as T,$}from"./index-B9Nfzawy.js";const k={standard:"w-3 h-3",compact:"w-2.5 h-2.5",responsive:"w-2.5 h-2.5 sm:w-3 sm:h-3"};function D({children:a,copyValue:g,copy:n=!1,size:r="standard",className:u,title:f,color:x,truncate:l}){const[d,m]=i.useState(!1),[w,y]=i.useState(!1),p=i.useRef(null),o=g??(typeof a=="string"?a:""),C=k[r],h=(()=>{if(!l||typeof a!="string")return a;const t=a,[c,j]=l===!0?[6,4]:l;return t.length<=c+j+3?t:`${t.slice(0,c)}…${t.slice(-j)}`})(),N=i.useCallback(async t=>{if(!n)return;t.preventDefault(),t.stopPropagation(),p.current&&clearTimeout(p.current);const c=await S(o);m(!0),p.current=setTimeout(()=>m(!1),2e3),c||console.warn("Copy may have failed for:",o.slice(0,16)+"...")},[n,o]),v=r==="compact"?"data-box-compact":r==="responsive"?"data-box-responsive":"",b=n?f||`Click to copy: ${o}`:f;return n?e.jsxs("button",{type:"button",onClick:N,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:s("data-box interactive",v,"cursor-pointer select-none gap-1","hover-bg",x,u),title:b,"aria-label":`Copy ${o}`,children:[e.jsx("span",{className:s("transition-colors duration-200",d?"text-sys-green":""),children:h}),e.jsx("span",{className:s("flex items-center justify-center",r==="compact"?"w-3 h-3":"w-3.5 h-3.5"),children:d?e.jsx(T,{className:s("text-sys-green",C)}):e.jsx($,{className:s("transition-opacity duration-200",w?"opacity-70":"opacity-40",C)})})]}):e.jsx("span",{className:s("data-box",v,x,u),title:b,children:h})}export{D}; diff --git a/frontend/dist/assets/DataValue-C6Gh85-I.js b/frontend/dist/assets/DataValue-Ddo4mrzf.js similarity index 87% rename from frontend/dist/assets/DataValue-C6Gh85-I.js rename to frontend/dist/assets/DataValue-Ddo4mrzf.js index 21278c87..a93fcf55 100644 --- a/frontend/dist/assets/DataValue-C6Gh85-I.js +++ b/frontend/dist/assets/DataValue-Ddo4mrzf.js @@ -1 +1 @@ -import{r as a,cQ as d,j as o,cR as N}from"./index-DZK2INMD.js";import{A as g}from"./index-C-Mp31KV.js";const I=a.memo(function({value:t,format:e,prefix:r,suffix:s,className:n,priority:m="medium"}){const[u,p]=a.useState(!1),[f,l]=a.useState(t);a.useEffect(()=>d(()=>{p(!0),l(0)},m),[m]),a.useEffect(()=>{u&&l(t)},[u,t]);const A=`${r??""}${t.toLocaleString(void 0,e)}${s??""}`;return u?o.jsx(g,{className:`${n??""} overflow-hidden`,format:e,prefix:r,suffix:s,transition:N.numberTicker,children:f}):o.jsx("span",{className:n,children:A})}),x={",":"punc",".":"punc-period",":":"punc-colon","/":"punc-slash"},c=/([,\.:\/])/g;function j(i){return i.split(c).map((e,r)=>{const s=x[e];return s?o.jsx("span",{className:s,children:e},r):e})}const S=a.memo(function({children:t,className:e="",as:r="span"}){const s=a.useMemo(()=>{let n;return typeof t=="number"?n=t.toLocaleString():Array.isArray(t)?n=t.join(""):n=String(t??""),c.test(n)?(c.lastIndex=0,j(n)):n},[t]);return o.jsx(r,{className:`data-tight ${e}`.trim(),children:s})});export{I as A,S as D}; +import{r as a,cQ as d,j as o,cR as N}from"./index-B9Nfzawy.js";import{A as g}from"./index-CHkxpv0k.js";const I=a.memo(function({value:t,format:e,prefix:r,suffix:s,className:n,priority:m="medium"}){const[u,p]=a.useState(!1),[f,l]=a.useState(t);a.useEffect(()=>d(()=>{p(!0),l(0)},m),[m]),a.useEffect(()=>{u&&l(t)},[u,t]);const A=`${r??""}${t.toLocaleString(void 0,e)}${s??""}`;return u?o.jsx(g,{className:`${n??""} overflow-hidden`,format:e,prefix:r,suffix:s,transition:N.numberTicker,children:f}):o.jsx("span",{className:n,children:A})}),x={",":"punc",".":"punc-period",":":"punc-colon","/":"punc-slash"},c=/([,\.:\/])/g;function j(i){return i.split(c).map((e,r)=>{const s=x[e];return s?o.jsx("span",{className:s,children:e},r):e})}const S=a.memo(function({children:t,className:e="",as:r="span"}){const s=a.useMemo(()=>{let n;return typeof t=="number"?n=t.toLocaleString():Array.isArray(t)?n=t.join(""):n=String(t??""),c.test(n)?(c.lastIndex=0,j(n)):n},[t]);return o.jsx(r,{className:`data-tight ${e}`.trim(),children:s})});export{I as A,S as D}; diff --git a/frontend/dist/assets/Grid-TGa3qLqq.js b/frontend/dist/assets/Grid-CbgS5PRh.js similarity index 95% rename from frontend/dist/assets/Grid-TGa3qLqq.js rename to frontend/dist/assets/Grid-CbgS5PRh.js index 74e37e55..36fba29d 100644 --- a/frontend/dist/assets/Grid-TGa3qLqq.js +++ b/frontend/dist/assets/Grid-CbgS5PRh.js @@ -1 +1 @@ -import{r as b,j as c,c as d}from"./index-DZK2INMD.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-B9Nfzawy.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-DgnjUPsG.js b/frontend/dist/assets/KeycapButton-DPkSXt-J.js similarity index 98% rename from frontend/dist/assets/KeycapButton-DgnjUPsG.js rename to frontend/dist/assets/KeycapButton-DPkSXt-J.js index 018fff91..37d229e4 100644 --- a/frontend/dist/assets/KeycapButton-DgnjUPsG.js +++ b/frontend/dist/assets/KeycapButton-DPkSXt-J.js @@ -1 +1 @@ -import{r as l,j as t,Z as O}from"./index-DZK2INMD.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-B9Nfzawy.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-D9e7Om82.js b/frontend/dist/assets/LightSparkline-DTXOFhS4.js similarity index 96% rename from frontend/dist/assets/LightSparkline-D9e7Om82.js rename to frontend/dist/assets/LightSparkline-DTXOFhS4.js index 0a455778..ab8ee196 100644 --- a/frontend/dist/assets/LightSparkline-D9e7Om82.js +++ b/frontend/dist/assets/LightSparkline-DTXOFhS4.js @@ -1 +1 @@ -import{r as y,j as t}from"./index-DZK2INMD.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-B9Nfzawy.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-BFa4P29Z.js b/frontend/dist/assets/Login-BPAK_Nkc.js similarity index 99% rename from frontend/dist/assets/Login-BFa4P29Z.js rename to frontend/dist/assets/Login-BPAK_Nkc.js index 088cabc2..bf4422b7 100644 --- a/frontend/dist/assets/Login-BFa4P29Z.js +++ b/frontend/dist/assets/Login-BPAK_Nkc.js @@ -1,3 +1,3 @@ -import{r as o,j as e,u as F,g as Y,i as $,s as Z,l as X,m as L,a as q,b as S,c as H,I as A,C as O,A as z,B as U,Z as V}from"./index-DZK2INMD.js";import{g as T,B as G,r as K,T as J}from"./ascii-burst-DN6etEs5.js";const w=["@@@@@@@ @@@ @@@ @@@@@@@@@@ @@@@@@@ ","@@@@@@@@ @@@ @@@ @@@@@@@@@@@ @@@@@@@@ ","@@! @@@ @@! !@@ @@! @@! @@! !@@ ","!@! @!@ !@! @!! !@! !@! !@! !@! ","@!@@!@! !@!@! @!! !!@ @!@ !@! ","!!@!!! @!!! !@! ! !@! !!! ","!!: !!: !!: !!: :!! ",":!: :!: :!: :!: :!: "," :: :: ::: :: ::: ::: "," : : : : :: :: : "],Q=J-1,ee=w.length,te=Math.max(...w.map(s=>s.length)),se=.994,ne=.08,re=.25,ae=8,oe=9.6,ie=20,W=.008,k=20,_=" . ˙·∙⁺˚°:;~*+✧✩×✴░✦✶✳oO▒#%&xX▓@MW8B█████",ce={" ":0,".":.08,":":.15,"!":.5,"@":.85,"#":.6,$:.7,"%":.65,"&":.6,"*":.3,"+":.25,"-":.1,"=":.2,_:.05,"~":.2,"^":.15,"|":.4,"/":.3,"\\":.3,"(":.35,")":.35,"[":.4,"]":.4,"{":.45,"}":.45,"<":.3,">":.3,"?":.4,";":.2,"'":.1,'"':.15,",":.08,"`":.05};function le(s){let t="",n=0,a=!1,x="",p=!1,l=!1,g=!1;for(;n",a=!1),x="",p=!1,l=!1,g=!1;else if(u==="1")p=!0,g=!0;else if(u==="2")l=!0,g=!0;else if(u.startsWith("38;2;")){const C=u.split(";");x=`rgb(${C[2]},${C[3]},${C[4]})`,g=!0}}else{if(g){a&&(t+="");const u=[];x&&u.push(`color:${x}`),p&&u.push("font-weight:700"),l&&u.push("opacity:0.6"),u.length>0?(t+=``,a=!0):a=!1,g=!1}const h=s[n];h==="<"?t+="<":h===">"?t+=">":h==="&"?t+="&":t+=h,n++}return a&&(t+=""),t}function P(s){let t="";for(let n=0;n0&&(t+=` +import{r as o,j as e,u as F,g as Y,i as $,s as Z,l as X,m as L,a as q,b as S,c as H,I as A,C as O,A as z,B as U,Z as V}from"./index-B9Nfzawy.js";import{g as T,B as G,r as K,T as J}from"./ascii-burst-DN6etEs5.js";const w=["@@@@@@@ @@@ @@@ @@@@@@@@@@ @@@@@@@ ","@@@@@@@@ @@@ @@@ @@@@@@@@@@@ @@@@@@@@ ","@@! @@@ @@! !@@ @@! @@! @@! !@@ ","!@! @!@ !@! @!! !@! !@! !@! !@! ","@!@@!@! !@!@! @!! !!@ @!@ !@! ","!!@!!! @!!! !@! ! !@! !!! ","!!: !!: !!: !!: :!! ",":!: :!: :!: :!: :!: "," :: :: ::: :: ::: ::: "," : : : : :: :: : "],Q=J-1,ee=w.length,te=Math.max(...w.map(s=>s.length)),se=.994,ne=.08,re=.25,ae=8,oe=9.6,ie=20,W=.008,k=20,_=" . ˙·∙⁺˚°:;~*+✧✩×✴░✦✶✳oO▒#%&xX▓@MW8B█████",ce={" ":0,".":.08,":":.15,"!":.5,"@":.85,"#":.6,$:.7,"%":.65,"&":.6,"*":.3,"+":.25,"-":.1,"=":.2,_:.05,"~":.2,"^":.15,"|":.4,"/":.3,"\\":.3,"(":.35,")":.35,"[":.4,"]":.4,"{":.45,"}":.45,"<":.3,">":.3,"?":.4,";":.2,"'":.1,'"':.15,",":.08,"`":.05};function le(s){let t="",n=0,a=!1,x="",p=!1,l=!1,g=!1;for(;n",a=!1),x="",p=!1,l=!1,g=!1;else if(u==="1")p=!0,g=!0;else if(u==="2")l=!0,g=!0;else if(u.startsWith("38;2;")){const C=u.split(";");x=`rgb(${C[2]},${C[3]},${C[4]})`,g=!0}}else{if(g){a&&(t+="");const u=[];x&&u.push(`color:${x}`),p&&u.push("font-weight:700"),l&&u.push("opacity:0.6"),u.length>0?(t+=``,a=!0):a=!1,g=!1}const h=s[n];h==="<"?t+="<":h===">"?t+=">":h==="&"?t+="&":t+=h,n++}return a&&(t+=""),t}function P(s){let t="";for(let n=0;n0&&(t+=` `),t+=le(s[n]);return t}const ue="rgb(91,91,214)",y=[[91,91,214],[72,70,200],[110,110,230],[150,150,245],[190,210,255],[0,240,255],[255,50,180],[80,255,180]];function R(s,t,n){return`rgb(${Math.round(s[0]+(t[0]-s[0])*n)},${Math.round(s[1]+(t[1]-s[1])*n)},${Math.round(s[2]+(t[2]-s[2])*n)})`}function de(s){const t=Math.max(0,Math.min(.999,s));return _[Math.floor(t*_.length)]}function me(s){return ce[s]??.5}function he(s,t){const n=Math.abs(s);if(n<.3)return R(y[0],y[2],n/.3);if(n<.6){const a=(n-.3)/.3;return R(y[3],y[4],a)}else{const a=Math.sin(t*17.3)*.5+.5;return a<.4?R(y[4],y[5],(n-.6)/.4):a<.6?`rgb(${y[6].join(",")})`:a<.7?`rgb(${y[7].join(",")})`:"rgb(255,252,255)"}}function I(s){let t="";for(let n=0;n0&&(t+=` `);const a=w[n]||"";for(let x=0;x0?Math.exp(-m*m/2):Math.exp(-m*m/12),j=c*re-C.radius*.4,M=Math.sin(j*Math.PI),d=b*C.strength;l+=b*M*C.strength,d>h&&(h=d,g=j+n*.1+x*.05)}if(l=Math.max(-1,Math.min(1,l)),Math.abs(l)${p}`;else{const r=me(p)+l*.5,i=Math.max(.02,Math.min(.98,r)),c=de(i),f=he(l,g);t+=`${c}`}}}return t}function Ce(){const s=o.useRef(null),t=o.useRef([]),n=o.useRef(0),[a,x]=o.useState(!1);o.useEffect(()=>{const r=s.current;if(!r)return;let i=0;r.innerHTML=P(T(w,0));const c=setInterval(()=>{if(i++,i>Q){clearInterval(c),x(!0);return}r.innerHTML=P(T(w,i))},G);return()=>{clearInterval(c),K()}},[]),o.useEffect(()=>{if(!a)return;const r=s.current;if(!r)return;let i=!0;const c=()=>{if(!i)return;const f=t.current;for(const m of f)m.radius+=ne,m.strength*=se;t.current=f.filter(m=>m.strength>W),t.current.length>0?r.innerHTML=I(t.current):r.innerHTML=I([]),n.current=requestAnimationFrame(c)};return n.current=requestAnimationFrame(c),()=>{i=!1,cancelAnimationFrame(n.current)}},[a]);const p=o.useRef(null),l=o.useCallback((r,i,c=1)=>{const f=s.current;if(!f||!a)return;const m=f.getBoundingClientRect(),b=r-m.left,j=i-m.top,M=b/oe,d=j/ie;t.current.length>=ae&&t.current.shift(),t.current.push({cx:M,cy:d,radius:0,strength:c}),p.current={x:r,y:i}},[a]),g=o.useCallback(r=>{const i=p.current;if(i){const c=r.clientX-i.x,f=r.clientY-i.y;if(Math.sqrt(c*c+f*f){l(r.clientX,r.clientY,1)},[l]),u=o.useCallback(r=>{p.current=null,l(r.clientX,r.clientY,.6)},[l]),C=o.useCallback(r=>{if(r.touches.length>0){const i=r.touches[0],c=p.current;if(c){const f=i.clientX-c.x,m=i.clientY-c.y;if(Math.sqrt(f*f+m*m)e.jsx("span",{className:"text-white/20 text-xs","aria-hidden":"true",children:"•"}),be=o.memo(function(){return e.jsx("div",{className:"fixed inset-0 -z-10",style:{backgroundColor:V[950]},"aria-hidden":"true"})}),ve=o.memo(function(){return e.jsxs(L.footer,{variants:v.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(E,{href:"https://github.com/rightup/pyMC_Repeater",children:e.jsx("img",{src:Le,alt:"pyMC",className:"h-14"})}),e.jsx(D,{}),e.jsx(E,{href:"https://meshcore.co.uk",children:e.jsx(xe,{height:12,className:"text-white"})}),e.jsx(D,{}),e.jsxs(E,{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:ge,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),je={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 Ne(){const s=F(),[t,n]=o.useState("admin"),[a,x]=o.useState(""),[p,l]=o.useState(Y),[g,h]=o.useState(!1),[u,C]=o.useState(null),[r]=o.useState(()=>{try{const d=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),d?je[d]??null:null}catch{return null}}),i=t.length>0&&a.length>0&&!g;o.useEffect(()=>{$()&&s("/",{replace:!0})},[s]);const c=o.useCallback(()=>C(null),[]),f=o.useCallback(d=>{n(d.target.value),u&&c()},[u,c]),m=o.useCallback(d=>{x(d.target.value),u&&c()},[u,c]),b=o.useCallback(d=>{l(d),Z(d)},[]),j=o.useCallback(async d=>{if(d.preventDefault(),!i)return;h(!0),C(null);const N=await X(t,a,p);h(!1),N.success?window.location.href="/":C(N.error??"Login failed")},[i,t,a,p]),M=o.useCallback(d=>{d.key==="Enter"&&i&&d.target.tagName==="INPUT"&&(d.preventDefault(),d.currentTarget.requestSubmit())},[i]);return e.jsxs(e.Fragment,{children:[e.jsx(be,{}),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(L.div,{variants:v.container,initial:"hidden",animate:"visible",className:"w-full max-w-sm space-y-10",children:[e.jsx(L.div,{variants:v.item,className:"flex justify-center",children:e.jsx(fe,{})}),r&&!u&&e.jsx(L.div,{variants:v.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:r})}),e.jsxs(L.form,{variants:v.item,onSubmit:j,onKeyDown:M,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(A,{id:"username",name:"username",type:"text",value:t,onChange:f,required:!0,autoComplete:"username",className:"font-mono text-sm font-semibold"})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:B,children:"Password"}),e.jsx("div",{className:"mt-2",children:e.jsx(A,{id:"password",name:"password",type:"password",value:a,onChange:m,required:!0,autoComplete:"current-password",autoFocus:!0,className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(O,{checked:p,onChange:b,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(z,{mode:"wait",children:u&&e.jsx(L.div,{variants:v.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:u})},"error")}),e.jsx(L.div,{whileTap:i?{scale:.98}:void 0,children:e.jsx(U,{type:"submit",disabled:!i,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:g?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ye,{className:"size-4"}),"Signing in…"]}):"Sign in"})})]}),e.jsxs(L.p,{variants:v.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(ve,{})]})}export{Ne as default}; diff --git a/frontend/dist/assets/Logs-BiTgALgq.js b/frontend/dist/assets/Logs-DSUXpt-n.js similarity index 92% rename from frontend/dist/assets/Logs-BiTgALgq.js rename to frontend/dist/assets/Logs-DSUXpt-n.js index 5aeb5339..eec06ec5 100644 --- a/frontend/dist/assets/Logs-BiTgALgq.js +++ b/frontend/dist/assets/Logs-DSUXpt-n.js @@ -1 +1 @@ -import{dL as h,dM as f,a3 as j,dN as L,dO as v,r as l,dP as N,j as e,dQ as m,a5 as y,B as w,c as i,dR as b,dB as C,m as S,dS as P}from"./index-DZK2INMD.js";import{P as R,a as B,B as E,C as k}from"./PageLayout-F1v-IzhG.js";import{C as I,a as M}from"./circle-stop-wbk-0e1-.js";const T=l.memo(function({log:a}){return e.jsx(S.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:i("type-data-sm w-14 shrink-0",P(a.level)),children:a.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:a.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(a.timestamp).toLocaleString()})]})]})})});function D({showDebug:s,onToggle:a}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:i("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(C,{enabled:s,onChange:a,size:"sm"})]})}function H(){const s=h(),a=f(),o=j(),r=L(),g=v(),[c,x]=l.useState(!1),u=l.useCallback(()=>{x(t=>!t)},[]),d=c?s:s.filter(t=>t.level!=="DEBUG"),n=l.useRef(r);return n.current=r,l.useEffect(()=>{if(!o)return;n.current();const t=setInterval(()=>n.current(),N.logs);return()=>clearInterval(t)},[o]),e.jsxs(R,{children:[e.jsx(B,{title:"System Logs",icon:e.jsx(m,{}),controls:e.jsx(D,{showDebug:c,onToggle:u})}),e.jsx(E,{ready:!0,children:e.jsxs(k,{neomorphic:!0,noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(w,{plain:!0,color:o?"danger":"primary",onClick:()=>g(!o),title:o?"Pause":"Resume",className:i(!o&&"animate-pulse-slow"),children:o?e.jsx(I,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(M,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:a&&s.length===0?e.jsx(b,{count:10}):d.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:s.length===0?"No logs available":"No logs match selected filters"}):d.map((t,p)=>e.jsx(T,{log:t},`${t.timestamp}-${p}`))})]})})]})}export{H as default}; +import{dL as h,dM as f,a3 as j,dN as L,dO as v,r as l,dP as N,j as e,dQ as m,a5 as y,B as w,c as i,dR as b,dB as C,m as S,dS as P}from"./index-B9Nfzawy.js";import{P as R,a as B,B as E,C as k}from"./PageLayout-Da0xfaXb.js";import{C as I,a as M}from"./circle-stop-CO5AnAxr.js";const T=l.memo(function({log:a}){return e.jsx(S.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:i("type-data-sm w-14 shrink-0",P(a.level)),children:a.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:a.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(a.timestamp).toLocaleString()})]})]})})});function D({showDebug:s,onToggle:a}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:i("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(C,{enabled:s,onChange:a,size:"sm"})]})}function H(){const s=h(),a=f(),o=j(),r=L(),g=v(),[c,x]=l.useState(!1),u=l.useCallback(()=>{x(t=>!t)},[]),d=c?s:s.filter(t=>t.level!=="DEBUG"),n=l.useRef(r);return n.current=r,l.useEffect(()=>{if(!o)return;n.current();const t=setInterval(()=>n.current(),N.logs);return()=>clearInterval(t)},[o]),e.jsxs(R,{children:[e.jsx(B,{title:"System Logs",icon:e.jsx(m,{}),controls:e.jsx(D,{showDebug:c,onToggle:u})}),e.jsx(E,{ready:!0,children:e.jsxs(k,{neomorphic:!0,noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(w,{plain:!0,color:o?"danger":"primary",onClick:()=>g(!o),title:o?"Pause":"Resume",className:i(!o&&"animate-pulse-slow"),children:o?e.jsx(I,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(M,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:a&&s.length===0?e.jsx(b,{count:10}):d.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:s.length===0?"No logs available":"No logs match selected filters"}):d.map((t,p)=>e.jsx(T,{log:t},`${t.timestamp}-${p}`))})]})})]})}export{H as default}; diff --git a/frontend/dist/assets/MeshGraph-BtvpvYiN.js b/frontend/dist/assets/MeshGraph-BrnySJao.js similarity index 99% rename from frontend/dist/assets/MeshGraph-BtvpvYiN.js rename to frontend/dist/assets/MeshGraph-BrnySJao.js index 40abc1d7..4c9caad7 100644 --- a/frontend/dist/assets/MeshGraph-BtvpvYiN.js +++ b/frontend/dist/assets/MeshGraph-BrnySJao.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-CuBcD5uU.js","assets/index-DZK2INMD.js","assets/max-BIfJ_m_6.js","assets/consumer-registry-C58OO1Zb.js","assets/clock-CZYZYW0y.js","assets/triangle-alert-z32LI9zM.js","assets/database-DWx780B3.js","assets/DataBox-BEDP2Kxh.js","assets/badge-colors-BNUqIXCA.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/target-CMbN1GDb.js","assets/layers-Bh2LK6a1.js","assets/search-DRsZhueb.js","assets/download-7zuVGrrm.js","assets/settings-2-CKbtmc0u.js","assets/rotate-ccw-BgriCY_m.js","assets/chevron-right-DYHNTpxG.js","assets/network-CfluO-Ty.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); -var aL=Object.defineProperty;var lL=(i,e,t)=>e in i?aL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var b=(i,e,t)=>lL(i,typeof e!="symbol"?e+"":e,t);import{d as sp,r as z,_ as p0,bt as cn,cm as pg,de as cL,df as uL,j as f,aA as dL,aB as m0,bK as Gl,c as rh,dg as hL,m as ga,Y as J_,a0 as mg,dh as RS,di as $h,dj as PS,dk as fL,cv as pL,A as Jc,dl as mL,aO as gL,dm as _L,dn as yL,dp as bL,dq as vL,dr as xL,ds as wL,dt as SL,a4 as EL,cH as CL,du as TL,L as Ge,Z as qt,dv as g0,R as Di,an as be,dw as kL,dx as AL,a8 as gg,dy as hd,dz as IL,aC as Pc,dA as LL,b2 as RL,dB as PL,dC as NL,B as ey,$ as DL,a1 as ML,dD as BL}from"./index-DZK2INMD.js";import{m as _0,t as _g,a as OL,b as FL,e as Rn,G as Gp,s as zL,u as UL,c as $L,M as NS,d as jL,E as HL,f as y0,g as ty}from"./max-BIfJ_m_6.js";import{u as VL,r as GL,f as b0,g as WL,e as YL}from"./consumer-registry-C58OO1Zb.js";import{C as qL}from"./clock-CZYZYW0y.js";import{T as XL}from"./triangle-alert-z32LI9zM.js";import{D as KL}from"./database-DWx780B3.js";import{D as ZL}from"./DataBox-BEDP2Kxh.js";import{N as QL,a as JL}from"./badge-colors-BNUqIXCA.js";import{e as eR,f as v0,g as tR}from"./meshcore-tx-constants-DgpFTAmf.js";import{E as iR,T as nR}from"./target-CMbN1GDb.js";import{L as x0}from"./layers-Bh2LK6a1.js";import{S as w0}from"./search-DRsZhueb.js";import{D as S0}from"./download-7zuVGrrm.js";import{S as E0}from"./settings-2-CKbtmc0u.js";import{R as C0}from"./rotate-ccw-BgriCY_m.js";import{C as Wp}from"./chevron-right-DYHNTpxG.js";import{N as sR}from"./network-CfluO-Ty.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-BYCL_Wh6.js","assets/index-B9Nfzawy.js","assets/max-BFwmL_H9.js","assets/consumer-registry-B_rYsmHo.js","assets/clock-CCOO2GB9.js","assets/triangle-alert-_KPqiYkd.js","assets/database-CSUiI1CG.js","assets/DataBox-CCBd3sT4.js","assets/badge-colors-BNUqIXCA.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/target-74Dm2pEA.js","assets/layers-DHyjQOGN.js","assets/search-BrfwwyYC.js","assets/download-BaEmSLqY.js","assets/settings-2-DYzgUEwY.js","assets/rotate-ccw-BwcqAp9U.js","assets/chevron-right-jwX-OOTu.js","assets/network-BCB-csrZ.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); +var aL=Object.defineProperty;var lL=(i,e,t)=>e in i?aL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var b=(i,e,t)=>lL(i,typeof e!="symbol"?e+"":e,t);import{d as sp,r as z,_ as p0,bt as cn,cm as pg,de as cL,df as uL,j as f,aA as dL,aB as m0,bK as Gl,c as rh,dg as hL,m as ga,Y as J_,a0 as mg,dh as RS,di as $h,dj as PS,dk as fL,cv as pL,A as Jc,dl as mL,aO as gL,dm as _L,dn as yL,dp as bL,dq as vL,dr as xL,ds as wL,dt as SL,a4 as EL,cH as CL,du as TL,L as Ge,Z as qt,dv as g0,R as Di,an as be,dw as kL,dx as AL,a8 as gg,dy as hd,dz as IL,aC as Pc,dA as LL,b2 as RL,dB as PL,dC as NL,B as ey,$ as DL,a1 as ML,dD as BL}from"./index-B9Nfzawy.js";import{m as _0,t as _g,a as OL,b as FL,e as Rn,G as Gp,s as zL,u as UL,c as $L,M as NS,d as jL,E as HL,f as y0,g as ty}from"./max-BFwmL_H9.js";import{u as VL,r as GL,f as b0,g as WL,e as YL}from"./consumer-registry-B_rYsmHo.js";import{C as qL}from"./clock-CCOO2GB9.js";import{T as XL}from"./triangle-alert-_KPqiYkd.js";import{D as KL}from"./database-CSUiI1CG.js";import{D as ZL}from"./DataBox-CCBd3sT4.js";import{N as QL,a as JL}from"./badge-colors-BNUqIXCA.js";import{e as eR,f as v0,g as tR}from"./meshcore-tx-constants-DgpFTAmf.js";import{E as iR,T as nR}from"./target-74Dm2pEA.js";import{L as x0}from"./layers-DHyjQOGN.js";import{S as w0}from"./search-BrfwwyYC.js";import{D as S0}from"./download-BaEmSLqY.js";import{S as E0}from"./settings-2-DYzgUEwY.js";import{R as C0}from"./rotate-ccw-BwcqAp9U.js";import{C as Wp}from"./chevron-right-jwX-OOTu.js";import{N as sR}from"./network-BCB-csrZ.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)}}};$(v2,"defaultProps",{..._n.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let DN=v2;function MN(i){return BN(i.source)||i.id||hy(`unnamed ${i.stage}-shader`)}function BN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const w2=class S2 extends _n{constructor(e,t){super(e,t,S2.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"}};$(w2,"defaultProps",{..._n.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 Kh=w2;const E2=class C2 extends _n{constructor(e,t){super(e,t,C2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(E2,"defaultProps",{..._n.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Z0=E2;function ON(i){return $N[i]}function FN(i){const[e,t]=UN[i],n=e==="i32"||e==="u32",s=e!=="u32",r=zN[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const zN={f32:4,f16:2,i32:4,u32:4},UN={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]},$N={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 T2(i,e){const t={};for(const n of i.attributes){const s=jN(i,e,n.name);s&&(t[n.name]=s)}return t}function Nte(i,e,t=16){const n=T2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function jN(i,e,t){const n=HN(i,t),s=VN(e,t);if(!n)return null;const r=FN(n.type),o=lN(r),a=(s==null?void 0:s.vertexFormat)||o,l=py(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 HN(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 VN(i,e){GN(i);let t=WN(i,e);return t||(t=YN(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function GN(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 WN(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 YN(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=py(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 xd;function k2(i){return(!xd||xd.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){ZN(this.uniforms[e],t)||(this.uniforms[e]=QN(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ri=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 KN(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new JN({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:ge.UNIFORM|ge.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:ge.UNIFORM|ge.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 Do;(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"})(Do||(Do={}));const eD={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:{}},tD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),iD=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)}}),nD=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 sD(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&&rD(s),s}return this.originalGetContext(t,n)}}function rD(i){i.getExtension("EXT_color_buffer_float");const e={...eD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:tD(i),OES_vertex_array_object:iD(i),ANGLE_instanced_arrays:nD(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 A2(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 oD=1;let hi=null,Q0=!1;const gy={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function aD(i){if(!globalThis.SPECTOR)try{await A2(i.debugSpectorJSUrl||gy.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Bte(i){var e;if(i={...gy,...i},!i.debugSpectorJS)return null;if(!hi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(oD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;hi=new t,globalThis.luma&&(globalThis.luma.spector=hi)}if(!hi)return null;if(Q0||(Q0=!0,hi.spyCanvases(),hi==null||hi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),hi==null||hi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),hi==null||hi.getResultUI(),hi==null||hi.resultView.display(),hi==null||hi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;hi==null||hi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),hi==null||hi.stopCapture()})}return hi}const lD="https://unpkg.com/webgl-debug@2.0.1/index.js";function I2(i){return i.luma=i.luma||{},i.luma}async function cD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await A2(lD))}function Ote(i,e={}){return e.debugWebGL||e.traceWebGL?dD(i,e):uD(i)}function uD(i){const e=I2(i);return e.realContext?e.realContext:i}function dD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=I2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Do,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,hD.bind(null,e),fD.bind(null,e));for(const o in Do)!(o in n)&&typeof Do[o]=="number"&&(n[o]=Do[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 J0(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 hD(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 fD(i,e,t){let n="";le.level>=1&&(n=J0(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||J0(e,t);debugger}}const wd=1;class pD extends EN{constructor(){super(),$(this,"type","webgl"),Eg.defaultProps={...Eg.defaultProps,...gy}}enforceWebGL2(e){sD(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 p0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-CuBcD5uU.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!mD(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 p0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-CuBcD5uU.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));le.groupCollapsed(wd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(cD()),e.debugSpectorJS&&n.push(aD(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(wd,o)(),le.table(wd,r.info)(),r}finally{le.groupEnd(wd)()}}}function mD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const gD=new pD,_D="#b3b3b3",yD=void 0,kg=void 0,bD=1,vD=4,xD="#666666",wD=.1,SD=1,ED=1,L2="#222222",pe={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},CD=.7,TD=.95,kD=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:R2,setPrototypeOf:ex,isFrozen:AD,getPrototypeOf:ID,getOwnPropertyDescriptor:LD}=Object;let{freeze:hn,seal:_s,create:P2}=Object,{apply:Ag,construct:Ig}=typeof Reflect<"u"&&Reflect;hn||(hn=function(i){return i});_s||(_s=function(i){return i});Ag||(Ag=function(i,e,t){return i.apply(e,t)});Ig||(Ig=function(i,e){return new i(...e)});const Sd=fn(Array.prototype.forEach),RD=fn(Array.prototype.lastIndexOf),tx=fn(Array.prototype.pop),lc=fn(Array.prototype.push),PD=fn(Array.prototype.splice),dh=fn(String.prototype.toLowerCase),im=fn(String.prototype.toString),ix=fn(String.prototype.match),cc=fn(String.prototype.replace),ND=fn(String.prototype.indexOf),DD=fn(String.prototype.trim),Ms=fn(Object.prototype.hasOwnProperty),sn=fn(RegExp.prototype.test),uc=MD(TypeError);function fn(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]:dh;ex&&ex(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(AD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function BD(i){for(let e=0;e/gm),$D=_s(/\$\{[\w\W]*/gm),jD=_s(/^data-[\-\w.\u00B7-\uFFFF]+$/),HD=_s(/^aria-[\-\w]+$/),N2=_s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),VD=_s(/^(?:\w+script|data):/i),GD=_s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),D2=_s(/^html$/i),WD=_s(/^[a-z][.\w]*(-[.\w]+)+$/i);var ax=Object.freeze({__proto__:null,ARIA_ATTR:HD,ATTR_WHITESPACE:GD,CUSTOM_ELEMENT:WD,DATA_ATTR:jD,DOCTYPE_NAME:D2,ERB_EXPR:UD,IS_ALLOWED_URI:N2,IS_SCRIPT_OR_DATA:VD,MUSTACHE_EXPR:zD,TMPLIT_EXPR:$D});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},YD=function(){return typeof window>"u"?null:window},qD=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}},lx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function M2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YD();const e=I=>M2(I);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==hc.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=i,m=l.prototype,_=dc(m,"cloneNode"),g=dc(m,"remove"),y=dc(m,"nextSibling"),S=dc(m,"childNodes"),C=dc(m,"parentNode");if(typeof o=="function"){const I=t.createElement("template");I.content&&I.content.ownerDocument&&(t=I.content.ownerDocument)}let x,A="";const{implementation:L,createNodeIterator:P,createDocumentFragment:H,getElementsByTagName:Q}=t,{importNode:te}=n;let B=lx();e.isSupported=typeof R2=="function"&&typeof C=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:se,TMPLIT_EXPR:R,DATA_ATTR:J,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:ee}=ax;let{IS_ALLOWED_URI:ae}=ax,Z=null;const Se=ot({},[...nx,...nm,...sm,...rm,...sx]);let xe=null;const Je=ot({},[...rx,...om,...ox,...Ed]);let de=Object.seal(P2(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}})),bt=null,Xe=null,ht=!0,re=!0,Te=!1,Pe=!0,q=!1,We=!0,He=!1,it=!1,Vt=!1,me=!1,nt=!1,ui=!1,_i=!0,Zn=!1;const Qo="user-content-";let Zs=!0,Li=!1,en={},Ri=null;const ai=ot({},["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 vo=null;const Es=ot({},["audio","video","img","source","image","track"]);let Qn=null;const Jn=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cs="http://www.w3.org/1998/Math/MathML",zi="http://www.w3.org/2000/svg",Ei="http://www.w3.org/1999/xhtml";let ii=Ei,bn=!1,vn=null;const Ts=ot({},[Cs,zi,Ei],im);let Bn=ot({},["mi","mo","mn","ms","mtext"]),es=ot({},["annotation-xml"]);const Dr=ot({},["title","style","font","a","script"]);let xn=null;const Qs=["application/xhtml+xml","text/html"],Jo="text/html";let Zt=null,Bt=null;const ks=t.createElement("form"),xo=function(I){return I instanceof RegExp||I instanceof Function},Js=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bt&&Bt===I)){if((!I||typeof I!="object")&&(I={}),I=Hr(I),xn=Qs.indexOf(I.PARSER_MEDIA_TYPE)===-1?Jo:I.PARSER_MEDIA_TYPE,Zt=xn==="application/xhtml+xml"?im:dh,Z=Ms(I,"ALLOWED_TAGS")?ot({},I.ALLOWED_TAGS,Zt):Se,xe=Ms(I,"ALLOWED_ATTR")?ot({},I.ALLOWED_ATTR,Zt):Je,vn=Ms(I,"ALLOWED_NAMESPACES")?ot({},I.ALLOWED_NAMESPACES,im):Ts,Qn=Ms(I,"ADD_URI_SAFE_ATTR")?ot(Hr(Jn),I.ADD_URI_SAFE_ATTR,Zt):Jn,vo=Ms(I,"ADD_DATA_URI_TAGS")?ot(Hr(Es),I.ADD_DATA_URI_TAGS,Zt):Es,Ri=Ms(I,"FORBID_CONTENTS")?ot({},I.FORBID_CONTENTS,Zt):ai,bt=Ms(I,"FORBID_TAGS")?ot({},I.FORBID_TAGS,Zt):Hr({}),Xe=Ms(I,"FORBID_ATTR")?ot({},I.FORBID_ATTR,Zt):Hr({}),en=Ms(I,"USE_PROFILES")?I.USE_PROFILES:!1,ht=I.ALLOW_ARIA_ATTR!==!1,re=I.ALLOW_DATA_ATTR!==!1,Te=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=I.SAFE_FOR_TEMPLATES||!1,We=I.SAFE_FOR_XML!==!1,He=I.WHOLE_DOCUMENT||!1,me=I.RETURN_DOM||!1,nt=I.RETURN_DOM_FRAGMENT||!1,ui=I.RETURN_TRUSTED_TYPE||!1,Vt=I.FORCE_BODY||!1,_i=I.SANITIZE_DOM!==!1,Zn=I.SANITIZE_NAMED_PROPS||!1,Zs=I.KEEP_CONTENT!==!1,Li=I.IN_PLACE||!1,ae=I.ALLOWED_URI_REGEXP||N2,ii=I.NAMESPACE||Ei,Bn=I.MATHML_TEXT_INTEGRATION_POINTS||Bn,es=I.HTML_INTEGRATION_POINTS||es,de=I.CUSTOM_ELEMENT_HANDLING||{},I.CUSTOM_ELEMENT_HANDLING&&xo(I.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=I.CUSTOM_ELEMENT_HANDLING.tagNameCheck),I.CUSTOM_ELEMENT_HANDLING&&xo(I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(re=!1),nt&&(me=!0),en&&(Z=ot({},sx),xe=[],en.html===!0&&(ot(Z,nx),ot(xe,rx)),en.svg===!0&&(ot(Z,nm),ot(xe,om),ot(xe,Ed)),en.svgFilters===!0&&(ot(Z,sm),ot(xe,om),ot(xe,Ed)),en.mathMl===!0&&(ot(Z,rm),ot(xe,ox),ot(xe,Ed))),I.ADD_TAGS&&(Z===Se&&(Z=Hr(Z)),ot(Z,I.ADD_TAGS,Zt)),I.ADD_ATTR&&(xe===Je&&(xe=Hr(xe)),ot(xe,I.ADD_ATTR,Zt)),I.ADD_URI_SAFE_ATTR&&ot(Qn,I.ADD_URI_SAFE_ATTR,Zt),I.FORBID_CONTENTS&&(Ri===ai&&(Ri=Hr(Ri)),ot(Ri,I.FORBID_CONTENTS,Zt)),Zs&&(Z["#text"]=!0),He&&ot(Z,["html","head","body"]),Z.table&&(ot(Z,["tbody"]),delete bt.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=I.TRUSTED_TYPES_POLICY,A=x.createHTML("")}else x===void 0&&(x=qD(p,s)),x!==null&&typeof A=="string"&&(A=x.createHTML(""));hn&&hn(I),Bt=I}},Rt=ot({},[...nm,...sm,...OD]),Mr=ot({},[...rm,...FD]),ea=function(I){let V=C(I);(!V||!V.tagName)&&(V={namespaceURI:ii,tagName:"template"});const E=dh(I.tagName),G=dh(V.tagName);return vn[I.namespaceURI]?I.namespaceURI===zi?V.namespaceURI===Ei?E==="svg":V.namespaceURI===Cs?E==="svg"&&(G==="annotation-xml"||Bn[G]):!!Rt[E]:I.namespaceURI===Cs?V.namespaceURI===Ei?E==="math":V.namespaceURI===zi?E==="math"&&es[G]:!!Mr[E]:I.namespaceURI===Ei?V.namespaceURI===zi&&!es[G]||V.namespaceURI===Cs&&!Bn[G]?!1:!Mr[E]&&(Dr[E]||!Rt[E]):!!(xn==="application/xhtml+xml"&&vn[I.namespaceURI]):!1},ts=function(I){lc(e.removed,{element:I});try{C(I).removeChild(I)}catch{g(I)}},di=function(I,V){try{lc(e.removed,{attribute:V.getAttributeNode(I),from:V})}catch{lc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(I),I==="is")if(me||nt)try{ts(V)}catch{}else try{V.setAttribute(I,"")}catch{}},On=function(I){let V=null,E=null;if(Vt)I=""+I;else{const Ce=ix(I,/^[\r\n\t ]+/);E=Ce&&Ce[0]}xn==="application/xhtml+xml"&&ii===Ei&&(I=''+I+"");const G=x?x.createHTML(I):I;if(ii===Ei)try{V=new h().parseFromString(G,xn)}catch{}if(!V||!V.documentElement){V=L.createDocument(ii,"template",null);try{V.documentElement.innerHTML=bn?A:G}catch{}}const ne=V.body||V.documentElement;return I&&E&&ne.insertBefore(t.createTextNode(E),ne.childNodes[0]||null),ii===Ei?Q.call(V,He?"html":"body")[0]:He?V.documentElement:ne},wo=function(I){return P.call(I.ownerDocument||I,I,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ut=function(I){return I instanceof d&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof u)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},Br=function(I){return typeof a=="function"&&I instanceof a};function st(I,V,E){Sd(I,G=>{G.call(e,V,E,Bt)})}const wn=function(I){let V=null;if(st(B.beforeSanitizeElements,I,null),ut(I))return ts(I),!0;const E=Zt(I.nodeName);if(st(B.uponSanitizeElement,I,{tagName:E,allowedTags:Z}),We&&I.hasChildNodes()&&!Br(I.firstElementChild)&&sn(/<[/\w!]/g,I.innerHTML)&&sn(/<[/\w!]/g,I.textContent)||I.nodeType===hc.progressingInstruction||We&&I.nodeType===hc.comment&&sn(/<[/\w]/g,I.data))return ts(I),!0;if(!Z[E]||bt[E]){if(!bt[E]&&er(E)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E)))return!1;if(Zs&&!Ri[E]){const G=C(I)||I.parentNode,ne=S(I)||I.childNodes;if(ne&&G){const Ce=ne.length;for(let At=Ce-1;At>=0;--At){const rt=_(ne[At],!0);rt.__removalCount=(I.__removalCount||0)+1,G.insertBefore(rt,y(I))}}}return ts(I),!0}return I instanceof l&&!ea(I)||(E==="noscript"||E==="noembed"||E==="noframes")&&sn(/<\/no(script|embed|frames)/i,I.innerHTML)?(ts(I),!0):(q&&I.nodeType===hc.text&&(V=I.textContent,Sd([he,se,R],G=>{V=cc(V,G," ")}),I.textContent!==V&&(lc(e.removed,{element:I.cloneNode()}),I.textContent=V)),st(B.afterSanitizeElements,I,null),!1)},Or=function(I,V,E){if(_i&&(V==="id"||V==="name")&&(E in t||E in ks))return!1;if(!(re&&!Xe[V]&&sn(J,V))&&!(ht&&sn(F,V))){if(!xe[V]||Xe[V]){if(!(er(I)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,I)||de.tagNameCheck instanceof Function&&de.tagNameCheck(I))&&(de.attributeNameCheck instanceof RegExp&&sn(de.attributeNameCheck,V)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(V))||V==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E))))return!1}else if(!Qn[V]&&!sn(ae,cc(E,ie,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&I!=="script"&&ND(E,"data:")===0&&vo[I])&&!(Te&&!sn(X,cc(E,ie,"")))&&E)return!1}return!0},er=function(I){return I!=="annotation-xml"&&ix(I,ee)},Fn=function(I){st(B.beforeSanitizeAttributes,I,null);const{attributes:V}=I;if(!V||ut(I))return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const ne=V[G],{name:Ce,namespaceURI:At,value:rt}=ne,et=Zt(Ce),yi=rt;let ft=Ce==="value"?yi:DD(yi);if(E.attrName=et,E.attrValue=ft,E.keepAttr=!0,E.forceKeepAttr=void 0,st(B.uponSanitizeAttribute,I,E),ft=E.attrValue,Zn&&(et==="id"||et==="name")&&(di(Ce,I),ft=Qo+ft),We&&sn(/((--!?|])>)|<\/(style|title)/i,ft)){di(Ce,I);continue}if(E.forceKeepAttr)continue;if(!E.keepAttr){di(Ce,I);continue}if(!Pe&&sn(/\/>/i,ft)){di(Ce,I);continue}q&&Sd([he,se,R],Ot=>{ft=cc(ft,Ot," ")});const tr=Zt(I.nodeName);if(!Or(tr,et,ft)){di(Ce,I);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!At)switch(p.getAttributeType(tr,et)){case"TrustedHTML":{ft=x.createHTML(ft);break}case"TrustedScriptURL":{ft=x.createScriptURL(ft);break}}if(ft!==yi)try{At?I.setAttributeNS(At,Ce,ft):I.setAttribute(Ce,ft),ut(I)?ts(I):tx(e.removed)}catch{di(Ce,I)}}st(B.afterSanitizeAttributes,I,null)},tn=function I(V){let E=null;const G=wo(V);for(st(B.beforeSanitizeShadowDOM,V,null);E=G.nextNode();)st(B.uponSanitizeShadowNode,E,null),wn(E),Fn(E),E.content instanceof r&&I(E.content);st(B.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(I){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,G=null,ne=null,Ce=null;if(bn=!I,bn&&(I=""),typeof I!="string"&&!Br(I))if(typeof I.toString=="function"){if(I=I.toString(),typeof I!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return I;if(it||Js(V),e.removed=[],typeof I=="string"&&(Li=!1),Li){if(I.nodeName){const et=Zt(I.nodeName);if(!Z[et]||bt[et])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof a)E=On(""),G=E.ownerDocument.importNode(I,!0),G.nodeType===hc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?E=G:E.appendChild(G);else{if(!me&&!q&&!He&&I.indexOf("<")===-1)return x&&ui?x.createHTML(I):I;if(E=On(I),!E)return me?null:ui?A:""}E&&Vt&&ts(E.firstChild);const At=wo(Li?I:E);for(;ne=At.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&tn(ne.content);if(Li)return I;if(me){if(nt)for(Ce=H.call(E.ownerDocument);E.firstChild;)Ce.appendChild(E.firstChild);else Ce=E;return(xe.shadowroot||xe.shadowrootmode)&&(Ce=te.call(n,Ce,!0)),Ce}let rt=He?E.outerHTML:E.innerHTML;return He&&Z["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&sn(D2,E.ownerDocument.doctype.name)&&(rt=" +`,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)}}};$(v2,"defaultProps",{..._n.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let DN=v2;function MN(i){return BN(i.source)||i.id||hy(`unnamed ${i.stage}-shader`)}function BN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const w2=class S2 extends _n{constructor(e,t){super(e,t,S2.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"}};$(w2,"defaultProps",{..._n.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 Kh=w2;const E2=class C2 extends _n{constructor(e,t){super(e,t,C2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(E2,"defaultProps",{..._n.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Z0=E2;function ON(i){return $N[i]}function FN(i){const[e,t]=UN[i],n=e==="i32"||e==="u32",s=e!=="u32",r=zN[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const zN={f32:4,f16:2,i32:4,u32:4},UN={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]},$N={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 T2(i,e){const t={};for(const n of i.attributes){const s=jN(i,e,n.name);s&&(t[n.name]=s)}return t}function Nte(i,e,t=16){const n=T2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function jN(i,e,t){const n=HN(i,t),s=VN(e,t);if(!n)return null;const r=FN(n.type),o=lN(r),a=(s==null?void 0:s.vertexFormat)||o,l=py(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 HN(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 VN(i,e){GN(i);let t=WN(i,e);return t||(t=YN(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function GN(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 WN(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 YN(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=py(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 xd;function k2(i){return(!xd||xd.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){ZN(this.uniforms[e],t)||(this.uniforms[e]=QN(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ri=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 KN(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new JN({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:ge.UNIFORM|ge.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:ge.UNIFORM|ge.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 Do;(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"})(Do||(Do={}));const eD={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:{}},tD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),iD=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)}}),nD=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 sD(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&&rD(s),s}return this.originalGetContext(t,n)}}function rD(i){i.getExtension("EXT_color_buffer_float");const e={...eD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:tD(i),OES_vertex_array_object:iD(i),ANGLE_instanced_arrays:nD(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 A2(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 oD=1;let hi=null,Q0=!1;const gy={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function aD(i){if(!globalThis.SPECTOR)try{await A2(i.debugSpectorJSUrl||gy.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Bte(i){var e;if(i={...gy,...i},!i.debugSpectorJS)return null;if(!hi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(oD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;hi=new t,globalThis.luma&&(globalThis.luma.spector=hi)}if(!hi)return null;if(Q0||(Q0=!0,hi.spyCanvases(),hi==null||hi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),hi==null||hi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),hi==null||hi.getResultUI(),hi==null||hi.resultView.display(),hi==null||hi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;hi==null||hi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),hi==null||hi.stopCapture()})}return hi}const lD="https://unpkg.com/webgl-debug@2.0.1/index.js";function I2(i){return i.luma=i.luma||{},i.luma}async function cD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await A2(lD))}function Ote(i,e={}){return e.debugWebGL||e.traceWebGL?dD(i,e):uD(i)}function uD(i){const e=I2(i);return e.realContext?e.realContext:i}function dD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=I2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Do,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,hD.bind(null,e),fD.bind(null,e));for(const o in Do)!(o in n)&&typeof Do[o]=="number"&&(n[o]=Do[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 J0(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 hD(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 fD(i,e,t){let n="";le.level>=1&&(n=J0(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||J0(e,t);debugger}}const wd=1;class pD extends EN{constructor(){super(),$(this,"type","webgl"),Eg.defaultProps={...Eg.defaultProps,...gy}}enforceWebGL2(e){sD(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 p0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-BYCL_Wh6.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!mD(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 p0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-BYCL_Wh6.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));le.groupCollapsed(wd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(cD()),e.debugSpectorJS&&n.push(aD(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(wd,o)(),le.table(wd,r.info)(),r}finally{le.groupEnd(wd)()}}}function mD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const gD=new pD,_D="#b3b3b3",yD=void 0,kg=void 0,bD=1,vD=4,xD="#666666",wD=.1,SD=1,ED=1,L2="#222222",pe={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},CD=.7,TD=.95,kD=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:R2,setPrototypeOf:ex,isFrozen:AD,getPrototypeOf:ID,getOwnPropertyDescriptor:LD}=Object;let{freeze:hn,seal:_s,create:P2}=Object,{apply:Ag,construct:Ig}=typeof Reflect<"u"&&Reflect;hn||(hn=function(i){return i});_s||(_s=function(i){return i});Ag||(Ag=function(i,e,t){return i.apply(e,t)});Ig||(Ig=function(i,e){return new i(...e)});const Sd=fn(Array.prototype.forEach),RD=fn(Array.prototype.lastIndexOf),tx=fn(Array.prototype.pop),lc=fn(Array.prototype.push),PD=fn(Array.prototype.splice),dh=fn(String.prototype.toLowerCase),im=fn(String.prototype.toString),ix=fn(String.prototype.match),cc=fn(String.prototype.replace),ND=fn(String.prototype.indexOf),DD=fn(String.prototype.trim),Ms=fn(Object.prototype.hasOwnProperty),sn=fn(RegExp.prototype.test),uc=MD(TypeError);function fn(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]:dh;ex&&ex(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(AD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function BD(i){for(let e=0;e/gm),$D=_s(/\$\{[\w\W]*/gm),jD=_s(/^data-[\-\w.\u00B7-\uFFFF]+$/),HD=_s(/^aria-[\-\w]+$/),N2=_s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),VD=_s(/^(?:\w+script|data):/i),GD=_s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),D2=_s(/^html$/i),WD=_s(/^[a-z][.\w]*(-[.\w]+)+$/i);var ax=Object.freeze({__proto__:null,ARIA_ATTR:HD,ATTR_WHITESPACE:GD,CUSTOM_ELEMENT:WD,DATA_ATTR:jD,DOCTYPE_NAME:D2,ERB_EXPR:UD,IS_ALLOWED_URI:N2,IS_SCRIPT_OR_DATA:VD,MUSTACHE_EXPR:zD,TMPLIT_EXPR:$D});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},YD=function(){return typeof window>"u"?null:window},qD=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}},lx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function M2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YD();const e=I=>M2(I);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==hc.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=i,m=l.prototype,_=dc(m,"cloneNode"),g=dc(m,"remove"),y=dc(m,"nextSibling"),S=dc(m,"childNodes"),C=dc(m,"parentNode");if(typeof o=="function"){const I=t.createElement("template");I.content&&I.content.ownerDocument&&(t=I.content.ownerDocument)}let x,A="";const{implementation:L,createNodeIterator:P,createDocumentFragment:H,getElementsByTagName:Q}=t,{importNode:te}=n;let B=lx();e.isSupported=typeof R2=="function"&&typeof C=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:se,TMPLIT_EXPR:R,DATA_ATTR:J,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:ee}=ax;let{IS_ALLOWED_URI:ae}=ax,Z=null;const Se=ot({},[...nx,...nm,...sm,...rm,...sx]);let xe=null;const Je=ot({},[...rx,...om,...ox,...Ed]);let de=Object.seal(P2(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}})),bt=null,Xe=null,ht=!0,re=!0,Te=!1,Pe=!0,q=!1,We=!0,He=!1,it=!1,Vt=!1,me=!1,nt=!1,ui=!1,_i=!0,Zn=!1;const Qo="user-content-";let Zs=!0,Li=!1,en={},Ri=null;const ai=ot({},["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 vo=null;const Es=ot({},["audio","video","img","source","image","track"]);let Qn=null;const Jn=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cs="http://www.w3.org/1998/Math/MathML",zi="http://www.w3.org/2000/svg",Ei="http://www.w3.org/1999/xhtml";let ii=Ei,bn=!1,vn=null;const Ts=ot({},[Cs,zi,Ei],im);let Bn=ot({},["mi","mo","mn","ms","mtext"]),es=ot({},["annotation-xml"]);const Dr=ot({},["title","style","font","a","script"]);let xn=null;const Qs=["application/xhtml+xml","text/html"],Jo="text/html";let Zt=null,Bt=null;const ks=t.createElement("form"),xo=function(I){return I instanceof RegExp||I instanceof Function},Js=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bt&&Bt===I)){if((!I||typeof I!="object")&&(I={}),I=Hr(I),xn=Qs.indexOf(I.PARSER_MEDIA_TYPE)===-1?Jo:I.PARSER_MEDIA_TYPE,Zt=xn==="application/xhtml+xml"?im:dh,Z=Ms(I,"ALLOWED_TAGS")?ot({},I.ALLOWED_TAGS,Zt):Se,xe=Ms(I,"ALLOWED_ATTR")?ot({},I.ALLOWED_ATTR,Zt):Je,vn=Ms(I,"ALLOWED_NAMESPACES")?ot({},I.ALLOWED_NAMESPACES,im):Ts,Qn=Ms(I,"ADD_URI_SAFE_ATTR")?ot(Hr(Jn),I.ADD_URI_SAFE_ATTR,Zt):Jn,vo=Ms(I,"ADD_DATA_URI_TAGS")?ot(Hr(Es),I.ADD_DATA_URI_TAGS,Zt):Es,Ri=Ms(I,"FORBID_CONTENTS")?ot({},I.FORBID_CONTENTS,Zt):ai,bt=Ms(I,"FORBID_TAGS")?ot({},I.FORBID_TAGS,Zt):Hr({}),Xe=Ms(I,"FORBID_ATTR")?ot({},I.FORBID_ATTR,Zt):Hr({}),en=Ms(I,"USE_PROFILES")?I.USE_PROFILES:!1,ht=I.ALLOW_ARIA_ATTR!==!1,re=I.ALLOW_DATA_ATTR!==!1,Te=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=I.SAFE_FOR_TEMPLATES||!1,We=I.SAFE_FOR_XML!==!1,He=I.WHOLE_DOCUMENT||!1,me=I.RETURN_DOM||!1,nt=I.RETURN_DOM_FRAGMENT||!1,ui=I.RETURN_TRUSTED_TYPE||!1,Vt=I.FORCE_BODY||!1,_i=I.SANITIZE_DOM!==!1,Zn=I.SANITIZE_NAMED_PROPS||!1,Zs=I.KEEP_CONTENT!==!1,Li=I.IN_PLACE||!1,ae=I.ALLOWED_URI_REGEXP||N2,ii=I.NAMESPACE||Ei,Bn=I.MATHML_TEXT_INTEGRATION_POINTS||Bn,es=I.HTML_INTEGRATION_POINTS||es,de=I.CUSTOM_ELEMENT_HANDLING||{},I.CUSTOM_ELEMENT_HANDLING&&xo(I.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=I.CUSTOM_ELEMENT_HANDLING.tagNameCheck),I.CUSTOM_ELEMENT_HANDLING&&xo(I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(re=!1),nt&&(me=!0),en&&(Z=ot({},sx),xe=[],en.html===!0&&(ot(Z,nx),ot(xe,rx)),en.svg===!0&&(ot(Z,nm),ot(xe,om),ot(xe,Ed)),en.svgFilters===!0&&(ot(Z,sm),ot(xe,om),ot(xe,Ed)),en.mathMl===!0&&(ot(Z,rm),ot(xe,ox),ot(xe,Ed))),I.ADD_TAGS&&(Z===Se&&(Z=Hr(Z)),ot(Z,I.ADD_TAGS,Zt)),I.ADD_ATTR&&(xe===Je&&(xe=Hr(xe)),ot(xe,I.ADD_ATTR,Zt)),I.ADD_URI_SAFE_ATTR&&ot(Qn,I.ADD_URI_SAFE_ATTR,Zt),I.FORBID_CONTENTS&&(Ri===ai&&(Ri=Hr(Ri)),ot(Ri,I.FORBID_CONTENTS,Zt)),Zs&&(Z["#text"]=!0),He&&ot(Z,["html","head","body"]),Z.table&&(ot(Z,["tbody"]),delete bt.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=I.TRUSTED_TYPES_POLICY,A=x.createHTML("")}else x===void 0&&(x=qD(p,s)),x!==null&&typeof A=="string"&&(A=x.createHTML(""));hn&&hn(I),Bt=I}},Rt=ot({},[...nm,...sm,...OD]),Mr=ot({},[...rm,...FD]),ea=function(I){let V=C(I);(!V||!V.tagName)&&(V={namespaceURI:ii,tagName:"template"});const E=dh(I.tagName),G=dh(V.tagName);return vn[I.namespaceURI]?I.namespaceURI===zi?V.namespaceURI===Ei?E==="svg":V.namespaceURI===Cs?E==="svg"&&(G==="annotation-xml"||Bn[G]):!!Rt[E]:I.namespaceURI===Cs?V.namespaceURI===Ei?E==="math":V.namespaceURI===zi?E==="math"&&es[G]:!!Mr[E]:I.namespaceURI===Ei?V.namespaceURI===zi&&!es[G]||V.namespaceURI===Cs&&!Bn[G]?!1:!Mr[E]&&(Dr[E]||!Rt[E]):!!(xn==="application/xhtml+xml"&&vn[I.namespaceURI]):!1},ts=function(I){lc(e.removed,{element:I});try{C(I).removeChild(I)}catch{g(I)}},di=function(I,V){try{lc(e.removed,{attribute:V.getAttributeNode(I),from:V})}catch{lc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(I),I==="is")if(me||nt)try{ts(V)}catch{}else try{V.setAttribute(I,"")}catch{}},On=function(I){let V=null,E=null;if(Vt)I=""+I;else{const Ce=ix(I,/^[\r\n\t ]+/);E=Ce&&Ce[0]}xn==="application/xhtml+xml"&&ii===Ei&&(I=''+I+"");const G=x?x.createHTML(I):I;if(ii===Ei)try{V=new h().parseFromString(G,xn)}catch{}if(!V||!V.documentElement){V=L.createDocument(ii,"template",null);try{V.documentElement.innerHTML=bn?A:G}catch{}}const ne=V.body||V.documentElement;return I&&E&&ne.insertBefore(t.createTextNode(E),ne.childNodes[0]||null),ii===Ei?Q.call(V,He?"html":"body")[0]:He?V.documentElement:ne},wo=function(I){return P.call(I.ownerDocument||I,I,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ut=function(I){return I instanceof d&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof u)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},Br=function(I){return typeof a=="function"&&I instanceof a};function st(I,V,E){Sd(I,G=>{G.call(e,V,E,Bt)})}const wn=function(I){let V=null;if(st(B.beforeSanitizeElements,I,null),ut(I))return ts(I),!0;const E=Zt(I.nodeName);if(st(B.uponSanitizeElement,I,{tagName:E,allowedTags:Z}),We&&I.hasChildNodes()&&!Br(I.firstElementChild)&&sn(/<[/\w!]/g,I.innerHTML)&&sn(/<[/\w!]/g,I.textContent)||I.nodeType===hc.progressingInstruction||We&&I.nodeType===hc.comment&&sn(/<[/\w]/g,I.data))return ts(I),!0;if(!Z[E]||bt[E]){if(!bt[E]&&er(E)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E)))return!1;if(Zs&&!Ri[E]){const G=C(I)||I.parentNode,ne=S(I)||I.childNodes;if(ne&&G){const Ce=ne.length;for(let At=Ce-1;At>=0;--At){const rt=_(ne[At],!0);rt.__removalCount=(I.__removalCount||0)+1,G.insertBefore(rt,y(I))}}}return ts(I),!0}return I instanceof l&&!ea(I)||(E==="noscript"||E==="noembed"||E==="noframes")&&sn(/<\/no(script|embed|frames)/i,I.innerHTML)?(ts(I),!0):(q&&I.nodeType===hc.text&&(V=I.textContent,Sd([he,se,R],G=>{V=cc(V,G," ")}),I.textContent!==V&&(lc(e.removed,{element:I.cloneNode()}),I.textContent=V)),st(B.afterSanitizeElements,I,null),!1)},Or=function(I,V,E){if(_i&&(V==="id"||V==="name")&&(E in t||E in ks))return!1;if(!(re&&!Xe[V]&&sn(J,V))&&!(ht&&sn(F,V))){if(!xe[V]||Xe[V]){if(!(er(I)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,I)||de.tagNameCheck instanceof Function&&de.tagNameCheck(I))&&(de.attributeNameCheck instanceof RegExp&&sn(de.attributeNameCheck,V)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(V))||V==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E))))return!1}else if(!Qn[V]&&!sn(ae,cc(E,ie,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&I!=="script"&&ND(E,"data:")===0&&vo[I])&&!(Te&&!sn(X,cc(E,ie,"")))&&E)return!1}return!0},er=function(I){return I!=="annotation-xml"&&ix(I,ee)},Fn=function(I){st(B.beforeSanitizeAttributes,I,null);const{attributes:V}=I;if(!V||ut(I))return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const ne=V[G],{name:Ce,namespaceURI:At,value:rt}=ne,et=Zt(Ce),yi=rt;let ft=Ce==="value"?yi:DD(yi);if(E.attrName=et,E.attrValue=ft,E.keepAttr=!0,E.forceKeepAttr=void 0,st(B.uponSanitizeAttribute,I,E),ft=E.attrValue,Zn&&(et==="id"||et==="name")&&(di(Ce,I),ft=Qo+ft),We&&sn(/((--!?|])>)|<\/(style|title)/i,ft)){di(Ce,I);continue}if(E.forceKeepAttr)continue;if(!E.keepAttr){di(Ce,I);continue}if(!Pe&&sn(/\/>/i,ft)){di(Ce,I);continue}q&&Sd([he,se,R],Ot=>{ft=cc(ft,Ot," ")});const tr=Zt(I.nodeName);if(!Or(tr,et,ft)){di(Ce,I);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!At)switch(p.getAttributeType(tr,et)){case"TrustedHTML":{ft=x.createHTML(ft);break}case"TrustedScriptURL":{ft=x.createScriptURL(ft);break}}if(ft!==yi)try{At?I.setAttributeNS(At,Ce,ft):I.setAttribute(Ce,ft),ut(I)?ts(I):tx(e.removed)}catch{di(Ce,I)}}st(B.afterSanitizeAttributes,I,null)},tn=function I(V){let E=null;const G=wo(V);for(st(B.beforeSanitizeShadowDOM,V,null);E=G.nextNode();)st(B.uponSanitizeShadowNode,E,null),wn(E),Fn(E),E.content instanceof r&&I(E.content);st(B.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(I){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,G=null,ne=null,Ce=null;if(bn=!I,bn&&(I=""),typeof I!="string"&&!Br(I))if(typeof I.toString=="function"){if(I=I.toString(),typeof I!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return I;if(it||Js(V),e.removed=[],typeof I=="string"&&(Li=!1),Li){if(I.nodeName){const et=Zt(I.nodeName);if(!Z[et]||bt[et])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof a)E=On(""),G=E.ownerDocument.importNode(I,!0),G.nodeType===hc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?E=G:E.appendChild(G);else{if(!me&&!q&&!He&&I.indexOf("<")===-1)return x&&ui?x.createHTML(I):I;if(E=On(I),!E)return me?null:ui?A:""}E&&Vt&&ts(E.firstChild);const At=wo(Li?I:E);for(;ne=At.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&tn(ne.content);if(Li)return I;if(me){if(nt)for(Ce=H.call(E.ownerDocument);E.firstChild;)Ce.appendChild(E.firstChild);else Ce=E;return(xe.shadowroot||xe.shadowrootmode)&&(Ce=te.call(n,Ce,!0)),Ce}let rt=He?E.outerHTML:E.innerHTML;return He&&Z["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&sn(D2,E.ownerDocument.doctype.name)&&(rt=" `+rt),q&&Sd([he,se,R],et=>{rt=cc(rt,et," ")}),x&&ui?x.createHTML(rt):rt},e.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Js(I),it=!0},e.clearConfig=function(){Bt=null,it=!1},e.isValidAttribute=function(I,V,E){Bt||Js({});const G=Zt(I),ne=Zt(V);return Or(G,ne,E)},e.addHook=function(I,V){typeof V=="function"&&lc(B[I],V)},e.removeHook=function(I,V){if(V!==void 0){const E=RD(B[I],V);return E===-1?void 0:PD(B[I],E,1)[0]}return tx(B[I])},e.removeHooks=function(I){B[I]=[]},e.removeAllHooks=function(){B=lx()},e}var XD=M2();const KD=i=>typeof i=="function",B2=i=>Array.isArray(i),ZD=i=>i instanceof Object,QD=i=>i instanceof Object?i.constructor.name!=="Function"&&i.constructor.name!=="Object":!1,cx=i=>ZD(i)&&!B2(i)&&!KD(i)&&!QD(i);function Mo(i){let e;if(B2(i))e=i;else{const t=Uo(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 JD(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 eM(i,e,t){return Math.min(Math.max(i,e),t)}function rs(i){return i!=null&&!Number.isNaN(i)}function tM(i,e){return XD.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 iM{constructor(){this.enableSimulation=pe.enableSimulation,this.backgroundColor=L2,this.spaceSize=pe.spaceSize,this.pointColor=_D,this.pointDefaultColor=void 0,this.pointGreyoutOpacity=yD,this.pointGreyoutColor=kg,this.pointSize=vD,this.pointDefaultSize=void 0,this.pointOpacity=bD,this.pointSizeScale=pe.pointSizeScale,this.hoveredPointCursor=pe.hoveredPointCursor,this.hoveredLinkCursor=pe.hoveredLinkCursor,this.renderHoveredPointRing=pe.renderHoveredPointRing,this.hoveredPointRingColor=pe.hoveredPointRingColor,this.focusedPointRingColor=pe.focusedPointRingColor,this.focusedPointIndex=pe.focusedPointIndex,this.linkColor=xD,this.linkDefaultColor=void 0,this.linkOpacity=SD,this.linkGreyoutOpacity=wD,this.linkWidth=ED,this.linkDefaultWidth=void 0,this.linkWidthScale=pe.linkWidthScale,this.hoveredLinkColor=pe.hoveredLinkColor,this.hoveredLinkWidthIncrease=pe.hoveredLinkWidthIncrease,this.renderLinks=pe.renderLinks,this.curvedLinks=pe.curvedLinks,this.curvedLinkSegments=pe.curvedLinkSegments,this.curvedLinkWeight=pe.curvedLinkWeight,this.curvedLinkControlPointDistance=pe.curvedLinkControlPointDistance,this.linkArrows=pe.linkArrows,this.linkDefaultArrows=void 0,this.linkArrowsSizeScale=pe.linkArrowsSizeScale,this.scaleLinksOnZoom=pe.scaleLinksOnZoom,this.linkVisibilityDistanceRange=pe.linkVisibilityDistanceRange,this.linkVisibilityMinTransparency=pe.linkVisibilityMinTransparency,this.simulationDecay=pe.simulation.decay,this.simulationGravity=pe.simulation.gravity,this.simulationCenter=pe.simulation.center,this.simulationRepulsion=pe.simulation.repulsion,this.simulationRepulsionTheta=pe.simulation.repulsionTheta,this.simulationLinkSpring=pe.simulation.linkSpring,this.simulationLinkDistance=pe.simulation.linkDistance,this.simulationLinkDistRandomVariationRange=pe.simulation.linkDistRandomVariationRange,this.simulationRepulsionFromMouse=pe.simulation.repulsionFromMouse,this.enableRightClickRepulsion=pe.enableRightClickRepulsion,this.simulationFriction=pe.simulation.friction,this.simulationCluster=pe.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=pe.showFPSMonitor,this.pixelRatio=pe.pixelRatio,this.scalePointsOnZoom=pe.scalePointsOnZoom,this.initialZoomLevel=void 0,this.enableZoom=pe.enableZoom,this.enableSimulationDuringZoom=pe.enableSimulationDuringZoom,this.enableDrag=pe.enableDrag,this.fitViewOnInit=pe.fitViewOnInit,this.fitViewDelay=pe.fitViewDelay,this.fitViewPadding=pe.fitViewPadding,this.fitViewDuration=pe.fitViewDuration,this.fitViewByPointsInRect=void 0,this.fitViewByPointIndices=void 0,this.randomSeed=void 0,this.pointSamplingDistance=pe.pointSamplingDistance,this.attribution=pe.attribution,this.rescalePositions=pe.rescalePositions}init(e){Object.keys(e).forEach(t=>{this.deepMergeConfig(this.getConfig(),e,t)})}deepMergeConfig(e,t,n){cx(e[n])&&cx(t[n])?Object.keys(t[n]).forEach(s=>{this.deepMergeConfig(e[n],t[n],s)}):e[n]=t[n]}getConfig(){return this}}function _y(i,e){if(!i)throw new Error(e||"shadertools: assertion failed.")}const am={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 nM(i){const e={};for(const[t,n]of Object.entries(i))e[t]=sM(n);return e}function sM(i){let e=ux(i);if(e!=="object")return{value:i,...am[e],type:e};if(typeof i=="object")return i?i.type!==void 0?{...i,...am[i.type],type:i.type}:i.value===void 0?{type:"object",value:i}:(e=ux(i.value),{...i,...am[e],type:e}):{type:"object",value:null};throw new Error("props")}function ux(i){return Array.isArray(i)||ArrayBuffer.isView(i)?"array":typeof i}const rM=`#ifdef MODULE_LOGDEPTH logdepth_adjustPosition(gl_Position); #endif diff --git a/frontend/dist/assets/Mqtt-B_SI6Dym.js b/frontend/dist/assets/Mqtt-CaCE2AxE.js similarity index 98% rename from frontend/dist/assets/Mqtt-B_SI6Dym.js rename to frontend/dist/assets/Mqtt-CaCE2AxE.js index e5085c03..8ea7250e 100644 --- a/frontend/dist/assets/Mqtt-B_SI6Dym.js +++ b/frontend/dist/assets/Mqtt-CaCE2AxE.js @@ -1,4 +1,4 @@ -import{d as he,f6 as N,f7 as Ke,r as d,j as e,I as K,B as te,c as C,eL as Fe,eM as ze,aC as ye,eN as Ve,a6 as xe,R as I,Y as ne,bK as fe,f8 as be,dd as Ce,f9 as Le,fa as me,fb as We,a8 as le,a5 as Pe,fc as O,fd as $e,fe as Ye,ff as Me,fg as Ze,fh as Je,fi as _e,a0 as je,fj as qe,cC as ke,fk as Xe}from"./index-DZK2INMD.js";import{C as Q,P as Qe,a as et,B as tt}from"./PageLayout-F1v-IzhG.js";import{L as Re,a as ge}from"./listbox-DR8wL7aQ.js";import{S as st}from"./settings-2-CKbtmc0u.js";import{P as re}from"./plus-Dm1LTbFN.js";import{M as at}from"./map-pin-qwXb-K8z.js";import{C as nt}from"./circle-x-D0lMBMA-.js";import{Z as se}from"./zap-CV3qJZPu.js";import{S as Te}from"./search-DRsZhueb.js";import{C as de}from"./chevron-right-DYHNTpxG.js";import{H as rt}from"./hash-Bx-gtxz0.js";import{u as lt,C as ot}from"./chevron-up-Bm8_AtG8.js";import{F as it}from"./funnel-ClRHq7Ic.js";import{a as ct,C as dt}from"./circle-stop-wbk-0e1-.js";import{T as ut}from"./trash-2-B1qiliQL.js";import{M as mt}from"./message-square-Cb8LlwAg.js";import{C as ht}from"./cpu-C2F1drgJ.js";import{R as ue,C as Ne}from"./Grid-TGa3qLqq.js";import{W as pt}from"./wifi-DPjA-ySX.js";import{W as xt}from"./wifi-off-Dpiws8OL.js";import{D as Se}from"./database-DWx780B3.js";import{C as ft}from"./clock-CZYZYW0y.js";import{T as gt}from"./triangle-alert-z32LI9zM.js";import"./element-movement-BZO5MqZi.js";/** +import{d as he,f6 as N,f7 as Ke,r as d,j as e,I as K,B as te,c as C,eL as Fe,eM as ze,aC as ye,eN as Ve,a6 as xe,R as I,Y as ne,bK as fe,f8 as be,dd as Ce,f9 as Le,fa as me,fb as We,a8 as le,a5 as Pe,fc as O,fd as $e,fe as Ye,ff as Me,fg as Ze,fh as Je,fi as _e,a0 as je,fj as qe,cC as ke,fk as Xe}from"./index-B9Nfzawy.js";import{C as Q,P as Qe,a as et,B as tt}from"./PageLayout-Da0xfaXb.js";import{L as Re,a as ge}from"./listbox-DV2L-QZw.js";import{S as st}from"./settings-2-DYzgUEwY.js";import{P as re}from"./plus-B7jylh_n.js";import{M as at}from"./map-pin-Z2xK57U6.js";import{C as nt}from"./circle-x-i9YQ1o9T.js";import{Z as se}from"./zap-DME89Nfc.js";import{S as Te}from"./search-BrfwwyYC.js";import{C as de}from"./chevron-right-jwX-OOTu.js";import{H as rt}from"./hash-fRZDKNyT.js";import{u as lt,C as ot}from"./chevron-up-DvNDOaHb.js";import{F as it}from"./funnel-DOec69-r.js";import{a as ct,C as dt}from"./circle-stop-CO5AnAxr.js";import{T as ut}from"./trash-2-BxrPvo_t.js";import{M as mt}from"./message-square-C9xeBmVh.js";import{C as ht}from"./cpu-lxveD9wi.js";import{R as ue,C as Ne}from"./Grid-CbgS5PRh.js";import{W as pt}from"./wifi-BpM3uttU.js";import{W as xt}from"./wifi-off-DoZXnx54.js";import{D as Se}from"./database-CSUiI1CG.js";import{C as ft}from"./clock-CCOO2GB9.js";import{T as gt}from"./triangle-alert-_KPqiYkd.js";import"./element-movement-C8Yd7NWa.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MqttModeBadge-CK543WcH.js b/frontend/dist/assets/MqttModeBadge-Bgn-nTpu.js similarity index 98% rename from frontend/dist/assets/MqttModeBadge-CK543WcH.js rename to frontend/dist/assets/MqttModeBadge-Bgn-nTpu.js index b0329c61..b2251d56 100644 --- a/frontend/dist/assets/MqttModeBadge-CK543WcH.js +++ b/frontend/dist/assets/MqttModeBadge-Bgn-nTpu.js @@ -1,4 +1,4 @@ -import{aX as Le,bi as ve,aW as qe,cT as Pe,aZ as Ve,aY as Z,r as l,b0 as We,b1 as ee,b5 as U,b4 as z,aR as I,b8 as V,cU as se,cV as _e,bd as Ye,be as Qe,bj as Xe,bf as re,bk as He,bg as me,cW as Fe,cX as W,cY as A,cZ as G,c_ as he,c$ as ge,bh as le,bt as C,d0 as ye,d1 as xe,bl as we,aV as Ke,bm as Te,bn as je,bo as J,bp as Ze,bq as Ue,bs as Oe,d2 as ze,d3 as Ee,bu as Je,d4 as et,d5 as tt,bv as ke,d6 as nt,d7 as at,d8 as ot,aS as st,d9 as rt,bB as lt,da as ut,db as it,dc as Ne,bD as ct,bF as ce,d as dt,j as P,c as M,A as pt,m as ft,cR as bt,dd as vt,u as mt,R as ht,a8 as Ie}from"./index-DZK2INMD.js";import{C as yt}from"./chevron-right-DYHNTpxG.js";import{F as xt,y as Pt,R as gt,T as $t,w as St,A as Ct}from"./map-pin-qwXb-K8z.js";var wt=Object.defineProperty,kt=(e,n,t)=>n in e?wt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Be=(e,n,t)=>(kt(e,typeof n!="symbol"?n+"":n,t),t),g=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(g||{}),It=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(It||{});let Bt={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,n){return e.button===n.button?e:{...e,button:n.button}},3(e,n){return e.buttonId===n.buttonId?e:{...e,buttonId:n.buttonId}},4(e,n){return e.panel===n.panel?e:{...e,panel:n.panel}},5(e,n){return e.panelId===n.panelId?e:{...e,panelId:n.panelId}}};class $e extends Le{constructor(n){super(n),Be(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let f=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;f==null||f.focus()},open:()=>this.send({type:0}),setButtonId:t=>this.send({type:3,buttonId:t}),setButton:t=>this.send({type:2,button:t}),setPanelId:t=>this.send({type:5,panelId:t}),setPanel:t=>this.send({type:4,panel:t})}),Be(this,"selectors",{isPortalled:t=>{var f;if(!t.button||!t.panel)return!1;let m=(f=qe(t.button))!=null?f:document;for(let $ of m.querySelectorAll("body > *"))if(Number($==null?void 0:$.contains(t.button))^Number($==null?void 0:$.contains(t.panel)))return!0;let i=Pe(m),r=i.indexOf(t.button),a=(r+i.length-1)%i.length,S=(r+1)%i.length,y=i[a],s=i[S];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,f=Ve.get(null);this.on(0,()=>f.actions.push(t)),this.on(1,()=>f.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new $e({id:n,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(n,t){return Z(t.type,Bt,n,t)}}const Me=l.createContext(null);function de(e){let n=l.useContext(Me);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function _t({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>$e.new({id:e,__demoMode:n}),[]);return We(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function Re(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function Ft(){return l.useContext(pe)}let Tt="div";function jt(e,n){var t;let f=l.useId(),{__demoMode:m=!1,...i}=e,r=_t({id:f,__demoMode:m}),a=l.useRef(null),S=z(n,et(u=>{a.current=u})),[y,s,$,w,B]=U(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),k=tt((t=a.current)!=null?t:s),b=ke(w),p=ke(B),v=l.useMemo(()=>({buttonId:b,panelId:p,close:r.actions.close}),[b,p,r]),x=Re(),c=x==null?void 0:x.registerPopover,_=I(()=>{var u,F;let j=se((u=a.current)!=null?u:s);return(F=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?F:j&&((s==null?void 0:s.contains(j))||($==null?void 0:$.contains(j)))});l.useEffect(()=>c==null?void 0:c(v),[c,v]);let[te,ne]=nt(),L=at(s),R=ot({mainTreeNode:L,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});st(k,"focus",u=>{var F,j,E,H,N,K;u.target!==window&&rt(u.target)&&r.state.popoverState===g.Open&&(_()||r.state.button&&r.state.panel&&(R.contains(u.target)||(j=(F=r.state.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&j.call(F,u.target)||(H=(E=r.state.afterPanelSentinel.current)==null?void 0:E.contains)!=null&&H.call(E,u.target)||(K=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&K.call(N,u.target)||r.actions.close()))},!0);let Y=y===g.Open;lt(Y,R.resolveContainers,(u,F)=>{r.actions.close(),ut(F,it.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===g.Open,close:r.actions.refocusableClose}),oe=U(r,l.useCallback(u=>Z(u.popoverState,{[g.Open]:J.Open,[g.Closed]:J.Closed}),[])),Q={ref:S},X=le();return C.createElement(Ne,{node:L},C.createElement(Ct,null,C.createElement(pe.Provider,{value:null},C.createElement(Me.Provider,{value:r},C.createElement(Ee,{value:r.actions.refocusableClose},C.createElement(ct,{value:oe},C.createElement(ne,null,X({ourProps:Q,theirProps:i,slot:ae,defaultTag:Tt,name:"Popover"}))))))))}let Ot="button";function Et(e,n){let t=l.useId(),{id:f=`headlessui-popover-button-${t}`,disabled:m=!1,autoFocus:i=!1,...r}=e,a=de("Popover.Button"),[S,y,s,$,w,B,k]=U(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),b=l.useRef(null),p=`headlessui-focus-sentinel-${l.useId()}`,v=Re(),x=v==null?void 0:v.closeOthers,c=Ft()!==null;l.useEffect(()=>{if(!c)return a.actions.setButtonId(f),()=>a.actions.setButtonId(null)},[c,f,a]);let[_]=l.useState(()=>Symbol()),te=z(b,n,xt(),I(o=>{if(!c){if(o)a.state.buttons.current.push(_);else{let d=a.state.buttons.current.indexOf(_);d!==-1&&a.state.buttons.current.splice(d,1)}a.state.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),o&&a.actions.setButton(o)}})),ne=z(b,n),L=I(o=>{var d,T,O;if(c){if(a.state.popoverState===g.Closed)return;switch(o.key){case V.Space:case V.Enter:o.preventDefault(),(T=(d=o.target).click)==null||T.call(d),a.actions.close(),(O=a.state.button)==null||O.focus();break}}else switch(o.key){case V.Space:case V.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close();break;case V.Escape:if(a.state.popoverState!==g.Open)return x==null?void 0:x(a.state.buttonId);if(!b.current)return;let D=se(b.current);if(D&&!b.current.contains(D))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),R=I(o=>{c||o.key===V.Space&&o.preventDefault()}),Y=I(o=>{var d,T;_e(o.currentTarget)||m||(c?(a.actions.close(),(d=a.state.button)==null||d.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close(),(T=a.state.button)==null||T.focus()))}),ae=I(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Q}=Ye({autoFocus:i}),{isHovered:X,hoverProps:u}=Qe({isDisabled:m}),{pressed:F,pressProps:j}=Xe({disabled:m}),E=S===g.Open,H=re({open:E,active:F||E,disabled:m,hover:X,focus:oe,autofocus:i}),N=He(e,s),K=c?me({ref:ne,type:N,onKeyDown:L,onClick:Y,disabled:m||void 0,autoFocus:i},Q,u,j):me({ref:te,id:$,type:N,"aria-expanded":S===g.Open,"aria-controls":w?B:void 0,disabled:m||void 0,autoFocus:i,onKeyDown:L,onKeyUp:R,onClick:Y,onMouseDown:ae},Q,u,j),ue=Fe(),fe=I(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function d(){Z(ue.current,{[A.Forwards]:()=>W(o,G.First),[A.Backwards]:()=>W(o,G.Last)})===he.Error&&W(Pe(ge(a.state.button)).filter(T=>T.dataset.headlessuiFocusGuard!=="true"),Z(ue.current,{[A.Forwards]:G.Next,[A.Backwards]:G.Previous}),{relativeTo:a.state.button})}d()}),h=le();return C.createElement(C.Fragment,null,h({ourProps:K,theirProps:r,slot:H,defaultTag:Ot,name:"Popover.Button"}),E&&!c&&y&&C.createElement(ye,{id:p,ref:k,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Nt="div",Mt=ce.RenderStrategy|ce.Static;function De(e,n){let t=l.useId(),{id:f=`headlessui-popover-backdrop-${t}`,transition:m=!1,...i}=e,r=de("Popover.Backdrop"),a=U(r,l.useCallback(v=>v.popoverState,[])),[S,y]=l.useState(null),s=z(n,y),$=Te(),[w,B]=je(m,S,$!==null?($&J.Open)===J.Open:a===g.Open),k=I(v=>{if(_e(v.currentTarget))return v.preventDefault();r.actions.close()}),b=re({open:a===g.Open}),p={ref:s,id:f,"aria-hidden":!0,onClick:k,...Oe(B)};return le()({ourProps:p,theirProps:i,slot:b,defaultTag:Nt,features:Mt,visible:w,name:"Popover.Backdrop"})}let Rt="div",Dt=ce.RenderStrategy|ce.Static;function At(e,n){let t=l.useId(),{id:f=`headlessui-popover-panel-${t}`,focus:m=!1,anchor:i,portal:r=!1,modal:a=!1,transition:S=!1,...y}=e,s=de("Popover.Panel"),$=U(s,s.selectors.isPortalled),[w,B,k,b,p]=U(s,l.useCallback(h=>[h.popoverState,h.button,h.__demoMode,h.beforePanelSentinel,h.afterPanelSentinel],[])),v=`headlessui-focus-sentinel-before-${t}`,x=`headlessui-focus-sentinel-after-${t}`,c=l.useRef(null),_=Pt(i),[te,ne]=gt(_),L=$t();_&&(r=!0);let[R,Y]=l.useState(null),ae=z(c,n,_?te:null,s.actions.setPanel,Y),oe=we(B),Q=we(c.current);Ke(()=>(s.actions.setPanelId(f),()=>s.actions.setPanelId(null)),[f,s]);let X=Te(),[u,F]=je(S,R,X!==null?(X&J.Open)===J.Open:w===g.Open);Ze(u,B,s.actions.close),Ue(k?!1:a&&u,Q);let j=I(h=>{var o;switch(h.key){case V.Escape:if(s.state.popoverState!==g.Open||!c.current)return;let d=se(c.current);if(d&&!c.current.contains(d))return;h.preventDefault(),h.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var h;e.static||w===g.Closed&&((h=e.unmount)==null||h)&&s.actions.setPanel(null)},[w,e.unmount,e.static,s]),l.useEffect(()=>{if(k||!m||w!==g.Open||!c.current)return;let h=se(c.current);c.current.contains(h)||W(c.current,G.First)},[k,m,c.current,w]);let E=re({open:w===g.Open,close:s.actions.refocusableClose}),H=me(_?L():{},{ref:ae,id:f,onKeyDown:j,onBlur:m&&w===g.Open?h=>{var o,d,T,O,D;let q=h.relatedTarget;q&&c.current&&((o=c.current)!=null&&o.contains(q)||(s.actions.close(),((T=(d=b.current)==null?void 0:d.contains)!=null&&T.call(d,q)||(D=(O=p.current)==null?void 0:O.contains)!=null&&D.call(O,q))&&q.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":St(u,B,!0).width},...Oe(F)}),N=Fe(),K=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;W(h,G.First)===he.Error&&((d=s.state.afterPanelSentinel.current)==null||d.focus())},[A.Backwards]:()=>{var d;(d=s.state.button)==null||d.focus({preventScroll:!0})}})}o()}),ue=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;if(!s.state.button)return;let T=(d=ge(s.state.button))!=null?d:document.body,O=Pe(T),D=O.indexOf(s.state.button),q=O.slice(0,D+1),ie=[...O.slice(D+1),...q];for(let be of ie.slice())if(be.dataset.headlessuiFocusGuard==="true"||R!=null&&R.contains(be)){let Ce=ie.indexOf(be);Ce!==-1&&ie.splice(Ce,1)}W(ie,G.First,{sorted:!1})},[A.Backwards]:()=>{var d;W(h,G.Previous)===he.Error&&((d=s.state.button)==null||d.focus())}})}o()}),fe=le();return C.createElement(ze,null,C.createElement(pe.Provider,{value:f},C.createElement(Ee,{value:s.actions.refocusableClose},C.createElement(Je,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&$&&C.createElement(ye,{id:v,ref:b,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:K}),fe({ourProps:H,theirProps:y,slot:E,defaultTag:Rt,features:Dt,visible:u,name:"Popover.Panel"}),u&&$&&C.createElement(ye,{id:x,ref:p,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Gt="div";function Lt(e,n){let t=l.useRef(null),f=z(t,n),[m,i]=l.useState([]),r=I(b=>{i(p=>{let v=p.indexOf(b);if(v!==-1){let x=p.slice();return x.splice(v,1),x}return p})}),a=I(b=>(i(p=>[...p,b]),()=>r(b))),S=I(()=>{var b;let p=ge(t.current);if(!p)return!1;let v=se(t.current);return(b=t.current)!=null&&b.contains(v)?!0:m.some(x=>{var c,_;return((c=p.getElementById(x.buttonId.current))==null?void 0:c.contains(v))||((_=p.getElementById(x.panelId.current))==null?void 0:_.contains(v))})}),y=I(b=>{for(let p of m)p.buttonId.current!==b&&p.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:S,closeOthers:y}),[a,r,S,y]),$=re({}),w=e,B={ref:f},k=le();return C.createElement(Ne,null,C.createElement(Se.Provider,{value:s},k({ourProps:B,theirProps:w,slot:$,defaultTag:Gt,name:"Popover.Group"})))}let qt=ee(jt),Ae=ee(Et),Vt=ee(De),Wt=ee(De),Ge=ee(At),Yt=ee(Lt),Qt=Object.assign(qt,{Button:Ae,Backdrop:Wt,Overlay:Vt,Panel:Ge,Group:Yt});/** +import{aX as Le,bi as ve,aW as qe,cT as Pe,aZ as Ve,aY as Z,r as l,b0 as We,b1 as ee,b5 as U,b4 as z,aR as I,b8 as V,cU as se,cV as _e,bd as Ye,be as Qe,bj as Xe,bf as re,bk as He,bg as me,cW as Fe,cX as W,cY as A,cZ as G,c_ as he,c$ as ge,bh as le,bt as C,d0 as ye,d1 as xe,bl as we,aV as Ke,bm as Te,bn as je,bo as J,bp as Ze,bq as Ue,bs as Oe,d2 as ze,d3 as Ee,bu as Je,d4 as et,d5 as tt,bv as ke,d6 as nt,d7 as at,d8 as ot,aS as st,d9 as rt,bB as lt,da as ut,db as it,dc as Ne,bD as ct,bF as ce,d as dt,j as P,c as M,A as pt,m as ft,cR as bt,dd as vt,u as mt,R as ht,a8 as Ie}from"./index-B9Nfzawy.js";import{C as yt}from"./chevron-right-jwX-OOTu.js";import{F as xt,y as Pt,R as gt,T as $t,w as St,A as Ct}from"./map-pin-Z2xK57U6.js";var wt=Object.defineProperty,kt=(e,n,t)=>n in e?wt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Be=(e,n,t)=>(kt(e,typeof n!="symbol"?n+"":n,t),t),g=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(g||{}),It=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(It||{});let Bt={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,n){return e.button===n.button?e:{...e,button:n.button}},3(e,n){return e.buttonId===n.buttonId?e:{...e,buttonId:n.buttonId}},4(e,n){return e.panel===n.panel?e:{...e,panel:n.panel}},5(e,n){return e.panelId===n.panelId?e:{...e,panelId:n.panelId}}};class $e extends Le{constructor(n){super(n),Be(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let f=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;f==null||f.focus()},open:()=>this.send({type:0}),setButtonId:t=>this.send({type:3,buttonId:t}),setButton:t=>this.send({type:2,button:t}),setPanelId:t=>this.send({type:5,panelId:t}),setPanel:t=>this.send({type:4,panel:t})}),Be(this,"selectors",{isPortalled:t=>{var f;if(!t.button||!t.panel)return!1;let m=(f=qe(t.button))!=null?f:document;for(let $ of m.querySelectorAll("body > *"))if(Number($==null?void 0:$.contains(t.button))^Number($==null?void 0:$.contains(t.panel)))return!0;let i=Pe(m),r=i.indexOf(t.button),a=(r+i.length-1)%i.length,S=(r+1)%i.length,y=i[a],s=i[S];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,f=Ve.get(null);this.on(0,()=>f.actions.push(t)),this.on(1,()=>f.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new $e({id:n,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(n,t){return Z(t.type,Bt,n,t)}}const Me=l.createContext(null);function de(e){let n=l.useContext(Me);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function _t({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>$e.new({id:e,__demoMode:n}),[]);return We(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function Re(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function Ft(){return l.useContext(pe)}let Tt="div";function jt(e,n){var t;let f=l.useId(),{__demoMode:m=!1,...i}=e,r=_t({id:f,__demoMode:m}),a=l.useRef(null),S=z(n,et(u=>{a.current=u})),[y,s,$,w,B]=U(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),k=tt((t=a.current)!=null?t:s),b=ke(w),p=ke(B),v=l.useMemo(()=>({buttonId:b,panelId:p,close:r.actions.close}),[b,p,r]),x=Re(),c=x==null?void 0:x.registerPopover,_=I(()=>{var u,F;let j=se((u=a.current)!=null?u:s);return(F=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?F:j&&((s==null?void 0:s.contains(j))||($==null?void 0:$.contains(j)))});l.useEffect(()=>c==null?void 0:c(v),[c,v]);let[te,ne]=nt(),L=at(s),R=ot({mainTreeNode:L,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});st(k,"focus",u=>{var F,j,E,H,N,K;u.target!==window&&rt(u.target)&&r.state.popoverState===g.Open&&(_()||r.state.button&&r.state.panel&&(R.contains(u.target)||(j=(F=r.state.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&j.call(F,u.target)||(H=(E=r.state.afterPanelSentinel.current)==null?void 0:E.contains)!=null&&H.call(E,u.target)||(K=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&K.call(N,u.target)||r.actions.close()))},!0);let Y=y===g.Open;lt(Y,R.resolveContainers,(u,F)=>{r.actions.close(),ut(F,it.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===g.Open,close:r.actions.refocusableClose}),oe=U(r,l.useCallback(u=>Z(u.popoverState,{[g.Open]:J.Open,[g.Closed]:J.Closed}),[])),Q={ref:S},X=le();return C.createElement(Ne,{node:L},C.createElement(Ct,null,C.createElement(pe.Provider,{value:null},C.createElement(Me.Provider,{value:r},C.createElement(Ee,{value:r.actions.refocusableClose},C.createElement(ct,{value:oe},C.createElement(ne,null,X({ourProps:Q,theirProps:i,slot:ae,defaultTag:Tt,name:"Popover"}))))))))}let Ot="button";function Et(e,n){let t=l.useId(),{id:f=`headlessui-popover-button-${t}`,disabled:m=!1,autoFocus:i=!1,...r}=e,a=de("Popover.Button"),[S,y,s,$,w,B,k]=U(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),b=l.useRef(null),p=`headlessui-focus-sentinel-${l.useId()}`,v=Re(),x=v==null?void 0:v.closeOthers,c=Ft()!==null;l.useEffect(()=>{if(!c)return a.actions.setButtonId(f),()=>a.actions.setButtonId(null)},[c,f,a]);let[_]=l.useState(()=>Symbol()),te=z(b,n,xt(),I(o=>{if(!c){if(o)a.state.buttons.current.push(_);else{let d=a.state.buttons.current.indexOf(_);d!==-1&&a.state.buttons.current.splice(d,1)}a.state.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),o&&a.actions.setButton(o)}})),ne=z(b,n),L=I(o=>{var d,T,O;if(c){if(a.state.popoverState===g.Closed)return;switch(o.key){case V.Space:case V.Enter:o.preventDefault(),(T=(d=o.target).click)==null||T.call(d),a.actions.close(),(O=a.state.button)==null||O.focus();break}}else switch(o.key){case V.Space:case V.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close();break;case V.Escape:if(a.state.popoverState!==g.Open)return x==null?void 0:x(a.state.buttonId);if(!b.current)return;let D=se(b.current);if(D&&!b.current.contains(D))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),R=I(o=>{c||o.key===V.Space&&o.preventDefault()}),Y=I(o=>{var d,T;_e(o.currentTarget)||m||(c?(a.actions.close(),(d=a.state.button)==null||d.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close(),(T=a.state.button)==null||T.focus()))}),ae=I(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Q}=Ye({autoFocus:i}),{isHovered:X,hoverProps:u}=Qe({isDisabled:m}),{pressed:F,pressProps:j}=Xe({disabled:m}),E=S===g.Open,H=re({open:E,active:F||E,disabled:m,hover:X,focus:oe,autofocus:i}),N=He(e,s),K=c?me({ref:ne,type:N,onKeyDown:L,onClick:Y,disabled:m||void 0,autoFocus:i},Q,u,j):me({ref:te,id:$,type:N,"aria-expanded":S===g.Open,"aria-controls":w?B:void 0,disabled:m||void 0,autoFocus:i,onKeyDown:L,onKeyUp:R,onClick:Y,onMouseDown:ae},Q,u,j),ue=Fe(),fe=I(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function d(){Z(ue.current,{[A.Forwards]:()=>W(o,G.First),[A.Backwards]:()=>W(o,G.Last)})===he.Error&&W(Pe(ge(a.state.button)).filter(T=>T.dataset.headlessuiFocusGuard!=="true"),Z(ue.current,{[A.Forwards]:G.Next,[A.Backwards]:G.Previous}),{relativeTo:a.state.button})}d()}),h=le();return C.createElement(C.Fragment,null,h({ourProps:K,theirProps:r,slot:H,defaultTag:Ot,name:"Popover.Button"}),E&&!c&&y&&C.createElement(ye,{id:p,ref:k,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Nt="div",Mt=ce.RenderStrategy|ce.Static;function De(e,n){let t=l.useId(),{id:f=`headlessui-popover-backdrop-${t}`,transition:m=!1,...i}=e,r=de("Popover.Backdrop"),a=U(r,l.useCallback(v=>v.popoverState,[])),[S,y]=l.useState(null),s=z(n,y),$=Te(),[w,B]=je(m,S,$!==null?($&J.Open)===J.Open:a===g.Open),k=I(v=>{if(_e(v.currentTarget))return v.preventDefault();r.actions.close()}),b=re({open:a===g.Open}),p={ref:s,id:f,"aria-hidden":!0,onClick:k,...Oe(B)};return le()({ourProps:p,theirProps:i,slot:b,defaultTag:Nt,features:Mt,visible:w,name:"Popover.Backdrop"})}let Rt="div",Dt=ce.RenderStrategy|ce.Static;function At(e,n){let t=l.useId(),{id:f=`headlessui-popover-panel-${t}`,focus:m=!1,anchor:i,portal:r=!1,modal:a=!1,transition:S=!1,...y}=e,s=de("Popover.Panel"),$=U(s,s.selectors.isPortalled),[w,B,k,b,p]=U(s,l.useCallback(h=>[h.popoverState,h.button,h.__demoMode,h.beforePanelSentinel,h.afterPanelSentinel],[])),v=`headlessui-focus-sentinel-before-${t}`,x=`headlessui-focus-sentinel-after-${t}`,c=l.useRef(null),_=Pt(i),[te,ne]=gt(_),L=$t();_&&(r=!0);let[R,Y]=l.useState(null),ae=z(c,n,_?te:null,s.actions.setPanel,Y),oe=we(B),Q=we(c.current);Ke(()=>(s.actions.setPanelId(f),()=>s.actions.setPanelId(null)),[f,s]);let X=Te(),[u,F]=je(S,R,X!==null?(X&J.Open)===J.Open:w===g.Open);Ze(u,B,s.actions.close),Ue(k?!1:a&&u,Q);let j=I(h=>{var o;switch(h.key){case V.Escape:if(s.state.popoverState!==g.Open||!c.current)return;let d=se(c.current);if(d&&!c.current.contains(d))return;h.preventDefault(),h.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var h;e.static||w===g.Closed&&((h=e.unmount)==null||h)&&s.actions.setPanel(null)},[w,e.unmount,e.static,s]),l.useEffect(()=>{if(k||!m||w!==g.Open||!c.current)return;let h=se(c.current);c.current.contains(h)||W(c.current,G.First)},[k,m,c.current,w]);let E=re({open:w===g.Open,close:s.actions.refocusableClose}),H=me(_?L():{},{ref:ae,id:f,onKeyDown:j,onBlur:m&&w===g.Open?h=>{var o,d,T,O,D;let q=h.relatedTarget;q&&c.current&&((o=c.current)!=null&&o.contains(q)||(s.actions.close(),((T=(d=b.current)==null?void 0:d.contains)!=null&&T.call(d,q)||(D=(O=p.current)==null?void 0:O.contains)!=null&&D.call(O,q))&&q.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":St(u,B,!0).width},...Oe(F)}),N=Fe(),K=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;W(h,G.First)===he.Error&&((d=s.state.afterPanelSentinel.current)==null||d.focus())},[A.Backwards]:()=>{var d;(d=s.state.button)==null||d.focus({preventScroll:!0})}})}o()}),ue=I(()=>{let h=c.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;if(!s.state.button)return;let T=(d=ge(s.state.button))!=null?d:document.body,O=Pe(T),D=O.indexOf(s.state.button),q=O.slice(0,D+1),ie=[...O.slice(D+1),...q];for(let be of ie.slice())if(be.dataset.headlessuiFocusGuard==="true"||R!=null&&R.contains(be)){let Ce=ie.indexOf(be);Ce!==-1&&ie.splice(Ce,1)}W(ie,G.First,{sorted:!1})},[A.Backwards]:()=>{var d;W(h,G.Previous)===he.Error&&((d=s.state.button)==null||d.focus())}})}o()}),fe=le();return C.createElement(ze,null,C.createElement(pe.Provider,{value:f},C.createElement(Ee,{value:s.actions.refocusableClose},C.createElement(Je,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&$&&C.createElement(ye,{id:v,ref:b,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:K}),fe({ourProps:H,theirProps:y,slot:E,defaultTag:Rt,features:Dt,visible:u,name:"Popover.Panel"}),u&&$&&C.createElement(ye,{id:x,ref:p,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Gt="div";function Lt(e,n){let t=l.useRef(null),f=z(t,n),[m,i]=l.useState([]),r=I(b=>{i(p=>{let v=p.indexOf(b);if(v!==-1){let x=p.slice();return x.splice(v,1),x}return p})}),a=I(b=>(i(p=>[...p,b]),()=>r(b))),S=I(()=>{var b;let p=ge(t.current);if(!p)return!1;let v=se(t.current);return(b=t.current)!=null&&b.contains(v)?!0:m.some(x=>{var c,_;return((c=p.getElementById(x.buttonId.current))==null?void 0:c.contains(v))||((_=p.getElementById(x.panelId.current))==null?void 0:_.contains(v))})}),y=I(b=>{for(let p of m)p.buttonId.current!==b&&p.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:S,closeOthers:y}),[a,r,S,y]),$=re({}),w=e,B={ref:f},k=le();return C.createElement(Ne,null,C.createElement(Se.Provider,{value:s},k({ourProps:B,theirProps:w,slot:$,defaultTag:Gt,name:"Popover.Group"})))}let qt=ee(jt),Ae=ee(Et),Vt=ee(De),Wt=ee(De),Ge=ee(At),Yt=ee(Lt),Qt=Object.assign(qt,{Button:Ae,Backdrop:Wt,Overlay:Vt,Panel:Ge,Group:Yt});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PacketList-DyZLMo3F.js b/frontend/dist/assets/PacketList-CO1EDTYK.js similarity index 98% rename from frontend/dist/assets/PacketList-DyZLMo3F.js rename to frontend/dist/assets/PacketList-CO1EDTYK.js index 0a7e1eeb..d2addf90 100644 --- a/frontend/dist/assets/PacketList-DyZLMo3F.js +++ b/frontend/dist/assets/PacketList-CO1EDTYK.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-Cu9lMTiD.js","assets/index-DZK2INMD.js","assets/BasemapLayer-DFBOwIT2.js","assets/useMapViewStore-DGeq1iXE.js","assets/index-C-Mp31KV.js","assets/index-BSz_JZ6w.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); -import{d as je,bL as ns,bM as Pt,p as rs,k as ls,j as e,c as R,B as nt,q as is,r as h,$ as rt,R as M,bN as Mt,bO as Bt,bP as Lt,a8 as de,bQ as Rt,bR as Ht,bS as Ft,bT as he,bU as Xe,am as Ee,_ as cs,bV as os,bW as ds,bX as xs,bY as ms,bZ as hs,b_ as us,m as oe,av as re,a1 as ps,Y as fs,b$ as gs,c0 as le,c1 as ht,c2 as ys,c3 as js,c4 as bs,c5 as Ns,c6 as vs,c7 as ws,c8 as Ze,c9 as ks,ar as Cs,a4 as Dt,ca as _s,cb as Ss,cc as Ts,cd as Ps,aA as At,aB as Et,A as qe,ce as Ms,aC as Bs,cf as Ls,cg as lt}from"./index-DZK2INMD.js";import{C as Rs,u as Hs}from"./chevron-up-Bm8_AtG8.js";import{p as Fs,d as Ds,e as It,g as As,b as Es}from"./primitives-NoSyYVE-.js";import{u as Is,r as zs,a as $s,b as Us,c as Os,d as Vs,i as Gs}from"./consumer-registry-C58OO1Zb.js";import{D as Pe,R as Ie,P as Me,g as Qs}from"./badge-colors-BNUqIXCA.js";import{g as zt,e as Se,a as $t}from"./chat-utils-B9fA4l9w.js";import{S as ze,i as $e,a as Ws,g as ut}from"./SignalIndicator-BlRL2nuG.js";import{a as qs,A as Ut}from"./arrow-up-DJJcQ7dG.js";import{A as ue}from"./arrow-right-BW1lsEoU.js";import{C as it}from"./chevron-right-DYHNTpxG.js";import{M as Ue}from"./map-pin-qwXb-K8z.js";import{C as Ks}from"./circle-question-mark-BdE_X9p5.js";import{T as Je}from"./triangle-alert-z32LI9zM.js";import{D as X}from"./DataBox-BEDP2Kxh.js";import{L as Ys}from"./layers-Bh2LK6a1.js";import{H as Ot}from"./hash-Bx-gtxz0.js";import{C as xe}from"./clock-CZYZYW0y.js";import{A as Xs}from"./activity-F7Po-3Al.js";import{C as Zs}from"./circle-check-DiKh03Ex.js";import{D as Js}from"./database-DWx780B3.js";import{H as ea,D as et,u as ta}from"./useMapViewStore-DGeq1iXE.js";import{S as ke}from"./shield-tOGn5YjL.js";import{C as Vt}from"./MqttModeBadge-CK543WcH.js";import{Z as pt}from"./zap-CV3qJZPu.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-63u_fpZD.js","assets/index-B9Nfzawy.js","assets/BasemapLayer--gGy0d8r.js","assets/useMapViewStore-CAlaFCdd.js","assets/index-CHkxpv0k.js","assets/index-BSz_JZ6w.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); +import{d as je,bL as ns,bM as Pt,p as rs,k as ls,j as e,c as R,B as nt,q as is,r as h,$ as rt,R as M,bN as Mt,bO as Bt,bP as Lt,a8 as de,bQ as Rt,bR as Ht,bS as Ft,bT as he,bU as Xe,am as Ee,_ as cs,bV as os,bW as ds,bX as xs,bY as ms,bZ as hs,b_ as us,m as oe,av as re,a1 as ps,Y as fs,b$ as gs,c0 as le,c1 as ht,c2 as ys,c3 as js,c4 as bs,c5 as Ns,c6 as vs,c7 as ws,c8 as Ze,c9 as ks,ar as Cs,a4 as Dt,ca as _s,cb as Ss,cc as Ts,cd as Ps,aA as At,aB as Et,A as qe,ce as Ms,aC as Bs,cf as Ls,cg as lt}from"./index-B9Nfzawy.js";import{C as Rs,u as Hs}from"./chevron-up-DvNDOaHb.js";import{p as Fs,d as Ds,e as It,g as As,b as Es}from"./primitives-DkuSh1mR.js";import{u as Is,r as zs,a as $s,b as Us,c as Os,d as Vs,i as Gs}from"./consumer-registry-B_rYsmHo.js";import{D as Pe,R as Ie,P as Me,g as Qs}from"./badge-colors-BNUqIXCA.js";import{g as zt,e as Se,a as $t}from"./chat-utils-CXtTpLY5.js";import{S as ze,i as $e,a as Ws,g as ut}from"./SignalIndicator-BAKXIHs1.js";import{a as qs,A as Ut}from"./arrow-up-1am5_GF2.js";import{A as ue}from"./arrow-right-BbRfzTpf.js";import{C as it}from"./chevron-right-jwX-OOTu.js";import{M as Ue}from"./map-pin-Z2xK57U6.js";import{C as Ks}from"./circle-question-mark-Br2ku42v.js";import{T as Je}from"./triangle-alert-_KPqiYkd.js";import{D as X}from"./DataBox-CCBd3sT4.js";import{L as Ys}from"./layers-DHyjQOGN.js";import{H as Ot}from"./hash-fRZDKNyT.js";import{C as xe}from"./clock-CCOO2GB9.js";import{A as Xs}from"./activity-CcUqK62Y.js";import{C as Zs}from"./circle-check-m0ROsc83.js";import{D as Js}from"./database-CSUiI1CG.js";import{H as ea,D as et,u as ta}from"./useMapViewStore-CAlaFCdd.js";import{S as ke}from"./shield-5eYUHkwt.js";import{C as Vt}from"./MqttModeBadge-Bgn-nTpu.js";import{Z as pt}from"./zap-DME89Nfc.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -39,7 +39,7 @@ import{d as je,bL as ns,bM as Pt,p as rs,k as ls,j as e,c as R,B as nt,q as is,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ma=[["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=je("user",ma);function ha(t){t.values.forEach(a=>a.stop())}function tt(t,a){[...a].reverse().forEach(n=>{const r=t.getVariant(n);r&&Pt(t,r),t.variantChildren&&t.variantChildren.forEach(i=>{tt(i,a)})})}function ua(t,a){if(Array.isArray(a))return tt(t,a);if(typeof a=="string")return tt(t,[a]);Pt(t,a)}function pa(){const t=new Set,a={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,n){const r=[];return t.forEach(i=>{r.push(ns(i,s,{transitionOverride:n}))}),Promise.all(r)},set(s){return t.forEach(n=>{ua(n,s)})},stop(){t.forEach(s=>{ha(s)})},mount(){return()=>{a.stop()}}};return a}function fa(){const t=rs(pa);return ls(t.mount,[]),t}function ga({"aria-label":t="Page navigation",className:a,...s}){return e.jsx("nav",{"aria-label":t,...s,className:R("flex gap-x-2",a)})}function ya({onClick:t,disabled:a=!1,className:s,children:n="Previous"}){return e.jsx("span",{className:R("grow basis-0",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Previous page",className:R("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 ja({onClick:t,disabled:a=!1,className:s,children:n="Next"}){return e.jsx("span",{className:R("flex grow basis-0 justify-end",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Next page",className:R("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 ba({className:t,...a}){return e.jsx("span",{...a,className:R("hidden items-baseline gap-x-2 sm:flex",t)})}function Na({page:t,current:a=!1,onClick:s,className:n,children:r}){return e.jsx(nt,{plain:!a,outline:a,onClick:()=>s==null?void 0:s(t),"aria-label":`Page ${t}`,"aria-current":a?"page":void 0,className:R("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:r??t})}function va({className:t,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:R("w-[2.25rem] select-none text-center text-sm text-fg-muted",t),children:"…"})}function wa(t,a,s=1){if(a<=7)return Array.from({length:a},(m,g)=>g+1);const n=Math.max(t-s,1),r=Math.min(t+s,a),i=n>2,l=ry+1),"gap",a]}if(i&&!l){const m=3+2*s;return[1,"gap",...Array.from({length:m},(u,y)=>a-m+y+1)]}return[1,"gap",...Array.from({length:r-n+1},(m,g)=>n+g),"gap",a]}const hr=is(t=>({requestedHash:null,requestChannel:a=>t({requestedHash:a}),clearRequest:()=>t({requestedHash:null})}));function ka(t){if(t.length===0)return[];const a=[];let s=0;for(;s{const l=i===t.length-1,o=n&&r.toUpperCase()===n;return e.jsxs("span",{className:"flex items-center flex-shrink-0",children:[o?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:r.toUpperCase()}),!l&&e.jsx(it,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${r}-${i}`)})})}const Wt=h.memo(Pa);function qt({channelName:t,onClick:a,active:s,compact:n,className:r}){const i=t.startsWith("#")?t:`#${t}`,l=R("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",s?"bg-sys-blue/20 text-sys-blue":"bg-sys-blue/10 text-sys-blue",a&&!s&&"hover:bg-sys-blue/20 cursor-pointer",r);return a?e.jsx("button",{type:"button",onClick:a,className:l,children:i}):e.jsx("span",{className:l,children:i})}function Kt({packet:t}){return t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("teal"),children:"HTTP"}):t._mqttSource&&!t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("purple"),children:"MQTT"}):null}function ye(t){return{"--data-box-accent":he[t]}}function Yt(t){const a=t.payload_type_name||Ht(t.payload_type??t.type),s=t.route_type_name||Ft(t.route_type??t.route),n=Me[a]??"zinc",r=Ie[s]??"zinc";return{payloadType:a,routeType:s,payloadColor:n,routeColor:r}}function Oe(t){if(!t)return[];if(Array.isArray(t))return t;try{const a=JSON.parse(t);return Array.isArray(a)?a:[]}catch{return[]}}function Xt(t,a){if(a){const s=a(t);return{name:s.name,isCompanion:s.isCompanion,isRepeater:s.isRepeater}}return{name:null,isCompanion:!1,isRepeater:!1}}function Ma({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,onTraceHover:o,traceTag:m,onViewTraceReport:g,dupeGroupPosition:u,isDupeGroupHovered:y=!1,onDupeGroupHover:w,dupeCount:j,getDecodedContent:x,onChannelClick:k}){const B=j?!1:Mt(t.is_duplicate),d=u!==void 0,{payloadType:b,routeType:f,payloadColor:_,routeColor:v}=Yt(t),p=t.packet_origin==="tx_local",E=b==="TRACE",O=Oe(t.original_path),G=Oe(t.forwarded_path),K=G.length>0?G:O,D=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:Y,isRepeater:I}=Xt(t,r);let H=null,$=null,U=null,J=null;if(b==="GRP_TXT"&&x){const S=x(t);S!=null&&S.decrypted&&($=S.senderName,U=S.channelName,J=S.channelHash,S.text&&(H=S.text))}else if(b==="TXT_MSG"&&t.raw_packet)try{const S=Bt.fromHex(t.raw_packet);if(S.success&&S.packet){const ce=Lt(S.packet.payload);ce&&!ce.encrypted&&(H=ce.text)}}catch{}const T=$||(I?null:Y),z=!!T,te=!z&&I&&!!Y,se=!z&&!te&&b==="GRP_TXT"&&!H,c=t.payload_length??t.length??0;t.lbt_attempts;const Z=h.useCallback(()=>{E&&m&&g?g(m):a(t)},[E,m,g,a,t]),q=h.useCallback(()=>{E&&m&&o&&o(m),d&&w&&t.packet_hash&&w(t.packet_hash)},[E,m,o,d,w,t.packet_hash]),ie=h.useCallback(()=>{o&&o(null),w&&w(null)},[o,w]),P=he[_]||he.zinc,F=y,ae=()=>{const S={pointerEvents:"none"};return u==="first"?{...S,borderTop:`2px solid ${P}`,borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:u==="middle"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:u==="last"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:`2px solid ${P}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...S,border:`2px solid ${P}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:Z,onMouseEnter:q,onMouseLeave:ie,className:R("group relative cursor-pointer","hover:bg-subtle-fill",B&&!y&&"opacity-40",i&&"flash-row",p&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:R("absolute pointer-events-none transition-opacity duration-75",d?F?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:ae()}),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:z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(Se(T).cleanName)},children:Se(T).emoji?e.jsx("span",{className:"text-base leading-none",children:Se(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(T)})}):te?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):se?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(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:T}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):te?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:Y}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:D||"—"}),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:ye(_),children:b}),p&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("indigo"),children:"LOCAL"}),e.jsx(Kt,{packet:t}),j&&j>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",j]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye(v),children:f}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[c,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:H||U?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[U&&e.jsx(qt,{channelName:U,compact:!0,onClick:k&&J?S=>{S.stopPropagation(),k(J)}:void 0}),H&&e.jsx("span",{className:"italic truncate",children:H})]}):e.jsx(Wt,{path:K,localHash:s})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"data-box data-box-compact",children:Rt(t.timestamp)}),e.jsx(ze,{rssi:t.rssi,snr:t.snr,compact:!0,showValues:!0,validated:$e(t)})]})]})]})}function Ba({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,traceTag:o,onViewTraceReport:m,dupeGroupPosition:g,isDupeGroupHovered:u=!1,onDupeGroupHover:y,dupeCount:w,getDecodedContent:j,onChannelClick:x}){const{payloadType:k,routeType:B,payloadColor:d,routeColor:b}=Yt(t),f=t.packet_origin==="tx_local",_=k==="TRACE",v=w?!1:Mt(t.is_duplicate),p=Oe(t.original_path),E=Oe(t.forwarded_path),O=E.length>0?E:p,G=t._hopCount??O.length,K=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:D,isRepeater:Y}=Xt(t,r);let I=null,H=null,$=null,U=null;if(k==="GRP_TXT"&&j){const P=j(t);P!=null&&P.decrypted&&(H=P.senderName,$=P.channelName,U=P.channelHash,P.text&&(I=P.text))}else if(k==="TXT_MSG"&&t.raw_packet)try{const P=Bt.fromHex(t.raw_packet);if(P.success&&P.packet){const F=Lt(P.packet.payload);F&&!F.encrypted&&(I=F.text)}}catch{}const J=H||(Y?null:D),T=!!J,z=!T&&Y&&!!D,te=!T&&!z&&k==="GRP_TXT"&&!I,se=t.payload_length??t.length??0,c=t.lbt_attempts??0,Z=()=>{_&&o&&m?m(o):a(t)},q=he[d]||he.zinc,ie=()=>{if(!g)return{opacity:0};const P=u?1:.4,F=u?"3px":"2px";return g==="first"?{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:g==="middle"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:0,borderRadius:0}:g==="last"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:Z,className:R("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",v&&"opacity-40",i&&"flash-row",f&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:"absolute left-0 transition-all",style:ie()}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"relative flex-shrink-0 mt-0.5",children:T?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(Se(J).cleanName)},children:Se(J).emoji?e.jsx("span",{className:"text-base leading-none",children:Se(J).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(J)})}):z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):te?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(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[T?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:J}):z?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:D}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:K||"—"}),D&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:D})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye(d),children:k}),f&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("indigo"),children:"LOCAL"}),e.jsx(Kt,{packet:t}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye(b),children:B}),w&&w>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",w]}),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:t.rssi}),e.jsx(ze,{rssi:t.rssi,compact:!0,showValues:!1,validated:$e(t)})]})]}),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:Rt(t.timestamp)}),se>0&&e.jsxs("span",{children:[se,"B"]}),c>0&&e.jsxs("span",{className:c>1?"text-sys-amber/60":void 0,children:["LBT:",c]}),t.snr!=null&&e.jsxs("span",{children:[t.snr.toFixed(0),"dB"]}),I||$?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[$&&e.jsx(qt,{channelName:$,compact:!0,onClick:x&&U?P=>{P.stopPropagation(),x(U)}:void 0}),I&&e.jsx("span",{className:"italic truncate",children:I})]}):G>0?e.jsx(Wt,{path:O,localHash:s}):null]})]})]})]})}const La=h.memo(Ma),Ra=h.memo(Ba);function Ha(t,a,s,n,r=!1){const i=t.toUpperCase(),l=[],o=s&&Xe(i,s);o&&l.push(s);for(const j of Object.keys(a))Xe(i,j)&&l.push(j);if(r&&o&&s&&l.length===1)return{matches:l,probability:1,bestMatch:s};if(r&&o&&l.length>1){const j=l.filter(x=>x!==s);if(j.length===1)return{matches:l,probability:1,bestMatch:j[0]}}const m=l.length>0?1/l.length:0,g=[...l].sort();let u=null,y=-1;if(g.length===1)u=g[0];else if(g.length>1&&n){for(const j of g){const x=n.get(j),k=x?typeof x=="number"?x:x.combinedScore:0;k>y&&(y=k,u=j)}u||(u=g[0])}else g.length>0&&(u=g[0]);let w=m;if(l.length>1&&n&&y>0){let j=0;for(const x of l){const k=n.get(x);j+=k?typeof k=="number"?k:k.combinedScore:0}j>0&&(w=Math.min(.95,y/j))}return{matches:l,probability:w,bestMatch:u}}function Fa(t,a,s,n){const i=(s-t)*Math.PI/180,l=(n-a)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 6371e3*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function Da(t){return t<100?1:t<500?.9:t<1e3?.7:t<5e3?.5:t<1e4?.3:.1}const Aa=h.lazy(()=>cs(()=>import("./PathMapMapLibre-Cu9lMTiD.js"),__vite__mapDeps([0,1,2,3,4,5,6])));function Ea(t,a,s,n,r=!1,i,l,o){const m=os(a);let g;l&&(g=ds(l,t,{position:o,isLastHop:r}).confidence);const{matches:u,probability:y}=Ha(t,m,n,i,r),w=u.length,j=[],x=t.toUpperCase(),k=s&&s.latitude!==void 0&&s.longitude!==void 0&&(s.latitude!==0||s.longitude!==0);for(const d of u){if(n&&Xe(x,n)&&d===n&&k&&s){j.push({hash:d,name:s.name||"Local Node",latitude:s.latitude,longitude:s.longitude,probability:r?1:y,isLocal:!0});continue}const b=m[d];b!=null&&b.latitude&&(b!=null&&b.longitude)&&!(b.latitude===0&&b.longitude===0)&&j.push({hash:d,name:b.node_name||b.name||"Unknown",latitude:b.latitude,longitude:b.longitude,probability:y,isLocal:!1,isDirectNeighbor:b.zero_hop===!0})}const B=j.length;if(B===1)j[0].probability=g??1;else if(B>1)if(g!==void 0&&g>0){const d=j[0];d.probability=g;const b=1-g,f=B-1;j.slice(1).forEach(_=>{_.probability=b/f})}else{let d=0;const b=j.map(f=>{if(f.isLocal)return{candidate:f,score:1};const _=i==null?void 0:i.get(f.hash);let v=.5;if(k&&s){const E=Fa(s.latitude,s.longitude,f.latitude,f.longitude);v=Da(E)}let p;return _?p=v*.3+_.hopConsistencyScore*.3+_.frequencyScore*.4:(p=v,f.isDirectNeighbor&&(p=Math.max(p,.8))),d+=p,{candidate:f,score:p}});if(d>0)b.forEach(({candidate:f,score:_})=>{f.probability=Math.min(.95,_/d)});else{const f=1/B;j.forEach(_=>_.probability=f)}}return{candidates:j,totalMatches:w}}function Ia(t,a,s,n,r,i){if(!t||t.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const l=t.length-1,o=t.map((u,y)=>{const w=y===l,j=t.length-y,{candidates:x,totalMatches:k}=Ea(u,a,s,n,w,r,i,j),B=x.length>0?Math.max(...x.map(d=>d.probability)):0;return{prefix:u,candidates:x,confidence:B,totalMatches:k}}),m=o.reduce((u,y)=>y.confidence===0?0:u*y.confidence,1),g=o.some(u=>u.candidates.length>0);return{hops:o,overallConfidence:m,hasValidPath:g}}function za(t){return`${(t*100).toFixed(0)}%`}function $a(t){return t>=1?"text-sys-green":t>=.5?"text-sys-indigo":t>=.25?"text-signal-poor":t>0?"text-sys-red":"text-fg-muted"}function Ua(t,a,s){let n;return a===0?n=s.muted:t>=1?n=s.success:t>=.5?n=s.secondary:t>=.25?n=s.poor:t>0?n=s.danger:n=s.muted,{color:n}}class Oa extends h.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 Ve({path:t,neighbors:a,localNode:s,localHash:n,srcHash:r,dstHash:i,neighborAffinity:l,prefixLookup:o,hubNodes:m,traceSnr:g,advertiserSource:u}){const[y,w]=h.useState(null),j=h.useMemo(()=>{if(!u)return null;const f=u.nodeType==="wardrive";return{prefix:u.prefix||"??",candidates:[{hash:u.publicKey||u.prefix||"source",name:u.name,latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isWardrive:f}],confidence:1,totalMatches:1,isSource:!0}},[u]),x=h.useMemo(()=>{if(u||!r)return null;const f=Ee(r),_=a[r];if((_==null?void 0:_.latitude)&&(_==null?void 0:_.longitude)&&!(_.latitude===0&&_.longitude===0))return{prefix:f,candidates:[{hash:r,name:_.node_name||_.name||"Source",latitude:_.latitude,longitude:_.longitude,probability:1,isLocal:!1,isDirectNeighbor:_.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const p=(_==null?void 0:_.node_name)||(_==null?void 0:_.name)||r.slice(0,8);return{prefix:f,candidates:[{hash:r,name:p,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[u,r,a]),k=h.useMemo(()=>{const f=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!f||f==="00"||f==="0000000000000000")&&s&&n){const G=Ee(n),K=s.latitude!==0||s.longitude!==0;return{prefix:G,candidates:[{hash:n,name:s.name||"Local Node",latitude:K?s.latitude:0,longitude:K?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const v=Ee(i);if(n&&i===n&&s){const G=s.latitude!==0||s.longitude!==0;return{prefix:v,candidates:[{hash:i,name:s.name||"Local Node",latitude:G?s.latitude:0,longitude:G?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const p=a[i];if((p==null?void 0:p.latitude)&&(p==null?void 0:p.longitude)&&!(p.latitude===0&&p.longitude===0))return{prefix:v,candidates:[{hash:i,name:p.node_name||p.name||"Destination",latitude:p.latitude,longitude:p.longitude,probability:1,isLocal:!1,isDirectNeighbor:p.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const O=(p==null?void 0:p.node_name)||(p==null?void 0:p.name)||i.slice(0,8);return{prefix:v,candidates:[{hash:i,name:O,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,a,s,n]),B=h.useMemo(()=>Ia(t,a,s,n,l,o),[t,a,s,n,l,o]),d=h.useMemo(()=>{const f=[];j?f.push(j):x&&f.push(x),f.push(...B.hops),k&&f.push(k);const _=f.reduce((p,E)=>E.confidence===0?0:p*E.confidence,1),v=f.some(p=>p.candidates.some(E=>E.latitude!==0||E.longitude!==0));return{hops:f,overallConfidence:_,hasValidPath:v}},[j,x,B,k]),b=h.useMemo(()=>{const f=getComputedStyle(document.documentElement);return{success:f.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:f.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:f.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:f.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:f.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return 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:$a(d.overallConfidence),children:za(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(Ks,{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(Oa,{children:e.jsx(h.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(Aa,{resolvedPath:d,localNode:s,hubNodes:m,hoveredHopIndex:y,onHoverHop:w,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:d.hops.map((f,_)=>{var G,K,D;const v=f.isSource===!0,p=f.isDestination===!0,E=y===_;let O;return v?O=`Source: ${((G=f.candidates[0])==null?void 0:G.name)||"Unknown"}`:p?O=`Destination: ${((K=f.candidates[0])==null?void 0:K.name)||"Unknown"}`:f.totalMatches===0?O="No matching nodes found":f.totalMatches===1?O=`Exact match: ${((D=f.candidates[0])==null?void 0:D.name)||"Unknown"}`:O=`${f.totalMatches} possible matches (${(f.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:R("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",E?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",v&&"border border-sys-green/30",p&&"border border-sys-blue/30"),title:O,onMouseEnter:()=>w(_),onMouseLeave:()=>w(null),children:[v&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),p&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:Ua(f.confidence,f.totalMatches,b),children:f.prefix}),!v&&!p&&f.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",f.totalMatches]}),!v&&!p&&f.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},_)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const Ke=16;function Ge(t){return t.match(/.{1,2}/g)||[]}function be(t){return t!==null&&t.startsWith("payload:")}const Te={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` + */const ma=[["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=je("user",ma);function ha(t){t.values.forEach(a=>a.stop())}function tt(t,a){[...a].reverse().forEach(n=>{const r=t.getVariant(n);r&&Pt(t,r),t.variantChildren&&t.variantChildren.forEach(i=>{tt(i,a)})})}function ua(t,a){if(Array.isArray(a))return tt(t,a);if(typeof a=="string")return tt(t,[a]);Pt(t,a)}function pa(){const t=new Set,a={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,n){const r=[];return t.forEach(i=>{r.push(ns(i,s,{transitionOverride:n}))}),Promise.all(r)},set(s){return t.forEach(n=>{ua(n,s)})},stop(){t.forEach(s=>{ha(s)})},mount(){return()=>{a.stop()}}};return a}function fa(){const t=rs(pa);return ls(t.mount,[]),t}function ga({"aria-label":t="Page navigation",className:a,...s}){return e.jsx("nav",{"aria-label":t,...s,className:R("flex gap-x-2",a)})}function ya({onClick:t,disabled:a=!1,className:s,children:n="Previous"}){return e.jsx("span",{className:R("grow basis-0",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Previous page",className:R("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 ja({onClick:t,disabled:a=!1,className:s,children:n="Next"}){return e.jsx("span",{className:R("flex grow basis-0 justify-end",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Next page",className:R("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 ba({className:t,...a}){return e.jsx("span",{...a,className:R("hidden items-baseline gap-x-2 sm:flex",t)})}function Na({page:t,current:a=!1,onClick:s,className:n,children:r}){return e.jsx(nt,{plain:!a,outline:a,onClick:()=>s==null?void 0:s(t),"aria-label":`Page ${t}`,"aria-current":a?"page":void 0,className:R("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:r??t})}function va({className:t,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:R("w-[2.25rem] select-none text-center text-sm text-fg-muted",t),children:"…"})}function wa(t,a,s=1){if(a<=7)return Array.from({length:a},(m,g)=>g+1);const n=Math.max(t-s,1),r=Math.min(t+s,a),i=n>2,l=ry+1),"gap",a]}if(i&&!l){const m=3+2*s;return[1,"gap",...Array.from({length:m},(u,y)=>a-m+y+1)]}return[1,"gap",...Array.from({length:r-n+1},(m,g)=>n+g),"gap",a]}const hr=is(t=>({requestedHash:null,requestChannel:a=>t({requestedHash:a}),clearRequest:()=>t({requestedHash:null})}));function ka(t){if(t.length===0)return[];const a=[];let s=0;for(;s{const l=i===t.length-1,o=n&&r.toUpperCase()===n;return e.jsxs("span",{className:"flex items-center flex-shrink-0",children:[o?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:r.toUpperCase()}),!l&&e.jsx(it,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${r}-${i}`)})})}const Wt=h.memo(Pa);function qt({channelName:t,onClick:a,active:s,compact:n,className:r}){const i=t.startsWith("#")?t:`#${t}`,l=R("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",s?"bg-sys-blue/20 text-sys-blue":"bg-sys-blue/10 text-sys-blue",a&&!s&&"hover:bg-sys-blue/20 cursor-pointer",r);return a?e.jsx("button",{type:"button",onClick:a,className:l,children:i}):e.jsx("span",{className:l,children:i})}function Kt({packet:t}){return t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("teal"),children:"HTTP"}):t._mqttSource&&!t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("purple"),children:"MQTT"}):null}function ye(t){return{"--data-box-accent":he[t]}}function Yt(t){const a=t.payload_type_name||Ht(t.payload_type??t.type),s=t.route_type_name||Ft(t.route_type??t.route),n=Me[a]??"zinc",r=Ie[s]??"zinc";return{payloadType:a,routeType:s,payloadColor:n,routeColor:r}}function Oe(t){if(!t)return[];if(Array.isArray(t))return t;try{const a=JSON.parse(t);return Array.isArray(a)?a:[]}catch{return[]}}function Xt(t,a){if(a){const s=a(t);return{name:s.name,isCompanion:s.isCompanion,isRepeater:s.isRepeater}}return{name:null,isCompanion:!1,isRepeater:!1}}function Ma({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,onTraceHover:o,traceTag:m,onViewTraceReport:g,dupeGroupPosition:u,isDupeGroupHovered:y=!1,onDupeGroupHover:w,dupeCount:j,getDecodedContent:x,onChannelClick:k}){const B=j?!1:Mt(t.is_duplicate),d=u!==void 0,{payloadType:b,routeType:f,payloadColor:_,routeColor:v}=Yt(t),p=t.packet_origin==="tx_local",E=b==="TRACE",O=Oe(t.original_path),G=Oe(t.forwarded_path),K=G.length>0?G:O,D=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:Y,isRepeater:I}=Xt(t,r);let H=null,$=null,U=null,J=null;if(b==="GRP_TXT"&&x){const S=x(t);S!=null&&S.decrypted&&($=S.senderName,U=S.channelName,J=S.channelHash,S.text&&(H=S.text))}else if(b==="TXT_MSG"&&t.raw_packet)try{const S=Bt.fromHex(t.raw_packet);if(S.success&&S.packet){const ce=Lt(S.packet.payload);ce&&!ce.encrypted&&(H=ce.text)}}catch{}const T=$||(I?null:Y),z=!!T,te=!z&&I&&!!Y,se=!z&&!te&&b==="GRP_TXT"&&!H,c=t.payload_length??t.length??0;t.lbt_attempts;const Z=h.useCallback(()=>{E&&m&&g?g(m):a(t)},[E,m,g,a,t]),q=h.useCallback(()=>{E&&m&&o&&o(m),d&&w&&t.packet_hash&&w(t.packet_hash)},[E,m,o,d,w,t.packet_hash]),ie=h.useCallback(()=>{o&&o(null),w&&w(null)},[o,w]),P=he[_]||he.zinc,F=y,ae=()=>{const S={pointerEvents:"none"};return u==="first"?{...S,borderTop:`2px solid ${P}`,borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:u==="middle"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:u==="last"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:`2px solid ${P}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...S,border:`2px solid ${P}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:Z,onMouseEnter:q,onMouseLeave:ie,className:R("group relative cursor-pointer","hover:bg-subtle-fill",B&&!y&&"opacity-40",i&&"flash-row",p&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:R("absolute pointer-events-none transition-opacity duration-75",d?F?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:ae()}),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:z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(Se(T).cleanName)},children:Se(T).emoji?e.jsx("span",{className:"text-base leading-none",children:Se(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(T)})}):te?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):se?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(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:T}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):te?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:Y}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:D||"—"}),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:ye(_),children:b}),p&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("indigo"),children:"LOCAL"}),e.jsx(Kt,{packet:t}),j&&j>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",j]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye(v),children:f}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[c,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:H||U?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[U&&e.jsx(qt,{channelName:U,compact:!0,onClick:k&&J?S=>{S.stopPropagation(),k(J)}:void 0}),H&&e.jsx("span",{className:"italic truncate",children:H})]}):e.jsx(Wt,{path:K,localHash:s})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"data-box data-box-compact",children:Rt(t.timestamp)}),e.jsx(ze,{rssi:t.rssi,snr:t.snr,compact:!0,showValues:!0,validated:$e(t)})]})]})]})}function Ba({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,traceTag:o,onViewTraceReport:m,dupeGroupPosition:g,isDupeGroupHovered:u=!1,onDupeGroupHover:y,dupeCount:w,getDecodedContent:j,onChannelClick:x}){const{payloadType:k,routeType:B,payloadColor:d,routeColor:b}=Yt(t),f=t.packet_origin==="tx_local",_=k==="TRACE",v=w?!1:Mt(t.is_duplicate),p=Oe(t.original_path),E=Oe(t.forwarded_path),O=E.length>0?E:p,G=t._hopCount??O.length,K=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:D,isRepeater:Y}=Xt(t,r);let I=null,H=null,$=null,U=null;if(k==="GRP_TXT"&&j){const P=j(t);P!=null&&P.decrypted&&(H=P.senderName,$=P.channelName,U=P.channelHash,P.text&&(I=P.text))}else if(k==="TXT_MSG"&&t.raw_packet)try{const P=Bt.fromHex(t.raw_packet);if(P.success&&P.packet){const F=Lt(P.packet.payload);F&&!F.encrypted&&(I=F.text)}}catch{}const J=H||(Y?null:D),T=!!J,z=!T&&Y&&!!D,te=!T&&!z&&k==="GRP_TXT"&&!I,se=t.payload_length??t.length??0,c=t.lbt_attempts??0,Z=()=>{_&&o&&m?m(o):a(t)},q=he[d]||he.zinc,ie=()=>{if(!g)return{opacity:0};const P=u?1:.4,F=u?"3px":"2px";return g==="first"?{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:g==="middle"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:0,borderRadius:0}:g==="last"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:Z,className:R("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",v&&"opacity-40",i&&"flash-row",f&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:"absolute left-0 transition-all",style:ie()}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"relative flex-shrink-0 mt-0.5",children:T?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(Se(J).cleanName)},children:Se(J).emoji?e.jsx("span",{className:"text-base leading-none",children:Se(J).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(J)})}):z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):te?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(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[T?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:J}):z?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:D}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:K||"—"}),D&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:D})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye(d),children:k}),f&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye("indigo"),children:"LOCAL"}),e.jsx(Kt,{packet:t}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ye(b),children:B}),w&&w>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",w]}),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:t.rssi}),e.jsx(ze,{rssi:t.rssi,compact:!0,showValues:!1,validated:$e(t)})]})]}),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:Rt(t.timestamp)}),se>0&&e.jsxs("span",{children:[se,"B"]}),c>0&&e.jsxs("span",{className:c>1?"text-sys-amber/60":void 0,children:["LBT:",c]}),t.snr!=null&&e.jsxs("span",{children:[t.snr.toFixed(0),"dB"]}),I||$?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[$&&e.jsx(qt,{channelName:$,compact:!0,onClick:x&&U?P=>{P.stopPropagation(),x(U)}:void 0}),I&&e.jsx("span",{className:"italic truncate",children:I})]}):G>0?e.jsx(Wt,{path:O,localHash:s}):null]})]})]})]})}const La=h.memo(Ma),Ra=h.memo(Ba);function Ha(t,a,s,n,r=!1){const i=t.toUpperCase(),l=[],o=s&&Xe(i,s);o&&l.push(s);for(const j of Object.keys(a))Xe(i,j)&&l.push(j);if(r&&o&&s&&l.length===1)return{matches:l,probability:1,bestMatch:s};if(r&&o&&l.length>1){const j=l.filter(x=>x!==s);if(j.length===1)return{matches:l,probability:1,bestMatch:j[0]}}const m=l.length>0?1/l.length:0,g=[...l].sort();let u=null,y=-1;if(g.length===1)u=g[0];else if(g.length>1&&n){for(const j of g){const x=n.get(j),k=x?typeof x=="number"?x:x.combinedScore:0;k>y&&(y=k,u=j)}u||(u=g[0])}else g.length>0&&(u=g[0]);let w=m;if(l.length>1&&n&&y>0){let j=0;for(const x of l){const k=n.get(x);j+=k?typeof k=="number"?k:k.combinedScore:0}j>0&&(w=Math.min(.95,y/j))}return{matches:l,probability:w,bestMatch:u}}function Fa(t,a,s,n){const i=(s-t)*Math.PI/180,l=(n-a)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 6371e3*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function Da(t){return t<100?1:t<500?.9:t<1e3?.7:t<5e3?.5:t<1e4?.3:.1}const Aa=h.lazy(()=>cs(()=>import("./PathMapMapLibre-63u_fpZD.js"),__vite__mapDeps([0,1,2,3,4,5,6])));function Ea(t,a,s,n,r=!1,i,l,o){const m=os(a);let g;l&&(g=ds(l,t,{position:o,isLastHop:r}).confidence);const{matches:u,probability:y}=Ha(t,m,n,i,r),w=u.length,j=[],x=t.toUpperCase(),k=s&&s.latitude!==void 0&&s.longitude!==void 0&&(s.latitude!==0||s.longitude!==0);for(const d of u){if(n&&Xe(x,n)&&d===n&&k&&s){j.push({hash:d,name:s.name||"Local Node",latitude:s.latitude,longitude:s.longitude,probability:r?1:y,isLocal:!0});continue}const b=m[d];b!=null&&b.latitude&&(b!=null&&b.longitude)&&!(b.latitude===0&&b.longitude===0)&&j.push({hash:d,name:b.node_name||b.name||"Unknown",latitude:b.latitude,longitude:b.longitude,probability:y,isLocal:!1,isDirectNeighbor:b.zero_hop===!0})}const B=j.length;if(B===1)j[0].probability=g??1;else if(B>1)if(g!==void 0&&g>0){const d=j[0];d.probability=g;const b=1-g,f=B-1;j.slice(1).forEach(_=>{_.probability=b/f})}else{let d=0;const b=j.map(f=>{if(f.isLocal)return{candidate:f,score:1};const _=i==null?void 0:i.get(f.hash);let v=.5;if(k&&s){const E=Fa(s.latitude,s.longitude,f.latitude,f.longitude);v=Da(E)}let p;return _?p=v*.3+_.hopConsistencyScore*.3+_.frequencyScore*.4:(p=v,f.isDirectNeighbor&&(p=Math.max(p,.8))),d+=p,{candidate:f,score:p}});if(d>0)b.forEach(({candidate:f,score:_})=>{f.probability=Math.min(.95,_/d)});else{const f=1/B;j.forEach(_=>_.probability=f)}}return{candidates:j,totalMatches:w}}function Ia(t,a,s,n,r,i){if(!t||t.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const l=t.length-1,o=t.map((u,y)=>{const w=y===l,j=t.length-y,{candidates:x,totalMatches:k}=Ea(u,a,s,n,w,r,i,j),B=x.length>0?Math.max(...x.map(d=>d.probability)):0;return{prefix:u,candidates:x,confidence:B,totalMatches:k}}),m=o.reduce((u,y)=>y.confidence===0?0:u*y.confidence,1),g=o.some(u=>u.candidates.length>0);return{hops:o,overallConfidence:m,hasValidPath:g}}function za(t){return`${(t*100).toFixed(0)}%`}function $a(t){return t>=1?"text-sys-green":t>=.5?"text-sys-indigo":t>=.25?"text-signal-poor":t>0?"text-sys-red":"text-fg-muted"}function Ua(t,a,s){let n;return a===0?n=s.muted:t>=1?n=s.success:t>=.5?n=s.secondary:t>=.25?n=s.poor:t>0?n=s.danger:n=s.muted,{color:n}}class Oa extends h.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 Ve({path:t,neighbors:a,localNode:s,localHash:n,srcHash:r,dstHash:i,neighborAffinity:l,prefixLookup:o,hubNodes:m,traceSnr:g,advertiserSource:u}){const[y,w]=h.useState(null),j=h.useMemo(()=>{if(!u)return null;const f=u.nodeType==="wardrive";return{prefix:u.prefix||"??",candidates:[{hash:u.publicKey||u.prefix||"source",name:u.name,latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isWardrive:f}],confidence:1,totalMatches:1,isSource:!0}},[u]),x=h.useMemo(()=>{if(u||!r)return null;const f=Ee(r),_=a[r];if((_==null?void 0:_.latitude)&&(_==null?void 0:_.longitude)&&!(_.latitude===0&&_.longitude===0))return{prefix:f,candidates:[{hash:r,name:_.node_name||_.name||"Source",latitude:_.latitude,longitude:_.longitude,probability:1,isLocal:!1,isDirectNeighbor:_.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const p=(_==null?void 0:_.node_name)||(_==null?void 0:_.name)||r.slice(0,8);return{prefix:f,candidates:[{hash:r,name:p,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[u,r,a]),k=h.useMemo(()=>{const f=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!f||f==="00"||f==="0000000000000000")&&s&&n){const G=Ee(n),K=s.latitude!==0||s.longitude!==0;return{prefix:G,candidates:[{hash:n,name:s.name||"Local Node",latitude:K?s.latitude:0,longitude:K?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const v=Ee(i);if(n&&i===n&&s){const G=s.latitude!==0||s.longitude!==0;return{prefix:v,candidates:[{hash:i,name:s.name||"Local Node",latitude:G?s.latitude:0,longitude:G?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const p=a[i];if((p==null?void 0:p.latitude)&&(p==null?void 0:p.longitude)&&!(p.latitude===0&&p.longitude===0))return{prefix:v,candidates:[{hash:i,name:p.node_name||p.name||"Destination",latitude:p.latitude,longitude:p.longitude,probability:1,isLocal:!1,isDirectNeighbor:p.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const O=(p==null?void 0:p.node_name)||(p==null?void 0:p.name)||i.slice(0,8);return{prefix:v,candidates:[{hash:i,name:O,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,a,s,n]),B=h.useMemo(()=>Ia(t,a,s,n,l,o),[t,a,s,n,l,o]),d=h.useMemo(()=>{const f=[];j?f.push(j):x&&f.push(x),f.push(...B.hops),k&&f.push(k);const _=f.reduce((p,E)=>E.confidence===0?0:p*E.confidence,1),v=f.some(p=>p.candidates.some(E=>E.latitude!==0||E.longitude!==0));return{hops:f,overallConfidence:_,hasValidPath:v}},[j,x,B,k]),b=h.useMemo(()=>{const f=getComputedStyle(document.documentElement);return{success:f.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:f.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:f.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:f.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:f.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return 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:$a(d.overallConfidence),children:za(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(Ks,{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(Oa,{children:e.jsx(h.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(Aa,{resolvedPath:d,localNode:s,hubNodes:m,hoveredHopIndex:y,onHoverHop:w,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:d.hops.map((f,_)=>{var G,K,D;const v=f.isSource===!0,p=f.isDestination===!0,E=y===_;let O;return v?O=`Source: ${((G=f.candidates[0])==null?void 0:G.name)||"Unknown"}`:p?O=`Destination: ${((K=f.candidates[0])==null?void 0:K.name)||"Unknown"}`:f.totalMatches===0?O="No matching nodes found":f.totalMatches===1?O=`Exact match: ${((D=f.candidates[0])==null?void 0:D.name)||"Unknown"}`:O=`${f.totalMatches} possible matches (${(f.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:R("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",E?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",v&&"border border-sys-green/30",p&&"border border-sys-blue/30"),title:O,onMouseEnter:()=>w(_),onMouseLeave:()=>w(null),children:[v&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),p&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:Ua(f.confidence,f.totalMatches,b),children:f.prefix}),!v&&!p&&f.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",f.totalMatches]}),!v&&!p&&f.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},_)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const Ke=16;function Ge(t){return t.match(/.{1,2}/g)||[]}function be(t){return t!==null&&t.startsWith("payload:")}const Te={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` var(--depth-stroke-tl), var(--depth-stroke-br) `,selectionBorderWidth:2},st={type:"tween",duration:.25,ease:[.25,.1,.25,1]};function Va(t,a){return t?`inset 0 0 0 ${Te.selectionBorderWidth}px ${he[a]}`:Te.cardRestShadow}function Ga(t,a){return t?a:`color-mix(in srgb, ${a} ${Te.hexRestOpacity}%, transparent)`}function Qa({segments:t,selectedSegment:a,onSegmentClick:s}){const[n,r]=h.useState(null),[i,l]=h.useState(null),o=t.some(u=>u.id!==void 0)&&s,m=[];for(const u of t){const y=Ge(u.hex);for(const w of y)m.push({byte:w.toUpperCase(),color:u.color,id:u.id})}const g=[];for(let u=0;u{const w=u.length{const d=B===u.length-1,b=w&&d,f=he[x],p=(k?n===k:i===x)||!!(k&&a===k);return e.jsx("span",{className:`w-[1.75rem] text-xs text-center py-0.5 font-mono select-text ${o?"cursor-pointer":""}`,style:{backgroundColor:Ga(p,f),color:p?"rgba(255,255,255,0.95)":f,transition:p?"none":"background-color 0.15s ease-out, color 0.15s ease-out",touchAction:"manipulation",...b?{borderRadius:"0 0.375rem 0.375rem 0"}:{}},onMouseEnter:()=>{k?r(k):l(x)},onMouseLeave:()=>{r(null),l(null)},onClick:()=>k&&(s==null?void 0:s(k)),onTouchStart:()=>{k?r(k):l(x)},onTouchEnd:()=>{r(null),l(null)},children:j},B)})},y)})})}function Wa({rawHex:t,hexSegments:a,selectedSegment:s,onSegmentClick:n}){const[r,i]=h.useState(!1),l=h.useCallback(async()=>{await ps(t.toUpperCase()),i(!0),setTimeout(()=>i(!1),2e3)},[t]);return e.jsxs("div",{className:"bg-inset radius-inner p-6 relative depth-stroke-inset",children:[e.jsx(Qa,{segments:a,selectedSegment:s,onSegmentClick:n}),e.jsx("button",{onClick:l,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:r?e.jsxs(e.Fragment,{children:[e.jsx(fs,{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(rt,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Copy"})]})})]})}function qa(t,a){const s=[];let n=0;const r=a.slice(0,64);s.push({id:"payload:publicKey",title:"Public Key",color:"pink",hex:r,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:t.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);s.push({id:"payload:timestamp",title:"Timestamp",color:"orange",hex:i,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:i.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.timestamp," (",le(t.timestamp),")"]})]})}),n+=4;const l=a.slice(72,200);s.push({id:"payload:signature",title:"Signature",color:"teal",hex:l,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:t.signature.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Ed25519 signature (64 bytes)"})]})}),n+=64;const o=a.slice(200,202);if(s.push({id:"payload:flags",title:"Flags",color:"blue",hex:o,startByte:n,endByte:n,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.flags.toString(16).padStart(2,"0").toUpperCase()]}),e.jsx("p",{className:"text-xs text-fg-primary mt-1",children:t.flagsDescription}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Node Type: ",t.nodeType]})]})}),n+=1,t.latitude!==void 0){const m=a.slice(n*2,n*2+8);s.push({id:"payload:latitude",title:"Latitude",color:"green",hex:m,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:m.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.latitude.toFixed(6),"°"]})]})}),n+=4}if(t.longitude!==void 0){const m=a.slice(n*2,n*2+8);s.push({id:"payload:longitude",title:"Longitude",color:"indigo",hex:m,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:m.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.longitude.toFixed(6),"°"]})]})}),n+=4}if(t.name){const m=a.slice(n*2),g=m.length/2;s.push({id:"payload:name",title:"Name",color:"amber",hex:m,startByte:n,endByte:n+g-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:m.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:['"',t.name,'"']})]})})}return s}function Ka(t,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(X,{size:"standard",copy:!0,children:["0x",t.crc]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"CRC32 of acknowledged packet"})]})}]}function Ya(t,a){const s=[];s.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(X,{size:"standard",copy:!0,children:["0x",t.channelHash]}),t.channelName&&e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:["Channel: ",t.channelName]})]})}),t.macHex&&s.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(X,{size:"standard",copy:!0,children:t.macHex.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Truncated HMAC-SHA256"})]})});const n=a.slice(6);return n&&s.push({id:"payload:ciphertext",title:t.decrypted?"Message":"Ciphertext",color:t.decrypted?"green":"zinc",hex:n,startByte:3,endByte:3+n.length/2-1,decoded:t.decrypted?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-fg-primary",children:['"',t.text,'"']}),t.senderName&&e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:["From: ",t.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"})]})}),s}function Xa(t,a){const s=[];s.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(X,{size:"standard",copy:!0,children:["0x",t.channelHash]}),t.channelName&&e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:["Channel: ",t.channelName]})]})}),t.macHex&&s.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(X,{size:"standard",copy:!0,children:t.macHex.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Truncated HMAC-SHA256"})]})});const n=a.slice(6);return n&&s.push({id:"payload:ciphertext",title:t.decrypted?"Decrypted Data":"Encrypted Data",color:t.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:(t.decryptedHex||n).toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.dataLength," bytes",t.decrypted?"":" (AES-128-ECB encrypted)"]})]})}),s}function Za(t,a){const s=[];if(s.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(X,{size:"standard",children:t.pathLength}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.pathLength," hop",t.pathLength!==1?"s":""]})]})}),t.path.length>0){const n=a.slice(2,2+t.pathLength*2);s.push({id:"payload:path",title:"Path Hops",color:"amber",hex:n,startByte:1,endByte:t.pathLength,decoded:e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:t.path.map((r,i)=>e.jsxs("span",{className:"flex items-center gap-1",children:[i>0&&e.jsx(ue,{className:"w-3 h-3 text-fg-muted"}),e.jsx(M,{color:"amber",className:"font-mono",children:r})]},i))})})})}if(t.extraType!=null){const n=1+t.pathLength;s.push({id:"payload:extraType",title:"Extra Type",color:"indigo",hex:a.slice(n*2,n*2+2),startByte:n,endByte:n,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",children:t.extraTypeName??`0x${t.extraType.toString(16).padStart(2,"0")}`}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Bundled payload type"})]})})}if(t.extraData){const n=1+t.pathLength+1,r=a.slice(n*2);r&&s.push({id:"payload:extraData",title:"Extra Data",color:"indigo",hex:r,startByte:n,endByte:n+r.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:r.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[r.length/2," bytes"]})]})})}return s}function Ja(t,a){const s=[];s.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(X,{size:"standard",copy:!0,children:["0x",t.traceTag]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique trace request identifier"})]})}),s.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(X,{size:"standard",copy:!0,children:t.authCode}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Authentication/verification code"})]})}),s.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(X,{size:"standard",copy:!0,children:["0x",t.flags.toString(16).toUpperCase().padStart(2,"0")]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:t.flags===0?"No flags set":`Flags: ${t.flags.toString(2).padStart(8,"0")}b`})]})});const n=a.slice(18);return n&&s.push({id:"payload:path",title:"Target Path",color:"indigo",hex:n,startByte:9,endByte:9+n.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:t.pathHashes.map((r,i)=>{const l=t.snrValues[i],o=l!==void 0?Qs(l):"zinc";return e.jsxs("span",{className:"flex items-center gap-1",children:[i>0&&e.jsx(ue,{className:"w-3 h-3 text-fg-muted"}),e.jsx(M,{color:"indigo",className:"font-mono",children:r}),l!==void 0&&e.jsxs(M,{color:o,className:"font-mono",children:[l>=0?"+":"",Number.isInteger(l)?l:l.toFixed(1),"dB"]})]},i)})}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.pathHashes.length," target ",t.pathHashes.length===1?"hop":"hops",t.snrValues.length>0&&` • ${t.snrValues.length} SNR ${t.snrValues.length===1?"value":"values"} collected`,t.isComplete&&" • ✓ Complete"]})]})}),s}function en(t,a){const s=[];s.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(X,{size:"standard",copy:!0,children:t.messageId.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique message identifier"})]})}),s.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(X,{size:"standard",copy:!0,children:t.partNumber}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"0-indexed part number"})]})}),s.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(X,{size:"standard",copy:!0,children:t.totalParts}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:["Part ",t.partNumber+1," of ",t.totalParts]})]})});const n=a.slice(8);return n&&s.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"]})]})}),s}function tn(t,a){switch(t.type){case"advert":return qa(t,a);case"ack":return Ka(t,a);case"grp_txt":return Ya(t,a);case"grp_data":return Xa(t,a);case"path":return Za(t,a);case"trace":return Ja(t,a);case"multipart":return en(t,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 sn(t){return t.map(a=>({id:a.id,hex:a.hex,color:a.color}))}function an({bits:t,field:a,value:s,binary:n}){const r=()=>{if(a==="Payload Type"){const i=Me[s]||"zinc";return e.jsx(M,{color:i,children:s})}if(a==="Route Type"){const i=Ie[s]||"zinc";return e.jsx(M,{color:i,children:s})}return e.jsx("span",{className:"text-sm text-fg-primary",children:s})};return e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 text-xs text-fg-muted tabular-nums",children:t}),e.jsx("td",{className:"py-1.5 text-sm text-fg-secondary",children:a}),e.jsx("td",{className:"py-1.5",children:r()}),e.jsx("td",{className:"py-1.5 type-data-xs text-sys-cyan",children:n})]})}function jt({id:t,title:a,color:s,hexBytes:n,startByte:r,endByte:i,isSelected:l,children:o}){const m=n?Ge(n):[];return e.jsxs(oe.div,{layout:"position",layoutId:t,transition:st,className:"w-full min-w-0 overflow-hidden radius-inner p-4 sm:p-5 space-y-4",style:{backgroundColor:Te.cardRestBg,boxShadow:Va(l,s)},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(M,{color:s,children:a}),m.length>0&&m.length<=16&&m.map((g,u)=>e.jsx(M,{color:s,className:"font-mono",children:g.toUpperCase()},u))]}),e.jsxs("span",{className:"type-data-xs text-fg-muted flex-shrink-0",children:["Bytes ",r,"-",i]})]}),e.jsx("div",{className:"min-w-0 overflow-hidden",children:o})]})}function nn({advert:t,timestamp:a}){const s=a?le(a):le(t.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(de,{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:t.name||"Unknown Node"}),e.jsx("p",{className:"text-sm text-fg-muted font-sans mt-0.5",children:t.nodeType})]})]}),e.jsx("div",{className:"mx-4 border-t border-edge-subtle"}),e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[t.latitude!==void 0&&t.longitude!==void 0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ue,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-fg-secondary font-mono",children:[t.latitude.toFixed(5),"°, ",t.longitude.toFixed(5),"°"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:s})]})]})]})})}function rn({decoded:t,timestamp:a}){const s=a?le(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(Js,{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:t.channelName||"Channel Data"}),e.jsxs("p",{className:"text-sm text-fg-muted font-sans mt-0.5",children:[t.dataLength," bytes • ",t.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(Ot,{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",t.channelHash]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"w-4 h-4 text-sys-teal flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:s})]}),t.decrypted&&t.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(X,{size:"compact",copy:!0,className:"inline-block",children:e.jsx("span",{className:"break-all text-xs",children:t.decryptedHex.toUpperCase()})})})]})]})]})})}function ln({decoded:t,timestamp:a,isLoading:s=!1,onDecrypted:n}){const r=a?le(a):"Unknown",[i,l]=h.useState(""),[o,m]=h.useState(!1),[g,u]=h.useState(null),[y,w]=h.useState(!1),j=h.useCallback(async()=>{if(!(!i.trim()||!t.ciphertextHex||!t.macHex)){m(!0),u(null);try{const x=parseInt(t.channelHash,16),k=ht(t.macHex),B=ht(t.ciphertextHex),d=await ys(i.trim(),x,k,B);if(d.success){const b=d.result.plaintext,f=new TextDecoder("utf-8",{fatal:!1}).decode(b.slice(5)),_=f.indexOf(": "),v={...t,channelName:d.result.channelName,decrypted:!0,timestamp:b[0]|b[1]<<8|b[2]<<16|b[3]<<24,flags:b[4],senderName:_>0?f.slice(0,_):void 0,text:_>0?f.slice(_+2):f};n==null||n(v),l(""),w(!1)}else u(d.error)}catch(x){u(x instanceof Error?x.message:"Unknown error")}finally{m(!1)}}},[i,t,n]);return s?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-CJP4ImUj.js b/frontend/dist/assets/PacketObservatory-cGIEJnyK.js similarity index 99% rename from frontend/dist/assets/PacketObservatory-CJP4ImUj.js rename to frontend/dist/assets/PacketObservatory-cGIEJnyK.js index 1ce86ebe..b9ec92fa 100644 --- a/frontend/dist/assets/PacketObservatory-CJP4ImUj.js +++ b/frontend/dist/assets/PacketObservatory-cGIEJnyK.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-BRm0f890.js","assets/index-DZK2INMD.js","assets/node-types-Cj1JOOlq.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); -import{cg as O,r as T,eB as Fe,eC as Ee,eD as Oe,eE as ze,bS as Be,eF as Ie,eG as Ge,eH as Ke,eI as Ve,bR as Ne,_ as ue,eJ as Ue,eK as we,bW as pe,j as e,eL as G,eM as K,eN as V,eb as xe,eO as qe,R as M,c2 as We,cd as Ce,cm as Ye,eP as Ze,eQ as Xe,eR as Qe,eS as Je,eT as et,eU as J,eV as tt,eW as st,eX as nt,eY as he,ar as me,am as Se,q as rt,eZ as at,N as lt,a4 as ot,e_ as ct,P as it,dz as dt}from"./index-DZK2INMD.js";import{usePipelineStore as Y}from"./usePipelineStore-BRm0f890.js";import{e as Te,p as ut,a as pt,A as I,S as U,c as se,f as E,K as i,H as A,B as xt,R as F,T as d,P as re,h as ht,i as S,C as _e,s as ee,j as mt}from"./primitives-NoSyYVE-.js";import{m as ke,i as gt}from"./node-types-Cj1JOOlq.js";function ft(t){const s=t.type??t.payload_type,r=t.duplicates??[],c=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const x=[t.rssi,...r.map(g=>g.rssi).filter(g=>g!=null)],m=[t.snr,...r.map(g=>g.snr).filter(g=>g!=null)];x.length>1&&(n=[Math.min(...x),Math.max(...x)]),m.length>1&&(l=[Math.min(...m),Math.max(...m)])}const o=s===O.TRACE;return{isDuplicate:c,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:o}}function bt(t,s,r){const c={traceTag:null,siblingCount:0,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:[],thisPathLen:0,minPathLen:0,firstHopPrefix:null};let a=t._traceTag;if(!a&&t.payload&&(a=Te(t.payload)),!a)return{...c,evidence:["no traceTag — cannot correlate"]};const n=s.get(a)??[],l=N=>N.path_length!=null?N.path_length:Array.isArray(N.original_path)?N.original_path.length:0,o=l(t),x=n.length>0?Math.min(...n.map(l)):o,m=t.payload?t.payload.slice(18):"",g=m.length>=2?m.slice(0,2).toUpperCase():null,u=[];if(u.push(`traceTag: ${a}`),u.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return u.push("packet_origin = tx_local → we initiated this trace"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return u.push(`sibling (hash ${v.packet_hash}) has packet_origin = tx_local`),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),g){if(u.push(`first hop in target path: ${g}`),o===0)return u.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),u.push("initiator is a direct RF neighbor"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"min_path_len",confidence:"speculative",inferredSrc:null,inferredName:null,evidence:[...u,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:o,minPathLen:x,firstHopPrefix:g};const f=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===g);if(f.length===1){const[k,$]=f[0],h=$.name||$.node_name||null;return u.push(`first hop ${g} → unique neighbor: ${h??k}`),u.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:g,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}else f.length>1?u.push(`first hop ${g} matches ${f.length} neighbors (ambiguous)`):u.push(`first hop ${g} is not a known neighbor`)}return u.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-BRm0f890.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-DZK2INMD.js").then(t=>t.gi),__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 yt(t,s){const r=t.type??t.payload_type,c=Ne(r),a=Be(t.route),n=r===O.ADVERT,l=r===O.TRACE,o=r===O.PATH,x=r===O.GRP_TXT||r===O.GRP_DATA,m=Ie(t.snr,t.rssi),g=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ve(t.route),f=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${f}`:f,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=gt(r),p=s.advertNodeType!=null?ke(s.advertNodeType):"unknown",_=y!=="unknown"?y:p,H=t.packet_origin??"rx",C=Math.floor(Date.now()/1e3)-t.timestamp,D=C<10?"live":C<300?"recent":C<3600?"warm":C<86400?"stale":"historic",L=t.path_length??(Array.isArray(t.original_path)?t.original_path.length:void 0),P=Array.isArray(t.original_path)&&t.original_path.length>0,R=L??0,b=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),w=ft(t);return{pType:r,payloadTypeName:c,routeTypeName:a,isAdvert:n,isTrace:l,isPath:o,isGrp:x,signalClass:g,routeClass:k,isFlood:u,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:$,inferredType:y,advertType:p,effectiveType:_,origin:H,age:D,pathLen:L,pathAvail:P,pathHopCount:R,byteLen:b,dupeAnalysis:w}}function jt(t){var f,k,$,h,y,p;const s=pt(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:c}=s;if(r.length<2||!ne||!ce)return null;const a=ne.usePipelineStore.getState().srcHashResolverMap,n=ne.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,o=ce.useStore.getState().stats,x=(o==null?void 0:o.neighbors)??{},m=o==null?void 0:o.local_hash,g=(k=(f=o==null?void 0:o.config)==null?void 0:f.repeater)==null?void 0:k.latitude,u=(h=($=o==null?void 0:o.config)==null?void 0:$.repeater)==null?void 0:h.longitude,v=Object.keys(x).length>0?Ue([],x,m,g,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=ge(H,_,L,a,v),R=[H,..._+20?N:null}function ge(t,s,r,c,a){if(s===0){const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.8};if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}}else{if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function vt(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 Nt(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 wt(t,s,r){const c=T.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=T.useMemo(()=>t?vt(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=ut(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}=Nt(r);return c.current.traceIndex=performance.now()-h,p===o.current.fingerprint?o.current.index:(o.current={fingerprint:p,index:y},y)},[r]),m=T.useMemo(()=>{const h=c.current;return{parse:h.parse,decode:h.decode,enrich:h.enrich,traceIndex:h.traceIndex,total:h.parse+h.decode+h.enrich+h.traceIndex}},[n,l,x]);if(!t)return null;const g=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",u=(n==null?void 0:n.protocolPacket)??null,v=u?u.payloadVersion:null,N=v===0,f=v===1,k=yt(t,l);let $=null;return k.isTrace&&($=jt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:g,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:f,enrichment:l,traceTagIndex:x,analysis:k,traceHopDetail:$,timing:m}}function ae({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:`w-16 shrink-0 font-medium ${l.active?"text-fg-primary":"text-fg-muted"}`,children:l.label}),l.detail&&e.jsx("span",{className:l.active?"text-fg-primary/70":"text-fg-muted",children:l.detail})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}function Ct({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 St={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=St[t]??"";return e.jsx(e.Fragment,{children:e.jsx(G,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${x}`,children:[e.jsxs(K,{className:"px-3 py-2 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-sys-blue shrink-0",children:t}),e.jsx("span",{className:"font-mono text-xs font-medium text-fg-primary truncate",children:s}),r&&!c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-zinc-500/20 text-fg-muted",children:"N/A"}),a!=null&&!n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})]})]}),e.jsx(V,{children:e.jsx("div",{className:"px-3 pb-3 font-mono text-xs",children:n?e.jsx("p",{className:"text-fg-muted italic",children:l??"Not applicable for this packet type"}):o})})]})})})}function Tt(t,s){return s?"manual":t._stripped?"bulk-tier":qe.isConnected()?"ws-push":"rest-poll"}const _t={connected:"green",degraded:"amber",offline:"red"};function kt({packet:t,isSynthetic:s}){const r=xe(g=>g.wsState),c=xe(g=>g.health),a=Tt(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:_t[c]}],m=s?"manual hex input":`${a} (${c})`;return e.jsx(le,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:m,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(U,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(ae,{options:o,nextFn:"ingest()"}),e.jsx(se,{tokens:x})]})})})}function q({start:t,end:s}){const r=s!=null&&s!==t?`[${t}..${s}]`:`[${t}]`;return e.jsx("span",{className:"text-fg-muted text-[9px] font-mono mr-1 select-none",children:r})}const Ht={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 $t({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 Dt({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=Ht[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode — decodePayload()"}),e.jsx(U,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(E,{}),e.jsx(Lt,{decoded:t,packet:s})]})})]})}function Lt({decoded:t,packet:s}){var r;switch(t.type){case"advert":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"publicKey",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px] break-all",children:t.publicKey}),children:e.jsx(d,{fn:"publicKey",value:t.publicKey,color:"green"})})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(F,{raw:e.jsx(A,{value:t.flags}),children:e.jsx(d,{fn:"flags",value:t.flagsDescription,color:"green"})})}),e.jsx(i,{label:"nodeType",children:e.jsx(d,{fn:"nodeType",value:t.nodeType,color:"green"})}),t.latitude!=null&&e.jsx(i,{label:"latitude",children:e.jsx(d,{fn:"lat",value:t.latitude.toFixed(6),color:"green"})}),t.longitude!=null&&e.jsx(i,{label:"longitude",children:e.jsx(d,{fn:"lon",value:t.longitude.toFixed(6),color:"green"})}),t.name&&e.jsx(i,{label:"name",children:e.jsx(d,{fn:"name",value:t.name,color:"green"})})]});case"ack":return e.jsx(i,{label:"crc",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const c=s!=null&&s.src_hash?s.src_hash.replace(/^0x/i,"").slice(0,2).toUpperCase():null;return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"traceTag",children:e.jsx(d,{fn:"traceTag",value:t.traceTag,color:"green"})}),e.jsx(i,{label:"authCode",children:e.jsx(d,{fn:"authCode",value:String(t.authCode),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(A,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(re,{hops:t.pathHashes.map(a=>a.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),e.jsx(i,{label:"complete",children:t.isComplete?e.jsxs("span",{className:"text-sys-green",children:["✓ all ",t.pathHashes.length," hops reported SNR"]}):e.jsxs("span",{className:"text-sys-amber",children:["✗ ",t.snrValues.length,"/",t.pathHashes.length," hops reported"]})}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1 text-[10px]",children:"Directional Edge SNR — per-hop link quality"}),t.snrValues.length===0?e.jsx("p",{className:"text-fg-muted italic text-[11px] ml-2",children:"No SNR values in path field"}):e.jsx("div",{className:"space-y-0.5 ml-2",children:t.snrValues.map((a,n)=>{var g,u,v,N,f;const l=((g=t.pathHashes[n])==null?void 0:g.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(f=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:f.spreading_factor,m=we(a,x);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted w-3 text-right",children:n}),e.jsx("span",{className:"text-fg-primary",children:o}),e.jsx("span",{className:"text-fg-muted",children:"→"}),e.jsx("span",{className:"text-fg-primary",children:l}),e.jsx("span",{className:"text-fg-muted",children:"@"}),e.jsxs("span",{className:"font-bold text-sys-green",children:[a>0?"+":"",a.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:m})]},n)})})]})]})}case"path":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"pathLength",children:e.jsx(d,{fn:"pathLength",value:String(t.pathLength),color:"green"})}),e.jsx(i,{label:"path",children:t.path&&t.path.length>0?e.jsx(re,{hops:t.path.map(c=>c.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),t.extraType!=null&&e.jsx(i,{label:"extraType",children:e.jsx(d,{fn:"extraType",value:t.extraTypeName??String(t.extraType),color:"purple"})}),t.extraData&&e.jsxs(i,{label:"extraData",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.extraData}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.extraData.length/2,"B)"]})]})]});case"txt_msg":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),e.jsx(i,{label:"encrypted",children:e.jsx(d,{fn:"encrypted",value:String(t.encrypted),color:"green"})})]});case"grp_txt":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),t.channelName&&e.jsx(i,{label:"channelName",children:e.jsx(d,{fn:"channel",value:t.channelName,color:"green"})}),e.jsx(i,{label:"decrypted",children:e.jsx(d,{fn:"decrypted",value:String(t.decrypted),color:"green"})}),t.text&&e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),t.senderName&&e.jsx(i,{label:"senderName",children:e.jsx(d,{fn:"sender",value:t.senderName,color:"green"})}),t.macCorrupted&&e.jsx(i,{label:"macCorrupted",children:e.jsx(d,{fn:"macCorrupted",value:"true",color:"green"})})]});case"grp_data":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),e.jsx(i,{label:"dataLength",children:t.dataLength}),e.jsx(i,{label:"decrypted",children:String(t.decrypted)})]});case"multipart":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"messageId",children:t.messageId}),e.jsxs(i,{label:"part",children:[t.partNumber+1," / ",t.totalParts]})]});case"control":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"controlType",children:e.jsx(F,{raw:e.jsx(A,{value:t.controlType}),children:e.jsx(d,{fn:"controlType",value:t.subtypeName,color:"green"})})}),e.jsx(i,{label:"subtype",children:e.jsx(d,{fn:"subtype",value:`0x${t.subtype.toString(16).padStart(2,"0")}`,color:"green"})}),t.nodeTypeName&&e.jsxs(i,{label:"nodeType",children:[e.jsx(d,{fn:"nodeType",value:t.nodeTypeName,color:"green"}),e.jsxs("span",{className:"text-fg-muted text-[10px] ml-1",children:["(flags & 0x0F = 0x",(r=t.nodeType)==null?void 0:r.toString(16).padStart(2,"0"),")"]})]}),t.snrDb!=null&&e.jsxs(i,{label:"snr",children:[e.jsxs("span",{className:"font-bold text-sys-green",children:[t.snrDb>0?"+":"",t.snrDb.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:t.snrDb>=5?"strong":t.snrDb>=0?"fair":"weak"})]}),t.tag&&e.jsx(i,{label:"tag",children:e.jsx(d,{fn:"tag",value:t.tag,color:"green"})}),t.publicKey&&e.jsxs(i,{label:"publicKey",children:[e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.publicKey}),e.jsx(M,{color:t.publicKeyFull?"green":"amber",children:t.publicKeyFull?"32B full":`${t.publicKey.length/2}B prefix`})]}),t.typeFilter!=null&&e.jsx(i,{label:"typeFilter",children:e.jsx(F,{raw:e.jsx(A,{value:t.typeFilter}),children:e.jsx(d,{fn:"typeFilter",value:t.typeFilterDescription??"none",color:"green"})})}),t.prefixOnly!=null&&e.jsx(i,{label:"prefixOnly",children:e.jsx(d,{fn:"prefixOnly",value:String(t.prefixOnly),color:"green"})}),t.since!=null&&e.jsx(i,{label:"since",children:e.jsx(d,{fn:"since",value:t.since===0?"all (0)":String(t.since),color:"green"})}),!t.nodeTypeName&&t.typeFilter==null&&t.dataLength>0&&e.jsxs(i,{label:"data",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.dataHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.dataLength,"B)"]})]})]});case"req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"response":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"anon_req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"senderPubKey",children:e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.senderPublicKey})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"generic":return e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"payloadType",children:[e.jsx(ht,{value:t.payloadType})," (",t.payloadTypeName,")"]}),e.jsx(i,{label:"length",children:t.length}),e.jsx(i,{label:"rawHex",children:e.jsx("span",{className:"break-all",children:t.rawHex})})]});default:return e.jsx("p",{className:"text-fg-muted",children:"Unknown decoded type"})}}function Pt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,c=r===Ze||r===Xe,a=T.useMemo(()=>{if(!c||!t)return null;const p=t.payload;return p.length<4?null:{channelHash:p[0],mac:p.slice(1,3),ciphertext:p.slice(3)}},[t,c]),[n,l]=T.useState("pending"),[o,x]=T.useState([]),[m,g]=T.useState(0);T.useEffect(()=>{if(!a){l(null);return}let p=!1;return(async()=>{const H=performance.now(),C=await Qe(a.channelHash,a.mac,a.ciphertext);p||(l(C),g(performance.now()-H));const D=await Je(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,f]=T.useState(null),[k,$]=T.useState(!1),h=T.useCallback(async()=>{if(!(!a||!u.trim())){$(!0);try{const p=await We(u.trim(),a.channelHash,a.mac,a.ciphertext);if(p.success){const _=new TextDecoder("utf-8",{fatal:!1}).decode(p.result.plaintext.slice(5));f({success:!0,text:_})}else f({success:!1,error:p.error})}catch(p){f({success:!1,error:String(p)})}finally{$(!1)}}},[a,u]),y=Ce(s);return!c||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"C. Decrypt — tryDecryptGroupMessage()"}),m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:m<1?`${(m*1e3).toFixed(0)}µs`:`${m.toFixed(2)}ms`})}),e.jsx(U,{prefix:"tryDecryptGroupMessage",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"channelHash",children:e.jsx(d,{fn:"channelHash",value:`0x${a.channelHash.toString(16).toUpperCase().padStart(2,"0")}`,color:"teal"})}),e.jsx(i,{label:"mac",children:e.jsx(d,{fn:"mac",value:Array.from(a.mac).map(p=>p.toString(16).padStart(2,"0")).join(""),color:"teal"})}),e.jsx(i,{label:"cipherLen",children:e.jsx(d,{fn:"cipherLen",value:`${a.ciphertext.length}B`,color:"teal"})}),e.jsx(i,{label:"candidates",children:e.jsx(d,{fn:"candidates",value:o.length>0?`${o.length} names`:"0",color:o.length>0?"teal":"zinc"})}),o.length>0&&e.jsxs("details",{className:"mt-1",children:[e.jsx("summary",{className:"text-fg-muted cursor-pointer hover:text-fg-primary text-[10px]",children:"show candidate names"}),e.jsx("div",{className:"mt-1 text-[10px] text-fg-muted break-all max-h-24 overflow-y-auto",children:o.join(", ")})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"Result:"}),n==="pending"?e.jsx("p",{className:"text-fg-muted italic",children:"decrypting…"}):n?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:n.channelName,color:"teal"})}),e.jsx(i,{label:"plaintext",children:e.jsx(d,{fn:"plaintext",value:new TextDecoder("utf-8",{fatal:!1}).decode(n.plaintext.slice(5)).trim()||"(empty)",color:"teal"})}),e.jsx(i,{label:"macValid",children:e.jsx(d,{fn:"macValid",value:n.macCorrupted?"false":"true",color:"teal"})})]}):e.jsxs(i,{label:"decrypt",children:[e.jsx(d,{fn:"decrypt",value:"failed",color:"red"}),e.jsx("span",{className:"text-fg-muted ml-1",children:"channel not in known list"})]})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"testChannelName() — manual test:"}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("input",{type:"text",value:u,onChange:p=>{v(p.target.value),f(null)},onKeyDown:p=>p.key==="Enter"&&h(),placeholder:"channel name",className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-40"}),e.jsx("button",{onClick:h,disabled:k||!u.trim(),className:"px-2 py-1 rounded text-[10px] font-mono bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 disabled:opacity-40 transition-colors",children:k?"…":"Try"})]}),N&&e.jsx("div",{className:"mt-1",children:N.success?e.jsx(i,{label:"result",children:e.jsx(d,{fn:"plaintext",value:N.text??"(empty)",color:"teal"})}):e.jsx(i,{label:"error",children:e.jsx(d,{fn:"error",value:N.error??"unknown",color:"red"})})})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"useDecodedMessage() store result:"}),y?y.decoded?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:y.decoded.channelName??"?",color:"teal"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:y.decoded.text,color:"teal"})})]}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"failed",color:"red"})}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"pending",color:"zinc"})})]})]})})]})}function Mt(t){const{rawHex:s,display:r,protocolPacket:c,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m,packetHash:g,packet:u}=t,v=!!s&&s.length>=4;return e.jsxs(G,{children:[e.jsx(K,{className:"w-full mt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-mono text-fg-muted",children:"🔬"}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-fg-muted",children:"Wire Inspection"}),e.jsx("span",{className:"text-[9px] text-fg-muted/50",children:"observatory diagnostic — not a runtime stage"})]})}),e.jsx(V,{children:e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-lg p-3 space-y-1 bg-surface/30",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/50 mb-2",children:"The backend parsed these fields server-side. This panel verifies the wire-level encoding client-side."}),v?e.jsxs(e.Fragment,{children:[e.jsx($t,{rawHex:s,display:r,protocolPacket:c,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m}),e.jsx(Dt,{decoded:a,packet:u}),e.jsx(Pt,{protocolPacket:c,packetHash:g})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function fe(t){if(!t)return[{fn:"decode",value:"no raw_packet",group:"decode",color:"zinc"}];switch(t.type){case"advert":{const s=t,r=[{fn:"decode.nodeType",value:s.nodeType,group:"decode",color:"blue"}];return s.name&&r.push({fn:"decode.name",value:s.name,group:"decode",color:"blue"}),s.latitude!=null&&s.longitude!=null&&r.push({fn:"decode.location",value:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`,group:"decode",color:"blue"}),r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:"blue"}),r}case"trace":{const s=t;return[{fn:"decode.traceTag",value:s.traceTag,group:"decode",color:"blue"},{fn:"decode.hops",value:s.pathHashes.length>0?s.pathString:"empty",group:"decode",color:"blue"},{fn:"decode.snr",value:s.snrValues.length>0?`${s.snrValues.length} values`:"none",group:"decode",color:s.snrValues.length>0?"blue":"zinc"},{fn:"decode.complete",value:s.isComplete?"yes":"partial",group:"decode",color:s.isComplete?"green":"amber"}]}case"path":{const s=t,r=[{fn:"decode.pathLength",value:String(s.pathLength),group:"decode",color:"blue"},{fn:"decode.path",value:s.path.length>0?s.pathString:"empty",group:"decode",color:"blue"}];return s.extraType!=null&&r.push({fn:"decode.extraType",value:s.extraTypeName??String(s.extraType),group:"decode",color:"purple"}),s.extraData&&r.push({fn:"decode.extraData",value:`${s.extraData.length/2}B`,group:"decode",color:"purple"}),r}case"ack":return[{fn:"decode.crc",value:t.crc,group:"decode",color:"blue"}];case"grp_txt":return[{fn:"decode.channelHash",value:t.channelHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:"true — decrypt at cascade",group:"decode",color:"zinc"}];case"grp_data":{const s=t;return[{fn:"decode.channelHash",value:s.channelHash,group:"decode",color:"blue"},{fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"}]}case"txt_msg":{const s=t;return[{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:s.encrypted?"true":"false",group:"decode",color:s.encrypted?"zinc":"green"},...s.encrypted?[]:[{fn:"decode.text",value:s.text,group:"decode",color:"blue"}]]}case"multipart":{const s=t;return[{fn:"decode.part",value:`${s.partNumber+1}/${s.totalParts}`,group:"decode",color:"blue"},{fn:"decode.msgId",value:s.messageId,group:"decode",color:"blue"}]}case"control":{const s=t,r=[{fn:"decode.subtype",value:s.subtypeName,group:"decode",color:"blue"}];return s.nodeTypeName&&r.push({fn:"decode.nodeType",value:s.nodeTypeName,group:"decode",color:"blue"}),s.snrDb!=null&&r.push({fn:"decode.snr",value:`${s.snrDb>0?"+":""}${s.snrDb.toFixed(1)} dB`,group:"decode",color:"blue"}),s.tag&&r.push({fn:"decode.tag",value:s.tag,group:"decode",color:"blue"}),s.publicKey&&r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:s.publicKeyFull?"green":"blue"}),s.typeFilter!=null&&r.push({fn:"decode.typeFilter",value:s.typeFilterDescription??`0x${s.typeFilter.toString(16)}`,group:"decode",color:"blue"}),s.prefixOnly!=null&&r.push({fn:"decode.prefixOnly",value:String(s.prefixOnly),group:"decode",color:"blue"}),!s.nodeTypeName&&!s.tag&&(r.push({fn:"decode.subtypeFlags",value:`0x${s.subtypeFlags.toString(16)}`,group:"decode",color:"blue"}),r.push({fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"})),r}case"req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"response":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"anon_req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.senderPubKey",value:s.senderPublicKey,group:"decode",color:"green"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"generic":return[{fn:"decode.raw",value:`${t.length}B`,group:"decode",color:"zinc"}];default:return[]}}function Rt({packet:t,pipeline:s,rawHex:r,traceTagIndex:c,neighbors:a}){const{enrichment:n,timing:l,display:o,protocolPacket:x,decoded:m,parseError:g,payloadVersion:u,isV1:v,isV2:N,analysis:f}=s,$=(t.type??t.payload_type)===et,h=f.dupeAnalysis,y=T.useRef(0),p=T.useMemo(()=>{if(!$)return null;const D=performance.now(),L=bt(t,c,a);return y.current=performance.now()-D,L},[t,c,a,$]),_=l.enrich+y.current,H=[];f.byteLen&&H.push(`${f.byteLen}B`),H.push(f.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):f.pathHopCount>0&&H.push(`${f.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const C=H.join(" — ");return e.jsxs(le,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:C,timeMs:_,children:[e.jsx(Mt,{rawHex:r,display:o,protocolPacket:x,decoded:m,parseError:g,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(U,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(M,{color:"green",children:"PacketCache"}):e.jsx(M,{color:"amber",children:"computed"}),e.jsx("span",{className:"text-[10px] text-fg-muted ml-1.5",children:n.preComputed?"pre-enriched by real pipeline":"synthetic — computed on the fly"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 mb-1",children:[e.jsx(d,{fn:"_byteLength",value:n.byteLength!=null?`${n.byteLength}B`:void 0,color:"blue"}),e.jsx(d,{fn:"_hopCount",value:String(n.hopCount),color:"blue"}),e.jsx(d,{fn:"_isZeroHop",value:String(n.isZeroHop),color:n.isZeroHop?"green":"blue"}),n.isZeroHop&&e.jsx(M,{color:"blue",children:"direct"}),n.channelHash!=null&&e.jsx(d,{fn:"_channelHash",value:n.channelHash,color:"blue"}),$&&t._traceTag&&e.jsx(d,{fn:"_traceTag",value:t._traceTag,color:"blue"})]}),n.advertSender||n.advertNodeType!=null||n.advertName!=null?e.jsxs("div",{className:"mt-1 mb-1",children:[e.jsx("p",{className:"text-[10px] text-sys-blue font-medium mb-0.5",children:"ADVERT Enrichment"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1",children:[n.advertSender&&e.jsx(d,{fn:"_advertSender",value:n.advertSender.slice(0,16)+"…",color:"blue"}),n.advertNodeType!=null&&e.jsx(d,{fn:"_advertNodeType",value:ke(n.advertNodeType),color:"blue"}),n.advertName!=null&&e.jsx(d,{fn:"_advertName",value:n.advertName,color:"blue"}),n.advertFlags!=null&&e.jsx(d,{fn:"_advertFlags",value:`0x${n.advertFlags.toString(16).padStart(2,"0")}`,color:"blue"}),n.advertHasLocation!=null&&e.jsx(d,{fn:"_advertHasLocation",value:String(n.advertHasLocation),color:"blue"}),n.advertHasName!=null&&e.jsx(d,{fn:"_advertHasName",value:String(n.advertHasName),color:"blue"}),n.advertLatitude!=null&&n.advertLongitude!=null&&e.jsx(d,{fn:"location",value:`${n.advertLatitude.toFixed(4)}, ${n.advertLongitude.toFixed(4)}`,color:"blue"})]})]}):e.jsx("p",{className:"text-[10px] text-fg-muted/30 mb-1",children:"ADVERT fields: N/A (non-ADVERT packet)"}),e.jsx(E,{title:"Payload Decode"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${m?"bg-sys-blue":"bg-zinc-500/40"}`}),e.jsx("span",{className:"font-mono text-[10px] font-medium text-fg-primary",children:"decodePayload()"}),e.jsx("span",{className:"text-[9px] text-fg-muted",children:"sync — wire data only, no crypto"})]}),e.jsx("div",{className:"ml-3",children:m?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:fe(m).map((D,L)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:D.fn,value:D.value,color:D.color})},L))}):e.jsx(S,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"dupe:"}),h.isDuplicate?e.jsx(d,{fn:"is_duplicate",value:"true",color:"purple"}):e.jsx(S,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(S,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"TRACE SRC:"}),p.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:p.inferredSrc,color:"purple"}),p.inferredName&&e.jsx(d,{fn:"name",value:p.inferredName,color:"purple"})]}):e.jsx(S,{children:"unresolvable"}),e.jsx(_e,{color:"purple",children:p.method}),e.jsxs(S,{children:["(",p.confidence,")"]}),e.jsxs(S,{children:["siblings=",p.siblingCount]})]})]}),(()=>{const D=f.pType!=null?`0x${f.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,L=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=fe(m),R=f.signalClass==="excellent"||f.signalClass==="good"?"green":f.signalClass==="fair"?"amber":"red",b=f.senderTier==="pubkey"?"green":f.senderTier==="prefix"?"amber":f.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:f.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:f.routeTypeName,raw:L,group:"wire",color:"blue"},{fn:"src_hash",value:t.src_hash||void 0,group:"wire",color:"blue"},{fn:"rssi",value:`${t.rssi}dBm`,group:"wire",color:"blue"},{fn:"snr",value:`${t.snr}dB`,group:"wire",color:"blue"},{fn:"_byteLength",value:f.byteLen?`${f.byteLen}B`:void 0,group:"enrichment",color:"blue"},{fn:"_hopCount",value:String(n.hopCount),group:"enrichment",color:"blue"},{fn:"_isZeroHop",value:String(n.isZeroHop),group:"enrichment",color:"blue"},{fn:"_advertSender",value:n.advertSender||void 0,group:"enrichment",color:"blue"},{fn:"_advertNodeType",value:f.advertType!=="unknown"?f.advertType:void 0,group:"enrichment",color:"blue"},{fn:"_advertName",value:n.advertName||void 0,group:"enrichment",color:"blue"},{fn:"_channelHash",value:n.channelHash||void 0,group:"enrichment",color:"blue"},...P,{fn:"is_duplicate",value:String(h.isDuplicate),group:"analysis",color:"purple"},p!=null&&p.inferredSrc?{fn:"traceSrc",value:p.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:f.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:f.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:f.senderTier,group:"analysis",color:b},{fn:"_origin",value:f.origin,group:"analysis",color:f.origin==="tx_local"?"green":f.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:f.pathAvail?`${f.pathHopCount} hops`:"none",group:"analysis",color:f.pathAvail?"green":"zinc"},{fn:"_age",value:f.age,group:"analysis",color:f.age==="live"||f.age==="recent"?"green":"zinc"},...h.dupeCount>0?[{fn:"_dupeCount",value:`×${h.dupeCount}`,group:"analysis",color:"purple"},...h.rssiRange?[{fn:"_multipath",value:`Δ${Math.abs(h.rssiRange[1]-h.rssiRange[0])}dB`,group:"analysis",color:Math.abs(h.rssiRange[1]-h.rssiRange[0])>6?"amber":"green"}]:[]]:[],...t.lbt_attempts!=null?[{fn:"_lbt",value:`${t.lbt_attempts} attempt${t.lbt_attempts!==1?"s":""}`,group:"analysis",color:(t.lbt_attempts??0)>1?"amber":"green"}]:[],...t.drop_reason?[{fn:"_dropReason",value:t.drop_reason,group:"analysis",color:"red"}]:[]];return e.jsx(se,{tokens:w})})()]})})]})}function be(t){switch(t){case"excellent":return"green";case"good":return"green";case"fair":return"amber";case"poor":return"red";case"critical":return"red";default:return"zinc"}}function ye(t){return`${Math.round(t*100)}%`}function je(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function At({hops:t}){return t.length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle/40",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/40 uppercase tracking-widest font-mono mb-1.5",children:"per-hop trace inspection"}),e.jsx("div",{className:"space-y-1",children:t.map(s=>e.jsx(U,{prefix:`trace.hop[${s.hopIndex}]`,children:e.jsxs("div",{className:"border border-edge-subtle/40 rounded px-2 py-1.5",children:[e.jsxs(i,{label:"link",children:[e.jsx(re,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(_e,{color:be(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(F,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:be(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:je(s.fromName,s.fromHash,s.fromPrefix),color:s.fromHash?s.fromConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:je(s.toName,s.toHash,s.toPrefix),color:s.toHash?s.toConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(se,{label:"trace contributes",tokens:Ft(t)})]})}function Ft(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 Et(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 Ot(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 zt({packet:t,decrypted:s,pipeline:r}){var b;const c=J(w=>w.isComputing),a=J(w=>w.lastUpdated),n=J(w=>w.lastComputeTimeMs),l=J(w=>w.topology.edges.length),o=J(w=>w.topology.discoveredNodes.length),x=tt(),m=st(),g=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),f=me(w=>w.initialDecodeComplete),k=t.type??t.payload_type,$=k===O.GRP_TXT||k===O.GRP_DATA,h=k===O.TRACE,y=k===O.PATH,p=$,_=[{label:"full",detail:"all GRP_TXT → decryption worker",active:p&&f,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!f,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!p,color:"zinc"}],H=Ot(s),C=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,D=c?"running":`${l}e ${o}g`,L=u?"running":`${v}n`,P=p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A",R=`topo ${c?"○":"✓"} ${D} · spark ${u?"○":"✓"} ${L} · decrypt ${P}`;return e.jsx(le,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:R,children:e.jsx(U,{prefix:"cascade",children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 py-1.5 text-[11px] font-mono",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"topology"}),e.jsxs("span",{className:"text-fg-muted",children:[l,"e ",o,"g"]}),(h||y)&&e.jsx("span",{className:"text-sys-green text-[9px]",children:"↑signal"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"sparkline"}),e.jsxs("span",{className:"text-fg-muted",children:[v,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.isDecoding?"bg-sys-amber animate-pulse":p?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:p?"text-sys-teal":"text-fg-muted",children:p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A"})]})]}),e.jsxs(G,{defaultOpen:h||y,children:[e.jsx(K,{className:"text-[10px] w-full border-t border-edge-subtle pt-1.5",children:e.jsx("span",{className:"font-mono text-fg-muted/50",children:"topology detail…"})}),e.jsx(V,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:c?"running":"idle",color:c?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Et(a),color:"zinc"}),n>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",n<1e3?`${n.toFixed(0)}ms`:`${(n/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(l),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(o),color:"purple"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(x.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(x.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(x.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${x.meanSnr.toFixed(1)} dB`,color:x.meanSnr>=5?"green":x.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${x.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(x.avgConfidence*100)}%`,color:"zinc"})]}),h&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(x.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(x.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(x.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(x.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(x.qualityCounts.critical),color:"red"})]}),g.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(g.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(g.confirmedLinks.length),color:"teal"})]})]}),h&&(r==null?void 0:r.traceHopDetail)&&e.jsx(At,{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 Bt(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 It(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().slice(0,2);n.length>=2&&n!==s&&c.add(n)}return c}function Gt(t,s,r,c,a,n,l){const o=Math.floor(Date.now()/1e3),x=new Map(r.map(m=>[m.hash,m]));return t.map(m=>{const g=s[m.hash],u=x.get(m.hash);let v=!0,N="";c!=="unknown"?m.type!=="unknown"&&m.type!==c?(v=!1,N=`${m.type} ≠ required ${c}`):m.type===c?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const f=!!(g!=null&&g.zero_hop),k=(g==null?void 0:g.last_seen)??0;let $=0;if(f&&k>0){const b=(o-k)/3600;$=50*Math.exp(-b/l)}let h=0;if(k>0){const b=(o-k)/3600;h=Math.exp(-b/n)}const y=h*20,p=!!(g!=null&&g.latitude&&(g!=null&&g.longitude)&&(g.latitude!==0||g.longitude!==0)),_=p?5:0,H=(u==null?void 0:u.advertCount)??0,C=Math.min(H*2,30),D=(u==null?void 0:u.forwarderPrefixes.size)??0,L=Math.min(D*3,15);let P=0;if(u&&u.totalForwarderObservations>0&&a.size>0){let b=0;for(const w of a)u.forwarderPrefixes.has(w)&&b++;P=b/a.size}const R=$+y+_+C+L;return{hash:m.hash,name:m.name,type:m.type,roleCompatible:v,roleReason:N,zeroHop:f,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,g)=>g.total-m.total)}function Kt({packet:t,pipeline:s,resolved:r,resolveTimeMs:c,advertName:a,neighbors:n,decrypted:l}){var ie,de;const o=Y(j=>j.neighborContext),x=Y(j=>j.topologyProfiles),m=Y(j=>j.config),{analysis:g}=s,u=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Se(t.src_hash):"",N=v?o.prefixIndex.get(v)??[]:[],f=v?x.get(v)??[]:[],k=g.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=g.inferredType,y=g.advertType,p=g.effectiveType,_=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((ie=l==null?void 0:l.decoded)==null?void 0:ie.senderName)??null,C=Bt(t,u,o,H),D=T.useMemo(()=>It(t,v),[t,v]),L=g.pathLen,P=T.useMemo(()=>Gt(N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours]),R=P.filter(j=>!j.roleCompatible),b=P.filter(j=>j.roleCompatible),w=t._advertSender?o.pubKeyMap.get(t._advertSender)??null:null,oe=C.tier===1,De=[{fn:"src_hash",value:v||"",active:!!v,color:"blue"},{fn:"_advertSender",value:t._advertSender?t._advertSender.slice(0,12)+"…":"",active:!!t._advertSender,color:"blue"},{fn:"_advertNodeType",value:_?`0x${_}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:L!=null?L===0?"zero-hop":String(L):"",active:L!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!w,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!w,color:"zinc"}],Pe=[{label:"payload",detail:`inferDeviceType(0x${$}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:_?`mapAdvertTypeCode(0x${_}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:p==="unknown",color:"zinc"}],Me=u.name??((de=u.hash)==null?void 0:de.slice(0,12))??"?",Re=u.confident?"confident":"ambiguous",Ae=`→ ${Me} (${Re}, Tier ${C.tier})`;return e.jsx(le,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Ae,timeMs:c,children:e.jsx(U,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(Ct,{tokens:De,nextFn:"resolvePacketSource()"})}),t.src_hash?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(ae,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:w?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:w,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),u.name&&a===u.name&&e.jsx(S,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(M,{color:"green",children:"Tier 1"}),e.jsx(S,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(S,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(S,{children:"no _advertSender — skip to prefix resolution"})})})]}),oe?e.jsx("div",{className:"border-t border-edge-subtle py-2",children:e.jsx("p",{className:"text-[11px] text-fg-muted/40 font-mono ml-3",children:"Steps 2–5 bypassed — pubkey definitive"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"2"})," ","CANDIDATE POOL — ",N.length," node",N.length!==1?"s":"",' match "',v,'"']}),e.jsxs("div",{className:"space-y-0.5 ml-3",children:[P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"break-all text-[10px]",children:j.hash}),e.jsx(M,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]},j.hash)),N.length===0&&e.jsx(S,{children:"no known nodes for this prefix"})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(ae,{options:Pe,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:p,color:p!=="unknown"?h!=="unknown"?"amber":"green":"zinc"})})})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"4"})," ","ROLE-TYPE SCRUB"]}),e.jsx("div",{className:"space-y-0.5 ml-3",children:P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:j.roleCompatible?"text-sys-green":"text-sys-red",children:j.roleCompatible?"✓":"✗"}),e.jsx("span",{className:`break-all text-[10px] ${j.roleCompatible?"":"line-through text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(S,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),R.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[R.length," eliminated, ",b.length," surviving"]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),b.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):b.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(S,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:b[0].hash}),b[0].name&&e.jsx(S,{c:"text-fg-muted ml-1",children:b[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[b.length," candidates scored…"]})}),e.jsx(V,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:b.map(j=>{const Q=j.hash===u.hash;return e.jsxs("div",{className:`text-[11px] leading-relaxed rounded px-2 py-1 ${Q?"bg-sys-green/8 border border-sys-green/20":"bg-zinc-500/5"}`,children:[e.jsxs("div",{className:"flex gap-2 items-center mb-0.5",children:[e.jsx(S,{c:Q?"text-sys-green":"text-fg-muted",children:Q?"→":" "}),e.jsx("span",{className:`break-all text-[10px] ${Q?"text-fg-primary":"text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:Q?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]}),e.jsxs("div",{className:"ml-4 flex flex-wrap gap-x-3 gap-y-0.5",children:[e.jsxs("span",{children:[e.jsx(S,{children:"zero_hop:"})," ",e.jsx(S,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"recency:"})," ",e.jsx(S,{c:"text-fg-primary",children:mt(j.lastSeen)})," ",e.jsxs(M,{color:ee(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"gps:"})," ",e.jsx(S,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"adverts:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(M,{color:ee(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"topo:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(M,{color:ee(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(S,{children:"score ≈"})," ",e.jsx(S,{c:"text-fg-primary font-bold",children:j.total.toFixed(1)})]})]},j.hash)})})})]})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:u.hash?e.jsx(d,{fn:"resolved.hash",value:u.hash,color:"green"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:u.type,color:u.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:u.name?e.jsx(d,{fn:"resolved.name",value:u.name,color:u.confident?"green":"amber"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(S,{c:u.confident?"text-sys-green":"text-sys-red",children:String(u.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(M,{color:C.tier<=2?"green":C.tier===3?"amber":"red",children:C.tier}),e.jsx(S,{c:"text-fg-primary ml-1",children:C.label})]})]})]})]}):e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx(S,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),u.confident?e.jsxs(S,{c:"text-sys-green",children:["→ resolved via ",C.label]}):e.jsx(S,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:u.hash??"null",group:"resolution",color:u.confident?"green":"zinc"},{fn:"resolved.type",value:u.type,group:"resolution",color:u.type!=="unknown"?u.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:u.name??"null",group:"resolution",color:u.confident?"green":u.name?"amber":"zinc"},{fn:"resolved.confident",value:String(u.confident),group:"resolution",color:u.confident?"green":"red"}];return e.jsx(se,{tokens:j})})()]})})})}const 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},Ut={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},qt={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},Wt={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},Yt={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},Zt={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},Xt={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},Qt={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,Ut,qt,Wt,Yt,Zt,Xt,Qt],Jt=new Map(Z.map(t=>[t.id,t])),es=new Map;for(const t of Z)for(const s of t.emits)es.set(s.fn,t);const $e=new Map;for(const t of Z)for(const s of t.outputs)$e.set(s,t);function ts(){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=Jt.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 ss={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function ns({stage:t,isActive:s,onClick:r}){const c=t.observatoryStage!=null?ss[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-Dto_OrsT.js","assets/index-B9Nfzawy.js","assets/node-types-D2DQet2e.js","assets/index-BSz_JZ6w.css"])))=>i.map(i=>d[i]); +import{cg as O,r as T,eB as Fe,eC as Ee,eD as Oe,eE as ze,bS as Be,eF as Ie,eG as Ge,eH as Ke,eI as Ve,bR as Ne,_ as ue,eJ as Ue,eK as we,bW as pe,j as e,eL as G,eM as K,eN as V,eb as xe,eO as qe,R as M,c2 as We,cd as Ce,cm as Ye,eP as Ze,eQ as Xe,eR as Qe,eS as Je,eT as et,eU as J,eV as tt,eW as st,eX as nt,eY as he,ar as me,am as Se,q as rt,eZ as at,N as lt,a4 as ot,e_ as ct,P as it,dz as dt}from"./index-B9Nfzawy.js";import{usePipelineStore as Y}from"./usePipelineStore-Dto_OrsT.js";import{e as Te,p as ut,a as pt,A as I,S as U,c as se,f as E,K as i,H as A,B as xt,R as F,T as d,P as re,h as ht,i as S,C as _e,s as ee,j as mt}from"./primitives-DkuSh1mR.js";import{m as ke,i as gt}from"./node-types-D2DQet2e.js";function ft(t){const s=t.type??t.payload_type,r=t.duplicates??[],c=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const x=[t.rssi,...r.map(g=>g.rssi).filter(g=>g!=null)],m=[t.snr,...r.map(g=>g.snr).filter(g=>g!=null)];x.length>1&&(n=[Math.min(...x),Math.max(...x)]),m.length>1&&(l=[Math.min(...m),Math.max(...m)])}const o=s===O.TRACE;return{isDuplicate:c,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:o}}function bt(t,s,r){const c={traceTag:null,siblingCount:0,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:[],thisPathLen:0,minPathLen:0,firstHopPrefix:null};let a=t._traceTag;if(!a&&t.payload&&(a=Te(t.payload)),!a)return{...c,evidence:["no traceTag — cannot correlate"]};const n=s.get(a)??[],l=N=>N.path_length!=null?N.path_length:Array.isArray(N.original_path)?N.original_path.length:0,o=l(t),x=n.length>0?Math.min(...n.map(l)):o,m=t.payload?t.payload.slice(18):"",g=m.length>=2?m.slice(0,2).toUpperCase():null,u=[];if(u.push(`traceTag: ${a}`),u.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return u.push("packet_origin = tx_local → we initiated this trace"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return u.push(`sibling (hash ${v.packet_hash}) has packet_origin = tx_local`),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),g){if(u.push(`first hop in target path: ${g}`),o===0)return u.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),u.push("initiator is a direct RF neighbor"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"min_path_len",confidence:"speculative",inferredSrc:null,inferredName:null,evidence:[...u,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:o,minPathLen:x,firstHopPrefix:g};const f=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===g);if(f.length===1){const[k,$]=f[0],h=$.name||$.node_name||null;return u.push(`first hop ${g} → unique neighbor: ${h??k}`),u.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:g,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}else f.length>1?u.push(`first hop ${g} matches ${f.length} neighbors (ambiguous)`):u.push(`first hop ${g} is not a known neighbor`)}return u.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-Dto_OrsT.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-B9Nfzawy.js").then(t=>t.gi),__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 yt(t,s){const r=t.type??t.payload_type,c=Ne(r),a=Be(t.route),n=r===O.ADVERT,l=r===O.TRACE,o=r===O.PATH,x=r===O.GRP_TXT||r===O.GRP_DATA,m=Ie(t.snr,t.rssi),g=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ve(t.route),f=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${f}`:f,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=gt(r),p=s.advertNodeType!=null?ke(s.advertNodeType):"unknown",_=y!=="unknown"?y:p,H=t.packet_origin??"rx",C=Math.floor(Date.now()/1e3)-t.timestamp,D=C<10?"live":C<300?"recent":C<3600?"warm":C<86400?"stale":"historic",L=t.path_length??(Array.isArray(t.original_path)?t.original_path.length:void 0),P=Array.isArray(t.original_path)&&t.original_path.length>0,R=L??0,b=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),w=ft(t);return{pType:r,payloadTypeName:c,routeTypeName:a,isAdvert:n,isTrace:l,isPath:o,isGrp:x,signalClass:g,routeClass:k,isFlood:u,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:$,inferredType:y,advertType:p,effectiveType:_,origin:H,age:D,pathLen:L,pathAvail:P,pathHopCount:R,byteLen:b,dupeAnalysis:w}}function jt(t){var f,k,$,h,y,p;const s=pt(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:c}=s;if(r.length<2||!ne||!ce)return null;const a=ne.usePipelineStore.getState().srcHashResolverMap,n=ne.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,o=ce.useStore.getState().stats,x=(o==null?void 0:o.neighbors)??{},m=o==null?void 0:o.local_hash,g=(k=(f=o==null?void 0:o.config)==null?void 0:f.repeater)==null?void 0:k.latitude,u=(h=($=o==null?void 0:o.config)==null?void 0:$.repeater)==null?void 0:h.longitude,v=Object.keys(x).length>0?Ue([],x,m,g,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=ge(H,_,L,a,v),R=[H,..._+20?N:null}function ge(t,s,r,c,a){if(s===0){const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.8};if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}}else{if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function vt(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 Nt(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 wt(t,s,r){const c=T.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=T.useMemo(()=>t?vt(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=ut(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}=Nt(r);return c.current.traceIndex=performance.now()-h,p===o.current.fingerprint?o.current.index:(o.current={fingerprint:p,index:y},y)},[r]),m=T.useMemo(()=>{const h=c.current;return{parse:h.parse,decode:h.decode,enrich:h.enrich,traceIndex:h.traceIndex,total:h.parse+h.decode+h.enrich+h.traceIndex}},[n,l,x]);if(!t)return null;const g=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",u=(n==null?void 0:n.protocolPacket)??null,v=u?u.payloadVersion:null,N=v===0,f=v===1,k=yt(t,l);let $=null;return k.isTrace&&($=jt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:g,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:f,enrichment:l,traceTagIndex:x,analysis:k,traceHopDetail:$,timing:m}}function ae({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:`w-16 shrink-0 font-medium ${l.active?"text-fg-primary":"text-fg-muted"}`,children:l.label}),l.detail&&e.jsx("span",{className:l.active?"text-fg-primary/70":"text-fg-muted",children:l.detail})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}function Ct({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 St={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=St[t]??"";return e.jsx(e.Fragment,{children:e.jsx(G,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${x}`,children:[e.jsxs(K,{className:"px-3 py-2 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-sys-blue shrink-0",children:t}),e.jsx("span",{className:"font-mono text-xs font-medium text-fg-primary truncate",children:s}),r&&!c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-zinc-500/20 text-fg-muted",children:"N/A"}),a!=null&&!n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})]})]}),e.jsx(V,{children:e.jsx("div",{className:"px-3 pb-3 font-mono text-xs",children:n?e.jsx("p",{className:"text-fg-muted italic",children:l??"Not applicable for this packet type"}):o})})]})})})}function Tt(t,s){return s?"manual":t._stripped?"bulk-tier":qe.isConnected()?"ws-push":"rest-poll"}const _t={connected:"green",degraded:"amber",offline:"red"};function kt({packet:t,isSynthetic:s}){const r=xe(g=>g.wsState),c=xe(g=>g.health),a=Tt(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:_t[c]}],m=s?"manual hex input":`${a} (${c})`;return e.jsx(le,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:m,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(U,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(ae,{options:o,nextFn:"ingest()"}),e.jsx(se,{tokens:x})]})})})}function q({start:t,end:s}){const r=s!=null&&s!==t?`[${t}..${s}]`:`[${t}]`;return e.jsx("span",{className:"text-fg-muted text-[9px] font-mono mr-1 select-none",children:r})}const Ht={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 $t({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 Dt({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=Ht[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode — decodePayload()"}),e.jsx(U,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(E,{}),e.jsx(Lt,{decoded:t,packet:s})]})})]})}function Lt({decoded:t,packet:s}){var r;switch(t.type){case"advert":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"publicKey",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px] break-all",children:t.publicKey}),children:e.jsx(d,{fn:"publicKey",value:t.publicKey,color:"green"})})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(F,{raw:e.jsx(A,{value:t.flags}),children:e.jsx(d,{fn:"flags",value:t.flagsDescription,color:"green"})})}),e.jsx(i,{label:"nodeType",children:e.jsx(d,{fn:"nodeType",value:t.nodeType,color:"green"})}),t.latitude!=null&&e.jsx(i,{label:"latitude",children:e.jsx(d,{fn:"lat",value:t.latitude.toFixed(6),color:"green"})}),t.longitude!=null&&e.jsx(i,{label:"longitude",children:e.jsx(d,{fn:"lon",value:t.longitude.toFixed(6),color:"green"})}),t.name&&e.jsx(i,{label:"name",children:e.jsx(d,{fn:"name",value:t.name,color:"green"})})]});case"ack":return e.jsx(i,{label:"crc",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const c=s!=null&&s.src_hash?s.src_hash.replace(/^0x/i,"").slice(0,2).toUpperCase():null;return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"traceTag",children:e.jsx(d,{fn:"traceTag",value:t.traceTag,color:"green"})}),e.jsx(i,{label:"authCode",children:e.jsx(d,{fn:"authCode",value:String(t.authCode),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(A,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(re,{hops:t.pathHashes.map(a=>a.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),e.jsx(i,{label:"complete",children:t.isComplete?e.jsxs("span",{className:"text-sys-green",children:["✓ all ",t.pathHashes.length," hops reported SNR"]}):e.jsxs("span",{className:"text-sys-amber",children:["✗ ",t.snrValues.length,"/",t.pathHashes.length," hops reported"]})}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1 text-[10px]",children:"Directional Edge SNR — per-hop link quality"}),t.snrValues.length===0?e.jsx("p",{className:"text-fg-muted italic text-[11px] ml-2",children:"No SNR values in path field"}):e.jsx("div",{className:"space-y-0.5 ml-2",children:t.snrValues.map((a,n)=>{var g,u,v,N,f;const l=((g=t.pathHashes[n])==null?void 0:g.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(f=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:f.spreading_factor,m=we(a,x);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted w-3 text-right",children:n}),e.jsx("span",{className:"text-fg-primary",children:o}),e.jsx("span",{className:"text-fg-muted",children:"→"}),e.jsx("span",{className:"text-fg-primary",children:l}),e.jsx("span",{className:"text-fg-muted",children:"@"}),e.jsxs("span",{className:"font-bold text-sys-green",children:[a>0?"+":"",a.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:m})]},n)})})]})]})}case"path":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"pathLength",children:e.jsx(d,{fn:"pathLength",value:String(t.pathLength),color:"green"})}),e.jsx(i,{label:"path",children:t.path&&t.path.length>0?e.jsx(re,{hops:t.path.map(c=>c.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),t.extraType!=null&&e.jsx(i,{label:"extraType",children:e.jsx(d,{fn:"extraType",value:t.extraTypeName??String(t.extraType),color:"purple"})}),t.extraData&&e.jsxs(i,{label:"extraData",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.extraData}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.extraData.length/2,"B)"]})]})]});case"txt_msg":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),e.jsx(i,{label:"encrypted",children:e.jsx(d,{fn:"encrypted",value:String(t.encrypted),color:"green"})})]});case"grp_txt":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),t.channelName&&e.jsx(i,{label:"channelName",children:e.jsx(d,{fn:"channel",value:t.channelName,color:"green"})}),e.jsx(i,{label:"decrypted",children:e.jsx(d,{fn:"decrypted",value:String(t.decrypted),color:"green"})}),t.text&&e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),t.senderName&&e.jsx(i,{label:"senderName",children:e.jsx(d,{fn:"sender",value:t.senderName,color:"green"})}),t.macCorrupted&&e.jsx(i,{label:"macCorrupted",children:e.jsx(d,{fn:"macCorrupted",value:"true",color:"green"})})]});case"grp_data":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),e.jsx(i,{label:"dataLength",children:t.dataLength}),e.jsx(i,{label:"decrypted",children:String(t.decrypted)})]});case"multipart":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"messageId",children:t.messageId}),e.jsxs(i,{label:"part",children:[t.partNumber+1," / ",t.totalParts]})]});case"control":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"controlType",children:e.jsx(F,{raw:e.jsx(A,{value:t.controlType}),children:e.jsx(d,{fn:"controlType",value:t.subtypeName,color:"green"})})}),e.jsx(i,{label:"subtype",children:e.jsx(d,{fn:"subtype",value:`0x${t.subtype.toString(16).padStart(2,"0")}`,color:"green"})}),t.nodeTypeName&&e.jsxs(i,{label:"nodeType",children:[e.jsx(d,{fn:"nodeType",value:t.nodeTypeName,color:"green"}),e.jsxs("span",{className:"text-fg-muted text-[10px] ml-1",children:["(flags & 0x0F = 0x",(r=t.nodeType)==null?void 0:r.toString(16).padStart(2,"0"),")"]})]}),t.snrDb!=null&&e.jsxs(i,{label:"snr",children:[e.jsxs("span",{className:"font-bold text-sys-green",children:[t.snrDb>0?"+":"",t.snrDb.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:t.snrDb>=5?"strong":t.snrDb>=0?"fair":"weak"})]}),t.tag&&e.jsx(i,{label:"tag",children:e.jsx(d,{fn:"tag",value:t.tag,color:"green"})}),t.publicKey&&e.jsxs(i,{label:"publicKey",children:[e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.publicKey}),e.jsx(M,{color:t.publicKeyFull?"green":"amber",children:t.publicKeyFull?"32B full":`${t.publicKey.length/2}B prefix`})]}),t.typeFilter!=null&&e.jsx(i,{label:"typeFilter",children:e.jsx(F,{raw:e.jsx(A,{value:t.typeFilter}),children:e.jsx(d,{fn:"typeFilter",value:t.typeFilterDescription??"none",color:"green"})})}),t.prefixOnly!=null&&e.jsx(i,{label:"prefixOnly",children:e.jsx(d,{fn:"prefixOnly",value:String(t.prefixOnly),color:"green"})}),t.since!=null&&e.jsx(i,{label:"since",children:e.jsx(d,{fn:"since",value:t.since===0?"all (0)":String(t.since),color:"green"})}),!t.nodeTypeName&&t.typeFilter==null&&t.dataLength>0&&e.jsxs(i,{label:"data",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.dataHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.dataLength,"B)"]})]})]});case"req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"response":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"anon_req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"senderPubKey",children:e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.senderPublicKey})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"generic":return e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"payloadType",children:[e.jsx(ht,{value:t.payloadType})," (",t.payloadTypeName,")"]}),e.jsx(i,{label:"length",children:t.length}),e.jsx(i,{label:"rawHex",children:e.jsx("span",{className:"break-all",children:t.rawHex})})]});default:return e.jsx("p",{className:"text-fg-muted",children:"Unknown decoded type"})}}function Pt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,c=r===Ze||r===Xe,a=T.useMemo(()=>{if(!c||!t)return null;const p=t.payload;return p.length<4?null:{channelHash:p[0],mac:p.slice(1,3),ciphertext:p.slice(3)}},[t,c]),[n,l]=T.useState("pending"),[o,x]=T.useState([]),[m,g]=T.useState(0);T.useEffect(()=>{if(!a){l(null);return}let p=!1;return(async()=>{const H=performance.now(),C=await Qe(a.channelHash,a.mac,a.ciphertext);p||(l(C),g(performance.now()-H));const D=await Je(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,f]=T.useState(null),[k,$]=T.useState(!1),h=T.useCallback(async()=>{if(!(!a||!u.trim())){$(!0);try{const p=await We(u.trim(),a.channelHash,a.mac,a.ciphertext);if(p.success){const _=new TextDecoder("utf-8",{fatal:!1}).decode(p.result.plaintext.slice(5));f({success:!0,text:_})}else f({success:!1,error:p.error})}catch(p){f({success:!1,error:String(p)})}finally{$(!1)}}},[a,u]),y=Ce(s);return!c||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"C. Decrypt — tryDecryptGroupMessage()"}),m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:m<1?`${(m*1e3).toFixed(0)}µs`:`${m.toFixed(2)}ms`})}),e.jsx(U,{prefix:"tryDecryptGroupMessage",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"channelHash",children:e.jsx(d,{fn:"channelHash",value:`0x${a.channelHash.toString(16).toUpperCase().padStart(2,"0")}`,color:"teal"})}),e.jsx(i,{label:"mac",children:e.jsx(d,{fn:"mac",value:Array.from(a.mac).map(p=>p.toString(16).padStart(2,"0")).join(""),color:"teal"})}),e.jsx(i,{label:"cipherLen",children:e.jsx(d,{fn:"cipherLen",value:`${a.ciphertext.length}B`,color:"teal"})}),e.jsx(i,{label:"candidates",children:e.jsx(d,{fn:"candidates",value:o.length>0?`${o.length} names`:"0",color:o.length>0?"teal":"zinc"})}),o.length>0&&e.jsxs("details",{className:"mt-1",children:[e.jsx("summary",{className:"text-fg-muted cursor-pointer hover:text-fg-primary text-[10px]",children:"show candidate names"}),e.jsx("div",{className:"mt-1 text-[10px] text-fg-muted break-all max-h-24 overflow-y-auto",children:o.join(", ")})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"Result:"}),n==="pending"?e.jsx("p",{className:"text-fg-muted italic",children:"decrypting…"}):n?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:n.channelName,color:"teal"})}),e.jsx(i,{label:"plaintext",children:e.jsx(d,{fn:"plaintext",value:new TextDecoder("utf-8",{fatal:!1}).decode(n.plaintext.slice(5)).trim()||"(empty)",color:"teal"})}),e.jsx(i,{label:"macValid",children:e.jsx(d,{fn:"macValid",value:n.macCorrupted?"false":"true",color:"teal"})})]}):e.jsxs(i,{label:"decrypt",children:[e.jsx(d,{fn:"decrypt",value:"failed",color:"red"}),e.jsx("span",{className:"text-fg-muted ml-1",children:"channel not in known list"})]})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"testChannelName() — manual test:"}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("input",{type:"text",value:u,onChange:p=>{v(p.target.value),f(null)},onKeyDown:p=>p.key==="Enter"&&h(),placeholder:"channel name",className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-40"}),e.jsx("button",{onClick:h,disabled:k||!u.trim(),className:"px-2 py-1 rounded text-[10px] font-mono bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 disabled:opacity-40 transition-colors",children:k?"…":"Try"})]}),N&&e.jsx("div",{className:"mt-1",children:N.success?e.jsx(i,{label:"result",children:e.jsx(d,{fn:"plaintext",value:N.text??"(empty)",color:"teal"})}):e.jsx(i,{label:"error",children:e.jsx(d,{fn:"error",value:N.error??"unknown",color:"red"})})})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"useDecodedMessage() store result:"}),y?y.decoded?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:y.decoded.channelName??"?",color:"teal"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:y.decoded.text,color:"teal"})})]}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"failed",color:"red"})}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"pending",color:"zinc"})})]})]})})]})}function Mt(t){const{rawHex:s,display:r,protocolPacket:c,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m,packetHash:g,packet:u}=t,v=!!s&&s.length>=4;return e.jsxs(G,{children:[e.jsx(K,{className:"w-full mt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-mono text-fg-muted",children:"🔬"}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-fg-muted",children:"Wire Inspection"}),e.jsx("span",{className:"text-[9px] text-fg-muted/50",children:"observatory diagnostic — not a runtime stage"})]})}),e.jsx(V,{children:e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-lg p-3 space-y-1 bg-surface/30",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/50 mb-2",children:"The backend parsed these fields server-side. This panel verifies the wire-level encoding client-side."}),v?e.jsxs(e.Fragment,{children:[e.jsx($t,{rawHex:s,display:r,protocolPacket:c,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m}),e.jsx(Dt,{decoded:a,packet:u}),e.jsx(Pt,{protocolPacket:c,packetHash:g})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function fe(t){if(!t)return[{fn:"decode",value:"no raw_packet",group:"decode",color:"zinc"}];switch(t.type){case"advert":{const s=t,r=[{fn:"decode.nodeType",value:s.nodeType,group:"decode",color:"blue"}];return s.name&&r.push({fn:"decode.name",value:s.name,group:"decode",color:"blue"}),s.latitude!=null&&s.longitude!=null&&r.push({fn:"decode.location",value:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`,group:"decode",color:"blue"}),r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:"blue"}),r}case"trace":{const s=t;return[{fn:"decode.traceTag",value:s.traceTag,group:"decode",color:"blue"},{fn:"decode.hops",value:s.pathHashes.length>0?s.pathString:"empty",group:"decode",color:"blue"},{fn:"decode.snr",value:s.snrValues.length>0?`${s.snrValues.length} values`:"none",group:"decode",color:s.snrValues.length>0?"blue":"zinc"},{fn:"decode.complete",value:s.isComplete?"yes":"partial",group:"decode",color:s.isComplete?"green":"amber"}]}case"path":{const s=t,r=[{fn:"decode.pathLength",value:String(s.pathLength),group:"decode",color:"blue"},{fn:"decode.path",value:s.path.length>0?s.pathString:"empty",group:"decode",color:"blue"}];return s.extraType!=null&&r.push({fn:"decode.extraType",value:s.extraTypeName??String(s.extraType),group:"decode",color:"purple"}),s.extraData&&r.push({fn:"decode.extraData",value:`${s.extraData.length/2}B`,group:"decode",color:"purple"}),r}case"ack":return[{fn:"decode.crc",value:t.crc,group:"decode",color:"blue"}];case"grp_txt":return[{fn:"decode.channelHash",value:t.channelHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:"true — decrypt at cascade",group:"decode",color:"zinc"}];case"grp_data":{const s=t;return[{fn:"decode.channelHash",value:s.channelHash,group:"decode",color:"blue"},{fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"}]}case"txt_msg":{const s=t;return[{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:s.encrypted?"true":"false",group:"decode",color:s.encrypted?"zinc":"green"},...s.encrypted?[]:[{fn:"decode.text",value:s.text,group:"decode",color:"blue"}]]}case"multipart":{const s=t;return[{fn:"decode.part",value:`${s.partNumber+1}/${s.totalParts}`,group:"decode",color:"blue"},{fn:"decode.msgId",value:s.messageId,group:"decode",color:"blue"}]}case"control":{const s=t,r=[{fn:"decode.subtype",value:s.subtypeName,group:"decode",color:"blue"}];return s.nodeTypeName&&r.push({fn:"decode.nodeType",value:s.nodeTypeName,group:"decode",color:"blue"}),s.snrDb!=null&&r.push({fn:"decode.snr",value:`${s.snrDb>0?"+":""}${s.snrDb.toFixed(1)} dB`,group:"decode",color:"blue"}),s.tag&&r.push({fn:"decode.tag",value:s.tag,group:"decode",color:"blue"}),s.publicKey&&r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:s.publicKeyFull?"green":"blue"}),s.typeFilter!=null&&r.push({fn:"decode.typeFilter",value:s.typeFilterDescription??`0x${s.typeFilter.toString(16)}`,group:"decode",color:"blue"}),s.prefixOnly!=null&&r.push({fn:"decode.prefixOnly",value:String(s.prefixOnly),group:"decode",color:"blue"}),!s.nodeTypeName&&!s.tag&&(r.push({fn:"decode.subtypeFlags",value:`0x${s.subtypeFlags.toString(16)}`,group:"decode",color:"blue"}),r.push({fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"})),r}case"req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"response":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"anon_req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.senderPubKey",value:s.senderPublicKey,group:"decode",color:"green"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"generic":return[{fn:"decode.raw",value:`${t.length}B`,group:"decode",color:"zinc"}];default:return[]}}function Rt({packet:t,pipeline:s,rawHex:r,traceTagIndex:c,neighbors:a}){const{enrichment:n,timing:l,display:o,protocolPacket:x,decoded:m,parseError:g,payloadVersion:u,isV1:v,isV2:N,analysis:f}=s,$=(t.type??t.payload_type)===et,h=f.dupeAnalysis,y=T.useRef(0),p=T.useMemo(()=>{if(!$)return null;const D=performance.now(),L=bt(t,c,a);return y.current=performance.now()-D,L},[t,c,a,$]),_=l.enrich+y.current,H=[];f.byteLen&&H.push(`${f.byteLen}B`),H.push(f.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):f.pathHopCount>0&&H.push(`${f.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const C=H.join(" — ");return e.jsxs(le,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:C,timeMs:_,children:[e.jsx(Mt,{rawHex:r,display:o,protocolPacket:x,decoded:m,parseError:g,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(U,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(M,{color:"green",children:"PacketCache"}):e.jsx(M,{color:"amber",children:"computed"}),e.jsx("span",{className:"text-[10px] text-fg-muted ml-1.5",children:n.preComputed?"pre-enriched by real pipeline":"synthetic — computed on the fly"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 mb-1",children:[e.jsx(d,{fn:"_byteLength",value:n.byteLength!=null?`${n.byteLength}B`:void 0,color:"blue"}),e.jsx(d,{fn:"_hopCount",value:String(n.hopCount),color:"blue"}),e.jsx(d,{fn:"_isZeroHop",value:String(n.isZeroHop),color:n.isZeroHop?"green":"blue"}),n.isZeroHop&&e.jsx(M,{color:"blue",children:"direct"}),n.channelHash!=null&&e.jsx(d,{fn:"_channelHash",value:n.channelHash,color:"blue"}),$&&t._traceTag&&e.jsx(d,{fn:"_traceTag",value:t._traceTag,color:"blue"})]}),n.advertSender||n.advertNodeType!=null||n.advertName!=null?e.jsxs("div",{className:"mt-1 mb-1",children:[e.jsx("p",{className:"text-[10px] text-sys-blue font-medium mb-0.5",children:"ADVERT Enrichment"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1",children:[n.advertSender&&e.jsx(d,{fn:"_advertSender",value:n.advertSender.slice(0,16)+"…",color:"blue"}),n.advertNodeType!=null&&e.jsx(d,{fn:"_advertNodeType",value:ke(n.advertNodeType),color:"blue"}),n.advertName!=null&&e.jsx(d,{fn:"_advertName",value:n.advertName,color:"blue"}),n.advertFlags!=null&&e.jsx(d,{fn:"_advertFlags",value:`0x${n.advertFlags.toString(16).padStart(2,"0")}`,color:"blue"}),n.advertHasLocation!=null&&e.jsx(d,{fn:"_advertHasLocation",value:String(n.advertHasLocation),color:"blue"}),n.advertHasName!=null&&e.jsx(d,{fn:"_advertHasName",value:String(n.advertHasName),color:"blue"}),n.advertLatitude!=null&&n.advertLongitude!=null&&e.jsx(d,{fn:"location",value:`${n.advertLatitude.toFixed(4)}, ${n.advertLongitude.toFixed(4)}`,color:"blue"})]})]}):e.jsx("p",{className:"text-[10px] text-fg-muted/30 mb-1",children:"ADVERT fields: N/A (non-ADVERT packet)"}),e.jsx(E,{title:"Payload Decode"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${m?"bg-sys-blue":"bg-zinc-500/40"}`}),e.jsx("span",{className:"font-mono text-[10px] font-medium text-fg-primary",children:"decodePayload()"}),e.jsx("span",{className:"text-[9px] text-fg-muted",children:"sync — wire data only, no crypto"})]}),e.jsx("div",{className:"ml-3",children:m?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:fe(m).map((D,L)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:D.fn,value:D.value,color:D.color})},L))}):e.jsx(S,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"dupe:"}),h.isDuplicate?e.jsx(d,{fn:"is_duplicate",value:"true",color:"purple"}):e.jsx(S,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(S,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"TRACE SRC:"}),p.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:p.inferredSrc,color:"purple"}),p.inferredName&&e.jsx(d,{fn:"name",value:p.inferredName,color:"purple"})]}):e.jsx(S,{children:"unresolvable"}),e.jsx(_e,{color:"purple",children:p.method}),e.jsxs(S,{children:["(",p.confidence,")"]}),e.jsxs(S,{children:["siblings=",p.siblingCount]})]})]}),(()=>{const D=f.pType!=null?`0x${f.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,L=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=fe(m),R=f.signalClass==="excellent"||f.signalClass==="good"?"green":f.signalClass==="fair"?"amber":"red",b=f.senderTier==="pubkey"?"green":f.senderTier==="prefix"?"amber":f.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:f.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:f.routeTypeName,raw:L,group:"wire",color:"blue"},{fn:"src_hash",value:t.src_hash||void 0,group:"wire",color:"blue"},{fn:"rssi",value:`${t.rssi}dBm`,group:"wire",color:"blue"},{fn:"snr",value:`${t.snr}dB`,group:"wire",color:"blue"},{fn:"_byteLength",value:f.byteLen?`${f.byteLen}B`:void 0,group:"enrichment",color:"blue"},{fn:"_hopCount",value:String(n.hopCount),group:"enrichment",color:"blue"},{fn:"_isZeroHop",value:String(n.isZeroHop),group:"enrichment",color:"blue"},{fn:"_advertSender",value:n.advertSender||void 0,group:"enrichment",color:"blue"},{fn:"_advertNodeType",value:f.advertType!=="unknown"?f.advertType:void 0,group:"enrichment",color:"blue"},{fn:"_advertName",value:n.advertName||void 0,group:"enrichment",color:"blue"},{fn:"_channelHash",value:n.channelHash||void 0,group:"enrichment",color:"blue"},...P,{fn:"is_duplicate",value:String(h.isDuplicate),group:"analysis",color:"purple"},p!=null&&p.inferredSrc?{fn:"traceSrc",value:p.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:f.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:f.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:f.senderTier,group:"analysis",color:b},{fn:"_origin",value:f.origin,group:"analysis",color:f.origin==="tx_local"?"green":f.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:f.pathAvail?`${f.pathHopCount} hops`:"none",group:"analysis",color:f.pathAvail?"green":"zinc"},{fn:"_age",value:f.age,group:"analysis",color:f.age==="live"||f.age==="recent"?"green":"zinc"},...h.dupeCount>0?[{fn:"_dupeCount",value:`×${h.dupeCount}`,group:"analysis",color:"purple"},...h.rssiRange?[{fn:"_multipath",value:`Δ${Math.abs(h.rssiRange[1]-h.rssiRange[0])}dB`,group:"analysis",color:Math.abs(h.rssiRange[1]-h.rssiRange[0])>6?"amber":"green"}]:[]]:[],...t.lbt_attempts!=null?[{fn:"_lbt",value:`${t.lbt_attempts} attempt${t.lbt_attempts!==1?"s":""}`,group:"analysis",color:(t.lbt_attempts??0)>1?"amber":"green"}]:[],...t.drop_reason?[{fn:"_dropReason",value:t.drop_reason,group:"analysis",color:"red"}]:[]];return e.jsx(se,{tokens:w})})()]})})]})}function be(t){switch(t){case"excellent":return"green";case"good":return"green";case"fair":return"amber";case"poor":return"red";case"critical":return"red";default:return"zinc"}}function ye(t){return`${Math.round(t*100)}%`}function je(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function At({hops:t}){return t.length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle/40",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/40 uppercase tracking-widest font-mono mb-1.5",children:"per-hop trace inspection"}),e.jsx("div",{className:"space-y-1",children:t.map(s=>e.jsx(U,{prefix:`trace.hop[${s.hopIndex}]`,children:e.jsxs("div",{className:"border border-edge-subtle/40 rounded px-2 py-1.5",children:[e.jsxs(i,{label:"link",children:[e.jsx(re,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(_e,{color:be(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(F,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:be(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:je(s.fromName,s.fromHash,s.fromPrefix),color:s.fromHash?s.fromConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:je(s.toName,s.toHash,s.toPrefix),color:s.toHash?s.toConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(se,{label:"trace contributes",tokens:Ft(t)})]})}function Ft(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 Et(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 Ot(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 zt({packet:t,decrypted:s,pipeline:r}){var b;const c=J(w=>w.isComputing),a=J(w=>w.lastUpdated),n=J(w=>w.lastComputeTimeMs),l=J(w=>w.topology.edges.length),o=J(w=>w.topology.discoveredNodes.length),x=tt(),m=st(),g=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),f=me(w=>w.initialDecodeComplete),k=t.type??t.payload_type,$=k===O.GRP_TXT||k===O.GRP_DATA,h=k===O.TRACE,y=k===O.PATH,p=$,_=[{label:"full",detail:"all GRP_TXT → decryption worker",active:p&&f,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!f,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!p,color:"zinc"}],H=Ot(s),C=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,D=c?"running":`${l}e ${o}g`,L=u?"running":`${v}n`,P=p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A",R=`topo ${c?"○":"✓"} ${D} · spark ${u?"○":"✓"} ${L} · decrypt ${P}`;return e.jsx(le,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:R,children:e.jsx(U,{prefix:"cascade",children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 py-1.5 text-[11px] font-mono",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"topology"}),e.jsxs("span",{className:"text-fg-muted",children:[l,"e ",o,"g"]}),(h||y)&&e.jsx("span",{className:"text-sys-green text-[9px]",children:"↑signal"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"sparkline"}),e.jsxs("span",{className:"text-fg-muted",children:[v,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.isDecoding?"bg-sys-amber animate-pulse":p?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:p?"text-sys-teal":"text-fg-muted",children:p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A"})]})]}),e.jsxs(G,{defaultOpen:h||y,children:[e.jsx(K,{className:"text-[10px] w-full border-t border-edge-subtle pt-1.5",children:e.jsx("span",{className:"font-mono text-fg-muted/50",children:"topology detail…"})}),e.jsx(V,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:c?"running":"idle",color:c?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Et(a),color:"zinc"}),n>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",n<1e3?`${n.toFixed(0)}ms`:`${(n/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(l),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(o),color:"purple"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(x.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(x.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(x.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${x.meanSnr.toFixed(1)} dB`,color:x.meanSnr>=5?"green":x.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${x.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(x.avgConfidence*100)}%`,color:"zinc"})]}),h&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(x.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(x.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(x.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(x.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(x.qualityCounts.critical),color:"red"})]}),g.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(g.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(g.confirmedLinks.length),color:"teal"})]})]}),h&&(r==null?void 0:r.traceHopDetail)&&e.jsx(At,{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 Bt(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 It(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().slice(0,2);n.length>=2&&n!==s&&c.add(n)}return c}function Gt(t,s,r,c,a,n,l){const o=Math.floor(Date.now()/1e3),x=new Map(r.map(m=>[m.hash,m]));return t.map(m=>{const g=s[m.hash],u=x.get(m.hash);let v=!0,N="";c!=="unknown"?m.type!=="unknown"&&m.type!==c?(v=!1,N=`${m.type} ≠ required ${c}`):m.type===c?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const f=!!(g!=null&&g.zero_hop),k=(g==null?void 0:g.last_seen)??0;let $=0;if(f&&k>0){const b=(o-k)/3600;$=50*Math.exp(-b/l)}let h=0;if(k>0){const b=(o-k)/3600;h=Math.exp(-b/n)}const y=h*20,p=!!(g!=null&&g.latitude&&(g!=null&&g.longitude)&&(g.latitude!==0||g.longitude!==0)),_=p?5:0,H=(u==null?void 0:u.advertCount)??0,C=Math.min(H*2,30),D=(u==null?void 0:u.forwarderPrefixes.size)??0,L=Math.min(D*3,15);let P=0;if(u&&u.totalForwarderObservations>0&&a.size>0){let b=0;for(const w of a)u.forwarderPrefixes.has(w)&&b++;P=b/a.size}const R=$+y+_+C+L;return{hash:m.hash,name:m.name,type:m.type,roleCompatible:v,roleReason:N,zeroHop:f,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,g)=>g.total-m.total)}function Kt({packet:t,pipeline:s,resolved:r,resolveTimeMs:c,advertName:a,neighbors:n,decrypted:l}){var ie,de;const o=Y(j=>j.neighborContext),x=Y(j=>j.topologyProfiles),m=Y(j=>j.config),{analysis:g}=s,u=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Se(t.src_hash):"",N=v?o.prefixIndex.get(v)??[]:[],f=v?x.get(v)??[]:[],k=g.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=g.inferredType,y=g.advertType,p=g.effectiveType,_=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((ie=l==null?void 0:l.decoded)==null?void 0:ie.senderName)??null,C=Bt(t,u,o,H),D=T.useMemo(()=>It(t,v),[t,v]),L=g.pathLen,P=T.useMemo(()=>Gt(N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours]),R=P.filter(j=>!j.roleCompatible),b=P.filter(j=>j.roleCompatible),w=t._advertSender?o.pubKeyMap.get(t._advertSender)??null:null,oe=C.tier===1,De=[{fn:"src_hash",value:v||"",active:!!v,color:"blue"},{fn:"_advertSender",value:t._advertSender?t._advertSender.slice(0,12)+"…":"",active:!!t._advertSender,color:"blue"},{fn:"_advertNodeType",value:_?`0x${_}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:L!=null?L===0?"zero-hop":String(L):"",active:L!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!w,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!w,color:"zinc"}],Pe=[{label:"payload",detail:`inferDeviceType(0x${$}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:_?`mapAdvertTypeCode(0x${_}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:p==="unknown",color:"zinc"}],Me=u.name??((de=u.hash)==null?void 0:de.slice(0,12))??"?",Re=u.confident?"confident":"ambiguous",Ae=`→ ${Me} (${Re}, Tier ${C.tier})`;return e.jsx(le,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Ae,timeMs:c,children:e.jsx(U,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(Ct,{tokens:De,nextFn:"resolvePacketSource()"})}),t.src_hash?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(ae,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:w?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:w,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),u.name&&a===u.name&&e.jsx(S,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(M,{color:"green",children:"Tier 1"}),e.jsx(S,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(S,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(S,{children:"no _advertSender — skip to prefix resolution"})})})]}),oe?e.jsx("div",{className:"border-t border-edge-subtle py-2",children:e.jsx("p",{className:"text-[11px] text-fg-muted/40 font-mono ml-3",children:"Steps 2–5 bypassed — pubkey definitive"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"2"})," ","CANDIDATE POOL — ",N.length," node",N.length!==1?"s":"",' match "',v,'"']}),e.jsxs("div",{className:"space-y-0.5 ml-3",children:[P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"break-all text-[10px]",children:j.hash}),e.jsx(M,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]},j.hash)),N.length===0&&e.jsx(S,{children:"no known nodes for this prefix"})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(ae,{options:Pe,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:p,color:p!=="unknown"?h!=="unknown"?"amber":"green":"zinc"})})})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"4"})," ","ROLE-TYPE SCRUB"]}),e.jsx("div",{className:"space-y-0.5 ml-3",children:P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:j.roleCompatible?"text-sys-green":"text-sys-red",children:j.roleCompatible?"✓":"✗"}),e.jsx("span",{className:`break-all text-[10px] ${j.roleCompatible?"":"line-through text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(S,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),R.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[R.length," eliminated, ",b.length," surviving"]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),b.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):b.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(S,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:b[0].hash}),b[0].name&&e.jsx(S,{c:"text-fg-muted ml-1",children:b[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[b.length," candidates scored…"]})}),e.jsx(V,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:b.map(j=>{const Q=j.hash===u.hash;return e.jsxs("div",{className:`text-[11px] leading-relaxed rounded px-2 py-1 ${Q?"bg-sys-green/8 border border-sys-green/20":"bg-zinc-500/5"}`,children:[e.jsxs("div",{className:"flex gap-2 items-center mb-0.5",children:[e.jsx(S,{c:Q?"text-sys-green":"text-fg-muted",children:Q?"→":" "}),e.jsx("span",{className:`break-all text-[10px] ${Q?"text-fg-primary":"text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:Q?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]}),e.jsxs("div",{className:"ml-4 flex flex-wrap gap-x-3 gap-y-0.5",children:[e.jsxs("span",{children:[e.jsx(S,{children:"zero_hop:"})," ",e.jsx(S,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"recency:"})," ",e.jsx(S,{c:"text-fg-primary",children:mt(j.lastSeen)})," ",e.jsxs(M,{color:ee(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"gps:"})," ",e.jsx(S,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"adverts:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(M,{color:ee(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"topo:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(M,{color:ee(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(S,{children:"score ≈"})," ",e.jsx(S,{c:"text-fg-primary font-bold",children:j.total.toFixed(1)})]})]},j.hash)})})})]})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:u.hash?e.jsx(d,{fn:"resolved.hash",value:u.hash,color:"green"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:u.type,color:u.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:u.name?e.jsx(d,{fn:"resolved.name",value:u.name,color:u.confident?"green":"amber"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(S,{c:u.confident?"text-sys-green":"text-sys-red",children:String(u.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(M,{color:C.tier<=2?"green":C.tier===3?"amber":"red",children:C.tier}),e.jsx(S,{c:"text-fg-primary ml-1",children:C.label})]})]})]})]}):e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx(S,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),u.confident?e.jsxs(S,{c:"text-sys-green",children:["→ resolved via ",C.label]}):e.jsx(S,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:u.hash??"null",group:"resolution",color:u.confident?"green":"zinc"},{fn:"resolved.type",value:u.type,group:"resolution",color:u.type!=="unknown"?u.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:u.name??"null",group:"resolution",color:u.confident?"green":u.name?"amber":"zinc"},{fn:"resolved.confident",value:String(u.confident),group:"resolution",color:u.confident?"green":"red"}];return e.jsx(se,{tokens:j})})()]})})})}const 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},Ut={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},qt={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},Wt={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},Yt={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},Zt={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},Xt={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},Qt={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,Ut,qt,Wt,Yt,Zt,Xt,Qt],Jt=new Map(Z.map(t=>[t.id,t])),es=new Map;for(const t of Z)for(const s of t.emits)es.set(s.fn,t);const $e=new Map;for(const t of Z)for(const s of t.outputs)$e.set(s,t);function ts(){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=Jt.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 ss={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function ns({stage:t,isActive:s,onClick:r}){const c=t.observatoryStage!=null?ss[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 rs({activeStageId:t,onStageClick:s}){const r=T.useMemo(()=>ts(),[]),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(ns,{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 as(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=rt(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)as(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 ls(){if(X=null,B.length===0)return;const t=B;B=[],te.getState()._pushBatch(t)}function os(){W||(B=[],W=at.subscribe(t=>{B.push(t),X===null&&(X=requestAnimationFrame(ls))}))}function cs(){if(W==null||W(),W=null,X!==null&&(cancelAnimationFrame(X),X=null),B.length>0){const t=B;B=[],te.getState()._pushBatch(t)}}function is(t){switch(t){case"active":return"●";case"skipped":return"○";case"inferred":return"◌"}}function ds(t){switch(t){case"active":return"text-sys-green";case"skipped":return"text-fg-muted/30";case"inferred":return"text-sys-amber"}}function us(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 ps(t,s,r,c,a){var m,g;const n=[];if(a?n.push({label:"Hex Input",detail:"Manual hex — no transport",status:"skipped",lane:"transport"}):s.age==="live"||s.age==="recent"?n.push({label:"WebSocket",detail:"ws:packet → real-time push",status:"active",lane:"transport"}):n.push({label:"REST Poll",detail:"fetchPackets → packetCache.poll()",status:"inferred",lane:"transport"}),!a){n.push({label:"Cache Merge",detail:"packetCache.mergePacketsDirectly()",status:"active",lane:"store"});const u=s.age==="live"||s.age==="recent";n.push({label:"Flash",detail:u?"flashReceived++ → sidebar blink":"Not newest — no flash",status:u?"active":"skipped",lane:"store"}),n.push({label:"Hydrate Cascade",detail:"hydrateDownstream() → schedule workers",status:"active",lane:"store"})}const l=s.pathAvail||s.pathHopCount>0;n.push({label:"Topology Worker",detail:l?`Path data (${s.pathHopCount} hops) → edge extraction`:"No path data — still included in batch recompute",status:"active",lane:"worker"}),n.push({label:"Sparkline Worker",detail:`Contributes to sparkline for src ${((m=t.src_hash)==null?void 0:m.slice(0,4))??"??"}`,status:"active",lane:"worker"});const o=s.isGrp;n.push({label:"Decryption Worker",detail:o?`GRP_TXT → queued for channel key search${c?" → decrypted ✓":""}`:`${s.payloadTypeName} — not encrypted, skipped`,status:o?"active":"skipped",lane:"worker"}),n.push({label:"Source Disambiguation",detail:r?`→ ${r.name??((g=r.hash)==null?void 0:g.slice(0,8))??"?"} (${r.type}${r.confident?", confident":", ambiguous"})`:"Pending recompute",status:r?"active":"inferred",lane:"pipeline"}),s.isAdvert&&n.push({label:"ADVERT Discovery",detail:"pubkey → extended hash-to-type + name extraction",status:"active",lane:"pipeline"}),o&&(c!=null&&c.decoded)&&n.push({label:"Decoded Content Policy",detail:`macCorrupted=${c.decoded.macCorrupted?"true":"false"} → cross-hash inheritance`,status:"active",lane:"pipeline"});const x=["Packets","Dashboard","Statistics"];return l&&x.push("Map","Graph"),s.isTrace&&x.push("Trace Detail"),n.push({label:"Page Hydration",detail:x.join(", "),status:"active",lane:"consumer"}),n}const xs=[],hs=["transport","store","worker","pipeline","consumer"],ms={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 fs(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 bs=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 ${fs(s.type)}`,children:gs(s.type)}),e.jsx("span",{className:"text-fg-muted/60 truncate",children:c})]})});function ys({packet:t,pipeline:s,resolved:r,decrypted:c,isSynthetic:a,liveMode:n}){const[l,o]=T.useState(!1);T.useEffect(()=>{if(l)return os(),()=>{cs()}},[l]);const x=s==null?void 0:s.analysis,m=T.useMemo(()=>!t||!x?null:ps(t,x,r,c,a),[t,x,r,c,a]),g=T.useMemo(()=>{if(!m)return null;const h=new Map;for(const y of m){let p=h.get(y.lane);p||(p=[],h.set(y.lane,p)),p.push(y)}return h},[m]),u=te(h=>l?h.events:xs),v=te(h=>l?h.eventCount:0),N=te(h=>h.clear),f=T.useRef(null);T.useEffect(()=>{l&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[v,l]);const k=(m==null?void 0:m.filter(h=>h.status==="active").length)??0,$=(m==null?void 0:m.length)??0;return e.jsxs(G,{defaultOpen:!0,children:[e.jsx(K,{className:"text-[10px]",children:e.jsxs("span",{className:"flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-sys-green",children:"CFT"}),e.jsx("span",{className:"text-fg-muted/40",children:"Control Flow Trace"}),t&&e.jsxs("span",{className:"text-fg-muted/30",children:["— ",k,"/",$," stages active"]})]})}),e.jsx(V,{children:e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 space-y-3",children:[t?g?e.jsx("div",{className:"space-y-2",children:hs.map(h=>{const y=g.get(h);return y?e.jsxs("div",{children:[e.jsx("div",{className:`text-[8px] uppercase tracking-widest font-mono mb-0.5 ${us(h)}`,children:ms[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 ${ds(p.status)}`,children:is(p.status)}),e.jsx("span",{className:"text-fg-primary",children:p.label}),e.jsx("span",{className:"text-fg-muted/50 truncate",children:p.detail})]},_))]},h):null})}):null:e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-2 text-center",children:"Select a packet to trace its flow"}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>o(h=>!h),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${l?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:l?"● LIVE":"○ LIVE"}),e.jsx("span",{className:"text-[9px] text-fg-muted/40 font-mono",children:l?`${v} events`:"Subscribe to all pipeline events"}),l&&e.jsx("button",{onClick:N,className:"text-[9px] text-fg-muted/40 hover:text-fg-muted font-mono transition-colors ml-auto",children:"clear"})]}),l&&e.jsx("div",{ref:f,className:"max-h-32 overflow-y-auto space-y-px",children:u.length===0?e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-1 text-center",children:"Waiting for events…"}):u.map((h,y)=>e.jsx(bs,{event:h},`${h.ts}-${y}`))})]})})]})}function js(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=dt(t.timestamp);return`${r} ${s} ←${c} ${t.rssi}dBm ${a} ${n}`}function Ss(){const t=lt(),s=ot(),r=ct(),c=(s==null?void 0:s.neighbors)??{},a=Y(b=>b.resolveSource),n=Y(b=>b.config),l=Y(b=>b.setConfig),[o,x]=T.useState(-1),m=T.useMemo(()=>{let b=t;return o!==-1&&(b=t.filter(w=>(w.type??w.payload_type)===o)),b.slice(-50).reverse()},[t,o]),[g,u]=T.useState(""),[v,N]=T.useState(""),[f,k]=T.useState(!1),$=T.useRef(r);T.useEffect(()=>{f&&r!==$.current&&m.length>0&&(u(m[0].packet_hash),N("")),$.current=r},[r,f,m]),T.useEffect(()=>{!g&&m.length>0&&!v&&u(m[0].packet_hash)},[g,m,v]);const h=T.useMemo(()=>v.trim()?null:m.find(b=>b.packet_hash===g)??null,[g,m,v]),y=T.useMemo(()=>{const b=v.replace(/\s+/g,"").trim();return b?{packet_hash:"manual-hex-input",timestamp:0,rssi:0,snr:0,transmitted:!1,drop_reason:null,is_duplicate:!1,raw_packet:b}:null},[v]),p=h??y,_=!!v.trim(),H=v.trim().replace(/\s+/g,"")||(p==null?void 0:p.raw_packet),C=wt(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(it).map(([b,w])=>e.jsxs("option",{value:Number(b),children:["0x",Number(b).toString(16).toUpperCase().padStart(2,"0")," ",w]},b))]}),e.jsxs("select",{value:g,onChange:b=>{u(b.target.value),N("")},className:"surface-input flex-1 min-w-0 px-2 py-1 rounded text-[11px] font-mono text-fg-primary truncate",children:[m.map((b,w)=>e.jsx("option",{value:b.packet_hash,children:js(b)},`${b.packet_hash}-${w}`)),m.length===0&&e.jsxs("option",{value:"",children:["No packets",o!==-1?" matching filter":" loaded"]})]}),e.jsx("button",{onClick:()=>k(b=>!b),className:`px-2 py-1 rounded text-[11px] font-mono transition-colors shrink-0 ${f?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:f?"● LIVE":"○ LIVE"})]}),e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] text-fg-muted/50 hover:text-fg-muted mt-1.5",children:e.jsx("span",{className:"font-mono",children:"Paste hex…"})}),e.jsx(V,{children:e.jsx("textarea",{value:v,onChange:b=>N(b.target.value),placeholder:"Paste raw packet hex (overrides dropdown)",rows:2,className:"surface-input w-full mt-1 px-2 py-1 rounded text-[11px] font-mono text-fg-primary resize-y"})})]})]}),e.jsxs(G,{children:[e.jsx(K,{className:"text-[11px] mb-3 w-full",children:e.jsxs("span",{className:"flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-fg-muted/50",children:"⚙"}),e.jsx("span",{className:"text-fg-muted/50",children:"Pipeline Config & Dev Tools"}),e.jsxs("span",{className:"text-fg-muted/30 text-[10px]",children:["disambig=",n.disambiguationEnabled?"on":"off"," mac=",n.macCorruptedPolicy," decay=",n.recencyDecayHours,"h"]})]})}),e.jsx(V,{children:e.jsxs("div",{className:"space-y-3 mb-4",children:[e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3",children:[e.jsx("h2",{className:"text-[10px] text-fg-muted/50 uppercase tracking-widest font-mono mb-2",children:"Pipeline Config"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Disambiguation"}),e.jsx("button",{onClick:()=>l({disambiguationEnabled:!n.disambiguationEnabled}),className:`px-2 py-0.5 rounded text-[11px] font-mono transition-colors ${n.disambiguationEnabled?"bg-sys-green/20 text-sys-green":"bg-sys-red/20 text-sys-red"}`,children:n.disambiguationEnabled?"● ON":"○ OFF"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"MAC policy"}),e.jsxs("select",{value:n.macCorruptedPolicy,onChange:b=>l({macCorruptedPolicy:b.target.value}),className:"surface-input px-1.5 py-0.5 rounded text-[11px] font-mono text-fg-primary",children:[e.jsx("option",{value:"strict",children:"strict (drop)"}),e.jsx("option",{value:"name-only",children:"name-only"}),e.jsx("option",{value:"permissive",children:"permissive"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Recency decay"}),e.jsx("input",{type:"range",min:1,max:48,step:1,value:n.recencyDecayHours,onChange:b=>l({recencyDecayHours:Number(b.target.value)}),className:"flex-1 h-1 accent-sys-blue"}),e.jsxs("span",{className:"text-[11px] font-mono text-fg-primary w-8 text-right",children:[n.recencyDecayHours,"h"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Zero-hop decay"}),e.jsx("input",{type:"range",min:12,max:168,step:6,value:n.zeroHopDecayHours,onChange:b=>l({zeroHopDecayHours:Number(b.target.value)}),className:"flex-1 h-1 accent-sys-blue"}),e.jsxs("span",{className:"text-[11px] font-mono text-fg-primary w-10 text-right",children:[n.zeroHopDecayHours,"h"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx(ys,{packet:p,pipeline:C,resolved:R,decrypted:L??null,isSynthetic:_,liveMode:f}),e.jsx(rs,{})]})]})})]}),p?e.jsxs("div",{className:"space-y-1",children:[e.jsx(kt,{packet:p,isSynthetic:_}),e.jsx(Rt,{packet:p,pipeline:C,rawHex:H,traceTagIndex:(C==null?void 0:C.traceTagIndex)??new Map,neighbors:c}),e.jsx(zt,{packet:p,decrypted:L??void 0,pipeline:C}),e.jsx(Kt,{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{Ss as default}; diff --git a/frontend/dist/assets/Packets-Cr5fIFSq.js b/frontend/dist/assets/Packets-BTBFZZN3.js similarity index 96% rename from frontend/dist/assets/Packets-Cr5fIFSq.js rename to frontend/dist/assets/Packets-BTBFZZN3.js index 475ff2de..71acba8a 100644 --- a/frontend/dist/assets/Packets-Cr5fIFSq.js +++ b/frontend/dist/assets/Packets-BTBFZZN3.js @@ -1,4 +1,4 @@ -import{r as c,aR as _,aS as ut,aT as Te,aU as We,aV as ie,aW as dt,aX as pt,aY as ce,aZ as Ye,a_ as mt,a$ as bt,b0 as ft,b1 as ge,b2 as vt,b3 as xt,b4 as Oe,b5 as U,b6 as gt,b7 as ke,b8 as X,b9 as re,ba as $e,bb as je,bc as ht,bd as Xe,be as Je,bf as he,bg as Pe,bh as ye,bi as yt,bj as St,bk as Ct,bl as Re,bm as Ot,bn as Nt,bo as Ce,bp as wt,bq as Et,br as jt,bs as Pt,bt as W,bu as It,bv as Tt,bw as kt,bx as $t,by as Rt,bz as Mt,bA as Ft,bB as Dt,bC as _t,bD as At,bE as Vt,bF as Me,d as Lt,j as l,c as J,aC as zt,Y as Bt,$ as Ht,bG as Ut,N as Gt,a4 as qt,aa as Kt,ab as Wt,ay as Yt,aP as Xt,ac as Fe,P as De,bH as _e,bI as Ae,B as we,bJ as Ve,a5 as Le,bK as ze,a6 as Jt}from"./index-DZK2INMD.js";import{c as Zt}from"./node-types-Cj1JOOlq.js";import{u as Qt}from"./chevron-up-Bm8_AtG8.js";import{c as H,p as eo,a as ve,f as Be,b as to,L as oo,S as me,s as no,u as He,d as so,g as ao,e as lo,h as io}from"./element-movement-BZO5MqZi.js";import{F as ro,y as co,R as uo,T as po,w as Ue,A as mo}from"./map-pin-qwXb-K8z.js";import{g as Ze,u as bo,R as fo,P as vo}from"./PacketList-DyZLMo3F.js";import{useGetDecodedContent as xo,useResolveSource as go}from"./usePipelineStore-BRm0f890.js";import{c as ho,a as yo,D as So,b as Co}from"./AnalyzerFilterPanel-Cx2An8MF.js";import{u as Oo,r as No}from"./consumer-registry-C58OO1Zb.js";import{A as wo}from"./arrow-up-DJJcQ7dG.js";import{A as Eo}from"./arrow-right-BW1lsEoU.js";import{C as jo}from"./circle-x-D0lMBMA-.js";import{P as Po,a as Io,B as To,C as Ge}from"./PageLayout-F1v-IzhG.js";import{T as ko,M as $o}from"./MqttModeBadge-CK543WcH.js";import{F as qe}from"./funnel-ClRHq7Ic.js";import{S as Ro}from"./search-DRsZhueb.js";import"./primitives-NoSyYVE-.js";import"./badge-colors-BNUqIXCA.js";import"./chat-utils-B9fA4l9w.js";import"./SignalIndicator-BlRL2nuG.js";import"./chevron-right-DYHNTpxG.js";import"./circle-question-mark-BdE_X9p5.js";import"./triangle-alert-z32LI9zM.js";import"./DataBox-BEDP2Kxh.js";import"./layers-Bh2LK6a1.js";import"./hash-Bx-gtxz0.js";import"./clock-CZYZYW0y.js";import"./activity-F7Po-3Al.js";import"./circle-check-DiKh03Ex.js";import"./database-DWx780B3.js";import"./useMapViewStore-DGeq1iXE.js";import"./index-C-Mp31KV.js";import"./shield-tOGn5YjL.js";import"./zap-CV3qJZPu.js";import"./monitor-smartphone-BKehVovy.js";function Qe(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return ut(e,"blur",t=>{let a=t.target;Te(a)&&(o.current={value:a.value,selectionStart:a.selectionStart,selectionEnd:a.selectionEnd})}),_(()=>{if(!We(e)&&Te(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==o.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:a}=o.current;t!==null&&a!==null&&e.setSelectionRange(t,a)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}function Mo(e,{container:o,accept:t,walk:a}){let n=c.useRef(t),i=c.useRef(a);c.useEffect(()=>{n.current=t,i.current=a},[t,a]),ie(()=>{if(!o||!e)return;let u=dt(o);if(!u)return;let f=n.current,d=i.current,b=Object.assign(N=>f(N),{acceptNode:f}),h=u.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,b,!1);for(;h.nextNode();)d(h.currentNode)},[o,e,n,i])}var Fo=Object.defineProperty,Do=(e,o,t)=>o in e?Fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Ke=(e,o,t)=>(Do(e,typeof o!="symbol"?o+"":o,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),Z=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Z||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oe||{}),et=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.DefaultToFirstOption=6]="DefaultToFirstOption",e[e.SetActivationTrigger=7]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",e[e.SetInputElement=9]="SetInputElement",e[e.SetButtonElement=10]="SetButtonElement",e[e.SetOptionsElement=11]="SetOptionsElement",e[e.MarkInputAsMoved=12]="MarkInputAsMoved",e))(et||{});function Ee(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,a=o(e.options.slice()),n=a.length>0&&a[0].dataRef.current.order!==null?a.sort((u,f)=>u.dataRef.current.order-f.dataRef.current.order):bt(a,u=>u.dataRef.current.domRef.current),i=t?n.indexOf(t):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}let _o={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?ve.Tracked(to(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:t,__demoMode:!1}},0(e){var o,t;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let a=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(a!==-1)return{...e,activeOptionIndex:a,comboboxState:0,__demoMode:!1,inputPositionState:ve.Idle}}return{...e,comboboxState:0,inputPositionState:ve.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,a,n,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((a=e.dataRef.current)!=null&&a.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:b,disabled:h}=e.virtual,N=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>b,resolveActiveIndex:()=>{var v,m;return(m=(v=e.activeOptionIndex)!=null?v:b.findIndex(P=>!h(P)))!=null?m:null},resolveDisabled:h,resolveId(){throw new Error("Function not implemented.")}}),C=(n=o.trigger)!=null?n:2;return e.activeOptionIndex===N&&e.activationTrigger===C?e:{...e,activeOptionIndex:N,activationTrigger:C,isTyping:!1,__demoMode:!1}}let u=Ee(e);if(u.activeOptionIndex===null){let b=u.options.findIndex(h=>!h.dataRef.current.disabled);b!==-1&&(u.activeOptionIndex=b)}let f=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:b=>b.id,resolveDisabled:b=>b.dataRef.current.disabled}),d=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===f&&e.activationTrigger===d?e:{...e,...u,isTyping:!1,activeOptionIndex:f,activationTrigger:d,__demoMode:!1}},4:(e,o)=>{var t,a,n,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let u=o.payload,f=Ee(e,b=>(b.push(u),b));e.activeOptionIndex===null&&(n=(a=e.dataRef.current).isSelected)!=null&&n.call(a,o.payload.dataRef.current.value)&&(f.activeOptionIndex=f.options.indexOf(u));let d={...e,...f,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(n=>n.id!==o.id)};let a=Ee(e,n=>{let i=n.findIndex(u=>u.id===o.id);return i!==-1&&n.splice(i,1),n});return{...e,...a,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,a;if(e.virtual===null)return{...e,virtual:{options:o.options,disabled:(t=o.disabled)!=null?t:()=>!1}};if(e.virtual.options===o.options&&e.virtual.disabled===o.disabled)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?n=i:n=null}return{...e,activeOptionIndex:n,virtual:{options:o.options,disabled:(a=o.disabled)!=null?a:()=>!1}}},9:(e,o)=>e.inputElement===o.element?e:{...e,inputElement:o.element},10:(e,o)=>e.buttonElement===o.element?e:{...e,buttonElement:o.element},11:(e,o)=>e.optionsElement===o.element?e:{...e,optionsElement:o.element},12(e){return e.inputPositionState.kind!=="Tracked"?e:{...e,inputPositionState:ve.Moved}}};class Ie extends pt{constructor(o){super(o),Ke(this,"actions",{onChange:t=>{let{onChange:a,compare:n,mode:i,value:u}=this.state.dataRef.current;return ce(i,{0:()=>a==null?void 0:a(t),1:()=>{let f=u.slice(),d=f.findIndex(b=>n(b,t));return d===-1?f.push(t):f.splice(d,1),a==null?void 0:a(f)}})},registerOption:(t,a)=>(this.send({type:4,payload:{id:t,dataRef:a}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(a.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,a)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:a})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,a;this.send({type:1}),this.send({type:6,value:!1}),(a=(t=this.state.dataRef.current).onClose)==null||a.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:a}=this.state.options[t];this.actions.onChange(a.current.value)}this.actions.goToOption({focus:H.Specific,idx:t})}},setInputElement:t=>{this.send({type:9,element:t})},setButtonElement:t=>{this.send({type:10,element:t})},setOptionsElement:t=>{this.send({type:11,element:t})}}),Ke(this,"selectors",{activeDescendantId:t=>{var a,n;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(n=t.options.find(u=>!u.dataRef.current.disabled&&t.dataRef.current.compare(u.dataRef.current.value,t.virtual.options[i])))==null?void 0:n.id:(a=t.options[i])==null?void 0:a.id},activeOptionIndex:t=>{if(t.defaultToFirstOption&&t.activeOptionIndex===null&&(t.virtual?t.virtual.options.length>0:t.options.length>0)){if(t.virtual){let{options:n,disabled:i}=t.virtual,u=n.findIndex(f=>{var d;return!((d=i==null?void 0:i(f))!=null&&d)});if(u!==-1)return u}let a=t.options.findIndex(n=>!n.dataRef.current.disabled);if(a!==-1)return a}return t.activeOptionIndex},activeOption:t=>{var a,n;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(n=(a=t.options[i])==null?void 0:a.dataRef.current.value)!=null?n:null},isActive:(t,a,n)=>{var i;let u=this.selectors.activeOptionIndex(t);return u===null?!1:t.virtual?u===t.dataRef.current.calculateIndex(a):((i=t.options[u])==null?void 0:i.id)===n},shouldScrollIntoView:(t,a,n)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,a,n)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,a=Ye.get(null);this.disposables.add(a.on(mt.Push,n=>{!a.selectors.isTop(n,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>a.actions.push(t)),this.on(1,()=>a.actions.pop(t))}this.disposables.group(t=>{this.on(1,a=>{a.inputElement&&(t.dispose(),t.add(eo(a.inputElement,a.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:a=!1}){var n;return new Ie({id:o,dataRef:{current:{}},comboboxState:a?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:a,inputPositionState:ve.Idle})}reduce(o,t){return ce(t.type,_o,o,t)}}const tt=c.createContext(null);function Se(e){let o=c.useContext(tt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ot),t}return o}function ot({id:e,virtual:o=null,__demoMode:t=!1}){let a=c.useMemo(()=>Ie.new({id:e,virtual:o,__demoMode:t}),[]);return ft(()=>a.dispose()),a}let xe=c.createContext(null);xe.displayName="ComboboxDataContext";function ue(e){let o=c.useContext(xe);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ue),t}return o}let nt=c.createContext(null);function Ao(e){let o=Se("VirtualProvider"),t=ue("VirtualProvider"),{options:a}=t.virtual,n=U(o,v=>v.optionsElement),[i,u]=c.useMemo(()=>{let v=n;if(!v)return[0,0];let m=window.getComputedStyle(v);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[n]),f=Qt({enabled:a.length!==0,scrollPaddingStart:i,scrollPaddingEnd:u,count:a.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[d,b]=c.useState(0);ie(()=>{b(v=>v+1)},[a]);let h=f.getVirtualItems(),N=U(o,v=>v.activationTrigger===oe.Pointer),C=U(o,o.selectors.activeOptionIndex);return h.length===0?null:W.createElement(nt.Provider,{value:f},W.createElement("div",{style:{position:"relative",width:"100%",height:`${f.getTotalSize()}px`},ref:v=>{v&&(N||C!==null&&a.length>C&&f.scrollToIndex(C))}},h.map(v=>{var m;return W.createElement(c.Fragment,{key:v.key},W.cloneElement((m=e.children)==null?void 0:m.call(e,{...e.slot,option:a[v.index]}),{key:`${d}-${v.key}`,"data-index":v.index,"aria-setsize":a.length,"aria-posinset":v.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${v.start}px)`,overflowAnchor:"none"}}))})))}let Vo=c.Fragment;function Lo(e,o){let t=c.useId(),a=Rt(),{value:n,defaultValue:i,onChange:u,form:f,name:d,by:b,invalid:h=!1,disabled:N=a||!1,onClose:C,__demoMode:v=!1,multiple:m=!1,immediate:P=!1,virtual:p=null,nullable:M,...y}=e,O=Mt(i),[T=m?[]:void 0,L]=Ft(n,u,O),E=ot({id:t,virtual:p,__demoMode:v}),A=c.useRef({static:!1,hold:!1}),$=io(b),F=_(I=>p?b===null?p.options.indexOf(I):p.options.findIndex(ae=>$(ae,I)):E.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),G=c.useCallback(I=>ce(V.mode,{[Z.Multi]:()=>T.some(ae=>$(ae,I)),[Z.Single]:()=>$(T,I)}),[T]),q=U(E,I=>I.virtual),j=_(()=>C==null?void 0:C()),V=c.useMemo(()=>({__demoMode:v,immediate:P,optionsPropsRef:A,value:T,defaultValue:O,disabled:N,invalid:h,mode:m?Z.Multi:Z.Single,virtual:p?q:null,onChange:L,isSelected:G,calculateIndex:F,compare:$,onClose:j}),[v,P,A,T,O,N,h,m,p,q,L,G,F,$,j]);ie(()=>{var I;p&&E.send({type:et.UpdateVirtualConfiguration,options:p.options,disabled:(I=p.disabled)!=null?I:null})},[p,p==null?void 0:p.options,p==null?void 0:p.disabled]),ie(()=>{E.state.dataRef.current=V},[V]);let[z,w,Y,le]=U(E,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),Q=Ye.get(null),ee=U(Q,c.useCallback(I=>Q.selectors.isTop(I,t),[Q,t]));Dt(ee,[w,Y,le],()=>E.actions.closeCombobox());let ne=U(E,E.selectors.activeOptionIndex),se=U(E,E.selectors.activeOption),x=he({open:z===S.Open,disabled:N,invalid:h,activeIndex:ne,activeOption:se,value:T}),[K,R]=_t(),D=o===null?{}:{ref:o},k=c.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),B=ye();return W.createElement(R,{value:K,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:z===S.Open,disabled:N}},W.createElement(mo,null,W.createElement(xe.Provider,{value:V},W.createElement(tt.Provider,{value:E},W.createElement(At,{value:ce(z,{[S.Open]:Ce.Open,[S.Closed]:Ce.Closed})},d!=null&&W.createElement(Vt,{disabled:N,data:T!=null?{[d]:T}:{},form:f,onReset:k}),B({ourProps:D,theirProps:y,slot:x,defaultTag:Vo,name:"Combobox"}))))))}let zo="input";function Bo(e,o){var t,a;let n=Se("Combobox.Input"),i=ue("Combobox.Input"),u=c.useId(),f=xt(),{id:d=f||`headlessui-combobox-input-${u}`,onChange:b,displayValue:h,disabled:N=i.disabled||!1,autoFocus:C=!1,type:v="text",...m}=e,P=c.useRef(null),p=Oe(P,o,ro(),n.actions.setInputElement),[M,y]=U(n,x=>[x.comboboxState,x.isTyping]),O=gt(),T=_(()=>{n.actions.onChange(null),n.state.optionsElement&&(n.state.optionsElement.scrollTop=0),n.actions.goToOption({focus:H.Nothing})}),L=c.useMemo(()=>{var x;return typeof h=="function"&&i.value!==void 0?(x=h(i.value))!=null?x:"":typeof i.value=="string"?i.value:""},[i.value,h]);ke(([x,K],[R,D])=>{if(n.state.isTyping)return;let k=P.current;k&&((D===S.Open&&K===S.Closed||x!==R)&&(k.value=x),requestAnimationFrame(()=>{if(n.state.isTyping||!k||We(k))return;let{selectionStart:B,selectionEnd:I}=k;Math.abs((I??0)-(B??0))===0&&B===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[L,M,y]),ke(([x],[K])=>{if(x===S.Open&&K===S.Closed){if(n.state.isTyping)return;let R=P.current;if(!R)return;let D=R.value,{selectionStart:k,selectionEnd:B,selectionDirection:I}=R;R.value="",R.value=D,I!==null?R.setSelectionRange(k,B,I):R.setSelectionRange(k,B)}},[M]);let E=c.useRef(!1),A=_(()=>{E.current=!0}),$=_(()=>{O.nextFrame(()=>{E.current=!1})}),F=_(x=>{switch(n.actions.setIsTyping(!0),x.key){case X.Enter:if(n.state.comboboxState!==S.Open||E.current)return;if(x.preventDefault(),x.stopPropagation(),n.selectors.activeOptionIndex(n.state)===null){n.actions.closeCombobox();return}n.actions.selectActiveOption(),i.mode===Z.Single&&n.actions.closeCombobox();break;case X.ArrowDown:return x.preventDefault(),x.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Next}),[S.Closed]:()=>n.actions.openCombobox()});case X.ArrowUp:return x.preventDefault(),x.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Previous}),[S.Closed]:()=>{re.flushSync(()=>n.actions.openCombobox()),i.value||n.actions.goToOption({focus:H.Last})}});case X.Home:if(n.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.First});case X.PageUp:return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.First});case X.End:if(n.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.PageDown:return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.Escape:return n.state.comboboxState!==S.Open?void 0:(x.preventDefault(),n.state.optionsElement&&!i.optionsPropsRef.current.static&&x.stopPropagation(),i.mode===Z.Single&&i.value===null&&T(),n.actions.closeCombobox());case X.Tab:if(n.actions.setIsTyping(!1),n.state.comboboxState!==S.Open)return;i.mode===Z.Single&&n.state.activationTrigger!==oe.Focus&&n.actions.selectActiveOption(),n.actions.closeCombobox();break}}),G=_(x=>{b==null||b(x),i.mode===Z.Single&&x.target.value===""&&T(),n.actions.openCombobox()}),q=_(x=>{var K,R,D;let k=(K=x.relatedTarget)!=null?K:$e.find(B=>B!==x.currentTarget);if(!((R=n.state.optionsElement)!=null&&R.contains(k))&&!((D=n.state.buttonElement)!=null&&D.contains(k))&&n.state.comboboxState===S.Open)return x.preventDefault(),i.mode===Z.Single&&i.value===null&&T(),n.actions.closeCombobox()}),j=_(x=>{var K,R,D;let k=(K=x.relatedTarget)!=null?K:$e.find(B=>B!==x.currentTarget);(R=n.state.buttonElement)!=null&&R.contains(k)||(D=n.state.optionsElement)!=null&&D.contains(k)||i.disabled||i.immediate&&n.state.comboboxState!==S.Open&&O.microTask(()=>{re.flushSync(()=>n.actions.openCombobox()),n.actions.setActivationTrigger(oe.Focus)})}),V=je(),z=ht(),{isFocused:w,focusProps:Y}=Xe({autoFocus:C}),{isHovered:le,hoverProps:Q}=Je({isDisabled:N}),ee=U(n,x=>x.optionsElement),ne=he({open:M===S.Open,disabled:N,invalid:i.invalid,hover:le,focus:w,autofocus:C}),se=Pe({ref:p,id:d,role:"combobox",type:v,"aria-controls":ee==null?void 0:ee.id,"aria-expanded":M===S.Open,"aria-activedescendant":U(n,n.selectors.activeDescendantId),"aria-labelledby":V,"aria-describedby":z,"aria-autocomplete":"list",defaultValue:(a=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?h==null?void 0:h(i.defaultValue):null)!=null?a:i.defaultValue,disabled:N||void 0,autoFocus:C,onCompositionStart:A,onCompositionEnd:$,onKeyDown:F,onChange:G,onFocus:j,onBlur:q},Y,Q);return ye()({ourProps:se,theirProps:m,slot:ne,defaultTag:zo,name:"Combobox.Input"})}let Ho="button";function Uo(e,o){let t=Se("Combobox.Button"),a=ue("Combobox.Button"),[n,i]=c.useState(null),u=Oe(o,i,t.actions.setButtonElement),f=c.useId(),{id:d=`headlessui-combobox-button-${f}`,disabled:b=a.disabled||!1,autoFocus:h=!1,...N}=e,[C,v,m]=U(t,j=>[j.comboboxState,j.inputElement,j.optionsElement]),P=Qe(v),p=C===S.Open;oo(p,{trigger:n,action:c.useCallback(j=>{if(n!=null&&n.contains(j.target))return me.Ignore;if(v!=null&&v.contains(j.target))return me.Ignore;let V=j.target.closest('[role="option"]:not([data-disabled])');return yt(V)?me.Select(V):m!=null&&m.contains(j.target)?me.Ignore:me.Close},[n,v,m]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let M=_(j=>{switch(j.key){case X.Space:case X.Enter:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&re.flushSync(()=>t.actions.openCombobox()),P();return;case X.ArrowDown:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.First})),P();return;case X.ArrowUp:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.Last})),P();return;case X.Escape:if(t.state.comboboxState!==S.Open)return;j.preventDefault(),t.state.optionsElement&&!a.optionsPropsRef.current.static&&j.stopPropagation(),re.flushSync(()=>t.actions.closeCombobox()),P();return;default:return}}),y=no(()=>{t.state.comboboxState===S.Open?t.actions.closeCombobox():t.actions.openCombobox(),P()}),O=je([d]),{isFocusVisible:T,focusProps:L}=Xe({autoFocus:h}),{isHovered:E,hoverProps:A}=Je({isDisabled:b}),{pressed:$,pressProps:F}=St({disabled:b}),G=he({open:C===S.Open,active:$||C===S.Open,disabled:b,invalid:a.invalid,value:a.value,hover:E,focus:T}),q=Pe({ref:u,id:d,type:Ct(e,n),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":C===S.Open,"aria-labelledby":O,disabled:b||void 0,autoFocus:h,onKeyDown:M},y,L,A,F);return ye()({ourProps:q,theirProps:N,slot:G,defaultTag:Ho,name:"Combobox.Button"})}let Go="div",qo=Me.RenderStrategy|Me.Static;function Ko(e,o){var t,a,n;let i=c.useId(),{id:u=`headlessui-combobox-options-${i}`,hold:f=!1,anchor:d,portal:b=!1,modal:h=!0,transition:N=!1,...C}=e,v=Se("Combobox.Options"),m=ue("Combobox.Options"),P=co(d);P&&(b=!0);let[p,M]=uo(P),[y,O]=c.useState(null),T=po(),L=Oe(o,P?p:null,v.actions.setOptionsElement,O),[E,A,$,F,G]=U(v,s=>[s.comboboxState,s.inputElement,s.buttonElement,s.optionsElement,s.activationTrigger]),q=Re(A||$),j=Re(F),V=Ot(),[z,w]=Nt(N,y,V!==null?(V&Ce.Open)===Ce.Open:E===S.Open);wt(z,A,v.actions.closeCombobox);let Y=m.__demoMode?!1:h&&E===S.Open;Et(Y,j);let le=m.__demoMode?!1:h&&E===S.Open;jt(le,{allowed:c.useCallback(()=>[A,$,F],[A,$,F])});let Q=U(v,v.selectors.didInputMove)?!1:z;ie(()=>{var s;m.optionsPropsRef.current.static=(s=e.static)!=null?s:!1},[m.optionsPropsRef,e.static]),ie(()=>{m.optionsPropsRef.current.hold=f},[m.optionsPropsRef,f]),Mo(E===S.Open,{container:F,accept(s){return s.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:s.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(s){s.setAttribute("role","none")}});let ee=je([$==null?void 0:$.id]),ne=he({open:E===S.Open,option:void 0}),se=_(()=>{v.actions.setActivationTrigger(oe.Pointer)}),x=_(s=>{s.preventDefault(),v.actions.setActivationTrigger(oe.Pointer)}),K=Pe(P?T():{},{"aria-labelledby":ee,role:"listbox","aria-multiselectable":m.mode===Z.Multi?!0:void 0,id:u,ref:L,style:{...C.style,...M,"--input-width":Ue(z,A,!0).width,"--button-width":Ue(z,$,!0).width},onWheel:G===oe.Pointer?void 0:se,onMouseDown:x,...Pt(w)}),R=z&&E===S.Closed&&!e.static,D=He(R,(t=m.virtual)==null?void 0:t.options),k=He(R,m.value),B=c.useCallback(s=>m.compare(k,s),[m.compare,k]),I=c.useMemo(()=>{if(!m.virtual)return m;if(D===void 0)throw new Error("Missing `options` in virtual mode");return D!==m.virtual.options?{...m,virtual:{...m.virtual,options:D}}:m},[m,D,(a=m.virtual)==null?void 0:a.options]);m.virtual&&Object.assign(C,{children:W.createElement(xe.Provider,{value:I},W.createElement(Ao,{slot:ne},C.children))});let ae=ye(),Ne=c.useMemo(()=>m.mode===Z.Multi?m:{...m,isSelected:B},[m,B]);return W.createElement(It,{enabled:b?e.static||z:!1,ownerDocument:q},W.createElement(xe.Provider,{value:Ne},ae({ourProps:K,theirProps:{...C,children:W.createElement(so,{freeze:R},typeof C.children=="function"?(n=C.children)==null?void 0:n.call(C,ne):C.children)},slot:ne,defaultTag:Go,features:qo,visible:Q,name:"Combobox.Options"})))}let Wo="div";function Yo(e,o){var t,a,n;let i=ue("Combobox.Option"),u=Se("Combobox.Option"),f=c.useId(),{id:d=`headlessui-combobox-option-${f}`,value:b,disabled:h=(n=(a=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:a.call(t,b))!=null?n:!1,order:N=null,...C}=e,[v]=U(u,w=>[w.inputElement]),m=Qe(v),P=U(u,c.useCallback(w=>u.selectors.isActive(w,b,d),[b,d])),p=i.isSelected(b),M=c.useRef(null),y=Tt({disabled:h,value:b,domRef:M,order:N}),O=c.useContext(nt),T=Oe(o,M,O?O.measureElement:null),L=_(()=>{u.actions.setIsTyping(!1),u.actions.onChange(b)});ie(()=>u.actions.registerOption(d,y),[y,d]);let E=U(u,c.useCallback(w=>u.selectors.shouldScrollIntoView(w,b,d),[b,d]));ie(()=>{if(E)return kt().requestAnimationFrame(()=>{var w,Y;(Y=(w=M.current)==null?void 0:w.scrollIntoView)==null||Y.call(w,{block:"nearest"})})},[E,M]);let A=_(w=>{w.preventDefault(),w.button===ao.Left&&(h||(L(),$t()||requestAnimationFrame(()=>m()),i.mode===Z.Single&&u.actions.closeCombobox()))}),$=_(()=>{if(h)return u.actions.goToOption({focus:H.Nothing});let w=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:w})}),F=lo(),G=_(w=>F.update(w)),q=_(w=>{if(!F.wasMoved(w)||h||P&&u.state.activationTrigger===oe.Pointer)return;let Y=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:Y},oe.Pointer)}),j=_(w=>{F.wasMoved(w)&&(h||P&&(i.optionsPropsRef.current.hold||u.state.activationTrigger===oe.Pointer&&u.actions.goToOption({focus:H.Nothing})))}),V=he({active:P,focus:P,selected:p,disabled:h}),z={id:d,ref:T,role:"option",tabIndex:h===!0?void 0:-1,"aria-disabled":h===!0?!0:void 0,"aria-selected":p,disabled:void 0,onMouseDown:A,onFocus:$,onPointerEnter:G,onMouseEnter:G,onPointerMove:q,onMouseMove:q,onPointerLeave:j,onMouseLeave:j};return ye()({ourProps:z,theirProps:C,slot:V,defaultTag:Wo,name:"Combobox.Option"})}let Xo=ge(Lo),st=ge(Uo),at=ge(Bo),Jo=vt,lt=ge(Ko),it=ge(Yo),Zo=Object.assign(Xo,{Input:at,Button:st,Label:Jo,Options:lt,Option:it});/** +import{r as c,aR as _,aS as ut,aT as Te,aU as We,aV as ie,aW as dt,aX as pt,aY as ce,aZ as Ye,a_ as mt,a$ as bt,b0 as ft,b1 as ge,b2 as vt,b3 as xt,b4 as Oe,b5 as U,b6 as gt,b7 as ke,b8 as X,b9 as re,ba as $e,bb as je,bc as ht,bd as Xe,be as Je,bf as he,bg as Pe,bh as ye,bi as yt,bj as St,bk as Ct,bl as Re,bm as Ot,bn as Nt,bo as Ce,bp as wt,bq as Et,br as jt,bs as Pt,bt as W,bu as It,bv as Tt,bw as kt,bx as $t,by as Rt,bz as Mt,bA as Ft,bB as Dt,bC as _t,bD as At,bE as Vt,bF as Me,d as Lt,j as l,c as J,aC as zt,Y as Bt,$ as Ht,bG as Ut,N as Gt,a4 as qt,aa as Kt,ab as Wt,ay as Yt,aP as Xt,ac as Fe,P as De,bH as _e,bI as Ae,B as we,bJ as Ve,a5 as Le,bK as ze,a6 as Jt}from"./index-B9Nfzawy.js";import{c as Zt}from"./node-types-D2DQet2e.js";import{u as Qt}from"./chevron-up-DvNDOaHb.js";import{c as H,p as eo,a as ve,f as Be,b as to,L as oo,S as me,s as no,u as He,d as so,g as ao,e as lo,h as io}from"./element-movement-C8Yd7NWa.js";import{F as ro,y as co,R as uo,T as po,w as Ue,A as mo}from"./map-pin-Z2xK57U6.js";import{g as Ze,u as bo,R as fo,P as vo}from"./PacketList-CO1EDTYK.js";import{useGetDecodedContent as xo,useResolveSource as go}from"./usePipelineStore-Dto_OrsT.js";import{c as ho,a as yo,D as So,b as Co}from"./AnalyzerFilterPanel-DX4fviv1.js";import{u as Oo,r as No}from"./consumer-registry-B_rYsmHo.js";import{A as wo}from"./arrow-up-1am5_GF2.js";import{A as Eo}from"./arrow-right-BbRfzTpf.js";import{C as jo}from"./circle-x-i9YQ1o9T.js";import{P as Po,a as Io,B as To,C as Ge}from"./PageLayout-Da0xfaXb.js";import{T as ko,M as $o}from"./MqttModeBadge-Bgn-nTpu.js";import{F as qe}from"./funnel-DOec69-r.js";import{S as Ro}from"./search-BrfwwyYC.js";import"./primitives-DkuSh1mR.js";import"./badge-colors-BNUqIXCA.js";import"./chat-utils-CXtTpLY5.js";import"./SignalIndicator-BAKXIHs1.js";import"./chevron-right-jwX-OOTu.js";import"./circle-question-mark-Br2ku42v.js";import"./triangle-alert-_KPqiYkd.js";import"./DataBox-CCBd3sT4.js";import"./layers-DHyjQOGN.js";import"./hash-fRZDKNyT.js";import"./clock-CCOO2GB9.js";import"./activity-CcUqK62Y.js";import"./circle-check-m0ROsc83.js";import"./database-CSUiI1CG.js";import"./useMapViewStore-CAlaFCdd.js";import"./index-CHkxpv0k.js";import"./shield-5eYUHkwt.js";import"./zap-DME89Nfc.js";import"./monitor-smartphone-zVB5GYa6.js";function Qe(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return ut(e,"blur",t=>{let a=t.target;Te(a)&&(o.current={value:a.value,selectionStart:a.selectionStart,selectionEnd:a.selectionEnd})}),_(()=>{if(!We(e)&&Te(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==o.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:a}=o.current;t!==null&&a!==null&&e.setSelectionRange(t,a)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}function Mo(e,{container:o,accept:t,walk:a}){let n=c.useRef(t),i=c.useRef(a);c.useEffect(()=>{n.current=t,i.current=a},[t,a]),ie(()=>{if(!o||!e)return;let u=dt(o);if(!u)return;let f=n.current,d=i.current,b=Object.assign(N=>f(N),{acceptNode:f}),h=u.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,b,!1);for(;h.nextNode();)d(h.currentNode)},[o,e,n,i])}var Fo=Object.defineProperty,Do=(e,o,t)=>o in e?Fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Ke=(e,o,t)=>(Do(e,typeof o!="symbol"?o+"":o,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),Z=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Z||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oe||{}),et=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.DefaultToFirstOption=6]="DefaultToFirstOption",e[e.SetActivationTrigger=7]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",e[e.SetInputElement=9]="SetInputElement",e[e.SetButtonElement=10]="SetButtonElement",e[e.SetOptionsElement=11]="SetOptionsElement",e[e.MarkInputAsMoved=12]="MarkInputAsMoved",e))(et||{});function Ee(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,a=o(e.options.slice()),n=a.length>0&&a[0].dataRef.current.order!==null?a.sort((u,f)=>u.dataRef.current.order-f.dataRef.current.order):bt(a,u=>u.dataRef.current.domRef.current),i=t?n.indexOf(t):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}let _o={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?ve.Tracked(to(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:t,__demoMode:!1}},0(e){var o,t;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let a=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(a!==-1)return{...e,activeOptionIndex:a,comboboxState:0,__demoMode:!1,inputPositionState:ve.Idle}}return{...e,comboboxState:0,inputPositionState:ve.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,a,n,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((a=e.dataRef.current)!=null&&a.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:b,disabled:h}=e.virtual,N=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>b,resolveActiveIndex:()=>{var v,m;return(m=(v=e.activeOptionIndex)!=null?v:b.findIndex(P=>!h(P)))!=null?m:null},resolveDisabled:h,resolveId(){throw new Error("Function not implemented.")}}),C=(n=o.trigger)!=null?n:2;return e.activeOptionIndex===N&&e.activationTrigger===C?e:{...e,activeOptionIndex:N,activationTrigger:C,isTyping:!1,__demoMode:!1}}let u=Ee(e);if(u.activeOptionIndex===null){let b=u.options.findIndex(h=>!h.dataRef.current.disabled);b!==-1&&(u.activeOptionIndex=b)}let f=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:b=>b.id,resolveDisabled:b=>b.dataRef.current.disabled}),d=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===f&&e.activationTrigger===d?e:{...e,...u,isTyping:!1,activeOptionIndex:f,activationTrigger:d,__demoMode:!1}},4:(e,o)=>{var t,a,n,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let u=o.payload,f=Ee(e,b=>(b.push(u),b));e.activeOptionIndex===null&&(n=(a=e.dataRef.current).isSelected)!=null&&n.call(a,o.payload.dataRef.current.value)&&(f.activeOptionIndex=f.options.indexOf(u));let d={...e,...f,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(n=>n.id!==o.id)};let a=Ee(e,n=>{let i=n.findIndex(u=>u.id===o.id);return i!==-1&&n.splice(i,1),n});return{...e,...a,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,a;if(e.virtual===null)return{...e,virtual:{options:o.options,disabled:(t=o.disabled)!=null?t:()=>!1}};if(e.virtual.options===o.options&&e.virtual.disabled===o.disabled)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?n=i:n=null}return{...e,activeOptionIndex:n,virtual:{options:o.options,disabled:(a=o.disabled)!=null?a:()=>!1}}},9:(e,o)=>e.inputElement===o.element?e:{...e,inputElement:o.element},10:(e,o)=>e.buttonElement===o.element?e:{...e,buttonElement:o.element},11:(e,o)=>e.optionsElement===o.element?e:{...e,optionsElement:o.element},12(e){return e.inputPositionState.kind!=="Tracked"?e:{...e,inputPositionState:ve.Moved}}};class Ie extends pt{constructor(o){super(o),Ke(this,"actions",{onChange:t=>{let{onChange:a,compare:n,mode:i,value:u}=this.state.dataRef.current;return ce(i,{0:()=>a==null?void 0:a(t),1:()=>{let f=u.slice(),d=f.findIndex(b=>n(b,t));return d===-1?f.push(t):f.splice(d,1),a==null?void 0:a(f)}})},registerOption:(t,a)=>(this.send({type:4,payload:{id:t,dataRef:a}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(a.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,a)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:a})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,a;this.send({type:1}),this.send({type:6,value:!1}),(a=(t=this.state.dataRef.current).onClose)==null||a.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:a}=this.state.options[t];this.actions.onChange(a.current.value)}this.actions.goToOption({focus:H.Specific,idx:t})}},setInputElement:t=>{this.send({type:9,element:t})},setButtonElement:t=>{this.send({type:10,element:t})},setOptionsElement:t=>{this.send({type:11,element:t})}}),Ke(this,"selectors",{activeDescendantId:t=>{var a,n;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(n=t.options.find(u=>!u.dataRef.current.disabled&&t.dataRef.current.compare(u.dataRef.current.value,t.virtual.options[i])))==null?void 0:n.id:(a=t.options[i])==null?void 0:a.id},activeOptionIndex:t=>{if(t.defaultToFirstOption&&t.activeOptionIndex===null&&(t.virtual?t.virtual.options.length>0:t.options.length>0)){if(t.virtual){let{options:n,disabled:i}=t.virtual,u=n.findIndex(f=>{var d;return!((d=i==null?void 0:i(f))!=null&&d)});if(u!==-1)return u}let a=t.options.findIndex(n=>!n.dataRef.current.disabled);if(a!==-1)return a}return t.activeOptionIndex},activeOption:t=>{var a,n;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(n=(a=t.options[i])==null?void 0:a.dataRef.current.value)!=null?n:null},isActive:(t,a,n)=>{var i;let u=this.selectors.activeOptionIndex(t);return u===null?!1:t.virtual?u===t.dataRef.current.calculateIndex(a):((i=t.options[u])==null?void 0:i.id)===n},shouldScrollIntoView:(t,a,n)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,a,n)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,a=Ye.get(null);this.disposables.add(a.on(mt.Push,n=>{!a.selectors.isTop(n,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>a.actions.push(t)),this.on(1,()=>a.actions.pop(t))}this.disposables.group(t=>{this.on(1,a=>{a.inputElement&&(t.dispose(),t.add(eo(a.inputElement,a.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:a=!1}){var n;return new Ie({id:o,dataRef:{current:{}},comboboxState:a?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:a,inputPositionState:ve.Idle})}reduce(o,t){return ce(t.type,_o,o,t)}}const tt=c.createContext(null);function Se(e){let o=c.useContext(tt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ot),t}return o}function ot({id:e,virtual:o=null,__demoMode:t=!1}){let a=c.useMemo(()=>Ie.new({id:e,virtual:o,__demoMode:t}),[]);return ft(()=>a.dispose()),a}let xe=c.createContext(null);xe.displayName="ComboboxDataContext";function ue(e){let o=c.useContext(xe);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ue),t}return o}let nt=c.createContext(null);function Ao(e){let o=Se("VirtualProvider"),t=ue("VirtualProvider"),{options:a}=t.virtual,n=U(o,v=>v.optionsElement),[i,u]=c.useMemo(()=>{let v=n;if(!v)return[0,0];let m=window.getComputedStyle(v);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[n]),f=Qt({enabled:a.length!==0,scrollPaddingStart:i,scrollPaddingEnd:u,count:a.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[d,b]=c.useState(0);ie(()=>{b(v=>v+1)},[a]);let h=f.getVirtualItems(),N=U(o,v=>v.activationTrigger===oe.Pointer),C=U(o,o.selectors.activeOptionIndex);return h.length===0?null:W.createElement(nt.Provider,{value:f},W.createElement("div",{style:{position:"relative",width:"100%",height:`${f.getTotalSize()}px`},ref:v=>{v&&(N||C!==null&&a.length>C&&f.scrollToIndex(C))}},h.map(v=>{var m;return W.createElement(c.Fragment,{key:v.key},W.cloneElement((m=e.children)==null?void 0:m.call(e,{...e.slot,option:a[v.index]}),{key:`${d}-${v.key}`,"data-index":v.index,"aria-setsize":a.length,"aria-posinset":v.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${v.start}px)`,overflowAnchor:"none"}}))})))}let Vo=c.Fragment;function Lo(e,o){let t=c.useId(),a=Rt(),{value:n,defaultValue:i,onChange:u,form:f,name:d,by:b,invalid:h=!1,disabled:N=a||!1,onClose:C,__demoMode:v=!1,multiple:m=!1,immediate:P=!1,virtual:p=null,nullable:M,...y}=e,O=Mt(i),[T=m?[]:void 0,L]=Ft(n,u,O),E=ot({id:t,virtual:p,__demoMode:v}),A=c.useRef({static:!1,hold:!1}),$=io(b),F=_(I=>p?b===null?p.options.indexOf(I):p.options.findIndex(ae=>$(ae,I)):E.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),G=c.useCallback(I=>ce(V.mode,{[Z.Multi]:()=>T.some(ae=>$(ae,I)),[Z.Single]:()=>$(T,I)}),[T]),q=U(E,I=>I.virtual),j=_(()=>C==null?void 0:C()),V=c.useMemo(()=>({__demoMode:v,immediate:P,optionsPropsRef:A,value:T,defaultValue:O,disabled:N,invalid:h,mode:m?Z.Multi:Z.Single,virtual:p?q:null,onChange:L,isSelected:G,calculateIndex:F,compare:$,onClose:j}),[v,P,A,T,O,N,h,m,p,q,L,G,F,$,j]);ie(()=>{var I;p&&E.send({type:et.UpdateVirtualConfiguration,options:p.options,disabled:(I=p.disabled)!=null?I:null})},[p,p==null?void 0:p.options,p==null?void 0:p.disabled]),ie(()=>{E.state.dataRef.current=V},[V]);let[z,w,Y,le]=U(E,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),Q=Ye.get(null),ee=U(Q,c.useCallback(I=>Q.selectors.isTop(I,t),[Q,t]));Dt(ee,[w,Y,le],()=>E.actions.closeCombobox());let ne=U(E,E.selectors.activeOptionIndex),se=U(E,E.selectors.activeOption),x=he({open:z===S.Open,disabled:N,invalid:h,activeIndex:ne,activeOption:se,value:T}),[K,R]=_t(),D=o===null?{}:{ref:o},k=c.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),B=ye();return W.createElement(R,{value:K,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:z===S.Open,disabled:N}},W.createElement(mo,null,W.createElement(xe.Provider,{value:V},W.createElement(tt.Provider,{value:E},W.createElement(At,{value:ce(z,{[S.Open]:Ce.Open,[S.Closed]:Ce.Closed})},d!=null&&W.createElement(Vt,{disabled:N,data:T!=null?{[d]:T}:{},form:f,onReset:k}),B({ourProps:D,theirProps:y,slot:x,defaultTag:Vo,name:"Combobox"}))))))}let zo="input";function Bo(e,o){var t,a;let n=Se("Combobox.Input"),i=ue("Combobox.Input"),u=c.useId(),f=xt(),{id:d=f||`headlessui-combobox-input-${u}`,onChange:b,displayValue:h,disabled:N=i.disabled||!1,autoFocus:C=!1,type:v="text",...m}=e,P=c.useRef(null),p=Oe(P,o,ro(),n.actions.setInputElement),[M,y]=U(n,x=>[x.comboboxState,x.isTyping]),O=gt(),T=_(()=>{n.actions.onChange(null),n.state.optionsElement&&(n.state.optionsElement.scrollTop=0),n.actions.goToOption({focus:H.Nothing})}),L=c.useMemo(()=>{var x;return typeof h=="function"&&i.value!==void 0?(x=h(i.value))!=null?x:"":typeof i.value=="string"?i.value:""},[i.value,h]);ke(([x,K],[R,D])=>{if(n.state.isTyping)return;let k=P.current;k&&((D===S.Open&&K===S.Closed||x!==R)&&(k.value=x),requestAnimationFrame(()=>{if(n.state.isTyping||!k||We(k))return;let{selectionStart:B,selectionEnd:I}=k;Math.abs((I??0)-(B??0))===0&&B===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[L,M,y]),ke(([x],[K])=>{if(x===S.Open&&K===S.Closed){if(n.state.isTyping)return;let R=P.current;if(!R)return;let D=R.value,{selectionStart:k,selectionEnd:B,selectionDirection:I}=R;R.value="",R.value=D,I!==null?R.setSelectionRange(k,B,I):R.setSelectionRange(k,B)}},[M]);let E=c.useRef(!1),A=_(()=>{E.current=!0}),$=_(()=>{O.nextFrame(()=>{E.current=!1})}),F=_(x=>{switch(n.actions.setIsTyping(!0),x.key){case X.Enter:if(n.state.comboboxState!==S.Open||E.current)return;if(x.preventDefault(),x.stopPropagation(),n.selectors.activeOptionIndex(n.state)===null){n.actions.closeCombobox();return}n.actions.selectActiveOption(),i.mode===Z.Single&&n.actions.closeCombobox();break;case X.ArrowDown:return x.preventDefault(),x.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Next}),[S.Closed]:()=>n.actions.openCombobox()});case X.ArrowUp:return x.preventDefault(),x.stopPropagation(),ce(n.state.comboboxState,{[S.Open]:()=>n.actions.goToOption({focus:H.Previous}),[S.Closed]:()=>{re.flushSync(()=>n.actions.openCombobox()),i.value||n.actions.goToOption({focus:H.Last})}});case X.Home:if(n.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.First});case X.PageUp:return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.First});case X.End:if(n.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.PageDown:return x.preventDefault(),x.stopPropagation(),n.actions.goToOption({focus:H.Last});case X.Escape:return n.state.comboboxState!==S.Open?void 0:(x.preventDefault(),n.state.optionsElement&&!i.optionsPropsRef.current.static&&x.stopPropagation(),i.mode===Z.Single&&i.value===null&&T(),n.actions.closeCombobox());case X.Tab:if(n.actions.setIsTyping(!1),n.state.comboboxState!==S.Open)return;i.mode===Z.Single&&n.state.activationTrigger!==oe.Focus&&n.actions.selectActiveOption(),n.actions.closeCombobox();break}}),G=_(x=>{b==null||b(x),i.mode===Z.Single&&x.target.value===""&&T(),n.actions.openCombobox()}),q=_(x=>{var K,R,D;let k=(K=x.relatedTarget)!=null?K:$e.find(B=>B!==x.currentTarget);if(!((R=n.state.optionsElement)!=null&&R.contains(k))&&!((D=n.state.buttonElement)!=null&&D.contains(k))&&n.state.comboboxState===S.Open)return x.preventDefault(),i.mode===Z.Single&&i.value===null&&T(),n.actions.closeCombobox()}),j=_(x=>{var K,R,D;let k=(K=x.relatedTarget)!=null?K:$e.find(B=>B!==x.currentTarget);(R=n.state.buttonElement)!=null&&R.contains(k)||(D=n.state.optionsElement)!=null&&D.contains(k)||i.disabled||i.immediate&&n.state.comboboxState!==S.Open&&O.microTask(()=>{re.flushSync(()=>n.actions.openCombobox()),n.actions.setActivationTrigger(oe.Focus)})}),V=je(),z=ht(),{isFocused:w,focusProps:Y}=Xe({autoFocus:C}),{isHovered:le,hoverProps:Q}=Je({isDisabled:N}),ee=U(n,x=>x.optionsElement),ne=he({open:M===S.Open,disabled:N,invalid:i.invalid,hover:le,focus:w,autofocus:C}),se=Pe({ref:p,id:d,role:"combobox",type:v,"aria-controls":ee==null?void 0:ee.id,"aria-expanded":M===S.Open,"aria-activedescendant":U(n,n.selectors.activeDescendantId),"aria-labelledby":V,"aria-describedby":z,"aria-autocomplete":"list",defaultValue:(a=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?h==null?void 0:h(i.defaultValue):null)!=null?a:i.defaultValue,disabled:N||void 0,autoFocus:C,onCompositionStart:A,onCompositionEnd:$,onKeyDown:F,onChange:G,onFocus:j,onBlur:q},Y,Q);return ye()({ourProps:se,theirProps:m,slot:ne,defaultTag:zo,name:"Combobox.Input"})}let Ho="button";function Uo(e,o){let t=Se("Combobox.Button"),a=ue("Combobox.Button"),[n,i]=c.useState(null),u=Oe(o,i,t.actions.setButtonElement),f=c.useId(),{id:d=`headlessui-combobox-button-${f}`,disabled:b=a.disabled||!1,autoFocus:h=!1,...N}=e,[C,v,m]=U(t,j=>[j.comboboxState,j.inputElement,j.optionsElement]),P=Qe(v),p=C===S.Open;oo(p,{trigger:n,action:c.useCallback(j=>{if(n!=null&&n.contains(j.target))return me.Ignore;if(v!=null&&v.contains(j.target))return me.Ignore;let V=j.target.closest('[role="option"]:not([data-disabled])');return yt(V)?me.Select(V):m!=null&&m.contains(j.target)?me.Ignore:me.Close},[n,v,m]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let M=_(j=>{switch(j.key){case X.Space:case X.Enter:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&re.flushSync(()=>t.actions.openCombobox()),P();return;case X.ArrowDown:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.First})),P();return;case X.ArrowUp:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.Last})),P();return;case X.Escape:if(t.state.comboboxState!==S.Open)return;j.preventDefault(),t.state.optionsElement&&!a.optionsPropsRef.current.static&&j.stopPropagation(),re.flushSync(()=>t.actions.closeCombobox()),P();return;default:return}}),y=no(()=>{t.state.comboboxState===S.Open?t.actions.closeCombobox():t.actions.openCombobox(),P()}),O=je([d]),{isFocusVisible:T,focusProps:L}=Xe({autoFocus:h}),{isHovered:E,hoverProps:A}=Je({isDisabled:b}),{pressed:$,pressProps:F}=St({disabled:b}),G=he({open:C===S.Open,active:$||C===S.Open,disabled:b,invalid:a.invalid,value:a.value,hover:E,focus:T}),q=Pe({ref:u,id:d,type:Ct(e,n),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":C===S.Open,"aria-labelledby":O,disabled:b||void 0,autoFocus:h,onKeyDown:M},y,L,A,F);return ye()({ourProps:q,theirProps:N,slot:G,defaultTag:Ho,name:"Combobox.Button"})}let Go="div",qo=Me.RenderStrategy|Me.Static;function Ko(e,o){var t,a,n;let i=c.useId(),{id:u=`headlessui-combobox-options-${i}`,hold:f=!1,anchor:d,portal:b=!1,modal:h=!0,transition:N=!1,...C}=e,v=Se("Combobox.Options"),m=ue("Combobox.Options"),P=co(d);P&&(b=!0);let[p,M]=uo(P),[y,O]=c.useState(null),T=po(),L=Oe(o,P?p:null,v.actions.setOptionsElement,O),[E,A,$,F,G]=U(v,s=>[s.comboboxState,s.inputElement,s.buttonElement,s.optionsElement,s.activationTrigger]),q=Re(A||$),j=Re(F),V=Ot(),[z,w]=Nt(N,y,V!==null?(V&Ce.Open)===Ce.Open:E===S.Open);wt(z,A,v.actions.closeCombobox);let Y=m.__demoMode?!1:h&&E===S.Open;Et(Y,j);let le=m.__demoMode?!1:h&&E===S.Open;jt(le,{allowed:c.useCallback(()=>[A,$,F],[A,$,F])});let Q=U(v,v.selectors.didInputMove)?!1:z;ie(()=>{var s;m.optionsPropsRef.current.static=(s=e.static)!=null?s:!1},[m.optionsPropsRef,e.static]),ie(()=>{m.optionsPropsRef.current.hold=f},[m.optionsPropsRef,f]),Mo(E===S.Open,{container:F,accept(s){return s.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:s.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(s){s.setAttribute("role","none")}});let ee=je([$==null?void 0:$.id]),ne=he({open:E===S.Open,option:void 0}),se=_(()=>{v.actions.setActivationTrigger(oe.Pointer)}),x=_(s=>{s.preventDefault(),v.actions.setActivationTrigger(oe.Pointer)}),K=Pe(P?T():{},{"aria-labelledby":ee,role:"listbox","aria-multiselectable":m.mode===Z.Multi?!0:void 0,id:u,ref:L,style:{...C.style,...M,"--input-width":Ue(z,A,!0).width,"--button-width":Ue(z,$,!0).width},onWheel:G===oe.Pointer?void 0:se,onMouseDown:x,...Pt(w)}),R=z&&E===S.Closed&&!e.static,D=He(R,(t=m.virtual)==null?void 0:t.options),k=He(R,m.value),B=c.useCallback(s=>m.compare(k,s),[m.compare,k]),I=c.useMemo(()=>{if(!m.virtual)return m;if(D===void 0)throw new Error("Missing `options` in virtual mode");return D!==m.virtual.options?{...m,virtual:{...m.virtual,options:D}}:m},[m,D,(a=m.virtual)==null?void 0:a.options]);m.virtual&&Object.assign(C,{children:W.createElement(xe.Provider,{value:I},W.createElement(Ao,{slot:ne},C.children))});let ae=ye(),Ne=c.useMemo(()=>m.mode===Z.Multi?m:{...m,isSelected:B},[m,B]);return W.createElement(It,{enabled:b?e.static||z:!1,ownerDocument:q},W.createElement(xe.Provider,{value:Ne},ae({ourProps:K,theirProps:{...C,children:W.createElement(so,{freeze:R},typeof C.children=="function"?(n=C.children)==null?void 0:n.call(C,ne):C.children)},slot:ne,defaultTag:Go,features:qo,visible:Q,name:"Combobox.Options"})))}let Wo="div";function Yo(e,o){var t,a,n;let i=ue("Combobox.Option"),u=Se("Combobox.Option"),f=c.useId(),{id:d=`headlessui-combobox-option-${f}`,value:b,disabled:h=(n=(a=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:a.call(t,b))!=null?n:!1,order:N=null,...C}=e,[v]=U(u,w=>[w.inputElement]),m=Qe(v),P=U(u,c.useCallback(w=>u.selectors.isActive(w,b,d),[b,d])),p=i.isSelected(b),M=c.useRef(null),y=Tt({disabled:h,value:b,domRef:M,order:N}),O=c.useContext(nt),T=Oe(o,M,O?O.measureElement:null),L=_(()=>{u.actions.setIsTyping(!1),u.actions.onChange(b)});ie(()=>u.actions.registerOption(d,y),[y,d]);let E=U(u,c.useCallback(w=>u.selectors.shouldScrollIntoView(w,b,d),[b,d]));ie(()=>{if(E)return kt().requestAnimationFrame(()=>{var w,Y;(Y=(w=M.current)==null?void 0:w.scrollIntoView)==null||Y.call(w,{block:"nearest"})})},[E,M]);let A=_(w=>{w.preventDefault(),w.button===ao.Left&&(h||(L(),$t()||requestAnimationFrame(()=>m()),i.mode===Z.Single&&u.actions.closeCombobox()))}),$=_(()=>{if(h)return u.actions.goToOption({focus:H.Nothing});let w=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:w})}),F=lo(),G=_(w=>F.update(w)),q=_(w=>{if(!F.wasMoved(w)||h||P&&u.state.activationTrigger===oe.Pointer)return;let Y=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:Y},oe.Pointer)}),j=_(w=>{F.wasMoved(w)&&(h||P&&(i.optionsPropsRef.current.hold||u.state.activationTrigger===oe.Pointer&&u.actions.goToOption({focus:H.Nothing})))}),V=he({active:P,focus:P,selected:p,disabled:h}),z={id:d,ref:T,role:"option",tabIndex:h===!0?void 0:-1,"aria-disabled":h===!0?!0:void 0,"aria-selected":p,disabled:void 0,onMouseDown:A,onFocus:$,onPointerEnter:G,onMouseEnter:G,onPointerMove:q,onMouseMove:q,onPointerLeave:j,onMouseLeave:j};return ye()({ourProps:z,theirProps:C,slot:V,defaultTag:Wo,name:"Combobox.Option"})}let Xo=ge(Lo),st=ge(Uo),at=ge(Bo),Jo=vt,lt=ge(Ko),it=ge(Yo),Zo=Object.assign(Xo,{Input:at,Button:st,Label:Jo,Options:lt,Option:it});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PageLayout-F1v-IzhG.js b/frontend/dist/assets/PageLayout-Da0xfaXb.js similarity index 89% rename from frontend/dist/assets/PageLayout-F1v-IzhG.js rename to frontend/dist/assets/PageLayout-Da0xfaXb.js index c4beda87..2f596e65 100644 --- a/frontend/dist/assets/PageLayout-F1v-IzhG.js +++ b/frontend/dist/assets/PageLayout-Da0xfaXb.js @@ -1 +1 @@ -import{j as e,W as o,c as x,aO as d,r,fx as f}from"./index-DZK2INMD.js";function p({children:a,className:s}){return e.jsx("div",{className:x("section-gap",s),children:a})}function j({children:a,className:s,ready:t}){const n=d(),i=t??n,[m,c]=r.useState(!1);return r.useEffect(()=>{if(!i){c(!1);return}let l=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{l||r.startTransition(()=>c(!0))})}),()=>{l=!0}},[i]),e.jsx(f.Provider,{value:m,children:e.jsx("div",{className:x("bento-section",s),children:a})})}function g({title:a,icon:s,controls:t,subtitle:n}){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("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})]}),t&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:t})]}),n&&e.jsx("div",{children:n})]})}function h({size:a,...s}){return e.jsx(o,{...s})}export{j as B,h as C,p as P,g as a}; +import{j as e,W as o,c as x,aO as d,r,fx as f}from"./index-B9Nfzawy.js";function p({children:a,className:s}){return e.jsx("div",{className:x("section-gap",s),children:a})}function j({children:a,className:s,ready:t}){const n=d(),i=t??n,[m,c]=r.useState(!1);return r.useEffect(()=>{if(!i){c(!1);return}let l=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{l||r.startTransition(()=>c(!0))})}),()=>{l=!0}},[i]),e.jsx(f.Provider,{value:m,children:e.jsx("div",{className:x("bento-section",s),children:a})})}function g({title:a,icon:s,controls:t,subtitle:n}){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("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})]}),t&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:t})]}),n&&e.jsx("div",{children:n})]})}function h({size:a,...s}){return e.jsx(o,{...s})}export{j as B,h as C,p as P,g as a}; diff --git a/frontend/dist/assets/PathMapMapLibre-Cu9lMTiD.js b/frontend/dist/assets/PathMapMapLibre-63u_fpZD.js similarity index 98% rename from frontend/dist/assets/PathMapMapLibre-Cu9lMTiD.js rename to frontend/dist/assets/PathMapMapLibre-63u_fpZD.js index 258634e5..27de4823 100644 --- a/frontend/dist/assets/PathMapMapLibre-Cu9lMTiD.js +++ b/frontend/dist/assets/PathMapMapLibre-63u_fpZD.js @@ -1,4 +1,4 @@ -import{d as ae,r as a,cS as ie,c4 as le,bX as de,fy as ce,Z as q,c7 as ue,j as t,R as K,c as z,fz as pe}from"./index-DZK2INMD.js";import{M as me,B as fe,S as ge,L as he,a as Y,P as xe}from"./BasemapLayer-DFBOwIT2.js";import{H as ye}from"./useMapViewStore-DGeq1iXE.js";import"./index-C-Mp31KV.js";/** +import{d as ae,r as a,cS as ie,c4 as le,bX as de,fy as ce,Z as q,c7 as ue,j as t,R as K,c as z,fz as pe}from"./index-B9Nfzawy.js";import{M as me,B as fe,S as ge,L as he,a as Y,P as xe}from"./BasemapLayer--gGy0d8r.js";import{H as ye}from"./useMapViewStore-CAlaFCdd.js";import"./index-CHkxpv0k.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RoomServer-bhKhtLG3.js b/frontend/dist/assets/RoomServer-y-ltkQOG.js similarity index 97% rename from frontend/dist/assets/RoomServer-bhKhtLG3.js rename to frontend/dist/assets/RoomServer-y-ltkQOG.js index 7279a70b..7f57c474 100644 --- a/frontend/dist/assets/RoomServer-bhKhtLG3.js +++ b/frontend/dist/assets/RoomServer-y-ltkQOG.js @@ -1,4 +1,4 @@ -import{d as I,j as e,dA as Fe,c as L,b2 as Oe,ep as Be,r as o,ck as W,a8 as ze,aA as qe,aI as He,aB as Ge,R as U,I as z,eq as Ue,B as F,c3 as Re,aC as ue,L as Ve,a5 as se,a1 as Me,Y as V,$ as We,er as Te,es as Ye,bG as Le,et as Ie,eu as Xe,ev as Ze,ew as Je,ex as Qe,ey as es,ez as ss,eA as ts,a4 as as,N as ns,ek as rs,cm as xe}from"./index-DZK2INMD.js";import{C as G,P as pe,a as he,B as ls}from"./PageLayout-F1v-IzhG.js";import{R as os,C as ge}from"./Grid-TGa3qLqq.js";import{c as is,m as cs}from"./node-types-Cj1JOOlq.js";import{R as ds,K as ms}from"./repeat-BAyKJWpi.js";import{L as us,a as xs,b as ps}from"./listbox-DR8wL7aQ.js";import{P as hs}from"./plus-Dm1LTbFN.js";import{M as J}from"./map-pin-qwXb-K8z.js";import{T as Ae}from"./trash-2-B1qiliQL.js";import{S as Q,K as Y}from"./KeycapButton-DgnjUPsG.js";import{C as fe}from"./ConfirmModal-CkTTKNiq.js";import{S as gs,C as fs,M as js}from"./ChatBubble-BfbDZnhb.js";import{e as vs,g as ys,a as Ns}from"./chat-utils-B9fA4l9w.js";import{W as ee}from"./wifi-DPjA-ySX.js";import"./element-movement-BZO5MqZi.js";import"./keycap-sfx-ByZp-njj.js";import"./triangle-alert-z32LI9zM.js";/** +import{d as I,j as e,dA as Fe,c as L,b2 as Oe,ep as Be,r as o,ck as W,a8 as ze,aA as qe,aI as He,aB as Ge,R as U,I as z,eq as Ue,B as F,c3 as Re,aC as ue,L as Ve,a5 as se,a1 as Me,Y as V,$ as We,er as Te,es as Ye,bG as Le,et as Ie,eu as Xe,ev as Ze,ew as Je,ex as Qe,ey as es,ez as ss,eA as ts,a4 as as,N as ns,ek as rs,cm as xe}from"./index-B9Nfzawy.js";import{C as G,P as pe,a as he,B as ls}from"./PageLayout-Da0xfaXb.js";import{R as os,C as ge}from"./Grid-CbgS5PRh.js";import{c as is,m as cs}from"./node-types-D2DQet2e.js";import{R as ds,K as ms}from"./repeat-C00vzJTj.js";import{L as us,a as xs,b as ps}from"./listbox-DV2L-QZw.js";import{P as hs}from"./plus-B7jylh_n.js";import{M as J}from"./map-pin-Z2xK57U6.js";import{T as Ae}from"./trash-2-BxrPvo_t.js";import{S as Q,K as Y}from"./KeycapButton-DPkSXt-J.js";import{C as fe}from"./ConfirmModal-CsrIdG-V.js";import{S as gs,C as fs,M as js}from"./ChatBubble-fzIllzhe.js";import{e as vs,g as ys,a as Ns}from"./chat-utils-CXtTpLY5.js";import{W as ee}from"./wifi-BpM3uttU.js";import"./element-movement-C8Yd7NWa.js";import"./keycap-sfx-ByZp-njj.js";import"./triangle-alert-_KPqiYkd.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Sessions-CBUF-gp6.js b/frontend/dist/assets/Sessions-D0mPmO8l.js similarity index 95% rename from frontend/dist/assets/Sessions-CBUF-gp6.js rename to frontend/dist/assets/Sessions-D0mPmO8l.js index 94a1d9ab..0c1aa6d1 100644 --- a/frontend/dist/assets/Sessions-CBUF-gp6.js +++ b/frontend/dist/assets/Sessions-D0mPmO8l.js @@ -1,4 +1,4 @@ -import{d as b,r as l,f4 as O,f5 as z,e1 as U,j as e,B as g,a0 as M,Y as J,bG as C,c as N,es as Q,cM as V,ck as Y}from"./index-DZK2INMD.js";import{C as Z}from"./ConfirmModal-CkTTKNiq.js";import{D as W}from"./DataBox-BEDP2Kxh.js";import{P as X,a as ee,B as se,C as P}from"./PageLayout-F1v-IzhG.js";import{R as ae}from"./refresh-cw-DzrjsyBC.js";import{R as T,C as y}from"./Grid-TGa3qLqq.js";import{S as B}from"./shield-check-8Y0lJQvU.js";import{C as te}from"./circle-question-mark-BdE_X9p5.js";import{T as le}from"./triangle-alert-z32LI9zM.js";import{S as ie}from"./shield-tOGn5YjL.js";import{A as ne}from"./antenna-DwKMmyHW.js";import{T as D}from"./trash-2-B1qiliQL.js";/** +import{d as b,r as l,f4 as O,f5 as z,e1 as U,j as e,B as g,a0 as M,Y as J,bG as C,c as N,es as Q,cM as V,ck as Y}from"./index-B9Nfzawy.js";import{C as Z}from"./ConfirmModal-CsrIdG-V.js";import{D as W}from"./DataBox-CCBd3sT4.js";import{P as X,a as ee,B as se,C as P}from"./PageLayout-Da0xfaXb.js";import{R as ae}from"./refresh-cw-hB3ADAmy.js";import{R as T,C as y}from"./Grid-CbgS5PRh.js";import{S as B}from"./shield-check-Bx84Eo-l.js";import{C as te}from"./circle-question-mark-Br2ku42v.js";import{T as le}from"./triangle-alert-_KPqiYkd.js";import{S as ie}from"./shield-5eYUHkwt.js";import{A as ne}from"./antenna-DHhoJnxo.js";import{T as D}from"./trash-2-BxrPvo_t.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/SignalIndicator-BlRL2nuG.js b/frontend/dist/assets/SignalIndicator-BAKXIHs1.js similarity index 99% rename from frontend/dist/assets/SignalIndicator-BlRL2nuG.js rename to frontend/dist/assets/SignalIndicator-BAKXIHs1.js index cfc12e2c..a08b6950 100644 --- a/frontend/dist/assets/SignalIndicator-BlRL2nuG.js +++ b/frontend/dist/assets/SignalIndicator-BAKXIHs1.js @@ -1,4 +1,4 @@ -import{d as l,r as m,c as i,j as r,cu as j,cv as _,cw as k}from"./index-DZK2INMD.js";/** +import{d as l,r as m,c as i,j as r,cu as j,cv as _,cw as k}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Statistics-D6VRKkm_.js b/frontend/dist/assets/Statistics-CltP1h12.js similarity index 98% rename from frontend/dist/assets/Statistics-D6VRKkm_.js rename to frontend/dist/assets/Statistics-CltP1h12.js index e2d52301..d00f92d2 100644 --- a/frontend/dist/assets/Statistics-D6VRKkm_.js +++ b/frontend/dist/assets/Statistics-CltP1h12.js @@ -1,4 +1,4 @@ -var Rt=Object.defineProperty;var Tt=(t,s,n)=>s in t?Rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var ye=(t,s,n)=>Tt(t,typeof s!="symbol"?s+"":s,n);import{d as Re,r as o,j as e,F as Ae,c as at,P as Nt,cx as vt,cy as et,v as we,cz as Dt,R as _e,cA as Et,cB as Lt,cC as It,w as Pt,cD as Ot,cE as Ft,cF as Ht,cG as Bt,cH as $t,c4 as zt,cI as $e,c7 as Wt,cJ as Ut,cK as Gt,a5 as ke,cL as qt,ad as kt,ae as Vt,cM as Kt,bI as Yt,a4 as Xt,aa as Zt,a9 as Qt,N as Jt,aO as es,aP as ts,ab as ss,ay as ns,cN as ze,ah as as,cO as it,aq as is,a8 as rs,cP as ls}from"./index-DZK2INMD.js";import{L as Se}from"./layers-Bh2LK6a1.js";import{u as tt,h as os,r as st}from"./consumer-registry-C58OO1Zb.js";import{C as We,e as cs}from"./easing-D7lsSq8M.js";import{T as ms,M as ds}from"./MqttModeBadge-CK543WcH.js";import{C as he,P as us,a as hs,B as xs}from"./PageLayout-F1v-IzhG.js";import{D as ps}from"./DataBox-BEDP2Kxh.js";import{A as Ue,D as Oe}from"./DataValue-C6Gh85-I.js";import{C as fs}from"./CollisionExplorerModal-Cb8lVNAn.js";import{H as rt}from"./hash-Bx-gtxz0.js";import{T as lt}from"./triangle-alert-z32LI9zM.js";import{L as Fe}from"./LightSparkline-D9e7Om82.js";import{A as gs}from"./activity-F7Po-3Al.js";import{c as bs,a as ys,A as js}from"./AnalyzerFilterPanel-Cx2An8MF.js";import{useResolveSource as Ns}from"./usePipelineStore-BRm0f890.js";import{R as je,C as Ce}from"./Grid-TGa3qLqq.js";import{S as vs}from"./settings-2-CKbtmc0u.js";import{N as ks}from"./network-CfluO-Ty.js";import"./chevron-right-DYHNTpxG.js";import"./map-pin-qwXb-K8z.js";import"./index-C-Mp31KV.js";import"./BasemapLayer-DFBOwIT2.js";import"./monitor-smartphone-BKehVovy.js";import"./node-types-Cj1JOOlq.js";import"./circle-question-mark-BdE_X9p5.js";import"./funnel-ClRHq7Ic.js";import"./search-DRsZhueb.js";/** +var Rt=Object.defineProperty;var Tt=(t,s,n)=>s in t?Rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var ye=(t,s,n)=>Tt(t,typeof s!="symbol"?s+"":s,n);import{d as Re,r as o,j as e,F as Ae,c as at,P as Nt,cx as vt,cy as et,v as we,cz as Dt,R as _e,cA as Et,cB as Lt,cC as It,w as Pt,cD as Ot,cE as Ft,cF as Ht,cG as Bt,cH as $t,c4 as zt,cI as $e,c7 as Wt,cJ as Ut,cK as Gt,a5 as ke,cL as qt,ad as kt,ae as Vt,cM as Kt,bI as Yt,a4 as Xt,aa as Zt,a9 as Qt,N as Jt,aO as es,aP as ts,ab as ss,ay as ns,cN as ze,ah as as,cO as it,aq as is,a8 as rs,cP as ls}from"./index-B9Nfzawy.js";import{L as Se}from"./layers-DHyjQOGN.js";import{u as tt,h as os,r as st}from"./consumer-registry-B_rYsmHo.js";import{C as We,e as cs}from"./easing-VuIK-HqT.js";import{T as ms,M as ds}from"./MqttModeBadge-Bgn-nTpu.js";import{C as he,P as us,a as hs,B as xs}from"./PageLayout-Da0xfaXb.js";import{D as ps}from"./DataBox-CCBd3sT4.js";import{A as Ue,D as Oe}from"./DataValue-Ddo4mrzf.js";import{C as fs}from"./CollisionExplorerModal-J7HE0WX3.js";import{H as rt}from"./hash-fRZDKNyT.js";import{T as lt}from"./triangle-alert-_KPqiYkd.js";import{L as Fe}from"./LightSparkline-DTXOFhS4.js";import{A as gs}from"./activity-CcUqK62Y.js";import{c as bs,a as ys,A as js}from"./AnalyzerFilterPanel-DX4fviv1.js";import{useResolveSource as Ns}from"./usePipelineStore-Dto_OrsT.js";import{R as je,C as Ce}from"./Grid-CbgS5PRh.js";import{S as vs}from"./settings-2-DYzgUEwY.js";import{N as ks}from"./network-BCB-csrZ.js";import"./chevron-right-jwX-OOTu.js";import"./map-pin-Z2xK57U6.js";import"./index-CHkxpv0k.js";import"./BasemapLayer--gGy0d8r.js";import"./monitor-smartphone-zVB5GYa6.js";import"./node-types-D2DQet2e.js";import"./circle-question-mark-Br2ku42v.js";import"./funnel-DOec69-r.js";import"./search-BrfwwyYC.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/System-WIc48OFP.js b/frontend/dist/assets/System-Bl4s4lrg.js similarity index 98% rename from frontend/dist/assets/System-WIc48OFP.js rename to frontend/dist/assets/System-Bl4s4lrg.js index 1925f9fa..1bcb8bf1 100644 --- a/frontend/dist/assets/System-WIc48OFP.js +++ b/frontend/dist/assets/System-Bl4s4lrg.js @@ -1,4 +1,4 @@ -import{d as Z,aH as B,L as F,r as l,K as q,j as e,dE as Y,c as A,a5 as P,dF as te,dG as se,dH as re,dI as ne,cx as ae,B as oe,dJ as le,dK as G}from"./index-DZK2INMD.js";import{C as E,P as ce,a as ie,B as de}from"./PageLayout-F1v-IzhG.js";import{T as me}from"./triangle-alert-z32LI9zM.js";import{a as ue,A as xe}from"./arrow-up-DJJcQ7dG.js";import{N as fe}from"./network-CfluO-Ty.js";import{A as D}from"./activity-F7Po-3Al.js";import{R as he}from"./refresh-cw-DzrjsyBC.js";import{C as pe}from"./cpu-C2F1drgJ.js";import{R as H,C as $}from"./Grid-TGa3qLqq.js";/** +import{d as Z,aH as B,L as F,r as l,K as q,j as e,dE as Y,c as A,a5 as P,dF as te,dG as se,dH as re,dI as ne,cx as ae,B as oe,dJ as le,dK as G}from"./index-B9Nfzawy.js";import{C as E,P as ce,a as ie,B as de}from"./PageLayout-Da0xfaXb.js";import{T as me}from"./triangle-alert-_KPqiYkd.js";import{a as ue,A as xe}from"./arrow-up-1am5_GF2.js";import{N as fe}from"./network-BCB-csrZ.js";import{A as D}from"./activity-CcUqK62Y.js";import{R as he}from"./refresh-cw-hB3ADAmy.js";import{C as pe}from"./cpu-lxveD9wi.js";import{R as H,C as $}from"./Grid-CbgS5PRh.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Terminal-D95YImn8.js b/frontend/dist/assets/Terminal-D7cLoYyV.js similarity index 99% rename from frontend/dist/assets/Terminal-D95YImn8.js rename to frontend/dist/assets/Terminal-D7cLoYyV.js index 5a255cac..62335563 100644 --- a/frontend/dist/assets/Terminal-D95YImn8.js +++ b/frontend/dist/assets/Terminal-D7cLoYyV.js @@ -1,4 +1,4 @@ -var Ua=Object.defineProperty;var ja=(e,t,i)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var D=(e,t,i)=>ja(e,typeof t!="symbol"?t+"":t,i);import{d as ls,Z as si,L as pe,dT as Ka,dU as rt,dV as es,dW as qa,cw as Co,di as xo,dj as Va,V as ko,dX as Ga,dY as Ya,dZ as Xa,q as Eo,dh as Ja,bO as Za,d_ as Qa,c1 as Ro,d$ as ge,bH as el,P as tl,cm as xt,e0 as il,e1 as sl,e2 as rl,e3 as nl,dK as zr,j as m,aA as Bo,aI as Mo,aB as Lo,B as ol,r as U,A as fs,m as $i,e4 as Ur,e5 as jr,cR as al,e6 as ll,c as ts,e7 as hl,e8 as cl,a4 as dl,e9 as ul,ea as _l,eb as fl}from"./index-DZK2INMD.js";import{a as pl}from"./ping-BIr2soBi.js";import{g as ml,r as gl}from"./system-OzsQQeV5.js";import{g as vi,B as Do,r as To,T as $o}from"./ascii-burst-DN6etEs5.js";import{P as vl,B as Sl,C as yl}from"./PageLayout-F1v-IzhG.js";import{K as Ao,S as wl}from"./KeycapButton-DgnjUPsG.js";import{D as Kr}from"./download-7zuVGrrm.js";import{S as qr}from"./search-DRsZhueb.js";import{C as bl}from"./chevron-right-DYHNTpxG.js";import"./keycap-sfx-ByZp-njj.js";/** +var Ua=Object.defineProperty;var ja=(e,t,i)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var D=(e,t,i)=>ja(e,typeof t!="symbol"?t+"":t,i);import{d as ls,Z as si,L as pe,dT as Ka,dU as rt,dV as es,dW as qa,cw as Co,di as xo,dj as Va,V as ko,dX as Ga,dY as Ya,dZ as Xa,q as Eo,dh as Ja,bO as Za,d_ as Qa,c1 as Ro,d$ as ge,bH as el,P as tl,cm as xt,e0 as il,e1 as sl,e2 as rl,e3 as nl,dK as zr,j as m,aA as Bo,aI as Mo,aB as Lo,B as ol,r as U,A as fs,m as $i,e4 as Ur,e5 as jr,cR as al,e6 as ll,c as ts,e7 as hl,e8 as cl,a4 as dl,e9 as ul,ea as _l,eb as fl}from"./index-B9Nfzawy.js";import{a as pl}from"./ping-kFEBCmQp.js";import{g as ml,r as gl}from"./system-D2aLg2mB.js";import{g as vi,B as Do,r as To,T as $o}from"./ascii-burst-DN6etEs5.js";import{P as vl,B as Sl,C as yl}from"./PageLayout-Da0xfaXb.js";import{K as Ao,S as wl}from"./KeycapButton-DPkSXt-J.js";import{D as Kr}from"./download-BaEmSLqY.js";import{S as qr}from"./search-BrfwwyYC.js";import{C as bl}from"./chevron-right-jwX-OOTu.js";import"./keycap-sfx-ByZp-njj.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -142,7 +142,7 @@ The web user needs polkit permissions to restart the service. See: /etc/polkit-1/localauthority/50-local.d/pymc-repeater.pkla`,"error");return}i.update(r,n.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"?(i.update(r,"Service is restarting (connection dropped).","success"),await this.waitForService(i)):i.update(r,`Error: ${o||"Restart failed"}`,"error")}}waitForService(i){return new Promise(s=>{const r=i.write("Waiting for service...","system");let n=0;const o=30;setTimeout(()=>{const a=setInterval(async()=>{n++,i.update(r,`Waiting for service... ${n}s`,"system");try{const h=new AbortController,l=setTimeout(()=>h.abort(),3e3);await fetch(`${nl}/api/stats`,{signal:h.signal}),clearTimeout(l),clearInterval(a),i.update(r,`Service connected. (${n+4}s)`,"success"),s();return}catch{}n>=o&&(clearInterval(a),i.update(r,`Service did not respond within ${o+4}s. Check manually.`,"warning"),s())},1e3)},4e3)})}}const Wt="\x1B[",Ie=`${Wt}0m`,Ha=`${Wt}32m`,Hr=`${Wt}33m`,Fr=`${Wt}31m`,R_=`${Wt}36m`,Mt=`${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 co(e){const t=Math.floor(e/86400),i=Math.floor(e%86400/3600),s=Math.floor(e%3600/60);return t>0?`${t}d ${i}h ${s}m`:i>0?`${i}h ${s}m`:`${s}m`}function B_(e,t){const i=Math.max(0,Math.min(100,e)),s=Math.round(i/100*t),r=t-s,n=i>=90?Fr:i>=70?Hr:Ha,o=`${n}${"█".repeat(s)}${Ie}${Mt}${"░".repeat(r)}${Ie}`,a=`${i.toFixed(1)}%`.padStart(6);return`[${o}] ${n}${a}${Ie}`}function M_(e){return e>=80?`${Fr}${Fa}${e.toFixed(1)}°C${Ie}`:e>=60?`${Hr}${e.toFixed(1)}°C${Ie}`:`${Ha}${e.toFixed(1)}°C${Ie}`}const Ci=2,uo=" ";function Jt(e,t){const i=" ".repeat(Ci),s=t-Ci,r=uo.length,n=[];let o="",a=0;for(const h of e){const l=cu(h);a===0?(o=h,a=l):a+r+l<=s?(o+=uo+h,a+=r+l):(n.push(i+o),o=h,a=l)}return a>0&&n.push(i+o),n}function L_(e,t,i){var d,u;const s=e.node_name||"unknown",r=e.version?`v${e.version}`:"",n=(d=t.system)!=null&&d.uptime?co(t.system.uptime):"?",o=co(e.uptime_seconds||0),a=Math.max(3,i-Ci*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=i>=60?l:h;return[` ${R_}${Fa}${s}${Ie} ${Mt}${r}${Ie}`,` ${Mt}${"─".repeat(a)}${Ie}`,...Jt([b("Sys",y(n)),b("Svc",y(o)),b("Load",y(c))],i)]}function D_(e,t){const s=Ci+4+1+2+6,r=Math.max(6,Math.min(30,t-s)),n=s+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=B_(_,r),x=o>=p.length?` ${Ae(p)}`:"";return` ${w(f.padEnd(4))}${g}${x}`};a.push(d("CPU",e.cpu.usage_percent,h)),a.push(d("Mem",e.memory.usage_percent,l)),a.push(d("Dsk",e.disk.usage_percent,c));const u=Object.entries(e.temperatures||{});if(u.length>0){const f=u.map(([_,p])=>`${Ae(_+":")} ${M_(p)}`);a.push(...Jt(f,t))}return a}function T_(e,t){var l,c;const i=e.neighbors||{},s=Object.keys(i).length,r=Object.values(i).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=["",` ${Mt}MESH${Ie}`];return h.push(...Jt([b("Mode",y(n)),b("Nbrs",`${y(String(r))}${Ae(`/${s}`)}`),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 $_(e,t){if(!e.network)return[];const i=["",` ${Mt}NET${Ie}`];return i.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))}${Ae("/")}${y(String(e.network.packets_recv))}`)],t)),i}function A_(e,t,i){if(e.length===0)return[];const s=t>=50,r=t>=50?6:5,n=t>=50?6:5,o=s?7:0,a=Ci+0,h=Math.max(4,t-a-o-r-n-4),l=3,c=t>=50?8:5,d=i!=null?Math.max(0,Math.min(c,i-l)):c;if(d<=0)return[];const u=["",` ${Mt}PROCS${Ie}`],f=(s?"PID".padEnd(o):"")+"CPU".padStart(r)+"MEM".padStart(n)+" NAME";u.push(` ${Ae(f)}`);for(const _ of e.slice(0,d)){const p=s?Ae(String(_.pid).padEnd(o)):"",g=(t>=50?_.cpu_percent.toFixed(1):_.cpu_percent.toFixed(0)).padStart(r),x=(t>=50?_.memory_percent.toFixed(1):_.memory_percent.toFixed(0)).padStart(n),z=_.name.length>h?_.name.slice(0,h-1)+"…":_.name,O=_.cpu_percent>=50?Fr:_.cpu_percent>=20?Hr:"",M=O?`${O}${g}${Ie}`:g;u.push(` ${p}${M}${Ae(x)} ${z}`)}return u}function P_(){return new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function _o(e,t,i,s,r){if(!e||!t)return` ${Mt}Waiting for data…${Ie}`;const n=L_(e,t,s),o=D_(t,s),a=T_(e,s),h=$_(t,s),l=["",` ${Mt}${P_()} · Ctrl+C to exit${Ie}`],c=[...n,...o,...a,...h,...l],d=r?wr(c,s):0,u=r?Math.max(0,r-d):void 0,f=A_(i,s,u),_=[...c.slice(0,-l.length),...f,...l];return r&&_.length>r&&(_.length=r),_.join(` `)}const N_=3e3;class I_ extends te{constructor(){super(...arguments);D(this,"name","top");D(this,"description","Live system overview (Ctrl+C to exit)");D(this,"aliases",["htop"])}async execute({output:i,rawInput:s,cols:r,signal:n}){var l,c;if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("top"),` ${w("Live-updating system overview combining hardware")}`,` ${w("stats, mesh metrics, and running processes.")}`,` ${w("Refreshes every 3s. Press Ctrl+C to exit.")}`,"",E("top","start live display"),"",W("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")}`,"",W("Aliases"),` ${w("htop")}`].join(` `));return}let o=null,a=[],h=xt.getState().stats;try{const[d,u]=await Promise.all([es(),zr()]);d.success&&d.data&&(o=d.data),u.success&&u.data&&(a=u.data.processes.sort((f,_)=>_.cpu_percent-f.cpu_percent))}catch{}if(!n.aborted){(l=i.enterFullscreen)==null||l.call(i);try{const d=i.write(_o(h,o,a,i.cols??r,i.rows));await new Promise(u=>{if(n.aborted){u();return}const f=async()=>{h=xt.getState().stats;try{const[p,g]=await Promise.all([es(),zr()]);p.success&&p.data&&(o=p.data),g.success&&g.data&&(a=g.data.processes.sort((x,z)=>z.cpu_percent-x.cpu_percent))}catch{}n.aborted||i.update(d,_o(h,o,a,i.cols??r,i.rows))},_=setInterval(()=>{if(n.aborted){clearInterval(_),u();return}f()},N_);n.addEventListener("abort",()=>{clearInterval(_),u()},{once:!0})})}finally{(c=i.exitFullscreen)==null||c.call(i)}}}}const fo=["DONT PANIC","C0FFEE","FEED C0DE","LOL","I CANNOT DO THAT"];function Wr(){return fo[Math.floor(Math.random()*fo.length)]}const Cr=new EventTarget,xr="shell-phrase";function Wa(e){Cr.dispatchEvent(new CustomEvent(xr,{detail:e??Wr()}))}function O_(e){const t=i=>e(i.detail);return Cr.addEventListener(xr,t),()=>Cr.removeEventListener(xr,t)}class H_ extends te{constructor(){super(...arguments);D(this,"name","fortune");D(this,"description","Display a fortune on the header");D(this,"aliases",["lol"])}execute({output:i}){const s=Wr();Wa(s),i.write(w(` ${s}`))}}const kr=new EventTarget,Er="party-time";function F_(){kr.dispatchEvent(new Event(Er))}function W_(e){return kr.addEventListener(Er,e),()=>kr.removeEventListener(Er,e)}class z_ extends te{constructor(){super(...arguments);D(this,"name","partytime");D(this,"description","Party on, Garth!");D(this,"aliases",["party","excellent","waynesworld"])}execute({output:i}){F_(),Wa("PARTY 0N GARTH"),i.write(w(" SCHWING!"))}}class U_ extends te{constructor(){super(...arguments);D(this,"name","ver");D(this,"description","Show version info");D(this,"aliases",["version"])}async execute({output:i,rawInput:s}){if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("ver"),` ${w("Display pyMC_Repeater, core, and console version.")}`,` ${w('Equivalent to firmware serial CLI "ver" command.')}`,"",E("ver","show version"),"",W("Aliases"),` ${w("version")}`].join(` -`));return}const r=i.write("processing...","system");try{const n=await rt();i.update(r,[` ${b("pyMC_Repeater",y(`v${n.version||"?"}`))}`,` ${b("pyMC_Core",y(n.core_version||"?"))}`,` ${b("pyMC_Console",y("v0.9.307"))}`].join(` +`));return}const r=i.write("processing...","system");try{const n=await rt();i.update(r,[` ${b("pyMC_Repeater",y(`v${n.version||"?"}`))}`,` ${b("pyMC_Core",y(n.core_version||"?"))}`,` ${b("pyMC_Console",y("v0.9.308"))}`].join(` `),"value")}catch(n){i.update(r,`Error: ${n instanceof Error?n.message:"Command failed"}`,"error")}}}class j_ extends te{constructor(){super(...arguments);D(this,"name","clock");D(this,"description","Show system UTC time")}execute({output:i,rawInput:s}){if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("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.")}`,"",E("clock","show UTC time")].join(` `));return}const r=new Date;i.write([` ${b("UTC",y(r.toUTCString()))}`,` ${b("ISO",y(r.toISOString()))}`,` ${b("Unix",y(String(Math.floor(r.getTime()/1e3))))}`].join(` `),"value")}}class K_ extends te{constructor(){super(...arguments);D(this,"name","stats-packets");D(this,"description","Packet counters")}async execute({output:i,rawInput:s}){if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("stats-packets"),` ${w("Display packet counters: sent, received, forwarded, dropped.")}`,` ${w('Equivalent to firmware serial CLI "stats-packets" command.')}`,"",E("stats-packets","show packet counters")].join(` diff --git a/frontend/dist/assets/Test-f9uH12cN.js b/frontend/dist/assets/Test-DRRytjEQ.js similarity index 99% rename from frontend/dist/assets/Test-f9uH12cN.js rename to frontend/dist/assets/Test-DRRytjEQ.js index 958d2174..04bd4432 100644 --- a/frontend/dist/assets/Test-f9uH12cN.js +++ b/frontend/dist/assets/Test-DRRytjEQ.js @@ -1,4 +1,4 @@ -import{d as Ae,r as p,fr as _e,fs as Ie,ad as Be,ae as Ve,j as e,a5 as U,R as ye,dy as He,c as le,aC as qe,N as We,a4 as Ye,ft as Oe,L as $,cg as z,t as Xe,G as me,Z,fu as ze,K as xe}from"./index-DZK2INMD.js";import{C as Q,P as Ge,a as Je,B as De}from"./PageLayout-F1v-IzhG.js";import{useResolveSource as Qe}from"./usePipelineStore-BRm0f890.js";import{R as Ke}from"./refresh-cw-DzrjsyBC.js";import{C as Ue}from"./chevron-right-DYHNTpxG.js";import{R as se,C as ae}from"./Grid-TGa3qLqq.js";import{C as Ze}from"./circle-check-DiKh03Ex.js";import{T as et}from"./triangle-alert-z32LI9zM.js";import"./node-types-Cj1JOOlq.js";/** +import{d as Ae,r as p,fr as _e,fs as Ie,ad as Be,ae as Ve,j as e,a5 as U,R as ye,dy as He,c as le,aC as qe,N as We,a4 as Ye,ft as Oe,L as $,cg as z,t as Xe,G as me,Z,fu as ze,K as xe}from"./index-B9Nfzawy.js";import{C as Q,P as Ge,a as Je,B as De}from"./PageLayout-Da0xfaXb.js";import{useResolveSource as Qe}from"./usePipelineStore-Dto_OrsT.js";import{R as Ke}from"./refresh-cw-hB3ADAmy.js";import{C as Ue}from"./chevron-right-jwX-OOTu.js";import{R as se,C as ae}from"./Grid-CbgS5PRh.js";import{C as Ze}from"./circle-check-m0ROsc83.js";import{T as et}from"./triangle-alert-_KPqiYkd.js";import"./node-types-D2DQet2e.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/activity-F7Po-3Al.js b/frontend/dist/assets/activity-CcUqK62Y.js similarity index 89% rename from frontend/dist/assets/activity-F7Po-3Al.js rename to frontend/dist/assets/activity-CcUqK62Y.js index 11bcc0ed..3355f9f8 100644 --- a/frontend/dist/assets/activity-F7Po-3Al.js +++ b/frontend/dist/assets/activity-CcUqK62Y.js @@ -1,4 +1,4 @@ -import{d as t}from"./index-DZK2INMD.js";/** +import{d as t}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/antenna-DwKMmyHW.js b/frontend/dist/assets/antenna-DHhoJnxo.js similarity index 90% rename from frontend/dist/assets/antenna-DwKMmyHW.js rename to frontend/dist/assets/antenna-DHhoJnxo.js index 53a6c054..2da4d202 100644 --- a/frontend/dist/assets/antenna-DwKMmyHW.js +++ b/frontend/dist/assets/antenna-DHhoJnxo.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DZK2INMD.js";/** +import{d as e}from"./index-B9Nfzawy.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-BW1lsEoU.js b/frontend/dist/assets/arrow-right-BbRfzTpf.js similarity index 86% rename from frontend/dist/assets/arrow-right-BW1lsEoU.js rename to frontend/dist/assets/arrow-right-BbRfzTpf.js index 8cf27cc7..d74ffe7f 100644 --- a/frontend/dist/assets/arrow-right-BW1lsEoU.js +++ b/frontend/dist/assets/arrow-right-BbRfzTpf.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-DZK2INMD.js";/** +import{d as o}from"./index-B9Nfzawy.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-DJJcQ7dG.js b/frontend/dist/assets/arrow-up-1am5_GF2.js similarity index 92% rename from frontend/dist/assets/arrow-up-DJJcQ7dG.js rename to frontend/dist/assets/arrow-up-1am5_GF2.js index 51abc2c2..67537050 100644 --- a/frontend/dist/assets/arrow-up-DJJcQ7dG.js +++ b/frontend/dist/assets/arrow-up-1am5_GF2.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-DZK2INMD.js";/** +import{d as o}from"./index-B9Nfzawy.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-B9fA4l9w.js b/frontend/dist/assets/chat-utils-CXtTpLY5.js similarity index 94% rename from frontend/dist/assets/chat-utils-B9fA4l9w.js rename to frontend/dist/assets/chat-utils-CXtTpLY5.js index da9ea859..adaf0716 100644 --- a/frontend/dist/assets/chat-utils-B9fA4l9w.js +++ b/frontend/dist/assets/chat-utils-CXtTpLY5.js @@ -1 +1 @@ -import{L as a,r as l}from"./index-DZK2INMD.js";const s=[a.green,a.blue,a.amber,a.pink,a.purple,a.cyan,a.orange,a.teal];function m(e){let n=0;for(let t=0;t0){const t=n[0],o=e.replace(i,"").trim();return{emoji:t,cleanName:o||e}}return{emoji:null,cleanName:e}}function f(e){const{cleanName:n}=u(e),t=n.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const r=Array.from(t[0])[0]||"",c=Array.from(t[1])[0]||"";return(r+c).toUpperCase()}return Array.from(n).slice(0,2).join("").toUpperCase()}function p(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function g(e){const n=/@\[([^\]]+)\]/g,t=[];let o=0,r;for(;(r=n.exec(e))!==null;)r.index>o&&t.push(e.slice(o,r.index)),t.push(l.createElement("span",{key:r.index,className:"font-extrabold text-white"},r[1])),o=r.index+r[0].length;return o0?t:e}export{f as a,p as b,u as e,g as f,m as g}; +import{L as a,r as l}from"./index-B9Nfzawy.js";const s=[a.green,a.blue,a.amber,a.pink,a.purple,a.cyan,a.orange,a.teal];function m(e){let n=0;for(let t=0;t0){const t=n[0],o=e.replace(i,"").trim();return{emoji:t,cleanName:o||e}}return{emoji:null,cleanName:e}}function f(e){const{cleanName:n}=u(e),t=n.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const r=Array.from(t[0])[0]||"",c=Array.from(t[1])[0]||"";return(r+c).toUpperCase()}return Array.from(n).slice(0,2).join("").toUpperCase()}function p(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function g(e){const n=/@\[([^\]]+)\]/g,t=[];let o=0,r;for(;(r=n.exec(e))!==null;)r.index>o&&t.push(e.slice(o,r.index)),t.push(l.createElement("span",{key:r.index,className:"font-extrabold text-white"},r[1])),o=r.index+r[0].length;return o0?t:e}export{f as a,p as b,u as e,g as f,m as g}; diff --git a/frontend/dist/assets/chevron-right-DYHNTpxG.js b/frontend/dist/assets/chevron-right-jwX-OOTu.js similarity index 85% rename from frontend/dist/assets/chevron-right-DYHNTpxG.js rename to frontend/dist/assets/chevron-right-jwX-OOTu.js index 3e8e367a..cebec480 100644 --- a/frontend/dist/assets/chevron-right-DYHNTpxG.js +++ b/frontend/dist/assets/chevron-right-jwX-OOTu.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-DZK2INMD.js";/** +import{d as o}from"./index-B9Nfzawy.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-Bm8_AtG8.js b/frontend/dist/assets/chevron-up-DvNDOaHb.js similarity index 99% rename from frontend/dist/assets/chevron-up-Bm8_AtG8.js rename to frontend/dist/assets/chevron-up-DvNDOaHb.js index a5ef13cc..1c3de110 100644 --- a/frontend/dist/assets/chevron-up-Bm8_AtG8.js +++ b/frontend/dist/assets/chevron-up-DvNDOaHb.js @@ -1,4 +1,4 @@ -import{r as x,b9 as F,d as R}from"./index-DZK2INMD.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-check-DiKh03Ex.js b/frontend/dist/assets/circle-check-m0ROsc83.js similarity index 87% rename from frontend/dist/assets/circle-check-DiKh03Ex.js rename to frontend/dist/assets/circle-check-m0ROsc83.js index a0a1d22d..9461d5b9 100644 --- a/frontend/dist/assets/circle-check-DiKh03Ex.js +++ b/frontend/dist/assets/circle-check-m0ROsc83.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DZK2INMD.js";/** +import{d as c}from"./index-B9Nfzawy.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-BdE_X9p5.js b/frontend/dist/assets/circle-question-mark-Br2ku42v.js similarity index 89% rename from frontend/dist/assets/circle-question-mark-BdE_X9p5.js rename to frontend/dist/assets/circle-question-mark-Br2ku42v.js index 4489da12..c376d3d6 100644 --- a/frontend/dist/assets/circle-question-mark-BdE_X9p5.js +++ b/frontend/dist/assets/circle-question-mark-Br2ku42v.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DZK2INMD.js";/** +import{d as c}from"./index-B9Nfzawy.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-wbk-0e1-.js b/frontend/dist/assets/circle-stop-CO5AnAxr.js similarity index 94% rename from frontend/dist/assets/circle-stop-wbk-0e1-.js rename to frontend/dist/assets/circle-stop-CO5AnAxr.js index 3968a7d2..0f954085 100644 --- a/frontend/dist/assets/circle-stop-wbk-0e1-.js +++ b/frontend/dist/assets/circle-stop-CO5AnAxr.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DZK2INMD.js";/** +import{d as c}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-x-D0lMBMA-.js b/frontend/dist/assets/circle-x-i9YQ1o9T.js similarity index 88% rename from frontend/dist/assets/circle-x-D0lMBMA-.js rename to frontend/dist/assets/circle-x-i9YQ1o9T.js index 5ccc8f20..3c4621c9 100644 --- a/frontend/dist/assets/circle-x-D0lMBMA-.js +++ b/frontend/dist/assets/circle-x-i9YQ1o9T.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DZK2INMD.js";/** +import{d as c}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/clock-CZYZYW0y.js b/frontend/dist/assets/clock-CCOO2GB9.js similarity index 87% rename from frontend/dist/assets/clock-CZYZYW0y.js rename to frontend/dist/assets/clock-CCOO2GB9.js index ffc9575b..1c07b7e2 100644 --- a/frontend/dist/assets/clock-CZYZYW0y.js +++ b/frontend/dist/assets/clock-CCOO2GB9.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DZK2INMD.js";/** +import{d as c}from"./index-B9Nfzawy.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-C58OO1Zb.js b/frontend/dist/assets/consumer-registry-B_rYsmHo.js similarity index 92% rename from frontend/dist/assets/consumer-registry-C58OO1Zb.js rename to frontend/dist/assets/consumer-registry-B_rYsmHo.js index 36989344..87fe7c6f 100644 --- a/frontend/dist/assets/consumer-registry-C58OO1Zb.js +++ b/frontend/dist/assets/consumer-registry-B_rYsmHo.js @@ -1 +1 @@ -import{av as n,r as i}from"./index-DZK2INMD.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{av as n,r as i}from"./index-B9Nfzawy.js";const p=t=>(t.type??t.payload_type)===n.ADVERT,l=t=>(t.type??t.payload_type)===n.TRACE,h=t=>(t.type??t.payload_type)===n.TXT_MSG,_=t=>(t.type??t.payload_type)===n.PATH,d=t=>(t.type??t.payload_type)===n.ACK,g=t=>{const e=t.type??t.payload_type;return e===n.GRP_TXT||e===n.GRP_DATA},m=t=>(t.path_length??(Array.isArray(t.original_path)?t.original_path.length:0))>0,A=t=>!!t.src_hash,T=t=>t.airtime_ms!=null,c=new Set,o=new Map;function a(t,e){return`${t}|${e}`}function u(t,e){const s=a(t,e);o.set(s,(o.get(s)??0)+1)}function y(t,e){const s=a(t,e),r=o.get(s)??0;r>1?o.set(s,r-1):o.delete(s)}function C(t){for(const e of t){const s=a(e.target,e.fn);c.has(s)||c.add(s)}}function P(t){i.useEffect(()=>{for(const e of t)u(e.target,e.fn);return()=>{for(const e of t)y(e.target,e.fn)}},[t])}export{m as a,A as b,h as c,d,p as e,l as f,_ as g,T as h,g as i,C as r,P as u}; diff --git a/frontend/dist/assets/cpu-C2F1drgJ.js b/frontend/dist/assets/cpu-lxveD9wi.js similarity index 94% rename from frontend/dist/assets/cpu-C2F1drgJ.js rename to frontend/dist/assets/cpu-lxveD9wi.js index 87eb5139..eeda9b13 100644 --- a/frontend/dist/assets/cpu-C2F1drgJ.js +++ b/frontend/dist/assets/cpu-lxveD9wi.js @@ -1,4 +1,4 @@ -import{d as h}from"./index-DZK2INMD.js";/** +import{d as h}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/database-DWx780B3.js b/frontend/dist/assets/database-CSUiI1CG.js similarity index 89% rename from frontend/dist/assets/database-DWx780B3.js rename to frontend/dist/assets/database-CSUiI1CG.js index 59300d88..98f8f839 100644 --- a/frontend/dist/assets/database-DWx780B3.js +++ b/frontend/dist/assets/database-CSUiI1CG.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DZK2INMD.js";/** +import{d as e}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/download-7zuVGrrm.js b/frontend/dist/assets/download-BaEmSLqY.js similarity index 89% rename from frontend/dist/assets/download-7zuVGrrm.js rename to frontend/dist/assets/download-BaEmSLqY.js index a2ba587c..3b891327 100644 --- a/frontend/dist/assets/download-7zuVGrrm.js +++ b/frontend/dist/assets/download-BaEmSLqY.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-DZK2INMD.js";/** +import{d as o}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/easing-D7lsSq8M.js b/frontend/dist/assets/easing-VuIK-HqT.js similarity index 90% rename from frontend/dist/assets/easing-D7lsSq8M.js rename to frontend/dist/assets/easing-VuIK-HqT.js index 46307392..175b749a 100644 --- a/frontend/dist/assets/easing-D7lsSq8M.js +++ b/frontend/dist/assets/easing-VuIK-HqT.js @@ -1,4 +1,4 @@ -import{d as s,fQ as a}from"./index-DZK2INMD.js";/** +import{d as s,fQ as a}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/element-movement-BZO5MqZi.js b/frontend/dist/assets/element-movement-C8Yd7NWa.js similarity index 98% rename from frontend/dist/assets/element-movement-BZO5MqZi.js rename to frontend/dist/assets/element-movement-C8Yd7NWa.js index d8a30496..a9eade03 100644 --- a/frontend/dist/assets/element-movement-BZO5MqZi.js +++ b/frontend/dist/assets/element-movement-C8Yd7NWa.js @@ -1 +1 @@ -import{r as o,aR as v,cV as b,fo as h,fp as $,d9 as R,bt as c,bw as x}from"./index-DZK2INMD.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 N(e=y){return o.useCallback((t,r)=>{if(typeof e=="string"){let u=e;return(t==null?void 0:t[u])===(r==null?void 0:r[u])}return e(t,r)},[e])}var w=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(w||{});function j(e){let t=o.useRef(null),r=v(l=>{t.current=l.pointerType,!b(l.currentTarget)&&l.pointerType==="mouse"&&l.button===w.Left&&(l.preventDefault(),e(l))}),u=v(l=>{t.current!=="mouse"&&(b(l.currentTarget)||e(l))});return{onPointerDown:r,onClick:u}}var S=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(S||{});const z={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,k=5;function F(e,{trigger:t,action:r,close:u,select:l}){let n=o.useRef(null),i=o.useRef(null),a=o.useRef(null);h(e&&t!==null,"pointerdown",s=>{$(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=s.x,a.current=s.y,n.current=s.timeStamp)}),h(e&&t!==null,"pointerup",s=>{var d,f;let p=n.current;if(p===null||(n.current=null,!R(s.target))||Math.abs(s.x-((d=i.current)!=null?d:s.x))I&&(l(g.target),u());break}case 2:{u();break}}},{capture:!0})}function m(e){return[e.screenX,e.screenY]}function P(){let e=o.useRef([-1,-1]);return{wasMoved(t){let r=m(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=m(t)}}}function L({children:e,freeze:t},r){let u=E(t,e);return o.isValidElement(u)?o.cloneElement(u,{ref:r}):c.createElement(c.Fragment,null,u)}const V=c.forwardRef(L);function E(e,t){let[r,u]=o.useState(t);return!e&&r!==t&&u(t),e?r:t}function T(e){throw new Error("Unexpected object: "+e)}var C=(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))(C||{});function A(e,t){let r=t.resolveItems();if(r.length<=0)return null;let u=t.resolveActiveIndex(),l=u??-1;switch(e.focus){case 0:{for(let n=0;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 2:{for(let n=l+1;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 4:{for(let n=0;n({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function D(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function H(e,t,r){let u=x();if(t.kind==="Tracked"){let l=function(){n!==D(e)&&(u.dispose(),r())},{position:n}=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{F as L,z as S,B as a,D as b,C as c,V as d,P as e,A as f,w as g,N as h,H as p,j as s,E as u}; +import{r as o,aR as v,cV as b,fo as h,fp as $,d9 as R,bt as c,bw as x}from"./index-B9Nfzawy.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 N(e=y){return o.useCallback((t,r)=>{if(typeof e=="string"){let u=e;return(t==null?void 0:t[u])===(r==null?void 0:r[u])}return e(t,r)},[e])}var w=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(w||{});function j(e){let t=o.useRef(null),r=v(l=>{t.current=l.pointerType,!b(l.currentTarget)&&l.pointerType==="mouse"&&l.button===w.Left&&(l.preventDefault(),e(l))}),u=v(l=>{t.current!=="mouse"&&(b(l.currentTarget)||e(l))});return{onPointerDown:r,onClick:u}}var S=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(S||{});const z={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,k=5;function F(e,{trigger:t,action:r,close:u,select:l}){let n=o.useRef(null),i=o.useRef(null),a=o.useRef(null);h(e&&t!==null,"pointerdown",s=>{$(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=s.x,a.current=s.y,n.current=s.timeStamp)}),h(e&&t!==null,"pointerup",s=>{var d,f;let p=n.current;if(p===null||(n.current=null,!R(s.target))||Math.abs(s.x-((d=i.current)!=null?d:s.x))I&&(l(g.target),u());break}case 2:{u();break}}},{capture:!0})}function m(e){return[e.screenX,e.screenY]}function P(){let e=o.useRef([-1,-1]);return{wasMoved(t){let r=m(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=m(t)}}}function L({children:e,freeze:t},r){let u=E(t,e);return o.isValidElement(u)?o.cloneElement(u,{ref:r}):c.createElement(c.Fragment,null,u)}const V=c.forwardRef(L);function E(e,t){let[r,u]=o.useState(t);return!e&&r!==t&&u(t),e?r:t}function T(e){throw new Error("Unexpected object: "+e)}var C=(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))(C||{});function A(e,t){let r=t.resolveItems();if(r.length<=0)return null;let u=t.resolveActiveIndex(),l=u??-1;switch(e.focus){case 0:{for(let n=0;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 2:{for(let n=l+1;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 4:{for(let n=0;n({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function D(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function H(e,t,r){let u=x();if(t.kind==="Tracked"){let l=function(){n!==D(e)&&(u.dispose(),r())},{position:n}=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{F as L,z as S,B as a,D as b,C as c,V as d,P as e,A as f,w as g,N as h,H as p,j as s,E as u}; diff --git a/frontend/dist/assets/funnel-ClRHq7Ic.js b/frontend/dist/assets/funnel-DOec69-r.js similarity index 89% rename from frontend/dist/assets/funnel-ClRHq7Ic.js rename to frontend/dist/assets/funnel-DOec69-r.js index e8e55e26..7921267f 100644 --- a/frontend/dist/assets/funnel-ClRHq7Ic.js +++ b/frontend/dist/assets/funnel-DOec69-r.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DZK2INMD.js";/** +import{d as e}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/hash-Bx-gtxz0.js b/frontend/dist/assets/hash-fRZDKNyT.js similarity index 90% rename from frontend/dist/assets/hash-Bx-gtxz0.js rename to frontend/dist/assets/hash-fRZDKNyT.js index a8060740..d323dc33 100644 --- a/frontend/dist/assets/hash-Bx-gtxz0.js +++ b/frontend/dist/assets/hash-fRZDKNyT.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DZK2INMD.js";/** +import{d as e}from"./index-B9Nfzawy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/index-DZK2INMD.js b/frontend/dist/assets/index-B9Nfzawy.js similarity index 71% rename from frontend/dist/assets/index-DZK2INMD.js rename to frontend/dist/assets/index-B9Nfzawy.js index e8aafd1c..9b28e20d 100644 --- a/frontend/dist/assets/index-DZK2INMD.js +++ b/frontend/dist/assets/index-B9Nfzawy.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-BFa4P29Z.js","assets/ascii-burst-DN6etEs5.js","assets/Dashboard-C9aRadqs.js","assets/PageLayout-F1v-IzhG.js","assets/consumer-registry-C58OO1Zb.js","assets/DataValue-C6Gh85-I.js","assets/index-C-Mp31KV.js","assets/node-types-Cj1JOOlq.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-DyZLMo3F.js","assets/chevron-up-Bm8_AtG8.js","assets/primitives-NoSyYVE-.js","assets/badge-colors-BNUqIXCA.js","assets/chat-utils-B9fA4l9w.js","assets/SignalIndicator-BlRL2nuG.js","assets/arrow-up-DJJcQ7dG.js","assets/arrow-right-BW1lsEoU.js","assets/chevron-right-DYHNTpxG.js","assets/map-pin-qwXb-K8z.js","assets/circle-question-mark-BdE_X9p5.js","assets/triangle-alert-z32LI9zM.js","assets/DataBox-BEDP2Kxh.js","assets/layers-Bh2LK6a1.js","assets/hash-Bx-gtxz0.js","assets/clock-CZYZYW0y.js","assets/activity-F7Po-3Al.js","assets/circle-check-DiKh03Ex.js","assets/database-DWx780B3.js","assets/useMapViewStore-DGeq1iXE.js","assets/shield-tOGn5YjL.js","assets/MqttModeBadge-CK543WcH.js","assets/zap-CV3qJZPu.js","assets/usePipelineStore-BRm0f890.js","assets/LightSparkline-D9e7Om82.js","assets/link-scoring-D2b5sONh.js","assets/AutoConfigureDialog-Biwer_fL.js","assets/ChatBubble-BfbDZnhb.js","assets/message-square-Cb8LlwAg.js","assets/shield-check-8Y0lJQvU.js","assets/Grid-TGa3qLqq.js","assets/Packets-Cr5fIFSq.js","assets/element-movement-BZO5MqZi.js","assets/AnalyzerFilterPanel-Cx2An8MF.js","assets/monitor-smartphone-BKehVovy.js","assets/funnel-ClRHq7Ic.js","assets/search-DRsZhueb.js","assets/circle-x-D0lMBMA-.js","assets/Contacts-DVusfR1A.js","assets/ping-BIr2soBi.js","assets/listbox-DR8wL7aQ.js","assets/CollisionExplorerModal-Cb8lVNAn.js","assets/BasemapLayer-DFBOwIT2.js","assets/target-CMbN1GDb.js","assets/network-CfluO-Ty.js","assets/trash-2-B1qiliQL.js","assets/ConfirmModal-CkTTKNiq.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-D6VRKkm_.js","assets/easing-D7lsSq8M.js","assets/settings-2-CKbtmc0u.js","assets/MeshGraph-BtvpvYiN.js","assets/max-BIfJ_m_6.js","assets/download-7zuVGrrm.js","assets/rotate-ccw-BgriCY_m.js","assets/System-WIc48OFP.js","assets/refresh-cw-DzrjsyBC.js","assets/cpu-C2F1drgJ.js","assets/Logs-BiTgALgq.js","assets/circle-stop-wbk-0e1-.js","assets/Terminal-D95YImn8.js","assets/system-OzsQQeV5.js","assets/KeycapButton-DgnjUPsG.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-Bw_n7Cvf.js","assets/repeat-BAyKJWpi.js","assets/antenna-DwKMmyHW.js","assets/plus-Dm1LTbFN.js","assets/RoomServer-bhKhtLG3.js","assets/wifi-DPjA-ySX.js","assets/PacketObservatory-CJP4ImUj.js","assets/Sessions-CBUF-gp6.js","assets/Mqtt-B_SI6Dym.js","assets/wifi-off-Dpiws8OL.js","assets/Test-f9uH12cN.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-BPAK_Nkc.js","assets/ascii-burst-DN6etEs5.js","assets/Dashboard-B603mHUm.js","assets/PageLayout-Da0xfaXb.js","assets/consumer-registry-B_rYsmHo.js","assets/DataValue-Ddo4mrzf.js","assets/index-CHkxpv0k.js","assets/node-types-D2DQet2e.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-CO1EDTYK.js","assets/chevron-up-DvNDOaHb.js","assets/primitives-DkuSh1mR.js","assets/badge-colors-BNUqIXCA.js","assets/chat-utils-CXtTpLY5.js","assets/SignalIndicator-BAKXIHs1.js","assets/arrow-up-1am5_GF2.js","assets/arrow-right-BbRfzTpf.js","assets/chevron-right-jwX-OOTu.js","assets/map-pin-Z2xK57U6.js","assets/circle-question-mark-Br2ku42v.js","assets/triangle-alert-_KPqiYkd.js","assets/DataBox-CCBd3sT4.js","assets/layers-DHyjQOGN.js","assets/hash-fRZDKNyT.js","assets/clock-CCOO2GB9.js","assets/activity-CcUqK62Y.js","assets/circle-check-m0ROsc83.js","assets/database-CSUiI1CG.js","assets/useMapViewStore-CAlaFCdd.js","assets/shield-5eYUHkwt.js","assets/MqttModeBadge-Bgn-nTpu.js","assets/zap-DME89Nfc.js","assets/usePipelineStore-Dto_OrsT.js","assets/LightSparkline-DTXOFhS4.js","assets/link-scoring-353AdDOu.js","assets/AutoConfigureDialog-D-tiCDMu.js","assets/ChatBubble-fzIllzhe.js","assets/message-square-C9xeBmVh.js","assets/shield-check-Bx84Eo-l.js","assets/Grid-CbgS5PRh.js","assets/Packets-BTBFZZN3.js","assets/element-movement-C8Yd7NWa.js","assets/AnalyzerFilterPanel-DX4fviv1.js","assets/monitor-smartphone-zVB5GYa6.js","assets/funnel-DOec69-r.js","assets/search-BrfwwyYC.js","assets/circle-x-i9YQ1o9T.js","assets/Contacts-DgMcpPLG.js","assets/ping-kFEBCmQp.js","assets/listbox-DV2L-QZw.js","assets/CollisionExplorerModal-J7HE0WX3.js","assets/BasemapLayer--gGy0d8r.js","assets/target-74Dm2pEA.js","assets/network-BCB-csrZ.js","assets/trash-2-BxrPvo_t.js","assets/ConfirmModal-CsrIdG-V.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-CltP1h12.js","assets/easing-VuIK-HqT.js","assets/settings-2-DYzgUEwY.js","assets/MeshGraph-BrnySJao.js","assets/max-BFwmL_H9.js","assets/download-BaEmSLqY.js","assets/rotate-ccw-BwcqAp9U.js","assets/System-Bl4s4lrg.js","assets/refresh-cw-hB3ADAmy.js","assets/cpu-lxveD9wi.js","assets/Logs-DSUXpt-n.js","assets/circle-stop-CO5AnAxr.js","assets/Terminal-D7cLoYyV.js","assets/system-D2aLg2mB.js","assets/KeycapButton-DPkSXt-J.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-CUBGWMgN.js","assets/repeat-C00vzJTj.js","assets/antenna-DHhoJnxo.js","assets/plus-B7jylh_n.js","assets/RoomServer-y-ltkQOG.js","assets/wifi-BpM3uttU.js","assets/PacketObservatory-cGIEJnyK.js","assets/Sessions-D0mPmO8l.js","assets/Mqtt-CaCE2AxE.js","assets/wifi-off-DoZXnx54.js","assets/Test-DRRytjEQ.js"])))=>i.map(i=>d[i]); var M9=Object.defineProperty;var Fk=e=>{throw TypeError(e)};var R9=(e,t,n)=>t in e?M9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Le=(e,t,n)=>R9(e,typeof t!="symbol"?t+"":t,n),Gy=(e,t,n)=>t.has(e)||Fk("Cannot "+n);var me=(e,t,n)=>(Gy(e,t,"read from private field"),n?n.call(e):t.get(e)),Kt=(e,t,n)=>t.has(e)?Fk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),St=(e,t,n,r)=>(Gy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),mt=(e,t,n)=>(Gy(e,t,"access private method"),n);var Ph=(e,t,n,r)=>({set _(o){St(e,t,o,n)},get _(){return me(e,t,r)}});function L9(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function I9(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ky={exports:{}},Qu={},Yy={exports:{}},$t={};/** * @license React * react.production.min.js @@ -49,9 +49,9 @@ Error generating stack: `+R.message+` * @license MIT */var Uk="popstate";function H9(e={}){function t(r,o){let{pathname:s,search:i,hash:l}=r.location;return gb("",{pathname:s,search:i,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Vf(o)}return G9(t,n,null,e)}function Tn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function rs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function q9(){return Math.random().toString(36).substring(2,10)}function zk(e,t){return{usr:e.state,key:e.key,idx:t}}function gb(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Jc(t):t,state:n,key:t&&t.key||r||q9()}}function Vf({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 Jc(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 G9(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,i=o.history,l="POP",c=null,u=d();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function d(){return(i.state||{idx:null}).idx}function h(){l="POP";let E=d(),C=E==null?null:E-u;u=E,c&&c({action:l,location:b.location,delta:C})}function p(E,C){l="PUSH";let v=gb(b.location,E,C);u=d()+1;let k=zk(v,u),A=b.createHref(v);try{i.pushState(k,"",A)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;o.location.assign(A)}s&&c&&c({action:l,location:b.location,delta:1})}function g(E,C){l="REPLACE";let v=gb(b.location,E,C);u=d();let k=zk(v,u),A=b.createHref(v);i.replaceState(k,"",A),s&&c&&c({action:l,location:b.location,delta:0})}function y(E){return K9(E)}let b={get action(){return l},get location(){return e(o,i)},listen(E){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Uk,h),c=E,()=>{o.removeEventListener(Uk,h),c=null}},createHref(E){return t(o,E)},createURL:y,encodeLocation(E){let C=y(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:p,replace:g,go(E){return i.go(E)}};return b}function K9(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Tn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Vf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function o_(e,t,n="/"){return Y9(e,t,n,!1)}function Y9(e,t,n,r){let o=typeof t=="string"?Jc(t):t,s=Ai(o.pathname||"/",n);if(s==null)return null;let i=s_(e);Q9(i);let l=null;for(let c=0;l==null&&c{let d={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&c)return;Tn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let h=bi([r,d.relativePath]),p=n.concat(d);i.children&&i.children.length>0&&(Tn(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),s_(i.children,t,p,h,c)),!(i.path==null&&!i.index)&&t.push({path:h,score:r7(h,i.index),routesMeta:p})};return e.forEach((i,l)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))s(i,l);else for(let u of i_(i.path))s(i,l,!0,u)}),t}function i_(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let i=i_(r.join("/")),l=[];return l.push(...i.map(c=>c===""?s:[s,c].join("/"))),o&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Q9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:o7(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var X9=/^:[\w-]+$/,J9=3,Z9=2,e7=1,t7=10,n7=-2,Vk=e=>e==="*";function r7(e,t){let n=e.split("/"),r=n.length;return n.some(Vk)&&(r+=n7),t&&(r+=Z9),n.filter(o=>!Vk(o)).reduce((o,s)=>o+(X9.test(s)?J9:s===""?e7:t7),r)}function o7(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function s7(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",i=[];for(let l=0;l{if(d==="*"){let y=l[p]||"";i=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[p];return h&&!g?u[d]=void 0:u[d]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:i,pattern:e}}function i7(e,t=!1,n=!0){rs(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function a7(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return rs(!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 Ai(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 l7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,c7=e=>l7.test(e);function u7(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Jc(e):e,s;if(n)if(c7(n))s=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),rs(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?s=Wk(n.substring(1),"/"):s=Wk(n,t)}else s=t;return{pathname:s,search:h7(r),hash:p7(o)}}function Wk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Zy(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 f7(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Sw(e){let t=f7(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function _w(e,t,n,r=!1){let o;typeof e=="string"?o=Jc(e):(o={...e},Tn(!o.pathname||!o.pathname.includes("?"),Zy("?","pathname","search",o)),Tn(!o.pathname||!o.pathname.includes("#"),Zy("#","pathname","hash",o)),Tn(!o.search||!o.search.includes("#"),Zy("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,l;if(i==null)l=n;else{let h=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),h-=1;o.pathname=p.join("/")}l=h>=0?t[h]:"/"}let c=u7(o,l),u=i&&i!=="/"&&i.endsWith("/"),d=(s||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var bi=e=>e.join("/").replace(/\/\/+/g,"/"),d7=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),h7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,p7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function m7(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function g7(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var a_=["POST","PUT","PATCH","DELETE"];new Set(a_);var y7=["GET",...a_];new Set(y7);var Zc=D.createContext(null);Zc.displayName="DataRouter";var $m=D.createContext(null);$m.displayName="DataRouterState";D.createContext(!1);var l_=D.createContext({isTransitioning:!1});l_.displayName="ViewTransition";var b7=D.createContext(new Map);b7.displayName="Fetchers";var v7=D.createContext(null);v7.displayName="Await";var ss=D.createContext(null);ss.displayName="Navigation";var rd=D.createContext(null);rd.displayName="Location";var Gs=D.createContext({outlet:null,matches:[],isDataRoute:!1});Gs.displayName="Route";var Dw=D.createContext(null);Dw.displayName="RouteError";function w7(e,{relative:t}={}){Tn(eu(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=D.useContext(ss),{hash:o,pathname:s,search:i}=od(e,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:bi([n,s])),r.createHref({pathname:l,search:i,hash:o})}function eu(){return D.useContext(rd)!=null}function Ks(){return Tn(eu(),"useLocation() may be used only in the context of a component."),D.useContext(rd).location}var c_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function u_(e){D.useContext(ss).static||D.useLayoutEffect(e)}function Um(){let{isDataRoute:e}=D.useContext(Gs);return e?M7():E7()}function E7(){Tn(eu(),"useNavigate() may be used only in the context of a component.");let e=D.useContext(Zc),{basename:t,navigator:n}=D.useContext(ss),{matches:r}=D.useContext(Gs),{pathname:o}=Ks(),s=JSON.stringify(Sw(r)),i=D.useRef(!1);return u_(()=>{i.current=!0}),D.useCallback((c,u={})=>{if(rs(i.current,c_),!i.current)return;if(typeof c=="number"){n.go(c);return}let d=_w(c,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:bi([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,s,o,e])}D.createContext(null);function od(e,{relative:t}={}){let{matches:n}=D.useContext(Gs),{pathname:r}=Ks(),o=JSON.stringify(Sw(n));return D.useMemo(()=>_w(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function C7(e,t){return f_(e,t)}function f_(e,t,n,r,o){var v;Tn(eu(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=D.useContext(ss),{matches:i}=D.useContext(Gs),l=i[i.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;{let k=h&&h.path||"";d_(u,!h||k.endsWith("*")||k.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=Ks(),g;if(t){let k=typeof t=="string"?Jc(t):t;Tn(d==="/"||((v=k.pathname)==null?void 0:v.startsWith(d)),`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 "${d}" but pathname "${k.pathname}" was given in the \`location\` prop.`),g=k}else g=p;let y=g.pathname||"/",b=y;if(d!=="/"){let k=d.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(k.length).join("/")}let E=o_(e,{pathname:b});rs(h||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),rs(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.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=_7(E&&E.map(k=>Object.assign({},k,{params:Object.assign({},c,k.params),pathname:bi([d,s.encodeLocation?s.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?d:bi([d,s.encodeLocation?s.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),i,n,r,o);return t&&C?D.createElement(rd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},C):C}function k7(){let e=P7(),t=m7(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)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=D.createElement(D.Fragment,null,D.createElement("p",null,"💿 Hey developer 👋"),D.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",D.createElement("code",{style:s},"ErrorBoundary")," or"," ",D.createElement("code",{style:s},"errorElement")," prop on your route.")),D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},t),n?D.createElement("pre",{style:o},n):null,i)}var x7=D.createElement(k7,null),A7=class extends D.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?D.createElement(Gs.Provider,{value:this.props.routeContext},D.createElement(Dw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function S7({routeContext:e,match:t,children:n}){let r=D.useContext(Zc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),D.createElement(Gs.Provider,{value:e},n)}function _7(e,t=[],n=null,r=null,o=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 s=e,i=n==null?void 0:n.errors;if(i!=null){let d=s.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);Tn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,d+1))}let l=!1,c=-1;if(n)for(let d=0;d=0?s=s.slice(0,c+1):s=[s[0]];break}}}let u=n&&r?(d,h)=>{var p,g;r(d,{location:n.location,params:((g=(p=n.matches)==null?void 0:p[0])==null?void 0:g.params)??{},unstable_pattern:g7(n.matches),errorInfo:h})}:void 0;return s.reduceRight((d,h,p)=>{let g,y=!1,b=null,E=null;n&&(g=i&&h.route.id?i[h.route.id]:void 0,b=h.route.errorElement||x7,l&&(c<0&&p===0?(d_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,E=null):c===p&&(y=!0,E=h.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,p+1)),v=()=>{let k;return g?k=b:y?k=E:h.route.Component?k=D.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=d,D.createElement(S7,{match:h,routeContext:{outlet:d,matches:C,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?D.createElement(A7,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:v(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:u}):v()},null)}function Tw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function D7(e){let t=D.useContext(Zc);return Tn(t,Tw(e)),t}function T7(e){let t=D.useContext($m);return Tn(t,Tw(e)),t}function F7(e){let t=D.useContext(Gs);return Tn(t,Tw(e)),t}function Fw(e){let t=F7(e),n=t.matches[t.matches.length-1];return Tn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function B7(){return Fw("useRouteId")}function P7(){var r;let e=D.useContext(Dw),t=T7("useRouteError"),n=Fw("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function M7(){let{router:e}=D7("useNavigate"),t=Fw("useNavigate"),n=D.useRef(!1);return u_(()=>{n.current=!0}),D.useCallback(async(o,s={})=>{rs(n.current,c_),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var Hk={};function d_(e,t,n){!t&&!Hk[e]&&(Hk[e]=!0,rs(!1,n))}D.memo(R7);function R7({routes:e,future:t,state:n,unstable_onError:r}){return f_(e,void 0,n,r,t)}function L7({to:e,replace:t,state:n,relative:r}){Tn(eu()," may be used only in the context of a component.");let{static:o}=D.useContext(ss);rs(!o," 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:s}=D.useContext(Gs),{pathname:i}=Ks(),l=Um(),c=_w(e,Sw(s),i,r==="path"),u=JSON.stringify(c);return D.useEffect(()=>{l(JSON.parse(u),{replace:t,state:n,relative:r})},[l,u,r,t,n]),null}function xr(e){Tn(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function I7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1,unstable_useTransitions:i}){Tn(!eu(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=D.useMemo(()=>({basename:l,navigator:o,static:s,unstable_useTransitions:i,future:{}}),[l,o,s,i]);typeof n=="string"&&(n=Jc(n));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,y=D.useMemo(()=>{let b=Ai(u,l);return b==null?null:{location:{pathname:b,search:d,hash:h,state:p,key:g},navigationType:r}},[l,u,d,h,p,g,r]);return rs(y!=null,` is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the won't render anything.`),y==null?null:D.createElement(ss.Provider,{value:c},D.createElement(rd.Provider,{children:t,value:y}))}function qk({children:e,location:t}){return C7(yb(e),t)}function yb(e,t=[]){let n=[];return D.Children.forEach(e,(r,o)=>{if(!D.isValidElement(r))return;let s=[...t,o];if(r.type===D.Fragment){n.push.apply(n,yb(r.props.children,s));return}Tn(r.type===xr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Tn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||s.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=yb(r.props.children,s)),n.push(i)}),n}var Cp="get",kp="application/x-www-form-urlencoded";function zm(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function N7(e){return zm(e)&&e.tagName.toLowerCase()==="button"}function j7(e){return zm(e)&&e.tagName.toLowerCase()==="form"}function O7(e){return zm(e)&&e.tagName.toLowerCase()==="input"}function $7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function U7(e,t){return e.button===0&&(!t||t==="_self")&&!$7(e)}var Rh=null;function z7(){if(Rh===null)try{new FormData(document.createElement("form"),0),Rh=!1}catch{Rh=!0}return Rh}var V7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function e0(e){return e!=null&&!V7.has(e)?(rs(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${kp}"`),null):e}function W7(e,t){let n,r,o,s,i;if(j7(e)){let l=e.getAttribute("action");r=l?Ai(l,t):null,n=e.getAttribute("method")||Cp,o=e0(e.getAttribute("enctype"))||kp,s=new FormData(e)}else if(N7(e)||O7(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a