Defer wordlist loading

This commit is contained in:
Jack Kingsman committed 2026-01-13 14:20:35 -08:00
1 parent 55d68beeb7
commit 2981b022bb
8 files changed
+563 -546

No files matched your search

-1
View File
@@ -1 +0,0 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 10%;--foreground: 0 0% 88%;--card: 0 0% 14%;--card-foreground: 0 0% 88%;--popover: 0 0% 14%;--popover-foreground: 0 0% 88%;--primary: 122 39% 49%;--primary-foreground: 0 0% 100%;--secondary: 0 0% 20%;--secondaLine truncated
+1
View File
@@ -0,0 +1 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 10%;--foreground: 0 0% 88%;--card: 0 0% 14%;--card-foreground: 0 0% 88%;--popover: 0 0% 14%;--popover-foreground: 0 0% 88%;--primary: 122 39% 49%;--primary-foreground: 0 0% 100%;--secondary: 0 0% 20%;--secondaLine truncated
-537
View File
@@ -1,537 +0,0 @@
var Xv=Object.defineProperty;var Jv=(a,o,r)=>o in a?Xv(a,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[o]=r;var Hn=(a,o,r)=>Jv(a,typeof o!="symbol"?o+"":o,r);function ek(a,o){for(var r=0;r<o.length;r++){const s=o[r];if(typeof s!="string"&&!Array.isArray(s)){for(const u in s)if(u!=="default"&&!(u in a)){const l=Object.getOwnPropertyDescriptor(s,u);l&&Object.defineProperty(a,u,l.get?l:{enumerable:!0,get:()=>s[u]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const l of u)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&s(m)}).observe(document,{childList:!0,subtree:!0});function r(u){const l={};return u.integrity&&(l.integrity=u.integrity),u.referrerPolicy&&(l.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?l.credentials="include":u.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(u){if(u.ep)return;u.ep=!0;const l=r(u);fetch(u.href,l)}})();var iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function Wg(a){if(Object.prototype.hasOwnProperty.call(a,"__esModule"))return a;var o=a.default;if(typeof o=="function"){var r=function s(){return this instanceof s?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};r.prototype=o.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(a).forEach(function(s){var u=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(r,s,u.get?u:{enumerable:!0,get:function(){return a[s]}})}),r}var au={exports:{}},vo={},nu={exports:{}},Ie={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lm;function ik(){if(Lm)return Ie;Lm=1;var a=Symbol.for("react.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function f(A){return A===null||typeof A!="object"?null:(A=y&&A[y]||A["@@iterator"],typeof A=="function"?A:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,k={};function v(A,I,L){this.props=A,this.context=I,this.refs=k,this.updater=L||w}v.prototype.isReactComponent={},v.prototype.setState=function(A,I){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,I,"setState")},v.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function j(){}j.prototype=v.prototype;function q(A,I,L){this.props=A,this.context=I,this.refs=k,this.updater=L||w}var x=q.prototype=new j;x.constructor=q,z(x,v.prototype),x.isPureReactComponent=!0;var _=Array.isArray,C=Object.prototype.hasOwnProperty,D={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function F(A,I,L){var $,le={},me=null,he=null;if(I!=null)for($ in I.ref!==void 0&&(he=I.ref),I.key!==void 0&&(me=""+I.key),I)C.call(I,$)&&!R.hasOwnProperty($)&&(le[$]=I[$]);var oe=arguments.length-2;if(oe===1)le.children=L;else if(1<oe){for(var qe=Array(oe),Te=0;Te<oe;Te++)qe[Te]=arguments[Te+2];le.children=qe}if(A&&A.defaultProps)for($ in oe=A.defaultProps,oe)le[$]===void 0&&(le[$]=oe[$]);return{$$typeof:a,type:A,key:me,ref:he,props:le,_owner:D.current}}function M(A,I){return{$$typeof:a,type:A.type,key:I,ref:A.ref,props:A.props,_owner:A._owner}}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===a}function T(A){var I={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(L){return I[L]})}var U=/\/+/g;function H(A,I){return typeof A=="object"&&A!==null&&A.key!=null?T(""+A.key):I.toString(36)}function Y(A,I,L,$,le){var me=typeof A;(me==="undefined"||me==="boolean")&&(A=null);var he=!1;if(A===null)he=!0;else switch(me){case"string":case"number":he=!0;break;case"object":switch(A.$$typeof){case a:case o:he=!0}}if(he)return he=A,le=le(he),A=$===""?"."+H(he,0):$,_(le)?(L="",A!=null&&(L=A.replace(U,"$&/")+"/"),Y(le,I,L,"",function(Te){return Te})):le!=null&&(P(le)&&(le=M(le,L+(!le.key||he&&he.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+A)),I.push(le)),1;if(he=0,$=$===""?".":$+":",_(A))for(var oe=0;oe<A.length;oe++){me=A[oe];var qe=$+H(me,oe);he+=Y(me,I,L,qe,le)}else if(qe=f(A),typeof qe=="function")for(A=qe.call(A),oe=0;!(me=A.next()).done;)me=me.value,qe=$+H(me,oe++),he+=Y(me,I,L,qe,le);else if(me==="object")throw I=String(A),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return he}function ae(A,I,L){if(A==null)return A;var $=[],le=0;return Y(A,$,"","",function(me){return I.call(L,me,le++)}),$}function X(A){if(A._status===-1){var I=A._result;I=I(),I.then(function(L){(A._status===0||A._status===-1)&&(A._status=1,A._result=L)},function(L){(A._status===0||A._status===-1)&&(A._status=2,A._result=L)}),A._status===-1&&(A._status=0,A._result=I)}if(A._status===1)return A._result.default;throw A._result}var ne={current:null},W={transition:null},re={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function J(){throw Error("act(...) is not supported in production builds of React.")}return Ie.Children={map:ae,forEach:function(A,I,L){ae(A,function(){I.apply(this,arguments)},L)},count:function(A){var I=0;return ae(A,function(){I++}),I},toArray:function(A){return ae(A,function(I){return I})||[]},only:function(A){if(!P(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Ie.Component=v,Ie.Fragment=r,Ie.Profiler=u,Ie.PureComponent=q,Ie.StrictMode=s,Ie.Suspense=h,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,Ie.act=J,Ie.cloneElement=function(A,I,L){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var $=z({},A.props),le=A.key,me=A.ref,he=A._owner;if(I!=null){if(I.ref!==void 0&&(me=I.ref,he=D.current),I.key!==void 0&&(le=""+I.key),A.type&&A.type.defaultProps)var oe=A.type.defaultProps;for(qe in I)C.call(I,qe)&&!R.hasOwnProperty(qe)&&($[qe]=I[qe]===void 0&&oe!==void 0?oe[qe]:I[qe])}var qe=arguments.length-2;if(qe===1)$.children=L;else if(1<qe){oe=Array(qe);for(var Te=0;Te<qe;Te++)oe[Te]=arguments[Te+2];$.children=oe}return{$$typeof:a,type:A.type,key:le,ref:me,props:$,_owner:he}},Ie.createContexLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Vm;function ak(){if(Vm)return vo;Vm=1;var a=Mu(),o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function m(c,h,d){var g,y={},f=null,w=null;d!==void 0&&(f=""+d),h.key!==void 0&&(f=""+h.key),h.ref!==void 0&&(w=h.ref);for(g in h)s.call(h,g)&&!l.hasOwnProperty(g)&&(y[g]=h[g]);if(c&&c.defaultProps)for(g in h=c.defaultProps,h)y[g]===void 0&&(y[g]=h[g]);return{$$typeof:o,type:c,key:f,ref:w,props:y,_owner:u.current}}return vo.Fragment=r,vo.jsx=m,vo.jsxs=m,vo}var Um;function nk(){return Um||(Um=1,au.exports=ak()),au.exports}var E=nk(),S=Mu();const de=Rr(S),Ou=ek({__proto__:null,default:de},[S]);var Ys={},ru={exports:{}},aa={},ou={exports:{}},su={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Wm;function rk(){return Wm||(Wm=1,(function(a){function o(W,re){var J=W.length;W.push(re);e:for(;0<J;){var A=J-1>>>1,I=W[A];if(0<u(I,re))W[A]=re,W[J]=I,J=A;else break e}}function r(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var re=W[0],J=W.pop();if(J!==re){W[0]=J;e:for(var A=0,I=W.length,L=I>>>1;A<L;){var $=2*(A+1)-1,le=W[$],me=$+1,he=W[me];if(0>u(le,J))me<I&&0>u(he,le)?(W[A]=he,W[me]=J,A=me):(W[A]=le,W[$]=J,A=$);else if(me<I&&0>u(he,J))W[A]=he,W[me]=J,A=me;else break e}}return re}function u(W,re){var J=W.sortIndex-re.sortIndex;return J!==0?J:W.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;a.unstable_now=function(){return l.now()}}else{var m=Date,c=m.now();a.unstable_now=function(){return m.now()-c}}var h=[],d=[],g=1,y=null,f=3,w=!1,z=!1,k=!1,v=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(W){for(var re=r(d);re!==null;){if(re.callback===null)s(d);else if(re.startTime<=W)s(d),re.sortIndex=re.expirationTime,o(h,re);else break;re=r(d)}}function _(W){if(k=!1,x(W),!z)if(r(h)!==null)z=!0,X(C);else{var re=r(d);re!==null&&ne(_,re.startTime-W)}}function C(W,re){z=!1,k&&(k=!1,j(F),F=-1),w=!0;var J=f;try{for(x(re),y=r(h);y!==null&&(!(y.expirationTime>re)||W&&!T());){var A=y.callback;if(typeof A=="function"){y.callback=null,f=y.priorityLevel;var I=A(y.expirationTime<=re);re=a.unstable_now(),typeof I=="function"?y.callback=I:y===r(h)&&s(h),x(re)}else s(h);y=r(h)}if(y!==null)var L=!0;else{var $=r(d);$!==null&&ne(_,$.startTime-re),L=!1}return L}finally{y=null,f=J,w=!1}}var D=!1,R=null,F=-1,M=5,P=-1;function T(){return!(a.unstable_now()-P<M)}function U(){if(R!==null){var W=a.unstable_now();P=W;var re=!0;try{re=R(!0,W)}finally{re?H():(D=!1,R=null)}}else D=!1}var H;if(typeof q=="function")H=function(){q(U)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,ae=Y.port2;Y.port1.onmessage=U,H=function(){ae.postMessage(null)}}else H=function(){v(U,0)};function X(W){R=W,D||(D=!0,H())}function ne(W,re){F=v(function(){W(a.unstable_now())},re)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(W){W.callback=null},a.unstable_continueExecution=function(){z||w||(z=!0,X(C))},a.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<W?Math.floor(1e3/W):5},a.unstable_getCurrentPriorityLevel=function(){return f},a.unstable_getFirstCallbackNode=function(){return r(h)},a.unstable_next=function(W){switch(f){case 1:case 2:case 3:var re=3;break;default:re=f}var J=f;f=re;try{return W()}finally{f=J}},a.unstable_pauseExecution=function(){},a.unstable_requestPaint=function(){},a.unstable_runWithPriority=function(W,re){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var J=f;f=W;try{return re()}finally{f=J}},a.unstable_scheduleCallback=function(W,re,J){var A=a.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?A+J:A):J=A,W){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=J+I,W={id:g++,callback:re,priorityLevel:W,startTime:J,expirationTime:I,sortIndex:-1},J>A?(W.sortIndex=J,o(d,W),r(h)===null&&W===r(d)&&(k?(j(F),F=-1):k=!0,ne(_,J-A))):(W.sortIndex=I,o(h,W),z||w||(z=!0,X(C))),W},a.unstable_shouldYield=T,a.unstable_wrapCallback=function(W){var re=f;return function(){var J=f;f=re;try{return W.apply(this,arguments)}finally{f=J}}}})(su)),su}var $m;function ok(){return $m||($m=1,ou.exports=rk()),ou.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Gm;function sk(){if(Gm)return aa;Gm=1;var a=Mu(),o=ok();function r(e){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)i+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,u={};function l(e,i){m(e,i),m(e+"Capture",i)}function m(e,i){for(u[e]=i,e=0;e<i.length;e++)s.add(i[e])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},y={};function f(e){return h.call(y,e)?!0:h.call(g,e)?!1:d.test(e)?y[e]=!0:(g[e]=!0,!1)}function w(e,i,n,t){if(n!==null&&n.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return t?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z(e,i,n,t){if(i===null||typeof i>"u"||w(e,i,n,t))return!0;if(t)return!1;if(n!==null)switch(n.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function k(e,i,n,t,p,b,B){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=t,this.attributeNamespace=p,this.mustUseProperty=n,this.propertyName=e,this.type=i,this.sanitizeURL=b,this.removeEmptyString=B}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new k(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var i=e[0];v[i]=new k(i,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new k(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new k(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){v[e]=new k(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new k(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new k(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new k(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new k(e,5,!1,e.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var i=e.replace(j,q);v[i]=new k(i,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var i=e.replace(j,q);v[i]=new k(i,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var i=e.replace(j,q);v[i]=new k(i,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new k(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new k(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,i,n,t){var p=v.hasOwnProperty(i)?v[i]:null;(p!==null?p.type!==0:t||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!= Line truncated
`+A+e}var L=!1;function $(e,i){if(!e||L)return"";L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(Z){var t=Z}Reflect.construct(e,[],i)}else{try{i.call()}catch(Z){t=Z}e.call(i.prototype)}else{try{throw Error()}catch(Z){t=Z}e()}}catch(Z){if(Z&&t&&typeof Z.stack=="string"){for(var p=Z.stack.split(`
`),b=t.stack.split(`
`),B=p.length-1,N=b.length-1;1<=B&&0<=N&&p[B]!==b[N];)N--;for(;1<=B&&0<=N;B--,N--)if(p[B]!==b[N]){if(B!==1||N!==1)do if(B--,N--,0>N||p[B]!==b[N]){var O=`
`+p[B].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),O}while(1<=B&&0<=N);break}}}finally{L=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function le(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=$(e.type,!1),e;case 11:return e=$(e.type.render,!1),e;case 1:return e=$(e.type,!0),e;default:return""}}function me(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case D:return"Portal";case M:return"Profiler";case F:return"StrictMode";case H:return"Suspense";case Y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case P:return(e._context.displayName||"Context")+".Provider";case U:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return i=e.displayName||null,i!==null?i:me(e.type)||"Memo";case X:i=e._payload,e=e._init;try{return me(e(i))}catch{}}return null}function he(e){var i=e.type;switch(e.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=i.render,e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(i);case 8:return i===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qe(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Te(e){var i=qe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,i),t=""+e[i];if(!e.hasOwnProperty(i)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,b=n.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return p.call(this)},set:function(B){t=""+B,b.call(this,B)}}),Object.defineProperty(e,i,{enumerable:n.enumerable}),{getValue:function(){return t},setValue:function(B){t=""+B},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function oi(e){e._valueTracker||(e._valueTracker=Te(e))}function ge(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var n=i.getValue(),t="";return e&&(t=qe(e)?e.checked?"true":"false":e.value),e=t,e!==n?(i.setValue(e),!0):!1}function _e(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Be(e,i){var n=i.checked;return J({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function si(e,i){var n=i.defaultValue==null?"":i.defaultValue,t=i.checked!=null?i.checked:i.defaultChecked;n=oe(i.value!=null?i.value:n),e._wrapperState={initialChecked:t,initialValue:n,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function ii(e,i){i=i.checked,i!=null&&x(e,"checked",i,!1)}function Ue(e,i){ii(e,i);var n=oe(i.value),t=i.type;if(n!=null)t==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(t==="submit"||t==="reset"){e.removeAttribute("value");return}i.hasOwnProperty("value")?Re(e,i.type,n):i.hasOwnProperty("defaultValue")&&Re(e,i.type,oe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(e.defaultChecked=!!i.defaultChecked)}function Ve(e,i,n){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var t=i.type;if(!(t!=="submit"&&t!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+e._wrapperState.initialValue,n||i===e.value||(e.value=i),e.defaultValue=i}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Re(e,i,n){(i!=="number"||_e(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Je=Array.isArray;function De(e,i,n,t){if(e=e.options,i){i={};for(var p=0;p<n.length;p++)i["$"+n[p]]=!0;for(n=0;n<e.length;n++)p=i.hasOwnProperty("$"+e[n].value),e[n].selected!==p&&(e[n].selected=p),p&&t&&(e[n].defaultSelected=!0)}else{for(n=""+oe(n),i=null,p=0;p<e.length;p++){if(e[p].value===n){e[p].selected=!0,t&&(e[p].defaultSelected=!0);return}i!==null||e[p].disabled||(i=e[p])}i!==null&&(i.selected=!0)}}function Ne(e,i){if(i.dangerouslySetInnerHTML!= Line truncated
`).replace(dv,"")}function cs(e,i,n){if(i=sp(i),sp(e)!==i&&n)throw Error(r(425))}function us(){}var $l=null,Gl=null;function Ql(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Kl=typeof setTimeout=="function"?setTimeout:void 0,pv=typeof clearTimeout=="function"?clearTimeout:void 0,tp=typeof Promise=="function"?Promise:void 0,mv=typeof queueMicrotask=="function"?queueMicrotask:typeof tp<"u"?function(e){return tp.resolve(null).then(e).catch(hv)}:Kl;function hv(e){setTimeout(function(){throw e})}function Yl(e,i){var n=i,t=0;do{var p=n.nextSibling;if(e.removeChild(n),p&&p.nodeType===8)if(n=p.data,n==="/$"){if(t===0){e.removeChild(p),Wr(i);return}t--}else n!=="$"&&n!=="$?"&&n!=="$!"||t++;n=p}while(n);Wr(i)}function dn(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return e}function lp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(i===0)return e;i--}else n==="/$"&&i++}e=e.previousSibling}return null}var lr=Math.random().toString(36).slice(2),Ta="__reactFiber$"+lr,ao="__reactProps$"+lr,Wa="__reactContainer$"+lr,Zl="__reactEvents$"+lr,gv="__reactListeners$"+lr,yv="__reactHandles$"+lr;function Bn(e){var i=e[Ta];if(i)return i;for(var n=e.parentNode;n;){if(i=n[Wa]||n[Ta]){if(n=i.alternate,i.child!==null||n!==null&&n.child!==null)for(e=lp(e);e!==null;){if(n=e[Ta])return n;e=lp(e)}return i}e=n,n=e.parentNode}return null}function no(e){return e=e[Ta]||e[Wa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function ds(e){return e[ao]||null}var Xl=[],ur=-1;function pn(e){return{current:e}}function ci(e){0>ur||(e.current=Xl[ur],Xl[ur]=null,ur--)}function ri(e,i){ur++,Xl[ur]=e.current,e.current=i}var mn={},Oi=pn(mn),Zi=pn(!1),_n=mn;function dr(e,i){var n=e.type.contextTypes;if(!n)return mn;var t=e.stateNode;if(t&&t.__reactInternalMemoizedUnmaskedChildContext===i)return t.__reactInternalMemoizedMaskedChildContext;var p={},b;for(b in n)p[b]=i[b];return t&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=p),p}function Xi(e){return e=e.childContextTypes,e!=null}function ps(){ci(Zi),ci(Oi)}function cp(e,i,n){if(Oi.current!==mn)throw Error(r(168));ri(Oi,i),ri(Zi,n)}function up(e,i,n){var t=e.stateNode;if(i=i.childContextTypes,typeof t.getChildContext!="function")return n;t=t.getChildContext();for(var p in t)if(!(p in i))throw Error(r(108,he(e)||"Unknown",p));return J({},n,t)}function ms(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mn,_n=Oi.current,ri(Oi,e),ri(Zi,Zi.current),!0}function dp(e,i,n){var t=e.stateNode;if(!t)throw Error(r(169));n?(e=up(e,i,_n),t.__reactInternalMemoizedMergedChildContext=e,ci(Zi),ci(Oi),ri(Oi,e)):ci(Zi),ri(Zi,n)}var $a=null,hs=!1,Jl=!1;function pp(e){$a===null?$a=[e]:$a.push(e)}function bv(e){hs=!0,pp(e)}function hn(){if(!Jl&&$a!==null){Jl=!0;var e=0,i=ei;try{var n=$a;for(ei=1;e<n.length;e++){var t=n[e];do t=t(!0);while(t!==null)}$a=null,hs=!1}catch(p){throw $a!==null&&($a=$a.slice(e+1)),hd(wl,hn),p}finally{ei=i,Jl=!1}}return null}var pr=[],mr=0,gs=null,ys=0,pa=[],ma=0,Dn=null,Ga=1,Qa="";function Fn(e,i){pr[mr++]=ys,pr[mr++]=gs,gs=e,ys=i}function mp(e,i,n){pa[ma++]=Ga,pa[ma++]=Qa,pa[ma++]=Dn,Dn=e;var t=Ga;e=Qa;var p=32-ja(t)-1;t&=~(1<<p),n+=1;var b=32-ja(i)+p;if(30<b){var B=p-p%5;b=(t&(1<<B)-1).toString(32),t>>=B,p-=B,Ga=1<<32-ja(i)+p|n<<p|t,Qa=b+e}else Ga=1<<b|n<<p|t,Qa=e}function ec(e){e.return!==null&&(Fn(e,1),mp(e,1,0))}function ic(e){for(;e===gs;)gs=pr[--mr],pr[mr]=null,ys=pr[--mr],pr[mr]=null;for(;e===Dn;)Dn=pa[--ma],pa[ma]=null,Qa=pa[--ma],pa[ma]=null,Ga=pa[--ma],pa[ma]=null}var sa=null,ta=null,ui=!1,Aa=null;function hp(e,i){var n=ba(5,null,null,0);n.elementType="DELETED",n.stateNode=i,n.return=e,i=e.deletions,i===null?(e.deletions=[n],e.flags|=16):i.push(n)}function gp(e,i){switch(e.tag){case 5:var n=e.type;return i=i.nodeType!==1||n.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(e.stateNode=i,sa=e,ta=dn(i.firstChild),!0):!1;case 6:return i=e.pendingProps===""||i.nodeType!==3?null:i,i!==null?(e.stateNode=i,sa=e,ta=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(n=Dn!==null?{id:Ga,overflow:Qa}:null,e.memoizedState={dehydrated:i,treeContext:n,retryLane:1073741824},n=ba(18,null,null,0),n.stateNode=i,n.return=e,e.child=n,sa=e,ta=null,!0):!1;default:return!1}}function ac(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(ui){var i=ta;if(i){var n=i;if(!gp(e,i)){if(ac(e))throw Error(r(418));i=dn(n.nextSibling);var t=sa;i&&gp(e,i)?hp(t,n):(e.flags=e.flags&-4097|2,ui=!1,sa=e)}}else{if(ac(e))throw Error(r(418));e.flags=e.flags&-4097|2,ui=!1,sa=e}}}function yp(e){for(e=e. Line truncated
Error generating stack: `+b.message+`
`+b.stack}return{value:e,source:i,stack:p,digest:null}}function qc(e,i,n){return{value:e,source:null,stack:n??null,digest:i??null}}function Ac(e,i){try{console.error(i.value)}catch(n){setTimeout(function(){throw n})}}var Av=typeof WeakMap=="function"?WeakMap:Map;function Yp(e,i,n){n=Ya(-1,n),n.tag=3,n.payload={element:null};var t=i.value;return n.callback=function(){Ps||(Ps=!0,Lc=t),Ac(e,i)},n}function Zp(e,i,n){n=Ya(-1,n),n.tag=3;var t=e.type.getDerivedStateFromError;if(typeof t=="function"){var p=i.value;n.payload=function(){return t(p)},n.callback=function(){Ac(e,i)}}var b=e.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(n.callback=function(){Ac(e,i),typeof t!="function"&&(fn===null?fn=new Set([this]):fn.add(this));var B=i.stack;this.componentDidCatch(i.value,{componentStack:B!==null?B:""})}),n}function Xp(e,i,n){var t=e.pingCache;if(t===null){t=e.pingCache=new Av;var p=new Set;t.set(i,p)}else p=t.get(i),p===void 0&&(p=new Set,t.set(i,p));p.has(n)||(p.add(n),e=Ov.bind(null,e,i,n),i.then(e,e))}function Jp(e){do{var i;if((i=e.tag===13)&&(i=e.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return e;e=e.return}while(e!==null);return null}function em(e,i,n,t,p){return(e.mode&1)===0?(e===i?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(i=Ya(-1,1),i.tag=2,yn(n,i,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Cv=_.ReactCurrentOwner,Ji=!1;function $i(e,i,n,t){i.child=e===null?kp(i,null,n,t):gr(i,e.child,n,t)}function im(e,i,n,t,p){n=n.render;var b=i.ref;return br(i,p),t=bc(e,i,n,t,b,p),n=fc(),e!==null&&!Ji?(i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~p,Za(e,i,p)):(ui&&n&&ec(i),i.flags|=1,$i(e,i,t,p),i.child)}function am(e,i,n,t,p){if(e===null){var b=n.type;return typeof b=="function"&&!Qc(b)&&b.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(i.tag=15,i.type=b,nm(e,i,b,t,p)):(e=Hs(n.type,null,t,i,i.mode,p),e.ref=i.ref,e.return=i,i.child=e)}if(b=e.child,(e.lanes&p)===0){var B=b.memoizedProps;if(n=n.compare,n=n!==null?n:Zr,n(B,t)&&e.ref===i.ref)return Za(e,i,p)}return i.flags|=1,e=zn(b,t),e.ref=i.ref,e.return=i,i.child=e}function nm(e,i,n,t,p){if(e!==null){var b=e.memoizedProps;if(Zr(b,t)&&e.ref===i.ref)if(Ji=!1,i.pendingProps=t=b,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Ji=!0);else return i.lanes=e.lanes,Za(e,i,p)}return Cc(e,i,n,t,p)}function rm(e,i,n){var t=i.pendingProps,p=t.children,b=e!==null?e.memoizedState:null;if(t.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ri(wr,la),la|=n;else{if((n&1073741824)===0)return e=b!==null?b.baseLanes|n:n,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:e,cachePool:null,transitions:null},i.updateQueue=null,ri(wr,la),la|=e,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},t=b!==null?b.baseLanes:n,ri(wr,la),la|=t}else b!==null?(t=b.baseLanes|n,i.memoizedState=null):t=n,ri(wr,la),la|=t;return $i(e,i,p,n),i.child}function om(e,i){var n=i.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(i.flags|=512,i.flags|=2097152)}function Cc(e,i,n,t,p){var b=Xi(n)?_n:Oi.current;return b=dr(i,b),br(i,p),n=bc(e,i,n,t,b,p),t=fc(),e!==null&&!Ji?(i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~p,Za(e,i,p)):(ui&&t&&ec(i),i.flags|=1,$i(e,i,n,p),i.child)}function sm(e,i,n,t,p){if(Xi(n)){var b=!0;ms(i)}else b=!1;if(br(i,p),i.stateNode===null)_s(e,i),Qp(i,n,t),jc(i,n,t,p),t=!0;else if(e===null){var B=i.stateNode,N=i.memoizedProps;B.props=N;var O=B.context,Z=n.contextType;typeof Z=="object"&&Z!==null?Z=ha(Z):(Z=Xi(n)?_n:Oi.current,Z=dr(i,Z));var te=n.getDerivedStateFromProps,ce=typeof te=="function"||typeof B.getSnapshotBeforeUpdate=="function";ce||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(N!==t||O!==Z)&&Kp(i,B,t,Z),gn=!1;var se=i.memoizedState;B.state=se,zs(i,t,B,p),O=i.memoizedState,N!==t||se!==O||Zi.current||gn?(typeof te=="function"&&(xc(i,n,te,t),O=i.memoizedState),(N=gn||Gp(i,n,N,t,se,O,Z))?(ce||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(i.flags|=4194308)):(typeof B.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=t,i.memoizedState=O),B.props=t,B.state=O,B.context=Z,t=N):(typeof B.componentDidMount=="function"&&(i.flags|=4194308),t=!1)}else{B=i.stateNode,zp(e,i),N=i.memoizedProps,Z=i.type===i.elementType?N:Ca(i.type,N),B.props=Z,ce=i.pendingProps,se=B.context,O=n.contextType,typeof O=="object"&&O!==null?O=ha(O):(O=Xi(n)?_n:Oi.current,O=dr(i,O));var ye=n.getDerivedStateFromProps;(te=typeof ye=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(N!==ce||se!==O)&&Kp(i,B,t,O),gn=!1,se=i.memoizedState,B Line truncated
`)}function pk(a){if(a.length===0)return`Neighbors
No neighbors reported`;const o=[...a].sort((s,u)=>u.snr-s.snr),r=[`Neighbors (${o.length})`];for(const s of o){const u=s.name||s.pubkey_prefix,l=s.snr>=0?`+${s.snr.toFixed(1)}`:s.snr.toFixed(1);r.push(`${u}, ${l} dB [${st(s.last_heard_seconds)} ago]`)}return r.join(`
`)}function mk(a){if(a.length===0)return`ACL
No ACL entries`;const o=[`ACL (${a.length})`];for(const r of a){const s=r.name||r.pubkey_prefix;o.push(`${s}: ${r.permission_name}`)}return o.join(`
`)}function Vn(a,o,r,s=0){const u=Math.floor(Date.now()/1e3);return{id:-Date.now()-s,type:"PRIV",conversation_key:a,text:o,sender_timestamp:u,received_at:u,path_len:null,txt_type:0,signature:null,outgoing:r,acked:1}}function hk(a,o,r){const[s,u]=S.useState(!1);S.useEffect(()=>{u(!1)},[a==null?void 0:a.id]);const l=S.useMemo(()=>{if(!a||a.type!=="contact")return!1;const h=o.find(d=>d.public_key===a.id);return(h==null?void 0:h.type)===Gg},[a,o]),m=S.useCallback(async h=>{if(!(!a||a.type!=="contact")&&l)try{const d=await Me.requestTelemetry(a.id,h),g=Vn(a.id,dk(d),!1,0),y=Vn(a.id,pk(d.neighbors),!1,1),f=Vn(a.id,mk(d.acl),!1,2);r(w=>[...w,g,y,f]),u(!0)}catch(d){const g=Vn(a.id,`Telemetry request failed: ${d instanceof Error?d.message:"Unknown error"}`,!1,0);r(y=>[...y,g])}},[a,l,r]),c=S.useCallback(async h=>{if(!a||a.type!=="contact"||!l||!s)return;const d=Vn(a.id,`> ${h}`,!0,0);r(g=>[...g,d]);try{const g=await Me.sendRepeaterCommand(a.id,h),y=Vn(a.id,g.response,!1,1);g.sender_timestamp&&(y.sender_timestamp=g.sender_timestamp),r(f=>[...f,y])}catch(g){const y=Vn(a.id,`Command failed: ${g instanceof Error?g.message:"Unknown error"}`,!1,1);r(f=>[...f,y])}},[a,l,s,r]);return{repeaterLoggedIn:s,activeContactIsRepeater:l,handleTelemetryRequest:m,handleRepeaterCommand:c}}const gk=12;function _r(a){return a.slice(0,gk)}function Qg(a,o){return!a||!o?!1:_r(a)===_r(o)}function Zn(a,o){return a||_r(o)}const ju="remoteterm-lastMessageTime";function Kg(a){try{const o=localStorage.getItem(a);return o?JSON.parse(o):{}}catch{return{}}}function yk(a,o){try{localStorage.setItem(a,JSON.stringify(o))}catch{}}function Ym(){return Kg(ju)}function tu(a,o){const r=Kg(ju);return(!r[a]||o>r[a])&&(r[a]=o,yk(ju,r)),r}function Ha(a,o){return a==="channel"?`channel-${o}`:`contact-${_r(o)}`}function bk(a,o,r){const[s,u]=S.useState({}),[l,m]=S.useState(Ym),c=S.useRef(new Set),h=S.useRef(new Set);S.useEffect(()=>{const w=a.filter(v=>!c.current.has(v.key)),z=o.filter(v=>v.public_key&&!h.current.has(v.public_key));if(w.length===0&&z.length===0)return;w.forEach(v=>c.current.add(v.key)),z.forEach(v=>h.current.add(v.public_key)),(async()=>{const v=[...w.map(j=>({type:"CHAN",conversation_key:j.key})),...z.map(j=>({type:"PRIV",conversation_key:j.public_key}))];if(v.length!==0)try{const j=await Me.getMessagesBulk(v,100),q={},x={};for(const _ of w){const C=j[`CHAN:${_.key}`]||[];if(C.length>0){const D=Ha("channel",_.key),R=_.last_read_at||0,F=C.filter(P=>!P.outgoing&&P.received_at>R).length;F>0&&(q[D]=F);const M=Math.max(...C.map(P=>P.received_at));x[D]=M,tu(D,M)}}for(const _ of z){const C=j[`PRIV:${_.public_key}`]||[];if(C.length>0){const D=Ha("contact",_.public_key),R=_.last_read_at||0,F=C.filter(P=>!P.outgoing&&P.received_at>R).length;F>0&&(q[D]=F);const M=Math.max(...C.map(P=>P.received_at));x[D]=M,tu(D,M)}}Object.keys(q).length>0&&u(_=>({..._,...q})),m(Ym())}catch(j){console.error("Failed to fetch messages bulk:",j)}})()},[a,o]),S.useEffect(()=>{if(r&&r.type!=="raw"){const w=Ha(r.type,r.id);u(z=>{if(z[w]){const k={...z};return delete k[w],k}return z}),r.type==="channel"?Me.markChannelRead(r.id).catch(z=>{console.error("Failed to mark channel as read on server:",z)}):r.type==="contact"&&Me.markContactRead(r.id).catch(z=>{console.error("Failed to mark contact as read on server:",z)})}},[r]);const d=S.useCallback(w=>{u(z=>({...z,[w]:(z[w]||0)+1}))},[]),g=S.useCallback(()=>{u({}),Me.markAllRead().catch(w=>{console.error("Failed to mark all as read on server:",w)})},[]),y=S.useCallback(w=>{if(w.type==="raw")return;const z=Ha(w.type,w.id);u(k=>{if(k[z]){const v={...k};return delete v[z],v}return k}),w.type==="channel"?Me.markChannelRead(w.id).catch(k=>{console.error("Failed to mark channel as read on server:",k)}):w.type==="contact"&&Me.markContactRead(w.id).catch(k=>{console.error("Failed to mark contact as read on server:",k)})},[]),f=S.useCallback(w=>{let z=null;if(w.type==="CHAN"&&w.conversation_key?z=Ha("channel",w.conversation_key):w.type==="PRIV"&&w.conversation_key&&(z=Ha("contact",w.conversation_key)),z){const k=w.received_at||Math.floor(Date.now()/1e3),v=tu(z,k);m(v)}},[]);return{unreadCounts:s,lastMessageTimes:l,incrementUnread:d,markAllRead:g,markConversationRead:y,trackNewMessage:f}}var Yg=$g();const Zg=Rr(Yg);function fk(a){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o.appendChild(r),r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}const vk=a=>{switch(a){case"success":return zk;case"info":return jk;case"warning":return xk;case"error":return qk;default:return null}},kk=Array(12).fill(0),wk=({visible:a,className:o})=>de.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":a},de.createElement("div",{className:"sonner-spinner"},kk.map((r,s)=>de.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),zk=de.createElement("svg",{xmlns:"http://www.w3 Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gk=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qk=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,r,s)=>s?s.toUpperCase():r.toLowerCase()),Jm=a=>{const o=Qk(a);return o.charAt(0).toUpperCase()+o.slice(1)},Xg=(...a)=>a.filter((o,r,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===r).join(" ").trim(),Kk=a=>{for(const o in a)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Yk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zk=S.forwardRef(({color:a="currentColor",size:o=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:u="",children:l,iconNode:m,...c},h)=>S.createElement("svg",{ref:h,...Yk,width:o,height:o,stroke:a,strokeWidth:s?Number(r)*24/Number(o):r,className:Xg("lucide",u),...!l&&!Kk(c)&&{"aria-hidden":"true"},...c},[...m.map(([d,g])=>S.createElement(d,g)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lu=(a,o)=>{const r=S.forwardRef(({className:s,...u},l)=>S.createElement(Zk,{ref:l,iconNode:o,className:Xg(`lucide-${Gk(Jm(a))}`,`lucide-${a}`,s),...u}));return r.displayName=Jm(a),r};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jk=Lu("check",Xk);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ew=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],iw=Lu("menu",ew);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jg=Lu("x",aw);function nw({health:a,config:o,onConfigClick:r,onMaintenanceClick:s,onAdvertise:u,onMenuClick:l}){const m=(a==null?void 0:a.radio_connected)??!1,[c,h]=S.useState(!1),d=async()=>{h(!0);try{const g=await Me.reconnectRadio();g.connected&&gi.success("Reconnected",{description:g.message})}catch(g){gi.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{h(!1)}};return E.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&E.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:E.jsx(iw,{className:"h-5 w-5"})}),E.jsx("h1",{className:"hidden lg:block text-base font-semibold mr-auto",children:"RemoteTerm"}),E.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[E.jsx("div",{className:`w-2 h-2 rounded-full ${m?"bg-[#4caf50]":"bg-[#666]"}`}),E.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:m?"Connected":"Disconnected"})]}),(a==null?void 0:a.serial_port)&&E.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Port: ",E.jsx("span",{className:"text-[#e0e0e0]",children:a.serial_port})]}),o&&E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"hidden lg:flex items-center gap-1 text-[#888]",children:E.jsx("span",{className:"text-[#e0e0e0]",children:o.name||"Unnamed"})}),E.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:[o.radio.freq," MHz/SF",o.radio.sf,"/CR",o.radio.cr,"/",o.tx_power,"dBm"]})]}),E.jsx("div",{className:"flex-1 lg:hidden"}),!m&&E.jsx("button",{onClick:d,disabled:c,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:c?"Reconnecting...":"Reconnect"}),E.jsx("button",{onClick:u,disabled:!m,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444] disabled:bg-[#333] disabled:text-[#666] disabled:cursor-not-allowed",children:"Advertise"}),E.jsx("button",{onClick:s,className:"px-2 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",title:"Database Maintenance",children:E.jsx("span",{role:"img","aria-label":"Settings",children:"⚙️"})}),E.jsxs("button",{onClick:r,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[E.jsx("span",{role:"img","aria-label":"Radio",children:"📻"})," Config"]})]})}const Au=2,rw={text:"🛜",background:"#444444",textColor:"#ffffff"};function ow(a){let o=0;for(let r=0;r<a.length;r++){const s=a.charCodeAt(r);o=(o<<5)-o+s,o=o&o}return Math.abs(o)}const sw=/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;function tw(a,o){if(!a)return o.slice(0,2).toUpperCase();const r=a.match(sw);if(r)return r[0];const s=a.match(/[a-zA-Z]/g);if(!s||s.length===0)return o.slice(0,2).toUpperCase();const u=a.indexOf(" ");if(u!==-1){const l=s[0],m=a.slice(u+1).match(/[a-zA-Z]/);if(m)return(l+m[0]).toUpperCase()}return s[0].toUpperCase()}function lw(a){const o=ow(a),r=o%360,s=50+(o>>8)%30,u=35+(o>>16)%20,l=`hsl(${r}, ${s}%, ${u}%)`,m=u<45?"#ffffff":"#000000";return{background:l,text:m}}function cw(a,o,r){if(r===Au)return rw;const s=tw(a,o),u=lw(o);return{text:s,background:u.background,textColor:u.text}}function ey({name:a,publicKey:o,size:r=28,contactType:s}){const u=cw(a,o,s);return E.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:u.background,color:u.textColor,width:r,height:r,fontSize:r*.45},children:u.text})}function iy(a){var o,r,s="";if(typeof a=="string"||typeof a=="number")s+=a;else if(typeof a=="object")if(Array.isArray(a)){var u=a.length;for(o=0;o<u;o++)a[o]&&(r=iy(a[o]))&&(s&&(s+=" "),s+=r)}else for(r in a)a[r]&&(s&&(s+=" "),s+=r);return s}function ay(){for(var a,o,r=0,s="",u=arguments.length;r<u;r++)(a=arguments[r])&&(o=iy(a))&&(s&&(s+=" "),s+=o);return s}const uw=(a,o)=>{const r=new Array(a.length+o.length);for(let s=0;s<a.length;s++)r[s]=a[s];for(let s=0;s<o.length;s++)r[a.length+s]=o[s];return r},dw=(a,o)=>({classGroupId:a,validator:o}),ny=(a=new Map,o=null,r)=>({nextPart:a,validators:o,classGroupId:r}),Yt="-",eh=[],pw="arbitrary..",mw=a=>{const o=gw(a),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return hw(m);const c=m.split(Yt),h=c[0]===""&&c.length>1?1:0;return ry(c,h,o)},getConflictingClassGroupIds:(m,c)=>{if(c){const h=s[m],d=r[m];return h?d?uw(d,h):h:d||eh}return r[m]||eh}}},ry=(a,o,r)=>{if(a.length-o===0)return r.classGroupId;const u=a[o],l=r.Line truncated
`).map((A,I,L)=>E.jsxs("span",{children:[uz(A,c),I<L.length-1&&E.jsx("br",{})]},I)),!X&&E.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:Eu(C.sender_timestamp||C.received_at)}),C.outgoing&&(C.acked>0?` ✓${C.acked>1?C.acked:""}`:" ?")]})]})]},C.id)})]}),y&&E.jsx("button",{onClick:k,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:E.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const ch=156,pz=140,mz=156,hz=120,gz=8,yz=S.forwardRef(function({onSend:o,disabled:r,placeholder:s,isRepeaterMode:u,conversationType:l,senderName:m},c){const[h,d]=S.useState(""),[g,y]=S.useState(!1),f=S.useRef(null);S.useImperativeHandle(c,()=>({appendText:C=>{var D;d(R=>R+C),(D=f.current)==null||D.focus()}}));const w=S.useMemo(()=>{if(l==="contact")return{warningAt:pz,dangerAt:ch,hardLimit:ch};if(l==="channel"){const C=(m==null?void 0:m.length)??10,D=Math.max(1,mz-C-2);return{warningAt:hz,dangerAt:Math.max(1,D-gz),hardLimit:D}}return null},[l,m]),{limitState:z,warningMessage:k}=S.useMemo(()=>{if(!w)return{limitState:"normal",warningMessage:null};const C=h.length;return C>=w.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:C>=w.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:C>=w.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[h.length,w]),v=w?w.hardLimit-h.length:0,j=S.useCallback(async C=>{C.preventDefault();const D=h.trim();if(u){if(g||r)return;const R=D==="."?"":D;y(!0);try{await o(R),d("")}catch(F){console.error("Failed to request telemetry:",F),gi.error("Failed to request telemetry",{description:F instanceof Error?F.message:"Check radio connection"});return}finally{y(!1)}setTimeout(()=>{var F;return(F=f.current)==null?void 0:F.focus()},0)}else{if(!D||g||r)return;y(!0);try{await o(D),d("")}catch(R){console.error("Failed to send message:",R),gi.error("Failed to send message",{description:R instanceof Error?R.message:"Check radio connection"});return}finally{y(!1)}setTimeout(()=>{var R;return(R=f.current)==null?void 0:R.focus()},0)}},[h,g,r,o,u]),q=S.useCallback(C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),j(C))},[j]),x=u?h.trim().length>0||h===".":h.trim().length>0,_=!u&&w!==null;return E.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:j,children:[E.jsxs("div",{className:"flex gap-2",children:[E.jsx(wi,{ref:f,type:u?"password":"text",value:h,onChange:C=>d(C.target.value),onKeyDown:q,placeholder:s||(u?"Enter password (or . for none)...":"Type a message..."),disabled:r||g,className:"flex-1 min-w-0"}),E.jsx(fa,{type:"submit",disabled:r||g||!x,className:"flex-shrink-0",children:g?u?"Fetching...":"Sending...":u?"Fetch":"Send"})]}),_&&E.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[E.jsxs("span",{className:We("tabular-nums",z==="error"||z==="danger"?"text-red-500 font-medium":z==="warning"?"text-yellow-500":"text-muted-foreground"),children:[h.length,"/",w.hardLimit,v<0&&` (${v})`]}),k&&E.jsxs("span",{className:We(z==="error"?"text-red-500":"text-yellow-500"),children:["— ",k]})]})]})});function Si(a,o,{checkForDefaultPrevented:r=!0}={}){return function(u){if(a==null||a(u),r===!1||!u.defaultPrevented)return o==null?void 0:o(u)}}function bz(a,o){const r=S.createContext(o),s=l=>{const{children:m,...c}=l,h=S.useMemo(()=>c,Object.values(c));return E.jsx(r.Provider,{value:h,children:m})};s.displayName=a+"Provider";function u(l){const m=S.useContext(r);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${a}\``)}return[s,u]}function Ho(a,o=[]){let r=[];function s(l,m){const c=S.createContext(m),h=r.length;r=[...r,m];const d=y=>{var j;const{scope:f,children:w,...z}=y,k=((j=f==null?void 0:f[a])==null?void 0:j[h])||c,v=S.useMemo(()=>z,Object.values(z));return E.jsx(k.Provider,{value:v,children:w})};d.displayName=l+"Provider";function g(y,f){var k;const w=((k=f==null?void 0:f[a])==null?void 0:k[h])||c,z=S.useContext(w);if(z)return z;if(m!==void 0)return m;throw new Error(`\`${y}\` must be used within \`${l}\``)}return[d,g]}const u=()=>{const l=r.map(m=>S.createContext(m));return function(c){const h=(c==null?void 0:c[a])||l;return S.useMemo(()=>({[`__scope${a}`]:{...c,[a]:h}}),[c,h])}};return u.scopeName=a,[s,fz(u,...o)]}function fz(...a){const o=a[0];if(a.length===1)return o;const r=()=>{const s=a.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const m=s.reduce((c,{useScope:h,scopeName:d})=>{const y=h(l)[`__scope${d}`];return{...c,...y}},{});return S.useMemo(()=Line truncated
.`.concat(Jz,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(c,"px ").concat(s,`;
}
body[`).concat(Sr,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(s,";"),r==="margin"&&`
padding-left: `.concat(u,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(m,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(c,"px ").concat(s,`;
`),r==="padding"&&"padding-right: ".concat(c,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(tt,` {
right: `).concat(c,"px ").concat(s,`;
}
.`).concat(lt,` {
margin-right: `).concat(c,"px ").concat(s,`;
}
.`).concat(tt," .").concat(tt,` {
right: 0 `).concat(s,`;
}
.`).concat(lt," .").concat(lt,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(Sr,`] {
`).concat(ex,": ").concat(c,`px;
}
`)},fh=function(){var a=parseInt(document.body.getAttribute(Sr)||"0",10);return isFinite(a)?a:0},vx=function(){S.useEffect(function(){return document.body.setAttribute(Sr,(fh()+1).toString()),function(){var a=fh()-1;a<=0?document.body.removeAttribute(Sr):document.body.setAttribute(Sr,a.toString())}},[])},kx=function(a){var o=a.noRelative,r=a.noImportant,s=a.gapMode,u=s===void 0?"margin":s;vx();var l=S.useMemo(function(){return yx(u)},[u]);return S.createElement(bx,{styles:fx(l,!o,u,r?"":"!important")})},Bu=!1;if(typeof window<"u")try{var at=Object.defineProperty({},"passive",{get:function(){return Bu=!0,!0}});window.addEventListener("test",at,at),window.removeEventListener("test",at,at)}catch{Bu=!1}var qr=Bu?{passive:!1}:!1,wx=function(a){return a.tagName==="TEXTAREA"},Ay=function(a,o){if(!(a instanceof Element))return!1;var r=window.getComputedStyle(a);return r[o]!=="hidden"&&!(r.overflowY===r.overflowX&&!wx(a)&&r[o]==="visible")},zx=function(a){return Ay(a,"overflowY")},xx=function(a){return Ay(a,"overflowX")},vh=function(a,o){var r=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var u=Cy(a,s);if(u){var l=Ey(a,s),m=l[1],c=l[2];if(m>c)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},jx=function(a){var o=a.scrollTop,r=a.scrollHeight,s=a.clientHeight;return[o,r,s]},qx=function(a){var o=a.scrollLeft,r=a.scrollWidth,s=a.clientWidth;return[o,r,s]},Cy=function(a,o){return a==="v"?zx(o):xx(o)},Ey=function(a,o){return a==="v"?jx(o):qx(o)},Ax=function(a,o){return a==="h"&&o==="rtl"?-1:1},Cx=function(a,o,r,s,u){var l=Ax(a,window.getComputedStyle(o).direction),m=l*s,c=r.target,h=o.contains(c),d=!1,g=m>0,y=0,f=0;do{if(!c)break;var w=Ey(a,c),z=w[0],k=w[1],v=w[2],j=k-v-l*z;(z||j)&&Cy(a,c)&&(y+=j,f+=z);var q=c.parentNode;c=q&&q.nodeType===Node.DOCUMENT_FRAGMENT_NODE?q.host:q}while(!h&&c!==document.body||h&&(o.contains(c)||o===c));return(g&&Math.abs(y)<1||!g&&Math.abs(f)<1)&&(d=!0),d},nt=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},kh=function(a){return[a.deltaX,a.deltaY]},wh=function(a){return a&&"current"in a?a.current:a},Ex=function(a,o){return a[0]===o[0]&&a[1]===o[1]},Sx=function(a){return`
.block-interactivity-`.concat(a,` {pointer-events: none;}
.allow-interactivity-`).concat(a,` {pointer-events: all;}
`)},Bx=0,Ar=[];function _x(a){var o=S.useRef([]),r=S.useRef([0,0]),s=S.useRef(),u=S.useState(Bx++)[0],l=S.useState(qy)[0],m=S.useRef(a);S.useEffect(function(){m.current=a},[a]),S.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(u));var k=Xz([a.lockRef.current],(a.shards||[]).map(wh),!0).filter(Boolean);return k.forEach(function(v){return v.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),k.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(u))})}}},[a.inert,a.lockRef.current,a.shards]);var c=S.useCallback(function(k,v){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!m.current.allowPinchZoom;var j=nt(k),q=r.current,x="deltaX"in k?k.deltaX:q[0]-j[0],_="deltaY"in k?k.deltaY:q[1]-j[1],C,D=k.target,R=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in k&&R==="h"&&D.type==="range")return!1;var F=window.getSelection(),M=F&&F.anchorNode,P=M?M===D||M.contains(D):!1;if(P)return!1;var T=vh(R,D);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=vh(R,D)),!T)return!1;if(!s.current&&"changedTouches"in k&&(x||_)&&(s.current=C),!C)return!0;var U=s.current||C;return Cx(U,v,k,U==="h"?x:_)},[]),h=S.useCallback(function(k){var v=k;if(!(!Ar.length||Ar[Ar.length-1]!==l)){var j="deltaY"in v?kh(v):nt(v),q=o.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Ex(C.delta,j)})[0];if(q&&q.should){v.cancelable&&v.preventDefault();return}if(!q){var x=(m.current.shards||[]).map(wh).filter(Boolean).filter(function(C){return C.contains(v.target)}),_=x.length>0?c(v,x[0]):!m.current.noIsolation;_&&v.cancelable&&v.preventDefault()}}},[]),d=S.useCallback(function(k,v,j,q){var x={name:k,delta:v,target:j,should:q,shadowParent:Dx(j)};o.current.push(x),setTimeout(function(){o.current=o.current.filter(function(_){return _!==x})},1)},[]),g=S.useCallback(function(k){r.current=nt(k),s.current=void 0},[]),y=S.useCallback(function(k){d(k.type,kh(k),k.target,c(k,a.lockRef.current))},[]),f=S.useCallback(function(k){d(k.type,nt(k),k.target,c(k,a.lockRef.current))},[]);S.useEffect(function(){return Ar.push(l),a.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:f}),document.addEventListener("wheel",h,qr),document.addEventListener("touchmove",h,qr),document.addEventListener("touchstart",g,qr),function(){Ar=Ar.filter(function(k){return k!==l}),document.removeEventListener("wheel",h,qr),document.removeEventListener("touchmove",h,qr),document.removeEventListener("touchstart",g,qr)}},[]);var w=a.removeScrollBar,z=a.inert;return S.createElement(S.Fragment,null,z?S.createElement(l,{styles:Sx(u)}):null,w?S.createElement(kx,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function Dx(a){for(var o=null;a!==null;)a instanceof ShadowRoot&&(o=a.host,a=a.host),a=a.parentNode;return o}const Fx=tx(jy,_x);var Sy=S.forwardRef(function(a,o){return S.createElement(ol,Va({},a,{ref:o,sideCar:Fx}))});Sy.classNames=ol.classNames;var Rx=function(a){if(typeof document>"u")return null;var o=Array.isArray(a)?a[0]:a;return o.ownerDocument.body},Cr=new WeakMap,rt=new WeakMap,ot={},bu=0,By=function(a){return a&&(a.host||By(a.parentNode))},Tx=function(a,o){return o.map(function(r){if(a.contains(r))return r;var s=By(r);return s&&a.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",a,". Doing nothing"),null)}).filter(function(r){return!!r})},Px=function(a,o,r,s){var u=Tx(o,Array.isArray(a)?a:[a]);ot[r]||(ot[r]=new WeakMap);var l=ot[r],m=[],c=new Set,h=new Set(u),d=function(y){!y||c.has(y)||(c.add(y),d(y.parentNode))};u.forEach(d);var g=function(y){!y||h.has(y)||Array.prototype.forEach.call(y.children,function(f){if(c.has(f))g(f);else try{var w=f.getAttribute(s),z=w!==null&&w!=="false",k=(Cr.get(f)||0)+1,v=(l.get(f)||0)+1;Cr.set(f,k),l.set(f,v),m.push(f),k===1&&z&&rt.set(f,!0),v===1&&f.setAttribute(r,"true"),z||f.setAttribute(s,"true")}catch(j){console.error("aria-hidden: cannot operate on ",f,j)}})};return g(o),c.clear(),bu++,function(){m.forEach(function(y){var f=Cr.get(y)-1,w=l.get(y)-1;Cr.set(y,f),l.set(y,w),f||(rt.has(y)||y.removeAttribute(s),rt.delete(y)),w||y.removeAttribute(r)}),bu--,bu||(Cr=new WeakMap,Cr=new WeakMap,rt=new WeakMap,ot={})}},Nx=function(a,o,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(a)?a:[a]),u=Rx(a);return u?(s.push.apply(s,Array.from(u.querySelectorAll("[aria-live], script"))),Px(s,u,r,"aria-hidden")):function(){return null}};function Ix(a){const o=Mx(a),r=S.forwardRef((s,u)=>{const{children:l,...m}=s,c=S.Children.toArray(l),h=c.find(Lx);if(h){const d=h.props.children,g=c.map(y=>y===h?S.Children.count(d)>1?S.Children.only(null):S.isValidElement(d)?d.props.children:null:y);return E.jsx(o,{...m,ref:u,children:S.isValidElement(d)?S.cloneElement(d,void 0,g):null})}return E.jsx(o,{...m,ref:u,children:l})});return r.displayName=`${a}.Slot`,r}function Mx(a){const o=S.forwardRef((r,s)=>{const{children:u Line truncated
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return S.useEffect(()=>{a&&(document.getElementById(a)||console.error(r))},[r,a]),null},Xx="DialogDescriptionWarning",Jx=({contentRef:a,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wy(Xx).contentName}}.`;return S.useEffect(()=>{var l;const u=(l=a.current)==null?void 0:l.getAttribute("aria-describedby");o&&u&&(document.getElementById(o)||console.warn(s))},[s,a,o]),null},$y=Dy,Gy=Ty,tl=Py,ll=Ny,cl=My,ul=Ly,Qy=Vy;const Gu=$y,e0=Gy,Ky=S.forwardRef(({className:a,...o},r)=>E.jsx(tl,{ref:r,className:We("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...o}));Ky.displayName=tl.displayName;const dl=S.forwardRef(({className:a,children:o,...r},s)=>E.jsxs(e0,{children:[E.jsx(Ky,{}),E.jsxs(ll,{ref:s,className:We("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...r,children:[o,E.jsxs(Qy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[E.jsx(Jg,{className:"h-4 w-4"}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dl.displayName=ll.displayName;const pl=({className:a,...o})=>E.jsx("div",{className:We("flex flex-col space-y-1.5 text-center sm:text-left",a),...o});pl.displayName="DialogHeader";const Qu=({className:a,...o})=>E.jsx("div",{className:We("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...o});Qu.displayName="DialogFooter";const ml=S.forwardRef(({className:a,...o},r)=>E.jsx(cl,{ref:r,className:We("text-lg font-semibold leading-none tracking-tight",a),...o}));ml.displayName=cl.displayName;const i0=S.forwardRef(({className:a,...o},r)=>E.jsx(ul,{ref:r,className:We("text-sm text-muted-foreground",a),...o}));i0.displayName=ul.displayName;function zh(a){const o=a0(a),r=S.forwardRef((s,u)=>{const{children:l,...m}=s,c=S.Children.toArray(l),h=c.find(r0);if(h){const d=h.props.children,g=c.map(y=>y===h?S.Children.count(d)>1?S.Children.only(null):S.isValidElement(d)?d.props.children:null:y);return E.jsx(o,{...m,ref:u,children:S.isValidElement(d)?S.cloneElement(d,void 0,g):null})}return E.jsx(o,{...m,ref:u,children:l})});return r.displayName=`${a}.Slot`,r}function a0(a){const o=S.forwardRef((r,s)=>{const{children:u,...l}=r;if(S.isValidElement(u)){const m=s0(u),c=o0(l,u.props);return u.type!==S.Fragment&&(c.ref=s?Lo(s,m):m),S.cloneElement(u,c)}return S.Children.count(u)>1?S.Children.only(null):null});return o.displayName=`${a}.SlotClone`,o}var n0=Symbol("radix.slottable");function r0(a){return S.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===n0}function o0(a,o){const r={...o};for(const s in o){const u=a[s],l=o[s];/^on[A-Z]/.test(s)?u&&l?r[s]=(...c)=>{const h=l(...c);return u(...c),h}:u&&(r[s]=u):s==="style"?r[s]={...u,...l}:s==="className"&&(r[s]=[u,l].filter(Boolean).join(" "))}return{...a,...r}}function s0(a){var s,u;let o=(s=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:s.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?a.ref:(o=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?a.props.ref:a.props.ref||a.ref)}function t0(a){const o=a+"CollectionProvider",[r,s]=Ho(o),[u,l]=r(o,{collectionRef:{current:null},itemMap:new Map}),m=k=>{const{scope:v,children:j}=k,q=de.useRef(null),x=de.useRef(new Map).current;return E.jsx(u,{scope:v,itemMap:x,collectionRef:q,children:j})};m.displayName=o;const c=a+"CollectionSlot",h=zh(c),d=de.forwardRef((k,v)=>{const{scope:j,children:q}=k,x=l(c,j),_=va(v,x.collectionRef);return E.jsx(h,{ref:_,children:q})});d.displayName=c;const g=a+"CollectionItemSlot",y="data-radix-collection-item",f=zh(g),w=de.forwardRef((k,v)=>{const{scope:j,children:q,...x}=k,_=de.useRef(null),C=va(v,_),D=l(g,j);return de.useEffect(()=>(D.itemMap.set(_,{ref:_,...x}),()=>void D.itemMap.delete(_))),E.jsx(f,{[y]:"",ref:C,children:q})});w.displayName=g;function z(k){const v=l(a+"CollectionConsumer",k);return de.useCallback(()=>{const q=v.collectionRef.current;if(!q)return[];const x=Array.from(q.querySelectorAll(`[${y}]`));return Array.from(v.itemMap.values()).sort((D,R)=>x.indexOf(D.ref.current)-x.indexOf(R.ref.current))},[v.coll Line truncated
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/return(function(s){var u=r,l=u.lib,m=l.WordArray,c=l.Hasher,h=u.algo,d=m.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),g=m.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),y=m.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=m.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),w=m.create([0,1518500249,1859775393,2400959708,2840853838]),z=m.create([1352829926,1548603684,1836072691,2053994217,0]),k=h.RIPEMD160=c.extend({_doReset:function(){this._hash=m.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,R){for(var F=0;F<16;F++){var M=R+F,P=D[M];D[M]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var T=this._hash.words,U=w.words,H=z.words,Y=d.words,ae=g.words,X=y.words,ne=f.words,W,re,J,A,I,L,$,le,me,he;L=W=T[0],$=re=T[1],le=J=T[2],me=A=T[3],he=I=T[4];for(var oe,F=0;F<80;F+=1)oe=W+D[R+Y[F]]|0,F<16?oe+=v(re,J,A)+U[0]:F<32?oe+=j(re,J,A)+U[1]:F<48?oe+=q(re,J,A)+U[2]:F<64?oe+=x(re,J,A)+U[3]:oe+=_(re,J,A)+U[4],oe=oe|0,oe=C(oe,X[F]),oe=oe+I|0,W=I,I=A,A=C(J,10),J=re,re=oe,oe=L+D[R+ae[F]]|0,F<16?oe+=_($,le,me)+H[0]:F<32?oe+=x($,le,me)+H[1]:F<48?oe+=q($,le,me)+H[2]:F<64?oe+=j($,le,me)+H[3]:oe+=v($,le,me)+H[4],oe=oe|0,oe=C(oe,ne[F]),oe=oe+he|0,L=he,he=me,me=C(le,10),le=$,$=oe;oe=T[1]+J+me|0,T[1]=T[2]+A+he|0,T[2]=T[3]+I+L|0,T[3]=T[4]+W+$|0,T[4]=T[0]+re+le|0,T[0]=oe},_doFinalize:function(){var D=this._data,R=D.words,F=this._nDataBytes*8,M=D.sigBytes*8;R[M>>>5]|=128<<24-M%32,R[(M+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,D.sigBytes=(R.length+1)*4,this._process();for(var P=this._hash,T=P.words,U=0;U<5;U++){var H=T[U];T[U]=(H<<8|H>>>24)&16711935|(H<<24|H>>>8)&4278255360}return P},clone:function(){var D=c.clone.call(this);return D._hash=this._hash.clone(),D}});function v(D,R,F){return D^R^F}function j(D,R,F){return D&R|~D&F}function q(D,R,F){return(D|~R)^F}function x(D,R,F){return D&F|R&~F}function _(D,R,F){return D^(R|~F)}function C(D,R){return D<<R|D>>>32-R}u.RIPEMD160=c._createHelper(k),u.HmacRIPEMD160=c._createHmacHelper(k)})(),r.RIPEMD160})})(jt)),jt.exports}var qt={exports:{}},fj=qt.exports,Hh;function bl(){return Hh||(Hh=1,(function(a,o){(function(r,s){a.exports=s(He())})(fj,function(r){(function(){var s=r,u=s.lib,l=u.Base,m=s.enc,c=m.Utf8,h=s.algo;h.HMAC=l.extend({init:function(d,g){d=this._hasher=new d.init,typeof g=="string"&&(g=c.parse(g));var y=d.blockSize,f=y*4;g.sigBytes>f&&(g=d.finalize(g)),g.clamp();for(var w=this._oKey=g.clone(),z=this._iKey=g.clone(),k=w.words,v=z.words,j=0;j<y;j++)k[j]^=1549556828,v[j]^=909522486;w.sigBytes=z.sigBytes=f,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var g=this._hasher,y=g.finalize(d);g.reset();var f=g.finalize(this._oKey.clone().concat(y));return f}})})()})})(qt)),qt.exports}var At={exports:{}},vj=At.exports,Vh;function kj(){return Vh||(Vh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Uo(),bl())})(vj,function(r){return(function(){var s=r,u=s.lib,l=u.Base,m=u.WordArray,c=s.algo,h=c.SHA256,d=c.HMAC,g=c.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,f){for(var w=this.cfg,z=d.create(w.hasher,y),k=m.create(),v=m.create([1]),j=k.words,q=v.words,x=w.keySize,_=w.iterations;j.length<x;){var C=z.update(f).finalize(v);z.reset();for(var D=C.words,R=D.length,F=C,M=1;M<_;M++){F=z.finalize(F),z.reset();for(var P=F.words,T=0;T<R;T++)D[T]^=P[T]}k.concat(C),q[0]++}return k.sigBytes=x*4,k}});s.PBKDF2=function(y,f,w){return g.create(w).compute(y,f)}})(),r.PBKDF2})})(At)),At.exports}var Ct={exports:{}},wj=Ct.exports,Uh;function En(){return Uh||(Uh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),_b(),bl())})(wj,function(r){return(function(){var s=r,u=s.lib,l=u.Base,m=u.WordArray,c=s.algo,h=c.MD5,d=c.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:1}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,y){for(var f,w=this.cfg,z=w.hasher.create(),k=m.create(),v=k.words,j=w.keySize,q=w.iterations;v.length<j;){f&&z.update(f),f=z.update(g).finalize(y),z.reset();for(var x=1;x<q;x++)f=z.finalize(f),z.reset();k.concat(f)}return k.sigBytes=j*4,k}});s.EvpKDF=function(g,y,f){return d.create(f).compute(g,y)}})(),r.EvpKDF})})(Ct)),Ct.exports}var Et={exports:{}},zj=Et.exports,Wh;function Ri(Line truncated
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/return r.mode.CTRGladman=(function(){var s=r.lib.BlockCipherMode.extend();function u(c){if((c>>24&255)===255){var h=c>>16&255,d=c>>8&255,g=c&255;h===255?(h=0,d===255?(d=0,g===255?g=0:++g):++d):++h,c=0,c+=h<<16,c+=d<<8,c+=g}else c+=1<<24;return c}function l(c){return(c[0]=u(c[0]))===0&&(c[1]=u(c[1])),c}var m=s.Encryptor=s.extend({processBlock:function(c,h){var d=this._cipher,g=d.blockSize,y=this._iv,f=this._counter;y&&(f=this._counter=y.slice(0),this._iv=void 0),l(f);var w=f.slice(0);d.encryptBlock(w,0);for(var z=0;z<g;z++)c[h+z]^=w[z]}});return s.Decryptor=m,s})(),r.mode.CTRGladman})})(_t)),_t.exports}var Dt={exports:{}},Sj=Dt.exports,Kh;function Bj(){return Kh||(Kh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Sj,function(r){return r.mode.OFB=(function(){var s=r.lib.BlockCipherMode.extend(),u=s.Encryptor=s.extend({processBlock:function(l,m){var c=this._cipher,h=c.blockSize,d=this._iv,g=this._keystream;d&&(g=this._keystream=d.slice(0),this._iv=void 0),c.encryptBlock(g,0);for(var y=0;y<h;y++)l[m+y]^=g[y]}});return s.Decryptor=u,s})(),r.mode.OFB})})(Dt)),Dt.exports}var Ft={exports:{}},_j=Ft.exports,Yh;function Dj(){return Yh||(Yh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(_j,function(r){return r.mode.ECB=(function(){var s=r.lib.BlockCipherMode.extend();return s.Encryptor=s.extend({processBlock:function(u,l){this._cipher.encryptBlock(u,l)}}),s.Decryptor=s.extend({processBlock:function(u,l){this._cipher.decryptBlock(u,l)}}),s})(),r.mode.ECB})})(Ft)),Ft.exports}var Rt={exports:{}},Fj=Rt.exports,Zh;function Rj(){return Zh||(Zh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Fj,function(r){return r.pad.AnsiX923={pad:function(s,u){var l=s.sigBytes,m=u*4,c=m-l%m,h=l+c-1;s.clamp(),s.words[h>>>2]|=c<<24-h%4*8,s.sigBytes+=c},unpad:function(s){var u=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=u}},r.pad.Ansix923})})(Rt)),Rt.exports}var Tt={exports:{}},Tj=Tt.exports,Xh;function Pj(){return Xh||(Xh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Tj,function(r){return r.pad.Iso10126={pad:function(s,u){var l=u*4,m=l-s.sigBytes%l;s.concat(r.lib.WordArray.random(m-1)).concat(r.lib.WordArray.create([m<<24],1))},unpad:function(s){var u=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=u}},r.pad.Iso10126})})(Tt)),Tt.exports}var Pt={exports:{}},Nj=Pt.exports,Jh;function Ij(){return Jh||(Jh=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Nj,function(r){return r.pad.Iso97971={pad:function(s,u){s.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(s,u)},unpad:function(s){r.pad.ZeroPadding.unpad(s),s.sigBytes--}},r.pad.Iso97971})})(Pt)),Pt.exports}var Nt={exports:{}},Mj=Nt.exports,eg;function Oj(){return eg||(eg=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Mj,function(r){return r.pad.ZeroPadding={pad:function(s,u){var l=u*4;s.clamp(),s.sigBytes+=l-(s.sigBytes%l||l)},unpad:function(s){for(var u=s.words,l=s.sigBytes-1,l=s.sigBytes-1;l>=0;l--)if(u[l>>>2]>>>24-l%4*8&255){s.sigBytes=l+1;break}}},r.pad.ZeroPadding})})(Nt)),Nt.exports}var It={exports:{}},Lj=It.exports,ig;function Hj(){return ig||(ig=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Lj,function(r){return r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding})})(It)),It.exports}var Mt={exports:{}},Vj=Mt.exports,ag;function Uj(){return ag||(ag=1,(function(a,o){(function(r,s,u){a.exports=s(He(),Ri())})(Vj,function(r){return(function(s){var u=r,l=u.lib,m=l.CipherParams,c=u.enc,h=c.Hex,d=u.format;d.Hex={stringify:function(g){return g.ciphertext.toString(h)},parse:function(g){var y=h.parse(g);return m.create({ciphertext:y})}}})(),r.format.Hex})})(Mt)),Mt.exports}var Ot={exports:{}},Wj=Ot.exports,ng;function $j(){return ng||(ng=1,(function(a,o){(function(r,s,u){a.exports=s(He(),er(),ir(),En(),Ri())})(Wj,function(r){return(function(){var s=r,u=s.lib,l=u.BlockCipher,m=s.algo,c=[],h=[],d=[],g=[],y=[],f=[],w=[],z=[],k=[],v=[];(function(){for(var x=[],_=0;_<256;_++)_<128?x[_]=_<<1:x[_]=_<<1^283;for(var C=0,D=0,_=0;_<256;_++){var R=D^D<<1^D<<2^D<<3^D<<4;R=R>>>8^R&255^99,c[C]=R,h[R]=C;var F=x[C],M=x[F],P=x[M],T=x[R]*257^R*16843008;d[C]=T<<24|T>>>8,g[C]=T<<16|T>>>16,y[C]=T<<8|T>>>24,f[C]=T;var T=P*16843009^M*65537^F*257^C*16843008;w[R]=T<<24|T>>>8,z[R]=T<<16|T>>>16,k[R]=T<<8|T>>>24,v[R]=T,C?(C=F^x[x[x[P^F]]],D^=x[x[D]]):C=D=1}})();var j=[0,1,2,4,8,16,32,64,128,27,54],q=m.AES=l.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var _=this._keyPriorReset=this._key,C=_.words,D=_.sigBytes/4,R=this._nRounds=D+6,F=(R+1)*4,M=this._keySchedule=[],P=0;P<F;P++)P<D?M[P]=C[P]:(x=M[P-1],P%D?D>6&&P%D==4&&(x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255]):(x=x<<8|x>>>24,x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255],x^=j[P/D|0]<<24),M[P]=M[P-D]^x);for(var T=this._invKeySchedule=[],U=0;U<F;U++){var P=F-U;if(U%4)var x=M[P];else var x=M[P-4];U<4||P<=4?T[U]=x:T[U]=w[c[x>>>24]]^z[c[x>>>16&255]]^k[c[x>>>8&255]]^v[c[x&255]]}}},encryptBlock:Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.Request,version:a.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:a.RequestType.GetStats,requestData:"",destinationHash:d,sourceHash:g,cipherMac:y,ciphertext:f};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.Request,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode request payload"],timestamp:0,requestType:a.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Co.RequestPayloadDecoder=r,Co}var Eo={},Ag;function Eq(){if(Ag)return Eo;Ag=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.ResponsePayloadDecoder=void 0;const a=ua(),o=Ii();class r{static decode(u,l){try{if(u.length<4){const z={type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(z.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,o.bytesToHex)(u)}]),z}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,o.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const g=(0,o.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:g}),h+=1;const y=(0,o.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:y}),h+=2;const f=(0,o.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&m.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:g,cipherMac:y,ciphertext:f,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Eo.ResponsePayloadDecoder=r,Eo}var So={},Cg;function Sq(){if(Cg)return So;Cg=1,Object.defineProperty(So,"__esModule",{value:!0}),So.AnonRequestPayloadDecoder=void 0;const a=ua(),o=Ii();class r{static decode(u,l){try{if(u.length<35){const z={type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(z.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,o.bytesToHex)(u)}]),z}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,o.byteToHex)(u[0]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${d}`,startByte:c+h,endByte:c+h,value:d}),h+=1;const g=(0,o.bytesToHex)(u.subarray(1,33));l!=null&&l.includeSegments&&m.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:c+h,endByte:c+h+31,value:g}),h+=32;const y=(0,o.bytesToHex)(u.subarray(33,35));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:c+h,endByte:c+h+1,value:y}),h+=2;const f=(0,o.bytesToHex)(u.subarray(35));l!=null&&l.includeSegments&&u.length>35&&m.push({name:"Ciphertext",description:`Encrypted message data (${u.length-35} bytes). Contains encrypted plaintext with this structure:
• Timestamp (4 bytes) - send time as unix timestamp
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
• Password (remaining bytes) - password for repeater/room`,startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,senderPublicKey:g,cipherMac:y,ciphertext:f,ciphertextLength:u.length-35};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return So.AnonRequestPayloadDecoder=r,So}var Bo={},Eg;function Bq(){if(Eg)return Bo;Eg=1,Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.AckPayloadDecoder=void 0;const a=ua(),o=Ii();class r{static decode(u,l){try{if(u.length<4){const g={type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(g.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,o.bytesToHex)(u)}]),g}const m=[],c=(l==null?void 0:l.segmentOffset)||0,h=(0,o.bytesToHex)(u.subarray(0,4));l!=null&&l.includeSegments&&m.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${h}`,startByte:c,endByte:c+3,value:h}),l!=null&&l.includeSegments&&u.length>4&&m.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:c+4,endByte:c+u.length-1,value:(0,o.bytesToHex)(u.subarray(4))});const d={type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!0,checksum:h};return l!=null&&l.includeSegments&&(d.segments=m),d}catch(m){return{type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode Ack payload"],checksum:""}}}}return Bo.AckPayloadDecoder=r,Bo}var _o={},Sg;function _q(){if(Sg)return _o;Sg=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.PathPayloadDecoder=void 0;const a=ua(),o=Ii();class r{static decode(u){try{if(u.length<2)return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=u[0];if(u.length<1+l+1)return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const m=[];for(let d=0;d<l;d++)m.push((0,o.byteToHex)(u[1+d]));const c=u[1+l];let h="";return u.length>1+l+1&&(h=(0,o.bytesToHex)(u.subarray(1+l+1))),{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:m,extraType:c,extraData:h}}catch(l){return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return _o.PathPayloadDecoder=r,_o}var Do={},Bg;function Dq(){if(Bg)return Do;Bg=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.TextMessagePayloadDecoder=void 0;const a=ua(),o=Ii();class r{static decode(u,l){try{if(u.length<4){const z={type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(z.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,o.bytesToHex)(u)}]),z}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,o.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const g=(0,o.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:g}),h+=1;const y=(0,o.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:y}),h+=2;const f=(0,o.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&m.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:g,cipherMac:y,ciphertext:f,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,i Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
);
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
const CHARS: array<u32, 37> = array<u32, 37>(
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
0x2du // dash
);
struct Params {
target_channel_hash: u32,
batch_offset: u32,
name_length: u32,
batch_size: u32,
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
ciphertext_words: u32, // Number of 32-bit words in ciphertext
ciphertext_len_bits: u32, // Length of ciphertext in bits
verify_mac: u32, // 1 to verify MAC, 0 to skip
}
@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
fn rotr(x: u32, n: u32) -> u32 {
return (x >> n) | (x << (32u - n));
}
fn ch(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (~x & z);
}
fn maj(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (x & z) ^ (y & z);
}
fn sigma0(x: u32) -> u32 {
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
}
fn sigma1(x: u32) -> u32 {
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
}
fn gamma0(x: u32) -> u32 {
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
}
fn gamma1(x: u32) -> u32 {
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
}
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
// Message starts with '#' (0x23)
var byte_pos = 0u;
var word_idx = 0u;
var current_word = 0x23000000u; // '#' in big-endian position 0
byte_pos = 1u;
var remaining = idx;
var prev_was_dash = false;
// Generate room name from index
for (var i = 0u; i < length; i++) {
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
var char_idx = remaining % char_count;
remaining = remaining / char_count;
// Check for consecutive dashes (invalid)
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
if (is_dash && prev_was_dash) {
return false; // Invalid: consecutive dashes
}
prev_was_dash = is_dash;
// Map char index to actual character
let c = CHARS[char_idx];
// Pack byte into current word (big-endian)
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u && byte_pos > 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0u;
}
current_word = current_word | (c << shift);
byte_pos = byte_pos + 1u;
}
// Add padding: 0x80 followed by zeros, then length in bits
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
// Add 0x80 padding byte
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0x80000000u;
} else {
current_word = current_word | (0x80u << shift);
}
byte_pos = byte_pos + 1u;
// Store current word
if (byte_pos % 4u == 0u || word_idx < 14u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
}
// Zero-fill until word 14
for (var i = word_idx; i < 14u; i++) {
(*msg)[i] = 0u;
}
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
(*msg)[14u] = 0u;
(*msg)[15u] = msg_len_bits;
return true;
}
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
// Initialize hash values
var h: array<u32, 8> = array<u32, 8>(
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
);
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Compute SHA256 of the key (16 bytes) to get channel hash
fn sha256_key(key: array<u32, 4>) -> u32 {
var msg: array<u32, 16>;
// Key bytes (16 bytes = 4 words)
msg[0] = key[0];
msg[1] = key[1];
msg[2] = key[2];
msg[3] = key[3];
// Padding: 0x80 followed by zeros
msg[4] = 0x80000000u;
for (var i = 5u; i < 14u; i++) {
msg[i] = 0u;
}
// Length: 128 bits
msg[14] = 0u;
msg[15] = 128u;
let hash = sha256_block(&msg);
// Return first byte of hash (big-endian)
return hash[0] >> 24u;
}
// HMAC-SHA256 for MAC verification
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
// ipad = 0x36 repeated, opad = 0x5c repeated
// Build padded key (64 bytes = 16 words)
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
var k_pad: array<u32, 16>;
k_pad[0] = key[0];
k_pad[1] = key[1];
k_pad[2] = key[2];
k_pad[3] = key[3];
for (var i = 4u; i < 16u; i++) {
k_pad[i] = 0u;
}
// Inner hash: SHA256((K' ^ ipad) || message)
// First block: K' ^ ipad (64 bytes)
var inner_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
inner_block[i] = k_pad[i] ^ 0x36363636u;
}
// Initialize hash state with first block
var h: array<u32, 8> = sha256_block(&inner_block);
// Process ciphertext blocks (continuing from h state)
let ciphertext_words = params.ciphertext_words;
var word_idx = 0u;
// Process full 64-byte blocks of ciphertext
while (word_idx + 16u <= ciphertext_words) {
var block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
block[i] = ciphertext[word_idx + i];
}
h = sha256_block_continue(&block, h);
word_idx = word_idx + 16u;
}
// Final block with remaining ciphertext + padding
var final_block: array<u32, 16>;
var remaining = ciphertext_words - word_idx;
for (var i = 0u; i < 16u; i++) {
if (i < remaining) {
final_block[i] = ciphertext[word_idx + i];
} else if (i == remaining) {
// Add 0x80 padding
final_block[i] = 0x80000000u;
} else {
final_block[i] = 0u;
}
}
// Add length (64 bytes of ipad + ciphertext length)
let total_bits = 512u + params.ciphertext_len_bits;
if (remaining < 14u) {
final_block[14] = 0u;
final_block[15] = total_bits;
h = sha256_block_continue(&final_block, h);
} else {
// Need extra block for length
h = sha256_block_continue(&final_block, h);
var len_block: array<u32, 16>;
for (var i = 0u; i < 14u; i++) {
len_block[i] = 0u;
}
len_block[14] = 0u;
len_block[15] = total_bits;
h = sha256_block_continue(&len_block, h);
}
let inner_hash = h;
// Outer hash: SHA256((K' ^ opad) || inner_hash)
var outer_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
}
h = sha256_block(&outer_block);
// Second block: inner_hash (32 bytes) + padding
var hash_block: array<u32, 16>;
for (var i = 0u; i < 8u; i++) {
hash_block[i] = inner_hash[i];
}
hash_block[8] = 0x80000000u;
for (var i = 9u; i < 14u; i++) {
hash_block[i] = 0u;
}
hash_block[14] = 0u;
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
h = sha256_block_continue(&hash_block, h);
// Return first 2 bytes (high 16 bits of first word)
return h[0] & 0xFFFF0000u;
}
// SHA256 block computation continuing from existing state
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
var h = h_in;
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Process a single candidate and record match if found
fn process_candidate(name_idx: u32) {
// Generate message for this room name
var msg: array<u32, 16>;
let valid = index_to_room_name(name_idx, params.name_length, &msg);
if (!valid) {
return;
}
// Compute SHA256("#roomname") - this gives us the key
let key_hash = sha256_block(&msg);
// Take first 16 bytes (4 words) as the key
var key: array<u32, 4>;
key[0] = key_hash[0];
key[1] = key_hash[1];
key[2] = key_hash[2];
key[3] = key_hash[3];
// Compute SHA256(key) to get channel hash
let channel_hash = sha256_key(key);
// Check if channel hash matches target
if (channel_hash != params.target_channel_hash) {
return;
}
// Channel hash matches - verify MAC if enabled
if (params.verify_mac == 1u) {
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
if (computed_mac != params.target_mac) {
return;
}
}
// Found a match - record the index
let match_idx = atomicAdd(&match_count, 1u);
if (match_idx < 1024u) { // Limit stored matches
match_indices[match_idx] = name_idx;
}
}
// Each thread processes 16 candidates to amortize thread overhead
const CANDIDATES_PER_THREAD: u32 = 16u;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
let idx = base_idx + i;
if (idx >= params.batch_size) {
return;
}
let name_idx = params.batch_offset + idx;
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let u=0;u<2;u++)this.matchCountReadBuffers[u]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[u]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const r=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:r,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,r){return Yn(r,o)}countNamesForLength(o){return Po(o)}async runBatch(o,r,s,u,l,m){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const c=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const h=this.matchCountReadBuffers[c],d=this.matchIndicesReadBuffers[c],g=l&&m?1:0;let y,f=0,w=0;if(g){const C=new Uint8Array(l.length/2);for(let P=0;P<C.length;P++)C[P]=parseInt(l.substr(P*2,2),16);f=C.length*8;const D=Math.ceil(C.length/4)*4,R=new Uint8Array(D);R.set(C),y=new Uint32Array(D/4);for(let P=0;P<y.length;P++)y[P]=R[P*4]<<24|R[P*4+1]<<16|R[P*4+2]<<8|R[P*4+3];const F=parseInt(m.substr(0,2),16),M=parseInt(m.substr(2,2),16);w=F<<24|M<<16}else y=new Uint32Array([0]);const z=Math.max(y.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<z)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:z,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=z,this.bindGroupDirty=!0);const k=new Uint32Array([o,s,r,u,w,y.length,f,g]);this.device.queue.writeBuffer(this.paramsBuffer,0,k),this.device.queue.writeBuffer(this.ciphertextBuffer,0,y),this.device.queue.writeBuffer(this.matchCountBuffer,0,vl.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const v=this.device.createCommandEncoder(),j=v.beginComputePass();j.setPipeline(this.pipeline),j.setBindGroup(0,this.bindGroup),j.dispatchWorkgroups(Math.ceil(u/(256*16))),j.end(),v.copyBufferToBuffer(this.matchCountBuffer,0,h,0,4),v.copyBufferToBuffer(this.matchIndicesBuffer,0,d,0,1024*4),this.device.queue.submit([v.finish()]),await h.mapAsync(GPUMapMode.READ);const x=new Uint32Array(h.getMappedRange())[0];h.unmap();const _=[];if(x>0){await d.mapAsync(GPUMapMode.READ);const C=new Uint32Array(d.getMappedRange());for(let D=0;D<Math.min(x,1024);D++)_.push(C[D]);d.unmap()}return _}destroy(){var o,r,s,u,l,m,c,h;(o=this.paramsBuffer)==null||o.destroy(),(r=this.matchCountBuffer)==null||r.destroy(),(s=this.matchIndicesBuffer)==null||s.destroy(),(u=this.ciphertextBuffer)==null||u.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(m=this.matchCountReadBuffers[1])==null||m.destroy(),(c=this.matchIndicesReadBuffers[0])==null||c.destroy(),(h=this.matchIndicesReadBuffers[1])==null||h.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}vl.ZERO_DATA=new Uint32Array([0]);function $q(){return typeof navigator<"u"&&"gpu"in navigator}class Og{runBatch(o,r,s,u,l,m){const c=[],h=o.toString(16).padStart(2,"0") Line truncated
`).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);this.wordlist=u.filter(Lg)}setWordlist(o){this.wordlist=o.map(r=>r.trim().toLowerCase()).filter(Lg)}abort(){this.abortFlag=!0}isGpuAvailable(){return $q()}async decodePacket(o){var s;const r=o.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!r||!/^[0-9a-fA-F]+$/.test(r))return null;try{const l=(s=(await Ng.MeshCorePacketDecoder.decodeWithVerification(r,{})).payload)==null?void 0:s.decoded;return!(l!=null&&l.channelHash)||!(l!=null&&l.ciphertext)||!(l!=null&&l.cipherMac)?null:{channelHash:l.channelHash,ciphertext:l.ciphertext,cipherMac:l.cipherMac,isGroupText:!0}}catch{return null}}async crack(o,r,s){this.abortFlag=!1,this.useTimestampFilter=(r==null?void 0:r.useTimestampFilter)??!0,this.useUtf8Filter=(r==null?void 0:r.useUtf8Filter)??!0,this.validSeconds=(r==null?void 0:r.validSeconds)??Pu,this.useCpu=(r==null?void 0:r.forceCpu)??!1;const u=(r==null?void 0:r.maxLength)??8,l=(r==null?void 0:r.startingLength)??1,m=(r==null?void 0:r.useDictionary)??!0,c=(r==null?void 0:r.startFromType)??"bruteforce",h=o.toLowerCase(),d=await this.decodePacket(h);if(!d)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:g,ciphertext:y,cipherMac:f}=d,w=parseInt(g,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new Og):this.gpuInstance||(this.gpuInstance=new vl,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new Og));const z=performance.now();let k=0,v=performance.now(),j=l,q=0,x=0,_=!1;if(r!=null&&r.startFrom){const H=r.startFrom.toLowerCase();if(c==="dictionary"){const Y=this.wordlist.indexOf(H);Y>=0&&(x=Y+1)}else{_=!0;const Y=Vq(H);Y&&(j=Math.max(l,Y.length),q=Y.index+1,q>=Po(j)&&(j++,q=0))}}let C=0;m&&!_&&this.wordlist.length>0&&(C+=this.wordlist.length-x);for(let H=j;H<=u;H++)C+=Po(H);C-=q;const D=(H,Y,ae)=>{if(!s)return;const ne=(performance.now()-z)/1e3,W=ne>0?Math.round(k/ne):0,re=C-k,J=W>0?re/W:0;s({checked:k,total:C,percent:C>0?Math.min(100,k/C*100):0,rateKeysPerSec:W,etaSeconds:J,elapsedSeconds:ne,currentLength:Y,currentPosition:ae,phase:H})},R=H=>{if(!Jb(y,f,H))return{valid:!1};const Y=Ng.ChannelCrypto.decryptGroupTextMessage(y,f,H);return!Y.success||!Y.data?{valid:!1}:this.useTimestampFilter&&!Uq(Y.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Wq(Y.data.message)?{valid:!1}:{valid:!0,message:Y.data.message}};if(!_&&x===0&&j===l&&q===0){D("public-key",0,Tu);const H=Iu(Kt);if(g===H){const Y=R(Kt);if(Y.valid)return{found:!0,roomName:Tu,key:Kt,decryptedMessage:Y.message}}}if(m&&!_&&this.wordlist.length>0)for(let H=x;H<this.wordlist.length;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[H],resumeType:"dictionary"};const Y=this.wordlist[H],ae=Nu("#"+Y),X=Iu(ae);if(parseInt(X,16)===w){const W=R(ae);if(W.valid)return{found:!0,roomName:Y,key:ae,decryptedMessage:W.message,resumeFrom:Y,resumeType:"dictionary"}}k++;const ne=performance.now();ne-v>=200&&(D("wordlist",Y.length,Y),v=ne,await new Promise(W=>setTimeout(W,0)))}const F=this.useCpu?1024:32768,M=(r==null?void 0:r.gpuDispatchMs)??1e3;let P=F,T=!1;for(let H=j;H<=u;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Yn(H,0)||void 0,resumeType:"bruteforce"};const Y=Po(H);let ae=H===j?q:0;for(;ae<Y;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Yn(H,ae)||void 0,resumeType:"bruteforce"};const X=Math.min(P,Y-ae),ne=performance.now();let W;this.useCpu?W=this.cpuInstance.runBatch(w,H,ae,X,y,f):W=await this.gpuInstance.runBatch(w,H,ae,X,y,f);const re=performance.now()-ne;if(k+=X,!this.useCpu&&!T&&X>=F&&re>0){const A=M/re,I=Math.round(X*A),L=Math.pow(2,Math.round(Math.log2(Math.max(F,I))));P=Math.max(F,L),T=!0}for(const A of W){const I=Yn(H,A);if(!I)continue;const L=Nu("#"+I),$=R(L);if($.valid)return{found:!0,roomName:I,key:L,decryptedMessage:$.message,resumeFrom:I,resumeType:"bruteforce"}}ae+=X;const J=performance.now();if(J-v>=200){const A=Yn(H,Math.min(ae,Y-1))||"";D("bruteforce",H,A),v=J,await new Promise(I=>setTimeout(I,0))}}}return{found:!1,resumeFrom:Yn(u,Po(u)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}const Zq=["2","1080","10-point","10th","11-point","12-point","16-point","18-point","1st","20-point","2d","2nd","30-30","3d","3-d","3m","3rd","48-point","4-d","4gl","4h","4th","5-point","5-t","5th","6-point","6th","7-point","7th","8-point","8th","9-point","9th","a","a1","a-1","a4","a5","aa","aaa","aaaa","aaaaaa","aaal","aaas","aaberg","aachen","aae","aaee","aaf","aag","aah","aahed","aahing","aahs","aaii","aal","aalborg","aalesund","aalii","aaliis","aals","aalst","aalto","aam","aamsi","aandahl","a-and-r","aani","aao","aap","aapss","aaqbiye","aar","aara","aarau","aarc","aardvark","aardvarks","aardwolf","aardwolves","aaren","aargau","aargh","aarhus","aarika","aaron","aaronic","aaronical","aaronite","aaronitic","aaronsburg","aaronson","aarp","aarrgh","aarrghh","aaru","a Line truncated
NoSleep enabled for older iOS devices. This can interrupt
active or long-running network requests from completing successfully.
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(c=>(this.enabled=!0,c)).catch(c=>{throw this.enabled=!1,c})}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):r()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return xu=u,xu}var eA=Jq();const iA=Rr(eA);function aA(a){if(a.length<4)return null;try{const r=parseInt(a.slice(0,2),16)&3;let s=2;if(r===0||r===3){if(a.length<s+8)return null;s+=8}if(a.length<s+2)return null;const u=parseInt(a.slice(s,s+2),16);s+=2;const l=u*2;return a.length<s+l?null:(s+=l,a.slice(s))}catch{return null}}function nA({packets:a,channels:o,onChannelCreate:r,onRunningChange:s}){const[u,l]=S.useState(!1),[m,c]=S.useState(6),[h,d]=S.useState(!1),[g,y]=S.useState(!0),[f,w]=S.useState(!1),[z,k]=S.useState(null),[v,j]=S.useState(new Map),[q,x]=S.useState([]),[_,C]=S.useState(!1),[D,R]=S.useState(null),[F,M]=S.useState(null),[P,T]=S.useState(0),U=S.useRef(null),H=S.useRef(null),Y=S.useRef(!1),ae=S.useRef(!1),X=S.useRef(!1),ne=S.useRef(new Map),W=S.useRef(!1),re=S.useRef(6),J=S.useRef(!0),A=S.useRef(!1),I=S.useRef(new Set),L=S.useRef(new Set);S.useEffect(()=>{const ge=new Yq;U.current=ge,R(ge.isGpuAvailable());const _e=new iA;return H.current=_e,ge.setWordlist(Zq),C(!0),()=>{ge.destroy(),U.current=null,_e.disable(),H.current=null}},[]),S.useEffect(()=>{const ge=()=>{Me.getUndecryptedPacketCount().then(({count:Be})=>M(Be)).catch(()=>M(null))};ge();const _e=setInterval(ge,3e4);return()=>clearInterval(_e)},[]);const $=new Set(o.map(ge=>ge.key.toUpperCase())),le=a.filter(ge=>ge.payload_type==="GROUP_TEXT"&&!ge.decrypted);S.useEffect(()=>{let ge=0;j(_e=>{const Be=new Map(_e);let si=!1;for(const ii of le)if(!Be.has(ii.id)){const Ue=aA(ii.data);if(Ue&&L.current.has(Ue)){ge++;continue}Ue&&L.current.add(Ue),Be.set(ii.id,{packet:ii,attempts:0,lastAttemptLength:0,status:"pending"}),si=!0}return si?(ne.current=Be,Be):_e}),ge>0&&T(_e=>_e+ge)},[le.length]),S.useEffect(()=>{ne.current=v},[v]),S.useEffect(()=>{W.current=h},[h]),S.useEffect(()=>{re.current=m},[m]),S.useEffect(()=>{J.current=g},[g]),S.useEffect(()=>{A.current=f},[f]),S.useEffect(()=>{I.current=new Set(le.map(ge=>ge.id))},[le]),S.useEffect(()=>{s==null||s(u)},[u,s]);const me=Array.from(v.values()).filter(ge=>ge.status==="pending").length,he=Array.from(v.values()).filter(ge=>ge.status==="cracked").length,oe=Array.from(v.values()).filter(ge=>ge.status==="failed").length,qe=S.useCallback(async()=>{if(X.current||!U.current||!Y.current)return;const ge=ne.current;let _e=null,Be=null;for(const[Ve,Re]of ge.entries())if(Re.status==="pending"){_e=Re,Be=Ve;break}if(!_e&&W.current){const Ve=Array.from(ge.entries()).filter(([,Re])=>Re.status==="failed"&&Re.lastAttemptLength<10);Ve.length>0&&(Ve.sort((Re,Je)=>Re[1].lastAttemptLength-Je[1].lastAttemptLength),[Be,_e]=Ve[0])}if(!_e||Be===null){Y.current&&setTimeout(()=>qe(),1e3);return}if(!I.current.has(Be)){j(Ve=>{const Re=new Map(Ve);return Re.delete(Be),Re}),Y.current&&setTimeout(()=>qe(),10);return}X.current=!0;const si=re.current,ii=_e.lastAttemptLength>0,Ue=ii?_e.lastAttemptLength+1:si;try{const Ve=await U.current.crack(_e.packet.data,{maxLength:Ue,useTimestampFilter:!0,useUtf8Filter:!0,...A.current&&{gpuDispatchMs:1e4},...ii&&{useDictionary:!1,startingLength:Ue}},Re=>{k(Re)});if(ae.current){ae.current=!1,X.current=!1,k(null);return}if(Ve.found&&Ve.roomName&&Ve.key){j(De=>{const Ne=new Map(De),ai=Ne.get(Be);return ai&&Ne.set(Be,{...ai,status:"cracked",attempts:ai.attempts+1,lastAttemptLength:Ue}),Ne});const Re={roomName:Ve.roomName,key:Ve.key,packetId:Be,message:Ve.decryptedMessage||"",crackedAt:Date.now()};x(De=>[...De,Re]);const Je=Ve.key.toUpperCase();if(!$.has(Je))try{const De="#"+Ve.roomName;await r(De,Ve.key),J.current&&await Me.decryptHistoricalPackets({key_type:"channel",channel_name:De})}catch(De){console.error("Failed to create channel or decrypt historical:",De),gi.error("Failed to save cracked channel",{description:De instanceof Error?De.message:"Channel discovered but could not be saved"})}}else j(Re=>{const Je=new Map(Re),De=Je.get(Be);return De&&Je.set(Be,{...De,status:"failed",attempts:De.attempts+1,lastAttemptLength:Ue}),Je})}catch(Ve){console.error("Cracking error:",Ve),j(Re=>{const Je=new Map(Re),De=Je.get(Be);return De&&Je.set(Be,{...De,status:"failed",attempts:De.attempts+1,lastAttemptLength:Ue}),Je})}X.current=!1,k(null),Y.current&&setTimeout(()=>qe(),100)},[$,r]),Te=()=>{var ge;if(!D){gi.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}l(!0),Y.current=!0,ae.current=!1,(ge=H.current)==null||ge.enable(),qe()},oi=()=>{var ge,_e;l(!1),Y.current=!1,ae.current=!0,(ge=U.current)==null||ge.abort(),(_e=H.current)==null||_e.disable()};return E.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[E.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["This will attempt to dictionary attack, then brute force GroupText packets as they arrive, testing room names up to the specified length.",E.jsx("strong",{children:" Retry failed at n+1"})," will Line truncated
+537
View File
@@ -0,0 +1,537 @@
var Jg=Object.defineProperty;var ev=(r,a,o)=>a in r?Jg(r,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[a]=o;var Vn=(r,a,o)=>ev(r,typeof a!="symbol"?a+"":a,o);function tv(r,a){for(var o=0;o<a.length;o++){const s=a[o];if(typeof s!="string"&&!Array.isArray(s)){for(const u in s)if(u!=="default"&&!(u in r)){const l=Object.getOwnPropertyDescriptor(s,u);l&&Object.defineProperty(r,u,l.get?l:{enumerable:!0,get:()=>s[u]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const l of u)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&s(A)}).observe(document,{childList:!0,subtree:!0});function o(u){const l={};return u.integrity&&(l.integrity=u.integrity),u.referrerPolicy&&(l.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?l.credentials="include":u.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(u){if(u.ep)return;u.ep=!0;const l=o(u);fetch(u.href,l)}})();var tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Io(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Gh(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var a=r.default;if(typeof a=="function"){var o=function s(){return this instanceof s?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};o.prototype=a.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var u=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(o,s,u.get?u:{enumerable:!0,get:function(){return r[s]}})}),o}var ru={exports:{}},va={},nu={exports:{}},je={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Vf;function rv(){if(Vf)return je;Vf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.iterator;function g(S){return S===null||typeof S!="object"?null:(S=x&&S[x]||S["@@iterator"],typeof S=="function"?S:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,y={};function v(S,O,z){this.props=S,this.context=O,this.refs=y,this.updater=z||C}v.prototype.isReactComponent={},v.prototype.setState=function(S,O){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,O,"setState")},v.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function E(){}E.prototype=v.prototype;function k(S,O,z){this.props=S,this.context=O,this.refs=y,this.updater=z||C}var b=k.prototype=new E;b.constructor=k,w(b,v.prototype),b.isPureReactComponent=!0;var R=Array.isArray,B=Object.prototype.hasOwnProperty,T={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function P(S,O,z){var q,ce={},fe=null,he=null;if(O!=null)for(q in O.ref!==void 0&&(he=O.ref),O.key!==void 0&&(fe=""+O.key),O)B.call(O,q)&&!N.hasOwnProperty(q)&&(ce[q]=O[q]);var ae=arguments.length-2;if(ae===1)ce.children=z;else if(1<ae){for(var De=Array(ae),Ne=0;Ne<ae;Ne++)De[Ne]=arguments[Ne+2];ce.children=De}if(S&&S.defaultProps)for(q in ae=S.defaultProps,ae)ce[q]===void 0&&(ce[q]=ae[q]);return{$$typeof:r,type:S,key:fe,ref:he,props:ce,_owner:T.current}}function L(S,O){return{$$typeof:r,type:S.type,key:O,ref:S.ref,props:S.props,_owner:S._owner}}function M(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function I(S){var O={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(z){return O[z]})}var $=/\/+/g;function V(S,O){return typeof S=="object"&&S!==null&&S.key!=null?I(""+S.key):O.toString(36)}function Y(S,O,z,q,ce){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var he=!1;if(S===null)he=!0;else switch(fe){case"string":case"number":he=!0;break;case"object":switch(S.$$typeof){case r:case a:he=!0}}if(he)return he=S,ce=ce(he),S=q===""?"."+V(he,0):q,R(ce)?(z="",S!=null&&(z=S.replace($,"$&/")+"/"),Y(ce,O,z,"",function(Ne){return Ne})):ce!=null&&(M(ce)&&(ce=L(ce,z+(!ce.key||he&&he.key===ce.key?"":(""+ce.key).replace($,"$&/")+"/")+S)),O.push(ce)),1;if(he=0,q=q===""?".":q+":",R(S))for(var ae=0;ae<S.length;ae++){fe=S[ae];var De=q+V(fe,ae);he+=Y(fe,O,z,De,ce)}else if(De=g(S),typeof De=="function")for(S=De.call(S),ae=0;!(fe=S.next()).done;)fe=fe.value,De=q+V(fe,ae++),he+=Y(fe,O,z,De,ce);else if(fe==="object")throw O=String(S),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return he}function re(S,O,z){if(S==null)return S;var q=[],ce=0;return Y(S,q,"","",function(fe){return O.call(z,fe,ce++)}),q}function X(S){if(S._status===-1){var O=S._result;O=O(),O.then(function(z){(S._status===0||S._status===-1)&&(S._status=1,S._result=z)},function(z){(S._status===0||S._status===-1)&&(S._status=2,S._result=z)}),S._status===-1&&(S._status=0,S._result=O)}if(S._status===1)return S._result.default;throw S._result}var ne={current:null},W={transition:null},oe={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:W,ReactCurrentOwner:T};function J(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:re,forEach:function(S,O,z){re(S,function(){O.apply(this,arguments)},z)},count:function(S){var O=0;return re(S,function(){O++}),O},toArray:function(S){return re(S,function(O){return O})||[]},only:function(S){if(!M(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},je.Component=v,je.Fragment=o,je.Profiler=u,je.PureComponent=k,je.StrictMode=s,je.Suspense=h,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,je.act=J,je.cloneElement=function(S,O,z){if(S==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+S+".");var q=w({},S.props),ce=S.key,fe=S.ref,he=S._owner;if(O!=null){if(O.ref!==void 0&&(fe=O.ref,he=T.current),O.key!==void 0&&(ce=""+O.key),S.type&&S.type.defaultProps)var ae=S.type.defaultProps;for(De in O)B.call(O,De)&&!N.hasOwnProperty(De)&&(q[De]=O[De]===void 0&&ae!==void 0?ae[De]:O[De])}var De=arguments.length-2;if(De===1)q.children=z;else if(1<De){ae=Array(De);for(var Ne=0;Ne<De;Ne++)ae[Ne]=arguments[Ne+2];q.children=ae}return{$$typeof:r,type:S.type,key:ce,ref:fe,props:q,_owner:he}},je.createContexLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Wf;function nv(){if(Wf)return va;Wf=1;var r=Lu(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function A(c,h,d){var p,x={},g=null,C=null;d!==void 0&&(g=""+d),h.key!==void 0&&(g=""+h.key),h.ref!==void 0&&(C=h.ref);for(p in h)s.call(h,p)&&!l.hasOwnProperty(p)&&(x[p]=h[p]);if(c&&c.defaultProps)for(p in h=c.defaultProps,h)x[p]===void 0&&(x[p]=h[p]);return{$$typeof:a,type:c,key:g,ref:C,props:x,_owner:u.current}}return va.Fragment=o,va.jsx=A,va.jsxs=A,va}var $f;function ov(){return $f||($f=1,ru.exports=nv()),ru.exports}var _=ov(),D=Lu();const de=Io(D),Hu=tv({__proto__:null,default:de},[D]);var Ys={},ou={exports:{}},rr={},au={exports:{}},su={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qf;function av(){return qf||(qf=1,(function(r){function a(W,oe){var J=W.length;W.push(oe);e:for(;0<J;){var S=J-1>>>1,O=W[S];if(0<u(O,oe))W[S]=oe,W[J]=O,J=S;else break e}}function o(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var oe=W[0],J=W.pop();if(J!==oe){W[0]=J;e:for(var S=0,O=W.length,z=O>>>1;S<z;){var q=2*(S+1)-1,ce=W[q],fe=q+1,he=W[fe];if(0>u(ce,J))fe<O&&0>u(he,ce)?(W[S]=he,W[fe]=J,S=fe):(W[S]=ce,W[q]=J,S=q);else if(fe<O&&0>u(he,J))W[S]=he,W[fe]=J,S=fe;else break e}}return oe}function u(W,oe){var J=W.sortIndex-oe.sortIndex;return J!==0?J:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,c=A.now();r.unstable_now=function(){return A.now()-c}}var h=[],d=[],p=1,x=null,g=3,C=!1,w=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(W){for(var oe=o(d);oe!==null;){if(oe.callback===null)s(d);else if(oe.startTime<=W)s(d),oe.sortIndex=oe.expirationTime,a(h,oe);else break;oe=o(d)}}function R(W){if(y=!1,b(W),!w)if(o(h)!==null)w=!0,X(B);else{var oe=o(d);oe!==null&&ne(R,oe.startTime-W)}}function B(W,oe){w=!1,y&&(y=!1,E(P),P=-1),C=!0;var J=g;try{for(b(oe),x=o(h);x!==null&&(!(x.expirationTime>oe)||W&&!I());){var S=x.callback;if(typeof S=="function"){x.callback=null,g=x.priorityLevel;var O=S(x.expirationTime<=oe);oe=r.unstable_now(),typeof O=="function"?x.callback=O:x===o(h)&&s(h),b(oe)}else s(h);x=o(h)}if(x!==null)var z=!0;else{var q=o(d);q!==null&&ne(R,q.startTime-oe),z=!1}return z}finally{x=null,g=J,C=!1}}var T=!1,N=null,P=-1,L=5,M=-1;function I(){return!(r.unstable_now()-M<L)}function $(){if(N!==null){var W=r.unstable_now();M=W;var oe=!0;try{oe=N(!0,W)}finally{oe?V():(T=!1,N=null)}}else T=!1}var V;if(typeof k=="function")V=function(){k($)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,re=Y.port2;Y.port1.onmessage=$,V=function(){re.postMessage(null)}}else V=function(){v($,0)};function X(W){N=W,T||(T=!0,V())}function ne(W,oe){P=v(function(){W(r.unstable_now())},oe)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(W){W.callback=null},r.unstable_continueExecution=function(){w||C||(w=!0,X(B))},r.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<W?Math.floor(1e3/W):5},r.unstable_getCurrentPriorityLevel=function(){return g},r.unstable_getFirstCallbackNode=function(){return o(h)},r.unstable_next=function(W){switch(g){case 1:case 2:case 3:var oe=3;break;default:oe=g}var J=g;g=oe;try{return W()}finally{g=J}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(W,oe){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var J=g;g=W;try{return oe()}finally{g=J}},r.unstable_scheduleCallback=function(W,oe,J){var S=r.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?S+J:S):J=S,W){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=J+O,W={id:p++,callback:oe,priorityLevel:W,startTime:J,expirationTime:O,sortIndex:-1},J>S?(W.sortIndex=J,a(d,W),o(h)===null&&W===o(d)&&(y?(E(P),P=-1):y=!0,ne(R,J-S))):(W.sortIndex=O,a(h,W),w||C||(w=!0,X(B))),W},r.unstable_shouldYield=I,r.unstable_wrapCallback=function(W){var oe=g;return function(){var J=g;g=oe;try{return W.apply(this,arguments)}finally{g=J}}}})(su)),su}var Gf;function sv(){return Gf||(Gf=1,au.exports=av()),au.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Qf;function iv(){if(Qf)return rr;Qf=1;var r=Lu(),a=sv();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,u={};function l(e,t){A(e,t),A(e+"Capture",t)}function A(e,t){for(u[e]=t,e=0;e<t.length;e++)s.add(t[e])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},x={};function g(e){return h.call(x,e)?!0:h.call(p,e)?!1:d.test(e)?x[e]=!0:(p[e]=!0,!1)}function C(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function w(e,t,n,i){if(t===null||typeof t>"u"||C(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function y(e,t,n,i,f,m,F){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=f,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=m,this.removeEmptyString=F}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new y(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];v[t]=new y(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new y(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){v[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new y(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new y(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new y(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function k(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(E,k);v[t]=new y(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(E,k);v[t]=new y(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(E,k);v[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,i){var f=v.hasOwnProperty(t)?v[t]:null;(f!==null?f.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!= Line truncated
`+S+e}var z=!1;function q(e,t){if(!e||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(Z){var i=Z}Reflect.construct(e,[],t)}else{try{t.call()}catch(Z){i=Z}e.call(t.prototype)}else{try{throw Error()}catch(Z){i=Z}e()}}catch(Z){if(Z&&i&&typeof Z.stack=="string"){for(var f=Z.stack.split(`
`),m=i.stack.split(`
`),F=f.length-1,j=m.length-1;1<=F&&0<=j&&f[F]!==m[j];)j--;for(;1<=F&&0<=j;F--,j--)if(f[F]!==m[j]){if(F!==1||j!==1)do if(F--,j--,0>j||f[F]!==m[j]){var H=`
`+f[F].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=F&&0<=j);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?O(e):""}function ce(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1),e;case 11:return e=q(e.type.render,!1),e;case 1:return e=q(e.type,!0),e;default:return""}}function fe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case T:return"Portal";case L:return"Profiler";case P:return"StrictMode";case V:return"Suspense";case Y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case I:return(e.displayName||"Context")+".Consumer";case M:return(e._context.displayName||"Context")+".Provider";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function he(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(t);case 8:return t===P?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ae(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function De(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ne(e){var t=De(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var f=n.get,m=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(F){i=""+F,m.call(this,F)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(F){i=""+F},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function at(e){e._valueTracker||(e._valueTracker=Ne(e))}function tt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=De(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function pe(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Fe(e,t){var n=t.checked;return J({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ie(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=ae(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dt(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Qe(e,t){dt(e,t);var n=ae(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Te(e,t.type,n):t.hasOwnProperty("defaultValue")&&Te(e,t.type,ae(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function et(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Te(e,t,n){(t!=="number"||pe(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ue=Array.isArray;function Le(e,t,n,i){if(e=e.options,t){t={};for(var f=0;f<n.length;f++)t["$"+n[f]]=!0;for(n=0;n<e.length;n++)f=t.hasOwnProperty("$"+e[n].value),e[n].selected!==f&&(e[n].selected=f),f&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ae(n),t=null,f=0;f<e.length;f++){if(e[f].value===n){e[f].selected=!0,i&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function ke(e,t){if(t.dangerouslySetInnerHTML!= Line truncated
`).replace(fg,"")}function cs(e,t,n){if(t=sd(t),sd(e)!==t&&n)throw Error(o(425))}function us(){}var ql=null,Gl=null;function Ql(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kl=typeof setTimeout=="function"?setTimeout:void 0,Ag=typeof clearTimeout=="function"?clearTimeout:void 0,id=typeof Promise=="function"?Promise:void 0,hg=typeof queueMicrotask=="function"?queueMicrotask:typeof id<"u"?function(e){return id.resolve(null).then(e).catch(pg)}:Kl;function pg(e){setTimeout(function(){throw e})}function Yl(e,t){var n=t,i=0;do{var f=n.nextSibling;if(e.removeChild(n),f&&f.nodeType===8)if(n=f.data,n==="/$"){if(i===0){e.removeChild(f),qo(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=f}while(n);qo(t)}function dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ld(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var lo=Math.random().toString(36).slice(2),Ir="__reactFiber$"+lo,na="__reactProps$"+lo,$r="__reactContainer$"+lo,Zl="__reactEvents$"+lo,xg="__reactListeners$"+lo,mg="__reactHandles$"+lo;function Fn(e){var t=e[Ir];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$r]||n[Ir]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ld(e);e!==null;){if(n=e[Ir])return n;e=ld(e)}return t}e=n,n=e.parentNode}return null}function oa(e){return e=e[Ir]||e[$r],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function co(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function ds(e){return e[na]||null}var Xl=[],uo=-1;function fn(e){return{current:e}}function lt(e){0>uo||(e.current=Xl[uo],Xl[uo]=null,uo--)}function ot(e,t){uo++,Xl[uo]=e.current,e.current=t}var An={},zt=fn(An),Zt=fn(!1),Rn=An;function fo(e,t){var n=e.type.contextTypes;if(!n)return An;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in n)f[m]=t[m];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=f),f}function Xt(e){return e=e.childContextTypes,e!=null}function fs(){lt(Zt),lt(zt)}function cd(e,t,n){if(zt.current!==An)throw Error(o(168));ot(zt,t),ot(Zt,n)}function ud(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var f in i)if(!(f in t))throw Error(o(108,he(e)||"Unknown",f));return J({},n,i)}function As(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||An,Rn=zt.current,ot(zt,e),ot(Zt,Zt.current),!0}function dd(e,t,n){var i=e.stateNode;if(!i)throw Error(o(169));n?(e=ud(e,t,Rn),i.__reactInternalMemoizedMergedChildContext=e,lt(Zt),lt(zt),ot(zt,e)):lt(Zt),ot(Zt,n)}var qr=null,hs=!1,Jl=!1;function fd(e){qr===null?qr=[e]:qr.push(e)}function gg(e){hs=!0,fd(e)}function hn(){if(!Jl&&qr!==null){Jl=!0;var e=0,t=Je;try{var n=qr;for(Je=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}qr=null,hs=!1}catch(f){throw qr!==null&&(qr=qr.slice(e+1)),h0(Cl,hn),f}finally{Je=t,Jl=!1}}return null}var Ao=[],ho=0,ps=null,xs=0,fr=[],Ar=0,Tn=null,Gr=1,Qr="";function Pn(e,t){Ao[ho++]=xs,Ao[ho++]=ps,ps=e,xs=t}function Ad(e,t,n){fr[Ar++]=Gr,fr[Ar++]=Qr,fr[Ar++]=Tn,Tn=e;var i=Gr;e=Qr;var f=32-Er(i)-1;i&=~(1<<f),n+=1;var m=32-Er(t)+f;if(30<m){var F=f-f%5;m=(i&(1<<F)-1).toString(32),i>>=F,f-=F,Gr=1<<32-Er(t)+f|n<<f|i,Qr=m+e}else Gr=1<<m|n<<f|i,Qr=e}function ec(e){e.return!==null&&(Pn(e,1),Ad(e,1,0))}function tc(e){for(;e===ps;)ps=Ao[--ho],Ao[ho]=null,xs=Ao[--ho],Ao[ho]=null;for(;e===Tn;)Tn=fr[--Ar],fr[Ar]=null,Qr=fr[--Ar],fr[Ar]=null,Gr=fr[--Ar],fr[Ar]=null}var sr=null,ir=null,ct=!1,Sr=null;function hd(e,t){var n=mr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function pd(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ir=dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ir=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Tn!==null?{id:Gr,overflow:Qr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sr=e,ir=null,!0):!1;default:return!1}}function rc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(ct){var t=ir;if(t){var n=t;if(!pd(e,t)){if(rc(e))throw Error(o(418));t=dn(n.nextSibling);var i=sr;t&&pd(e,t)?hd(i,n):(e.flags=e.flags&-4097|2,ct=!1,sr=e)}}else{if(rc(e))throw Error(o(418));e.flags=e.flags&-4097|2,ct=!1,sr=e}}}function xd(e){for(e=e. Line truncated
Error generating stack: `+m.message+`
`+m.stack}return{value:e,source:t,stack:f,digest:null}}function kc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Sc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Bg=typeof WeakMap=="function"?WeakMap:Map;function Yd(e,t,n){n=Yr(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Ms||(Ms=!0,zc=i),Sc(e,t)},n}function Zd(e,t,n){n=Yr(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var f=t.value;n.payload=function(){return i(f)},n.callback=function(){Sc(e,t)}}var m=e.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(n.callback=function(){Sc(e,t),typeof i!="function"&&(gn===null?gn=new Set([this]):gn.add(this));var F=t.stack;this.componentDidCatch(t.value,{componentStack:F!==null?F:""})}),n}function Xd(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Bg;var f=new Set;i.set(t,f)}else f=i.get(t),f===void 0&&(f=new Set,i.set(t,f));f.has(n)||(f.add(n),e=zg.bind(null,e,t,n),t.then(e,e))}function Jd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ef(e,t,n,i,f){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Yr(-1,1),t.tag=2,xn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var _g=R.ReactCurrentOwner,Jt=!1;function Gt(e,t,n,i){t.child=e===null?yd(t,null,n,i):xo(t,e.child,n,i)}function tf(e,t,n,i,f){n=n.render;var m=t.ref;return go(t,f),i=mc(e,t,n,i,m,f),n=gc(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,Zr(e,t,f)):(ct&&n&&ec(t),t.flags|=1,Gt(e,t,i,f),t.child)}function rf(e,t,n,i,f){if(e===null){var m=n.type;return typeof m=="function"&&!Qc(m)&&m.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=m,nf(e,t,m,i,f)):(e=Vs(n.type,null,i,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,(e.lanes&f)===0){var F=m.memoizedProps;if(n=n.compare,n=n!==null?n:Xo,n(F,i)&&e.ref===t.ref)return Zr(e,t,f)}return t.flags|=1,e=wn(m,i),e.ref=t.ref,e.return=t,t.child=e}function nf(e,t,n,i,f){if(e!==null){var m=e.memoizedProps;if(Xo(m,i)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=i=m,(e.lanes&f)!==0)(e.flags&131072)!==0&&(Jt=!0);else return t.lanes=e.lanes,Zr(e,t,f)}return Bc(e,t,n,i,f)}function of(e,t,n){var i=t.pendingProps,f=i.children,m=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(wo,lr),lr|=n;else{if((n&1073741824)===0)return e=m!==null?m.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(wo,lr),lr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=m!==null?m.baseLanes:n,ot(wo,lr),lr|=i}else m!==null?(i=m.baseLanes|n,t.memoizedState=null):i=n,ot(wo,lr),lr|=i;return Gt(e,t,f,n),t.child}function af(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Bc(e,t,n,i,f){var m=Xt(n)?Rn:zt.current;return m=fo(t,m),go(t,f),n=mc(e,t,n,i,m,f),i=gc(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,Zr(e,t,f)):(ct&&i&&ec(t),t.flags|=1,Gt(e,t,n,f),t.child)}function sf(e,t,n,i,f){if(Xt(n)){var m=!0;As(t)}else m=!1;if(go(t,f),t.stateNode===null)Rs(e,t),Qd(t,n,i),Ec(t,n,i,f),i=!0;else if(e===null){var F=t.stateNode,j=t.memoizedProps;F.props=j;var H=F.context,Z=n.contextType;typeof Z=="object"&&Z!==null?Z=hr(Z):(Z=Xt(n)?Rn:zt.current,Z=fo(t,Z));var ie=n.getDerivedStateFromProps,le=typeof ie=="function"||typeof F.getSnapshotBeforeUpdate=="function";le||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(j!==i||H!==Z)&&Kd(t,F,i,Z),pn=!1;var se=t.memoizedState;F.state=se,ws(t,i,F,f),H=t.memoizedState,j!==i||se!==H||Zt.current||pn?(typeof ie=="function"&&(bc(t,n,ie,i),H=t.memoizedState),(j=pn||Gd(t,n,j,i,se,H,Z))?(le||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(t.flags|=4194308)):(typeof F.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),F.props=i,F.state=H,F.context=Z,i=j):(typeof F.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{F=t.stateNode,wd(e,t),j=t.memoizedProps,Z=t.type===t.elementType?j:Br(t.type,j),F.props=Z,le=t.pendingProps,se=F.context,H=n.contextType,typeof H=="object"&&H!==null?H=hr(H):(H=Xt(n)?Rn:zt.current,H=fo(t,H));var xe=n.getDerivedStateFromProps;(ie=typeof xe=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(j!==le||se!==H)&&Kd(t,F,i,H),pn=!1,se=t.memoizedState,F Line truncated
`)}function Av(r){if(r.length===0)return`Neighbors
No neighbors reported`;const a=[...r].sort((s,u)=>u.snr-s.snr),o=[`Neighbors (${a.length})`];for(const s of a){const u=s.name||s.pubkey_prefix,l=s.snr>=0?`+${s.snr.toFixed(1)}`:s.snr.toFixed(1);o.push(`${u}, ${l} dB [${si(s.last_heard_seconds)} ago]`)}return o.join(`
`)}function hv(r){if(r.length===0)return`ACL
No ACL entries`;const a=[`ACL (${r.length})`];for(const o of r){const s=o.name||o.pubkey_prefix;a.push(`${s}: ${o.permission_name}`)}return a.join(`
`)}function Un(r,a,o,s=0){const u=Math.floor(Date.now()/1e3);return{id:-Date.now()-s,type:"PRIV",conversation_key:r,text:a,sender_timestamp:u,received_at:u,path_len:null,txt_type:0,signature:null,outgoing:o,acked:1}}function pv(r,a,o){const[s,u]=D.useState(!1);D.useEffect(()=>{u(!1)},[r==null?void 0:r.id]);const l=D.useMemo(()=>{if(!r||r.type!=="contact")return!1;const h=a.find(d=>d.public_key===r.id);return(h==null?void 0:h.type)===Kh},[r,a]),A=D.useCallback(async h=>{if(!(!r||r.type!=="contact")&&l)try{const d=await Oe.requestTelemetry(r.id,h),p=Un(r.id,fv(d),!1,0),x=Un(r.id,Av(d.neighbors),!1,1),g=Un(r.id,hv(d.acl),!1,2);o(C=>[...C,p,x,g]),u(!0)}catch(d){const p=Un(r.id,`Telemetry request failed: ${d instanceof Error?d.message:"Unknown error"}`,!1,0);o(x=>[...x,p])}},[r,l,o]),c=D.useCallback(async h=>{if(!r||r.type!=="contact"||!l||!s)return;const d=Un(r.id,`> ${h}`,!0,0);o(p=>[...p,d]);try{const p=await Oe.sendRepeaterCommand(r.id,h),x=Un(r.id,p.response,!1,1);p.sender_timestamp&&(x.sender_timestamp=p.sender_timestamp),o(g=>[...g,x])}catch(p){const x=Un(r.id,`Command failed: ${p instanceof Error?p.message:"Unknown error"}`,!1,1);o(g=>[...g,x])}},[r,l,s,o]);return{repeaterLoggedIn:s,activeContactIsRepeater:l,handleTelemetryRequest:A,handleRepeaterCommand:c}}const xv=12;function To(r){return r.slice(0,xv)}function Yh(r,a){return!r||!a?!1:To(r)===To(a)}function Zn(r,a){return r||To(a)}const Eu="remoteterm-lastMessageTime";function Zh(r){try{const a=localStorage.getItem(r);return a?JSON.parse(a):{}}catch{return{}}}function mv(r,a){try{localStorage.setItem(r,JSON.stringify(a))}catch{}}function Zf(){return Zh(Eu)}function iu(r,a){const o=Zh(Eu);return(!o[r]||a>o[r])&&(o[r]=a,mv(Eu,o)),o}function Vr(r,a){return r==="channel"?`channel-${a}`:`contact-${To(a)}`}function gv(r,a,o){const[s,u]=D.useState({}),[l,A]=D.useState(Zf),c=D.useRef(new Set),h=D.useRef(new Set);D.useEffect(()=>{const C=r.filter(v=>!c.current.has(v.key)),w=a.filter(v=>v.public_key&&!h.current.has(v.public_key));if(C.length===0&&w.length===0)return;C.forEach(v=>c.current.add(v.key)),w.forEach(v=>h.current.add(v.public_key)),(async()=>{const v=[...C.map(E=>({type:"CHAN",conversation_key:E.key})),...w.map(E=>({type:"PRIV",conversation_key:E.public_key}))];if(v.length!==0)try{const E=await Oe.getMessagesBulk(v,100),k={},b={};for(const R of C){const B=E[`CHAN:${R.key}`]||[];if(B.length>0){const T=Vr("channel",R.key),N=R.last_read_at||0,P=B.filter(M=>!M.outgoing&&M.received_at>N).length;P>0&&(k[T]=P);const L=Math.max(...B.map(M=>M.received_at));b[T]=L,iu(T,L)}}for(const R of w){const B=E[`PRIV:${R.public_key}`]||[];if(B.length>0){const T=Vr("contact",R.public_key),N=R.last_read_at||0,P=B.filter(M=>!M.outgoing&&M.received_at>N).length;P>0&&(k[T]=P);const L=Math.max(...B.map(M=>M.received_at));b[T]=L,iu(T,L)}}Object.keys(k).length>0&&u(R=>({...R,...k})),A(Zf())}catch(E){console.error("Failed to fetch messages bulk:",E)}})()},[r,a]),D.useEffect(()=>{if(o&&o.type!=="raw"){const C=Vr(o.type,o.id);u(w=>{if(w[C]){const y={...w};return delete y[C],y}return w}),o.type==="channel"?Oe.markChannelRead(o.id).catch(w=>{console.error("Failed to mark channel as read on server:",w)}):o.type==="contact"&&Oe.markContactRead(o.id).catch(w=>{console.error("Failed to mark contact as read on server:",w)})}},[o]);const d=D.useCallback(C=>{u(w=>({...w,[C]:(w[C]||0)+1}))},[]),p=D.useCallback(()=>{u({}),Oe.markAllRead().catch(C=>{console.error("Failed to mark all as read on server:",C)})},[]),x=D.useCallback(C=>{if(C.type==="raw")return;const w=Vr(C.type,C.id);u(y=>{if(y[w]){const v={...y};return delete v[w],v}return y}),C.type==="channel"?Oe.markChannelRead(C.id).catch(y=>{console.error("Failed to mark channel as read on server:",y)}):C.type==="contact"&&Oe.markContactRead(C.id).catch(y=>{console.error("Failed to mark contact as read on server:",y)})},[]),g=D.useCallback(C=>{let w=null;if(C.type==="CHAN"&&C.conversation_key?w=Vr("channel",C.conversation_key):C.type==="PRIV"&&C.conversation_key&&(w=Vr("contact",C.conversation_key)),w){const y=C.received_at||Math.floor(Date.now()/1e3),v=iu(w,y);A(v)}},[]);return{unreadCounts:s,lastMessageTimes:l,incrementUnread:d,markAllRead:p,markConversationRead:x,trackNewMessage:g}}var Xh=Qh();const Jh=Io(Xh);function vv(r){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a.appendChild(o),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r))}const yv=r=>{switch(r){case"success":return bv;case"info":return kv;case"warning":return Ev;case"error":return Sv;default:return null}},Cv=Array(12).fill(0),wv=({visible:r,className:a})=>de.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":r},de.createElement("div",{className:"sonner-spinner"},Cv.map((o,s)=>de.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),bv=de.createElement("svg",{xmlns:"http://www.w3 Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qv=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kv=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,s)=>s?s.toUpperCase():o.toLowerCase()),eA=r=>{const a=Kv(r);return a.charAt(0).toUpperCase()+a.slice(1)},ep=(...r)=>r.filter((a,o,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===o).join(" ").trim(),Yv=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Zv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xv=D.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:s,className:u="",children:l,iconNode:A,...c},h)=>D.createElement("svg",{ref:h,...Zv,width:a,height:a,stroke:r,strokeWidth:s?Number(o)*24/Number(a):o,className:ep("lucide",u),...!l&&!Yv(c)&&{"aria-hidden":"true"},...c},[...A.map(([d,p])=>D.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zu=(r,a)=>{const o=D.forwardRef(({className:s,...u},l)=>D.createElement(Xv,{ref:l,iconNode:a,className:ep(`lucide-${Qv(eA(r))}`,`lucide-${r}`,s),...u}));return o.displayName=eA(r),o};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ey=zu("check",Jv);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ty=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ry=zu("menu",ty);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ny=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tp=zu("x",ny);function oy({health:r,config:a,onConfigClick:o,onMaintenanceClick:s,onAdvertise:u,onMenuClick:l}){const A=(r==null?void 0:r.radio_connected)??!1,[c,h]=D.useState(!1),d=async()=>{h(!0);try{const p=await Oe.reconnectRadio();p.connected&&ut.success("Reconnected",{description:p.message})}catch(p){ut.error("Reconnection failed",{description:p instanceof Error?p.message:"Check radio connection and power"})}finally{h(!1)}};return _.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&_.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:_.jsx(ry,{className:"h-5 w-5"})}),_.jsx("h1",{className:"hidden lg:block text-base font-semibold mr-auto",children:"RemoteTerm"}),_.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[_.jsx("div",{className:`w-2 h-2 rounded-full ${A?"bg-[#4caf50]":"bg-[#666]"}`}),_.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:A?"Connected":"Disconnected"})]}),(r==null?void 0:r.serial_port)&&_.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Port: ",_.jsx("span",{className:"text-[#e0e0e0]",children:r.serial_port})]}),a&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"hidden lg:flex items-center gap-1 text-[#888]",children:_.jsx("span",{className:"text-[#e0e0e0]",children:a.name||"Unnamed"})}),_.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:[a.radio.freq," MHz/SF",a.radio.sf,"/CR",a.radio.cr,"/",a.tx_power,"dBm"]})]}),_.jsx("div",{className:"flex-1 lg:hidden"}),!A&&_.jsx("button",{onClick:d,disabled:c,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:c?"Reconnecting...":"Reconnect"}),_.jsx("button",{onClick:u,disabled:!A,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444] disabled:bg-[#333] disabled:text-[#666] disabled:cursor-not-allowed",children:"Advertise"}),_.jsx("button",{onClick:s,className:"px-2 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",title:"Database Maintenance",children:_.jsx("span",{role:"img","aria-label":"Settings",children:"⚙️"})}),_.jsxs("button",{onClick:o,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[_.jsx("span",{role:"img","aria-label":"Radio",children:"📻"})," Config"]})]})}const Su=2,ay={text:"🛜",background:"#444444",textColor:"#ffffff"};function sy(r){let a=0;for(let o=0;o<r.length;o++){const s=r.charCodeAt(o);a=(a<<5)-a+s,a=a&a}return Math.abs(a)}const iy=/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;function ly(r,a){if(!r)return a.slice(0,2).toUpperCase();const o=r.match(iy);if(o)return o[0];const s=r.match(/[a-zA-Z]/g);if(!s||s.length===0)return a.slice(0,2).toUpperCase();const u=r.indexOf(" ");if(u!==-1){const l=s[0],A=r.slice(u+1).match(/[a-zA-Z]/);if(A)return(l+A[0]).toUpperCase()}return s[0].toUpperCase()}function cy(r){const a=sy(r),o=a%360,s=50+(a>>8)%30,u=35+(a>>16)%20,l=`hsl(${o}, ${s}%, ${u}%)`,A=u<45?"#ffffff":"#000000";return{background:l,text:A}}function uy(r,a,o){if(o===Su)return ay;const s=ly(r,a),u=cy(a);return{text:s,background:u.background,textColor:u.text}}function rp({name:r,publicKey:a,size:o=28,contactType:s}){const u=uy(r,a,s);return _.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:u.background,color:u.textColor,width:o,height:o,fontSize:o*.45},children:u.text})}function np(r){var a,o,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(a=0;a<u;a++)r[a]&&(o=np(r[a]))&&(s&&(s+=" "),s+=o)}else for(o in r)r[o]&&(s&&(s+=" "),s+=o);return s}function op(){for(var r,a,o=0,s="",u=arguments.length;o<u;o++)(r=arguments[o])&&(a=np(r))&&(s&&(s+=" "),s+=a);return s}const dy=(r,a)=>{const o=new Array(r.length+a.length);for(let s=0;s<r.length;s++)o[s]=r[s];for(let s=0;s<a.length;s++)o[r.length+s]=a[s];return o},fy=(r,a)=>({classGroupId:r,validator:a}),ap=(r=new Map,a=null,o)=>({nextPart:r,validators:a,classGroupId:o}),Yi="-",tA=[],Ay="arbitrary..",hy=r=>{const a=xy(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:A=>{if(A.startsWith("[")&&A.endsWith("]"))return py(A);const c=A.split(Yi),h=c[0]===""&&c.length>1?1:0;return sp(c,h,a)},getConflictingClassGroupIds:(A,c)=>{if(c){const h=s[A],d=o[A];return h?d?dy(d,h):h:d||tA}return o[A]||tA}}},sp=(r,a,o)=>{if(r.length-a===0)return o.classGroupId;const u=r[a],l=o.Line truncated
`).map((S,O,z)=>_.jsxs("span",{children:[d1(S,c),O<z.length-1&&_.jsx("br",{})]},O)),!X&&_.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:_u(B.sender_timestamp||B.received_at)}),B.outgoing&&(B.acked>0?` ✓${B.acked>1?B.acked:""}`:" ?")]})]})]},B.id)})]}),x&&_.jsx("button",{onClick:y,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:_.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const uA=156,A1=140,h1=156,p1=120,x1=8,m1=D.forwardRef(function({onSend:a,disabled:o,placeholder:s,isRepeaterMode:u,conversationType:l,senderName:A},c){const[h,d]=D.useState(""),[p,x]=D.useState(!1),g=D.useRef(null);D.useImperativeHandle(c,()=>({appendText:B=>{var T;d(N=>N+B),(T=g.current)==null||T.focus()}}));const C=D.useMemo(()=>{if(l==="contact")return{warningAt:A1,dangerAt:uA,hardLimit:uA};if(l==="channel"){const B=(A==null?void 0:A.length)??10,T=Math.max(1,h1-B-2);return{warningAt:p1,dangerAt:Math.max(1,T-x1),hardLimit:T}}return null},[l,A]),{limitState:w,warningMessage:y}=D.useMemo(()=>{if(!C)return{limitState:"normal",warningMessage:null};const B=h.length;return B>=C.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:B>=C.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:B>=C.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[h.length,C]),v=C?C.hardLimit-h.length:0,E=D.useCallback(async B=>{B.preventDefault();const T=h.trim();if(u){if(p||o)return;const N=T==="."?"":T;x(!0);try{await a(N),d("")}catch(P){console.error("Failed to request telemetry:",P),ut.error("Failed to request telemetry",{description:P instanceof Error?P.message:"Check radio connection"});return}finally{x(!1)}setTimeout(()=>{var P;return(P=g.current)==null?void 0:P.focus()},0)}else{if(!T||p||o)return;x(!0);try{await a(T),d("")}catch(N){console.error("Failed to send message:",N),ut.error("Failed to send message",{description:N instanceof Error?N.message:"Check radio connection"});return}finally{x(!1)}setTimeout(()=>{var N;return(N=g.current)==null?void 0:N.focus()},0)}},[h,p,o,a,u]),k=D.useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),E(B))},[E]),b=u?h.trim().length>0||h===".":h.trim().length>0,R=!u&&C!==null;return _.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:E,children:[_.jsxs("div",{className:"flex gap-2",children:[_.jsx(Ct,{ref:g,type:u?"password":"text",value:h,onChange:B=>d(B.target.value),onKeyDown:k,placeholder:s||(u?"Enter password (or . for none)...":"Type a message..."),disabled:o||p,className:"flex-1 min-w-0"}),_.jsx(gr,{type:"submit",disabled:o||p||!b,className:"flex-shrink-0",children:p?u?"Fetching...":"Sending...":u?"Fetch":"Send"})]}),R&&_.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[_.jsxs("span",{className:We("tabular-nums",w==="error"||w==="danger"?"text-red-500 font-medium":w==="warning"?"text-yellow-500":"text-muted-foreground"),children:[h.length,"/",C.hardLimit,v<0&&` (${v})`]}),y&&_.jsxs("span",{className:We(w==="error"?"text-red-500":"text-yellow-500"),children:["— ",y]})]})]})});function Dt(r,a,{checkForDefaultPrevented:o=!0}={}){return function(u){if(r==null||r(u),o===!1||!u.defaultPrevented)return a==null?void 0:a(u)}}function g1(r,a){const o=D.createContext(a),s=l=>{const{children:A,...c}=l,h=D.useMemo(()=>c,Object.values(c));return _.jsx(o.Provider,{value:h,children:A})};s.displayName=r+"Provider";function u(l){const A=D.useContext(o);if(A)return A;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,u]}function Va(r,a=[]){let o=[];function s(l,A){const c=D.createContext(A),h=o.length;o=[...o,A];const d=x=>{var E;const{scope:g,children:C,...w}=x,y=((E=g==null?void 0:g[r])==null?void 0:E[h])||c,v=D.useMemo(()=>w,Object.values(w));return _.jsx(y.Provider,{value:v,children:C})};d.displayName=l+"Provider";function p(x,g){var y;const C=((y=g==null?void 0:g[r])==null?void 0:y[h])||c,w=D.useContext(C);if(w)return w;if(A!==void 0)return A;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[d,p]}const u=()=>{const l=o.map(A=>D.createContext(A));return function(c){const h=(c==null?void 0:c[r])||l;return D.useMemo(()=>({[`__scope${r}`]:{...c,[r]:h}}),[c,h])}};return u.scopeName=r,[s,v1(u,...a)]}function v1(...r){const a=r[0];if(r.length===1)return a;const o=()=>{const s=r.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const A=s.reduce((c,{useScope:h,scopeName:d})=>{const x=h(l)[`__scope${d}`];return{...c,...x}},{});return D.useMemo(()=Line truncated
.`.concat(e2,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(c,"px ").concat(s,`;
}
body[`).concat(Fo,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([a&&"position: relative ".concat(s,";"),o==="margin"&&`
padding-left: `.concat(u,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(A,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(c,"px ").concat(s,`;
`),o==="padding"&&"padding-right: ".concat(c,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(ii,` {
right: `).concat(c,"px ").concat(s,`;
}
.`).concat(li,` {
margin-right: `).concat(c,"px ").concat(s,`;
}
.`).concat(ii," .").concat(ii,` {
right: 0 `).concat(s,`;
}
.`).concat(li," .").concat(li,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(Fo,`] {
`).concat(t2,": ").concat(c,`px;
}
`)},vA=function(){var r=parseInt(document.body.getAttribute(Fo)||"0",10);return isFinite(r)?r:0},y2=function(){D.useEffect(function(){return document.body.setAttribute(Fo,(vA()+1).toString()),function(){var r=vA()-1;r<=0?document.body.removeAttribute(Fo):document.body.setAttribute(Fo,r.toString())}},[])},C2=function(r){var a=r.noRelative,o=r.noImportant,s=r.gapMode,u=s===void 0?"margin":s;y2();var l=D.useMemo(function(){return m2(u)},[u]);return D.createElement(g2,{styles:v2(l,!a,u,o?"":"!important")})},Fu=!1;if(typeof window<"u")try{var ri=Object.defineProperty({},"passive",{get:function(){return Fu=!0,!0}});window.addEventListener("test",ri,ri),window.removeEventListener("test",ri,ri)}catch{Fu=!1}var So=Fu?{passive:!1}:!1,w2=function(r){return r.tagName==="TEXTAREA"},_p=function(r,a){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!w2(r)&&o[a]==="visible")},b2=function(r){return _p(r,"overflowY")},E2=function(r){return _p(r,"overflowX")},yA=function(r,a){var o=a.ownerDocument,s=a;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var u=Dp(r,s);if(u){var l=Fp(r,s),A=l[1],c=l[2];if(A>c)return!0}s=s.parentNode}while(s&&s!==o.body);return!1},k2=function(r){var a=r.scrollTop,o=r.scrollHeight,s=r.clientHeight;return[a,o,s]},S2=function(r){var a=r.scrollLeft,o=r.scrollWidth,s=r.clientWidth;return[a,o,s]},Dp=function(r,a){return r==="v"?b2(a):E2(a)},Fp=function(r,a){return r==="v"?k2(a):S2(a)},B2=function(r,a){return r==="h"&&a==="rtl"?-1:1},_2=function(r,a,o,s,u){var l=B2(r,window.getComputedStyle(a).direction),A=l*s,c=o.target,h=a.contains(c),d=!1,p=A>0,x=0,g=0;do{if(!c)break;var C=Fp(r,c),w=C[0],y=C[1],v=C[2],E=y-v-l*w;(w||E)&&Dp(r,c)&&(x+=E,g+=w);var k=c.parentNode;c=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!h&&c!==document.body||h&&(a.contains(c)||a===c));return(p&&Math.abs(x)<1||!p&&Math.abs(g)<1)&&(d=!0),d},ni=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},CA=function(r){return[r.deltaX,r.deltaY]},wA=function(r){return r&&"current"in r?r.current:r},D2=function(r,a){return r[0]===a[0]&&r[1]===a[1]},F2=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},R2=0,Bo=[];function T2(r){var a=D.useRef([]),o=D.useRef([0,0]),s=D.useRef(),u=D.useState(R2++)[0],l=D.useState(Bp)[0],A=D.useRef(r);D.useEffect(function(){A.current=r},[r]),D.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(u));var y=J1([r.lockRef.current],(r.shards||[]).map(wA),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(u))})}}},[r.inert,r.lockRef.current,r.shards]);var c=D.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!A.current.allowPinchZoom;var E=ni(y),k=o.current,b="deltaX"in y?y.deltaX:k[0]-E[0],R="deltaY"in y?y.deltaY:k[1]-E[1],B,T=y.target,N=Math.abs(b)>Math.abs(R)?"h":"v";if("touches"in y&&N==="h"&&T.type==="range")return!1;var P=window.getSelection(),L=P&&P.anchorNode,M=L?L===T||L.contains(T):!1;if(M)return!1;var I=yA(N,T);if(!I)return!0;if(I?B=N:(B=N==="v"?"h":"v",I=yA(N,T)),!I)return!1;if(!s.current&&"changedTouches"in y&&(b||R)&&(s.current=B),!B)return!0;var $=s.current||B;return _2($,v,y,$==="h"?b:R)},[]),h=D.useCallback(function(y){var v=y;if(!(!Bo.length||Bo[Bo.length-1]!==l)){var E="deltaY"in v?CA(v):ni(v),k=a.current.filter(function(B){return B.name===v.type&&(B.target===v.target||v.target===B.shadowParent)&&D2(B.delta,E)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var b=(A.current.shards||[]).map(wA).filter(Boolean).filter(function(B){return B.contains(v.target)}),R=b.length>0?c(v,b[0]):!A.current.noIsolation;R&&v.cancelable&&v.preventDefault()}}},[]),d=D.useCallback(function(y,v,E,k){var b={name:y,delta:v,target:E,should:k,shadowParent:P2(E)};a.current.push(b),setTimeout(function(){a.current=a.current.filter(function(R){return R!==b})},1)},[]),p=D.useCallback(function(y){o.current=ni(y),s.current=void 0},[]),x=D.useCallback(function(y){d(y.type,CA(y),y.target,c(y,r.lockRef.current))},[]),g=D.useCallback(function(y){d(y.type,ni(y),y.target,c(y,r.lockRef.current))},[]);D.useEffect(function(){return Bo.push(l),r.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:g}),document.addEventListener("wheel",h,So),document.addEventListener("touchmove",h,So),document.addEventListener("touchstart",p,So),function(){Bo=Bo.filter(function(y){return y!==l}),document.removeEventListener("wheel",h,So),document.removeEventListener("touchmove",h,So),document.removeEventListener("touchstart",p,So)}},[]);var C=r.removeScrollBar,w=r.inert;return D.createElement(D.Fragment,null,w?D.createElement(l,{styles:F2(u)}):null,C?D.createElement(C2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function P2(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const N2=l2(Sp,T2);var Rp=D.forwardRef(function(r,a){return D.createElement(al,Ur({},r,{ref:a,sideCar:N2}))});Rp.classNames=al.classNames;var I2=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},_o=new WeakMap,oi=new WeakMap,ai={},mu=0,Tp=function(r){return r&&(r.host||Tp(r.parentNode))},M2=function(r,a){return a.map(function(o){if(r.contains(o))return o;var s=Tp(o);return s&&r.contains(s)?s:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},j2=function(r,a,o,s){var u=M2(a,Array.isArray(r)?r:[r]);ai[o]||(ai[o]=new WeakMap);var l=ai[o],A=[],c=new Set,h=new Set(u),d=function(x){!x||c.has(x)||(c.add(x),d(x.parentNode))};u.forEach(d);var p=function(x){!x||h.has(x)||Array.prototype.forEach.call(x.children,function(g){if(c.has(g))p(g);else try{var C=g.getAttribute(s),w=C!==null&&C!=="false",y=(_o.get(g)||0)+1,v=(l.get(g)||0)+1;_o.set(g,y),l.set(g,v),A.push(g),y===1&&w&&oi.set(g,!0),v===1&&g.setAttribute(o,"true"),w||g.setAttribute(s,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return p(a),c.clear(),mu++,function(){A.forEach(function(x){var g=_o.get(x)-1,C=l.get(x)-1;_o.set(x,g),l.set(x,C),g||(oi.has(x)||x.removeAttribute(s),oi.delete(x)),C||x.removeAttribute(o)}),mu--,mu||(_o=new WeakMap,_o=new WeakMap,oi=new WeakMap,ai={})}},O2=function(r,a,o){o===void 0&&(o="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),u=I2(r);return u?(s.push.apply(s,Array.from(u.querySelectorAll("[aria-live], script"))),j2(s,u,o,"aria-hidden")):function(){return null}};function L2(r){const a=H2(r),o=D.forwardRef((s,u)=>{const{children:l,...A}=s,c=D.Children.toArray(l),h=c.find(V2);if(h){const d=h.props.children,p=c.map(x=>x===h?D.Children.count(d)>1?D.Children.only(null):D.isValidElement(d)?d.props.children:null:x);return _.jsx(a,{...A,ref:u,children:D.isValidElement(d)?D.cloneElement(d,void 0,p):null})}return _.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function H2(r){const a=D.forwardRef((o,s)=>{const{children:u Line truncated
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return D.useEffect(()=>{r&&(document.getElementById(r)||console.error(o))},[o,r]),null},J2="DialogDescriptionWarning",eC=({contentRef:r,descriptionId:a})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gp(J2).contentName}}.`;return D.useEffect(()=>{var l;const u=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");a&&u&&(document.getElementById(a)||console.warn(s))},[s,r,a]),null},Qp=Np,Kp=jp,il=Op,ll=Lp,cl=zp,ul=Up,Yp=$p;const Gu=Qp,tC=Kp,Zp=D.forwardRef(({className:r,...a},o)=>_.jsx(il,{ref:o,className:We("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a}));Zp.displayName=il.displayName;const dl=D.forwardRef(({className:r,children:a,...o},s)=>_.jsxs(tC,{children:[_.jsx(Zp,{}),_.jsxs(ll,{ref:s,className:We("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...o,children:[a,_.jsxs(Yp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(tp,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dl.displayName=ll.displayName;const fl=({className:r,...a})=>_.jsx("div",{className:We("flex flex-col space-y-1.5 text-center sm:text-left",r),...a});fl.displayName="DialogHeader";const Qu=({className:r,...a})=>_.jsx("div",{className:We("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});Qu.displayName="DialogFooter";const Al=D.forwardRef(({className:r,...a},o)=>_.jsx(cl,{ref:o,className:We("text-lg font-semibold leading-none tracking-tight",r),...a}));Al.displayName=cl.displayName;const rC=D.forwardRef(({className:r,...a},o)=>_.jsx(ul,{ref:o,className:We("text-sm text-muted-foreground",r),...a}));rC.displayName=ul.displayName;function bA(r){const a=nC(r),o=D.forwardRef((s,u)=>{const{children:l,...A}=s,c=D.Children.toArray(l),h=c.find(aC);if(h){const d=h.props.children,p=c.map(x=>x===h?D.Children.count(d)>1?D.Children.only(null):D.isValidElement(d)?d.props.children:null:x);return _.jsx(a,{...A,ref:u,children:D.isValidElement(d)?D.cloneElement(d,void 0,p):null})}return _.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function nC(r){const a=D.forwardRef((o,s)=>{const{children:u,...l}=o;if(D.isValidElement(u)){const A=iC(u),c=sC(l,u.props);return u.type!==D.Fragment&&(c.ref=s?za(s,A):A),D.cloneElement(u,c)}return D.Children.count(u)>1?D.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var oC=Symbol("radix.slottable");function aC(r){return D.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===oC}function sC(r,a){const o={...a};for(const s in a){const u=r[s],l=a[s];/^on[A-Z]/.test(s)?u&&l?o[s]=(...c)=>{const h=l(...c);return u(...c),h}:u&&(o[s]=u):s==="style"?o[s]={...u,...l}:s==="className"&&(o[s]=[u,l].filter(Boolean).join(" "))}return{...r,...o}}function iC(r){var s,u;let a=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?r.ref:(a=(u=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:u.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?r.props.ref:r.props.ref||r.ref)}function lC(r){const a=r+"CollectionProvider",[o,s]=Va(a),[u,l]=o(a,{collectionRef:{current:null},itemMap:new Map}),A=y=>{const{scope:v,children:E}=y,k=de.useRef(null),b=de.useRef(new Map).current;return _.jsx(u,{scope:v,itemMap:b,collectionRef:k,children:E})};A.displayName=a;const c=r+"CollectionSlot",h=bA(c),d=de.forwardRef((y,v)=>{const{scope:E,children:k}=y,b=l(c,E),R=vr(v,b.collectionRef);return _.jsx(h,{ref:R,children:k})});d.displayName=c;const p=r+"CollectionItemSlot",x="data-radix-collection-item",g=bA(p),C=de.forwardRef((y,v)=>{const{scope:E,children:k,...b}=y,R=de.useRef(null),B=vr(v,R),T=l(p,E);return de.useEffect(()=>(T.itemMap.set(R,{ref:R,...b}),()=>void T.itemMap.delete(R))),_.jsx(g,{[x]:"",ref:B,children:k})});C.displayName=p;function w(y){const v=l(r+"CollectionConsumer",y);return de.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const b=Array.from(k.querySelectorAll(`[${x}]`));return Array.from(v.itemMap.values()).sort((T,N)=>b.indexOf(T.ref.current)-b.indexOf(N.ref.current))},[v.coll Line truncated
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/return(function(s){var u=o,l=u.lib,A=l.WordArray,c=l.Hasher,h=u.algo,d=A.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=A.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),x=A.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),g=A.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),C=A.create([0,1518500249,1859775393,2400959708,2840853838]),w=A.create([1352829926,1548603684,1836072691,2053994217,0]),y=h.RIPEMD160=c.extend({_doReset:function(){this._hash=A.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(T,N){for(var P=0;P<16;P++){var L=N+P,M=T[L];T[L]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}var I=this._hash.words,$=C.words,V=w.words,Y=d.words,re=p.words,X=x.words,ne=g.words,W,oe,J,S,O,z,q,ce,fe,he;z=W=I[0],q=oe=I[1],ce=J=I[2],fe=S=I[3],he=O=I[4];for(var ae,P=0;P<80;P+=1)ae=W+T[N+Y[P]]|0,P<16?ae+=v(oe,J,S)+$[0]:P<32?ae+=E(oe,J,S)+$[1]:P<48?ae+=k(oe,J,S)+$[2]:P<64?ae+=b(oe,J,S)+$[3]:ae+=R(oe,J,S)+$[4],ae=ae|0,ae=B(ae,X[P]),ae=ae+O|0,W=O,O=S,S=B(J,10),J=oe,oe=ae,ae=z+T[N+re[P]]|0,P<16?ae+=R(q,ce,fe)+V[0]:P<32?ae+=b(q,ce,fe)+V[1]:P<48?ae+=k(q,ce,fe)+V[2]:P<64?ae+=E(q,ce,fe)+V[3]:ae+=v(q,ce,fe)+V[4],ae=ae|0,ae=B(ae,ne[P]),ae=ae+he|0,z=he,he=fe,fe=B(ce,10),ce=q,q=ae;ae=I[1]+J+fe|0,I[1]=I[2]+S+he|0,I[2]=I[3]+O+z|0,I[3]=I[4]+W+q|0,I[4]=I[0]+oe+ce|0,I[0]=ae},_doFinalize:function(){var T=this._data,N=T.words,P=this._nDataBytes*8,L=T.sigBytes*8;N[L>>>5]|=128<<24-L%32,N[(L+64>>>9<<4)+14]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360,T.sigBytes=(N.length+1)*4,this._process();for(var M=this._hash,I=M.words,$=0;$<5;$++){var V=I[$];I[$]=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360}return M},clone:function(){var T=c.clone.call(this);return T._hash=this._hash.clone(),T}});function v(T,N,P){return T^N^P}function E(T,N,P){return T&N|~T&P}function k(T,N,P){return(T|~N)^P}function b(T,N,P){return T&P|N&~P}function R(T,N,P){return T^(N|~P)}function B(T,N){return T<<N|T>>>32-N}u.RIPEMD160=c._createHelper(y),u.HmacRIPEMD160=c._createHmacHelper(y)})(),o.RIPEMD160})})(Ei)),Ei.exports}var ki={exports:{}},w4=ki.exports,WA;function ml(){return WA||(WA=1,(function(r,a){(function(o,s){r.exports=s(Ve())})(w4,function(o){(function(){var s=o,u=s.lib,l=u.Base,A=s.enc,c=A.Utf8,h=s.algo;h.HMAC=l.extend({init:function(d,p){d=this._hasher=new d.init,typeof p=="string"&&(p=c.parse(p));var x=d.blockSize,g=x*4;p.sigBytes>g&&(p=d.finalize(p)),p.clamp();for(var C=this._oKey=p.clone(),w=this._iKey=p.clone(),y=C.words,v=w.words,E=0;E<x;E++)y[E]^=1549556828,v[E]^=909522486;C.sigBytes=w.sigBytes=g,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var p=this._hasher,x=p.finalize(d);p.reset();var g=p.finalize(this._oKey.clone().concat(x));return g}})})()})})(ki)),ki.exports}var Si={exports:{}},b4=Si.exports,$A;function E4(){return $A||($A=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),Wa(),ml())})(b4,function(o){return(function(){var s=o,u=s.lib,l=u.Base,A=u.WordArray,c=s.algo,h=c.SHA256,d=c.HMAC,p=c.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,g){for(var C=this.cfg,w=d.create(C.hasher,x),y=A.create(),v=A.create([1]),E=y.words,k=v.words,b=C.keySize,R=C.iterations;E.length<b;){var B=w.update(g).finalize(v);w.reset();for(var T=B.words,N=T.length,P=B,L=1;L<R;L++){P=w.finalize(P),w.reset();for(var M=P.words,I=0;I<N;I++)T[I]^=M[I]}y.concat(B),k[0]++}return y.sigBytes=b*4,y}});s.PBKDF2=function(x,g,C){return p.create(C).compute(x,g)}})(),o.PBKDF2})})(Si)),Si.exports}var Bi={exports:{}},k4=Bi.exports,qA;function _n(){return qA||(qA=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),Px(),ml())})(k4,function(o){return(function(){var s=o,u=s.lib,l=u.Base,A=u.WordArray,c=s.algo,h=c.MD5,d=c.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:1}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,x){for(var g,C=this.cfg,w=C.hasher.create(),y=A.create(),v=y.words,E=C.keySize,k=C.iterations;v.length<E;){g&&w.update(g),g=w.update(p).finalize(x),w.reset();for(var b=1;b<k;b++)g=w.finalize(g),w.reset();y.concat(g)}return y.sigBytes=E*4,y}});s.EvpKDF=function(p,x,g){return d.create(g).compute(p,x)}})(),o.EvpKDF})})(Bi)),Bi.exports}var _i={exports:{}},S4=_i.exports,GA;function It(Line truncated
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/return o.mode.CTRGladman=(function(){var s=o.lib.BlockCipherMode.extend();function u(c){if((c>>24&255)===255){var h=c>>16&255,d=c>>8&255,p=c&255;h===255?(h=0,d===255?(d=0,p===255?p=0:++p):++d):++h,c=0,c+=h<<16,c+=d<<8,c+=p}else c+=1<<24;return c}function l(c){return(c[0]=u(c[0]))===0&&(c[1]=u(c[1])),c}var A=s.Encryptor=s.extend({processBlock:function(c,h){var d=this._cipher,p=d.blockSize,x=this._iv,g=this._counter;x&&(g=this._counter=x.slice(0),this._iv=void 0),l(g);var C=g.slice(0);d.encryptBlock(C,0);for(var w=0;w<p;w++)c[h+w]^=C[w]}});return s.Decryptor=A,s})(),o.mode.CTRGladman})})(Ri)),Ri.exports}var Ti={exports:{}},P4=Ti.exports,ZA;function N4(){return ZA||(ZA=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(P4,function(o){return o.mode.OFB=(function(){var s=o.lib.BlockCipherMode.extend(),u=s.Encryptor=s.extend({processBlock:function(l,A){var c=this._cipher,h=c.blockSize,d=this._iv,p=this._keystream;d&&(p=this._keystream=d.slice(0),this._iv=void 0),c.encryptBlock(p,0);for(var x=0;x<h;x++)l[A+x]^=p[x]}});return s.Decryptor=u,s})(),o.mode.OFB})})(Ti)),Ti.exports}var Pi={exports:{}},I4=Pi.exports,XA;function M4(){return XA||(XA=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(I4,function(o){return o.mode.ECB=(function(){var s=o.lib.BlockCipherMode.extend();return s.Encryptor=s.extend({processBlock:function(u,l){this._cipher.encryptBlock(u,l)}}),s.Decryptor=s.extend({processBlock:function(u,l){this._cipher.decryptBlock(u,l)}}),s})(),o.mode.ECB})})(Pi)),Pi.exports}var Ni={exports:{}},j4=Ni.exports,JA;function O4(){return JA||(JA=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(j4,function(o){return o.pad.AnsiX923={pad:function(s,u){var l=s.sigBytes,A=u*4,c=A-l%A,h=l+c-1;s.clamp(),s.words[h>>>2]|=c<<24-h%4*8,s.sigBytes+=c},unpad:function(s){var u=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=u}},o.pad.Ansix923})})(Ni)),Ni.exports}var Ii={exports:{}},L4=Ii.exports,eh;function H4(){return eh||(eh=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(L4,function(o){return o.pad.Iso10126={pad:function(s,u){var l=u*4,A=l-s.sigBytes%l;s.concat(o.lib.WordArray.random(A-1)).concat(o.lib.WordArray.create([A<<24],1))},unpad:function(s){var u=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=u}},o.pad.Iso10126})})(Ii)),Ii.exports}var Mi={exports:{}},z4=Mi.exports,th;function V4(){return th||(th=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(z4,function(o){return o.pad.Iso97971={pad:function(s,u){s.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(s,u)},unpad:function(s){o.pad.ZeroPadding.unpad(s),s.sigBytes--}},o.pad.Iso97971})})(Mi)),Mi.exports}var ji={exports:{}},U4=ji.exports,rh;function W4(){return rh||(rh=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(U4,function(o){return o.pad.ZeroPadding={pad:function(s,u){var l=u*4;s.clamp(),s.sigBytes+=l-(s.sigBytes%l||l)},unpad:function(s){for(var u=s.words,l=s.sigBytes-1,l=s.sigBytes-1;l>=0;l--)if(u[l>>>2]>>>24-l%4*8&255){s.sigBytes=l+1;break}}},o.pad.ZeroPadding})})(ji)),ji.exports}var Oi={exports:{}},$4=Oi.exports,nh;function q4(){return nh||(nh=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})($4,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(Oi)),Oi.exports}var Li={exports:{}},G4=Li.exports,oh;function Q4(){return oh||(oh=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),It())})(G4,function(o){return(function(s){var u=o,l=u.lib,A=l.CipherParams,c=u.enc,h=c.Hex,d=u.format;d.Hex={stringify:function(p){return p.ciphertext.toString(h)},parse:function(p){var x=h.parse(p);return A.create({ciphertext:x})}}})(),o.format.Hex})})(Li)),Li.exports}var Hi={exports:{}},K4=Hi.exports,ah;function Y4(){return ah||(ah=1,(function(r,a){(function(o,s,u){r.exports=s(Ve(),eo(),to(),_n(),It())})(K4,function(o){return(function(){var s=o,u=s.lib,l=u.BlockCipher,A=s.algo,c=[],h=[],d=[],p=[],x=[],g=[],C=[],w=[],y=[],v=[];(function(){for(var b=[],R=0;R<256;R++)R<128?b[R]=R<<1:b[R]=R<<1^283;for(var B=0,T=0,R=0;R<256;R++){var N=T^T<<1^T<<2^T<<3^T<<4;N=N>>>8^N&255^99,c[B]=N,h[N]=B;var P=b[B],L=b[P],M=b[L],I=b[N]*257^N*16843008;d[B]=I<<24|I>>>8,p[B]=I<<16|I>>>16,x[B]=I<<8|I>>>24,g[B]=I;var I=M*16843009^L*65537^P*257^B*16843008;C[N]=I<<24|I>>>8,w[N]=I<<16|I>>>16,y[N]=I<<8|I>>>24,v[N]=I,B?(B=P^b[b[b[M^P]]],T^=b[b[T]]):B=T=1}})();var E=[0,1,2,4,8,16,32,64,128,27,54],k=A.AES=l.extend({_doReset:function(){var b;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var R=this._keyPriorReset=this._key,B=R.words,T=R.sigBytes/4,N=this._nRounds=T+6,P=(N+1)*4,L=this._keySchedule=[],M=0;M<P;M++)M<T?L[M]=B[M]:(b=L[M-1],M%T?T>6&&M%T==4&&(b=c[b>>>24]<<24|c[b>>>16&255]<<16|c[b>>>8&255]<<8|c[b&255]):(b=b<<8|b>>>24,b=c[b>>>24]<<24|c[b>>>16&255]<<16|c[b>>>8&255]<<8|c[b&255],b^=E[M/T|0]<<24),L[M]=L[M-T]^b);for(var I=this._invKeySchedule=[],$=0;$<P;$++){var M=P-$;if($%4)var b=L[M];else var b=L[M-4];$<4||M<=4?I[$]=b:I[$]=C[c[b>>>24]]^w[c[b>>>16&255]]^y[c[b>>>8&255]]^v[c[b&255]]}}},encryptBlock:Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Ba.RequestPayloadDecoder=o,Ba}var _a={},_h;function Tw(){if(_h)return _a;_h=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.ResponsePayloadDecoder=void 0;const r=ur(),a=Lt();class o{static decode(u,l){try{if(u.length<4){const w={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),w}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:p}),h+=1;const x=(0,a.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return _a.ResponsePayloadDecoder=o,_a}var Da={},Dh;function Pw(){if(Dh)return Da;Dh=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.AnonRequestPayloadDecoder=void 0;const r=ur(),a=Lt();class o{static decode(u,l){try{if(u.length<35){const w={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),w}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${d}`,startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.bytesToHex)(u.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:c+h,endByte:c+h+31,value:p}),h+=32;const x=(0,a.bytesToHex)(u.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(35));l!=null&&l.includeSegments&&u.length>35&&A.push({name:"Ciphertext",description:`Encrypted message data (${u.length-35} bytes). Contains encrypted plaintext with this structure:
• Timestamp (4 bytes) - send time as unix timestamp
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
• Password (remaining bytes) - password for repeater/room`,startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,senderPublicKey:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-35};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Da.AnonRequestPayloadDecoder=o,Da}var Fa={},Fh;function Nw(){if(Fh)return Fa;Fh=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.AckPayloadDecoder=void 0;const r=ur(),a=Lt();class o{static decode(u,l){try{if(u.length<4){const p={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(p.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),p}const A=[],c=(l==null?void 0:l.segmentOffset)||0,h=(0,a.bytesToHex)(u.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${h}`,startByte:c,endByte:c+3,value:h}),l!=null&&l.includeSegments&&u.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:c+4,endByte:c+u.length-1,value:(0,a.bytesToHex)(u.subarray(4))});const d={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!0,checksum:h};return l!=null&&l.includeSegments&&(d.segments=A),d}catch(A){return{type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}}return Fa.AckPayloadDecoder=o,Fa}var Ra={},Rh;function Iw(){if(Rh)return Ra;Rh=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.PathPayloadDecoder=void 0;const r=ur(),a=Lt();class o{static decode(u){try{if(u.length<2)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=u[0];if(u.length<1+l+1)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let d=0;d<l;d++)A.push((0,a.byteToHex)(u[1+d]));const c=u[1+l];let h="";return u.length>1+l+1&&(h=(0,a.bytesToHex)(u.subarray(1+l+1))),{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:c,extraData:h}}catch(l){return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Ra.PathPayloadDecoder=o,Ra}var Ta={},Th;function Mw(){if(Th)return Ta;Th=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.TextMessagePayloadDecoder=void 0;const r=ur(),a=Lt();class o{static decode(u,l){try{if(u.length<4){const w={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),w}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:p}),h+=1;const x=(0,a.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,i Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
);
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
const CHARS: array<u32, 37> = array<u32, 37>(
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
0x2du // dash
);
struct Params {
target_channel_hash: u32,
batch_offset: u32,
name_length: u32,
batch_size: u32,
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
ciphertext_words: u32, // Number of 32-bit words in ciphertext
ciphertext_len_bits: u32, // Length of ciphertext in bits
verify_mac: u32, // 1 to verify MAC, 0 to skip
}
@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
fn rotr(x: u32, n: u32) -> u32 {
return (x >> n) | (x << (32u - n));
}
fn ch(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (~x & z);
}
fn maj(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (x & z) ^ (y & z);
}
fn sigma0(x: u32) -> u32 {
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
}
fn sigma1(x: u32) -> u32 {
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
}
fn gamma0(x: u32) -> u32 {
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
}
fn gamma1(x: u32) -> u32 {
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
}
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
// Message starts with '#' (0x23)
var byte_pos = 0u;
var word_idx = 0u;
var current_word = 0x23000000u; // '#' in big-endian position 0
byte_pos = 1u;
var remaining = idx;
var prev_was_dash = false;
// Generate room name from index
for (var i = 0u; i < length; i++) {
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
var char_idx = remaining % char_count;
remaining = remaining / char_count;
// Check for consecutive dashes (invalid)
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
if (is_dash && prev_was_dash) {
return false; // Invalid: consecutive dashes
}
prev_was_dash = is_dash;
// Map char index to actual character
let c = CHARS[char_idx];
// Pack byte into current word (big-endian)
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u && byte_pos > 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0u;
}
current_word = current_word | (c << shift);
byte_pos = byte_pos + 1u;
}
// Add padding: 0x80 followed by zeros, then length in bits
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
// Add 0x80 padding byte
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0x80000000u;
} else {
current_word = current_word | (0x80u << shift);
}
byte_pos = byte_pos + 1u;
// Store current word
if (byte_pos % 4u == 0u || word_idx < 14u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
}
// Zero-fill until word 14
for (var i = word_idx; i < 14u; i++) {
(*msg)[i] = 0u;
}
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
(*msg)[14u] = 0u;
(*msg)[15u] = msg_len_bits;
return true;
}
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
// Initialize hash values
var h: array<u32, 8> = array<u32, 8>(
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
);
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Compute SHA256 of the key (16 bytes) to get channel hash
fn sha256_key(key: array<u32, 4>) -> u32 {
var msg: array<u32, 16>;
// Key bytes (16 bytes = 4 words)
msg[0] = key[0];
msg[1] = key[1];
msg[2] = key[2];
msg[3] = key[3];
// Padding: 0x80 followed by zeros
msg[4] = 0x80000000u;
for (var i = 5u; i < 14u; i++) {
msg[i] = 0u;
}
// Length: 128 bits
msg[14] = 0u;
msg[15] = 128u;
let hash = sha256_block(&msg);
// Return first byte of hash (big-endian)
return hash[0] >> 24u;
}
// HMAC-SHA256 for MAC verification
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
// ipad = 0x36 repeated, opad = 0x5c repeated
// Build padded key (64 bytes = 16 words)
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
var k_pad: array<u32, 16>;
k_pad[0] = key[0];
k_pad[1] = key[1];
k_pad[2] = key[2];
k_pad[3] = key[3];
for (var i = 4u; i < 16u; i++) {
k_pad[i] = 0u;
}
// Inner hash: SHA256((K' ^ ipad) || message)
// First block: K' ^ ipad (64 bytes)
var inner_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
inner_block[i] = k_pad[i] ^ 0x36363636u;
}
// Initialize hash state with first block
var h: array<u32, 8> = sha256_block(&inner_block);
// Process ciphertext blocks (continuing from h state)
let ciphertext_words = params.ciphertext_words;
var word_idx = 0u;
// Process full 64-byte blocks of ciphertext
while (word_idx + 16u <= ciphertext_words) {
var block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
block[i] = ciphertext[word_idx + i];
}
h = sha256_block_continue(&block, h);
word_idx = word_idx + 16u;
}
// Final block with remaining ciphertext + padding
var final_block: array<u32, 16>;
var remaining = ciphertext_words - word_idx;
for (var i = 0u; i < 16u; i++) {
if (i < remaining) {
final_block[i] = ciphertext[word_idx + i];
} else if (i == remaining) {
// Add 0x80 padding
final_block[i] = 0x80000000u;
} else {
final_block[i] = 0u;
}
}
// Add length (64 bytes of ipad + ciphertext length)
let total_bits = 512u + params.ciphertext_len_bits;
if (remaining < 14u) {
final_block[14] = 0u;
final_block[15] = total_bits;
h = sha256_block_continue(&final_block, h);
} else {
// Need extra block for length
h = sha256_block_continue(&final_block, h);
var len_block: array<u32, 16>;
for (var i = 0u; i < 14u; i++) {
len_block[i] = 0u;
}
len_block[14] = 0u;
len_block[15] = total_bits;
h = sha256_block_continue(&len_block, h);
}
let inner_hash = h;
// Outer hash: SHA256((K' ^ opad) || inner_hash)
var outer_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
}
h = sha256_block(&outer_block);
// Second block: inner_hash (32 bytes) + padding
var hash_block: array<u32, 16>;
for (var i = 0u; i < 8u; i++) {
hash_block[i] = inner_hash[i];
}
hash_block[8] = 0x80000000u;
for (var i = 9u; i < 14u; i++) {
hash_block[i] = 0u;
}
hash_block[14] = 0u;
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
h = sha256_block_continue(&hash_block, h);
// Return first 2 bytes (high 16 bits of first word)
return h[0] & 0xFFFF0000u;
}
// SHA256 block computation continuing from existing state
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
var h = h_in;
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Process a single candidate and record match if found
fn process_candidate(name_idx: u32) {
// Generate message for this room name
var msg: array<u32, 16>;
let valid = index_to_room_name(name_idx, params.name_length, &msg);
if (!valid) {
return;
}
// Compute SHA256("#roomname") - this gives us the key
let key_hash = sha256_block(&msg);
// Take first 16 bytes (4 words) as the key
var key: array<u32, 4>;
key[0] = key_hash[0];
key[1] = key_hash[1];
key[2] = key_hash[2];
key[3] = key_hash[3];
// Compute SHA256(key) to get channel hash
let channel_hash = sha256_key(key);
// Check if channel hash matches target
if (channel_hash != params.target_channel_hash) {
return;
}
// Channel hash matches - verify MAC if enabled
if (params.verify_mac == 1u) {
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
if (computed_mac != params.target_mac) {
return;
}
}
// Found a match - record the index
let match_idx = atomicAdd(&match_count, 1u);
if (match_idx < 1024u) { // Limit stored matches
match_indices[match_idx] = name_idx;
}
}
// Each thread processes 16 candidates to amortize thread overhead
const CANDIDATES_PER_THREAD: u32 = 16u;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
let idx = base_idx + i;
if (idx >= params.batch_size) {
return;
}
let name_idx = params.batch_offset + idx;
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const a=await navigator.gpu.requestAdapter();if(!a)return console.warn("No GPU adapter found"),!1;this.device=await a.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let u=0;u<2;u++)this.matchCountReadBuffers[u]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[u]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:o,entryPoint:"main"}}),!0}catch(a){return console.error("WebGPU initialization failed:",a),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(a,o){return Yn(o,a)}countNamesForLength(a){return Ma(a)}async runBatch(a,o,s,u,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const c=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const h=this.matchCountReadBuffers[c],d=this.matchIndicesReadBuffers[c],p=l&&A?1:0;let x,g=0,C=0;if(p){const B=new Uint8Array(l.length/2);for(let M=0;M<B.length;M++)B[M]=parseInt(l.substr(M*2,2),16);g=B.length*8;const T=Math.ceil(B.length/4)*4,N=new Uint8Array(T);N.set(B),x=new Uint32Array(T/4);for(let M=0;M<x.length;M++)x[M]=N[M*4]<<24|N[M*4+1]<<16|N[M*4+2]<<8|N[M*4+3];const P=parseInt(A.substr(0,2),16),L=parseInt(A.substr(2,2),16);C=P<<24|L<<16}else x=new Uint32Array([0]);const w=Math.max(x.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<w)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:w,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=w,this.bindGroupDirty=!0);const y=new Uint32Array([a,s,o,u,C,x.length,g,p]);this.device.queue.writeBuffer(this.paramsBuffer,0,y),this.device.queue.writeBuffer(this.ciphertextBuffer,0,x),this.device.queue.writeBuffer(this.matchCountBuffer,0,vl.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const v=this.device.createCommandEncoder(),E=v.beginComputePass();E.setPipeline(this.pipeline),E.setBindGroup(0,this.bindGroup),E.dispatchWorkgroups(Math.ceil(u/(256*16))),E.end(),v.copyBufferToBuffer(this.matchCountBuffer,0,h,0,4),v.copyBufferToBuffer(this.matchIndicesBuffer,0,d,0,1024*4),this.device.queue.submit([v.finish()]),await h.mapAsync(GPUMapMode.READ);const b=new Uint32Array(h.getMappedRange())[0];h.unmap();const R=[];if(b>0){await d.mapAsync(GPUMapMode.READ);const B=new Uint32Array(d.getMappedRange());for(let T=0;T<Math.min(b,1024);T++)R.push(B[T]);d.unmap()}return R}destroy(){var a,o,s,u,l,A,c,h;(a=this.paramsBuffer)==null||a.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(s=this.matchIndicesBuffer)==null||s.destroy(),(u=this.ciphertextBuffer)==null||u.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(A=this.matchCountReadBuffers[1])==null||A.destroy(),(c=this.matchIndicesReadBuffers[0])==null||c.destroy(),(h=this.matchIndicesReadBuffers[1])==null||h.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}vl.ZERO_DATA=new Uint32Array([0]);function Yw(){return typeof navigator<"u"&&"gpu"in navigator}class Vh{runBatch(a,o,s,u,l,A){const c=[],h=a.toString(16).padStart(2,"0") Line truncated
`).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);this.wordlist=u.filter(Uh)}setWordlist(a){this.wordlist=a.map(o=>o.trim().toLowerCase()).filter(Uh)}abort(){this.abortFlag=!0}isGpuAvailable(){return Yw()}async decodePacket(a){var s;const o=a.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const l=(s=(await Lh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:s.decoded;return!(l!=null&&l.channelHash)||!(l!=null&&l.ciphertext)||!(l!=null&&l.cipherMac)?null:{channelHash:l.channelHash,ciphertext:l.ciphertext,cipherMac:l.cipherMac,isGroupText:!0}}catch{return null}}async crack(a,o,s){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0,this.validSeconds=(o==null?void 0:o.validSeconds)??Mu,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const u=(o==null?void 0:o.maxLength)??8,l=(o==null?void 0:o.startingLength)??1,A=(o==null?void 0:o.useDictionary)??!0,c=(o==null?void 0:o.startFromType)??"bruteforce",h=a.toLowerCase(),d=await this.decodePacket(h);if(!d)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:p,ciphertext:x,cipherMac:g}=d,C=parseInt(p,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new Vh):this.gpuInstance||(this.gpuInstance=new vl,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new Vh));const w=performance.now();let y=0,v=performance.now(),E=l,k=0,b=0,R=!1;if(o!=null&&o.startFrom){const V=o.startFrom.toLowerCase();if(c==="dictionary"){const Y=this.wordlist.indexOf(V);Y>=0&&(b=Y+1)}else{R=!0;const Y=Gw(V);Y&&(E=Math.max(l,Y.length),k=Y.index+1,k>=Ma(E)&&(E++,k=0))}}let B=0;A&&!R&&this.wordlist.length>0&&(B+=this.wordlist.length-b);for(let V=E;V<=u;V++)B+=Ma(V);B-=k;const T=(V,Y,re)=>{if(!s)return;const ne=(performance.now()-w)/1e3,W=ne>0?Math.round(y/ne):0,oe=B-y,J=W>0?oe/W:0;s({checked:y,total:B,percent:B>0?Math.min(100,y/B*100):0,rateKeysPerSec:W,etaSeconds:J,elapsedSeconds:ne,currentLength:Y,currentPosition:re,phase:V})},N=V=>{if(!tm(x,g,V))return{valid:!1};const Y=Lh.ChannelCrypto.decryptGroupTextMessage(x,g,V);return!Y.success||!Y.data?{valid:!1}:this.useTimestampFilter&&!Qw(Y.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Kw(Y.data.message)?{valid:!1}:{valid:!0,message:Y.data.message}};if(!R&&b===0&&E===l&&k===0){T("public-key",0,Iu);const V=Ou(Ki);if(p===V){const Y=N(Ki);if(Y.valid)return{found:!0,roomName:Iu,key:Ki,decryptedMessage:Y.message}}}if(A&&!R&&this.wordlist.length>0)for(let V=b;V<this.wordlist.length;V++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[V],resumeType:"dictionary"};const Y=this.wordlist[V],re=ju("#"+Y),X=Ou(re);if(parseInt(X,16)===C){const W=N(re);if(W.valid)return{found:!0,roomName:Y,key:re,decryptedMessage:W.message,resumeFrom:Y,resumeType:"dictionary"}}y++;const ne=performance.now();ne-v>=200&&(T("wordlist",Y.length,Y),v=ne,await new Promise(W=>setTimeout(W,0)))}const P=this.useCpu?1024:32768,L=(o==null?void 0:o.gpuDispatchMs)??1e3;let M=P,I=!1;for(let V=E;V<=u;V++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Yn(V,0)||void 0,resumeType:"bruteforce"};const Y=Ma(V);let re=V===E?k:0;for(;re<Y;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Yn(V,re)||void 0,resumeType:"bruteforce"};const X=Math.min(M,Y-re),ne=performance.now();let W;this.useCpu?W=this.cpuInstance.runBatch(C,V,re,X,x,g):W=await this.gpuInstance.runBatch(C,V,re,X,x,g);const oe=performance.now()-ne;if(y+=X,!this.useCpu&&!I&&X>=P&&oe>0){const S=L/oe,O=Math.round(X*S),z=Math.pow(2,Math.round(Math.log2(Math.max(P,O))));M=Math.max(P,z),I=!0}for(const S of W){const O=Yn(V,S);if(!O)continue;const z=ju("#"+O),q=N(z);if(q.valid)return{found:!0,roomName:O,key:z,decryptedMessage:q.message,resumeFrom:O,resumeType:"bruteforce"}}re+=X;const J=performance.now();if(J-v>=200){const S=Yn(V,Math.min(re,Y-1))||"";T("bruteforce",V,S),v=J,await new Promise(O=>setTimeout(O,0))}}}return{found:!1,resumeFrom:Yn(u,Ma(u)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var wu,Wh;function tb(){return Wh||(Wh=1,wu={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBA Line truncated
NoSleep enabled for older iOS devices. This can interrupt
active or long-running network requests from completing successfully.
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(c=>(this.enabled=!0,c)).catch(c=>{throw this.enabled=!1,c})}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):o()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return bu=u,bu}var nb=rb();const ob=Io(nb);function ab(r){if(r.length<4)return null;try{const o=parseInt(r.slice(0,2),16)&3;let s=2;if(o===0||o===3){if(r.length<s+8)return null;s+=8}if(r.length<s+2)return null;const u=parseInt(r.slice(s,s+2),16);s+=2;const l=u*2;return r.length<s+l?null:(s+=l,r.slice(s))}catch{return null}}function sb({packets:r,channels:a,onChannelCreate:o,onRunningChange:s,visible:u=!1}){const[l,A]=D.useState(!1),[c,h]=D.useState(6),[d,p]=D.useState(!1),[x,g]=D.useState(!0),[C,w]=D.useState(!1),[y,v]=D.useState(null),[E,k]=D.useState(new Map),[b,R]=D.useState([]),[B,T]=D.useState(!1),[N,P]=D.useState(null),[L,M]=D.useState(null),[I,$]=D.useState(0),V=D.useRef(null),Y=D.useRef(null),re=D.useRef(!1),X=D.useRef(!1),ne=D.useRef(!1),W=D.useRef(new Map),oe=D.useRef(!1),J=D.useRef(6),S=D.useRef(!0),O=D.useRef(!1),z=D.useRef(new Set),q=D.useRef(new Set);D.useEffect(()=>{const pe=new eb;V.current=pe,P(pe.isGpuAvailable());const Fe=new ob;return Y.current=Fe,()=>{pe.destroy(),V.current=null,Fe.disable(),Y.current=null}},[]),D.useEffect(()=>{!u||B||XC(async()=>{const{ENGLISH_WORDLIST:pe}=await import("./wordlist-BV_32SRm.js");return{ENGLISH_WORDLIST:pe}},[]).then(({ENGLISH_WORDLIST:pe})=>{V.current&&(V.current.setWordlist(pe),T(!0))}).catch(pe=>{console.error("Failed to load wordlist:",pe),ut.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[u,B]),D.useEffect(()=>{const pe=()=>{Oe.getUndecryptedPacketCount().then(({count:Ie})=>M(Ie)).catch(()=>M(null))};pe();const Fe=setInterval(pe,3e4);return()=>clearInterval(Fe)},[]);const ce=new Set(a.map(pe=>pe.key.toUpperCase())),fe=r.filter(pe=>pe.payload_type==="GROUP_TEXT"&&!pe.decrypted);D.useEffect(()=>{let pe=0;k(Fe=>{const Ie=new Map(Fe);let dt=!1;for(const Qe of fe)if(!Ie.has(Qe.id)){const et=ab(Qe.data);if(et&&q.current.has(et)){pe++;continue}et&&q.current.add(et),Ie.set(Qe.id,{packet:Qe,attempts:0,lastAttemptLength:0,status:"pending"}),dt=!0}return dt?(W.current=Ie,Ie):Fe}),pe>0&&$(Fe=>Fe+pe)},[fe.length]),D.useEffect(()=>{W.current=E},[E]),D.useEffect(()=>{oe.current=d},[d]),D.useEffect(()=>{J.current=c},[c]),D.useEffect(()=>{S.current=x},[x]),D.useEffect(()=>{O.current=C},[C]),D.useEffect(()=>{z.current=new Set(fe.map(pe=>pe.id))},[fe]),D.useEffect(()=>{s==null||s(l)},[l,s]);const he=Array.from(E.values()).filter(pe=>pe.status==="pending").length,ae=Array.from(E.values()).filter(pe=>pe.status==="cracked").length,De=Array.from(E.values()).filter(pe=>pe.status==="failed").length,Ne=D.useCallback(async()=>{if(ne.current||!V.current||!re.current)return;const pe=W.current;let Fe=null,Ie=null;for(const[Te,Ue]of pe.entries())if(Ue.status==="pending"){Fe=Ue,Ie=Te;break}if(!Fe&&oe.current){const Te=Array.from(pe.entries()).filter(([,Ue])=>Ue.status==="failed"&&Ue.lastAttemptLength<10);Te.length>0&&(Te.sort((Ue,Le)=>Ue[1].lastAttemptLength-Le[1].lastAttemptLength),[Ie,Fe]=Te[0])}if(!Fe||Ie===null){re.current&&setTimeout(()=>Ne(),1e3);return}if(!z.current.has(Ie)){k(Te=>{const Ue=new Map(Te);return Ue.delete(Ie),Ue}),re.current&&setTimeout(()=>Ne(),10);return}ne.current=!0;const dt=J.current,Qe=Fe.lastAttemptLength>0,et=Qe?Fe.lastAttemptLength+1:dt;try{const Te=await V.current.crack(Fe.packet.data,{maxLength:et,useTimestampFilter:!0,useUtf8Filter:!0,...O.current&&{gpuDispatchMs:1e4},...Qe&&{useDictionary:!1,startingLength:et}},Ue=>{v(Ue)});if(X.current){X.current=!1,ne.current=!1,v(null);return}if(Te.found&&Te.roomName&&Te.key){k(ke=>{const rt=new Map(ke),Ft=rt.get(Ie);return Ft&&rt.set(Ie,{...Ft,status:"cracked",attempts:Ft.attempts+1,lastAttemptLength:et}),rt});const Ue={roomName:Te.roomName,key:Te.key,packetId:Ie,message:Te.decryptedMessage||"",crackedAt:Date.now()};R(ke=>[...ke,Ue]);const Le=Te.key.toUpperCase();if(!ce.has(Le))try{const ke="#"+Te.roomName;await o(ke,Te.key),S.current&&await Oe.decryptHistoricalPackets({key_type:"channel",channel_name:ke})}catch(ke){console.error("Failed to create channel or decrypt historical:",ke),ut.error("Failed to save cracked channel",{description:ke instanceof Error?ke.message:"Channel discovered but could not be saved"})}}else k(Ue=>{const Le=new Map(Ue),ke=Le.get(Ie);return ke&&Le.set(Ie,{...ke,status:"failed",attempts:ke.attempts+1,lastAttemptLength:et}),Le})}catch(Te){console.error("Cracking error:",Te),k(Ue=>{const Le=new Map(Ue),ke=Le.get(Ie);return ke&&Le.set(Ie,{...ke,status:"failed",attempts:ke.attempts+1,lastAttemptLength:et}),Le})}ne.current=!1,v(null),re.current&&setTimeout(()=>Ne(),100)},[ce,o]),at=()=>{var pe;if(!N){ut.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}A(!0),re.current=!0,X.current=!1,(pe=Y.current)==null||pe.enable(),Ne()},tt=()=>{var pe,Fe;A(!1),re.current=!1,X.current=!0,(pe=V.current)==null||pe.abort(),(Fe=Y.current)==null||Fe.disable()};return _.jsxs("div",{className Line truncated
+1
View File
@@ -0,0 +1 @@
const e=["2","1080","10-point","10th","11-point","12-point","16-point","18-point","1st","20-point","2d","2nd","30-30","3d","3-d","3m","3rd","48-point","4-d","4gl","4h","4th","5-point","5-t","5th","6-point","6th","7-point","7th","8-point","8th","9-point","9th","a","a1","a-1","a4","a5","aa","aaa","aaaa","aaaaaa","aaal","aaas","aaberg","aachen","aae","aaee","aaf","aag","aah","aahed","aahing","aahs","aaii","aal","aalborg","aalesund","aalii","aaliis","aals","aalst","aalto","aam","aamsi","aandahl","a-and-r","aani","aao","aap","aapss","aaqbiye","aar","aara","aarau","aarc","aardvark","aardvarks","aardwolf","aardwolves","aaren","aargau","aargh","aarhus","aarika","aaron","aaronic","aaronical","aaronite","aaronitic","aaronsburg","aaronson","aarp","aarrgh","aarrghh","aaru","aas","aasvogel","aasvogels","aau","aaup","aauw","aavso","aax","a-axes","a-axis","ab","aba","ababa","ababdeh","ababua","abac","abaca","abacay","abacas","abacate","abacaxi","abaci","abacinate","abacination","abacisci","abaciscus","abacist","aback","abacli","abaco","abacot","abacterial","abactinal","abactinally","abaction","abactor","abaculi","abaculus","abacus","abacuses","abad","abada","abadan","abaddon","abadejo","abadengo","abadia","abadite","abaff","abaft","abagael","abagail","abagtha","abay","abayah","abailard","abaisance","abaised","abaiser","abaisse","abaissed","abaka","abakan","abakas","abakumov","abalation","abalienate","abalienated","abalienating","abalienation","abalone","abalones","abama","abamp","abampere","abamperes","abamps","abana","aband","abandon","abandonable","abandoned","abandonedly","abandonee","abandoner","abandoners","abandoning","abandonment","abandonments","abandons","abandum","abanet","abanga","abanic","abannition","abantes","abapical","abaptiston","abaptistum","abarambo","abarbarea","abaris","abarthrosis","abarticular","abarticulation","abas","abase","abased","abasedly","abasedness","abasement","abasements","abaser","abasers","abases","abasgi","abash","abashed","abashedly","abashedness","abashes","abashing","abashless","abashlessly","abashment","abashments","abasia","abasias","abasic","abasing","abasio","abask","abassi","abassieh","abassin","abastard","abastardize","abastral","abatable","abatage","abate","abated","abatement","abatements","abater","abaters","abates","abatic","abating","abatis","abatised","abatises","abatjour","abatjours","abaton","abator","abators","abats","abattage","abattis","abattised","abattises","abattoir","abattoirs","abattu","abattue","abatua","abature","abaue","abave","abaxial","abaxile","abaze","abb","abba","abbacy","abbacies","abbacomes","abbadide","abbai","abbaye","abbandono","abbas","abbasi","abbasid","abbassi","abbassid","abbasside","abbate","abbatial","abbatical","abbatie","abbe","abbey","abbeys","abbeystead","abbeystede","abbes","abbess","abbesses","abbest","abbevilean","abbeville","abbevillian","abbi","abby","abbie","abbye","abbyville","abboccato","abbogada","abbot","abbotcy","abbotcies","abbotnullius","abbotric","abbots","abbotsen","abbotsford","abbotship","abbotships","abbotson","abbotsun","abbott","abbottson","abbottstown","abboud","abbozzo","abbr","abbrev","abbreviatable","abbreviate","abbreviated","abbreviately","abbreviates","abbreviating","abbreviation","abbreviations","abbreviator","abbreviatory","abbreviators","abbreviature","abbroachment","abc","abcess","abcissa","abcoulomb","abcs","abd","abdal","abdali","abdaria","abdat","abdel","abd-el-kadir","abd-el-krim","abdella","abderhalden","abderian","abderite","abderus","abdest","abdias","abdicable","abdicant","abdicate","abdicated","abdicates","abdicating","abdication","abdications","abdicative","abdicator","abdiel","abditive","abditory","abdom","abdomen","abdomens","abdomina","abdominal","abdominales","abdominalia","abdominalian","abdominally","abdominals","abdominoanterior","abdominocardiac","abdominocentesis","abdominocystic","abdominogenital","abdominohysterectomy","abdominohysterotomy","abdominoposterior","abdominoscope","abdominoscopy","abdominothoracic","abdominous","abdomino-uterotomy","abdominovaginal","abdominovesical","abdon","abdu","abduce","abduced","abducens","abducent","abducentes","abduces","abducing","abduct","abducted","abducting","abduction","abductions","abductor","abductores","abductors","abducts","abdul","abdul-aziz","abdul-baha","abdulla","abe","a-be","abeam","abear","abearance","abebi","abecedaire","abecedary","abecedaria","abecedarian","abecedarians","abecedaries","abecedarium","abecedarius","abed","abede","abedge","abednego","abegge","abey","abeyance","abeyances","abeyancy","abeyancies","abeyant","abeigh","abel","abelard","abele","abeles","abelia","abelian","abelicea","abelite","abell","abelmoschus","abelmosk","abelmosks","abelmusk","abelonian","abelson","abeltree","abencerrages","abend","abends","abenezra","abenteric","abeokuta","abepithymia","abepp","abercromby","abercrombie","aberdare","aberdavine","aberdeen","aberdeenshire","aberdevine","aberdonian","aberduvine","aberfan","aberglaube","aberia","aberystwyth",Line truncated
+2 -2
View File
@@ -13,8 +13,8 @@
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<script type="module" crossorigin src="/assets/index-CUZgfnRO.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-49wEGwkK.css">
<script type="module" crossorigin src="/assets/index-DKdsyLDV.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bk7xCS0b.css">
</head>
<body>
<div id="root"></div>
+1
View File
@@ -633,6 +633,7 @@ export function App() {
<CrackerPanel
packets={rawPackets}
channels={channels}
visible={showCracker}
onChannelCreate={async (name, key) => {
const created = await api.createChannel(name, key);
const data = await api.getChannels();
+21 -6
View File
@@ -1,6 +1,5 @@
import { useState, useEffect, useRef, useCallback } from 'react';
import { GroupTextCracker, type ProgressReport } from 'meshcore-hashtag-cracker';
import { ENGLISH_WORDLIST } from 'meshcore-hashtag-cracker/wordlist';
import NoSleep from 'nosleep.js';
import type { RawPacket, Channel } from '../types';
import { api } from '../api';
@@ -62,9 +61,10 @@ interface CrackerPanelProps {
channels: Channel[];
onChannelCreate: (name: string, key: string) => Promise<void>;
onRunningChange?: (running: boolean) => void;
visible?: boolean;
}
export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChange }: CrackerPanelProps) {
export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChange, visible = false }: CrackerPanelProps) {
const [isRunning, setIsRunning] = useState(false);
const [maxLength, setMaxLength] = useState(6);
const [retryFailedAtNextLength, setRetryFailedAtNextLength] = useState(false);
@@ -100,10 +100,6 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
const noSleep = new NoSleep();
noSleepRef.current = noSleep;
// Use built-in wordlist
cracker.setWordlist(ENGLISH_WORDLIST);
setWordlistLoaded(true);
return () => {
cracker.destroy();
crackerRef.current = null;
@@ -112,6 +108,25 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
};
}, []);
// Load wordlist dynamically when panel becomes visible for the first time
useEffect(() => {
if (!visible || wordlistLoaded) return;
import('meshcore-hashtag-cracker/wordlist')
.then(({ ENGLISH_WORDLIST }) => {
if (crackerRef.current) {
crackerRef.current.setWordlist(ENGLISH_WORDLIST);
setWordlistLoaded(true);
}
})
.catch((err) => {
console.error('Failed to load wordlist:', err);
toast.error('Failed to load wordlist', {
description: 'Cracking will not be available',
});
});
}, [visible, wordlistLoaded]);
// Fetch undecrypted packet count
useEffect(() => {
const fetchCount = () => {