mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-10-23 01:41:15 +00:00
Expand our repeat-watch time
This commit is contained in:
1 parent
4bc51f82da
commit
ff6b25c0e5
7 files changed
+581
-550
No files matched your search
-542
@@ -1,542 +0,0 @@
|
||||
var gy=Object.defineProperty;var xy=(n,s,i)=>s in n?gy(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i;var Wo=(n,s,i)=>xy(n,typeof s!="symbol"?s+"":s,i);function Ay(n,s){for(var i=0;i<s.length;i++){const l=s[i];if(typeof l!="string"&&!Array.isArray(l)){for(const c in l)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(l,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>l[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const p of u.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();var Kf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function gx(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var s=n.default;if(typeof s=="function"){var i=function l(){return this instanceof l?Reflect.construct(s,arguments,this.constructor):s.apply(this,arguments)};i.prototype=s.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(l){var c=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(i,l,c.get?c:{enumerable:!0,get:function(){return n[l]}})}),i}var Qf={exports:{}},el={},Yf={exports:{}},ht={};/**
|
||||
* @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 $p;function vy(){if($p)return ht;$p=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),p=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),A=Symbol.iterator;function _(N){return N===null||typeof N!="object"?null:(N=A&&N[A]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,C={};function b(N,O,G){this.props=N,this.context=O,this.refs=C,this.updater=G||k}b.prototype.isReactComponent={},b.prototype.setState=function(N,O){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,O,"setState")},b.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function B(){}B.prototype=b.prototype;function S(N,O,G){this.props=N,this.context=O,this.refs=C,this.updater=G||k}var P=S.prototype=new B;P.constructor=S,D(P,b.prototype),P.isPureReactComponent=!0;var F=Array.isArray,M=Object.prototype.hasOwnProperty,H={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function z(N,O,G){var Q,ue={},pe=null,ve=null;if(O!=null)for(Q in O.ref!==void 0&&(ve=O.ref),O.key!==void 0&&(pe=""+O.key),O)M.call(O,Q)&&!V.hasOwnProperty(Q)&&(ue[Q]=O[Q]);var me=arguments.length-2;if(me===1)ue.children=G;else if(1<me){for(var Le=Array(me),Ke=0;Ke<me;Ke++)Le[Ke]=arguments[Ke+2];ue.children=Le}if(N&&N.defaultProps)for(Q in me=N.defaultProps,me)ue[Q]===void 0&&(ue[Q]=me[Q]);return{$$typeof:n,type:N,key:pe,ref:ve,props:ue,_owner:H.current}}function te(N,O){return{$$typeof:n,type:N.type,key:O,ref:N.ref,props:N.props,_owner:N._owner}}function Z(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function U(N){var O={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(G){return O[G]})}var K=/\/+/g;function W(N,O){return typeof N=="object"&&N!==null&&N.key!=null?U(""+N.key):O.toString(36)}function X(N,O,G,Q,ue){var pe=typeof N;(pe==="undefined"||pe==="boolean")&&(N=null);var ve=!1;if(N===null)ve=!0;else switch(pe){case"string":case"number":ve=!0;break;case"object":switch(N.$$typeof){case n:case s:ve=!0}}if(ve)return ve=N,ue=ue(ve),N=Q===""?"."+W(ve,0):Q,F(ue)?(G="",N!=null&&(G=N.replace(K,"$&/")+"/"),X(ue,O,G,"",function(Ke){return Ke})):ue!=null&&(Z(ue)&&(ue=te(ue,G+(!ue.key||ve&&ve.key===ue.key?"":(""+ue.key).replace(K,"$&/")+"/")+N)),O.push(ue)),1;if(ve=0,Q=Q===""?".":Q+":",F(N))for(var me=0;me<N.length;me++){pe=N[me];var Le=Q+W(pe,me);ve+=X(pe,O,G,Le,ue)}else if(Le=_(N),typeof Le=="function")for(N=Le.call(N),me=0;!(pe=N.next()).done;)pe=pe.value,Le=Q+W(pe,me++),ve+=X(pe,O,G,Le,ue);else if(pe==="object")throw O=String(N),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return ve}function oe(N,O,G){if(N==null)return N;var Q=[],ue=0;return X(N,Q,"","",function(pe){return O.call(G,pe,ue++)}),Q}function J(N){if(N._status===-1){var O=N._result;O=O(),O.then(function(G){(N._status===0||N._status===-1)&&(N._status=1,N._result=G)},function(G){(N._status===0||N._status===-1)&&(N._status=2,N._result=G)}),N._status===-1&&(N._status=0,N._result=O)}if(N._status===1)return N._result.default;throw N._result}var ae={current:null},$={transition:null},he={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:$,ReactCurrentOwner:H};function q(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:oe,forEach:function(N,O,G){oe(N,function(){O.apply(this,arguments)},G)},count:function(N){var O=0;return oe(N,function(){O++}),O},toArray:function(N){return oe(N,function(O){return O})||[]},only:function(N){if(!Z(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},ht.Component=b,ht.Fragment=i,ht.Profiler=c,ht.PureComponent=S,ht.StrictMode=l,ht.Suspense=g,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=he,ht.act=q,ht.cloneElement=function(N,O,G){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var Q=D({},N.props),ue=N.key,pe=N.ref,ve=N._owner;if(O!=null){if(O.ref!==void 0&&(pe=O.ref,ve=H.current),O.key!==void 0&&(ue=""+O.key),N.type&&N.type.defaultProps)var me=N.type.defaultProps;for(Le in O)M.call(O,Le)&&!V.hasOwnProperty(Le)&&(Q[Le]=O[Le]===void 0&&me!==void 0?me[Le]:O[Le])}var Le=arguments.length-2;if(Le===1)Q.children=G;else if(1<Le){me=Array(Le);for(var Ke=0;Ke<Le;Ke++)me[Ke]=arguments[Ke+2];Q.children=me}return{$$typeof:n,type:N.type,key:ue,ref:pe,props:Q,_owner:ve}},ht.createContLine 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 Qp;function yy(){if(Qp)return el;Qp=1;var n=M0(),s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function p(d,g,m){var x,A={},_=null,k=null;m!==void 0&&(_=""+m),g.key!==void 0&&(_=""+g.key),g.ref!==void 0&&(k=g.ref);for(x in g)l.call(g,x)&&!u.hasOwnProperty(x)&&(A[x]=g[x]);if(d&&d.defaultProps)for(x in g=d.defaultProps,g)A[x]===void 0&&(A[x]=g[x]);return{$$typeof:s,type:d,key:_,ref:k,props:A,_owner:c.current}}return el.Fragment=i,el.jsx=p,el.jsxs=p,el}var Yp;function _y(){return Yp||(Yp=1,Qf.exports=yy()),Qf.exports}var w=_y(),R=M0();const ke=aa(R),I0=Ay({__proto__:null,default:ke},[R]);var Vc={},Xf={exports:{}},Kn={},Jf={exports:{}},e0={};/**
|
||||
* @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 Xp;function wy(){return Xp||(Xp=1,(function(n){function s($,he){var q=$.length;$.push(he);e:for(;0<q;){var N=q-1>>>1,O=$[N];if(0<c(O,he))$[N]=he,$[q]=O,q=N;else break e}}function i($){return $.length===0?null:$[0]}function l($){if($.length===0)return null;var he=$[0],q=$.pop();if(q!==he){$[0]=q;e:for(var N=0,O=$.length,G=O>>>1;N<G;){var Q=2*(N+1)-1,ue=$[Q],pe=Q+1,ve=$[pe];if(0>c(ue,q))pe<O&&0>c(ve,ue)?($[N]=ve,$[pe]=q,N=pe):($[N]=ue,$[Q]=q,N=Q);else if(pe<O&&0>c(ve,q))$[N]=ve,$[pe]=q,N=pe;else break e}}return he}function c($,he){var q=$.sortIndex-he.sortIndex;return q!==0?q:$.id-he.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var p=Date,d=p.now();n.unstable_now=function(){return p.now()-d}}var g=[],m=[],x=1,A=null,_=3,k=!1,D=!1,C=!1,b=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P($){for(var he=i(m);he!==null;){if(he.callback===null)l(m);else if(he.startTime<=$)l(m),he.sortIndex=he.expirationTime,s(g,he);else break;he=i(m)}}function F($){if(C=!1,P($),!D)if(i(g)!==null)D=!0,J(M);else{var he=i(m);he!==null&&ae(F,he.startTime-$)}}function M($,he){D=!1,C&&(C=!1,B(z),z=-1),k=!0;var q=_;try{for(P(he),A=i(g);A!==null&&(!(A.expirationTime>he)||$&&!U());){var N=A.callback;if(typeof N=="function"){A.callback=null,_=A.priorityLevel;var O=N(A.expirationTime<=he);he=n.unstable_now(),typeof O=="function"?A.callback=O:A===i(g)&&l(g),P(he)}else l(g);A=i(g)}if(A!==null)var G=!0;else{var Q=i(m);Q!==null&&ae(F,Q.startTime-he),G=!1}return G}finally{A=null,_=q,k=!1}}var H=!1,V=null,z=-1,te=5,Z=-1;function U(){return!(n.unstable_now()-Z<te)}function K(){if(V!==null){var $=n.unstable_now();Z=$;var he=!0;try{he=V(!0,$)}finally{he?W():(H=!1,V=null)}}else H=!1}var W;if(typeof S=="function")W=function(){S(K)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,oe=X.port2;X.port1.onmessage=K,W=function(){oe.postMessage(null)}}else W=function(){b(K,0)};function J($){V=$,H||(H=!0,W())}function ae($,he){z=b(function(){$(n.unstable_now())},he)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_continueExecution=function(){D||k||(D=!0,J(M))},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_getFirstCallbackNode=function(){return i(g)},n.unstable_next=function($){switch(_){case 1:case 2:case 3:var he=3;break;default:he=_}var q=_;_=he;try{return $()}finally{_=q}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function($,he){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var q=_;_=$;try{return he()}finally{_=q}},n.unstable_scheduleCallback=function($,he,q){var N=n.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?N+q:N):q=N,$){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=q+O,$={id:x++,callback:he,priorityLevel:$,startTime:q,expirationTime:O,sortIndex:-1},q>N?($.sortIndex=q,s(m,$),i(g)===null&&$===i(m)&&(C?(B(z),z=-1):C=!0,ae(F,q-N))):($.sortIndex=O,s(g,$),D||k||(D=!0,J(M))),$},n.unstable_shouldYield=U,n.unstable_wrapCallback=function($){var he=_;return function(){var q=_;_=he;try{return $.apply(this,arguments)}finally{_=q}}}})(e0)),e0}var Jp;function by(){return Jp||(Jp=1,Jf.exports=wy()),Jf.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 em;function Cy(){if(em)return Kn;em=1;var n=M0(),s=by();function i(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,c={};function u(e,r){p(e,r),p(e+"Capture",r)}function p(e,r){for(c[e]=r,e=0;e<r.length;e++)l.add(r[e])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,x={},A={};function _(e){return g.call(A,e)?!0:g.call(x,e)?!1:m.test(e)?A[e]=!0:(x[e]=!0,!1)}function k(e,r,a,h){if(a!==null&&a.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return h?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,r,a,h){if(r===null||typeof r>"u"||k(e,r,a,h))return!0;if(h)return!1;if(a!==null)switch(a.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function C(e,r,a,h,y,E,I){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=h,this.attributeNamespace=y,this.mustUseProperty=a,this.propertyName=e,this.type=r,this.sanitizeURL=E,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];b[r]=new C(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new C(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){b[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function S(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 r=e.replace(B,S);b[r]=new C(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(B,S);b[r]=new C(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(B,S);b[r]=new C(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,r,a,h){var y=b.hasOwnProperty(r)?b[r]:null;(y!==null?y.type!==0:h||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=
Line truncated
|
||||
`+N+e}var G=!1;function Q(e,r){if(!e||G)return"";G=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(fe){var h=fe}Reflect.construct(e,[],r)}else{try{r.call()}catch(fe){h=fe}e.call(r.prototype)}else{try{throw Error()}catch(fe){h=fe}e()}}catch(fe){if(fe&&h&&typeof fe.stack=="string"){for(var y=fe.stack.split(`
|
||||
`),E=h.stack.split(`
|
||||
`),I=y.length-1,Y=E.length-1;1<=I&&0<=Y&&y[I]!==E[Y];)Y--;for(;1<=I&&0<=Y;I--,Y--)if(y[I]!==E[Y]){if(I!==1||Y!==1)do if(I--,Y--,0>Y||y[I]!==E[Y]){var ne=`
|
||||
`+y[I].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=I&&0<=Y);break}}}finally{G=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?O(e):""}function ue(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 pe(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 V:return"Fragment";case H:return"Portal";case te:return"Profiler";case z:return"StrictMode";case W:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case Z:return(e._context.displayName||"Context")+".Provider";case K:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return r=e.displayName||null,r!==null?r:pe(e.type)||"Memo";case J:r=e._payload,e=e._init;try{return pe(e(r))}catch{}}return null}function ve(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(r);case 8:return r===z?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function me(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Le(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ke(e){var r=Le(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),h=""+e[r];if(!e.hasOwnProperty(r)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var y=a.get,E=a.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return y.call(this)},set:function(I){h=""+I,E.call(this,I)}}),Object.defineProperty(e,r,{enumerable:a.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function bt(e){e._valueTracker||(e._valueTracker=Ke(e))}function ct(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),h="";return e&&(h=Le(e)?e.checked?"true":"false":e.value),e=h,e!==a?(r.setValue(e),!0):!1}function Ee(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 Ze(e,r){var a=r.checked;return q({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function lt(e,r){var a=r.defaultValue==null?"":r.defaultValue,h=r.checked!=null?r.checked:r.defaultChecked;a=me(r.value!=null?r.value:a),e._wrapperState={initialChecked:h,initialValue:a,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Mt(e,r){r=r.checked,r!=null&&P(e,"checked",r,!1)}function ut(e,r){Mt(e,r);var a=me(r.value),h=r.type;if(a!=null)h==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?qe(e,r.type,a):r.hasOwnProperty("defaultValue")&&qe(e,r.type,me(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function mt(e,r,a){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var h=r.type;if(!(h!=="submit"&&h!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,a||r===e.value||(e.value=r),e.defaultValue=r}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function qe(e,r,a){(r!=="number"||Ee(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var tt=Array.isArray;function nt(e,r,a,h){if(e=e.options,r){r={};for(var y=0;y<a.length;y++)r["$"+a[y]]=!0;for(a=0;a<e.length;a++)y=r.hasOwnProperty("$"+e[a].value),e[a].selected!==y&&(e[a].selected=y),y&&h&&(e[a].defaultSelected=!0)}else{for(a=""+me(a),r=null,y=0;y<e.length;y++){if(e[y].value===a){e[y].selected=!0,h&&(e[y].defaultSelected=!0);return}r!==null||e[y].disabled||(r=e[y])}r!==null&&(r.selected=!0)}}function Ve(e,r){if(r.dangerouslySetInnerH
Line truncated
|
||||
`).replace(ee,"")}function de(e,r,a){if(r=se(r),se(e)!==r&&a)throw Error(i(425))}function Ae(){}var Pe=null,We=null;function it(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ln=typeof setTimeout=="function"?setTimeout:void 0,rn=typeof clearTimeout=="function"?clearTimeout:void 0,Ln=typeof Promise=="function"?Promise:void 0,Sn=typeof queueMicrotask=="function"?queueMicrotask:typeof Ln<"u"?function(e){return Ln.resolve(null).then(e).catch(Yi)}:ln;function Yi(e){setTimeout(function(){throw e})}function ja(e,r){var a=r,h=0;do{var y=a.nextSibling;if(e.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"){if(h===0){e.removeChild(y),nr(r);return}h--}else a!=="$"&&a!=="$?"&&a!=="$!"||h++;a=y}while(a);nr(r)}function Yr(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function rc(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return e;r--}else a==="/$"&&r++}e=e.previousSibling}return null}var mi=Math.random().toString(36).slice(2),xr="__reactFiber$"+mi,Xi="__reactProps$"+mi,St="__reactContainer$"+mi,Ji="__reactEvents$"+mi,Ud="__reactListeners$"+mi,Zd="__reactHandles$"+mi;function gi(e){var r=e[xr];if(r)return r;for(var a=e.parentNode;a;){if(r=a[St]||a[xr]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=rc(e);e!==null;){if(a=e[xr])return a;e=rc(e)}return r}e=a,a=e.parentNode}return null}function xi(e){return e=e[xr]||e[St],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ai(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Ns(e){return e[Xi]||null}var Wd=[],Fs=-1;function eo(e){return{current:e}}function Ot(e){0>Fs||(e.current=Wd[Fs],Wd[Fs]=null,Fs--)}function Lt(e,r){Fs++,Wd[Fs]=e.current,e.current=r}var to={},Bn=eo(to),Zn=eo(!1),Fo=to;function Ls(e,r){var a=e.type.contextTypes;if(!a)return to;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===r)return h.__reactInternalMemoizedMaskedChildContext;var y={},E;for(E in a)y[E]=r[E];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=y),y}function Wn(e){return e=e.childContextTypes,e!=null}function ic(){Ot(Zn),Ot(Bn)}function gh(e,r,a){if(Bn.current!==to)throw Error(i(168));Lt(Bn,r),Lt(Zn,a)}function xh(e,r,a){var h=e.stateNode;if(r=r.childContextTypes,typeof h.getChildContext!="function")return a;h=h.getChildContext();for(var y in h)if(!(y in r))throw Error(i(108,ve(e)||"Unknown",y));return q({},a,h)}function oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Fo=Bn.current,Lt(Bn,e),Lt(Zn,Zn.current),!0}function Ah(e,r,a){var h=e.stateNode;if(!h)throw Error(i(169));a?(e=xh(e,r,Fo),h.__reactInternalMemoizedMergedChildContext=e,Ot(Zn),Ot(Bn),Lt(Bn,e)):Ot(Zn),Lt(Zn,a)}var vi=null,sc=!1,qd=!1;function vh(e){vi===null?vi=[e]:vi.push(e)}function Lv(e){sc=!0,vh(e)}function no(){if(!qd&&vi!==null){qd=!0;var e=0,r=vt;try{var a=vi;for(vt=1;e<a.length;e++){var h=a[e];do h=h(!0);while(h!==null)}vi=null,sc=!1}catch(y){throw vi!==null&&(vi=vi.slice(e+1)),Nl(pa,no),y}finally{vt=r,qd=!1}}return null}var Ms=[],Is=0,ac=null,lc=0,Ar=[],vr=0,Lo=null,yi=1,_i="";function Mo(e,r){Ms[Is++]=lc,Ms[Is++]=ac,ac=e,lc=r}function yh(e,r,a){Ar[vr++]=yi,Ar[vr++]=_i,Ar[vr++]=Lo,Lo=e;var h=yi;e=_i;var y=32-rt(h)-1;h&=~(1<<y),a+=1;var E=32-rt(r)+y;if(30<E){var I=y-y%5;E=(h&(1<<I)-1).toString(32),h>>=I,y-=I,yi=1<<32-rt(r)+y|a<<y|h,_i=E+e}else yi=1<<E|a<<y|h,_i=e}function Gd(e){e.return!==null&&(Mo(e,1),yh(e,1,0))}function $d(e){for(;e===ac;)ac=Ms[--Is],Ms[Is]=null,lc=Ms[--Is],Ms[Is]=null;for(;e===Lo;)Lo=Ar[--vr],Ar[vr]=null,_i=Ar[--vr],Ar[vr]=null,yi=Ar[--vr],Ar[vr]=null}var ar=null,lr=null,Vt=!1,Nr=null;function _h(e,r){var a=br(5,null,null,0);a.elementType="DELETED",a.stateNode=r,a.return=e,r=e.deletions,r===null?(e.deletions=[a],e.flags|=16):r.push(a)}function wh(e,r){switch(e.tag){case 5:var a=e.type;return r=r.nodeType!==1||a.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,ar=e,lr=Yr(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,ar=e,lr=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=Lo!==null?{id:yi,overflow:_i}:null,e.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=br(18,null,null,0),a.stateNode=r,a.return=e,e.child=a,ar=e,lr=null,!0):!1;default:return!1}}function Kd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qd(e){if(Vt){var r=lr;if(r){var a=r;if(!wh(e,r)){if(Kd(e))throw Error(i(418));r=Yr(a.nextSibling);var h=ar;r&&wh(e,r)?_h(h,a):(e.flags=e.flags&-4097|2,Vt=!1,ar=e)}}else{if(Kd(e))throw Error(i(418));e.flags=e.flags&-4097|2,Vt=!1,ar=e}}}function bh(e){for(e=e.
Line truncated
|
||||
Error generating stack: `+E.message+`
|
||||
`+E.stack}return{value:e,source:r,stack:y,digest:null}}function vf(e,r,a){return{value:e,source:null,stack:a??null,digest:r??null}}function yf(e,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var Zv=typeof WeakMap=="function"?WeakMap:Map;function rp(e,r,a){a=bi(-1,a),a.tag=3,a.payload={element:null};var h=r.value;return a.callback=function(){Bc||(Bc=!0,Lf=h),yf(e,r)},a}function ip(e,r,a){a=bi(-1,a),a.tag=3;var h=e.type.getDerivedStateFromError;if(typeof h=="function"){var y=r.value;a.payload=function(){return h(y)},a.callback=function(){yf(e,r)}}var E=e.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(a.callback=function(){yf(e,r),typeof h!="function"&&(so===null?so=new Set([this]):so.add(this));var I=r.stack;this.componentDidCatch(r.value,{componentStack:I!==null?I:""})}),a}function op(e,r,a){var h=e.pingCache;if(h===null){h=e.pingCache=new Zv;var y=new Set;h.set(r,y)}else y=h.get(r),y===void 0&&(y=new Set,h.set(r,y));y.has(a)||(y.add(a),e=iy.bind(null,e,r,a),r.then(e,e))}function sp(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function ap(e,r,a,h,y){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(r=bi(-1,1),r.tag=2,io(a,r,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=y,e)}var Wv=F.ReactCurrentOwner,qn=!1;function Mn(e,r,a,h){r.child=e===null?Sh(r,null,a,h):js(r,e.child,a,h)}function lp(e,r,a,h,y){a=a.render;var E=r.ref;return Hs(r,y),h=df(e,r,a,h,E,y),a=ff(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Vt&&a&&Gd(r),r.flags|=1,Mn(e,r,h,y),r.child)}function cp(e,r,a,h,y){if(e===null){var E=a.type;return typeof E=="function"&&!Vf(E)&&E.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=E,up(e,r,E,h,y)):(e=Fc(a.type,null,h,r,r.mode,y),e.ref=r.ref,e.return=r,r.child=e)}if(E=e.child,(e.lanes&y)===0){var I=E.memoizedProps;if(a=a.compare,a=a!==null?a:$r,a(I,h)&&e.ref===r.ref)return Ci(e,r,y)}return r.flags|=1,e=uo(E,h),e.ref=r.ref,e.return=r,r.child=e}function up(e,r,a,h,y){if(e!==null){var E=e.memoizedProps;if($r(E,h)&&e.ref===r.ref)if(qn=!1,r.pendingProps=h=E,(e.lanes&y)!==0)(e.flags&131072)!==0&&(qn=!0);else return r.lanes=e.lanes,Ci(e,r,y)}return _f(e,r,a,h,y)}function dp(e,r,a){var h=r.pendingProps,y=h.children,E=e!==null?e.memoizedState:null;if(h.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(Ws,cr),cr|=a;else{if((a&1073741824)===0)return e=E!==null?E.baseLanes|a:a,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,Lt(Ws,cr),cr|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=E!==null?E.baseLanes:a,Lt(Ws,cr),cr|=h}else E!==null?(h=E.baseLanes|a,r.memoizedState=null):h=a,Lt(Ws,cr),cr|=h;return Mn(e,r,y,a),r.child}function fp(e,r){var a=r.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function _f(e,r,a,h,y){var E=Wn(a)?Fo:Bn.current;return E=Ls(r,E),Hs(r,y),a=df(e,r,a,h,E,y),h=ff(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Vt&&h&&Gd(r),r.flags|=1,Mn(e,r,a,y),r.child)}function hp(e,r,a,h,y){if(Wn(a)){var E=!0;oc(r)}else E=!1;if(Hs(r,y),r.stateNode===null)bc(e,r),tp(r,a,h),Af(r,a,h,y),h=!0;else if(e===null){var I=r.stateNode,Y=r.memoizedProps;I.props=Y;var ne=I.context,fe=a.contextType;typeof fe=="object"&&fe!==null?fe=yr(fe):(fe=Wn(a)?Fo:Bn.current,fe=Ls(r,fe));var we=a.getDerivedStateFromProps,be=typeof we=="function"||typeof I.getSnapshotBeforeUpdate=="function";be||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==h||ne!==fe)&&np(r,I,h,fe),ro=!1;var ye=r.memoizedState;I.state=ye,pc(r,h,I,y),ne=r.memoizedState,Y!==h||ye!==ne||Zn.current||ro?(typeof we=="function"&&(xf(r,a,we,h),ne=r.memoizedState),(Y=ro||ep(r,a,Y,h,ye,ne,fe))?(be||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(r.flags|=4194308)):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=ne),I.props=h,I.state=ne,I.context=fe,h=Y):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{I=r.stateNode,Ph(e,r),Y=r.memoizedProps,fe=r.type===r.elementType?Y:Fr(r.type,Y),I.props=fe,be=r.pendingProps,ye=I.context,ne=a.contextType,typeof ne=="object"&&ne!==null?ne=yr(ne):(ne=Wn(a)?Fo:Bn.current,ne=Ls(r,ne));var Fe=a.getDerivedStateFromProps;(we=typeof Fe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==be||ye!==ne)&&np(r,I,
Line truncated
|
||||
`)}function $s(n,s,i){const l=Math.floor(Date.now()/1e3);return{id:-Date.now(),type:"PRIV",conversation_key:n,text:s,sender_timestamp:l,received_at:l,paths:null,txt_type:0,signature:null,outgoing:i,acked:1}}function Ny(n){const s=R.useRef(null),i=R.useRef(null),l=R.useCallback(()=>{i.current!==null&&(clearInterval(i.current),i.current=null),s.current=null},[]),c=R.useCallback(async()=>{const p=s.current;if(!p)return;let d=null,g=null;for(let m=0;m<2;m++)try{d=await et.requestTelemetry(p.conversationId,"");break}catch(x){g=x instanceof Error?x:new Error("Unknown error"),m===0&&await new Promise(A=>setTimeout(A,2e3))}if(d){const m=$s(p.conversationId,Ry(p,d),!1);n(x=>[...x,m])}else{const m=$s(p.conversationId,`Duty cycle poll failed after retry: ${(g==null?void 0:g.message)??"Unknown error"}`,!1);n(x=>[...x,m])}},[n]),u=R.useCallback(async(p,d)=>{const g=p.trim().toLowerCase();if(g==="dutycycle_start"){l();let m=null,x=null;for(let k=0;k<2;k++)try{m=await et.requestTelemetry(d,"");break}catch(D){x=D instanceof Error?D:new Error("Unknown error"),k===0&&await new Promise(C=>setTimeout(C,2e3))}if(!m){const k=$s(d,`Failed to start duty cycle tracking after retry: ${(x==null?void 0:x.message)??"Unknown error"}`,!1);return n(D=>[...D,k]),!0}const A=Math.floor(Date.now()/1e3);s.current={startTime:A,uptime:m.uptime_seconds,txAirtime:m.airtime_seconds,rxAirtime:m.rx_airtime_seconds,sentFlood:m.sent_flood,sentDirect:m.sent_direct,recvFlood:m.recv_flood,recvDirect:m.recv_direct,conversationId:d};const _=$s(d,`Airtime/duty cycle statistics gathering begins at ${A}. Logs will follow every 5 minutes. To stop, run dutycycle_stop or navigate away from this conversation.`,!1);return n(k=>[...k,_]),i.current=window.setInterval(c,Ty),!0}if(g==="dutycycle_stop"){if(s.current&&s.current.conversationId===d){await c(),l();const m=$s(d,"Airtime/duty cycle statistics gathering stopped.",!1);n(x=>[...x,m])}else{const m=$s(d,"Duty cycle tracking is not active.",!1);n(x=>[...x,m])}return!0}return!1},[n,l,c]);return R.useEffect(()=>()=>{i.current!==null&&clearInterval(i.current)},[]),{handleAirtimeCommand:u,stopTracking:l}}function nu(n){if(n<60)return`${n}s`;const s=Math.floor(n/86400),i=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return s>0?i>0&&l>0?`${s}d${i}h${l}m`:i>0?`${s}d${i}h`:l>0?`${s}d${l}m`:`${s}d`:i>0?l>0?`${i}h${l}m`:`${i}h`:`${l}m`}function Fy(n){return["Telemetry",`Battery Voltage: ${n.battery_volts.toFixed(3)}V`,`Uptime: ${nu(n.uptime_seconds)}`,`TX Airtime: ${nu(n.airtime_seconds)}`,`RX Airtime: ${nu(n.rx_airtime_seconds)}`,"",`Noise Floor: ${n.noise_floor_dbm} dBm`,`Last RSSI: ${n.last_rssi_dbm} dBm`,`Last SNR: ${n.last_snr_db.toFixed(1)} dB`,"",`Packets: ${n.packets_received.toLocaleString()} rx / ${n.packets_sent.toLocaleString()} tx`,`Flood: ${n.recv_flood.toLocaleString()} rx / ${n.sent_flood.toLocaleString()} tx`,`Direct: ${n.recv_direct.toLocaleString()} rx / ${n.sent_direct.toLocaleString()} tx`,`Duplicates: ${n.flood_dups.toLocaleString()} flood / ${n.direct_dups.toLocaleString()} direct`,"",`TX Queue: ${n.tx_queue_len}`,`Debug Flags: ${n.full_events}`].join(`
|
||||
`)}function Ly(n){if(n.length===0)return`Neighbors
|
||||
No neighbors reported`;const s=[...n].sort((l,c)=>c.snr-l.snr),i=[`Neighbors (${s.length})`];for(const l of s){const c=l.name||l.pubkey_prefix,u=l.snr>=0?`+${l.snr.toFixed(1)}`:l.snr.toFixed(1);i.push(`${c}, ${u} dB [${nu(l.last_heard_seconds)} ago]`)}return i.join(`
|
||||
`)}function My(n){if(n.length===0)return`ACL
|
||||
No ACL entries`;const s=[`ACL (${n.length})`];for(const i of n){const l=i.name||i.pubkey_prefix;s.push(`${l}: ${i.permission_name}`)}return s.join(`
|
||||
`)}function qo(n,s,i,l=0){const c=Math.floor(Date.now()/1e3);return{id:-Date.now()-l,type:"PRIV",conversation_key:n,text:s,sender_timestamp:c,received_at:c,paths:null,txt_type:0,signature:null,outgoing:i,acked:1}}function Iy(n,s,i){const[l,c]=R.useState(!1),{handleAirtimeCommand:u,stopTracking:p}=Ny(i);R.useEffect(()=>{c(!1),p()},[n==null?void 0:n.id,p]);const d=R.useMemo(()=>{if(!n||n.type!=="contact")return!1;const x=s.find(A=>A.public_key===n.id);return(x==null?void 0:x.type)===rd},[n,s]),g=R.useCallback(async x=>{if(!(!n||n.type!=="contact")&&d)try{const A=await et.requestTelemetry(n.id,x),_=qo(n.id,Fy(A),!1,0),k=qo(n.id,Ly(A.neighbors),!1,1),D=qo(n.id,My(A.acl),!1,2);i(C=>[...C,_,k,D]),c(!0)}catch(A){const _=qo(n.id,`Telemetry request failed: ${A instanceof Error?A.message:"Unknown error"}`,!1,0);i(k=>[...k,_])}},[n,d,i]),m=R.useCallback(async x=>{if(!n||n.type!=="contact"||!d||!l||await u(x,n.id))return;const _=qo(n.id,`> ${x}`,!0,0);i(k=>[...k,_]);try{const k=await et.sendRepeaterCommand(n.id,x),D=qo(n.id,k.response,!1,1);k.sender_timestamp&&(D.sender_timestamp=k.sender_timestamp),i(C=>[...C,D])}catch(k){const D=qo(n.id,`Command failed: ${k instanceof Error?k.message:"Unknown error"}`,!1,1);i(C=>[...C,D])}},[n,d,l,i,u]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:g,handleRepeaterCommand:m}}const Ax="remoteterm-lastMessageTime",vx="remoteterm-sortOrder";let Gu={};function im(n){Gu={...n}}function om(){return{...Gu}}function t0(n,s){return Gu[n]=s,{...Gu}}function jr(n,s){return`${n}-${s}`}function Oy(){try{const n=localStorage.getItem(Ax);return n?JSON.parse(n):{}}catch{return{}}}function jy(){try{return localStorage.getItem(vx)==="alpha"?"alpha":"recent"}catch{return"recent"}}function sm(){try{localStorage.removeItem(Ax),localStorage.removeItem(vx)}catch{}}function am(n,s){if(!s)return!1;const i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${i}\\]`,"i").test(n)}function zy(n,s,i,l=null){const[c,u]=R.useState({}),[p,d]=R.useState({}),[g,m]=R.useState(om),x=R.useRef(l);R.useEffect(()=>{x.current=l},[l]);const A=R.useRef(new Set),_=R.useRef(new Set);R.useEffect(()=>{const B=n.filter(F=>!A.current.has(F.key)),S=s.filter(F=>F.public_key&&!_.current.has(F.public_key));if(B.length===0&&S.length===0)return;B.forEach(F=>A.current.add(F.key)),S.forEach(F=>_.current.add(F.public_key)),(async()=>{const F=[...B.map(M=>({type:"CHAN",conversation_key:M.key})),...S.map(M=>({type:"PRIV",conversation_key:M.public_key}))];if(F.length!==0)try{const H={};for(let Z=0;Z<F.length;Z+=200){const U=F.slice(Z,Z+200),K=await et.getMessagesBulk(U,O0);Object.assign(H,K)}const V={},z={},te={};for(const Z of B){const U=H[`CHAN:${Z.key}`]||[];if(U.length>0){const K=jr("channel",Z.key),W=Z.last_read_at||0,X=U.filter(J=>!J.outgoing&&J.received_at>W);X.length>0&&(V[K]=X.length,X.some(J=>am(J.text,x.current))&&(z[K]=!0));const oe=Math.max(...U.map(J=>J.received_at));te[K]=oe,t0(K,oe)}}for(const Z of S){const U=H[`PRIV:${Z.public_key}`]||[];if(U.length>0){const K=jr("contact",Z.public_key),W=Z.last_read_at||0,X=U.filter(J=>!J.outgoing&&J.received_at>W);X.length>0&&(V[K]=X.length,X.some(J=>am(J.text,x.current))&&(z[K]=!0));const oe=Math.max(...U.map(J=>J.received_at));te[K]=oe,t0(K,oe)}}Object.keys(V).length>0&&u(Z=>({...Z,...V})),Object.keys(z).length>0&&d(Z=>({...Z,...z})),m(om())}catch(M){console.error("Failed to fetch messages bulk:",M)}})()},[n,s]),R.useEffect(()=>{if(i&&i.type!=="raw"&&i.type!=="map"){const B=jr(i.type,i.id);u(S=>{if(S[B]){const P={...S};return delete P[B],P}return S}),d(S=>{if(S[B]){const P={...S};return delete P[B],P}return S}),i.type==="channel"?et.markChannelRead(i.id).catch(S=>{console.error("Failed to mark channel as read on server:",S)}):i.type==="contact"&&et.markContactRead(i.id).catch(S=>{console.error("Failed to mark contact as read on server:",S)})}},[i]);const k=R.useCallback((B,S)=>{u(P=>({...P,[B]:(P[B]||0)+1})),S&&d(P=>({...P,[B]:!0}))},[]),D=R.useCallback(()=>{u({}),d({}),et.markAllRead().catch(B=>{console.error("Failed to mark all as read on server:",B)})},[]),C=R.useCallback(B=>{if(B.type==="raw"||B.type==="map")return;const S=jr(B.type,B.id);u(P=>{if(P[S]){const F={...P};return delete F[S],F}return P}),d(P=>{if(P[S]){const F={...P};return delete F[S],F}return P}),B.type==="channel"?et.markChannelRead(B.id).catch(P=>{console.error("Failed to mark channel as read on server:",P)}):B.type==="contact"&&et.markContactRead(B.id).catch(P=>{console.error("Failed to mark contact as read on server:",P)})},[]),b=R.useCallback(B=>{let S=null;if(B.type==="CHAN"&&B.conversation_key?S=jr("channel",B.conversation_key):B.type==="PRIV"&&B.conversation_key&&(S=jr("contact",B.conversation_key)),S){const P=B.received_at||Math.floor(Date.now()/1e3),F=t0(S,P);m(F)}},[]);return{unreadCounts:c,mentions:p,lastMessageTimes:g,incrementUnread:k,markAllRead:D,markConversationRead:C,trackNewMessage:b}}var j0=xx();const yx=aa(j0);function Hy(n){if(typeof document>"u")return;let s=
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 g_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),x_=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,i,l)=>l?l.toUpperCase():i.toLowerCase()),um=n=>{const s=x_(n);return s.charAt(0).toUpperCase()+s.slice(1)},_x=(...n)=>n.filter((s,i,l)=>!!s&&s.trim()!==""&&l.indexOf(s)===i).join(" ").trim(),A_=n=>{for(const s in n)if(s.startsWith("aria-")||s==="role"||s==="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 v_={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 y_=R.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:c="",children:u,iconNode:p,...d},g)=>R.createElement("svg",{ref:g,...v_,width:s,height:s,stroke:n,strokeWidth:l?Number(i)*24/Number(s):i,className:_x("lucide",c),...!u&&!A_(d)&&{"aria-hidden":"true"},...d},[...p.map(([m,x])=>R.createElement(m,x)),...Array.isArray(u)?u:[u]]));/**
|
||||
* @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 z0=(n,s)=>{const i=R.forwardRef(({className:l,...c},u)=>R.createElement(y_,{ref:u,iconNode:s,className:_x(`lucide-${g_(um(n))}`,`lucide-${n}`,l),...c}));return i.displayName=um(n),i};/**
|
||||
* @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 __=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],w_=z0("check",__);/**
|
||||
* @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 b_=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],C_=z0("menu",b_);/**
|
||||
* @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 E_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wx=z0("x",E_);function k_({health:n,config:s,onSettingsClick:i,onMenuClick:l}){const c=(n==null?void 0:n.radio_connected)??!1,[u,p]=R.useState(!1),d=async()=>{p(!0);try{const g=await et.reconnectRadio();g.connected&&At.success("Reconnected",{description:g.message})}catch(g){At.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{p(!1)}};return w.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&w.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:w.jsx(C_,{className:"h-5 w-5"})}),w.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),w.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[w.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-[#4caf50]":"bg-[#666]"}`}),w.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:c?"Connected":"Disconnected"})]}),s&&w.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[w.jsx("span",{className:"text-[#e0e0e0]",children:s.name||"Unnamed"}),w.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(s.public_key),At.success("Public key copied!")},title:"Click to copy public key",children:s.public_key.toLowerCase()})]}),!c&&w.jsx("button",{onClick:d,disabled:u,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:u?"Reconnecting...":"Reconnect"}),w.jsxs("button",{onClick:i,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[w.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const S_=12;function B_(n){return n.slice(0,S_)}function Ti(n,s){return n||B_(s)}const na=2,P_={text:"🛜",background:"#444444",textColor:"#ffffff"};function T_(n){let s=0;for(let i=0;i<n.length;i++){const l=n.charCodeAt(i);s=(s<<5)-s+l,s=s&s}return Math.abs(s)}const D_=/[\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 R_(n,s){if(!n)return s.slice(0,2).toUpperCase();const i=n.match(D_);if(i)return i[0];const l=n.match(/[a-zA-Z]/g);if(!l||l.length===0)return s.slice(0,2).toUpperCase();const c=n.indexOf(" ");if(c!==-1){const u=l[0],p=n.slice(c+1).match(/[a-zA-Z]/);if(p)return(u+p[0]).toUpperCase()}return l[0].toUpperCase()}function N_(n){const s=T_(n),i=s%360,l=50+(s>>8)%30,c=35+(s>>16)%20,u=`hsl(${i}, ${l}%, ${c}%)`,p=c<45?"#ffffff":"#000000";return{background:u,text:p}}function F_(n,s,i){if(i===na)return P_;const l=R_(n,s),c=N_(s);return{text:l,background:c.background,textColor:c.text}}function v0({name:n,publicKey:s,size:i=28,contactType:l}){const c=F_(n,s,l);return w.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:c.background,color:c.textColor,width:i,height:i,fontSize:i*.45},children:c.text})}const bx="remoteterm-favorites";function ts(n,s,i){return n.some(l=>l.type===s&&l.id===i)}function L_(){try{const n=localStorage.getItem(bx);return n?JSON.parse(n):[]}catch{return[]}}function dm(){try{localStorage.removeItem(bx)}catch{}}function Cx(n){var s,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(s=0;s<c;s++)n[s]&&(i=Cx(n[s]))&&(l&&(l+=" "),l+=i)}else for(i in n)n[i]&&(l&&(l+=" "),l+=i);return l}function Ex(){for(var n,s,i=0,l="",c=arguments.length;i<c;i++)(n=arguments[i])&&(s=Cx(n))&&(l&&(l+=" "),l+=s);return l}const M_=(n,s)=>{const i=new Array(n.length+s.length);for(let l=0;l<n.length;l++)i[l]=n[l];for(let l=0;l<s.length;l++)i[n.length+l]=s[l];return i},I_=(n,s)=>({classGroupId:n,validator:s}),kx=(n=new Map,s=null,i)=>({nextPart:n,validators:s,classGroupId:i}),$u="-",fm=[],O_="arbitrary..",j_=n=>{const s=H_(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return z_(p);const d=p.split($u),g=d[0]===""&&d.length>1?1:0;return Sx(d,g,s)},getConflictingClassGroupIds:(p,d)=>{if(d){const g=l[p],m=i[p];return g?m?M_(m,g):g:m||fm}return i[p]||fm}}},Sx=(n,s,i)=>{if(n.length-s===0)return i.classGroupId;const c=n[s],u=i.nextPart.get(c);if(u){const m=Sx(n,s+1,u);if(m)return m}const p=i.validators;if(p===null)return;const d=s===0?n.join($u):n.slice(s).join($u),g=p.length;for(let m=0;m<g;m++){const x=p[m];if(x.validator(d))return x.classGroupId}},z_=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=n.slice(1,-1),i=s.indexOf(":"),l=s.slice(0,i);return l?O_+l:void 0})(),H_=n=>{const{theme:s,classGroLine truncated
|
||||
.`.concat(bw,` {
|
||||
overflow: hidden `).concat(l,`;
|
||||
padding-right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
body[`).concat(ea,`] {
|
||||
overflow: hidden `).concat(l,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([s&&"position: relative ".concat(l,";"),i==="margin"&&`
|
||||
padding-left: `.concat(c,`px;
|
||||
padding-top: `).concat(u,`px;
|
||||
padding-right: `).concat(p,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(d,"px ").concat(l,`;
|
||||
`),i==="padding"&&"padding-right: ".concat(d,"px ").concat(l,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(iu,` {
|
||||
right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(ou,` {
|
||||
margin-right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(iu," .").concat(iu,` {
|
||||
right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(ou," .").concat(ou,` {
|
||||
margin-right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
body[`).concat(ea,`] {
|
||||
`).concat(Cw,": ").concat(d,`px;
|
||||
}
|
||||
`)},Pm=function(){var n=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(n)?n:0},Uw=function(){R.useEffect(function(){return document.body.setAttribute(ea,(Pm()+1).toString()),function(){var n=Pm()-1;n<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,n.toString())}},[])},Zw=function(n){var s=n.noRelative,i=n.noImportant,l=n.gapMode,c=l===void 0?"margin":l;Uw();var u=R.useMemo(function(){return zw(c)},[c]);return R.createElement(Hw,{styles:Vw(u,!s,c,i?"":"!important")})},w0=!1;if(typeof window<"u")try{var Qc=Object.defineProperty({},"passive",{get:function(){return w0=!0,!0}});window.addEventListener("test",Qc,Qc),window.removeEventListener("test",Qc,Qc)}catch{w0=!1}var Qs=w0?{passive:!1}:!1,Ww=function(n){return n.tagName==="TEXTAREA"},Kx=function(n,s){if(!(n instanceof Element))return!1;var i=window.getComputedStyle(n);return i[s]!=="hidden"&&!(i.overflowY===i.overflowX&&!Ww(n)&&i[s]==="visible")},qw=function(n){return Kx(n,"overflowY")},Gw=function(n){return Kx(n,"overflowX")},Tm=function(n,s){var i=s.ownerDocument,l=s;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var c=Qx(n,l);if(c){var u=Yx(n,l),p=u[1],d=u[2];if(p>d)return!0}l=l.parentNode}while(l&&l!==i.body);return!1},$w=function(n){var s=n.scrollTop,i=n.scrollHeight,l=n.clientHeight;return[s,i,l]},Kw=function(n){var s=n.scrollLeft,i=n.scrollWidth,l=n.clientWidth;return[s,i,l]},Qx=function(n,s){return n==="v"?qw(s):Gw(s)},Yx=function(n,s){return n==="v"?$w(s):Kw(s)},Qw=function(n,s){return n==="h"&&s==="rtl"?-1:1},Yw=function(n,s,i,l,c){var u=Qw(n,window.getComputedStyle(s).direction),p=u*l,d=i.target,g=s.contains(d),m=!1,x=p>0,A=0,_=0;do{if(!d)break;var k=Yx(n,d),D=k[0],C=k[1],b=k[2],B=C-b-u*D;(D||B)&&Qx(n,d)&&(A+=B,_+=D);var S=d.parentNode;d=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!g&&d!==document.body||g&&(s.contains(d)||s===d));return(x&&Math.abs(A)<1||!x&&Math.abs(_)<1)&&(m=!0),m},Yc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Dm=function(n){return[n.deltaX,n.deltaY]},Rm=function(n){return n&&"current"in n?n.current:n},Xw=function(n,s){return n[0]===s[0]&&n[1]===s[1]},Jw=function(n){return`
|
||||
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
||||
`)},e2=0,Ys=[];function t2(n){var s=R.useRef([]),i=R.useRef([0,0]),l=R.useRef(),c=R.useState(e2++)[0],u=R.useState($x)[0],p=R.useRef(n);R.useEffect(function(){p.current=n},[n]),R.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var C=ww([n.lockRef.current],(n.shards||[]).map(Rm),!0).filter(Boolean);return C.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var d=R.useCallback(function(C,b){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!p.current.allowPinchZoom;var B=Yc(C),S=i.current,P="deltaX"in C?C.deltaX:S[0]-B[0],F="deltaY"in C?C.deltaY:S[1]-B[1],M,H=C.target,V=Math.abs(P)>Math.abs(F)?"h":"v";if("touches"in C&&V==="h"&&H.type==="range")return!1;var z=window.getSelection(),te=z&&z.anchorNode,Z=te?te===H||te.contains(H):!1;if(Z)return!1;var U=Tm(V,H);if(!U)return!0;if(U?M=V:(M=V==="v"?"h":"v",U=Tm(V,H)),!U)return!1;if(!l.current&&"changedTouches"in C&&(P||F)&&(l.current=M),!M)return!0;var K=l.current||M;return Yw(K,b,C,K==="h"?P:F)},[]),g=R.useCallback(function(C){var b=C;if(!(!Ys.length||Ys[Ys.length-1]!==u)){var B="deltaY"in b?Dm(b):Yc(b),S=s.current.filter(function(M){return M.name===b.type&&(M.target===b.target||b.target===M.shadowParent)&&Xw(M.delta,B)})[0];if(S&&S.should){b.cancelable&&b.preventDefault();return}if(!S){var P=(p.current.shards||[]).map(Rm).filter(Boolean).filter(function(M){return M.contains(b.target)}),F=P.length>0?d(b,P[0]):!p.current.noIsolation;F&&b.cancelable&&b.preventDefault()}}},[]),m=R.useCallback(function(C,b,B,S){var P={name:C,delta:b,target:B,should:S,shadowParent:n2(B)};s.current.push(P),setTimeout(function(){s.current=s.current.filter(function(F){return F!==P})},1)},[]),x=R.useCallback(function(C){i.current=Yc(C),l.current=void 0},[]),A=R.useCallback(function(C){m(C.type,Dm(C),C.target,d(C,n.lockRef.current))},[]),_=R.useCallback(function(C){m(C.type,Yc(C),C.target,d(C,n.lockRef.current))},[]);R.useEffect(function(){return Ys.push(u),n.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:_}),document.addEventListener("wheel",g,Qs),document.addEventListener("touchmove",g,Qs),document.addEventListener("touchstart",x,Qs),function(){Ys=Ys.filter(function(C){return C!==u}),document.removeEventListener("wheel",g,Qs),document.removeEventListener("touchmove",g,Qs),document.removeEventListener("touchstart",x,Qs)}},[]);var k=n.removeScrollBar,D=n.inert;return R.createElement(R.Fragment,null,D?R.createElement(u,{styles:Jw(c)}):null,k?R.createElement(Zw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function n2(n){for(var s=null;n!==null;)n instanceof ShadowRoot&&(s=n.host,n=n.host),n=n.parentNode;return s}const r2=Dw(Gx,t2);var Xx=R.forwardRef(function(n,s){return R.createElement(od,ii({},n,{ref:s,sideCar:r2}))});Xx.classNames=od.classNames;var i2=function(n){if(typeof document>"u")return null;var s=Array.isArray(n)?n[0]:n;return s.ownerDocument.body},Xs=new WeakMap,Xc=new WeakMap,Jc={},u0=0,Jx=function(n){return n&&(n.host||Jx(n.parentNode))},o2=function(n,s){return s.map(function(i){if(n.contains(i))return i;var l=Jx(i);return l&&n.contains(l)?l:(console.error("aria-hidden",i,"in not contained inside",n,". Doing nothing"),null)}).filter(function(i){return!!i})},s2=function(n,s,i,l){var c=o2(s,Array.isArray(n)?n:[n]);Jc[i]||(Jc[i]=new WeakMap);var u=Jc[i],p=[],d=new Set,g=new Set(c),m=function(A){!A||d.has(A)||(d.add(A),m(A.parentNode))};c.forEach(m);var x=function(A){!A||g.has(A)||Array.prototype.forEach.call(A.children,function(_){if(d.has(_))x(_);else try{var k=_.getAttribute(l),D=k!==null&&k!=="false",C=(Xs.get(_)||0)+1,b=(u.get(_)||0)+1;Xs.set(_,C),u.set(_,b),p.push(_),C===1&&D&&Xc.set(_,!0),b===1&&_.setAttribute(i,"true"),D||_.setAttribute(l,"true")}catch(B){console.error("aria-hidden: cannot operate on ",_,B)}})};return x(s),d.clear(),u0++,function(){p.forEach(function(A){var _=Xs.get(A)-1,k=u.get(A)-1;Xs.set(A,_),u.set(A,k),_||(Xc.has(A)||A.removeAttribute(l),Xc.delete(A)),k||A.removeAttribute(i)}),u0--,u0||(Xs=new WeakMap,Xs=new WeakMap,Xc=new WeakMap,Jc={})}},a2=function(n,s,i){i===void 0&&(i="data-aria-hidden");var l=Array.from(Array.isArray(n)?n:[n]),c=i2(n);return c?(l.push.apply(l,Array.from(c.querySelectorAll("[aria-live], script"))),s2(l,c,i,"aria-hidden")):function(){return null}};function l2(n){const s=c2(n),i=R.forwardRef((l,c)=>{const{children:u,...p}=l,d=R.Children.toArray(u),g=d.find(d2);if(g){const m=g.props.children,x=d.map(A=>A===g?R.Children.count(m)>1?R.Children.only(null):R.isValidElement(m)?m.props.children:null:A);return w.jsx(s,{...p,ref:c,children:R.isValidElement(m)?R.cloneElement(m,void 0,x):null})}return w.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function c2(n){const s=R.forwardRef((i,l)=>{const{childr
Line truncated
|
||||
|
||||
If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return R.useEffect(()=>{n&&(document.getElementById(n)||console.error(i))},[i,n]),null},w2="DialogDescriptionWarning",b2=({contentRef:n,descriptionId:s})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pA(w2).contentName}}.`;return R.useEffect(()=>{var u;const c=(u=n.current)==null?void 0:u.getAttribute("aria-describedby");s&&c&&(document.getElementById(s)||console.warn(l))},[l,n,s]),null},mA=tA,gA=iA,ad=oA,ld=sA,cd=lA,ud=uA,xA=fA;const G0=mA,C2=gA,AA=R.forwardRef(({className:n,...s},i)=>w.jsx(ad,{ref:i,className:ot("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",n),...s}));AA.displayName=ad.displayName;const dd=R.forwardRef(({className:n,children:s,...i},l)=>w.jsxs(C2,{children:[w.jsx(AA,{}),w.jsxs(ld,{ref:l,className:ot("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",n),...i,children:[s,w.jsxs(xA,{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:[w.jsx(wx,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dd.displayName=ld.displayName;const fd=({className:n,...s})=>w.jsx("div",{className:ot("flex flex-col space-y-1.5 text-center sm:text-left",n),...s});fd.displayName="DialogHeader";const $0=({className:n,...s})=>w.jsx("div",{className:ot("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...s});$0.displayName="DialogFooter";const hd=R.forwardRef(({className:n,...s},i)=>w.jsx(cd,{ref:i,className:ot("text-lg font-semibold leading-none tracking-tight",n),...s}));hd.displayName=cd.displayName;const pd=R.forwardRef(({className:n,...s},i)=>w.jsx(ud,{ref:i,className:ot("text-sm text-muted-foreground",n),...s}));pd.displayName=ud.displayName;function E2(){const n=window.location.hash.slice(1);if(!n)return null;if(n==="raw")return{type:"raw",name:"raw"};if(n==="map")return{type:"map",name:"map"};if(n==="visualizer")return{type:"visualizer",name:"visualizer"};if(n.startsWith("map/focus/")){const c=n.slice(10);return c?{type:"map",name:"map",mapFocusKey:decodeURIComponent(c)}:{type:"map",name:"map"}}const s=n.indexOf("/");if(s===-1)return null;const i=n.slice(0,s),l=decodeURIComponent(n.slice(s+1));return(i==="channel"||i==="contact")&&l?{type:i,name:l}:null}function vA(n){return`#map/focus/${encodeURIComponent(n)}`}function k2(n){if(!n)return"";if(n.type==="raw")return"#raw";if(n.type==="map")return"#map";if(n.type==="visualizer")return"#visualizer";const s=n.type==="channel"&&n.name.startsWith("#")?n.name.slice(1):n.name;return`#${n.type}/${encodeURIComponent(s)}`}function S2(n){const s=k2(n);s!==window.location.hash&&window.history.replaceState(null,"",s||window.location.pathname)}function B2({open:n,onClose:s,paths:i,senderInfo:l,contacts:c,config:u}){const p=i.map(g=>({...g,resolved:j1(g.path,l,c,u)})),d=i.length===1;return w.jsx(G0,{open:n,onOpenChange:g=>!g&&s(),children:w.jsxs(dd,{className:"max-w-md max-h-[80vh] flex flex-col",children:[w.jsxs(fd,{children:[w.jsxs(hd,{children:["Message Path",!d&&`s (${i.length})`]}),w.jsx(pd,{children:d?w.jsxs(w.Fragment,{children:["This shows ",w.jsx("em",{children:"one route"})," that this message traveled through the mesh network. Routers may be incorrectly identified due to prefix collisions between heard and non-heard router advertisements."]}):w.jsxs(w.Fragment,{children:["This message was received via ",w.jsxs("strong",{children:[i.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),w.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[p.map((g,m)=>w.jsxs("div",{children:[!d&&w.jsxs("div",{className:"text-xs text-muted-foreground font-medium mb-2 pb-1 border-b border-border",children:["Path ",m+1," — received ",ra(g.received_at)]}),w.jsx(P2,{resolved:g.resolved,senderInfo:l,hideStraightLine:!d})]},m)),!d&&p.length>0&&(()=>{const g=p[0].resolved;return Bt(g.sender.lat,g.sender.lon)&&Bt(g.receiver.lat,g.receiver.lon)?w.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[w.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),w.jsx("span",{className:"text-sm font-medium",c
Line truncated
|
||||
`).map((Q,ue,pe)=>w.jsxs("span",{children:[R2(Q,d),ue<pe.length-1&&w.jsx("br",{})]},ue)),!he&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:ra(z.sender_timestamp||z.received_at)}),!z.outgoing&&z.paths&&z.paths.length>0&&w.jsx(Fm,{paths:z.paths,variant:"inline",onClick:()=>C({paths:z.paths,senderInfo:M(z,Z,K)})})]}),z.outgoing&&(z.acked>0?` ✓${z.acked>1?z.acked:""}`:" ?")]})]})]},z.id)})]}),_&&w.jsx("button",{onClick:S,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:w.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:w.jsx("polyline",{points:"6 9 12 15 18 9"})})}),D&&w.jsx(B2,{open:!0,onClose:()=>C(null),paths:D.paths,senderInfo:D.senderInfo,contacts:s,config:g??null})]})}const Lm=156,F2=140,L2=156,M2=120,I2=8,O2=R.forwardRef(function({onSend:s,disabled:i,placeholder:l,isRepeaterMode:c,conversationType:u,senderName:p},d){const[g,m]=R.useState(""),[x,A]=R.useState(!1),_=R.useRef(null);R.useImperativeHandle(d,()=>({appendText:M=>{var H;m(V=>V+M),(H=_.current)==null||H.focus()}}));const k=R.useMemo(()=>{if(u==="contact")return{warningAt:F2,dangerAt:Lm,hardLimit:Lm};if(u==="channel"){const M=(p==null?void 0:p.length)??10,H=Math.max(1,L2-M-2);return{warningAt:M2,dangerAt:Math.max(1,H-I2),hardLimit:H}}return null},[u,p]),{limitState:D,warningMessage:C}=R.useMemo(()=>{if(!k)return{limitState:"normal",warningMessage:null};const M=g.length;return M>=k.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:M>=k.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:M>=k.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[g.length,k]),b=k?k.hardLimit-g.length:0,B=R.useCallback(async M=>{M.preventDefault();const H=g.trim();if(c){if(x||i)return;A(!0);try{await s(H),m("")}catch(V){console.error("Failed to request telemetry:",V),At.error("Failed to request telemetry",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=_.current)==null?void 0:V.focus()},0)}else{if(!H||x||i)return;A(!0);try{await s(H),m("")}catch(V){console.error("Failed to send message:",V),At.error("Failed to send message",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=_.current)==null?void 0:V.focus()},0)}},[g,x,i,s,c]),S=R.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),B(M))},[B]),P=c?!0:g.trim().length>0,F=!c&&k!==null;return w.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:B,children:[w.jsxs("div",{className:"flex gap-2",children:[w.jsx(nn,{ref:_,type:c?"password":"text",autoComplete:c?"off":void 0,value:g,onChange:M=>m(M.target.value),onKeyDown:S,placeholder:l||(c?"Enter password for admin login...":"Type a message..."),disabled:i||x,className:"flex-1 min-w-0"}),w.jsx(wn,{type:"submit",disabled:i||x||!P,className:"flex-shrink-0",children:x?c?"Logging in...":"Sending...":c?g.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),F&&w.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[w.jsxs("span",{className:ot("tabular-nums",D==="error"||D==="danger"?"text-red-500 font-medium":D==="warning"?"text-yellow-500":"text-muted-foreground"),children:[g.length,"/",k.hardLimit,b<0&&` (${b})`]}),C&&w.jsxs("span",{className:ot(D==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function Mm(n){const s=j2(n),i=R.forwardRef((l,c)=>{const{children:u,...p}=l,d=R.Children.toArray(u),g=d.find(H2);if(g){const m=g.props.children,x=d.map(A=>A===g?R.Children.count(m)>1?R.Children.only(null):R.isValidElement(m)?m.props.children:null:A);return w.jsx(s,{...p,ref:c,children:R.isValidElement(m)?R.cloneElement(m,void 0,x):null})}return w.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function j2(n){const s=R.forwardRef((i,l)=>{const{children:c,...u}=i;if(R.isValidElement(c)){const p=U2(c),d=V2(u,c.props);return c.type!==R.Fragment&&(d.ref=l?El(l,p):p),R.cloneElement(c,d)}return R.Children.count(c)>1?R.Children.only(null):null});return s.displayName=`${n}.SlotClone`,s}var z2=Symbol("radix.slottable");function H2(n){return R.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===z2}function V2(n,s){const i={...s};for(const l in s){const c=n[l],u=s[l];/^on[A-Z]/.test(l)?c&&u?i[l]=(...d)=>{const g=u(...d);return c(...d),g}:c&&(i[l]=c):l==="style"?i[l]={...c,...u}:l==="className"&&(i[l]=[c,u].filter(Boolean).join(" "))}return{...n,...i}}function
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(l){var c=i,u=c.lib,p=u.WordArray,d=u.Hasher,g=c.algo,m=p.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]),x=p.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]),A=p.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]),_=p.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]),k=p.create([0,1518500249,1859775393,2400959708,2840853838]),D=p.create([1352829926,1548603684,1836072691,2053994217,0]),C=g.RIPEMD160=d.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(H,V){for(var z=0;z<16;z++){var te=V+z,Z=H[te];H[te]=(Z<<8|Z>>>24)&16711935|(Z<<24|Z>>>8)&4278255360}var U=this._hash.words,K=k.words,W=D.words,X=m.words,oe=x.words,J=A.words,ae=_.words,$,he,q,N,O,G,Q,ue,pe,ve;G=$=U[0],Q=he=U[1],ue=q=U[2],pe=N=U[3],ve=O=U[4];for(var me,z=0;z<80;z+=1)me=$+H[V+X[z]]|0,z<16?me+=b(he,q,N)+K[0]:z<32?me+=B(he,q,N)+K[1]:z<48?me+=S(he,q,N)+K[2]:z<64?me+=P(he,q,N)+K[3]:me+=F(he,q,N)+K[4],me=me|0,me=M(me,J[z]),me=me+O|0,$=O,O=N,N=M(q,10),q=he,he=me,me=G+H[V+oe[z]]|0,z<16?me+=F(Q,ue,pe)+W[0]:z<32?me+=P(Q,ue,pe)+W[1]:z<48?me+=S(Q,ue,pe)+W[2]:z<64?me+=B(Q,ue,pe)+W[3]:me+=b(Q,ue,pe)+W[4],me=me|0,me=M(me,ae[z]),me=me+ve|0,G=ve,ve=pe,pe=M(ue,10),ue=Q,Q=me;me=U[1]+q+pe|0,U[1]=U[2]+N+ve|0,U[2]=U[3]+O+G|0,U[3]=U[4]+$+Q|0,U[4]=U[0]+he+ue|0,U[0]=me},_doFinalize:function(){var H=this._data,V=H.words,z=this._nDataBytes*8,te=H.sigBytes*8;V[te>>>5]|=128<<24-te%32,V[(te+64>>>9<<4)+14]=(z<<8|z>>>24)&16711935|(z<<24|z>>>8)&4278255360,H.sigBytes=(V.length+1)*4,this._process();for(var Z=this._hash,U=Z.words,K=0;K<5;K++){var W=U[K];U[K]=(W<<8|W>>>24)&16711935|(W<<24|W>>>8)&4278255360}return Z},clone:function(){var H=d.clone.call(this);return H._hash=this._hash.clone(),H}});function b(H,V,z){return H^V^z}function B(H,V,z){return H&V|~H&z}function S(H,V,z){return(H|~V)^z}function P(H,V,z){return H&z|V&~z}function F(H,V,z){return H^(V|~z)}function M(H,V){return H<<V|H>>>32-V}c.RIPEMD160=d._createHelper(C),c.HmacRIPEMD160=d._createHmacHelper(C)})(),i.RIPEMD160})})(yu)),yu.exports}var _u={exports:{}},Gb=_u.exports,tg;function vd(){return tg||(tg=1,(function(n,s){(function(i,l){n.exports=l(xt())})(Gb,function(i){(function(){var l=i,c=l.lib,u=c.Base,p=l.enc,d=p.Utf8,g=l.algo;g.HMAC=u.extend({init:function(m,x){m=this._hasher=new m.init,typeof x=="string"&&(x=d.parse(x));var A=m.blockSize,_=A*4;x.sigBytes>_&&(x=m.finalize(x)),x.clamp();for(var k=this._oKey=x.clone(),D=this._iKey=x.clone(),C=k.words,b=D.words,B=0;B<A;B++)C[B]^=1549556828,b[B]^=909522486;k.sigBytes=D.sigBytes=_,this.reset()},reset:function(){var m=this._hasher;m.reset(),m.update(this._iKey)},update:function(m){return this._hasher.update(m),this},finalize:function(m){var x=this._hasher,A=x.finalize(m);x.reset();var _=x.finalize(this._oKey.clone().concat(A));return _}})})()})})(_u)),_u.exports}var wu={exports:{}},$b=wu.exports,ng;function Kb(){return ng||(ng=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),Bl(),vd())})($b,function(i){return(function(){var l=i,c=l.lib,u=c.Base,p=c.WordArray,d=l.algo,g=d.SHA256,m=d.HMAC,x=d.PBKDF2=u.extend({cfg:u.extend({keySize:128/32,hasher:g,iterations:25e4}),init:function(A){this.cfg=this.cfg.extend(A)},compute:function(A,_){for(var k=this.cfg,D=m.create(k.hasher,A),C=p.create(),b=p.create([1]),B=C.words,S=b.words,P=k.keySize,F=k.iterations;B.length<P;){var M=D.update(_).finalize(b);D.reset();for(var H=M.words,V=H.length,z=M,te=1;te<F;te++){z=D.finalize(z),D.reset();for(var Z=z.words,U=0;U<V;U++)H[U]^=Z[U]}C.concat(M),S[0]++}return C.sigBytes=P*4,C}});l.PBKDF2=function(A,_,k){return x.create(k).compute(A,_)}})(),i.PBKDF2})})(wu)),wu.exports}var bu={exports:{}},Qb=bu.exports,rg;function vo(){return rg||(rg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),YA(),vd())})(Qb,function(i){return(function(){var l=i,c=l.lib,u=c.Base,p=c.WordArray,d=l.algo,g=d.MD5,m=d.EvpKDF=u.extend({cfg:u.extend({keySize:128/32,hasher:g,iterations:1}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,A){for(var _,k=this.cfg,D=k.hasher.create(),C=p.create(),b=C.words,B=k.keySize,S=k.iterations;b.length<B;){_&&D.update(_),_=D.update(x).finalize(A),D.reset();for(var P=1;P<S;P++)_=D.finalize(_),D.reset();C.concat(_)}return C.sigBytes=B*4,C}});l.EvpKDF=function(x,A,_){return m.create(_).compute(x,A)}})(),i.EvpKDF})})(bu)),bu.exports}var Cu={exports:{}},Yb=Cu.exports,ig;fuLine truncated
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return i.mode.CTRGladman=(function(){var l=i.lib.BlockCipherMode.extend();function c(d){if((d>>24&255)===255){var g=d>>16&255,m=d>>8&255,x=d&255;g===255?(g=0,m===255?(m=0,x===255?x=0:++x):++m):++g,d=0,d+=g<<16,d+=m<<8,d+=x}else d+=1<<24;return d}function u(d){return(d[0]=c(d[0]))===0&&(d[1]=c(d[1])),d}var p=l.Encryptor=l.extend({processBlock:function(d,g){var m=this._cipher,x=m.blockSize,A=this._iv,_=this._counter;A&&(_=this._counter=A.slice(0),this._iv=void 0),u(_);var k=_.slice(0);m.encryptBlock(k,0);for(var D=0;D<x;D++)d[g+D]^=k[D]}});return l.Decryptor=p,l})(),i.mode.CTRGladman})})(Su)),Su.exports}var Bu={exports:{}},iC=Bu.exports,lg;function oC(){return lg||(lg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(iC,function(i){return i.mode.OFB=(function(){var l=i.lib.BlockCipherMode.extend(),c=l.Encryptor=l.extend({processBlock:function(u,p){var d=this._cipher,g=d.blockSize,m=this._iv,x=this._keystream;m&&(x=this._keystream=m.slice(0),this._iv=void 0),d.encryptBlock(x,0);for(var A=0;A<g;A++)u[p+A]^=x[A]}});return l.Decryptor=c,l})(),i.mode.OFB})})(Bu)),Bu.exports}var Pu={exports:{}},sC=Pu.exports,cg;function aC(){return cg||(cg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(sC,function(i){return i.mode.ECB=(function(){var l=i.lib.BlockCipherMode.extend();return l.Encryptor=l.extend({processBlock:function(c,u){this._cipher.encryptBlock(c,u)}}),l.Decryptor=l.extend({processBlock:function(c,u){this._cipher.decryptBlock(c,u)}}),l})(),i.mode.ECB})})(Pu)),Pu.exports}var Tu={exports:{}},lC=Tu.exports,ug;function cC(){return ug||(ug=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(lC,function(i){return i.pad.AnsiX923={pad:function(l,c){var u=l.sigBytes,p=c*4,d=p-u%p,g=u+d-1;l.clamp(),l.words[g>>>2]|=d<<24-g%4*8,l.sigBytes+=d},unpad:function(l){var c=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=c}},i.pad.Ansix923})})(Tu)),Tu.exports}var Du={exports:{}},uC=Du.exports,dg;function dC(){return dg||(dg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(uC,function(i){return i.pad.Iso10126={pad:function(l,c){var u=c*4,p=u-l.sigBytes%u;l.concat(i.lib.WordArray.random(p-1)).concat(i.lib.WordArray.create([p<<24],1))},unpad:function(l){var c=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=c}},i.pad.Iso10126})})(Du)),Du.exports}var Ru={exports:{}},fC=Ru.exports,fg;function hC(){return fg||(fg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(fC,function(i){return i.pad.Iso97971={pad:function(l,c){l.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(l,c)},unpad:function(l){i.pad.ZeroPadding.unpad(l),l.sigBytes--}},i.pad.Iso97971})})(Ru)),Ru.exports}var Nu={exports:{}},pC=Nu.exports,hg;function mC(){return hg||(hg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(pC,function(i){return i.pad.ZeroPadding={pad:function(l,c){var u=c*4;l.clamp(),l.sigBytes+=u-(l.sigBytes%u||u)},unpad:function(l){for(var c=l.words,u=l.sigBytes-1,u=l.sigBytes-1;u>=0;u--)if(c[u>>>2]>>>24-u%4*8&255){l.sigBytes=u+1;break}}},i.pad.ZeroPadding})})(Nu)),Nu.exports}var Fu={exports:{}},gC=Fu.exports,pg;function xC(){return pg||(pg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(gC,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding})})(Fu)),Fu.exports}var Lu={exports:{}},AC=Lu.exports,mg;function vC(){return mg||(mg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),An())})(AC,function(i){return(function(l){var c=i,u=c.lib,p=u.CipherParams,d=c.enc,g=d.Hex,m=c.format;m.Hex={stringify:function(x){return x.ciphertext.toString(g)},parse:function(x){var A=g.parse(x);return p.create({ciphertext:A})}}})(),i.format.Hex})})(Lu)),Lu.exports}var Mu={exports:{}},yC=Mu.exports,gg;function _C(){return gg||(gg=1,(function(n,s){(function(i,l,c){n.exports=l(xt(),ss(),as(),vo(),An())})(yC,function(i){return(function(){var l=i,c=l.lib,u=c.BlockCipher,p=l.algo,d=[],g=[],m=[],x=[],A=[],_=[],k=[],D=[],C=[],b=[];(function(){for(var P=[],F=0;F<256;F++)F<128?P[F]=F<<1:P[F]=F<<1^283;for(var M=0,H=0,F=0;F<256;F++){var V=H^H<<1^H<<2^H<<3^H<<4;V=V>>>8^V&255^99,d[M]=V,g[V]=M;var z=P[M],te=P[z],Z=P[te],U=P[V]*257^V*16843008;m[M]=U<<24|U>>>8,x[M]=U<<16|U>>>16,A[M]=U<<8|U>>>24,_[M]=U;var U=Z*16843009^te*65537^z*257^M*16843008;k[V]=U<<24|U>>>8,D[V]=U<<16|U>>>16,C[V]=U<<8|U>>>24,b[V]=U,M?(M=z^P[P[P[Z^z]]],H^=P[P[H]]):M=H=1}})();var B=[0,1,2,4,8,16,32,64,128,27,54],S=p.AES=u.extend({_doReset:function(){var P;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,M=F.words,H=F.sigBytes/4,V=this._nRounds=H+6,z=(V+1)*4,te=this._keySchedule=[],Z=0;Z<z;Z++)Z<H?te[Z]=M[Z]:(P=te[Z-1],Z%H?H>6&&Z%H==4&&(P=d[P>>>24]<<24|d[P>>>16&255]<<16|d[P>>>8&255]<<8|d[P&255]):(P=P<<8|P>>>24,P=d[P>>>24]<<24|d[P>>>16&255]<<16|d[P>>>8&255]<<8|d[P&255],P^=B[Z/H|0]<<24),te[Z]=te[Z-H]^P);for(var U=this._invKeySchedule=[],K=0;K<z;K++){var Z=z-K;if(K%4)var P=te[Z];else var P=te[Z-4];K<4||Z<=4?U[K]=P:U[K]=k[d[P>>>24]]^D[d[P>>>16&255]]^C[d[P>>>8&255]]^b[d[P&255]]}}},encLine 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:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode request payload"],timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return ll.RequestPayloadDecoder=i,ll}var cl={},jg;function rE(){if(jg)return cl;jg=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.ResponsePayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<4){const D={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(D.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),D}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:d+g,endByte:d+g,value:x}),g+=1;const A=(0,s.bytesToHex)(c.subarray(g,g+2));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(g));u!=null&&u.includeSegments&&c.length>g&&p.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-4};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return cl.ResponsePayloadDecoder=i,cl}var ul={},zg;function iE(){if(zg)return ul;zg=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.AnonRequestPayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<35){const D={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(D.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:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),D}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[0]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${m}`,startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.bytesToHex)(c.subarray(1,33));u!=null&&u.includeSegments&&p.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:d+g,endByte:d+g+31,value:x}),g+=32;const A=(0,s.bytesToHex)(c.subarray(33,35));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(35));u!=null&&u.includeSegments&&c.length>35&&p.push({name:"Ciphertext",description:`Encrypted message data (${c.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:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,senderPublicKey:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-35};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return ul.AnonRequestPayloadDecoder=i,ul}var dl={},Hg;function oE(){if(Hg)return dl;Hg=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.AckPayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<4){const x={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return u!=null&&u.includeSegments&&(x.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),x}const p=[],d=(u==null?void 0:u.segmentOffset)||0,g=(0,s.bytesToHex)(c.subarray(0,4));u!=null&&u.includeSegments&&p.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${g}`,startByte:d,endByte:d+3,value:g}),u!=null&&u.includeSegments&&c.length>4&&p.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:d+4,endByte:d+c.length-1,value:(0,s.bytesToHex)(c.subarray(4))});const m={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!0,checksum:g};return u!=null&&u.includeSegments&&(m.segments=p),m}catch(p){return{type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode Ack payload"],checksum:""}}}}return dl.AckPayloadDecoder=i,dl}var fl={},Vg;function sE(){if(Vg)return fl;Vg=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.PathPayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c){try{if(c.length<2)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const u=c[0];if(c.length<1+u+1)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+u+1} bytes for path length + path + extra type)`],pathLength:u,pathHashes:[],extraType:0,extraData:""};const p=[];for(let m=0;m<u;m++)p.push((0,s.byteToHex)(c[1+m]));const d=c[1+u];let g="";return c.length>1+u+1&&(g=(0,s.bytesToHex)(c.subarray(1+u+1))),{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!0,pathLength:u,pathHashes:p,extraType:d,extraData:g}}catch(u){return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return fl.PathPayloadDecoder=i,fl}var hl={},Ug;function aE(){if(Ug)return hl;Ug=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.TextMessagePayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<4){const D={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(D.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),D}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:d+g,endByte:d+g,value:x}),g+=1;const A=(0,s.bytesToHex)(c.subarray(g,g+2));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(g));u!=null&&u.includeSegments&&c.length>g&&p.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-4};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,i
Line truncated
|
||||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||
*/var bE=gl.exports,Qg;function CE(){return Qg||(Qg=1,(function(n,s){(function(i,l){l(s)})(bE,(function(i){var l="1.9.4";function c(t){var o,f,v,T;for(f=1,v=arguments.length;f<v;f++){T=arguments[f];for(o in T)t[o]=T[o]}return t}var u=Object.create||(function(){function t(){}return function(o){return t.prototype=o,new t}})();function p(t,o){var f=Array.prototype.slice;if(t.bind)return t.bind.apply(t,f.call(arguments,1));var v=f.call(arguments,2);return function(){return t.apply(o,v.length?v.concat(f.call(arguments)):arguments)}}var d=0;function g(t){return"_leaflet_id"in t||(t._leaflet_id=++d),t._leaflet_id}function m(t,o,f){var v,T,j,ee;return ee=function(){v=!1,T&&(j.apply(f,T),T=!1)},j=function(){v?T=arguments:(t.apply(f,arguments),setTimeout(ee,o),v=!0)},j}function x(t,o,f){var v=o[1],T=o[0],j=v-T;return t===v&&f?t:((t-T)%j+j)%j+T}function A(){return!1}function _(t,o){if(o===!1)return t;var f=Math.pow(10,o===void 0?6:o);return Math.round(t*f)/f}function k(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function D(t){return k(t).split(/\s+/)}function C(t,o){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?u(t.options):{});for(var f in o)t.options[f]=o[f];return t.options}function b(t,o,f){var v=[];for(var T in t)v.push(encodeURIComponent(f?T.toUpperCase():T)+"="+encodeURIComponent(t[T]));return(!o||o.indexOf("?")===-1?"?":"&")+v.join("&")}var B=/\{ *([\w_ -]+) *\}/g;function S(t,o){return t.replace(B,function(f,v){var T=o[v];if(T===void 0)throw new Error("No value provided for variable "+f);return typeof T=="function"&&(T=T(o)),T})}var P=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function F(t,o){for(var f=0;f<t.length;f++)if(t[f]===o)return f;return-1}var M="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function H(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var V=0;function z(t){var o=+new Date,f=Math.max(0,16-(o-V));return V=o+f,window.setTimeout(t,f)}var te=window.requestAnimationFrame||H("RequestAnimationFrame")||z,Z=window.cancelAnimationFrame||H("CancelAnimationFrame")||H("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function U(t,o,f){if(f&&te===z)t.call(o);else return te.call(window,p(t,o))}function K(t){t&&Z.call(window,t)}var W={__proto__:null,extend:c,create:u,bind:p,get lastId(){return d},stamp:g,throttle:m,wrapNum:x,falseFn:A,formatNum:_,trim:k,splitWords:D,setOptions:C,getParamString:b,template:S,isArray:P,indexOf:F,emptyImageUrl:M,requestFn:te,cancelFn:Z,requestAnimFrame:U,cancelAnimFrame:K};function X(){}X.extend=function(t){var o=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},f=o.__super__=this.prototype,v=u(f);v.constructor=o,o.prototype=v;for(var T in this)Object.prototype.hasOwnProperty.call(this,T)&&T!=="prototype"&&T!=="__super__"&&(o[T]=this[T]);return t.statics&&c(o,t.statics),t.includes&&(oe(t.includes),c.apply(null,[v].concat(t.includes))),c(v,t),delete v.statics,delete v.includes,v.options&&(v.options=f.options?u(f.options):{},c(v.options,t.options)),v._initHooks=[],v.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this),this._initHooksCalled=!0;for(var j=0,ee=v._initHooks.length;j<ee;j++)v._initHooks[j].call(this)}},o},X.include=function(t){var o=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=o,this.mergeOptions(t.options)),this},X.mergeOptions=function(t){return c(this.prototype.options,t),this},X.addInitHook=function(t){var o=Array.prototype.slice.call(arguments,1),f=typeof t=="function"?t:function(){this[t].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(f),this};function oe(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=P(t)?t:[t];for(var o=0;o<t.length;o++)t[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var J={on:function(t,o,f){if(typeof t=="object")for(var v in t)this._on(v,t[v],o);else{t=D(t);for(var T=0,j=t.length;T<j;T++)this._on(t[T],o,f)}return this},off:function(t,o,f){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var v in t)this._off(v,t[v],o);else{t=D(t);for(var T=arguments.length===1,j=0,ee=t.length;j<ee;j++)T?this._off(t[j]):this._off(t[j],o,f)}return this},_on:function(t,o,f,v){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(t,o,f)===!1){f===this&&(f=void 0);var T={fn:o,ctx:f};v&&(T.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(T)}},_off:function(t,o,f){var v,T,j;if(this._events&&(v=this._events[t],!!v)){if(arguments.length===1){if(this._firingCount)for(T=0,j=v.length;T<j;T++)v[T].fn=A;delete this._events[t];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var ee=tLine 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 32 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 32u;
|
||||
|
||||
@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 s=await navigator.gpu.requestAdapter();if(!s)return console.warn("No GPU adapter found"),!1;this.device=await s.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 c=0;c<2;c++)this.matchCountReadBuffers[c]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[c]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const i=this.device.createShaderModule({code:this.shaderCode}),l=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:l,compute:{module:i,entryPoint:"main"}}),!0}catch(s){return console.error("WebGPU initialization failed:",s),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(s,i){return es(i,s)}countNamesForLength(s){return vl(s)}async runBatch(s,i,l,c,u,p){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 d=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const g=this.matchCountReadBuffers[d],m=this.matchIndicesReadBuffers[d],x=u&&p?1:0;let A,_=0,k=0;if(x){const M=new Uint8Array(u.length/2);for(let Z=0;Z<M.length;Z++)M[Z]=parseInt(u.substr(Z*2,2),16);_=M.length*8;const H=Math.ceil(M.length/4)*4,V=new Uint8Array(H);V.set(M),A=new Uint32Array(H/4);for(let Z=0;Z<A.length;Z++)A[Z]=V[Z*4]<<24|V[Z*4+1]<<16|V[Z*4+2]<<8|V[Z*4+3];const z=parseInt(p.substr(0,2),16),te=parseInt(p.substr(2,2),16);k=z<<24|te<<16}else A=new Uint32Array([0]);const D=Math.max(A.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<D)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:D,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=D,this.bindGroupDirty=!0);const C=new Uint32Array([s,l,i,c,k,A.length,_,x]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,A),this.device.queue.writeBuffer(this.matchCountBuffer,0,Ed.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 b=this.device.createCommandEncoder(),B=b.beginComputePass();B.setPipeline(this.pipeline),B.setBindGroup(0,this.bindGroup),B.dispatchWorkgroups(Math.ceil(c/(256*32))),B.end(),b.copyBufferToBuffer(this.matchCountBuffer,0,g,0,4),b.copyBufferToBuffer(this.matchIndicesBuffer,0,m,0,1024*4),this.device.queue.submit([b.finish()]),await g.mapAsync(GPUMapMode.READ);const P=new Uint32Array(g.getMappedRange())[0];g.unmap();const F=[];if(P>0){await m.mapAsync(GPUMapMode.READ);const M=new Uint32Array(m.getMappedRange());for(let H=0;H<Math.min(P,1024);H++)F.push(M[H]);m.unmap()}return F}destroy(){var s,i,l,c,u,p,d,g;(s=this.paramsBuffer)==null||s.destroy(),(i=this.matchCountBuffer)==null||i.destroy(),(l=this.matchIndicesBuffer)==null||l.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(u=this.matchCountReadBuffers[0])==null||u.destroy(),(p=this.matchCountReadBuffers[1])==null||p.destroy(),(d=this.matchIndicesReadBuffers[0])==null||d.destroy(),(g=this.matchIndicesReadBuffers[1])==null||g.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}}Ed.ZERO_DATA=new Uint32Array([0]);function eS(){return typeof navigator<"u"&&"gpu"in navigator}class dx{runBatch(s,i,l,c,u,p){const d=[],g=s.toString(16).padStart(2,"0
Line truncated
|
||||
`).map(u=>u.trim().toLowerCase()).filter(u=>u.length>0);this.wordlist=c.filter(fx)}setWordlist(s){this.wordlist=s.map(i=>i.trim().toLowerCase()).filter(fx)}abort(){this.abortFlag=!0}isGpuAvailable(){return eS()}async decodePacket(s){var l;const i=s.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!i||!/^[0-9a-fA-F]+$/.test(i))return null;try{const u=(l=(await Et.MeshCorePacketDecoder.decodeWithVerification(i,{})).payload)==null?void 0:l.decoded;return!(u!=null&&u.channelHash)||!(u!=null&&u.ciphertext)||!(u!=null&&u.cipherMac)?null:{channelHash:u.channelHash,ciphertext:u.ciphertext,cipherMac:u.cipherMac,isGroupText:!0}}catch{return null}}async crack(s,i,l){this.abortFlag=!1,this.useTimestampFilter=(i==null?void 0:i.useTimestampFilter)??!0,this.useUtf8Filter=(i==null?void 0:i.useUtf8Filter)??!0,this.useSenderFilter=(i==null?void 0:i.useSenderFilter)??!0,this.validSeconds=(i==null?void 0:i.validSeconds)??N0,this.useCpu=(i==null?void 0:i.forceCpu)??!1;const c=(i==null?void 0:i.maxLength)??8,u=(i==null?void 0:i.startingLength)??1,p=(i==null?void 0:i.useDictionary)??!0,d=(i==null?void 0:i.startFromType)??"bruteforce",g=s.toLowerCase(),m=await this.decodePacket(g);if(!m)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:x,ciphertext:A,cipherMac:_}=m,k=parseInt(x,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new dx):this.gpuInstance||(this.gpuInstance=new Ed,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new dx));const D=performance.now();let C=0,b=performance.now(),B=u,S=0,P=0,F=!1;if(i!=null&&i.startFrom){const W=i.startFrom.toLowerCase();if(d==="dictionary"){const X=this.wordlist.indexOf(W);X>=0&&(P=X+1)}else{F=!0;const X=Yk(W);X&&(B=Math.max(u,X.length),S=X.index+1,S>=vl(B)&&(B++,S=0))}}let M=0;p&&!F&&this.wordlist.length>0&&(M+=this.wordlist.length-P);for(let W=B;W<=c;W++)M+=vl(W);M-=S;const H=(W,X,oe)=>{if(!l)return;const ae=(performance.now()-D)/1e3,$=ae>0?Math.round(C/ae):0,he=M-C,q=$>0?he/$:0;l({checked:C,total:M,percent:M>0?Math.min(100,C/M*100):0,rateKeysPerSec:$,etaSeconds:q,elapsedSeconds:ae,currentLength:X,currentPosition:oe,phase:W})},V=W=>{if(!Tv(A,_,W))return{valid:!1};const X=Et.ChannelCrypto.decryptGroupTextMessage(A,_,W);return!X.success||!X.data?{valid:!1}:this.useTimestampFilter&&!Xk(X.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Jk(X.data.message)?{valid:!1}:this.useSenderFilter&&!X.data.sender?{valid:!1}:{valid:!0,message:X.data.sender?`${X.data.sender}: ${X.data.message}`:X.data.message}};if(!F&&P===0&&B===u&&S===0){H("public-key",0,R0);const W=L0(qu);if(x===W){const X=V(qu);if(X.valid)return{found:!0,roomName:R0,key:qu,decryptedMessage:X.message}}}if(p&&!F&&this.wordlist.length>0)for(let W=P;W<this.wordlist.length;W++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[W],resumeType:"dictionary"};const X=this.wordlist[W],oe=F0("#"+X),J=L0(oe);if(parseInt(J,16)===k){const $=V(oe);if($.valid)return{found:!0,roomName:X,key:oe,decryptedMessage:$.message,resumeFrom:X,resumeType:"dictionary"}}C++;const ae=performance.now();ae-b>=200&&(H("wordlist",X.length,X),b=ae,await new Promise($=>setTimeout($,0)))}const z=this.useCpu?1024:32768,te=(i==null?void 0:i.gpuDispatchMs)??1e3;let Z=z,U=!1;for(let W=B;W<=c;W++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es(W,0)||void 0,resumeType:"bruteforce"};const X=vl(W);let oe=W===B?S:0;for(;oe<X;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es(W,oe)||void 0,resumeType:"bruteforce"};const J=Math.min(Z,X-oe),ae=performance.now();let $;this.useCpu?$=this.cpuInstance.runBatch(k,W,oe,J,A,_):$=await this.gpuInstance.runBatch(k,W,oe,J,A,_);const he=performance.now()-ae;if(C+=J,!this.useCpu&&!U&&J>=z&&he>0){const N=te/he,O=Math.round(J*N),G=Math.pow(2,Math.round(Math.log2(Math.max(z,O))));Z=Math.max(z,G),U=!0}for(const N of $){const O=es(W,N);if(!O)continue;const G=F0("#"+O),Q=V(G);if(Q.valid)return{found:!0,roomName:O,key:G,decryptedMessage:Q.message,resumeFrom:O,resumeType:"bruteforce"}}oe+=J;const q=performance.now();if(q-b>=200){const N=es(W,Math.min(oe,X-1))||"";H("bruteforce",W,N),b=q,await new Promise(O=>setTimeout(O,0))}}}return{found:!1,resumeFrom:es(c,vl(c)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var g0,hx;function oS(){return hx||(hx=1,g0={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDi
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(d=>(this.enabled=!0,d)).catch(d=>{throw this.enabled=!1,d})}disable(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):i()?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 x0=c,x0}var aS=sS();const lS=aa(aS);function cS(n){if(n.length<4)return null;try{const i=parseInt(n.slice(0,2),16)&3;let l=2;if(i===0||i===3){if(n.length<l+8)return null;l+=8}if(n.length<l+2)return null;const c=parseInt(n.slice(l,l+2),16);l+=2;const u=c*2;return n.length<l+u?null:(l+=u,n.slice(l))}catch{return null}}function uS({packets:n,channels:s,onChannelCreate:i,onRunningChange:l,visible:c=!1}){const[u,p]=R.useState(!1),[d,g]=R.useState(6),[m,x]=R.useState(!1),[A,_]=R.useState(!0),[k,D]=R.useState(!1),[C,b]=R.useState(null),[B,S]=R.useState(new Map),[P,F]=R.useState([]),[M,H]=R.useState(!1),[V,z]=R.useState(null),[te,Z]=R.useState(null),[U,K]=R.useState(0),W=R.useRef(null),X=R.useRef(null),oe=R.useRef(!1),J=R.useRef(!1),ae=R.useRef(!1),$=R.useRef(new Map),he=R.useRef(!1),q=R.useRef(6),N=R.useRef(!0),O=R.useRef(!1),G=R.useRef(new Set),Q=R.useRef(new Set);R.useEffect(()=>{const Ee=new iS;W.current=Ee,z(Ee.isGpuAvailable());const Ze=new lS;return X.current=Ze,()=>{Ee.destroy(),W.current=null,Ze.disable(),X.current=null}},[]),R.useEffect(()=>{!c||M||Vk(async()=>{const{ENGLISH_WORDLIST:Ee}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Ee}},[]).then(({ENGLISH_WORDLIST:Ee})=>{W.current&&(W.current.setWordlist(Ee),H(!0))}).catch(Ee=>{console.error("Failed to load wordlist:",Ee),At.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[c,M]),R.useEffect(()=>{const Ee=()=>{et.getUndecryptedPacketCount().then(({count:lt})=>Z(lt)).catch(()=>Z(null))};Ee();const Ze=setInterval(Ee,36e5);return()=>clearInterval(Ze)},[]);const ue=R.useMemo(()=>new Set(s.map(Ee=>Ee.key.toUpperCase())),[s]),pe=n.filter(Ee=>Ee.payload_type==="GROUP_TEXT"&&!Ee.decrypted);R.useEffect(()=>{let Ee=0;S(Ze=>{const lt=new Map(Ze);let Mt=!1;for(const ut of pe)if(!lt.has(ut.id)){const mt=cS(ut.data);if(mt&&Q.current.has(mt)){Ee++;continue}mt&&Q.current.add(mt),lt.set(ut.id,{packet:ut,attempts:0,lastAttemptLength:0,status:"pending"}),Mt=!0}return Mt?($.current=lt,lt):Ze}),Ee>0&&K(Ze=>Ze+Ee)},[pe.length]),R.useEffect(()=>{$.current=B},[B]),R.useEffect(()=>{he.current=m},[m]),R.useEffect(()=>{q.current=d},[d]),R.useEffect(()=>{N.current=A},[A]),R.useEffect(()=>{O.current=k},[k]),R.useEffect(()=>{G.current=new Set(pe.map(Ee=>Ee.id))},[pe]),R.useEffect(()=>{l==null||l(u)},[u,l]);const ve=Array.from(B.values()).filter(Ee=>Ee.status==="pending").length,me=Array.from(B.values()).filter(Ee=>Ee.status==="cracked").length,Le=Array.from(B.values()).filter(Ee=>Ee.status==="failed").length,Ke=R.useCallback(async()=>{if(ae.current||!W.current||!oe.current)return;const Ee=$.current;let Ze=null,lt=null;for(const[qe,tt]of Ee.entries())if(tt.status==="pending"){Ze=tt,lt=qe;break}if(!Ze&&he.current){const qe=Array.from(Ee.entries()).filter(([,tt])=>tt.status==="failed"&&tt.lastAttemptLength<10);qe.length>0&&(qe.sort((tt,nt)=>tt[1].lastAttemptLength-nt[1].lastAttemptLength),[lt,Ze]=qe[0])}if(!Ze||lt===null){oe.current&&setTimeout(()=>Ke(),1e3);return}if(!G.current.has(lt)){S(qe=>{const tt=new Map(qe);return tt.delete(lt),tt}),oe.current&&setTimeout(()=>Ke(),10);return}ae.current=!0;const Mt=q.current,ut=Ze.lastAttemptLength>0,mt=ut?Ze.lastAttemptLength+1:Mt;try{const qe=await W.current.crack(Ze.packet.data,{maxLength:mt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...O.current&&{gpuDispatchMs:1e4},...ut&&{useDictionary:!1,startingLength:mt}},tt=>{b(tt)});if(J.current){J.current=!1,ae.current=!1,b(null);return}if(qe.found&&qe.roomName&&qe.key){S(Ve=>{const kt=new Map(Ve),$t=kt.get(lt);return $t&&kt.set(lt,{...$t,status:"cracked",attempts:$t.attempts+1,lastAttemptLength:mt}),kt});const tt={roomName:qe.roomName,key:qe.key,packetId:lt,message:qe.decryptedMessage||"",crackedAt:Date.now()};F(Ve=>[...Ve,tt]);const nt=qe.key.toUpperCase();if(!ue.has(nt))try{const Ve="#"+qe.roomName;await i(Ve,qe.key),N.current&&await et.decryptHistoricalPackets({key_type:"channel",channel_name:Ve})}catch(Ve){console.error("Failed to create channel or decrypt historical:",Ve),At.error("Failed to save cracked channel",{description:Ve instanceof Error?Ve.message:"Channel discovered but could not be saved"})}}else S(tt=>{const nt=new Map(tt),Ve=nt.get(lt);return Ve&&nt.set(lt,{...Ve,status:"failed",attempts:Ve.attempts+1,lastAttemptLength:mt}),nt})}catch(qe){console.error("Cracking error:",qe),S(tt=>{const nt=new Map(tt),Ve=nt.get(lt);return Ve&&nt.set(lt,{...Ve,status:"failed",attempts:Ve.attempts+1,lastAttemptLength:mt}),nt})}ae.current=!1,b(null),oe.current&&setTimeout(()=>Ke(),100)},[ue,i]),bt=()=>{var Ee;if(!V){At.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}p(!0),oe.current=!0,J.current=!1,(Ee=X.current)==null||Ee.enable(),Ke()},ct=()=>{var Ee,Ze;p(!1),oe.current=!1,J.current=!0,(Ee=W.current)==null||Ee.abort(),(Ze=X.current)==null||Ze.d
Line truncated
|
||||
//# sourceMappingURL=index-BBzeYRV9.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"mappings":";;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,EAAE,OAAO,OAAOC,EAAE,GAAG,SAASC,EAAEJ,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAACG,EAAE,UAAU,iBAAiB,GACnQA,EAAE,UAAU,SAAS,SAASJ,EAAEK,EAAE,CAAC,GAAc,OAAOL,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEK,EAAE,UAAU,CAAC,EAAED,EAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASO,GAAG,EAAEA,EAAE,UAAUH,EAAE,UAAU,SAASI,EAAER,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAAC,IAAIQ,EAAED,EAAE,UAAU,IAAID,EACrfE,EAAE,YAAYD,EAAEN,EAAEO,EAAEL,EAAE,SAAS,EAAEK,EAAE,qBAAqB,GAAG,IAAIC,EAAE,MAAM,QAAQC,EAAE,OAAO,UAAU,eAAeC,EAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EACxK,SAASC,EAAEd,EAAEK,EAAEC,EAAE,CAAC,IAAIS,EAAEC,GAAE,GAAGC,GAAE,KAAKC,GAAE,KAAK,GAASb,GAAN,KAAQ,IAAIU,KAAcV,EAAE,MAAX,SAAiBa,GAAEb,EAAE,KAAcA,EAAE,MAAX,SAAiBY,GAAE,GAAGZ,EAAE,KAAKA,EAAEM,EAAE,KAAKN,EAAEU,CAAC,GAAG,CAACF,EAAE,eAAeE,CAAC,IAAIC,GAAED,CAAC,EAAEV,EAAEU,CAAC,GAAG,IAAII,GAAE,UAAU,OAAO,EAAE,GAAOA,KAAJ,EAAMH,GAAE,SAASV,UAAU,EAAEa,GAAE,CAAC,QAAQC,GAAE,MAAMD,EAAC,EAAEE,GAAE,EAAEA,GAAEF,GAAEE,KAAID,GAAEC,EAAC,EAAE,UAAUA,GAAE,CAAC,EAAEL,GAAE,SAASI,EAAC,CAAC,GAAGpB,GAAGA,EAAE,aAAa,IAAIe,KAAKI,GAAEnB,EAAE,aAAamB,GAAWH,GAAED,CAAC,IAAZ,SAAgBC,GAAED,CAAC,EAAEI,GAAEJ,CAAC,GAAG,MAAM,CAAC,SAAS5B,EAAE,KAAKa,EAAE,IAAIiB,GAAE,IAAIC,GAAE,MAAMF,GAAE,OAAOJ,EAAE,OAAO,CAAC,CAC7a,SAASU,GAAEtB,EAAEK,EAAE,CAAC,MAAM,CAAC,SAASlB,EAAE,KAAKa,EAAE,KAAK,IAAIK,EAAE,IAAIL,EAAE,IAAI,MAAMA,EAAE,MAAM,OAAOA,EAAE,MAAM,CAAC,CAAC,SAASuB,EAAEvB,EAAE,CAAC,OAAiB,OAAOA,GAAlB,UAA4BA,IAAP,MAAUA,EAAE,WAAWb,CAAC,CAAC,SAASqC,EAAOxB,EAAE,CAAC,IAAIK,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIL,EAAE,QAAQ,QAAQ,SAASA,EAAE,CAAC,OAAOK,EAAEL,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIyB,EAAE,OAAO,SAASC,EAAE1B,EAAEK,EAAE,CAAC,OAAiB,OAAOL,GAAlB,UAA4BA,IAAP,MAAgBA,EAAE,KAAR,KAAYwB,EAAO,GAAGxB,EAAE,GAAG,EAAEK,EAAE,SAAS,EAAE,CAAC,CAC/W,SAASsB,EAAE3B,EAAEK,EAAEC,EAAES,EAAEC,GAAE,CAAC,IAAIC,GAAE,OAAOjB,GAAmBiB,KAAd,aAA6BA,KAAZ,aAAcjB,EAAE,MAAK,IAAIkB,GAAE,GAAG,GAAUlB,IAAP,KAASkB,GAAE,OAAQ,QAAOD,GAAC,CAAE,IAAK,SAAS,IAAK,SAASC,GAAE,GAAG,MAAM,IAAK,SAAS,OAAOlB,EAAE,SAAQ,CAAE,KAAKb,EAAE,KAAKC,EAAE8B,GAAE,EAAE,CAAC,CAAC,GAAGA,GAAE,OAAOA,GAAElB,EAAEgB,GAAEA,GAAEE,EAAC,EAAElB,EAAOe,IAAL,GAAO,IAAIW,EAAER,GAAE,CAAC,EAAEH,EAAEL,EAAEM,EAAC,GAAGV,EAAE,GAASN,GAAN,OAAUM,EAAEN,EAAE,QAAQyB,EAAE,KAAK,EAAE,KAAKE,EAAEX,GAAEX,EAAEC,EAAE,GAAG,SAASN,GAAE,CAAC,OAAOA,EAAC,CAAC,GAASgB,IAAN,OAAUO,EAAEP,EAAC,IAAIA,GAAEM,GAAEN,GAAEV,GAAG,CAACU,GAAE,KAAKE,IAAGA,GAAE,MAAMF,GAAE,IAAI,IAAI,GAAGA,GAAE,KAAK,QAAQS,EAAE,KAAK,EAAE,KAAKzB,CAAC,GAAGK,EAAE,KAAKW,EAAC,GAAG,EAAyB,GAAvBE,GAAE,EAAEH,EAAOA,IAAL,GAAO,IAAIA,EAAE,IAAOL,EAAEV,CAAC,EAAE,QAAQmB,GAAE,EAAEA,GAAEnB,EAAE,OAAOmB,KAAI,CAACF,GACrfjB,EAAEmB,EAAC,EAAE,IAAIC,GAAEL,EAAEW,EAAET,GAAEE,EAAC,EAAED,IAAGS,EAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,CAAC,SAASI,GAAErB,EAAEC,CAAC,EAAe,OAAOoB,IAApB,WAAsB,IAAIpB,EAAEoB,GAAE,KAAKpB,CAAC,EAAEmB,GAAE,EAAE,EAAEF,GAAEjB,EAAE,KAAI,GAAI,MAAMiB,GAAEA,GAAE,MAAMG,GAAEL,EAAEW,EAAET,GAAEE,IAAG,EAAED,IAAGS,EAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,UAAqBC,KAAX,SAAa,MAAMZ,EAAE,OAAOL,CAAC,EAAE,MAAM,mDAAuEK,IAApB,kBAAsB,qBAAqB,OAAO,KAAKL,CAAC,EAAE,KAAK,IAAI,EAAE,IAAIK,GAAG,2EAA2E,EAAE,OAAOa,EAAC,CACzZ,SAASU,GAAE5B,EAAEK,EAAEC,EAAE,CAAC,GAASN,GAAN,KAAQ,OAAOA,EAAE,IAAIe,EAAE,GAAGC,GAAE,EAAE,OAAAW,EAAE3B,EAAEe,EAAE,GAAG,GAAG,SAASf,GAAE,CAAC,OAAOK,EAAE,KAAKC,EAAEN,GAAEgB,IAAG,CAAC,CAAC,EAASD,CAAC,CAAC,SAASc,EAAE7B,EAAE,CAAC,GAAQA,EAAE,UAAP,GAAe,CAAC,IAAIK,EAAEL,EAAE,QAAQK,EAAEA,EAAC,EAAGA,EAAE,KAAK,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,EAAE,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,CAAC,EAAOL,EAAE,UAAP,KAAiBA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAE,CAAC,GAAOL,EAAE,UAAN,EAAc,OAAOA,EAAE,QAAQ,QAAQ,MAAMA,EAAE,OAAQ,CAC5Z,IAAI8B,GAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,WAAW,IAAI,EAAEC,GAAE,CAAC,uBAAuBF,GAAE,wBAAwBC,EAAE,kBAAkBnB,CAAC,EAAE,SAASqB,GAAG,CAAC,MAAM,MAAM,0DAA0D,CAAE,CACzM,OAAAC,GAAA,SAAiB,CAAC,IAAIN,GAAE,QAAQ,SAAS5B,EAAEK,EAAEC,EAAE,CAACsB,GAAE5B,EAAE,UAAU,CAACK,EAAE,MAAM,KAAK,SAAS,CAAC,EAAEC,CAAC,CAAC,EAAE,MAAM,SAASN,EAAE,CAAC,IAAIK,EAAE,EAAE,OAAAuB,GAAE5B,EAAE,UAAU,CAACK,GAAG,CAAC,EAASA,CAAC,EAAE,QAAQ,SAASL,EAAE,CAAC,OAAO4B,GAAE5B,EAAE,SAASA,EAAE,CAAC,OAAOA,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,SAASA,EAAE,CAAC,GAAG,CAACuB,EAAEvB,CAAC,EAAE,Line truncated
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottLine truncated
|
||||
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottLine truncated
|
||||
+542
@@ -0,0 +1,542 @@
|
||||
var my=Object.defineProperty;var gy=(n,s,i)=>s in n?my(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i;var Wo=(n,s,i)=>gy(n,typeof s!="symbol"?s+"":s,i);function xy(n,s){for(var i=0;i<s.length;i++){const l=s[i];if(typeof l!="string"&&!Array.isArray(l)){for(const c in l)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(l,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>l[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const p of u.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();var Kf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function mx(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var s=n.default;if(typeof s=="function"){var i=function l(){return this instanceof l?Reflect.construct(s,arguments,this.constructor):s.apply(this,arguments)};i.prototype=s.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(l){var c=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(i,l,c.get?c:{enumerable:!0,get:function(){return n[l]}})}),i}var Qf={exports:{}},el={},Yf={exports:{}},pt={};/**
|
||||
* @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 $p;function Ay(){if($p)return pt;$p=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),p=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),A=Symbol.iterator;function _(N){return N===null||typeof N!="object"?null:(N=A&&N[A]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,C={};function b(N,U,$){this.props=N,this.context=U,this.refs=C,this.updater=$||k}b.prototype.isReactComponent={},b.prototype.setState=function(N,U){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,U,"setState")},b.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function B(){}B.prototype=b.prototype;function S(N,U,$){this.props=N,this.context=U,this.refs=C,this.updater=$||k}var T=S.prototype=new B;T.constructor=S,R(T,b.prototype),T.isPureReactComponent=!0;var F=Array.isArray,M=Object.prototype.hasOwnProperty,z={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function j(N,U,$){var Z,ae={},de=null,Ae=null;if(U!=null)for(Z in U.ref!==void 0&&(Ae=U.ref),U.key!==void 0&&(de=""+U.key),U)M.call(U,Z)&&!V.hasOwnProperty(Z)&&(ae[Z]=U[Z]);var me=arguments.length-2;if(me===1)ae.children=$;else if(1<me){for(var He=Array(me),qe=0;qe<me;qe++)He[qe]=arguments[qe+2];ae.children=He}if(N&&N.defaultProps)for(Z in me=N.defaultProps,me)ae[Z]===void 0&&(ae[Z]=me[Z]);return{$$typeof:n,type:N,key:de,ref:Ae,props:ae,_owner:z.current}}function J(N,U){return{$$typeof:n,type:N.type,key:U,ref:N.ref,props:N.props,_owner:N._owner}}function W(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function K(N){var U={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function($){return U[$]})}var ne=/\/+/g;function H(N,U){return typeof N=="object"&&N!==null&&N.key!=null?K(""+N.key):U.toString(36)}function Y(N,U,$,Z,ae){var de=typeof N;(de==="undefined"||de==="boolean")&&(N=null);var Ae=!1;if(N===null)Ae=!0;else switch(de){case"string":case"number":Ae=!0;break;case"object":switch(N.$$typeof){case n:case s:Ae=!0}}if(Ae)return Ae=N,ae=ae(Ae),N=Z===""?"."+H(Ae,0):Z,F(ae)?($="",N!=null&&($=N.replace(ne,"$&/")+"/"),Y(ae,U,$,"",function(qe){return qe})):ae!=null&&(W(ae)&&(ae=J(ae,$+(!ae.key||Ae&&Ae.key===ae.key?"":(""+ae.key).replace(ne,"$&/")+"/")+N)),U.push(ae)),1;if(Ae=0,Z=Z===""?".":Z+":",F(N))for(var me=0;me<N.length;me++){de=N[me];var He=Z+H(de,me);Ae+=Y(de,U,$,He,ae)}else if(He=_(N),typeof He=="function")for(N=He.call(N),me=0;!(de=N.next()).done;)de=de.value,He=Z+H(de,me++),Ae+=Y(de,U,$,He,ae);else if(de==="object")throw U=String(N),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return Ae}function oe(N,U,$){if(N==null)return N;var Z=[],ae=0;return Y(N,Z,"","",function(de){return U.call($,de,ae++)}),Z}function ee(N){if(N._status===-1){var U=N._result;U=U(),U.then(function($){(N._status===0||N._status===-1)&&(N._status=1,N._result=$)},function($){(N._status===0||N._status===-1)&&(N._status=2,N._result=$)}),N._status===-1&&(N._status=0,N._result=U)}if(N._status===1)return N._result.default;throw N._result}var se={current:null},q={transition:null},le={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:q,ReactCurrentOwner:z};function G(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:oe,forEach:function(N,U,$){oe(N,function(){U.apply(this,arguments)},$)},count:function(N){var U=0;return oe(N,function(){U++}),U},toArray:function(N){return oe(N,function(U){return U})||[]},only:function(N){if(!W(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},pt.Component=b,pt.Fragment=i,pt.Profiler=c,pt.PureComponent=S,pt.StrictMode=l,pt.Suspense=g,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,pt.act=G,pt.cloneElement=function(N,U,$){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var Z=R({},N.props),ae=N.key,de=N.ref,Ae=N._owner;if(U!=null){if(U.ref!==void 0&&(de=U.ref,Ae=z.current),U.key!==void 0&&(ae=""+U.key),N.type&&N.type.defaultProps)var me=N.type.defaultProps;for(He in U)M.call(U,He)&&!V.hasOwnProperty(He)&&(Z[He]=U[He]===void 0&&me!==void 0?me[He]:U[He])}var He=arguments.length-2;if(He===1)Z.children=$;else if(1<He){me=Array(He);for(var qe=0;qe<He;qe++)me[qe]=arguments[qe+2];Z.children=me}return{$$typeof:n,type:N.type,key:ae,ref:de,props:Z,_owner:Ae}},pt.createCoLine 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 Qp;function vy(){if(Qp)return el;Qp=1;var n=M0(),s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function p(d,g,m){var x,A={},_=null,k=null;m!==void 0&&(_=""+m),g.key!==void 0&&(_=""+g.key),g.ref!==void 0&&(k=g.ref);for(x in g)l.call(g,x)&&!u.hasOwnProperty(x)&&(A[x]=g[x]);if(d&&d.defaultProps)for(x in g=d.defaultProps,g)A[x]===void 0&&(A[x]=g[x]);return{$$typeof:s,type:d,key:_,ref:k,props:A,_owner:c.current}}return el.Fragment=i,el.jsx=p,el.jsxs=p,el}var Yp;function yy(){return Yp||(Yp=1,Qf.exports=vy()),Qf.exports}var w=yy(),D=M0();const Ee=aa(D),I0=xy({__proto__:null,default:Ee},[D]);var Vc={},Xf={exports:{}},Kn={},Jf={exports:{}},e0={};/**
|
||||
* @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 Xp;function _y(){return Xp||(Xp=1,(function(n){function s(q,le){var G=q.length;q.push(le);e:for(;0<G;){var N=G-1>>>1,U=q[N];if(0<c(U,le))q[N]=le,q[G]=U,G=N;else break e}}function i(q){return q.length===0?null:q[0]}function l(q){if(q.length===0)return null;var le=q[0],G=q.pop();if(G!==le){q[0]=G;e:for(var N=0,U=q.length,$=U>>>1;N<$;){var Z=2*(N+1)-1,ae=q[Z],de=Z+1,Ae=q[de];if(0>c(ae,G))de<U&&0>c(Ae,ae)?(q[N]=Ae,q[de]=G,N=de):(q[N]=ae,q[Z]=G,N=Z);else if(de<U&&0>c(Ae,G))q[N]=Ae,q[de]=G,N=de;else break e}}return le}function c(q,le){var G=q.sortIndex-le.sortIndex;return G!==0?G:q.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var p=Date,d=p.now();n.unstable_now=function(){return p.now()-d}}var g=[],m=[],x=1,A=null,_=3,k=!1,R=!1,C=!1,b=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(q){for(var le=i(m);le!==null;){if(le.callback===null)l(m);else if(le.startTime<=q)l(m),le.sortIndex=le.expirationTime,s(g,le);else break;le=i(m)}}function F(q){if(C=!1,T(q),!R)if(i(g)!==null)R=!0,ee(M);else{var le=i(m);le!==null&&se(F,le.startTime-q)}}function M(q,le){R=!1,C&&(C=!1,B(j),j=-1),k=!0;var G=_;try{for(T(le),A=i(g);A!==null&&(!(A.expirationTime>le)||q&&!K());){var N=A.callback;if(typeof N=="function"){A.callback=null,_=A.priorityLevel;var U=N(A.expirationTime<=le);le=n.unstable_now(),typeof U=="function"?A.callback=U:A===i(g)&&l(g),T(le)}else l(g);A=i(g)}if(A!==null)var $=!0;else{var Z=i(m);Z!==null&&se(F,Z.startTime-le),$=!1}return $}finally{A=null,_=G,k=!1}}var z=!1,V=null,j=-1,J=5,W=-1;function K(){return!(n.unstable_now()-W<J)}function ne(){if(V!==null){var q=n.unstable_now();W=q;var le=!0;try{le=V(!0,q)}finally{le?H():(z=!1,V=null)}}else z=!1}var H;if(typeof S=="function")H=function(){S(ne)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,oe=Y.port2;Y.port1.onmessage=ne,H=function(){oe.postMessage(null)}}else H=function(){b(ne,0)};function ee(q){V=q,z||(z=!0,H())}function se(q,le){j=b(function(){q(n.unstable_now())},le)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(q){q.callback=null},n.unstable_continueExecution=function(){R||k||(R=!0,ee(M))},n.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<q?Math.floor(1e3/q):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_getFirstCallbackNode=function(){return i(g)},n.unstable_next=function(q){switch(_){case 1:case 2:case 3:var le=3;break;default:le=_}var G=_;_=le;try{return q()}finally{_=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(q,le){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var G=_;_=q;try{return le()}finally{_=G}},n.unstable_scheduleCallback=function(q,le,G){var N=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?N+G:N):G=N,q){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=G+U,q={id:x++,callback:le,priorityLevel:q,startTime:G,expirationTime:U,sortIndex:-1},G>N?(q.sortIndex=G,s(m,q),i(g)===null&&q===i(m)&&(C?(B(j),j=-1):C=!0,se(F,G-N))):(q.sortIndex=U,s(g,q),R||k||(R=!0,ee(M))),q},n.unstable_shouldYield=K,n.unstable_wrapCallback=function(q){var le=_;return function(){var G=_;_=le;try{return q.apply(this,arguments)}finally{_=G}}}})(e0)),e0}var Jp;function wy(){return Jp||(Jp=1,Jf.exports=_y()),Jf.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 em;function by(){if(em)return Kn;em=1;var n=M0(),s=wy();function i(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,c={};function u(e,r){p(e,r),p(e+"Capture",r)}function p(e,r){for(c[e]=r,e=0;e<r.length;e++)l.add(r[e])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,x={},A={};function _(e){return g.call(A,e)?!0:g.call(x,e)?!1:m.test(e)?A[e]=!0:(x[e]=!0,!1)}function k(e,r,a,h){if(a!==null&&a.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return h?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R(e,r,a,h){if(r===null||typeof r>"u"||k(e,r,a,h))return!0;if(h)return!1;if(a!==null)switch(a.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function C(e,r,a,h,y,E,I){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=h,this.attributeNamespace=y,this.mustUseProperty=a,this.propertyName=e,this.type=r,this.sanitizeURL=E,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];b[r]=new C(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new C(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){b[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function S(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 r=e.replace(B,S);b[r]=new C(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(B,S);b[r]=new C(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(B,S);b[r]=new C(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function T(e,r,a,h){var y=b.hasOwnProperty(r)?b[r]:null;(y!==null?y.type!==0:h||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=
Line truncated
|
||||
`+N+e}var $=!1;function Z(e,r){if(!e||$)return"";$=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(pe){var h=pe}Reflect.construct(e,[],r)}else{try{r.call()}catch(pe){h=pe}e.call(r.prototype)}else{try{throw Error()}catch(pe){h=pe}e()}}catch(pe){if(pe&&h&&typeof pe.stack=="string"){for(var y=pe.stack.split(`
|
||||
`),E=h.stack.split(`
|
||||
`),I=y.length-1,Q=E.length-1;1<=I&&0<=Q&&y[I]!==E[Q];)Q--;for(;1<=I&&0<=Q;I--,Q--)if(y[I]!==E[Q]){if(I!==1||Q!==1)do if(I--,Q--,0>Q||y[I]!==E[Q]){var te=`
|
||||
`+y[I].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=I&&0<=Q);break}}}finally{$=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?U(e):""}function ae(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=Z(e.type,!1),e;case 11:return e=Z(e.type.render,!1),e;case 1:return e=Z(e.type,!0),e;default:return""}}function de(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 V:return"Fragment";case z:return"Portal";case J:return"Profiler";case j:return"StrictMode";case H:return"Suspense";case Y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K:return(e.displayName||"Context")+".Consumer";case W:return(e._context.displayName||"Context")+".Provider";case ne:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return r=e.displayName||null,r!==null?r:de(e.type)||"Memo";case ee:r=e._payload,e=e._init;try{return de(e(r))}catch{}}return null}function Ae(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(r);case 8:return r===j?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function me(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function He(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function qe(e){var r=He(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),h=""+e[r];if(!e.hasOwnProperty(r)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var y=a.get,E=a.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return y.call(this)},set:function(I){h=""+I,E.call(this,I)}}),Object.defineProperty(e,r,{enumerable:a.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function ot(e){e._valueTracker||(e._valueTracker=qe(e))}function dt(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),h="";return e&&(h=He(e)?e.checked?"true":"false":e.value),e=h,e!==a?(r.setValue(e),!0):!1}function Be(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 Ze(e,r){var a=r.checked;return G({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Qe(e,r){var a=r.defaultValue==null?"":r.defaultValue,h=r.checked!=null?r.checked:r.defaultChecked;a=me(r.value!=null?r.value:a),e._wrapperState={initialChecked:h,initialValue:a,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Bt(e,r){r=r.checked,r!=null&&T(e,"checked",r,!1)}function lt(e,r){Bt(e,r);var a=me(r.value),h=r.type;if(a!=null)h==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Ge(e,r.type,a):r.hasOwnProperty("defaultValue")&&Ge(e,r.type,me(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function gt(e,r,a){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var h=r.type;if(!(h!=="submit"&&h!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,a||r===e.value||(e.value=r),e.defaultValue=r}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function Ge(e,r,a){(r!=="number"||Be(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var nt=Array.isArray;function rt(e,r,a,h){if(e=e.options,r){r={};for(var y=0;y<a.length;y++)r["$"+a[y]]=!0;for(a=0;a<e.length;a++)y=r.hasOwnProperty("$"+e[a].value),e[a].selected!==y&&(e[a].selected=y),y&&h&&(e[a].defaultSelected=!0)}else{for(a=""+me(a),r=null,y=0;y<e.length;y++){if(e[y].value===a){e[y].selected=!0,h&&(e[y].defaultSelected=!0);return}r!==null||e[y].disabled||(r=e[y])}r!==null&&(r.selected=!0)}}function Ve(e,r){if(r.dangerouslySetInner
Line truncated
|
||||
`).replace(X,"")}function he(e,r,a){if(r=ce(r),ce(e)!==r&&a)throw Error(i(425))}function ve(){}var Pe=null,We=null;function st(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ln=typeof setTimeout=="function"?setTimeout:void 0,rn=typeof clearTimeout=="function"?clearTimeout:void 0,Ln=typeof Promise=="function"?Promise:void 0,Sn=typeof queueMicrotask=="function"?queueMicrotask:typeof Ln<"u"?function(e){return Ln.resolve(null).then(e).catch(Yi)}:ln;function Yi(e){setTimeout(function(){throw e})}function ja(e,r){var a=r,h=0;do{var y=a.nextSibling;if(e.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"){if(h===0){e.removeChild(y),nr(r);return}h--}else a!=="$"&&a!=="$?"&&a!=="$!"||h++;a=y}while(a);nr(r)}function Yr(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function rc(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return e;r--}else a==="/$"&&r++}e=e.previousSibling}return null}var mi=Math.random().toString(36).slice(2),xr="__reactFiber$"+mi,Xi="__reactProps$"+mi,St="__reactContainer$"+mi,Ji="__reactEvents$"+mi,Ud="__reactListeners$"+mi,Zd="__reactHandles$"+mi;function gi(e){var r=e[xr];if(r)return r;for(var a=e.parentNode;a;){if(r=a[St]||a[xr]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=rc(e);e!==null;){if(a=e[xr])return a;e=rc(e)}return r}e=a,a=e.parentNode}return null}function xi(e){return e=e[xr]||e[St],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ai(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Ns(e){return e[Xi]||null}var Wd=[],Fs=-1;function eo(e){return{current:e}}function Ot(e){0>Fs||(e.current=Wd[Fs],Wd[Fs]=null,Fs--)}function Mt(e,r){Fs++,Wd[Fs]=e.current,e.current=r}var to={},Bn=eo(to),Zn=eo(!1),Fo=to;function Ls(e,r){var a=e.type.contextTypes;if(!a)return to;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===r)return h.__reactInternalMemoizedMaskedChildContext;var y={},E;for(E in a)y[E]=r[E];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=y),y}function Wn(e){return e=e.childContextTypes,e!=null}function ic(){Ot(Zn),Ot(Bn)}function gh(e,r,a){if(Bn.current!==to)throw Error(i(168));Mt(Bn,r),Mt(Zn,a)}function xh(e,r,a){var h=e.stateNode;if(r=r.childContextTypes,typeof h.getChildContext!="function")return a;h=h.getChildContext();for(var y in h)if(!(y in r))throw Error(i(108,Ae(e)||"Unknown",y));return G({},a,h)}function oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Fo=Bn.current,Mt(Bn,e),Mt(Zn,Zn.current),!0}function Ah(e,r,a){var h=e.stateNode;if(!h)throw Error(i(169));a?(e=xh(e,r,Fo),h.__reactInternalMemoizedMergedChildContext=e,Ot(Zn),Ot(Bn),Mt(Bn,e)):Ot(Zn),Mt(Zn,a)}var vi=null,sc=!1,qd=!1;function vh(e){vi===null?vi=[e]:vi.push(e)}function Fv(e){sc=!0,vh(e)}function no(){if(!qd&&vi!==null){qd=!0;var e=0,r=yt;try{var a=vi;for(yt=1;e<a.length;e++){var h=a[e];do h=h(!0);while(h!==null)}vi=null,sc=!1}catch(y){throw vi!==null&&(vi=vi.slice(e+1)),Nl(pa,no),y}finally{yt=r,qd=!1}}return null}var Ms=[],Is=0,ac=null,lc=0,Ar=[],vr=0,Lo=null,yi=1,_i="";function Mo(e,r){Ms[Is++]=lc,Ms[Is++]=ac,ac=e,lc=r}function yh(e,r,a){Ar[vr++]=yi,Ar[vr++]=_i,Ar[vr++]=Lo,Lo=e;var h=yi;e=_i;var y=32-it(h)-1;h&=~(1<<y),a+=1;var E=32-it(r)+y;if(30<E){var I=y-y%5;E=(h&(1<<I)-1).toString(32),h>>=I,y-=I,yi=1<<32-it(r)+y|a<<y|h,_i=E+e}else yi=1<<E|a<<y|h,_i=e}function Gd(e){e.return!==null&&(Mo(e,1),yh(e,1,0))}function $d(e){for(;e===ac;)ac=Ms[--Is],Ms[Is]=null,lc=Ms[--Is],Ms[Is]=null;for(;e===Lo;)Lo=Ar[--vr],Ar[vr]=null,_i=Ar[--vr],Ar[vr]=null,yi=Ar[--vr],Ar[vr]=null}var ar=null,lr=null,Vt=!1,Nr=null;function _h(e,r){var a=br(5,null,null,0);a.elementType="DELETED",a.stateNode=r,a.return=e,r=e.deletions,r===null?(e.deletions=[a],e.flags|=16):r.push(a)}function wh(e,r){switch(e.tag){case 5:var a=e.type;return r=r.nodeType!==1||a.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,ar=e,lr=Yr(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,ar=e,lr=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=Lo!==null?{id:yi,overflow:_i}:null,e.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=br(18,null,null,0),a.stateNode=r,a.return=e,e.child=a,ar=e,lr=null,!0):!1;default:return!1}}function Kd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qd(e){if(Vt){var r=lr;if(r){var a=r;if(!wh(e,r)){if(Kd(e))throw Error(i(418));r=Yr(a.nextSibling);var h=ar;r&&wh(e,r)?_h(h,a):(e.flags=e.flags&-4097|2,Vt=!1,ar=e)}}else{if(Kd(e))throw Error(i(418));e.flags=e.flags&-4097|2,Vt=!1,ar=e}}}function bh(e){for(e=e.r
Line truncated
|
||||
Error generating stack: `+E.message+`
|
||||
`+E.stack}return{value:e,source:r,stack:y,digest:null}}function vf(e,r,a){return{value:e,source:null,stack:a??null,digest:r??null}}function yf(e,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var Uv=typeof WeakMap=="function"?WeakMap:Map;function rp(e,r,a){a=bi(-1,a),a.tag=3,a.payload={element:null};var h=r.value;return a.callback=function(){Bc||(Bc=!0,Lf=h),yf(e,r)},a}function ip(e,r,a){a=bi(-1,a),a.tag=3;var h=e.type.getDerivedStateFromError;if(typeof h=="function"){var y=r.value;a.payload=function(){return h(y)},a.callback=function(){yf(e,r)}}var E=e.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(a.callback=function(){yf(e,r),typeof h!="function"&&(so===null?so=new Set([this]):so.add(this));var I=r.stack;this.componentDidCatch(r.value,{componentStack:I!==null?I:""})}),a}function op(e,r,a){var h=e.pingCache;if(h===null){h=e.pingCache=new Uv;var y=new Set;h.set(r,y)}else y=h.get(r),y===void 0&&(y=new Set,h.set(r,y));y.has(a)||(y.add(a),e=ry.bind(null,e,r,a),r.then(e,e))}function sp(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function ap(e,r,a,h,y){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(r=bi(-1,1),r.tag=2,io(a,r,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=y,e)}var Zv=F.ReactCurrentOwner,qn=!1;function Mn(e,r,a,h){r.child=e===null?Sh(r,null,a,h):js(r,e.child,a,h)}function lp(e,r,a,h,y){a=a.render;var E=r.ref;return Hs(r,y),h=df(e,r,a,h,E,y),a=ff(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Vt&&a&&Gd(r),r.flags|=1,Mn(e,r,h,y),r.child)}function cp(e,r,a,h,y){if(e===null){var E=a.type;return typeof E=="function"&&!Vf(E)&&E.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=E,up(e,r,E,h,y)):(e=Fc(a.type,null,h,r,r.mode,y),e.ref=r.ref,e.return=r,r.child=e)}if(E=e.child,(e.lanes&y)===0){var I=E.memoizedProps;if(a=a.compare,a=a!==null?a:$r,a(I,h)&&e.ref===r.ref)return Ci(e,r,y)}return r.flags|=1,e=uo(E,h),e.ref=r.ref,e.return=r,r.child=e}function up(e,r,a,h,y){if(e!==null){var E=e.memoizedProps;if($r(E,h)&&e.ref===r.ref)if(qn=!1,r.pendingProps=h=E,(e.lanes&y)!==0)(e.flags&131072)!==0&&(qn=!0);else return r.lanes=e.lanes,Ci(e,r,y)}return _f(e,r,a,h,y)}function dp(e,r,a){var h=r.pendingProps,y=h.children,E=e!==null?e.memoizedState:null;if(h.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Ws,cr),cr|=a;else{if((a&1073741824)===0)return e=E!==null?E.baseLanes|a:a,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,Mt(Ws,cr),cr|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=E!==null?E.baseLanes:a,Mt(Ws,cr),cr|=h}else E!==null?(h=E.baseLanes|a,r.memoizedState=null):h=a,Mt(Ws,cr),cr|=h;return Mn(e,r,y,a),r.child}function fp(e,r){var a=r.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function _f(e,r,a,h,y){var E=Wn(a)?Fo:Bn.current;return E=Ls(r,E),Hs(r,y),a=df(e,r,a,h,E,y),h=ff(),e!==null&&!qn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~y,Ci(e,r,y)):(Vt&&h&&Gd(r),r.flags|=1,Mn(e,r,a,y),r.child)}function hp(e,r,a,h,y){if(Wn(a)){var E=!0;oc(r)}else E=!1;if(Hs(r,y),r.stateNode===null)bc(e,r),tp(r,a,h),Af(r,a,h,y),h=!0;else if(e===null){var I=r.stateNode,Q=r.memoizedProps;I.props=Q;var te=I.context,pe=a.contextType;typeof pe=="object"&&pe!==null?pe=yr(pe):(pe=Wn(a)?Fo:Bn.current,pe=Ls(r,pe));var we=a.getDerivedStateFromProps,be=typeof we=="function"||typeof I.getSnapshotBeforeUpdate=="function";be||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Q!==h||te!==pe)&&np(r,I,h,pe),ro=!1;var ye=r.memoizedState;I.state=ye,pc(r,h,I,y),te=r.memoizedState,Q!==h||ye!==te||Zn.current||ro?(typeof we=="function"&&(xf(r,a,we,h),te=r.memoizedState),(Q=ro||ep(r,a,Q,h,ye,te,pe))?(be||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(r.flags|=4194308)):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=te),I.props=h,I.state=te,I.context=pe,h=Q):(typeof I.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{I=r.stateNode,Ph(e,r),Q=r.memoizedProps,pe=r.type===r.elementType?Q:Fr(r.type,Q),I.props=pe,be=r.pendingProps,ye=I.context,te=a.contextType,typeof te=="object"&&te!==null?te=yr(te):(te=Wn(a)?Fo:Bn.current,te=Ls(r,te));var Fe=a.getDerivedStateFromProps;(we=typeof Fe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Q!==be||ye!==te)&&np(r,I,
Line truncated
|
||||
`)}function $s(n,s,i){const l=Math.floor(Date.now()/1e3);return{id:-Date.now(),type:"PRIV",conversation_key:n,text:s,sender_timestamp:l,received_at:l,paths:null,txt_type:0,signature:null,outgoing:i,acked:1}}function Ry(n){const s=D.useRef(null),i=D.useRef(null),l=D.useCallback(()=>{i.current!==null&&(clearInterval(i.current),i.current=null),s.current=null},[]),c=D.useCallback(async()=>{const p=s.current;if(!p)return;let d=null,g=null;for(let m=0;m<2;m++)try{d=await tt.requestTelemetry(p.conversationId,"");break}catch(x){g=x instanceof Error?x:new Error("Unknown error"),m===0&&await new Promise(A=>setTimeout(A,2e3))}if(d){const m=$s(p.conversationId,Dy(p,d),!1);n(x=>[...x,m])}else{const m=$s(p.conversationId,`Duty cycle poll failed after retry: ${(g==null?void 0:g.message)??"Unknown error"}`,!1);n(x=>[...x,m])}},[n]),u=D.useCallback(async(p,d)=>{const g=p.trim().toLowerCase();if(g==="dutycycle_start"){l();let m=null,x=null;for(let k=0;k<2;k++)try{m=await tt.requestTelemetry(d,"");break}catch(R){x=R instanceof Error?R:new Error("Unknown error"),k===0&&await new Promise(C=>setTimeout(C,2e3))}if(!m){const k=$s(d,`Failed to start duty cycle tracking after retry: ${(x==null?void 0:x.message)??"Unknown error"}`,!1);return n(R=>[...R,k]),!0}const A=Math.floor(Date.now()/1e3);s.current={startTime:A,uptime:m.uptime_seconds,txAirtime:m.airtime_seconds,rxAirtime:m.rx_airtime_seconds,sentFlood:m.sent_flood,sentDirect:m.sent_direct,recvFlood:m.recv_flood,recvDirect:m.recv_direct,conversationId:d};const _=$s(d,`Airtime/duty cycle statistics gathering begins at ${A}. Logs will follow every 5 minutes. To stop, run dutycycle_stop or navigate away from this conversation.`,!1);return n(k=>[...k,_]),i.current=window.setInterval(c,Py),!0}if(g==="dutycycle_stop"){if(s.current&&s.current.conversationId===d){await c(),l();const m=$s(d,"Airtime/duty cycle statistics gathering stopped.",!1);n(x=>[...x,m])}else{const m=$s(d,"Duty cycle tracking is not active.",!1);n(x=>[...x,m])}return!0}return!1},[n,l,c]);return D.useEffect(()=>()=>{i.current!==null&&clearInterval(i.current)},[]),{handleAirtimeCommand:u,stopTracking:l}}function nu(n){if(n<60)return`${n}s`;const s=Math.floor(n/86400),i=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return s>0?i>0&&l>0?`${s}d${i}h${l}m`:i>0?`${s}d${i}h`:l>0?`${s}d${l}m`:`${s}d`:i>0?l>0?`${i}h${l}m`:`${i}h`:`${l}m`}function Ny(n){return["Telemetry",`Battery Voltage: ${n.battery_volts.toFixed(3)}V`,`Uptime: ${nu(n.uptime_seconds)}`,`TX Airtime: ${nu(n.airtime_seconds)}`,`RX Airtime: ${nu(n.rx_airtime_seconds)}`,"",`Noise Floor: ${n.noise_floor_dbm} dBm`,`Last RSSI: ${n.last_rssi_dbm} dBm`,`Last SNR: ${n.last_snr_db.toFixed(1)} dB`,"",`Packets: ${n.packets_received.toLocaleString()} rx / ${n.packets_sent.toLocaleString()} tx`,`Flood: ${n.recv_flood.toLocaleString()} rx / ${n.sent_flood.toLocaleString()} tx`,`Direct: ${n.recv_direct.toLocaleString()} rx / ${n.sent_direct.toLocaleString()} tx`,`Duplicates: ${n.flood_dups.toLocaleString()} flood / ${n.direct_dups.toLocaleString()} direct`,"",`TX Queue: ${n.tx_queue_len}`,`Debug Flags: ${n.full_events}`].join(`
|
||||
`)}function Fy(n){if(n.length===0)return`Neighbors
|
||||
No neighbors reported`;const s=[...n].sort((l,c)=>c.snr-l.snr),i=[`Neighbors (${s.length})`];for(const l of s){const c=l.name||l.pubkey_prefix,u=l.snr>=0?`+${l.snr.toFixed(1)}`:l.snr.toFixed(1);i.push(`${c}, ${u} dB [${nu(l.last_heard_seconds)} ago]`)}return i.join(`
|
||||
`)}function Ly(n){if(n.length===0)return`ACL
|
||||
No ACL entries`;const s=[`ACL (${n.length})`];for(const i of n){const l=i.name||i.pubkey_prefix;s.push(`${l}: ${i.permission_name}`)}return s.join(`
|
||||
`)}function qo(n,s,i,l=0){const c=Math.floor(Date.now()/1e3);return{id:-Date.now()-l,type:"PRIV",conversation_key:n,text:s,sender_timestamp:c,received_at:c,paths:null,txt_type:0,signature:null,outgoing:i,acked:1}}function My(n,s,i){const[l,c]=D.useState(!1),{handleAirtimeCommand:u,stopTracking:p}=Ry(i);D.useEffect(()=>{c(!1),p()},[n==null?void 0:n.id,p]);const d=D.useMemo(()=>{if(!n||n.type!=="contact")return!1;const x=s.find(A=>A.public_key===n.id);return(x==null?void 0:x.type)===rd},[n,s]),g=D.useCallback(async x=>{if(!(!n||n.type!=="contact")&&d)try{const A=await tt.requestTelemetry(n.id,x),_=qo(n.id,Ny(A),!1,0),k=qo(n.id,Fy(A.neighbors),!1,1),R=qo(n.id,Ly(A.acl),!1,2);i(C=>[...C,_,k,R]),c(!0)}catch(A){const _=qo(n.id,`Telemetry request failed: ${A instanceof Error?A.message:"Unknown error"}`,!1,0);i(k=>[...k,_])}},[n,d,i]),m=D.useCallback(async x=>{if(!n||n.type!=="contact"||!d||!l||await u(x,n.id))return;const _=qo(n.id,`> ${x}`,!0,0);i(k=>[...k,_]);try{const k=await tt.sendRepeaterCommand(n.id,x),R=qo(n.id,k.response,!1,1);k.sender_timestamp&&(R.sender_timestamp=k.sender_timestamp),i(C=>[...C,R])}catch(k){const R=qo(n.id,`Command failed: ${k instanceof Error?k.message:"Unknown error"}`,!1,1);i(C=>[...C,R])}},[n,d,l,i,u]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:g,handleRepeaterCommand:m}}const xx="remoteterm-lastMessageTime",Ax="remoteterm-sortOrder";let Gu={};function im(n){Gu={...n}}function om(){return{...Gu}}function t0(n,s){return Gu[n]=s,{...Gu}}function jr(n,s){return`${n}-${s}`}function Iy(){try{const n=localStorage.getItem(xx);return n?JSON.parse(n):{}}catch{return{}}}function Oy(){try{return localStorage.getItem(Ax)==="alpha"?"alpha":"recent"}catch{return"recent"}}function sm(){try{localStorage.removeItem(xx),localStorage.removeItem(Ax)}catch{}}function am(n,s){if(!s)return!1;const i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${i}\\]`,"i").test(n)}function jy(n,s,i,l=null){const[c,u]=D.useState({}),[p,d]=D.useState({}),[g,m]=D.useState(om),x=D.useRef(l);D.useEffect(()=>{x.current=l},[l]);const A=D.useRef(new Set),_=D.useRef(new Set);D.useEffect(()=>{const B=n.filter(F=>!A.current.has(F.key)),S=s.filter(F=>F.public_key&&!_.current.has(F.public_key));if(B.length===0&&S.length===0)return;B.forEach(F=>A.current.add(F.key)),S.forEach(F=>_.current.add(F.public_key)),(async()=>{const F=[...B.map(M=>({type:"CHAN",conversation_key:M.key})),...S.map(M=>({type:"PRIV",conversation_key:M.public_key}))];if(F.length!==0)try{const z={};for(let W=0;W<F.length;W+=200){const K=F.slice(W,W+200),ne=await tt.getMessagesBulk(K,O0);Object.assign(z,ne)}const V={},j={},J={};for(const W of B){const K=z[`CHAN:${W.key}`]||[];if(K.length>0){const ne=jr("channel",W.key),H=W.last_read_at||0,Y=K.filter(ee=>!ee.outgoing&&ee.received_at>H);Y.length>0&&(V[ne]=Y.length,Y.some(ee=>am(ee.text,x.current))&&(j[ne]=!0));const oe=Math.max(...K.map(ee=>ee.received_at));J[ne]=oe,t0(ne,oe)}}for(const W of S){const K=z[`PRIV:${W.public_key}`]||[];if(K.length>0){const ne=jr("contact",W.public_key),H=W.last_read_at||0,Y=K.filter(ee=>!ee.outgoing&&ee.received_at>H);Y.length>0&&(V[ne]=Y.length,Y.some(ee=>am(ee.text,x.current))&&(j[ne]=!0));const oe=Math.max(...K.map(ee=>ee.received_at));J[ne]=oe,t0(ne,oe)}}Object.keys(V).length>0&&u(W=>({...W,...V})),Object.keys(j).length>0&&d(W=>({...W,...j})),m(om())}catch(M){console.error("Failed to fetch messages bulk:",M)}})()},[n,s]),D.useEffect(()=>{if(i&&i.type!=="raw"&&i.type!=="map"){const B=jr(i.type,i.id);u(S=>{if(S[B]){const T={...S};return delete T[B],T}return S}),d(S=>{if(S[B]){const T={...S};return delete T[B],T}return S}),i.type==="channel"?tt.markChannelRead(i.id).catch(S=>{console.error("Failed to mark channel as read on server:",S)}):i.type==="contact"&&tt.markContactRead(i.id).catch(S=>{console.error("Failed to mark contact as read on server:",S)})}},[i]);const k=D.useCallback((B,S)=>{u(T=>({...T,[B]:(T[B]||0)+1})),S&&d(T=>({...T,[B]:!0}))},[]),R=D.useCallback(()=>{u({}),d({}),tt.markAllRead().catch(B=>{console.error("Failed to mark all as read on server:",B)})},[]),C=D.useCallback(B=>{if(B.type==="raw"||B.type==="map")return;const S=jr(B.type,B.id);u(T=>{if(T[S]){const F={...T};return delete F[S],F}return T}),d(T=>{if(T[S]){const F={...T};return delete F[S],F}return T}),B.type==="channel"?tt.markChannelRead(B.id).catch(T=>{console.error("Failed to mark channel as read on server:",T)}):B.type==="contact"&&tt.markContactRead(B.id).catch(T=>{console.error("Failed to mark contact as read on server:",T)})},[]),b=D.useCallback(B=>{let S=null;if(B.type==="CHAN"&&B.conversation_key?S=jr("channel",B.conversation_key):B.type==="PRIV"&&B.conversation_key&&(S=jr("contact",B.conversation_key)),S){const T=B.received_at||Math.floor(Date.now()/1e3),F=t0(S,T);m(F)}},[]);return{unreadCounts:c,mentions:p,lastMessageTimes:g,incrementUnread:k,markAllRead:R,markConversationRead:C,trackNewMessage:b}}var j0=gx();const vx=aa(j0);function zy(n){if(typeof doc
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 m_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),g_=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,i,l)=>l?l.toUpperCase():i.toLowerCase()),um=n=>{const s=g_(n);return s.charAt(0).toUpperCase()+s.slice(1)},yx=(...n)=>n.filter((s,i,l)=>!!s&&s.trim()!==""&&l.indexOf(s)===i).join(" ").trim(),x_=n=>{for(const s in n)if(s.startsWith("aria-")||s==="role"||s==="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 A_={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 v_=D.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:c="",children:u,iconNode:p,...d},g)=>D.createElement("svg",{ref:g,...A_,width:s,height:s,stroke:n,strokeWidth:l?Number(i)*24/Number(s):i,className:yx("lucide",c),...!u&&!x_(d)&&{"aria-hidden":"true"},...d},[...p.map(([m,x])=>D.createElement(m,x)),...Array.isArray(u)?u:[u]]));/**
|
||||
* @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 z0=(n,s)=>{const i=D.forwardRef(({className:l,...c},u)=>D.createElement(v_,{ref:u,iconNode:s,className:yx(`lucide-${m_(um(n))}`,`lucide-${n}`,l),...c}));return i.displayName=um(n),i};/**
|
||||
* @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 y_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],__=z0("check",y_);/**
|
||||
* @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 w_=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],b_=z0("menu",w_);/**
|
||||
* @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 C_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_x=z0("x",C_);function E_({health:n,config:s,onSettingsClick:i,onMenuClick:l}){const c=(n==null?void 0:n.radio_connected)??!1,[u,p]=D.useState(!1),d=async()=>{p(!0);try{const g=await tt.reconnectRadio();g.connected&&vt.success("Reconnected",{description:g.message})}catch(g){vt.error("Reconnection failed",{description:g instanceof Error?g.message:"Check radio connection and power"})}finally{p(!1)}};return w.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[l&&w.jsx("button",{onClick:l,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:w.jsx(b_,{className:"h-5 w-5"})}),w.jsx("h1",{className:"text-base font-semibold mr-auto",children:"RemoteTerm"}),w.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[w.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-[#4caf50]":"bg-[#666]"}`}),w.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:c?"Connected":"Disconnected"})]}),s&&w.jsxs("div",{className:"hidden lg:flex items-center gap-2 text-[#888]",children:[w.jsx("span",{className:"text-[#e0e0e0]",children:s.name||"Unnamed"}),w.jsx("span",{className:"font-mono text-[#888] cursor-pointer hover:text-[#4a9eff]",onClick:()=>{navigator.clipboard.writeText(s.public_key),vt.success("Public key copied!")},title:"Click to copy public key",children:s.public_key.toLowerCase()})]}),!c&&w.jsx("button",{onClick:d,disabled:u,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:u?"Reconnecting...":"Reconnect"}),w.jsxs("button",{onClick:i,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[w.jsx("span",{role:"img","aria-label":"Settings",children:"🔧"})," ","Radio & Config"]})]})}const k_=12;function S_(n){return n.slice(0,k_)}function Ti(n,s){return n||S_(s)}const na=2,B_={text:"🛜",background:"#444444",textColor:"#ffffff"};function P_(n){let s=0;for(let i=0;i<n.length;i++){const l=n.charCodeAt(i);s=(s<<5)-s+l,s=s&s}return Math.abs(s)}const T_=/[\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 D_(n,s){if(!n)return s.slice(0,2).toUpperCase();const i=n.match(T_);if(i)return i[0];const l=n.match(/[a-zA-Z]/g);if(!l||l.length===0)return s.slice(0,2).toUpperCase();const c=n.indexOf(" ");if(c!==-1){const u=l[0],p=n.slice(c+1).match(/[a-zA-Z]/);if(p)return(u+p[0]).toUpperCase()}return l[0].toUpperCase()}function R_(n){const s=P_(n),i=s%360,l=50+(s>>8)%30,c=35+(s>>16)%20,u=`hsl(${i}, ${l}%, ${c}%)`,p=c<45?"#ffffff":"#000000";return{background:u,text:p}}function N_(n,s,i){if(i===na)return B_;const l=D_(n,s),c=R_(s);return{text:l,background:c.background,textColor:c.text}}function v0({name:n,publicKey:s,size:i=28,contactType:l}){const c=N_(n,s,l);return w.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:c.background,color:c.textColor,width:i,height:i,fontSize:i*.45},children:c.text})}const wx="remoteterm-favorites";function ts(n,s,i){return n.some(l=>l.type===s&&l.id===i)}function F_(){try{const n=localStorage.getItem(wx);return n?JSON.parse(n):[]}catch{return[]}}function dm(){try{localStorage.removeItem(wx)}catch{}}function bx(n){var s,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(s=0;s<c;s++)n[s]&&(i=bx(n[s]))&&(l&&(l+=" "),l+=i)}else for(i in n)n[i]&&(l&&(l+=" "),l+=i);return l}function Cx(){for(var n,s,i=0,l="",c=arguments.length;i<c;i++)(n=arguments[i])&&(s=bx(n))&&(l&&(l+=" "),l+=s);return l}const L_=(n,s)=>{const i=new Array(n.length+s.length);for(let l=0;l<n.length;l++)i[l]=n[l];for(let l=0;l<s.length;l++)i[n.length+l]=s[l];return i},M_=(n,s)=>({classGroupId:n,validator:s}),Ex=(n=new Map,s=null,i)=>({nextPart:n,validators:s,classGroupId:i}),$u="-",fm=[],I_="arbitrary..",O_=n=>{const s=z_(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return j_(p);const d=p.split($u),g=d[0]===""&&d.length>1?1:0;return kx(d,g,s)},getConflictingClassGroupIds:(p,d)=>{if(d){const g=l[p],m=i[p];return g?m?L_(m,g):g:m||fm}return i[p]||fm}}},kx=(n,s,i)=>{if(n.length-s===0)return i.classGroupId;const c=n[s],u=i.nextPart.get(c);if(u){const m=kx(n,s+1,u);if(m)return m}const p=i.validators;if(p===null)return;const d=s===0?n.join($u):n.slice(s).join($u),g=p.length;for(let m=0;m<g;m++){const x=p[m];if(x.validator(d))return x.classGroupId}},j_=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=n.slice(1,-1),i=s.indexOf(":"),l=s.slice(0,i);return l?I_+l:void 0})(),z_=n=>{const{theme:s,classGroLine truncated
|
||||
.`.concat(ww,` {
|
||||
overflow: hidden `).concat(l,`;
|
||||
padding-right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
body[`).concat(ea,`] {
|
||||
overflow: hidden `).concat(l,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([s&&"position: relative ".concat(l,";"),i==="margin"&&`
|
||||
padding-left: `.concat(c,`px;
|
||||
padding-top: `).concat(u,`px;
|
||||
padding-right: `).concat(p,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(d,"px ").concat(l,`;
|
||||
`),i==="padding"&&"padding-right: ".concat(d,"px ").concat(l,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(iu,` {
|
||||
right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(ou,` {
|
||||
margin-right: `).concat(d,"px ").concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(iu," .").concat(iu,` {
|
||||
right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
.`).concat(ou," .").concat(ou,` {
|
||||
margin-right: 0 `).concat(l,`;
|
||||
}
|
||||
|
||||
body[`).concat(ea,`] {
|
||||
`).concat(bw,": ").concat(d,`px;
|
||||
}
|
||||
`)},Pm=function(){var n=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(n)?n:0},Vw=function(){D.useEffect(function(){return document.body.setAttribute(ea,(Pm()+1).toString()),function(){var n=Pm()-1;n<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,n.toString())}},[])},Uw=function(n){var s=n.noRelative,i=n.noImportant,l=n.gapMode,c=l===void 0?"margin":l;Vw();var u=D.useMemo(function(){return jw(c)},[c]);return D.createElement(zw,{styles:Hw(u,!s,c,i?"":"!important")})},w0=!1;if(typeof window<"u")try{var Qc=Object.defineProperty({},"passive",{get:function(){return w0=!0,!0}});window.addEventListener("test",Qc,Qc),window.removeEventListener("test",Qc,Qc)}catch{w0=!1}var Qs=w0?{passive:!1}:!1,Zw=function(n){return n.tagName==="TEXTAREA"},$x=function(n,s){if(!(n instanceof Element))return!1;var i=window.getComputedStyle(n);return i[s]!=="hidden"&&!(i.overflowY===i.overflowX&&!Zw(n)&&i[s]==="visible")},Ww=function(n){return $x(n,"overflowY")},qw=function(n){return $x(n,"overflowX")},Tm=function(n,s){var i=s.ownerDocument,l=s;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var c=Kx(n,l);if(c){var u=Qx(n,l),p=u[1],d=u[2];if(p>d)return!0}l=l.parentNode}while(l&&l!==i.body);return!1},Gw=function(n){var s=n.scrollTop,i=n.scrollHeight,l=n.clientHeight;return[s,i,l]},$w=function(n){var s=n.scrollLeft,i=n.scrollWidth,l=n.clientWidth;return[s,i,l]},Kx=function(n,s){return n==="v"?Ww(s):qw(s)},Qx=function(n,s){return n==="v"?Gw(s):$w(s)},Kw=function(n,s){return n==="h"&&s==="rtl"?-1:1},Qw=function(n,s,i,l,c){var u=Kw(n,window.getComputedStyle(s).direction),p=u*l,d=i.target,g=s.contains(d),m=!1,x=p>0,A=0,_=0;do{if(!d)break;var k=Qx(n,d),R=k[0],C=k[1],b=k[2],B=C-b-u*R;(R||B)&&Kx(n,d)&&(A+=B,_+=R);var S=d.parentNode;d=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!g&&d!==document.body||g&&(s.contains(d)||s===d));return(x&&Math.abs(A)<1||!x&&Math.abs(_)<1)&&(m=!0),m},Yc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Dm=function(n){return[n.deltaX,n.deltaY]},Rm=function(n){return n&&"current"in n?n.current:n},Yw=function(n,s){return n[0]===s[0]&&n[1]===s[1]},Xw=function(n){return`
|
||||
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
||||
`)},Jw=0,Ys=[];function e2(n){var s=D.useRef([]),i=D.useRef([0,0]),l=D.useRef(),c=D.useState(Jw++)[0],u=D.useState(Gx)[0],p=D.useRef(n);D.useEffect(function(){p.current=n},[n]),D.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var C=_w([n.lockRef.current],(n.shards||[]).map(Rm),!0).filter(Boolean);return C.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var d=D.useCallback(function(C,b){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!p.current.allowPinchZoom;var B=Yc(C),S=i.current,T="deltaX"in C?C.deltaX:S[0]-B[0],F="deltaY"in C?C.deltaY:S[1]-B[1],M,z=C.target,V=Math.abs(T)>Math.abs(F)?"h":"v";if("touches"in C&&V==="h"&&z.type==="range")return!1;var j=window.getSelection(),J=j&&j.anchorNode,W=J?J===z||J.contains(z):!1;if(W)return!1;var K=Tm(V,z);if(!K)return!0;if(K?M=V:(M=V==="v"?"h":"v",K=Tm(V,z)),!K)return!1;if(!l.current&&"changedTouches"in C&&(T||F)&&(l.current=M),!M)return!0;var ne=l.current||M;return Qw(ne,b,C,ne==="h"?T:F)},[]),g=D.useCallback(function(C){var b=C;if(!(!Ys.length||Ys[Ys.length-1]!==u)){var B="deltaY"in b?Dm(b):Yc(b),S=s.current.filter(function(M){return M.name===b.type&&(M.target===b.target||b.target===M.shadowParent)&&Yw(M.delta,B)})[0];if(S&&S.should){b.cancelable&&b.preventDefault();return}if(!S){var T=(p.current.shards||[]).map(Rm).filter(Boolean).filter(function(M){return M.contains(b.target)}),F=T.length>0?d(b,T[0]):!p.current.noIsolation;F&&b.cancelable&&b.preventDefault()}}},[]),m=D.useCallback(function(C,b,B,S){var T={name:C,delta:b,target:B,should:S,shadowParent:t2(B)};s.current.push(T),setTimeout(function(){s.current=s.current.filter(function(F){return F!==T})},1)},[]),x=D.useCallback(function(C){i.current=Yc(C),l.current=void 0},[]),A=D.useCallback(function(C){m(C.type,Dm(C),C.target,d(C,n.lockRef.current))},[]),_=D.useCallback(function(C){m(C.type,Yc(C),C.target,d(C,n.lockRef.current))},[]);D.useEffect(function(){return Ys.push(u),n.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:_}),document.addEventListener("wheel",g,Qs),document.addEventListener("touchmove",g,Qs),document.addEventListener("touchstart",x,Qs),function(){Ys=Ys.filter(function(C){return C!==u}),document.removeEventListener("wheel",g,Qs),document.removeEventListener("touchmove",g,Qs),document.removeEventListener("touchstart",x,Qs)}},[]);var k=n.removeScrollBar,R=n.inert;return D.createElement(D.Fragment,null,R?D.createElement(u,{styles:Xw(c)}):null,k?D.createElement(Uw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function t2(n){for(var s=null;n!==null;)n instanceof ShadowRoot&&(s=n.host,n=n.host),n=n.parentNode;return s}const n2=Tw(qx,e2);var Yx=D.forwardRef(function(n,s){return D.createElement(od,ii({},n,{ref:s,sideCar:n2}))});Yx.classNames=od.classNames;var r2=function(n){if(typeof document>"u")return null;var s=Array.isArray(n)?n[0]:n;return s.ownerDocument.body},Xs=new WeakMap,Xc=new WeakMap,Jc={},u0=0,Xx=function(n){return n&&(n.host||Xx(n.parentNode))},i2=function(n,s){return s.map(function(i){if(n.contains(i))return i;var l=Xx(i);return l&&n.contains(l)?l:(console.error("aria-hidden",i,"in not contained inside",n,". Doing nothing"),null)}).filter(function(i){return!!i})},o2=function(n,s,i,l){var c=i2(s,Array.isArray(n)?n:[n]);Jc[i]||(Jc[i]=new WeakMap);var u=Jc[i],p=[],d=new Set,g=new Set(c),m=function(A){!A||d.has(A)||(d.add(A),m(A.parentNode))};c.forEach(m);var x=function(A){!A||g.has(A)||Array.prototype.forEach.call(A.children,function(_){if(d.has(_))x(_);else try{var k=_.getAttribute(l),R=k!==null&&k!=="false",C=(Xs.get(_)||0)+1,b=(u.get(_)||0)+1;Xs.set(_,C),u.set(_,b),p.push(_),C===1&&R&&Xc.set(_,!0),b===1&&_.setAttribute(i,"true"),R||_.setAttribute(l,"true")}catch(B){console.error("aria-hidden: cannot operate on ",_,B)}})};return x(s),d.clear(),u0++,function(){p.forEach(function(A){var _=Xs.get(A)-1,k=u.get(A)-1;Xs.set(A,_),u.set(A,k),_||(Xc.has(A)||A.removeAttribute(l),Xc.delete(A)),k||A.removeAttribute(i)}),u0--,u0||(Xs=new WeakMap,Xs=new WeakMap,Xc=new WeakMap,Jc={})}},s2=function(n,s,i){i===void 0&&(i="data-aria-hidden");var l=Array.from(Array.isArray(n)?n:[n]),c=r2(n);return c?(l.push.apply(l,Array.from(c.querySelectorAll("[aria-live], script"))),o2(l,c,i,"aria-hidden")):function(){return null}};function a2(n){const s=l2(n),i=D.forwardRef((l,c)=>{const{children:u,...p}=l,d=D.Children.toArray(u),g=d.find(u2);if(g){const m=g.props.children,x=d.map(A=>A===g?D.Children.count(m)>1?D.Children.only(null):D.isValidElement(m)?m.props.children:null:A);return w.jsx(s,{...p,ref:c,children:D.isValidElement(m)?D.cloneElement(m,void 0,x):null})}return w.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function l2(n){const s=D.forwardRef((i,l)=>{const{childre
Line truncated
|
||||
|
||||
If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return D.useEffect(()=>{n&&(document.getElementById(n)||console.error(i))},[i,n]),null},_2="DialogDescriptionWarning",w2=({contentRef:n,descriptionId:s})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hA(_2).contentName}}.`;return D.useEffect(()=>{var u;const c=(u=n.current)==null?void 0:u.getAttribute("aria-describedby");s&&c&&(document.getElementById(s)||console.warn(l))},[l,n,s]),null},pA=eA,mA=rA,ad=iA,ld=oA,cd=aA,ud=cA,gA=dA;const G0=pA,b2=mA,xA=D.forwardRef(({className:n,...s},i)=>w.jsx(ad,{ref:i,className:at("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",n),...s}));xA.displayName=ad.displayName;const dd=D.forwardRef(({className:n,children:s,...i},l)=>w.jsxs(b2,{children:[w.jsx(xA,{}),w.jsxs(ld,{ref:l,className:at("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",n),...i,children:[s,w.jsxs(gA,{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:[w.jsx(_x,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dd.displayName=ld.displayName;const fd=({className:n,...s})=>w.jsx("div",{className:at("flex flex-col space-y-1.5 text-center sm:text-left",n),...s});fd.displayName="DialogHeader";const $0=({className:n,...s})=>w.jsx("div",{className:at("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...s});$0.displayName="DialogFooter";const hd=D.forwardRef(({className:n,...s},i)=>w.jsx(cd,{ref:i,className:at("text-lg font-semibold leading-none tracking-tight",n),...s}));hd.displayName=cd.displayName;const pd=D.forwardRef(({className:n,...s},i)=>w.jsx(ud,{ref:i,className:at("text-sm text-muted-foreground",n),...s}));pd.displayName=ud.displayName;function C2(){const n=window.location.hash.slice(1);if(!n)return null;if(n==="raw")return{type:"raw",name:"raw"};if(n==="map")return{type:"map",name:"map"};if(n==="visualizer")return{type:"visualizer",name:"visualizer"};if(n.startsWith("map/focus/")){const c=n.slice(10);return c?{type:"map",name:"map",mapFocusKey:decodeURIComponent(c)}:{type:"map",name:"map"}}const s=n.indexOf("/");if(s===-1)return null;const i=n.slice(0,s),l=decodeURIComponent(n.slice(s+1));return(i==="channel"||i==="contact")&&l?{type:i,name:l}:null}function AA(n){return`#map/focus/${encodeURIComponent(n)}`}function E2(n){if(!n)return"";if(n.type==="raw")return"#raw";if(n.type==="map")return"#map";if(n.type==="visualizer")return"#visualizer";const s=n.type==="channel"&&n.name.startsWith("#")?n.name.slice(1):n.name;return`#${n.type}/${encodeURIComponent(s)}`}function k2(n){const s=E2(n);s!==window.location.hash&&window.history.replaceState(null,"",s||window.location.pathname)}function S2({open:n,onClose:s,paths:i,senderInfo:l,contacts:c,config:u}){const p=i.map(g=>({...g,resolved:O1(g.path,l,c,u)})),d=i.length===1;return w.jsx(G0,{open:n,onOpenChange:g=>!g&&s(),children:w.jsxs(dd,{className:"max-w-md max-h-[80vh] flex flex-col",children:[w.jsxs(fd,{children:[w.jsxs(hd,{children:["Message Path",!d&&`s (${i.length})`]}),w.jsx(pd,{children:d?w.jsxs(w.Fragment,{children:["This shows ",w.jsx("em",{children:"one route"})," that this message traveled through the mesh network. Routers may be incorrectly identified due to prefix collisions between heard and non-heard router advertisements."]}):w.jsxs(w.Fragment,{children:["This message was received via ",w.jsxs("strong",{children:[i.length," different routes"]}),". Routers may be incorrectly identified due to prefix collisions."]})})]}),w.jsxs("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:[p.map((g,m)=>w.jsxs("div",{children:[!d&&w.jsxs("div",{className:"text-xs text-muted-foreground font-medium mb-2 pb-1 border-b border-border",children:["Path ",m+1," — received ",ra(g.received_at)]}),w.jsx(B2,{resolved:g.resolved,senderInfo:l,hideStraightLine:!d})]},m)),!d&&p.length>0&&(()=>{const g=p[0].resolved;return Pt(g.sender.lat,g.sender.lon)&&Pt(g.receiver.lat,g.receiver.lon)?w.jsxs("div",{className:"pt-3 mt-1 border-t border-border",children:[w.jsx("span",{className:"text-sm text-muted-foreground",children:"Straight-line distance: "}),w.jsx("span",{className:"text-sm font-medium",c
Line truncated
|
||||
`).map((Z,ae,de)=>w.jsxs("span",{children:[D2(Z,d),ae<de.length-1&&w.jsx("br",{})]},ae)),!le&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:ra(j.sender_timestamp||j.received_at)}),!j.outgoing&&j.paths&&j.paths.length>0&&w.jsx(Fm,{paths:j.paths,variant:"inline",onClick:()=>C({paths:j.paths,senderInfo:M(j,W,ne)})})]}),j.outgoing&&(j.acked>0?` ✓${j.acked>1?j.acked:""}`:" ?")]})]})]},j.id)})]}),_&&w.jsx("button",{onClick:S,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:w.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:w.jsx("polyline",{points:"6 9 12 15 18 9"})})}),R&&w.jsx(S2,{open:!0,onClose:()=>C(null),paths:R.paths,senderInfo:R.senderInfo,contacts:s,config:g??null})]})}const Lm=156,N2=140,F2=156,L2=120,M2=8,I2=D.forwardRef(function({onSend:s,disabled:i,placeholder:l,isRepeaterMode:c,conversationType:u,senderName:p},d){const[g,m]=D.useState(""),[x,A]=D.useState(!1),_=D.useRef(null);D.useImperativeHandle(d,()=>({appendText:M=>{var z;m(V=>V+M),(z=_.current)==null||z.focus()}}));const k=D.useMemo(()=>{if(u==="contact")return{warningAt:N2,dangerAt:Lm,hardLimit:Lm};if(u==="channel"){const M=(p==null?void 0:p.length)??10,z=Math.max(1,F2-M-2);return{warningAt:L2,dangerAt:Math.max(1,z-M2),hardLimit:z}}return null},[u,p]),{limitState:R,warningMessage:C}=D.useMemo(()=>{if(!k)return{limitState:"normal",warningMessage:null};const M=g.length;return M>=k.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:M>=k.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:M>=k.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[g.length,k]),b=k?k.hardLimit-g.length:0,B=D.useCallback(async M=>{M.preventDefault();const z=g.trim();if(c){if(x||i)return;A(!0);try{await s(z),m("")}catch(V){console.error("Failed to request telemetry:",V),vt.error("Failed to request telemetry",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=_.current)==null?void 0:V.focus()},0)}else{if(!z||x||i)return;A(!0);try{await s(z),m("")}catch(V){console.error("Failed to send message:",V),vt.error("Failed to send message",{description:V instanceof Error?V.message:"Check radio connection"});return}finally{A(!1)}setTimeout(()=>{var V;return(V=_.current)==null?void 0:V.focus()},0)}},[g,x,i,s,c]),S=D.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),B(M))},[B]),T=c?!0:g.trim().length>0,F=!c&&k!==null;return w.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:B,children:[w.jsxs("div",{className:"flex gap-2",children:[w.jsx(nn,{ref:_,type:c?"password":"text",autoComplete:c?"off":void 0,value:g,onChange:M=>m(M.target.value),onKeyDown:S,placeholder:l||(c?"Enter password for admin login...":"Type a message..."),disabled:i||x,className:"flex-1 min-w-0"}),w.jsx(wn,{type:"submit",disabled:i||x||!T,className:"flex-shrink-0",children:x?c?"Logging in...":"Sending...":c?g.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),F&&w.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[w.jsxs("span",{className:at("tabular-nums",R==="error"||R==="danger"?"text-red-500 font-medium":R==="warning"?"text-yellow-500":"text-muted-foreground"),children:[g.length,"/",k.hardLimit,b<0&&` (${b})`]}),C&&w.jsxs("span",{className:at(R==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function Mm(n){const s=O2(n),i=D.forwardRef((l,c)=>{const{children:u,...p}=l,d=D.Children.toArray(u),g=d.find(z2);if(g){const m=g.props.children,x=d.map(A=>A===g?D.Children.count(m)>1?D.Children.only(null):D.isValidElement(m)?m.props.children:null:A);return w.jsx(s,{...p,ref:c,children:D.isValidElement(m)?D.cloneElement(m,void 0,x):null})}return w.jsx(s,{...p,ref:c,children:u})});return i.displayName=`${n}.Slot`,i}function O2(n){const s=D.forwardRef((i,l)=>{const{children:c,...u}=i;if(D.isValidElement(c)){const p=V2(c),d=H2(u,c.props);return c.type!==D.Fragment&&(d.ref=l?El(l,p):p),D.cloneElement(c,d)}return D.Children.count(c)>1?D.Children.only(null):null});return s.displayName=`${n}.SlotClone`,s}var j2=Symbol("radix.slottable");function z2(n){return D.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===j2}function H2(n,s){const i={...s};for(const l in s){const c=n[l],u=s[l];/^on[A-Z]/.test(l)?c&&u?i[l]=(...d)=>{const g=u(...d);return c(...d),g}:c&&(i[l]=c):l==="style"?i[l]={...c,...u}:l==="className"&&(i[l]=[c,u].filter(Boolean).join(" "))}return{...n,...i}}functio
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(l){var c=i,u=c.lib,p=u.WordArray,d=u.Hasher,g=c.algo,m=p.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]),x=p.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]),A=p.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]),_=p.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]),k=p.create([0,1518500249,1859775393,2400959708,2840853838]),R=p.create([1352829926,1548603684,1836072691,2053994217,0]),C=g.RIPEMD160=d.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(z,V){for(var j=0;j<16;j++){var J=V+j,W=z[J];z[J]=(W<<8|W>>>24)&16711935|(W<<24|W>>>8)&4278255360}var K=this._hash.words,ne=k.words,H=R.words,Y=m.words,oe=x.words,ee=A.words,se=_.words,q,le,G,N,U,$,Z,ae,de,Ae;$=q=K[0],Z=le=K[1],ae=G=K[2],de=N=K[3],Ae=U=K[4];for(var me,j=0;j<80;j+=1)me=q+z[V+Y[j]]|0,j<16?me+=b(le,G,N)+ne[0]:j<32?me+=B(le,G,N)+ne[1]:j<48?me+=S(le,G,N)+ne[2]:j<64?me+=T(le,G,N)+ne[3]:me+=F(le,G,N)+ne[4],me=me|0,me=M(me,ee[j]),me=me+U|0,q=U,U=N,N=M(G,10),G=le,le=me,me=$+z[V+oe[j]]|0,j<16?me+=F(Z,ae,de)+H[0]:j<32?me+=T(Z,ae,de)+H[1]:j<48?me+=S(Z,ae,de)+H[2]:j<64?me+=B(Z,ae,de)+H[3]:me+=b(Z,ae,de)+H[4],me=me|0,me=M(me,se[j]),me=me+Ae|0,$=Ae,Ae=de,de=M(ae,10),ae=Z,Z=me;me=K[1]+G+de|0,K[1]=K[2]+N+Ae|0,K[2]=K[3]+U+$|0,K[3]=K[4]+q+Z|0,K[4]=K[0]+le+ae|0,K[0]=me},_doFinalize:function(){var z=this._data,V=z.words,j=this._nDataBytes*8,J=z.sigBytes*8;V[J>>>5]|=128<<24-J%32,V[(J+64>>>9<<4)+14]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360,z.sigBytes=(V.length+1)*4,this._process();for(var W=this._hash,K=W.words,ne=0;ne<5;ne++){var H=K[ne];K[ne]=(H<<8|H>>>24)&16711935|(H<<24|H>>>8)&4278255360}return W},clone:function(){var z=d.clone.call(this);return z._hash=this._hash.clone(),z}});function b(z,V,j){return z^V^j}function B(z,V,j){return z&V|~z&j}function S(z,V,j){return(z|~V)^j}function T(z,V,j){return z&j|V&~j}function F(z,V,j){return z^(V|~j)}function M(z,V){return z<<V|z>>>32-V}c.RIPEMD160=d._createHelper(C),c.HmacRIPEMD160=d._createHmacHelper(C)})(),i.RIPEMD160})})(yu)),yu.exports}var _u={exports:{}},qb=_u.exports,tg;function vd(){return tg||(tg=1,(function(n,s){(function(i,l){n.exports=l(At())})(qb,function(i){(function(){var l=i,c=l.lib,u=c.Base,p=l.enc,d=p.Utf8,g=l.algo;g.HMAC=u.extend({init:function(m,x){m=this._hasher=new m.init,typeof x=="string"&&(x=d.parse(x));var A=m.blockSize,_=A*4;x.sigBytes>_&&(x=m.finalize(x)),x.clamp();for(var k=this._oKey=x.clone(),R=this._iKey=x.clone(),C=k.words,b=R.words,B=0;B<A;B++)C[B]^=1549556828,b[B]^=909522486;k.sigBytes=R.sigBytes=_,this.reset()},reset:function(){var m=this._hasher;m.reset(),m.update(this._iKey)},update:function(m){return this._hasher.update(m),this},finalize:function(m){var x=this._hasher,A=x.finalize(m);x.reset();var _=x.finalize(this._oKey.clone().concat(A));return _}})})()})})(_u)),_u.exports}var wu={exports:{}},Gb=wu.exports,ng;function $b(){return ng||(ng=1,(function(n,s){(function(i,l,c){n.exports=l(At(),Bl(),vd())})(Gb,function(i){return(function(){var l=i,c=l.lib,u=c.Base,p=c.WordArray,d=l.algo,g=d.SHA256,m=d.HMAC,x=d.PBKDF2=u.extend({cfg:u.extend({keySize:128/32,hasher:g,iterations:25e4}),init:function(A){this.cfg=this.cfg.extend(A)},compute:function(A,_){for(var k=this.cfg,R=m.create(k.hasher,A),C=p.create(),b=p.create([1]),B=C.words,S=b.words,T=k.keySize,F=k.iterations;B.length<T;){var M=R.update(_).finalize(b);R.reset();for(var z=M.words,V=z.length,j=M,J=1;J<F;J++){j=R.finalize(j),R.reset();for(var W=j.words,K=0;K<V;K++)z[K]^=W[K]}C.concat(M),S[0]++}return C.sigBytes=T*4,C}});l.PBKDF2=function(A,_,k){return x.create(k).compute(A,_)}})(),i.PBKDF2})})(wu)),wu.exports}var bu={exports:{}},Kb=bu.exports,rg;function vo(){return rg||(rg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),QA(),vd())})(Kb,function(i){return(function(){var l=i,c=l.lib,u=c.Base,p=c.WordArray,d=l.algo,g=d.MD5,m=d.EvpKDF=u.extend({cfg:u.extend({keySize:128/32,hasher:g,iterations:1}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,A){for(var _,k=this.cfg,R=k.hasher.create(),C=p.create(),b=C.words,B=k.keySize,S=k.iterations;b.length<B;){_&&R.update(_),_=R.update(x).finalize(A),R.reset();for(var T=1;T<S;T++)_=R.finalize(_),R.reset();C.concat(_)}return C.sigBytes=B*4,C}});l.EvpKDF=function(x,A,_){return m.create(_).compute(x,A)}})(),i.EvpKDF})})(bu)),bu.exports}var Cu={exports:{}},Qb=Cu.exports,igLine truncated
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return i.mode.CTRGladman=(function(){var l=i.lib.BlockCipherMode.extend();function c(d){if((d>>24&255)===255){var g=d>>16&255,m=d>>8&255,x=d&255;g===255?(g=0,m===255?(m=0,x===255?x=0:++x):++m):++g,d=0,d+=g<<16,d+=m<<8,d+=x}else d+=1<<24;return d}function u(d){return(d[0]=c(d[0]))===0&&(d[1]=c(d[1])),d}var p=l.Encryptor=l.extend({processBlock:function(d,g){var m=this._cipher,x=m.blockSize,A=this._iv,_=this._counter;A&&(_=this._counter=A.slice(0),this._iv=void 0),u(_);var k=_.slice(0);m.encryptBlock(k,0);for(var R=0;R<x;R++)d[g+R]^=k[R]}});return l.Decryptor=p,l})(),i.mode.CTRGladman})})(Su)),Su.exports}var Bu={exports:{}},rC=Bu.exports,lg;function iC(){return lg||(lg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(rC,function(i){return i.mode.OFB=(function(){var l=i.lib.BlockCipherMode.extend(),c=l.Encryptor=l.extend({processBlock:function(u,p){var d=this._cipher,g=d.blockSize,m=this._iv,x=this._keystream;m&&(x=this._keystream=m.slice(0),this._iv=void 0),d.encryptBlock(x,0);for(var A=0;A<g;A++)u[p+A]^=x[A]}});return l.Decryptor=c,l})(),i.mode.OFB})})(Bu)),Bu.exports}var Pu={exports:{}},oC=Pu.exports,cg;function sC(){return cg||(cg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(oC,function(i){return i.mode.ECB=(function(){var l=i.lib.BlockCipherMode.extend();return l.Encryptor=l.extend({processBlock:function(c,u){this._cipher.encryptBlock(c,u)}}),l.Decryptor=l.extend({processBlock:function(c,u){this._cipher.decryptBlock(c,u)}}),l})(),i.mode.ECB})})(Pu)),Pu.exports}var Tu={exports:{}},aC=Tu.exports,ug;function lC(){return ug||(ug=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(aC,function(i){return i.pad.AnsiX923={pad:function(l,c){var u=l.sigBytes,p=c*4,d=p-u%p,g=u+d-1;l.clamp(),l.words[g>>>2]|=d<<24-g%4*8,l.sigBytes+=d},unpad:function(l){var c=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=c}},i.pad.Ansix923})})(Tu)),Tu.exports}var Du={exports:{}},cC=Du.exports,dg;function uC(){return dg||(dg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(cC,function(i){return i.pad.Iso10126={pad:function(l,c){var u=c*4,p=u-l.sigBytes%u;l.concat(i.lib.WordArray.random(p-1)).concat(i.lib.WordArray.create([p<<24],1))},unpad:function(l){var c=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=c}},i.pad.Iso10126})})(Du)),Du.exports}var Ru={exports:{}},dC=Ru.exports,fg;function fC(){return fg||(fg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(dC,function(i){return i.pad.Iso97971={pad:function(l,c){l.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(l,c)},unpad:function(l){i.pad.ZeroPadding.unpad(l),l.sigBytes--}},i.pad.Iso97971})})(Ru)),Ru.exports}var Nu={exports:{}},hC=Nu.exports,hg;function pC(){return hg||(hg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(hC,function(i){return i.pad.ZeroPadding={pad:function(l,c){var u=c*4;l.clamp(),l.sigBytes+=u-(l.sigBytes%u||u)},unpad:function(l){for(var c=l.words,u=l.sigBytes-1,u=l.sigBytes-1;u>=0;u--)if(c[u>>>2]>>>24-u%4*8&255){l.sigBytes=u+1;break}}},i.pad.ZeroPadding})})(Nu)),Nu.exports}var Fu={exports:{}},mC=Fu.exports,pg;function gC(){return pg||(pg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(mC,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding})})(Fu)),Fu.exports}var Lu={exports:{}},xC=Lu.exports,mg;function AC(){return mg||(mg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),An())})(xC,function(i){return(function(l){var c=i,u=c.lib,p=u.CipherParams,d=c.enc,g=d.Hex,m=c.format;m.Hex={stringify:function(x){return x.ciphertext.toString(g)},parse:function(x){var A=g.parse(x);return p.create({ciphertext:A})}}})(),i.format.Hex})})(Lu)),Lu.exports}var Mu={exports:{}},vC=Mu.exports,gg;function yC(){return gg||(gg=1,(function(n,s){(function(i,l,c){n.exports=l(At(),ss(),as(),vo(),An())})(vC,function(i){return(function(){var l=i,c=l.lib,u=c.BlockCipher,p=l.algo,d=[],g=[],m=[],x=[],A=[],_=[],k=[],R=[],C=[],b=[];(function(){for(var T=[],F=0;F<256;F++)F<128?T[F]=F<<1:T[F]=F<<1^283;for(var M=0,z=0,F=0;F<256;F++){var V=z^z<<1^z<<2^z<<3^z<<4;V=V>>>8^V&255^99,d[M]=V,g[V]=M;var j=T[M],J=T[j],W=T[J],K=T[V]*257^V*16843008;m[M]=K<<24|K>>>8,x[M]=K<<16|K>>>16,A[M]=K<<8|K>>>24,_[M]=K;var K=W*16843009^J*65537^j*257^M*16843008;k[V]=K<<24|K>>>8,R[V]=K<<16|K>>>16,C[V]=K<<8|K>>>24,b[V]=K,M?(M=j^T[T[T[W^j]]],z^=T[T[z]]):M=z=1}})();var B=[0,1,2,4,8,16,32,64,128,27,54],S=p.AES=u.extend({_doReset:function(){var T;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,M=F.words,z=F.sigBytes/4,V=this._nRounds=z+6,j=(V+1)*4,J=this._keySchedule=[],W=0;W<j;W++)W<z?J[W]=M[W]:(T=J[W-1],W%z?z>6&&W%z==4&&(T=d[T>>>24]<<24|d[T>>>16&255]<<16|d[T>>>8&255]<<8|d[T&255]):(T=T<<8|T>>>24,T=d[T>>>24]<<24|d[T>>>16&255]<<16|d[T>>>8&255]<<8|d[T&255],T^=B[W/z|0]<<24),J[W]=J[W-z]^T);for(var K=this._invKeySchedule=[],ne=0;ne<j;ne++){var W=j-ne;if(ne%4)var T=J[W];else var T=J[W-4];ne<4||W<=4?K[ne]=T:K[ne]=k[d[T>>>24]]^R[d[T>>>16&255]]^C[d[T>>>8&255]]^b[d[T&255]]}}},encryLine 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:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.Request,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode request payload"],timestamp:0,requestType:n.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return ll.RequestPayloadDecoder=i,ll}var cl={},jg;function nE(){if(jg)return cl;jg=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.ResponsePayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<4){const R={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(R.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),R}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:d+g,endByte:d+g,value:x}),g+=1;const A=(0,s.bytesToHex)(c.subarray(g,g+2));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(g));u!=null&&u.includeSegments&&c.length>g&&p.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-4};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.Response,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return cl.ResponsePayloadDecoder=i,cl}var ul={},zg;function rE(){if(zg)return ul;zg=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.AnonRequestPayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<35){const R={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(R.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:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),R}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[0]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${m}`,startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.bytesToHex)(c.subarray(1,33));u!=null&&u.includeSegments&&p.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:d+g,endByte:d+g+31,value:x}),g+=32;const A=(0,s.bytesToHex)(c.subarray(33,35));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(35));u!=null&&u.includeSegments&&c.length>35&&p.push({name:"Ciphertext",description:`Encrypted message data (${c.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:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,senderPublicKey:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-35};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.AnonRequest,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return ul.AnonRequestPayloadDecoder=i,ul}var dl={},Hg;function iE(){if(Hg)return dl;Hg=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.AckPayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<4){const x={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return u!=null&&u.includeSegments&&(x.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),x}const p=[],d=(u==null?void 0:u.segmentOffset)||0,g=(0,s.bytesToHex)(c.subarray(0,4));u!=null&&u.includeSegments&&p.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${g}`,startByte:d,endByte:d+3,value:g}),u!=null&&u.includeSegments&&c.length>4&&p.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:d+4,endByte:d+c.length-1,value:(0,s.bytesToHex)(c.subarray(4))});const m={type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!0,checksum:g};return u!=null&&u.includeSegments&&(m.segments=p),m}catch(p){return{type:n.PayloadType.Ack,version:n.PayloadVersion.Version1,isValid:!1,errors:[p instanceof Error?p.message:"Failed to decode Ack payload"],checksum:""}}}}return dl.AckPayloadDecoder=i,dl}var fl={},Vg;function oE(){if(Vg)return fl;Vg=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.PathPayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c){try{if(c.length<2)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const u=c[0];if(c.length<1+u+1)return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+u+1} bytes for path length + path + extra type)`],pathLength:u,pathHashes:[],extraType:0,extraData:""};const p=[];for(let m=0;m<u;m++)p.push((0,s.byteToHex)(c[1+m]));const d=c[1+u];let g="";return c.length>1+u+1&&(g=(0,s.bytesToHex)(c.subarray(1+u+1))),{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!0,pathLength:u,pathHashes:p,extraType:d,extraData:g}}catch(u){return{type:n.PayloadType.Path,version:n.PayloadVersion.Version1,isValid:!1,errors:[u instanceof Error?u.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return fl.PathPayloadDecoder=i,fl}var hl={},Ug;function sE(){if(Ug)return hl;Ug=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.TextMessagePayloadDecoder=void 0;const n=dr(),s=bn();class i{static decode(c,u){try{if(c.length<4){const R={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return u!=null&&u.includeSegments&&(R.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:u.segmentOffset||0,endByte:(u.segmentOffset||0)+c.length-1,value:(0,s.bytesToHex)(c)}]),R}const p=[],d=(u==null?void 0:u.segmentOffset)||0;let g=0;const m=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:d+g,endByte:d+g,value:m}),g+=1;const x=(0,s.byteToHex)(c[g]);u!=null&&u.includeSegments&&p.push({name:"Source Hash",description:"First byte of source node public key",startByte:d+g,endByte:d+g,value:x}),g+=1;const A=(0,s.bytesToHex)(c.subarray(g,g+2));u!=null&&u.includeSegments&&p.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:d+g,endByte:d+g+1,value:A}),g+=2;const _=(0,s.bytesToHex)(c.subarray(g));u!=null&&u.includeSegments&&c.length>g&&p.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:d+g,endByte:d+c.length-1,value:_});const k={type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,isValid:!0,destinationHash:m,sourceHash:x,cipherMac:A,ciphertext:_,ciphertextLength:c.length-4};return u!=null&&u.includeSegments&&(k.segments=p),k}catch(p){return{type:n.PayloadType.TextMessage,version:n.PayloadVersion.Version1,i
Line truncated
|
||||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||
*/var wE=gl.exports,Qg;function bE(){return Qg||(Qg=1,(function(n,s){(function(i,l){l(s)})(wE,(function(i){var l="1.9.4";function c(t){var o,f,v,P;for(f=1,v=arguments.length;f<v;f++){P=arguments[f];for(o in P)t[o]=P[o]}return t}var u=Object.create||(function(){function t(){}return function(o){return t.prototype=o,new t}})();function p(t,o){var f=Array.prototype.slice;if(t.bind)return t.bind.apply(t,f.call(arguments,1));var v=f.call(arguments,2);return function(){return t.apply(o,v.length?v.concat(f.call(arguments)):arguments)}}var d=0;function g(t){return"_leaflet_id"in t||(t._leaflet_id=++d),t._leaflet_id}function m(t,o,f){var v,P,O,X;return X=function(){v=!1,P&&(O.apply(f,P),P=!1)},O=function(){v?P=arguments:(t.apply(f,arguments),setTimeout(X,o),v=!0)},O}function x(t,o,f){var v=o[1],P=o[0],O=v-P;return t===v&&f?t:((t-P)%O+O)%O+P}function A(){return!1}function _(t,o){if(o===!1)return t;var f=Math.pow(10,o===void 0?6:o);return Math.round(t*f)/f}function k(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function R(t){return k(t).split(/\s+/)}function C(t,o){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?u(t.options):{});for(var f in o)t.options[f]=o[f];return t.options}function b(t,o,f){var v=[];for(var P in t)v.push(encodeURIComponent(f?P.toUpperCase():P)+"="+encodeURIComponent(t[P]));return(!o||o.indexOf("?")===-1?"?":"&")+v.join("&")}var B=/\{ *([\w_ -]+) *\}/g;function S(t,o){return t.replace(B,function(f,v){var P=o[v];if(P===void 0)throw new Error("No value provided for variable "+f);return typeof P=="function"&&(P=P(o)),P})}var T=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function F(t,o){for(var f=0;f<t.length;f++)if(t[f]===o)return f;return-1}var M="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function z(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var V=0;function j(t){var o=+new Date,f=Math.max(0,16-(o-V));return V=o+f,window.setTimeout(t,f)}var J=window.requestAnimationFrame||z("RequestAnimationFrame")||j,W=window.cancelAnimationFrame||z("CancelAnimationFrame")||z("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function K(t,o,f){if(f&&J===j)t.call(o);else return J.call(window,p(t,o))}function ne(t){t&&W.call(window,t)}var H={__proto__:null,extend:c,create:u,bind:p,get lastId(){return d},stamp:g,throttle:m,wrapNum:x,falseFn:A,formatNum:_,trim:k,splitWords:R,setOptions:C,getParamString:b,template:S,isArray:T,indexOf:F,emptyImageUrl:M,requestFn:J,cancelFn:W,requestAnimFrame:K,cancelAnimFrame:ne};function Y(){}Y.extend=function(t){var o=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},f=o.__super__=this.prototype,v=u(f);v.constructor=o,o.prototype=v;for(var P in this)Object.prototype.hasOwnProperty.call(this,P)&&P!=="prototype"&&P!=="__super__"&&(o[P]=this[P]);return t.statics&&c(o,t.statics),t.includes&&(oe(t.includes),c.apply(null,[v].concat(t.includes))),c(v,t),delete v.statics,delete v.includes,v.options&&(v.options=f.options?u(f.options):{},c(v.options,t.options)),v._initHooks=[],v.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this),this._initHooksCalled=!0;for(var O=0,X=v._initHooks.length;O<X;O++)v._initHooks[O].call(this)}},o},Y.include=function(t){var o=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=o,this.mergeOptions(t.options)),this},Y.mergeOptions=function(t){return c(this.prototype.options,t),this},Y.addInitHook=function(t){var o=Array.prototype.slice.call(arguments,1),f=typeof t=="function"?t:function(){this[t].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(f),this};function oe(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=T(t)?t:[t];for(var o=0;o<t.length;o++)t[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var ee={on:function(t,o,f){if(typeof t=="object")for(var v in t)this._on(v,t[v],o);else{t=R(t);for(var P=0,O=t.length;P<O;P++)this._on(t[P],o,f)}return this},off:function(t,o,f){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var v in t)this._off(v,t[v],o);else{t=R(t);for(var P=arguments.length===1,O=0,X=t.length;O<X;O++)P?this._off(t[O]):this._off(t[O],o,f)}return this},_on:function(t,o,f,v){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(t,o,f)===!1){f===this&&(f=void 0);var P={fn:o,ctx:f};v&&(P.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(P)}},_off:function(t,o,f){var v,P,O;if(this._events&&(v=this._events[t],!!v)){if(arguments.length===1){if(this._firingCount)for(P=0,O=v.length;P<O;P++)v[P].fn=A;delete this._events[t];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var X=this._listLine 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 32 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 32u;
|
||||
|
||||
@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 s=await navigator.gpu.requestAdapter();if(!s)return console.warn("No GPU adapter found"),!1;this.device=await s.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 c=0;c<2;c++)this.matchCountReadBuffers[c]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[c]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const i=this.device.createShaderModule({code:this.shaderCode}),l=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:l,compute:{module:i,entryPoint:"main"}}),!0}catch(s){return console.error("WebGPU initialization failed:",s),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(s,i){return es(i,s)}countNamesForLength(s){return vl(s)}async runBatch(s,i,l,c,u,p){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 d=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const g=this.matchCountReadBuffers[d],m=this.matchIndicesReadBuffers[d],x=u&&p?1:0;let A,_=0,k=0;if(x){const M=new Uint8Array(u.length/2);for(let W=0;W<M.length;W++)M[W]=parseInt(u.substr(W*2,2),16);_=M.length*8;const z=Math.ceil(M.length/4)*4,V=new Uint8Array(z);V.set(M),A=new Uint32Array(z/4);for(let W=0;W<A.length;W++)A[W]=V[W*4]<<24|V[W*4+1]<<16|V[W*4+2]<<8|V[W*4+3];const j=parseInt(p.substr(0,2),16),J=parseInt(p.substr(2,2),16);k=j<<24|J<<16}else A=new Uint32Array([0]);const R=Math.max(A.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<R)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:R,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=R,this.bindGroupDirty=!0);const C=new Uint32Array([s,l,i,c,k,A.length,_,x]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,A),this.device.queue.writeBuffer(this.matchCountBuffer,0,Ed.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 b=this.device.createCommandEncoder(),B=b.beginComputePass();B.setPipeline(this.pipeline),B.setBindGroup(0,this.bindGroup),B.dispatchWorkgroups(Math.ceil(c/(256*32))),B.end(),b.copyBufferToBuffer(this.matchCountBuffer,0,g,0,4),b.copyBufferToBuffer(this.matchIndicesBuffer,0,m,0,1024*4),this.device.queue.submit([b.finish()]),await g.mapAsync(GPUMapMode.READ);const T=new Uint32Array(g.getMappedRange())[0];g.unmap();const F=[];if(T>0){await m.mapAsync(GPUMapMode.READ);const M=new Uint32Array(m.getMappedRange());for(let z=0;z<Math.min(T,1024);z++)F.push(M[z]);m.unmap()}return F}destroy(){var s,i,l,c,u,p,d,g;(s=this.paramsBuffer)==null||s.destroy(),(i=this.matchCountBuffer)==null||i.destroy(),(l=this.matchIndicesBuffer)==null||l.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(u=this.matchCountReadBuffers[0])==null||u.destroy(),(p=this.matchCountReadBuffers[1])==null||p.destroy(),(d=this.matchIndicesReadBuffers[0])==null||d.destroy(),(g=this.matchIndicesReadBuffers[1])==null||g.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}}Ed.ZERO_DATA=new Uint32Array([0]);function eS(){return typeof navigator<"u"&&"gpu"in navigator}class ux{runBatch(s,i,l,c,u,p){const d=[],g=s.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(u=>u.trim().toLowerCase()).filter(u=>u.length>0);this.wordlist=c.filter(dx)}setWordlist(s){this.wordlist=s.map(i=>i.trim().toLowerCase()).filter(dx)}abort(){this.abortFlag=!0}isGpuAvailable(){return eS()}async decodePacket(s){var l;const i=s.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!i||!/^[0-9a-fA-F]+$/.test(i))return null;try{const u=(l=(await Et.MeshCorePacketDecoder.decodeWithVerification(i,{})).payload)==null?void 0:l.decoded;return!(u!=null&&u.channelHash)||!(u!=null&&u.ciphertext)||!(u!=null&&u.cipherMac)?null:{channelHash:u.channelHash,ciphertext:u.ciphertext,cipherMac:u.cipherMac,isGroupText:!0}}catch{return null}}async crack(s,i,l){this.abortFlag=!1,this.useTimestampFilter=(i==null?void 0:i.useTimestampFilter)??!0,this.useUtf8Filter=(i==null?void 0:i.useUtf8Filter)??!0,this.useSenderFilter=(i==null?void 0:i.useSenderFilter)??!0,this.validSeconds=(i==null?void 0:i.validSeconds)??N0,this.useCpu=(i==null?void 0:i.forceCpu)??!1;const c=(i==null?void 0:i.maxLength)??8,u=(i==null?void 0:i.startingLength)??1,p=(i==null?void 0:i.useDictionary)??!0,d=(i==null?void 0:i.startFromType)??"bruteforce",g=s.toLowerCase(),m=await this.decodePacket(g);if(!m)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:x,ciphertext:A,cipherMac:_}=m,k=parseInt(x,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new ux):this.gpuInstance||(this.gpuInstance=new Ed,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new ux));const R=performance.now();let C=0,b=performance.now(),B=u,S=0,T=0,F=!1;if(i!=null&&i.startFrom){const H=i.startFrom.toLowerCase();if(d==="dictionary"){const Y=this.wordlist.indexOf(H);Y>=0&&(T=Y+1)}else{F=!0;const Y=Yk(H);Y&&(B=Math.max(u,Y.length),S=Y.index+1,S>=vl(B)&&(B++,S=0))}}let M=0;p&&!F&&this.wordlist.length>0&&(M+=this.wordlist.length-T);for(let H=B;H<=c;H++)M+=vl(H);M-=S;const z=(H,Y,oe)=>{if(!l)return;const se=(performance.now()-R)/1e3,q=se>0?Math.round(C/se):0,le=M-C,G=q>0?le/q:0;l({checked:C,total:M,percent:M>0?Math.min(100,C/M*100):0,rateKeysPerSec:q,etaSeconds:G,elapsedSeconds:se,currentLength:Y,currentPosition:oe,phase:H})},V=H=>{if(!Pv(A,_,H))return{valid:!1};const Y=Et.ChannelCrypto.decryptGroupTextMessage(A,_,H);return!Y.success||!Y.data?{valid:!1}:this.useTimestampFilter&&!Xk(Y.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Jk(Y.data.message)?{valid:!1}:this.useSenderFilter&&!Y.data.sender?{valid:!1}:{valid:!0,message:Y.data.sender?`${Y.data.sender}: ${Y.data.message}`:Y.data.message}};if(!F&&T===0&&B===u&&S===0){z("public-key",0,R0);const H=L0(qu);if(x===H){const Y=V(qu);if(Y.valid)return{found:!0,roomName:R0,key:qu,decryptedMessage:Y.message}}}if(p&&!F&&this.wordlist.length>0)for(let H=T;H<this.wordlist.length;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[H],resumeType:"dictionary"};const Y=this.wordlist[H],oe=F0("#"+Y),ee=L0(oe);if(parseInt(ee,16)===k){const q=V(oe);if(q.valid)return{found:!0,roomName:Y,key:oe,decryptedMessage:q.message,resumeFrom:Y,resumeType:"dictionary"}}C++;const se=performance.now();se-b>=200&&(z("wordlist",Y.length,Y),b=se,await new Promise(q=>setTimeout(q,0)))}const j=this.useCpu?1024:32768,J=(i==null?void 0:i.gpuDispatchMs)??1e3;let W=j,K=!1;for(let H=B;H<=c;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es(H,0)||void 0,resumeType:"bruteforce"};const Y=vl(H);let oe=H===B?S:0;for(;oe<Y;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:es(H,oe)||void 0,resumeType:"bruteforce"};const ee=Math.min(W,Y-oe),se=performance.now();let q;this.useCpu?q=this.cpuInstance.runBatch(k,H,oe,ee,A,_):q=await this.gpuInstance.runBatch(k,H,oe,ee,A,_);const le=performance.now()-se;if(C+=ee,!this.useCpu&&!K&&ee>=j&&le>0){const N=J/le,U=Math.round(ee*N),$=Math.pow(2,Math.round(Math.log2(Math.max(j,U))));W=Math.max(j,$),K=!0}for(const N of q){const U=es(H,N);if(!U)continue;const $=F0("#"+U),Z=V($);if(Z.valid)return{found:!0,roomName:U,key:$,decryptedMessage:Z.message,resumeFrom:U,resumeType:"bruteforce"}}oe+=ee;const G=performance.now();if(G-b>=200){const N=es(H,Math.min(oe,Y-1))||"";z("bruteforce",H,N),b=G,await new Promise(U=>setTimeout(U,0))}}}return{found:!1,resumeFrom:es(c,vl(c)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var g0,fx;function oS(){return fx||(fx=1,g0={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaF
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(d=>(this.enabled=!0,d)).catch(d=>{throw this.enabled=!1,d})}disable(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):i()?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 x0=c,x0}var aS=sS();const lS=aa(aS);function cS(n){if(n.length<4)return null;try{const i=parseInt(n.slice(0,2),16)&3;let l=2;if(i===0||i===3){if(n.length<l+8)return null;l+=8}if(n.length<l+2)return null;const c=parseInt(n.slice(l,l+2),16);l+=2;const u=c*2;return n.length<l+u?null:(l+=u,n.slice(l))}catch{return null}}function uS({packets:n,channels:s,onChannelCreate:i,onRunningChange:l,visible:c=!1}){const[u,p]=D.useState(!1),[d,g]=D.useState(6),[m,x]=D.useState(!1),[A,_]=D.useState(!0),[k,R]=D.useState(!1),[C,b]=D.useState(null),[B,S]=D.useState(new Map),[T,F]=D.useState([]),[M,z]=D.useState(!1),[V,j]=D.useState(null),[J,W]=D.useState(null),[K,ne]=D.useState(0),H=D.useRef(null),Y=D.useRef(null),oe=D.useRef(!1),ee=D.useRef(!1),se=D.useRef(!1),q=D.useRef(new Map),le=D.useRef(!1),G=D.useRef(6),N=D.useRef(!0),U=D.useRef(!1),$=D.useRef(new Set),Z=D.useRef(new Set);D.useEffect(()=>{const Be=new iS;H.current=Be,j(Be.isGpuAvailable());const Ze=new lS;return Y.current=Ze,()=>{Be.destroy(),H.current=null,Ze.disable(),Y.current=null}},[]),D.useEffect(()=>{!c||M||Vk(async()=>{const{ENGLISH_WORDLIST:Be}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Be}},[]).then(({ENGLISH_WORDLIST:Be})=>{H.current&&(H.current.setWordlist(Be),z(!0))}).catch(Be=>{console.error("Failed to load wordlist:",Be),vt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[c,M]),D.useEffect(()=>{const Be=()=>{tt.getUndecryptedPacketCount().then(({count:Qe})=>W(Qe)).catch(()=>W(null))};Be();const Ze=setInterval(Be,36e5);return()=>clearInterval(Ze)},[]);const ae=D.useMemo(()=>new Set(s.map(Be=>Be.key.toUpperCase())),[s]),de=n.filter(Be=>Be.payload_type==="GROUP_TEXT"&&!Be.decrypted);D.useEffect(()=>{let Be=0;S(Ze=>{const Qe=new Map(Ze);let Bt=!1;for(const lt of de)if(!Qe.has(lt.id)){const gt=cS(lt.data);if(gt&&Z.current.has(gt)){Be++;continue}gt&&Z.current.add(gt),Qe.set(lt.id,{packet:lt,attempts:0,lastAttemptLength:0,status:"pending"}),Bt=!0}return Bt?(q.current=Qe,Qe):Ze}),Be>0&&ne(Ze=>Ze+Be)},[de.length]),D.useEffect(()=>{q.current=B},[B]),D.useEffect(()=>{le.current=m},[m]),D.useEffect(()=>{G.current=d},[d]),D.useEffect(()=>{N.current=A},[A]),D.useEffect(()=>{U.current=k},[k]),D.useEffect(()=>{$.current=new Set(de.map(Be=>Be.id))},[de]),D.useEffect(()=>{l==null||l(u)},[u,l]);const Ae=Array.from(B.values()).filter(Be=>Be.status==="pending").length,me=Array.from(B.values()).filter(Be=>Be.status==="cracked").length,He=Array.from(B.values()).filter(Be=>Be.status==="failed").length,qe=D.useCallback(async()=>{if(se.current||!H.current||!oe.current)return;const Be=q.current;let Ze=null,Qe=null;for(const[Ge,nt]of Be.entries())if(nt.status==="pending"){Ze=nt,Qe=Ge;break}if(!Ze&&le.current){const Ge=Array.from(Be.entries()).filter(([,nt])=>nt.status==="failed"&&nt.lastAttemptLength<10);Ge.length>0&&(Ge.sort((nt,rt)=>nt[1].lastAttemptLength-rt[1].lastAttemptLength),[Qe,Ze]=Ge[0])}if(!Ze||Qe===null){oe.current&&setTimeout(()=>qe(),1e3);return}if(!$.current.has(Qe)){S(Ge=>{const nt=new Map(Ge);return nt.delete(Qe),nt}),oe.current&&setTimeout(()=>qe(),10);return}se.current=!0;const Bt=G.current,lt=Ze.lastAttemptLength>0,gt=lt?Ze.lastAttemptLength+1:Bt;try{const Ge=await H.current.crack(Ze.packet.data,{maxLength:gt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...U.current&&{gpuDispatchMs:1e4},...lt&&{useDictionary:!1,startingLength:gt}},nt=>{b(nt)});if(ee.current){ee.current=!1,se.current=!1,b(null);return}if(Ge.found&&Ge.roomName&&Ge.key){S(Ve=>{const kt=new Map(Ve),$t=kt.get(Qe);return $t&&kt.set(Qe,{...$t,status:"cracked",attempts:$t.attempts+1,lastAttemptLength:gt}),kt});const nt={roomName:Ge.roomName,key:Ge.key,packetId:Qe,message:Ge.decryptedMessage||"",crackedAt:Date.now()};F(Ve=>[...Ve,nt]);const rt=Ge.key.toUpperCase();if(!ae.has(rt))try{const Ve="#"+Ge.roomName;await i(Ve,Ge.key),N.current&&await tt.decryptHistoricalPackets({key_type:"channel",channel_name:Ve})}catch(Ve){console.error("Failed to create channel or decrypt historical:",Ve),vt.error("Failed to save cracked channel",{description:Ve instanceof Error?Ve.message:"Channel discovered but could not be saved"})}}else S(nt=>{const rt=new Map(nt),Ve=rt.get(Qe);return Ve&&rt.set(Qe,{...Ve,status:"failed",attempts:Ve.attempts+1,lastAttemptLength:gt}),rt})}catch(Ge){console.error("Cracking error:",Ge),S(nt=>{const rt=new Map(nt),Ve=rt.get(Qe);return Ve&&rt.set(Qe,{...Ve,status:"failed",attempts:Ve.attempts+1,lastAttemptLength:gt}),rt})}se.current=!1,b(null),oe.current&&setTimeout(()=>qe(),100)},[ae,i]),ot=()=>{var Be;if(!V){vt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}p(!0),oe.current=!0,ee.current=!1,(Be=Y.current)==null||Be.enable(),qe()},dt=()=>{var Be,Ze;p(!1),oe.current=!1,ee.current=!0,(Be=H.current)==null||Be.abort(),(Ze=Y.current)==null
Line truncated
|
||||
//# sourceMappingURL=index-Pr4PQ17F.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"mappings":";;;;;;;;6CASa,IAAIA,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,cAAc,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,mBAAmB,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,IAAI,YAAY,EAAEC,EAAE,OAAO,SAAS,SAASC,EAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,GAAGE,EAAEF,CAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,EAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,EAAE,OAAO,OAAOC,EAAE,GAAG,SAASC,EAAEJ,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAACG,EAAE,UAAU,iBAAiB,GACnQA,EAAE,UAAU,SAAS,SAASJ,EAAEK,EAAE,CAAC,GAAc,OAAOL,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEK,EAAE,UAAU,CAAC,EAAED,EAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASO,GAAG,EAAEA,EAAE,UAAUH,EAAE,UAAU,SAASI,EAAER,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,EAAE,KAAK,QAAQG,GAAGL,CAAC,CAAC,IAAIQ,EAAED,EAAE,UAAU,IAAID,EACrfE,EAAE,YAAYD,EAAEN,EAAEO,EAAEL,EAAE,SAAS,EAAEK,EAAE,qBAAqB,GAAG,IAAIC,EAAE,MAAM,QAAQC,EAAE,OAAO,UAAU,eAAeC,EAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EACxK,SAASC,EAAEd,EAAEK,EAAEC,EAAE,CAAC,IAAIS,EAAEC,GAAE,GAAGC,GAAE,KAAKC,GAAE,KAAK,GAASb,GAAN,KAAQ,IAAIU,KAAcV,EAAE,MAAX,SAAiBa,GAAEb,EAAE,KAAcA,EAAE,MAAX,SAAiBY,GAAE,GAAGZ,EAAE,KAAKA,EAAEM,EAAE,KAAKN,EAAEU,CAAC,GAAG,CAACF,EAAE,eAAeE,CAAC,IAAIC,GAAED,CAAC,EAAEV,EAAEU,CAAC,GAAG,IAAII,GAAE,UAAU,OAAO,EAAE,GAAOA,KAAJ,EAAMH,GAAE,SAASV,UAAU,EAAEa,GAAE,CAAC,QAAQC,GAAE,MAAMD,EAAC,EAAEE,GAAE,EAAEA,GAAEF,GAAEE,KAAID,GAAEC,EAAC,EAAE,UAAUA,GAAE,CAAC,EAAEL,GAAE,SAASI,EAAC,CAAC,GAAGpB,GAAGA,EAAE,aAAa,IAAIe,KAAKI,GAAEnB,EAAE,aAAamB,GAAWH,GAAED,CAAC,IAAZ,SAAgBC,GAAED,CAAC,EAAEI,GAAEJ,CAAC,GAAG,MAAM,CAAC,SAAS5B,EAAE,KAAKa,EAAE,IAAIiB,GAAE,IAAIC,GAAE,MAAMF,GAAE,OAAOJ,EAAE,OAAO,CAAC,CAC7a,SAASU,EAAEtB,EAAEK,EAAE,CAAC,MAAM,CAAC,SAASlB,EAAE,KAAKa,EAAE,KAAK,IAAIK,EAAE,IAAIL,EAAE,IAAI,MAAMA,EAAE,MAAM,OAAOA,EAAE,MAAM,CAAC,CAAC,SAASuB,EAAEvB,EAAE,CAAC,OAAiB,OAAOA,GAAlB,UAA4BA,IAAP,MAAUA,EAAE,WAAWb,CAAC,CAAC,SAASqC,EAAOxB,EAAE,CAAC,IAAIK,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,MAAM,IAAIL,EAAE,QAAQ,QAAQ,SAASA,EAAE,CAAC,OAAOK,EAAEL,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIyB,GAAE,OAAO,SAASC,EAAE1B,EAAEK,EAAE,CAAC,OAAiB,OAAOL,GAAlB,UAA4BA,IAAP,MAAgBA,EAAE,KAAR,KAAYwB,EAAO,GAAGxB,EAAE,GAAG,EAAEK,EAAE,SAAS,EAAE,CAAC,CAC/W,SAASsB,EAAE3B,EAAEK,EAAEC,EAAES,EAAEC,GAAE,CAAC,IAAIC,GAAE,OAAOjB,GAAmBiB,KAAd,aAA6BA,KAAZ,aAAcjB,EAAE,MAAK,IAAIkB,GAAE,GAAG,GAAUlB,IAAP,KAASkB,GAAE,OAAQ,QAAOD,GAAC,CAAE,IAAK,SAAS,IAAK,SAASC,GAAE,GAAG,MAAM,IAAK,SAAS,OAAOlB,EAAE,SAAQ,CAAE,KAAKb,EAAE,KAAKC,EAAE8B,GAAE,EAAE,CAAC,CAAC,GAAGA,GAAE,OAAOA,GAAElB,EAAEgB,GAAEA,GAAEE,EAAC,EAAElB,EAAOe,IAAL,GAAO,IAAIW,EAAER,GAAE,CAAC,EAAEH,EAAEL,EAAEM,EAAC,GAAGV,EAAE,GAASN,GAAN,OAAUM,EAAEN,EAAE,QAAQyB,GAAE,KAAK,EAAE,KAAKE,EAAEX,GAAEX,EAAEC,EAAE,GAAG,SAASN,GAAE,CAAC,OAAOA,EAAC,CAAC,GAASgB,IAAN,OAAUO,EAAEP,EAAC,IAAIA,GAAEM,EAAEN,GAAEV,GAAG,CAACU,GAAE,KAAKE,IAAGA,GAAE,MAAMF,GAAE,IAAI,IAAI,GAAGA,GAAE,KAAK,QAAQS,GAAE,KAAK,EAAE,KAAKzB,CAAC,GAAGK,EAAE,KAAKW,EAAC,GAAG,EAAyB,GAAvBE,GAAE,EAAEH,EAAOA,IAAL,GAAO,IAAIA,EAAE,IAAOL,EAAEV,CAAC,EAAE,QAAQmB,GAAE,EAAEA,GAAEnB,EAAE,OAAOmB,KAAI,CAACF,GACrfjB,EAAEmB,EAAC,EAAE,IAAIC,GAAEL,EAAEW,EAAET,GAAEE,EAAC,EAAED,IAAGS,EAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,CAAC,SAASI,GAAErB,EAAEC,CAAC,EAAe,OAAOoB,IAApB,WAAsB,IAAIpB,EAAEoB,GAAE,KAAKpB,CAAC,EAAEmB,GAAE,EAAE,EAAEF,GAAEjB,EAAE,KAAI,GAAI,MAAMiB,GAAEA,GAAE,MAAMG,GAAEL,EAAEW,EAAET,GAAEE,IAAG,EAAED,IAAGS,EAAEV,GAAEZ,EAAEC,EAAEc,GAAEJ,EAAC,UAAqBC,KAAX,SAAa,MAAMZ,EAAE,OAAOL,CAAC,EAAE,MAAM,mDAAuEK,IAApB,kBAAsB,qBAAqB,OAAO,KAAKL,CAAC,EAAE,KAAK,IAAI,EAAE,IAAIK,GAAG,2EAA2E,EAAE,OAAOa,EAAC,CACzZ,SAASU,GAAE5B,EAAEK,EAAEC,EAAE,CAAC,GAASN,GAAN,KAAQ,OAAOA,EAAE,IAAIe,EAAE,GAAGC,GAAE,EAAE,OAAAW,EAAE3B,EAAEe,EAAE,GAAG,GAAG,SAASf,GAAE,CAAC,OAAOK,EAAE,KAAKC,EAAEN,GAAEgB,IAAG,CAAC,CAAC,EAASD,CAAC,CAAC,SAASc,GAAE7B,EAAE,CAAC,GAAQA,EAAE,UAAP,GAAe,CAAC,IAAIK,EAAEL,EAAE,QAAQK,EAAEA,EAAC,EAAGA,EAAE,KAAK,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,EAAE,SAASA,EAAE,EAAQL,EAAE,UAAN,GAAoBA,EAAE,UAAP,MAAeA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAC,CAAC,EAAOL,EAAE,UAAP,KAAiBA,EAAE,QAAQ,EAAEA,EAAE,QAAQK,EAAE,CAAC,GAAOL,EAAE,UAAN,EAAc,OAAOA,EAAE,QAAQ,QAAQ,MAAMA,EAAE,OAAQ,CAC5Z,IAAI8B,GAAE,CAAC,QAAQ,IAAI,EAAEC,EAAE,CAAC,WAAW,IAAI,EAAEC,GAAE,CAAC,uBAAuBF,GAAE,wBAAwBC,EAAE,kBAAkBnB,CAAC,EAAE,SAASqB,GAAG,CAAC,MAAM,MAAM,0DAA0D,CAAE,CACzM,OAAAC,GAAA,SAAiB,CAAC,IAAIN,GAAE,QAAQ,SAAS5B,EAAEK,EAAEC,EAAE,CAACsB,GAAE5B,EAAE,UAAU,CAACK,EAAE,MAAM,KAAK,SAAS,CAAC,EAAEC,CAAC,CAAC,EAAE,MAAM,SAASN,EAAE,CAAC,IAAIK,EAAE,EAAE,OAAAuB,GAAE5B,EAAE,UAAU,CAACK,GAAG,CAAC,EAASA,CAAC,EAAE,QAAQ,SAASL,EAAE,CAAC,OAAO4B,GAAE5B,EAAE,SAASA,EAAE,CAAC,OAAOA,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,SAASA,EAAE,CAAC,GAAG,CAACuB,EAAEvB,CAAC,EAAE,Line truncated
|
||||
Vendored
+2
-2
@@ -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-BBzeYRV9.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Ty42XaBr.css">
|
||||
<script type="module" crossorigin src="/assets/index-Pr4PQ17F.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Bg6UtK9Z.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -108,7 +108,7 @@ const PARTICLE_COLOR_MAP: Record<PacketLabel, string> = {
|
||||
};
|
||||
|
||||
const PARTICLE_SPEED = 0.008;
|
||||
const OBSERVATION_WINDOW_MS = 2000;
|
||||
const DEFAULT_OBSERVATION_WINDOW_SEC = 15;
|
||||
const FORTY_EIGHT_HOURS_MS = 48 * 60 * 60 * 1000;
|
||||
|
||||
const LEGEND_ITEMS = [
|
||||
@@ -254,6 +254,7 @@ interface UseVisualizerDataOptions {
|
||||
chargeStrength: number;
|
||||
letEmDrift: boolean;
|
||||
particleSpeedMultiplier: number;
|
||||
observationWindowSec: number;
|
||||
dimensions: { width: number; height: number };
|
||||
}
|
||||
|
||||
@@ -276,6 +277,7 @@ function useVisualizerData({
|
||||
chargeStrength,
|
||||
letEmDrift,
|
||||
particleSpeedMultiplier,
|
||||
observationWindowSec,
|
||||
dimensions,
|
||||
}: UseVisualizerDataOptions): VisualizerData {
|
||||
const nodesRef = useRef<Map<string, GraphNode>>(new Map());
|
||||
@@ -286,13 +288,18 @@ function useVisualizerData({
|
||||
const pendingRef = useRef<Map<string, PendingPacket>>(new Map());
|
||||
const timersRef = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());
|
||||
const speedMultiplierRef = useRef(particleSpeedMultiplier);
|
||||
const observationWindowRef = useRef(observationWindowSec * 1000);
|
||||
const [stats, setStats] = useState({ processed: 0, animated: 0, nodes: 0, links: 0 });
|
||||
|
||||
// Keep speed multiplier ref in sync with prop
|
||||
// Keep refs in sync with props
|
||||
useEffect(() => {
|
||||
speedMultiplierRef.current = particleSpeedMultiplier;
|
||||
}, [particleSpeedMultiplier]);
|
||||
|
||||
useEffect(() => {
|
||||
observationWindowRef.current = observationWindowSec * 1000;
|
||||
}, [observationWindowSec]);
|
||||
|
||||
// Initialize simulation
|
||||
useEffect(() => {
|
||||
const sim = forceSimulation<GraphNode, GraphLink>([])
|
||||
@@ -657,16 +664,17 @@ function useVisualizerData({
|
||||
if (timersRef.current.has(packetKey)) {
|
||||
clearTimeout(timersRef.current.get(packetKey));
|
||||
}
|
||||
const windowMs = observationWindowRef.current;
|
||||
pendingRef.current.set(packetKey, {
|
||||
key: packetKey,
|
||||
label: getPacketLabel(parsed.payloadType),
|
||||
paths: [{ nodes: path, snr: packet.snr ?? null, timestamp: now }],
|
||||
firstSeen: now,
|
||||
expiresAt: now + OBSERVATION_WINDOW_MS,
|
||||
expiresAt: now + windowMs,
|
||||
});
|
||||
timersRef.current.set(
|
||||
packetKey,
|
||||
setTimeout(() => publishPacket(packetKey), OBSERVATION_WINDOW_MS)
|
||||
setTimeout(() => publishPacket(packetKey), windowMs)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -951,6 +959,7 @@ export function PacketVisualizer({
|
||||
const [showAmbiguousNodes, setShowAmbiguousNodes] = useState(false);
|
||||
const [chargeStrength, setChargeStrength] = useState(-200);
|
||||
const [filterOldRepeaters, setFilterOldRepeaters] = useState(false);
|
||||
const [observationWindowSec, setObservationWindowSec] = useState(DEFAULT_OBSERVATION_WINDOW_SEC);
|
||||
const [letEmDrift, setLetEmDrift] = useState(true);
|
||||
const [particleSpeedMultiplier, setParticleSpeedMultiplier] = useState(3);
|
||||
const [hideUI, setHideUI] = useState(false);
|
||||
@@ -973,6 +982,7 @@ export function PacketVisualizer({
|
||||
chargeStrength,
|
||||
letEmDrift,
|
||||
particleSpeedMultiplier,
|
||||
observationWindowSec,
|
||||
dimensions,
|
||||
});
|
||||
|
||||
@@ -1210,6 +1220,27 @@ export function PacketVisualizer({
|
||||
Hide repeaters >48hrs heard
|
||||
</span>
|
||||
</label>
|
||||
<div className="flex items-center gap-2">
|
||||
<label
|
||||
className="text-muted-foreground"
|
||||
title="How long to wait for duplicate packets via different paths before animating"
|
||||
>
|
||||
Observation window:
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
max="60"
|
||||
value={observationWindowSec}
|
||||
onChange={(e) =>
|
||||
setObservationWindowSec(
|
||||
Math.max(1, Math.min(60, parseInt(e.target.value) || 1))
|
||||
)
|
||||
}
|
||||
className="w-12 px-1 py-0.5 bg-background border border-border rounded text-xs text-center"
|
||||
/>
|
||||
<span className="text-muted-foreground">sec</span>
|
||||
</div>
|
||||
<div className="border-t border-border pt-2 mt-1 flex flex-col gap-2">
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
<Checkbox
|
||||
|
||||
Reference in new issue
Block a user