Add cracker dropin interface

This commit is contained in:
Jack Kingsman committed 2026-01-07 17:35:22 -08:00
1 parent e33275a2fc
commit 89c5fb2ce4
8 files changed
+612 -568

No files matched your search

-542
View File
@@ -1,542 +0,0 @@
function o1(r,o){for(var a=0;a<o.length;a++){const s=o[a];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in r)){const l=Object.getOwnPropertyDescriptor(s,c);l&&Object.defineProperty(r,c,l.get?l:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&s(A)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function nu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},Oe={};/**
* @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 eh;function a1(){if(eh)return Oe;eh=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(k){return k===null||typeof k!="object"?null:(k=p&&k[p]||k["@@iterator"],typeof k=="function"?k:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function y(k,O,z){this.props=k,this.context=O,this.refs=S,this.updater=z||_}y.prototype.isReactComponent={},y.prototype.setState=function(k,O){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,O,"setState")},y.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function x(){}x.prototype=y.prototype;function C(k,O,z){this.props=k,this.context=O,this.refs=S,this.updater=z||_}var w=C.prototype=new x;w.constructor=C,b(w,y.prototype),w.isPureReactComponent=!0;var T=Array.isArray,R=Object.prototype.hasOwnProperty,D={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function I(k,O,z){var V,re={},ue=null,de=null;if(O!=null)for(V in O.ref!==void 0&&(de=O.ref),O.key!==void 0&&(ue=""+O.key),O)R.call(O,V)&&!N.hasOwnProperty(V)&&(re[V]=O[V]);var oe=arguments.length-2;if(oe===1)re.children=z;else if(1<oe){for(var Be=Array(oe),ze=0;ze<oe;ze++)Be[ze]=arguments[ze+2];re.children=Be}if(k&&k.defaultProps)for(V in oe=k.defaultProps,oe)re[V]===void 0&&(re[V]=oe[V]);return{$$typeof:r,type:k,key:ue,ref:de,props:re,_owner:D.current}}function F(k,O){return{$$typeof:r,type:k.type,key:O,ref:k.ref,props:k.props,_owner:k._owner}}function j(k){return typeof k=="object"&&k!==null&&k.$$typeof===r}function L(k){var O={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(z){return O[z]})}var G=/\/+/g;function K(k,O){return typeof k=="object"&&k!==null&&k.key!=null?L(""+k.key):O.toString(36)}function ee(k,O,z,V,re){var ue=typeof k;(ue==="undefined"||ue==="boolean")&&(k=null);var de=!1;if(k===null)de=!0;else switch(ue){case"string":case"number":de=!0;break;case"object":switch(k.$$typeof){case r:case o:de=!0}}if(de)return de=k,re=re(de),k=V===""?"."+K(de,0):V,T(re)?(z="",k!=null&&(z=k.replace(G,"$&/")+"/"),ee(re,O,z,"",function(ze){return ze})):re!=null&&(j(re)&&(re=F(re,z+(!re.key||de&&de.key===re.key?"":(""+re.key).replace(G,"$&/")+"/")+k)),O.push(re)),1;if(de=0,V=V===""?".":V+":",T(k))for(var oe=0;oe<k.length;oe++){ue=k[oe];var Be=V+K(ue,oe);de+=ee(ue,O,z,Be,re)}else if(Be=v(k),typeof Be=="function")for(k=Be.call(k),oe=0;!(ue=k.next()).done;)ue=ue.value,Be=V+K(ue,oe++),de+=ee(ue,O,z,Be,re);else if(ue==="object")throw O=String(k),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return de}function se(k,O,z){if(k==null)return k;var V=[],re=0;return ee(k,V,"","",function(ue){return O.call(z,ue,re++)}),V}function J(k){if(k._status===-1){var O=k._result;O=O(),O.then(function(z){(k._status===0||k._status===-1)&&(k._status=1,k._result=z)},function(z){(k._status===0||k._status===-1)&&(k._status=2,k._result=z)}),k._status===-1&&(k._status=0,k._result=O)}if(k._status===1)return k._result.default;throw k._result}var ne={current:null},W={transition:null},X={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:se,forEach:function(k,O,z){se(k,function(){O.apply(this,arguments)},z)},count:function(k){var O=0;return se(k,function(){O++}),O},toArray:function(k){return se(k,function(O){return O})||[]},only:function(k){if(!j(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},Oe.Component=y,Oe.Fragment=a,Oe.Profiler=c,Oe.PureComponent=C,Oe.StrictMode=s,Oe.Suspense=f,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,Oe.act=Z,Oe.cloneElement=function(k,O,z){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var V=b({},k.props),re=k.key,ue=k.ref,de=k._owner;if(O!=null){if(O.ref!==void 0&&(ue=O.ref,de=D.current),O.key!==void 0&&(re=""+O.key),k.type&&k.type.defaultProps)var oe=k.type.defaultProps;for(Be in O)R.call(O,Be)&&!N.hasOwnProperty(Be)&&(V[Be]=O[Be]===void 0&&oe!==void 0?oe[Be]:O[Be])}var Be=arguments.length-2;if(Be===1)V.children=z;else if(1<Be){oe=Array(Be);for(var ze=0;ze<Be;ze++)oe[ze]=arguments[ze+2];V.children=oe}return{$$typeof:r,type:k.type,key:re,ref:ue,props:V,_owner:de}},Oe.createConLine 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 rh;function s1(){if(rh)return da;rh=1;var r=ou(),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function A(u,f,h){var m,p={},v=null,_=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(_=f.ref);for(m in f)s.call(f,m)&&!l.hasOwnProperty(m)&&(p[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:o,type:u,key:v,ref:_,props:p,_owner:c.current}}return da.Fragment=a,da.jsx=A,da.jsxs=A,da}var nh;function i1(){return nh||(nh=1,ic.exports=s1()),ic.exports}var P=i1(),B=ou();const he=nu(B),au=o1({__proto__:null,default:he},[B]);var js={},cc={exports:{}},rr={},uc={exports:{}},dc={};/**
* @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 oh;function l1(){return oh||(oh=1,(function(r){function o(W,X){var Z=W.length;W.push(X);e:for(;0<Z;){var k=Z-1>>>1,O=W[k];if(0<c(O,X))W[k]=X,W[Z]=O,Z=k;else break e}}function a(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var X=W[0],Z=W.pop();if(Z!==X){W[0]=Z;e:for(var k=0,O=W.length,z=O>>>1;k<z;){var V=2*(k+1)-1,re=W[V],ue=V+1,de=W[ue];if(0>c(re,Z))ue<O&&0>c(de,re)?(W[k]=de,W[ue]=Z,k=ue):(W[k]=re,W[V]=Z,k=V);else if(ue<O&&0>c(de,Z))W[k]=de,W[ue]=Z,k=ue;else break e}}return X}function c(W,X){var Z=W.sortIndex-X.sortIndex;return Z!==0?Z:W.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,u=A.now();r.unstable_now=function(){return A.now()-u}}var f=[],h=[],m=1,p=null,v=3,_=!1,b=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var X=a(h);X!==null;){if(X.callback===null)s(h);else if(X.startTime<=W)s(h),X.sortIndex=X.expirationTime,o(f,X);else break;X=a(h)}}function T(W){if(S=!1,w(W),!b)if(a(f)!==null)b=!0,J(R);else{var X=a(h);X!==null&&ne(T,X.startTime-W)}}function R(W,X){b=!1,S&&(S=!1,x(I),I=-1),_=!0;var Z=v;try{for(w(X),p=a(f);p!==null&&(!(p.expirationTime>X)||W&&!L());){var k=p.callback;if(typeof k=="function"){p.callback=null,v=p.priorityLevel;var O=k(p.expirationTime<=X);X=r.unstable_now(),typeof O=="function"?p.callback=O:p===a(f)&&s(f),w(X)}else s(f);p=a(f)}if(p!==null)var z=!0;else{var V=a(h);V!==null&&ne(T,V.startTime-X),z=!1}return z}finally{p=null,v=Z,_=!1}}var D=!1,N=null,I=-1,F=5,j=-1;function L(){return!(r.unstable_now()-j<F)}function G(){if(N!==null){var W=r.unstable_now();j=W;var X=!0;try{X=N(!0,W)}finally{X?K():(D=!1,N=null)}}else D=!1}var K;if(typeof C=="function")K=function(){C(G)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,se=ee.port2;ee.port1.onmessage=G,K=function(){se.postMessage(null)}}else K=function(){y(G,0)};function J(W){N=W,D||(D=!0,K())}function ne(W,X){I=y(function(){W(r.unstable_now())},X)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(W){W.callback=null},r.unstable_continueExecution=function(){b||_||(b=!0,J(R))},r.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<W?Math.floor(1e3/W):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return a(f)},r.unstable_next=function(W){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var Z=v;v=X;try{return W()}finally{v=Z}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(W,X){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Z=v;v=W;try{return X()}finally{v=Z}},r.unstable_scheduleCallback=function(W,X,Z){var k=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?k+Z:k):Z=k,W){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Z+O,W={id:m++,callback:X,priorityLevel:W,startTime:Z,expirationTime:O,sortIndex:-1},Z>k?(W.sortIndex=Z,o(h,W),a(f)===null&&W===a(h)&&(S?(x(I),I=-1):S=!0,ne(T,Z-k))):(W.sortIndex=O,o(f,W),b||_||(b=!0,J(R))),W},r.unstable_shouldYield=L,r.unstable_wrapCallback=function(W){var X=v;return function(){var Z=v;v=X;try{return W.apply(this,arguments)}finally{v=Z}}}})(dc)),dc}var ah;function c1(){return ah||(ah=1,uc.exports=l1()),uc.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 sh;function u1(){if(sh)return rr;sh=1;var r=ou(),o=c1();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,c={};function l(e,t){A(e,t),A(e+"Capture",t)}function A(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},p={};function v(e){return f.call(p,e)?!0:f.call(m,e)?!1:h.test(e)?p[e]=!0:(m[e]=!0,!1)}function _(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function b(e,t,n,i){if(t===null||typeof t>"u"||_(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,n,i,d,g,E){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=g,this.removeEmptyString=E}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];y[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new S(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){y[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function C(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(x,C);y[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function w(e,t,n,i){var d=y.hasOwnProperty(t)?y[t]:null;(d!==null?d.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!= Line truncated
`+k+e}var z=!1;function V(e,t){if(!e||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(Y){var i=Y}Reflect.construct(e,[],t)}else{try{t.call()}catch(Y){i=Y}e.call(t.prototype)}else{try{throw Error()}catch(Y){i=Y}e()}}catch(Y){if(Y&&i&&typeof Y.stack=="string"){for(var d=Y.stack.split(`
`),g=i.stack.split(`
`),E=d.length-1,M=g.length-1;1<=E&&0<=M&&d[E]!==g[M];)M--;for(;1<=E&&0<=M;E--,M--)if(d[E]!==g[M]){if(E!==1||M!==1)do if(E--,M--,0>M||d[E]!==g[M]){var H=`
`+d[E].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=E&&0<=M);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?O(e):""}function re(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=V(e.type,!1),e;case 11:return e=V(e.type.render,!1),e;case 1:return e=V(e.type,!0),e;default:return""}}function ue(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case D:return"Portal";case F:return"Profiler";case I:return"StrictMode";case K:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(t);case 8:return t===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=Be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,g=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(E){i=""+E,g.call(this,E)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dt(e){e._valueTracker||(e._valueTracker=ze(e))}function it(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Be(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ft(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 Je(e,t){var n=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ar(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=oe(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ut(e,t){t=t.checked,t!=null&&w(e,"checked",t,!1)}function Et(e,t){Ut(e,t);var n=oe(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ht(e,t.type,n):t.hasOwnProperty("defaultValue")&&ht(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ht(e,t,n){(t!=="number"||ft(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var It=Array.isArray;function nt(e,t,n,i){if(e=e.options,t){t={};for(var d=0;d<n.length;d++)t["$"+n[d]]=!0;for(n=0;n<e.length;n++)d=t.hasOwnProperty("$"+e[n].value),e[n].selected!==d&&(e[n].selected=d),d&&i&&(e[n].defaultSelected=!0)}else{for(n=""+oe(n),t=null,d=0;d<e.length;d++){if(e[d].value===n){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Ve(e,t){if(t.dangerouslySetInnerHTML! Line truncated
`).replace(gm,"")}function Ka(e,t,n){if(t=vd(t),vd(e)!==t&&n)throw Error(a(425))}function Ya(){}var Ji=null,$i=null;function el(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tl=typeof setTimeout=="function"?setTimeout:void 0,vm=typeof clearTimeout=="function"?clearTimeout:void 0,yd=typeof Promise=="function"?Promise:void 0,ym=typeof queueMicrotask=="function"?queueMicrotask:typeof yd<"u"?function(e){return yd.resolve(null).then(e).catch(xm)}:tl;function xm(e){setTimeout(function(){throw e})}function rl(e,t){var n=t,i=0;do{var d=n.nextSibling;if(e.removeChild(n),d&&d.nodeType===8)if(n=d.data,n==="/$"){if(i===0){e.removeChild(d),Fo(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=d}while(n);Fo(t)}function an(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jn=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Jn,Yo="__reactProps$"+Jn,Ur="__reactContainer$"+Jn,nl="__reactEvents$"+Jn,wm="__reactListeners$"+Jn,bm="__reactHandles$"+Jn;function Sn(e){var t=e[Dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xd(e);e!==null;){if(n=e[Dr])return n;e=xd(e)}return t}e=n,n=e.parentNode}return null}function Zo(e){return e=e[Dr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $n(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Za(e){return e[Yo]||null}var ol=[],eo=-1;function sn(e){return{current:e}}function st(e){0>eo||(e.current=ol[eo],ol[eo]=null,eo--)}function et(e,t){eo++,ol[eo]=e.current,e.current=t}var ln={},Lt=sn(ln),Xt=sn(!1),En=ln;function to(e,t){var n=e.type.contextTypes;if(!n)return ln;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},g;for(g in n)d[g]=t[g];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Jt(e){return e=e.childContextTypes,e!=null}function Xa(){st(Xt),st(Lt)}function wd(e,t,n){if(Lt.current!==ln)throw Error(a(168));et(Lt,t),et(Xt,n)}function bd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(a(108,de(e)||"Unknown",d));return Z({},n,i)}function Ja(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,En=Lt.current,et(Lt,e),et(Xt,Xt.current),!0}function _d(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=bd(e,t,En),i.__reactInternalMemoizedMergedChildContext=e,st(Xt),st(Lt),et(Lt,e)):st(Xt),et(Xt,n)}var Wr=null,$a=!1,al=!1;function Cd(e){Wr===null?Wr=[e]:Wr.push(e)}function _m(e){$a=!0,Cd(e)}function cn(){if(!al&&Wr!==null){al=!0;var e=0,t=Ye;try{var n=Wr;for(Ye=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Wr=null,$a=!1}catch(d){throw Wr!==null&&(Wr=Wr.slice(e+1)),Su(Ei,cn),d}finally{Ye=t,al=!1}}return null}var ro=[],no=0,es=null,ts=0,hr=[],Ar=0,Rn=null,Qr=1,Gr="";function Tn(e,t){ro[no++]=ts,ro[no++]=es,es=e,ts=t}function kd(e,t,n){hr[Ar++]=Qr,hr[Ar++]=Gr,hr[Ar++]=Rn,Rn=e;var i=Qr;e=Gr;var d=32-br(i)-1;i&=~(1<<d),n+=1;var g=32-br(t)+d;if(30<g){var E=d-d%5;g=(i&(1<<E)-1).toString(32),i>>=E,d-=E,Qr=1<<32-br(t)+d|n<<d|i,Gr=g+e}else Qr=1<<g|n<<d|i,Gr=e}function sl(e){e.return!==null&&(Tn(e,1),kd(e,1,0))}function il(e){for(;e===es;)es=ro[--no],ro[no]=null,ts=ro[--no],ro[no]=null;for(;e===Rn;)Rn=hr[--Ar],hr[Ar]=null,Gr=hr[--Ar],hr[Ar]=null,Qr=hr[--Ar],hr[Ar]=null}var ir=null,lr=null,lt=!1,Cr=null;function Sd(e,t){var n=vr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ed(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ir=e,lr=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ir=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rn!==null?{id:Qr,overflow:Gr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=vr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ir=e,lr=null,!0):!1;default:return!1}}function ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cl(e){if(lt){var t=lr;if(t){var n=t;if(!Ed(e,t)){if(ll(e))throw Error(a(418));t=an(n.nextSibling);var i=ir;t&&Ed(e,t)?Sd(i,n):(e.flags=e.flags&-4097|2,lt=!1,ir=e)}}else{if(ll(e))throw Error(a(418));e.flags=e.flags&-4097|2,lt=!1,ir=e}}}function Rd(e){for(e=e. Line truncated
Error generating stack: `+g.message+`
`+g.stack}return{value:e,source:t,stack:d,digest:null}}function Pl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Nl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Nm=typeof WeakMap=="function"?WeakMap:Map;function cf(e,t,n){n=Kr(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){ws||(ws=!0,ql=i),Nl(e,t)},n}function uf(e,t,n){n=Kr(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var d=t.value;n.payload=function(){return i(d)},n.callback=function(){Nl(e,t)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(n.callback=function(){Nl(e,t),typeof i!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var E=t.stack;this.componentDidCatch(t.value,{componentStack:E!==null?E:""})}),n}function df(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Nm;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(n)||(d.add(n),e=Gm.bind(null,e,t,n),t.then(e,e))}function ff(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hf(e,t,n,i,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Kr(-1,1),t.tag=2,dn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Dm=T.ReactCurrentOwner,$t=!1;function Gt(e,t,n,i){t.child=e===null?Nd(t,null,n,i):ao(t,e.child,n,i)}function Af(e,t,n,i,d){n=n.render;var g=t.ref;return io(t,d),i=_l(e,t,n,i,g,d),n=Cl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(lt&&n&&sl(t),t.flags|=1,Gt(e,t,i,d),t.child)}function pf(e,t,n,i,d){if(e===null){var g=n.type;return typeof g=="function"&&!ec(g)&&g.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=g,mf(e,t,g,i,d)):(e=Es(n.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,(e.lanes&d)===0){var E=g.memoizedProps;if(n=n.compare,n=n!==null?n:Wo,n(E,i)&&e.ref===t.ref)return Yr(e,t,d)}return t.flags|=1,e=gn(g,i),e.ref=t.ref,e.return=t,t.child=e}function mf(e,t,n,i,d){if(e!==null){var g=e.memoizedProps;if(Wo(g,i)&&e.ref===t.ref)if($t=!1,t.pendingProps=i=g,(e.lanes&d)!==0)(e.flags&131072)!==0&&($t=!0);else return t.lanes=e.lanes,Yr(e,t,d)}return Dl(e,t,n,i,d)}function gf(e,t,n){var i=t.pendingProps,d=i.children,g=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(fo,cr),cr|=n;else{if((n&1073741824)===0)return e=g!==null?g.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(fo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=g!==null?g.baseLanes:n,et(fo,cr),cr|=i}else g!==null?(i=g.baseLanes|n,t.memoizedState=null):i=n,et(fo,cr),cr|=i;return Gt(e,t,d,n),t.child}function vf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dl(e,t,n,i,d){var g=Jt(n)?En:Lt.current;return g=to(t,g),io(t,d),n=_l(e,t,n,i,g,d),i=Cl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(lt&&i&&sl(t),t.flags|=1,Gt(e,t,n,d),t.child)}function yf(e,t,n,i,d){if(Jt(n)){var g=!0;Ja(t)}else g=!1;if(io(t,d),t.stateNode===null)ms(e,t),sf(t,n,i),Bl(t,n,i,d),i=!0;else if(e===null){var E=t.stateNode,M=t.memoizedProps;E.props=M;var H=E.context,Y=n.contextType;typeof Y=="object"&&Y!==null?Y=pr(Y):(Y=Jt(n)?En:Lt.current,Y=to(t,Y));var ie=n.getDerivedStateFromProps,ce=typeof ie=="function"||typeof E.getSnapshotBeforeUpdate=="function";ce||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==i||H!==Y)&&lf(t,E,i,Y),un=!1;var ae=t.memoizedState;E.state=ae,is(t,i,E,d),H=t.memoizedState,M!==i||ae!==H||Xt.current||un?(typeof ie=="function"&&(Tl(t,n,ie,i),H=t.memoizedState),(M=un||af(t,n,M,i,ae,H,Y))?(ce||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(t.flags|=4194308)):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),E.props=i,E.state=H,E.context=Y,i=M):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{E=t.stateNode,Id(e,t),M=t.memoizedProps,Y=t.type===t.elementType?M:kr(t.type,M),E.props=Y,ce=t.pendingProps,ae=E.context,H=n.contextType,typeof H=="object"&&H!==null?H=pr(H):(H=Jt(n)?En:Lt.current,H=to(t,H));var pe=n.getDerivedStateFromProps;(ie=typeof pe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==ce||ae!==H)&&lf(t,E,i,H),un=!1,ae=t.memoizedState,E 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 p1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m1=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),ch=r=>{const o=m1(r);return o.charAt(0).toUpperCase()+o.slice(1)},oA=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),g1=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var v1={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 y1=B.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:c="",children:l,iconNode:A,...u},f)=>B.createElement("svg",{ref:f,...v1,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:oA("lucide",c),...!l&&!g1(u)&&{"aria-hidden":"true"},...u},[...A.map(([h,m])=>B.createElement(h,m)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const su=(r,o)=>{const a=B.forwardRef(({className:s,...c},l)=>B.createElement(y1,{ref:l,iconNode:o,className:oA(`lucide-${p1(ch(r))}`,`lucide-${r}`,s),...c}));return a.displayName=ch(r),a};/**
* @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 x1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],w1=su("check",x1);/**
* @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 b1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],_1=su("menu",b1);/**
* @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 C1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],aA=su("x",C1);var sA=nA();const iA=nu(sA);function k1(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",o.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}const S1=r=>{switch(r){case"success":return T1;case"info":return P1;case"warning":return B1;case"error":return N1;default:return null}},E1=Array(12).fill(0),R1=({visible:r,className:o})=>he.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},he.createElement("div",{className:"sonner-spinner"},E1.map((a,s)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),T1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),B1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),P1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),D1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I1=()=>{const[r,o]=he.useState(document.hidden);return he.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Qc=1;class j1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const a=this.subscribers.indexOf(o);this.subscribers.splice(a,1)}),this.publish=o=>{this.subscribers.forEach(a=>a(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var a;const{message:s,...c}=o,l=typeof(o==null?void 0:o.id)=="number"||((a=o.id)==null?void 0:a.length)>0?o.id:Qc++,A=this.toasts.find(f=>f.id===l),u=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),A?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...o,id:l,title:s}),{...f,...o,id:l,dismissible:u,title:s}):f):this.addToast({title:s,...c,dismissible:u,id:l}),l},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:o,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),o),this.message=(o,a)=>this.create({...a,message:o}),this.error=(o,a)=>this.create({...a,message:o,type:"error"}),this.success=(o,a)=>this.create({...a,type:"success",message:o}),this.info=(o,a)=>this.create({...a,type:"info",message:o}),this.warning=(o,a)=>this.create({...a,type:"warning",message:o}),this.loading=(o,a)=>this.create({...a,type:"loading",message:o}),this.promise=(o,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:o,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let l=s!==void 0,A;const u=c.then(async h=>{if(A=["resolve",h],he.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(O1(h)&&!h.ok){l=!1;const p=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,b=typeof p=="object"&&!he.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...b})}else if(h instanceof Error){l=!1;const p=typeof a.error=="function"?await a.error(h):a.error,Line truncated
`).map((J,ne,W)=>P.jsxs("span",{children:[J,ne<W.length-1&&P.jsx("br",{})]},ne)),!L&&P.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:bh(x.sender_timestamp||x.received_at)}),x.outgoing&&(x.acked?" ✓":" ?")]})]})]},x.id)})]})}const uv=B.forwardRef(function({onSend:o,disabled:a,placeholder:s},c){const[l,A]=B.useState(""),[u,f]=B.useState(!1),h=B.useRef(null);B.useImperativeHandle(c,()=>({appendText:v=>{var _;A(b=>b+v),(_=h.current)==null||_.focus()}}));const m=B.useCallback(async v=>{v.preventDefault();const _=l.trim();if(!(!_||u||a)){f(!0);try{await o(_),A("")}catch(b){console.error("Failed to send message:",b)}finally{f(!1)}}},[l,u,a,o]),p=B.useCallback(v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),m(v))},[m]);return P.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:m,children:[P.jsx(bt,{ref:h,type:"text",value:l,onChange:v=>A(v.target.value),onKeyDown:p,placeholder:s||"Type a message...",disabled:a||u,className:"flex-1"}),P.jsx(Vr,{type:"submit",disabled:a||u||!l.trim(),children:u?"Sending...":"Send"})]})});function St(r,o,{checkForDefaultPrevented:a=!0}={}){return function(c){if(r==null||r(c),a===!1||!c.defaultPrevented)return o==null?void 0:o(c)}}function dv(r,o){const a=B.createContext(o),s=l=>{const{children:A,...u}=l,f=B.useMemo(()=>u,Object.values(u));return P.jsx(a.Provider,{value:f,children:A})};s.displayName=r+"Provider";function c(l){const A=B.useContext(a);if(A)return A;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,c]}function Sa(r,o=[]){let a=[];function s(l,A){const u=B.createContext(A),f=a.length;a=[...a,A];const h=p=>{var x;const{scope:v,children:_,...b}=p,S=((x=v==null?void 0:v[r])==null?void 0:x[f])||u,y=B.useMemo(()=>b,Object.values(b));return P.jsx(S.Provider,{value:y,children:_})};h.displayName=l+"Provider";function m(p,v){var S;const _=((S=v==null?void 0:v[r])==null?void 0:S[f])||u,b=B.useContext(_);if(b)return b;if(A!==void 0)return A;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[h,m]}const c=()=>{const l=a.map(A=>B.createContext(A));return function(u){const f=(u==null?void 0:u[r])||l;return B.useMemo(()=>({[`__scope${r}`]:{...u,[r]:f}}),[u,f])}};return c.scopeName=r,[s,fv(c,...o)]}function fv(...r){const o=r[0];if(r.length===1)return o;const a=()=>{const s=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(l){const A=s.reduce((u,{useScope:f,scopeName:h})=>{const p=f(l)[`__scope${h}`];return{...u,...p}},{});return B.useMemo(()=>({[`__scope${o.scopeName}`]:A}),[A])}};return a.scopeName=o.scopeName,a}var So=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},hv=au[" useId ".trim().toString()]||(()=>{}),Av=0;function ba(r){const[o,a]=B.useState(hv());return So(()=>{a(s=>s??String(Av++))},[r]),o?`radix-${o}`:""}var pv=au[" useInsertionEffect ".trim().toString()]||So;function Ai({prop:r,defaultProp:o,onChange:a=()=>{},caller:s}){const[c,l,A]=mv({defaultProp:o,onChange:a}),u=r!==void 0,f=u?r:c;{const m=B.useRef(r!==void 0);B.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,s])}const h=B.useCallback(m=>{var p;if(u){const v=gv(m)?m(r):m;v!==r&&((p=A.current)==null||p.call(A,v))}else l(m)},[u,r,l,A]);return[f,h]}function mv({defaultProp:r,onChange:o}){const[a,s]=B.useState(r),c=B.useRef(a),l=B.useRef(o);return pv(()=>{l.current=o},[o]),B.useEffect(()=>{var A;c.current!==a&&((A=l.current)==null||A.call(l,a),c.current=a)},[a,c]),[a,s,l]}function gv(r){return typeof r=="function"}function vv(r){const o=yv(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(wv);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function yv(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=_v(c),u=bv(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var xv=Symbol("radix.slottable");function wv(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===xv}function bv(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function _v(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.getLine truncated
.`.concat(qv,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(u,"px ").concat(s,`;
}
body[`).concat(_o,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(s,";"),a==="margin"&&`
padding-left: `.concat(c,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(A,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(s,`;
`),a==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(oi,` {
right: `).concat(u,"px ").concat(s,`;
}
.`).concat(ai,` {
margin-right: `).concat(u,"px ").concat(s,`;
}
.`).concat(oi," .").concat(oi,` {
right: 0 `).concat(s,`;
}
.`).concat(ai," .").concat(ai,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(_o,`] {
`).concat(Kv,": ").concat(u,`px;
}
`)},Ph=function(){var r=parseInt(document.body.getAttribute(_o)||"0",10);return isFinite(r)?r:0},h2=function(){B.useEffect(function(){return document.body.setAttribute(_o,(Ph()+1).toString()),function(){var r=Ph()-1;r<=0?document.body.removeAttribute(_o):document.body.setAttribute(_o,r.toString())}},[])},A2=function(r){var o=r.noRelative,a=r.noImportant,s=r.gapMode,c=s===void 0?"margin":s;h2();var l=B.useMemo(function(){return u2(c)},[c]);return B.createElement(d2,{styles:f2(l,!o,c,a?"":"!important")})},Xc=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Xc=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Xc=!1}var mo=Xc?{passive:!1}:!1,p2=function(r){return r.tagName==="TEXTAREA"},MA=function(r,o){if(!(r instanceof Element))return!1;var a=window.getComputedStyle(r);return a[o]!=="hidden"&&!(a.overflowY===a.overflowX&&!p2(r)&&a[o]==="visible")},m2=function(r){return MA(r,"overflowY")},g2=function(r){return MA(r,"overflowX")},Nh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=OA(r,s);if(c){var l=FA(r,s),A=l[1],u=l[2];if(A>u)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},v2=function(r){var o=r.scrollTop,a=r.scrollHeight,s=r.clientHeight;return[o,a,s]},y2=function(r){var o=r.scrollLeft,a=r.scrollWidth,s=r.clientWidth;return[o,a,s]},OA=function(r,o){return r==="v"?m2(o):g2(o)},FA=function(r,o){return r==="v"?v2(o):y2(o)},x2=function(r,o){return r==="h"&&o==="rtl"?-1:1},w2=function(r,o,a,s,c){var l=x2(r,window.getComputedStyle(o).direction),A=l*s,u=a.target,f=o.contains(u),h=!1,m=A>0,p=0,v=0;do{if(!u)break;var _=FA(r,u),b=_[0],S=_[1],y=_[2],x=S-y-l*b;(b||x)&&OA(r,u)&&(p+=x,v+=b);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(o.contains(u)||o===u));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},zs=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Dh=function(r){return[r.deltaX,r.deltaY]},Ih=function(r){return r&&"current"in r?r.current:r},b2=function(r,o){return r[0]===o[0]&&r[1]===o[1]},_2=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},C2=0,go=[];function k2(r){var o=B.useRef([]),a=B.useRef([0,0]),s=B.useRef(),c=B.useState(C2++)[0],l=B.useState(jA)[0],A=B.useRef(r);B.useEffect(function(){A.current=r},[r]),B.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Gv([r.lockRef.current],(r.shards||[]).map(Ih),!0).filter(Boolean);return S.forEach(function(y){return y.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=B.useCallback(function(S,y){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!A.current.allowPinchZoom;var x=zs(S),C=a.current,w="deltaX"in S?S.deltaX:C[0]-x[0],T="deltaY"in S?S.deltaY:C[1]-x[1],R,D=S.target,N=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in S&&N==="h"&&D.type==="range")return!1;var I=window.getSelection(),F=I&&I.anchorNode,j=F?F===D||F.contains(D):!1;if(j)return!1;var L=Nh(N,D);if(!L)return!0;if(L?R=N:(R=N==="v"?"h":"v",L=Nh(N,D)),!L)return!1;if(!s.current&&"changedTouches"in S&&(w||T)&&(s.current=R),!R)return!0;var G=s.current||R;return w2(G,y,S,G==="h"?w:T)},[]),f=B.useCallback(function(S){var y=S;if(!(!go.length||go[go.length-1]!==l)){var x="deltaY"in y?Dh(y):zs(y),C=o.current.filter(function(R){return R.name===y.type&&(R.target===y.target||y.target===R.shadowParent)&&b2(R.delta,x)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var w=(A.current.shards||[]).map(Ih).filter(Boolean).filter(function(R){return R.contains(y.target)}),T=w.length>0?u(y,w[0]):!A.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),h=B.useCallback(function(S,y,x,C){var w={name:S,delta:y,target:x,should:C,shadowParent:S2(x)};o.current.push(w),setTimeout(function(){o.current=o.current.filter(function(T){return T!==w})},1)},[]),m=B.useCallback(function(S){a.current=zs(S),s.current=void 0},[]),p=B.useCallback(function(S){h(S.type,Dh(S),S.target,u(S,r.lockRef.current))},[]),v=B.useCallback(function(S){h(S.type,zs(S),S.target,u(S,r.lockRef.current))},[]);B.useEffect(function(){return go.push(l),r.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,mo),document.addEventListener("touchmove",f,mo),document.addEventListener("touchstart",m,mo),function(){go=go.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,mo),document.removeEventListener("touchmove",f,mo),document.removeEventListener("touchstart",m,mo)}},[]);var _=r.removeScrollBar,b=r.inert;return B.createElement(B.Fragment,null,b?B.createElement(l,{styles:_2(c)}):null,_?B.createElement(A2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function S2(r){for(var o=null;r!==null;)r instanceof ShadowRoot&&(o=r.host,r=r.host),r=r.parentNode;return o}const E2=t2(IA,k2);var LA=B.forwardRef(function(r,o){return B.createElement(pi,zr({},r,{ref:o,sideCar:E2}))});LA.classNames=pi.classNames;var R2=function(r){if(typeof document>"u")return null;var o=Array.isArray(r)?r[0]:r;return o.ownerDocument.body},vo=new WeakMap,Vs=new WeakMap,Us={},wc=0,HA=function(r){return r&&(r.host||HA(r.parentNode))},T2=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=HA(a);return s&&r.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",r,". Doing nothing"),null)}).filter(function(a){return!!a})},B2=function(r,o,a,s){var c=T2(o,Array.isArray(r)?r:[r]);Us[a]||(Us[a]=new WeakMap);var l=Us[a],A=[],u=new Set,f=new Set(c),h=function(p){!p||u.has(p)||(u.add(p),h(p.parentNode))};c.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))m(v);else try{var _=v.getAttribute(s),b=_!==null&&_!=="false",S=(vo.get(v)||0)+1,y=(l.get(v)||0)+1;vo.set(v,S),l.set(v,y),A.push(v),S===1&&b&&Vs.set(v,!0),y===1&&v.setAttribute(a,"true"),b||v.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return m(o),u.clear(),wc++,function(){A.forEach(function(p){var v=vo.get(p)-1,_=l.get(p)-1;vo.set(p,v),l.set(p,_),v||(Vs.has(p)||p.removeAttribute(s),Vs.delete(p)),_||p.removeAttribute(a)}),wc--,wc||(vo=new WeakMap,vo=new WeakMap,Vs=new WeakMap,Us={})}},P2=function(r,o,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),c=R2(r);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),B2(s,c,a,"aria-hidden")):function(){return null}};function N2(r){const o=D2(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(j2);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function D2(r){const o=B.forwardRef((a,s)=>{const{children:c Line truncated
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return B.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},G2="DialogDescriptionWarning",q2=({contentRef:r,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t0(G2).contentName}}.`;return B.useEffect(()=>{var l;const c=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(s))},[s,r,o]),null},r0=VA,n0=QA,gi=GA,vi=qA,yi=YA,xi=XA,o0=$A;const a0=r0,K2=n0,s0=B.forwardRef(({className:r,...o},a)=>P.jsx(gi,{ref:a,className:Ze("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o}));s0.displayName=gi.displayName;const fu=B.forwardRef(({className:r,children:o,...a},s)=>P.jsxs(K2,{children:[P.jsx(s0,{}),P.jsxs(vi,{ref:s,className:Ze("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[o,P.jsxs(o0,{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:[P.jsx(aA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fu.displayName=vi.displayName;const hu=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});hu.displayName="DialogHeader";const Au=({className:r,...o})=>P.jsx("div",{className:Ze("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});Au.displayName="DialogFooter";const pu=B.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ze("text-lg font-semibold leading-none tracking-tight",r),...o}));pu.displayName=yi.displayName;const Y2=B.forwardRef(({className:r,...o},a)=>P.jsx(xi,{ref:a,className:Ze("text-sm text-muted-foreground",r),...o}));Y2.displayName=xi.displayName;function jh(r){const o=Z2(r),a=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(J2);if(f){const h=f.props.children,m=u.map(p=>p===f?B.Children.count(h)>1?B.Children.only(null):B.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:B.isValidElement(h)?B.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Z2(r){const o=B.forwardRef((a,s)=>{const{children:c,...l}=a;if(B.isValidElement(c)){const A=ey(c),u=$2(l,c.props);return c.type!==B.Fragment&&(u.ref=s?ka(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var X2=Symbol("radix.slottable");function J2(r){return B.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===X2}function $2(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function ey(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}function ty(r){const o=r+"CollectionProvider",[a,s]=Sa(o),[c,l]=a(o,{collectionRef:{current:null},itemMap:new Map}),A=S=>{const{scope:y,children:x}=S,C=he.useRef(null),w=he.useRef(new Map).current;return P.jsx(c,{scope:y,itemMap:w,collectionRef:C,children:x})};A.displayName=o;const u=r+"CollectionSlot",f=jh(u),h=he.forwardRef((S,y)=>{const{scope:x,children:C}=S,w=l(u,x),T=yr(y,w.collectionRef);return P.jsx(f,{ref:T,children:C})});h.displayName=u;const m=r+"CollectionItemSlot",p="data-radix-collection-item",v=jh(m),_=he.forwardRef((S,y)=>{const{scope:x,children:C,...w}=S,T=he.useRef(null),R=yr(y,T),D=l(m,x);return he.useEffect(()=>(D.itemMap.set(T,{ref:T,...w}),()=>void D.itemMap.delete(T))),P.jsx(v,{[p]:"",ref:R,children:C})});_.displayName=m;function b(S){const y=l(r+"CollectionConsumer",S);return he.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const w=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((D,N)=>w.indexOf(D.ref.current)-w.indexOf(N.ref.current))},[y.coll Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}};r.RequestPayloadDecoder=s}}),R4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/response.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponsePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.ResponsePayloadDecoder=s}}),T4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/anon-request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AnonRequestPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<35){const b={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.bytesToHex)(c.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+f,endByte:u+f+31,value:m}),f+=32;const p=(0,a.bytesToHex)(c.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(35));l!=null&&l.includeSegments&&c.length>35&&A.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:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,senderPublicKey:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-35};return l!=null&&l.includeSegments&&(_.segments=A),_}catch(A){return{type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.AnonRequestPayloadDecoder=s}}),B4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/ack.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AckPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const m={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(m.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),m}const A=[],u=(l==null?void 0:l.segmentOffset)||0,f=(0,a.bytesToHex)(c.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${f}`,startByte:u,endByte:u+3,value:f}),l!=null&&l.includeSegments&&c.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+c.length-1,value:(0,a.bytesToHex)(c.subarray(4))});const h={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!0,checksum:f};return l!=null&&l.includeSegments&&(h.segments=A),h}catch(A){return{type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}};r.AckPayloadDecoder=s}}),P4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/path.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathPayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c){try{if(c.length<2)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=c[0];if(c.length<1+l+1)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let h=0;h<l;h++)A.push((0,a.byteToHex)(c[1+h]));const u=c[1+l];let f="";return c.length>1+l+1&&(f=(0,a.bytesToHex)(c.subarray(1+l+1))),{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:u,extraData:f}}catch(l){return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}};r.PathPayloadDecoder=s}}),N4=_e({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/text-message.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextMessagePayloadDecoder=void 0;var o=ur(),a=Ft(),s=class{static decode(c,l){try{if(c.length<4){const b={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),b}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+f,endByte:u+c.length-1,value:v});const _={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.include Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
);
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
const CHARS: array<u32, 37> = array<u32, 37>(
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
0x2du // dash
);
struct Params {
target_channel_hash: u32,
batch_offset: u32,
name_length: u32,
batch_size: u32,
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
ciphertext_words: u32, // Number of 32-bit words in ciphertext
ciphertext_len_bits: u32, // Length of ciphertext in bits
verify_mac: u32, // 1 to verify MAC, 0 to skip
}
@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
fn rotr(x: u32, n: u32) -> u32 {
return (x >> n) | (x << (32u - n));
}
fn ch(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (~x & z);
}
fn maj(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (x & z) ^ (y & z);
}
fn sigma0(x: u32) -> u32 {
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
}
fn sigma1(x: u32) -> u32 {
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
}
fn gamma0(x: u32) -> u32 {
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
}
fn gamma1(x: u32) -> u32 {
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
}
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
// Message starts with '#' (0x23)
var byte_pos = 0u;
var word_idx = 0u;
var current_word = 0x23000000u; // '#' in big-endian position 0
byte_pos = 1u;
var remaining = idx;
var prev_was_dash = false;
// Generate room name from index
for (var i = 0u; i < length; i++) {
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
var char_idx = remaining % char_count;
remaining = remaining / char_count;
// Check for consecutive dashes (invalid)
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
if (is_dash && prev_was_dash) {
return false; // Invalid: consecutive dashes
}
prev_was_dash = is_dash;
// Map char index to actual character
let c = CHARS[char_idx];
// Pack byte into current word (big-endian)
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u && byte_pos > 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0u;
}
current_word = current_word | (c << shift);
byte_pos = byte_pos + 1u;
}
// Add padding: 0x80 followed by zeros, then length in bits
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
// Add 0x80 padding byte
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0x80000000u;
} else {
current_word = current_word | (0x80u << shift);
}
byte_pos = byte_pos + 1u;
// Store current word
if (byte_pos % 4u == 0u || word_idx < 14u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
}
// Zero-fill until word 14
for (var i = word_idx; i < 14u; i++) {
(*msg)[i] = 0u;
}
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
(*msg)[14u] = 0u;
(*msg)[15u] = msg_len_bits;
return true;
}
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
// Initialize hash values
var h: array<u32, 8> = array<u32, 8>(
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
);
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Compute SHA256 of the key (16 bytes) to get channel hash
fn sha256_key(key: array<u32, 4>) -> u32 {
var msg: array<u32, 16>;
// Key bytes (16 bytes = 4 words)
msg[0] = key[0];
msg[1] = key[1];
msg[2] = key[2];
msg[3] = key[3];
// Padding: 0x80 followed by zeros
msg[4] = 0x80000000u;
for (var i = 5u; i < 14u; i++) {
msg[i] = 0u;
}
// Length: 128 bits
msg[14] = 0u;
msg[15] = 128u;
let hash = sha256_block(&msg);
// Return first byte of hash (big-endian)
return hash[0] >> 24u;
}
// HMAC-SHA256 for MAC verification
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
// ipad = 0x36 repeated, opad = 0x5c repeated
// Build padded key (64 bytes = 16 words)
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
var k_pad: array<u32, 16>;
k_pad[0] = key[0];
k_pad[1] = key[1];
k_pad[2] = key[2];
k_pad[3] = key[3];
for (var i = 4u; i < 16u; i++) {
k_pad[i] = 0u;
}
// Inner hash: SHA256((K' ^ ipad) || message)
// First block: K' ^ ipad (64 bytes)
var inner_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
inner_block[i] = k_pad[i] ^ 0x36363636u;
}
// Initialize hash state with first block
var h: array<u32, 8> = sha256_block(&inner_block);
// Process ciphertext blocks (continuing from h state)
let ciphertext_words = params.ciphertext_words;
var word_idx = 0u;
// Process full 64-byte blocks of ciphertext
while (word_idx + 16u <= ciphertext_words) {
var block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
block[i] = ciphertext[word_idx + i];
}
h = sha256_block_continue(&block, h);
word_idx = word_idx + 16u;
}
// Final block with remaining ciphertext + padding
var final_block: array<u32, 16>;
var remaining = ciphertext_words - word_idx;
for (var i = 0u; i < 16u; i++) {
if (i < remaining) {
final_block[i] = ciphertext[word_idx + i];
} else if (i == remaining) {
// Add 0x80 padding
final_block[i] = 0x80000000u;
} else {
final_block[i] = 0u;
}
}
// Add length (64 bytes of ipad + ciphertext length)
let total_bits = 512u + params.ciphertext_len_bits;
if (remaining < 14u) {
final_block[14] = 0u;
final_block[15] = total_bits;
h = sha256_block_continue(&final_block, h);
} else {
// Need extra block for length
h = sha256_block_continue(&final_block, h);
var len_block: array<u32, 16>;
for (var i = 0u; i < 14u; i++) {
len_block[i] = 0u;
}
len_block[14] = 0u;
len_block[15] = total_bits;
h = sha256_block_continue(&len_block, h);
}
let inner_hash = h;
// Outer hash: SHA256((K' ^ opad) || inner_hash)
var outer_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
}
h = sha256_block(&outer_block);
// Second block: inner_hash (32 bytes) + padding
var hash_block: array<u32, 16>;
for (var i = 0u; i < 8u; i++) {
hash_block[i] = inner_hash[i];
}
hash_block[8] = 0x80000000u;
for (var i = 9u; i < 14u; i++) {
hash_block[i] = 0u;
}
hash_block[14] = 0u;
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
h = sha256_block_continue(&hash_block, h);
// Return first 2 bytes (high 16 bits of first word)
return h[0] & 0xFFFF0000u;
}
// SHA256 block computation continuing from existing state
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
var h = h_in;
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Process a single candidate and record match if found
fn process_candidate(name_idx: u32) {
// Generate message for this room name
var msg: array<u32, 16>;
let valid = index_to_room_name(name_idx, params.name_length, &msg);
if (!valid) {
return;
}
// Compute SHA256("#roomname") - this gives us the key
let key_hash = sha256_block(&msg);
// Take first 16 bytes (4 words) as the key
var key: array<u32, 4>;
key[0] = key_hash[0];
key[1] = key_hash[1];
key[2] = key_hash[2];
key[3] = key_hash[3];
// Compute SHA256(key) to get channel hash
let channel_hash = sha256_key(key);
// Check if channel hash matches target
if (channel_hash != params.target_channel_hash) {
return;
}
// Channel hash matches - verify MAC if enabled
if (params.verify_mac == 1u) {
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
if (computed_mac != params.target_mac) {
return;
}
}
// Found a match - record the index
let match_idx = atomicAdd(&match_count, 1u);
if (match_idx < 1024u) { // Limit stored matches
match_indices[match_idx] = name_idx;
}
}
// Each thread processes 16 candidates to amortize thread overhead
const CANDIDATES_PER_THREAD: u32 = 16u;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
let idx = base_idx + i;
if (idx >= params.batch_size) {
return;
}
let name_idx = params.batch_offset + idx;
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let 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 a=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:a,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,a){return bo(a,o)}countNamesForLength(o){return xa(o)}async runBatch(o,a,s,c,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const u=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const f=this.matchCountReadBuffers[u],h=this.matchIndicesReadBuffers[u],m=l&&A?1:0;let p,v=0,_=0;if(m){const R=new Uint8Array(l.length/2);for(let j=0;j<R.length;j++)R[j]=parseInt(l.substr(j*2,2),16);v=R.length*8;const D=Math.ceil(R.length/4)*4,N=new Uint8Array(D);N.set(R),p=new Uint32Array(D/4);for(let j=0;j<p.length;j++)p[j]=N[j*4]<<24|N[j*4+1]<<16|N[j*4+2]<<8|N[j*4+3];const I=parseInt(A.substr(0,2),16),F=parseInt(A.substr(2,2),16);_=I<<24|F<<16}else p=new Uint32Array([0]);const b=Math.max(p.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<b)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:b,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=b,this.bindGroupDirty=!0);const S=new Uint32Array([o,s,a,c,_,p.length,v,m]);this.device.queue.writeBuffer(this.paramsBuffer,0,S),this.device.queue.writeBuffer(this.ciphertextBuffer,0,p),this.device.queue.writeBuffer(this.matchCountBuffer,0,sp.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 y=this.device.createCommandEncoder(),x=y.beginComputePass();x.setPipeline(this.pipeline),x.setBindGroup(0,this.bindGroup),x.dispatchWorkgroups(Math.ceil(c/(256*16))),x.end(),y.copyBufferToBuffer(this.matchCountBuffer,0,f,0,4),y.copyBufferToBuffer(this.matchIndicesBuffer,0,h,0,1024*4),this.device.queue.submit([y.finish()]),await f.mapAsync(GPUMapMode.READ);const w=new Uint32Array(f.getMappedRange())[0];f.unmap();const T=[];if(w>0){await h.mapAsync(GPUMapMode.READ);const R=new Uint32Array(h.getMappedRange());for(let D=0;D<Math.min(w,1024);D++)T.push(R[D]);h.unmap()}return T}destroy(){var o,a,s,c,l,A,u,f;(o=this.paramsBuffer)==null||o.destroy(),(a=this.matchCountBuffer)==null||a.destroy(),(s=this.matchIndicesBuffer)==null||s.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(A=this.matchCountReadBuffers[1])==null||A.destroy(),(u=this.matchIndicesReadBuffers[0])==null||u.destroy(),(f=this.matchIndicesReadBuffers[1])==null||f.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}};ap.ZERO_DATA=new Uint32Array([0]);var V4=ap;function U4(){return typeof navigator<"u"&&"gpu"in navigator}var W4=/^[a-z0-9-]+$/,Q4=/^[a-z0-9].*[a-z0-9]$|^[a-z0-9]$/,G4=/ Line truncated
`).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);this.wordlist=s.filter($h)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter($h)}abort(){this.abortFlag=!0}isGpuAvailable(){return U4()}async decodePacket(r){var a;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const c=(a=(await Zh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:a.decoded;return!(c!=null&&c.channelHash)||!(c!=null&&c.ciphertext)||!(c!=null&&c.cipherMac)?null:{channelHash:c.channelHash,ciphertext:c.ciphertext,cipherMac:c.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,a){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0;const s=(o==null?void 0:o.maxLength)??8,c=await this.decodePacket(r);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:l,ciphertext:A,cipherMac:u}=c,f=parseInt(l,16);if(!this.gpuInstance&&(this.gpuInstance=new V4,!await this.gpuInstance.init()))return{found:!1,error:"WebGPU not available"};const h=performance.now();let m=0,p=performance.now(),v=1,_=0;if(o!=null&&o.startFrom){const D=F4(o.startFrom);D&&(v=D.length,_=D.index+1,_>=xa(v)&&(v++,_=0))}let b=0;for(let D=v;D<=s;D++)b+=xa(D);b-=_;const S=(D,N,I)=>{if(!a)return;const j=(performance.now()-h)/1e3,L=j>0?Math.round(m/j):0,G=b-m,K=L>0?G/L:0;a({checked:m,total:b,percent:b>0?Math.min(100,m/b*100):0,rateKeysPerSec:L,etaSeconds:K,elapsedSeconds:j,currentLength:N,currentPosition:I,phase:D})},y=D=>{if(!L4(A,u,D))return{valid:!1};const N=Zh.ChannelCrypto.decryptGroupTextMessage(A,u,D);return!N.success||!N.data?{valid:!1}:this.useTimestampFilter&&!H4(N.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!z4(N.data.message)?{valid:!1}:{valid:!0,message:N.data.message}};if(v===1&&_===0){S("public-key",0,ru);const D=Jh(li);if(l===D){const N=y(li);if(N.valid)return{found:!0,roomName:ru,key:li,decryptedMessage:N.message}}}if(this.wordlist.length>0&&v===1&&_===0)for(let D=0;D<this.wordlist.length;D++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[D]};const N=this.wordlist[D],I=Xh("#"+N),F=Jh(I);if(parseInt(F,16)===f){const L=y(I);if(L.valid)return{found:!0,roomName:N,key:I,decryptedMessage:L.message}}const j=performance.now();j-p>=200&&(S("wordlist",N.length,N),p=j,await new Promise(L=>setTimeout(L,0)))}const x=32768,C=1e3;let w=x,T=!1;for(let D=v;D<=s;D++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(D,0)||void 0};const N=xa(D);let I=D===v?_:0;for(;I<N;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(D,I)||void 0};const F=Math.min(w,N-I),j=performance.now(),L=await this.gpuInstance.runBatch(f,D,I,F,A,u),G=performance.now()-j;if(m+=F,!T&&F>=x&&G>0){const ee=C/G,se=Math.round(F*ee),J=Math.pow(2,Math.round(Math.log2(Math.max(x,se))));w=Math.max(x,J),T=!0}for(const ee of L){const se=bo(D,ee);if(!se)continue;const J=Xh("#"+se),ne=y(J);if(ne.valid)return{found:!0,roomName:se,key:J,decryptedMessage:ne.message}}I+=F;const K=performance.now();if(K-p>=200){const ee=bo(D,Math.min(I,N-1))||"";S("bruteforce",D,ee),p=K,await new Promise(se=>setTimeout(se,0))}}}return{found:!1,resumeFrom:bo(s,xa(s)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null)}};/*! Bundled license information:
crypto-js/ripemd160.js:
(** @preserve
(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.
*)
crypto-js/mode-ctr-gladman.js:
(** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*)
@noble/ed25519/index.js:
(*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
*/var Uc,eA;function K4(){return eA||(eA=1,Uc={webm:"data:video/webm;base64,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 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(u=>(this.enabled=!0,u)).catch(u=>{throw this.enabled=!1,u})}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?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 Wc=c,Wc}var Z4=Y4();const X4=nu(Z4);function J4({packets:r,channels:o,onChannelCreate:a}){const[s,c]=B.useState(!1),[l,A]=B.useState(6),[u,f]=B.useState(!1),[h,m]=B.useState(null),[p,v]=B.useState(new Map),[_,b]=B.useState([]),[S,y]=B.useState(!1),[x,C]=B.useState(null),w=B.useRef(null),T=B.useRef(null),R=B.useRef(!1),D=B.useRef(!1),N=B.useRef(!1),I=B.useRef(new Map),F=B.useRef(!1),j=B.useRef(6);B.useEffect(()=>{const X=new q4;w.current=X,C(X.isGpuAvailable());const Z=new X4;return T.current=Z,X.loadWordlist("/words_alpha.txt").then(()=>y(!0)).catch(k=>console.error("Failed to load wordlist:",k)),()=>{X.destroy(),w.current=null,Z.disable(),T.current=null}},[]);const L=new Set(o.map(X=>X.key.toUpperCase())),G=r.filter(X=>X.payload_type==="GROUP_TEXT"&&!X.decrypted);B.useEffect(()=>{v(X=>{const Z=new Map(X);let k=!1;for(const O of G)Z.has(O.id)||(Z.set(O.id,{packet:O,attempts:0,lastAttemptLength:0,status:"pending"}),k=!0);return k?(I.current=Z,Z):X})},[G.length]),B.useEffect(()=>{I.current=p},[p]),B.useEffect(()=>{F.current=u},[u]),B.useEffect(()=>{j.current=l},[l]);const K=Array.from(p.values()).filter(X=>X.status==="pending").length,ee=Array.from(p.values()).filter(X=>X.status==="cracked").length,se=Array.from(p.values()).filter(X=>X.status==="failed").length,J=B.useCallback(async()=>{if(N.current||!w.current||!R.current)return;const X=I.current;let Z=null,k=null;for(const[V,re]of X.entries())if(re.status==="pending"){Z=re,k=V;break}if(!Z&&F.current){const V=Array.from(X.entries()).filter(([,re])=>re.status==="failed"&&re.lastAttemptLength<10);V.length>0&&(V.sort((re,ue)=>re[1].lastAttemptLength-ue[1].lastAttemptLength),[k,Z]=V[0])}if(!Z||k===null){R.current&&setTimeout(()=>J(),1e3);return}N.current=!0;const O=j.current,z=Z.lastAttemptLength>0?Z.lastAttemptLength+1:O;try{const V=await w.current.crack(Z.packet.data,{maxLength:z,useTimestampFilter:!0,useUtf8Filter:!0},re=>{m(re)});if(D.current){D.current=!1,N.current=!1,m(null);return}if(V.found&&V.roomName&&V.key){v(de=>{const oe=new Map(de),Be=oe.get(k);return Be&&oe.set(k,{...Be,status:"cracked",attempts:Be.attempts+1,lastAttemptLength:z}),oe});const re={roomName:V.roomName,key:V.key,packetId:k,message:V.decryptedMessage||"",crackedAt:Date.now()};b(de=>[...de,re]);const ue=V.key.toUpperCase();if(!L.has(ue))try{await a("#"+V.roomName,V.key)}catch(de){console.error("Failed to create channel:",de)}}else v(re=>{const ue=new Map(re),de=ue.get(k);return de&&ue.set(k,{...de,status:"failed",attempts:de.attempts+1,lastAttemptLength:z}),ue})}catch(V){console.error("Cracking error:",V),v(re=>{const ue=new Map(re),de=ue.get(k);return de&&ue.set(k,{...de,status:"failed",attempts:de.attempts+1,lastAttemptLength:z}),ue})}N.current=!1,m(null),R.current&&setTimeout(()=>J(),100)},[L,a]),ne=()=>{var X;if(!x){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}c(!0),R.current=!0,D.current=!1,(X=T.current)==null||X.enable(),J()},W=()=>{var X,Z;c(!1),R.current=!1,D.current=!0,(X=w.current)==null||X.abort(),(Z=T.current)==null||Z.disable()};return P.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[P.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[P.jsx("button",{onClick:s?W:ne,disabled:!S||x===!1,className:Ze("px-4 py-1.5 rounded text-sm font-medium",s?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90","disabled:opacity-50 disabled:cursor-not-allowed"),children:s?"Stop":"Start Cracking"}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),P.jsx("input",{type:"number",min:1,max:10,value:l,onChange:X=>A(Math.min(10,Math.max(1,parseInt(X.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),P.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[P.jsx("input",{type:"checkbox",checked:u,onChange:X=>f(X.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),P.jsxs("div",{className:"flex gap-4 text-sm",children:[P.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",P.jsx("span",{className:"text-foreground font-medium",children:K})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",P.jsx("span",{className:"text-green-500 font-medium",children:ee})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",P.jsx("span",{className:"text-destructive font-medium",children:se})]})]}),h&&P.jsxs("div",{className:"space-y-1",children:[P.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[P.jsxs("span",{children:[h.phase==="wordlist"?"Dictionary":h.phase==="bruteforce"?"Bruteforce":"Public Key",h.phase===" Line truncated
+542
View File
@@ -0,0 +1,542 @@
function o1(r,o){for(var a=0;a<o.length;a++){const s=o[a];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in r)){const l=Object.getOwnPropertyDescriptor(s,c);l&&Object.defineProperty(r,c,l.get?l:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&s(A)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function nu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},Le={};/**
* @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 eh;function a1(){if(eh)return Le;eh=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(C){return C===null||typeof C!="object"?null:(C=p&&C[p]||C["@@iterator"],typeof C=="function"?C:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function y(C,F,z){this.props=C,this.context=F,this.refs=S,this.updater=z||k}y.prototype.isReactComponent={},y.prototype.setState=function(C,F){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,F,"setState")},y.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function x(){}x.prototype=y.prototype;function _(C,F,z){this.props=C,this.context=F,this.refs=S,this.updater=z||k}var b=_.prototype=new x;b.constructor=_,w(b,y.prototype),b.isPureReactComponent=!0;var B=Array.isArray,T=Object.prototype.hasOwnProperty,N={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function I(C,F,z){var U,ne={},ue=null,de=null;if(F!=null)for(U in F.ref!==void 0&&(de=F.ref),F.key!==void 0&&(ue=""+F.key),F)T.call(F,U)&&!j.hasOwnProperty(U)&&(ne[U]=F[U]);var te=arguments.length-2;if(te===1)ne.children=z;else if(1<te){for(var Ee=Array(te),je=0;je<te;je++)Ee[je]=arguments[je+2];ne.children=Ee}if(C&&C.defaultProps)for(U in te=C.defaultProps,te)ne[U]===void 0&&(ne[U]=te[U]);return{$$typeof:r,type:C,key:ue,ref:de,props:ne,_owner:N.current}}function L(C,F){return{$$typeof:r,type:C.type,key:F,ref:C.ref,props:C.props,_owner:C._owner}}function D(C){return typeof C=="object"&&C!==null&&C.$$typeof===r}function O(C){var F={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(z){return F[z]})}var Q=/\/+/g;function G(C,F){return typeof C=="object"&&C!==null&&C.key!=null?O(""+C.key):F.toString(36)}function $(C,F,z,U,ne){var ue=typeof C;(ue==="undefined"||ue==="boolean")&&(C=null);var de=!1;if(C===null)de=!0;else switch(ue){case"string":case"number":de=!0;break;case"object":switch(C.$$typeof){case r:case o:de=!0}}if(de)return de=C,ne=ne(de),C=U===""?"."+G(de,0):U,B(ne)?(z="",C!=null&&(z=C.replace(Q,"$&/")+"/"),$(ne,F,z,"",function(je){return je})):ne!=null&&(D(ne)&&(ne=L(ne,z+(!ne.key||de&&de.key===ne.key?"":(""+ne.key).replace(Q,"$&/")+"/")+C)),F.push(ne)),1;if(de=0,U=U===""?".":U+":",B(C))for(var te=0;te<C.length;te++){ue=C[te];var Ee=U+G(ue,te);de+=$(ue,F,z,Ee,ne)}else if(Ee=v(C),typeof Ee=="function")for(C=Ee.call(C),te=0;!(ue=C.next()).done;)ue=ue.value,Ee=U+G(ue,te++),de+=$(ue,F,z,Ee,ne);else if(ue==="object")throw F=String(C),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return de}function oe(C,F,z){if(C==null)return C;var U=[],ne=0;return $(C,U,"","",function(ue){return F.call(z,ue,ne++)}),U}function J(C){if(C._status===-1){var F=C._result;F=F(),F.then(function(z){(C._status===0||C._status===-1)&&(C._status=1,C._result=z)},function(z){(C._status===0||C._status===-1)&&(C._status=2,C._result=z)}),C._status===-1&&(C._status=0,C._result=F)}if(C._status===1)return C._result.default;throw C._result}var re={current:null},W={transition:null},ie={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:W,ReactCurrentOwner:N};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Le.Children={map:oe,forEach:function(C,F,z){oe(C,function(){F.apply(this,arguments)},z)},count:function(C){var F=0;return oe(C,function(){F++}),F},toArray:function(C){return oe(C,function(F){return F})||[]},only:function(C){if(!D(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},Le.Component=y,Le.Fragment=a,Le.Profiler=c,Le.PureComponent=_,Le.StrictMode=s,Le.Suspense=f,Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ie,Le.act=Y,Le.cloneElement=function(C,F,z){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var U=w({},C.props),ne=C.key,ue=C.ref,de=C._owner;if(F!=null){if(F.ref!==void 0&&(ue=F.ref,de=N.current),F.key!==void 0&&(ne=""+F.key),C.type&&C.type.defaultProps)var te=C.type.defaultProps;for(Ee in F)T.call(F,Ee)&&!j.hasOwnProperty(Ee)&&(U[Ee]=F[Ee]===void 0&&te!==void 0?te[Ee]:F[Ee])}var Ee=arguments.length-2;if(Ee===1)U.children=z;else if(1<Ee){te=Array(Ee);for(var je=0;je<Ee;je++)te[je]=arguments[je+2];U.children=te}return{$$typeof:r,type:C.type,key:ne,ref:ue,props:U,_owner:de}},Le.createContexLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var rh;function s1(){if(rh)return da;rh=1;var r=ou(),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function A(u,f,h){var m,p={},v=null,k=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(k=f.ref);for(m in f)s.call(f,m)&&!l.hasOwnProperty(m)&&(p[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:o,type:u,key:v,ref:k,props:p,_owner:c.current}}return da.Fragment=a,da.jsx=A,da.jsxs=A,da}var nh;function i1(){return nh||(nh=1,ic.exports=s1()),ic.exports}var P=i1(),R=ou();const he=nu(R),au=o1({__proto__:null,default:he},[R]);var Is={},cc={exports:{}},nr={},uc={exports:{}},dc={};/**
* @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 oh;function l1(){return oh||(oh=1,(function(r){function o(W,ie){var Y=W.length;W.push(ie);e:for(;0<Y;){var C=Y-1>>>1,F=W[C];if(0<c(F,ie))W[C]=ie,W[Y]=F,Y=C;else break e}}function a(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var ie=W[0],Y=W.pop();if(Y!==ie){W[0]=Y;e:for(var C=0,F=W.length,z=F>>>1;C<z;){var U=2*(C+1)-1,ne=W[U],ue=U+1,de=W[ue];if(0>c(ne,Y))ue<F&&0>c(de,ne)?(W[C]=de,W[ue]=Y,C=ue):(W[C]=ne,W[U]=Y,C=U);else if(ue<F&&0>c(de,Y))W[C]=de,W[ue]=Y,C=ue;else break e}}return ie}function c(W,ie){var Y=W.sortIndex-ie.sortIndex;return Y!==0?Y:W.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,u=A.now();r.unstable_now=function(){return A.now()-u}}var f=[],h=[],m=1,p=null,v=3,k=!1,w=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(W){for(var ie=a(h);ie!==null;){if(ie.callback===null)s(h);else if(ie.startTime<=W)s(h),ie.sortIndex=ie.expirationTime,o(f,ie);else break;ie=a(h)}}function B(W){if(S=!1,b(W),!w)if(a(f)!==null)w=!0,J(T);else{var ie=a(h);ie!==null&&re(B,ie.startTime-W)}}function T(W,ie){w=!1,S&&(S=!1,x(I),I=-1),k=!0;var Y=v;try{for(b(ie),p=a(f);p!==null&&(!(p.expirationTime>ie)||W&&!O());){var C=p.callback;if(typeof C=="function"){p.callback=null,v=p.priorityLevel;var F=C(p.expirationTime<=ie);ie=r.unstable_now(),typeof F=="function"?p.callback=F:p===a(f)&&s(f),b(ie)}else s(f);p=a(f)}if(p!==null)var z=!0;else{var U=a(h);U!==null&&re(B,U.startTime-ie),z=!1}return z}finally{p=null,v=Y,k=!1}}var N=!1,j=null,I=-1,L=5,D=-1;function O(){return!(r.unstable_now()-D<L)}function Q(){if(j!==null){var W=r.unstable_now();D=W;var ie=!0;try{ie=j(!0,W)}finally{ie?G():(N=!1,j=null)}}else N=!1}var G;if(typeof _=="function")G=function(){_(Q)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,oe=$.port2;$.port1.onmessage=Q,G=function(){oe.postMessage(null)}}else G=function(){y(Q,0)};function J(W){j=W,N||(N=!0,G())}function re(W,ie){I=y(function(){W(r.unstable_now())},ie)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(W){W.callback=null},r.unstable_continueExecution=function(){w||k||(w=!0,J(T))},r.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<W?Math.floor(1e3/W):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return a(f)},r.unstable_next=function(W){switch(v){case 1:case 2:case 3:var ie=3;break;default:ie=v}var Y=v;v=ie;try{return W()}finally{v=Y}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(W,ie){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Y=v;v=W;try{return ie()}finally{v=Y}},r.unstable_scheduleCallback=function(W,ie,Y){var C=r.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?C+Y:C):Y=C,W){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=Y+F,W={id:m++,callback:ie,priorityLevel:W,startTime:Y,expirationTime:F,sortIndex:-1},Y>C?(W.sortIndex=Y,o(h,W),a(f)===null&&W===a(h)&&(S?(x(I),I=-1):S=!0,re(B,Y-C))):(W.sortIndex=F,o(f,W),w||k||(w=!0,J(T))),W},r.unstable_shouldYield=O,r.unstable_wrapCallback=function(W){var ie=v;return function(){var Y=v;v=ie;try{return W.apply(this,arguments)}finally{v=Y}}}})(dc)),dc}var ah;function c1(){return ah||(ah=1,uc.exports=l1()),uc.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 sh;function u1(){if(sh)return nr;sh=1;var r=ou(),o=c1();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,c={};function l(e,t){A(e,t),A(e+"Capture",t)}function A(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},p={};function v(e){return f.call(p,e)?!0:f.call(m,e)?!1:h.test(e)?p[e]=!0:(m[e]=!0,!1)}function k(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function w(e,t,n,i){if(t===null||typeof t>"u"||k(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,n,i,d,g,E){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=g,this.removeEmptyString=E}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];y[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new S(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){y[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function _(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(x,_);y[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(x,_);y[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(x,_);y[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,i){var d=y.hasOwnProperty(t)?y[t]:null;(d!==null?d.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!= Line truncated
`+C+e}var z=!1;function U(e,t){if(!e||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(Z){var i=Z}Reflect.construct(e,[],t)}else{try{t.call()}catch(Z){i=Z}e.call(t.prototype)}else{try{throw Error()}catch(Z){i=Z}e()}}catch(Z){if(Z&&i&&typeof Z.stack=="string"){for(var d=Z.stack.split(`
`),g=i.stack.split(`
`),E=d.length-1,M=g.length-1;1<=E&&0<=M&&d[E]!==g[M];)M--;for(;1<=E&&0<=M;E--,M--)if(d[E]!==g[M]){if(E!==1||M!==1)do if(E--,M--,0>M||d[E]!==g[M]){var H=`
`+d[E].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=E&&0<=M);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function ne(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1),e;case 11:return e=U(e.type.render,!1),e;case 1:return e=U(e.type,!0),e;default:return""}}function ue(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 j:return"Fragment";case N:return"Portal";case L:return"Profiler";case I:return"StrictMode";case G:return"Suspense";case $:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:return(e.displayName||"Context")+".Consumer";case D:return(e._context.displayName||"Context")+".Provider";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(t);case 8:return t===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function je(e){var t=Ee(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,g=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(E){i=""+E,g.call(this,E)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function at(e){e._valueTracker||(e._valueTracker=je(e))}function st(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Ee(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function lt(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,t){var n=t.checked;return Y({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qt(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=te(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ut(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Et(e,t){Ut(e,t);var n=te(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?dt(e,t.type,n):t.hasOwnProperty("defaultValue")&&dt(e,t.type,te(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function dt(e,t,n){(t!=="number"||lt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dt=Array.isArray;function tt(e,t,n,i){if(e=e.options,t){t={};for(var d=0;d<n.length;d++)t["$"+n[d]]=!0;for(n=0;n<e.length;n++)d=t.hasOwnProperty("$"+e[n].value),e[n].selected!==d&&(e[n].selected=d),d&&i&&(e[n].defaultSelected=!0)}else{for(n=""+te(n),t=null,d=0;d<e.length;d++){if(e[d].value===n){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Ve(e,t){if(t.dangerouslySetInnerHTML!= Line truncated
`).replace(gm,"")}function Ka(e,t,n){if(t=vd(t),vd(e)!==t&&n)throw Error(a(425))}function Ya(){}var Ji=null,$i=null;function el(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tl=typeof setTimeout=="function"?setTimeout:void 0,vm=typeof clearTimeout=="function"?clearTimeout:void 0,yd=typeof Promise=="function"?Promise:void 0,ym=typeof queueMicrotask=="function"?queueMicrotask:typeof yd<"u"?function(e){return yd.resolve(null).then(e).catch(xm)}:tl;function xm(e){setTimeout(function(){throw e})}function rl(e,t){var n=t,i=0;do{var d=n.nextSibling;if(e.removeChild(n),d&&d.nodeType===8)if(n=d.data,n==="/$"){if(i===0){e.removeChild(d),Fo(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=d}while(n);Fo(t)}function an(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jn=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Jn,Yo="__reactProps$"+Jn,Ur="__reactContainer$"+Jn,nl="__reactEvents$"+Jn,wm="__reactListeners$"+Jn,bm="__reactHandles$"+Jn;function Sn(e){var t=e[Dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xd(e);e!==null;){if(n=e[Dr])return n;e=xd(e)}return t}e=n,n=e.parentNode}return null}function Zo(e){return e=e[Dr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $n(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Za(e){return e[Yo]||null}var ol=[],eo=-1;function sn(e){return{current:e}}function ot(e){0>eo||(e.current=ol[eo],ol[eo]=null,eo--)}function Je(e,t){eo++,ol[eo]=e.current,e.current=t}var ln={},Lt=sn(ln),Jt=sn(!1),En=ln;function to(e,t){var n=e.type.contextTypes;if(!n)return ln;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var d={},g;for(g in n)d[g]=t[g];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function $t(e){return e=e.childContextTypes,e!=null}function Xa(){ot(Jt),ot(Lt)}function wd(e,t,n){if(Lt.current!==ln)throw Error(a(168));Je(Lt,t),Je(Jt,n)}function bd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in t))throw Error(a(108,de(e)||"Unknown",d));return Y({},n,i)}function Ja(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,En=Lt.current,Je(Lt,e),Je(Jt,Jt.current),!0}function _d(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=bd(e,t,En),i.__reactInternalMemoizedMergedChildContext=e,ot(Jt),ot(Lt),Je(Lt,e)):ot(Jt),Je(Jt,n)}var Wr=null,$a=!1,al=!1;function kd(e){Wr===null?Wr=[e]:Wr.push(e)}function _m(e){$a=!0,kd(e)}function cn(){if(!al&&Wr!==null){al=!0;var e=0,t=Ye;try{var n=Wr;for(Ye=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}Wr=null,$a=!1}catch(d){throw Wr!==null&&(Wr=Wr.slice(e+1)),Su(Ei,cn),d}finally{Ye=t,al=!1}}return null}var ro=[],no=0,es=null,ts=0,fr=[],hr=0,Tn=null,Qr=1,Gr="";function Rn(e,t){ro[no++]=ts,ro[no++]=es,es=e,ts=t}function Cd(e,t,n){fr[hr++]=Qr,fr[hr++]=Gr,fr[hr++]=Tn,Tn=e;var i=Qr;e=Gr;var d=32-br(i)-1;i&=~(1<<d),n+=1;var g=32-br(t)+d;if(30<g){var E=d-d%5;g=(i&(1<<E)-1).toString(32),i>>=E,d-=E,Qr=1<<32-br(t)+d|n<<d|i,Gr=g+e}else Qr=1<<g|n<<d|i,Gr=e}function sl(e){e.return!==null&&(Rn(e,1),Cd(e,1,0))}function il(e){for(;e===es;)es=ro[--no],ro[no]=null,ts=ro[--no],ro[no]=null;for(;e===Tn;)Tn=fr[--hr],fr[hr]=null,Gr=fr[--hr],fr[hr]=null,Qr=fr[--hr],fr[hr]=null}var ir=null,lr=null,it=!1,kr=null;function Sd(e,t){var n=gr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ed(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ir=e,lr=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ir=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Tn!==null?{id:Qr,overflow:Gr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ir=e,lr=null,!0):!1;default:return!1}}function ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cl(e){if(it){var t=lr;if(t){var n=t;if(!Ed(e,t)){if(ll(e))throw Error(a(418));t=an(n.nextSibling);var i=ir;t&&Ed(e,t)?Sd(i,n):(e.flags=e.flags&-4097|2,it=!1,ir=e)}}else{if(ll(e))throw Error(a(418));e.flags=e.flags&-4097|2,it=!1,ir=e}}}function Td(e){for(e=e. Line truncated
Error generating stack: `+g.message+`
`+g.stack}return{value:e,source:t,stack:d,digest:null}}function Pl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Nl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Nm=typeof WeakMap=="function"?WeakMap:Map;function cf(e,t,n){n=Kr(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){ws||(ws=!0,ql=i),Nl(e,t)},n}function uf(e,t,n){n=Kr(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var d=t.value;n.payload=function(){return i(d)},n.callback=function(){Nl(e,t)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(n.callback=function(){Nl(e,t),typeof i!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var E=t.stack;this.componentDidCatch(t.value,{componentStack:E!==null?E:""})}),n}function df(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Nm;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(n)||(d.add(n),e=Gm.bind(null,e,t,n),t.then(e,e))}function ff(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hf(e,t,n,i,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Kr(-1,1),t.tag=2,dn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Dm=B.ReactCurrentOwner,er=!1;function Qt(e,t,n,i){t.child=e===null?Nd(t,null,n,i):ao(t,e.child,n,i)}function Af(e,t,n,i,d){n=n.render;var g=t.ref;return io(t,d),i=_l(e,t,n,i,g,d),n=kl(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(it&&n&&sl(t),t.flags|=1,Qt(e,t,i,d),t.child)}function pf(e,t,n,i,d){if(e===null){var g=n.type;return typeof g=="function"&&!ec(g)&&g.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=g,mf(e,t,g,i,d)):(e=Es(n.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,(e.lanes&d)===0){var E=g.memoizedProps;if(n=n.compare,n=n!==null?n:Wo,n(E,i)&&e.ref===t.ref)return Yr(e,t,d)}return t.flags|=1,e=gn(g,i),e.ref=t.ref,e.return=t,t.child=e}function mf(e,t,n,i,d){if(e!==null){var g=e.memoizedProps;if(Wo(g,i)&&e.ref===t.ref)if(er=!1,t.pendingProps=i=g,(e.lanes&d)!==0)(e.flags&131072)!==0&&(er=!0);else return t.lanes=e.lanes,Yr(e,t,d)}return Dl(e,t,n,i,d)}function gf(e,t,n){var i=t.pendingProps,d=i.children,g=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(fo,cr),cr|=n;else{if((n&1073741824)===0)return e=g!==null?g.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Je(fo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=g!==null?g.baseLanes:n,Je(fo,cr),cr|=i}else g!==null?(i=g.baseLanes|n,t.memoizedState=null):i=n,Je(fo,cr),cr|=i;return Qt(e,t,d,n),t.child}function vf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dl(e,t,n,i,d){var g=$t(n)?En:Lt.current;return g=to(t,g),io(t,d),n=_l(e,t,n,i,g,d),i=kl(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(it&&i&&sl(t),t.flags|=1,Qt(e,t,n,d),t.child)}function yf(e,t,n,i,d){if($t(n)){var g=!0;Ja(t)}else g=!1;if(io(t,d),t.stateNode===null)ms(e,t),sf(t,n,i),Bl(t,n,i,d),i=!0;else if(e===null){var E=t.stateNode,M=t.memoizedProps;E.props=M;var H=E.context,Z=n.contextType;typeof Z=="object"&&Z!==null?Z=Ar(Z):(Z=$t(n)?En:Lt.current,Z=to(t,Z));var se=n.getDerivedStateFromProps,ce=typeof se=="function"||typeof E.getSnapshotBeforeUpdate=="function";ce||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==i||H!==Z)&&lf(t,E,i,Z),un=!1;var ae=t.memoizedState;E.state=ae,is(t,i,E,d),H=t.memoizedState,M!==i||ae!==H||Jt.current||un?(typeof se=="function"&&(Rl(t,n,se,i),H=t.memoizedState),(M=un||af(t,n,M,i,ae,H,Z))?(ce||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(t.flags|=4194308)):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),E.props=i,E.state=H,E.context=Z,i=M):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{E=t.stateNode,jd(e,t),M=t.memoizedProps,Z=t.type===t.elementType?M:Cr(t.type,M),E.props=Z,ce=t.pendingProps,ae=E.context,H=n.contextType,typeof H=="object"&&H!==null?H=Ar(H):(H=$t(n)?En:Lt.current,H=to(t,H));var pe=n.getDerivedStateFromProps;(se=typeof pe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==ce||ae!==H)&&lf(t,E,i,H),un=!1,ae=t.memoizedState,E 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 p1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m1=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),ch=r=>{const o=m1(r);return o.charAt(0).toUpperCase()+o.slice(1)},oA=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),g1=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var v1={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 y1=R.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:c="",children:l,iconNode:A,...u},f)=>R.createElement("svg",{ref:f,...v1,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:oA("lucide",c),...!l&&!g1(u)&&{"aria-hidden":"true"},...u},[...A.map(([h,m])=>R.createElement(h,m)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const su=(r,o)=>{const a=R.forwardRef(({className:s,...c},l)=>R.createElement(y1,{ref:l,iconNode:o,className:oA(`lucide-${p1(ch(r))}`,`lucide-${r}`,s),...c}));return a.displayName=ch(r),a};/**
* @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 x1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],w1=su("check",x1);/**
* @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 b1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],_1=su("menu",b1);/**
* @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 k1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],aA=su("x",k1);var sA=nA();const iA=nu(sA);function C1(r){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",o.appendChild(a),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(document.createTextNode(r))}const S1=r=>{switch(r){case"success":return R1;case"info":return P1;case"warning":return B1;case"error":return N1;default:return null}},E1=Array(12).fill(0),T1=({visible:r,className:o})=>he.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},he.createElement("div",{className:"sonner-spinner"},E1.map((a,s)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),R1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),B1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),P1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),D1=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),j1=()=>{const[r,o]=he.useState(document.hidden);return he.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Qc=1;class I1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const a=this.subscribers.indexOf(o);this.subscribers.splice(a,1)}),this.publish=o=>{this.subscribers.forEach(a=>a(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var a;const{message:s,...c}=o,l=typeof(o==null?void 0:o.id)=="number"||((a=o.id)==null?void 0:a.length)>0?o.id:Qc++,A=this.toasts.find(f=>f.id===l),u=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),A?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...o,id:l,title:s}),{...f,...o,id:l,dismissible:u,title:s}):f):this.addToast({title:s,...c,dismissible:u,id:l}),l},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:o,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),o),this.message=(o,a)=>this.create({...a,message:o}),this.error=(o,a)=>this.create({...a,message:o,type:"error"}),this.success=(o,a)=>this.create({...a,type:"success",message:o}),this.info=(o,a)=>this.create({...a,type:"info",message:o}),this.warning=(o,a)=>this.create({...a,type:"warning",message:o}),this.loading=(o,a)=>this.create({...a,type:"loading",message:o}),this.promise=(o,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:o,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let l=s!==void 0,A;const u=c.then(async h=>{if(A=["resolve",h],he.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(O1(h)&&!h.ok){l=!1;const p=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,w=typeof p=="object"&&!he.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...w})}else if(h instanceof Error){l=!1;const p=typeof a.error=="function"?await a.error(h):a.error,Line truncated
`).map((J,re,W)=>P.jsxs("span",{children:[J,re<W.length-1&&P.jsx("br",{})]},re)),!O&&P.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:bh(x.sender_timestamp||x.received_at)}),x.outgoing&&(x.acked?" ✓":" ?")]})]})]},x.id)})]})}const uv=R.forwardRef(function({onSend:o,disabled:a,placeholder:s},c){const[l,A]=R.useState(""),[u,f]=R.useState(!1),h=R.useRef(null);R.useImperativeHandle(c,()=>({appendText:v=>{var k;A(w=>w+v),(k=h.current)==null||k.focus()}}));const m=R.useCallback(async v=>{v.preventDefault();const k=l.trim();if(!(!k||u||a)){f(!0);try{await o(k),A("")}catch(w){console.error("Failed to send message:",w)}finally{f(!1)}}},[l,u,a,o]),p=R.useCallback(v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),m(v))},[m]);return P.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:m,children:[P.jsx(wt,{ref:h,type:"text",value:l,onChange:v=>A(v.target.value),onKeyDown:p,placeholder:s||"Type a message...",disabled:a||u,className:"flex-1"}),P.jsx(Vr,{type:"submit",disabled:a||u||!l.trim(),children:u?"Sending...":"Send"})]})});function St(r,o,{checkForDefaultPrevented:a=!0}={}){return function(c){if(r==null||r(c),a===!1||!c.defaultPrevented)return o==null?void 0:o(c)}}function dv(r,o){const a=R.createContext(o),s=l=>{const{children:A,...u}=l,f=R.useMemo(()=>u,Object.values(u));return P.jsx(a.Provider,{value:f,children:A})};s.displayName=r+"Provider";function c(l){const A=R.useContext(a);if(A)return A;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[s,c]}function Sa(r,o=[]){let a=[];function s(l,A){const u=R.createContext(A),f=a.length;a=[...a,A];const h=p=>{var x;const{scope:v,children:k,...w}=p,S=((x=v==null?void 0:v[r])==null?void 0:x[f])||u,y=R.useMemo(()=>w,Object.values(w));return P.jsx(S.Provider,{value:y,children:k})};h.displayName=l+"Provider";function m(p,v){var S;const k=((S=v==null?void 0:v[r])==null?void 0:S[f])||u,w=R.useContext(k);if(w)return w;if(A!==void 0)return A;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[h,m]}const c=()=>{const l=a.map(A=>R.createContext(A));return function(u){const f=(u==null?void 0:u[r])||l;return R.useMemo(()=>({[`__scope${r}`]:{...u,[r]:f}}),[u,f])}};return c.scopeName=r,[s,fv(c,...o)]}function fv(...r){const o=r[0];if(r.length===1)return o;const a=()=>{const s=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(l){const A=s.reduce((u,{useScope:f,scopeName:h})=>{const p=f(l)[`__scope${h}`];return{...u,...p}},{});return R.useMemo(()=>({[`__scope${o.scopeName}`]:A}),[A])}};return a.scopeName=o.scopeName,a}var So=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},hv=au[" useId ".trim().toString()]||(()=>{}),Av=0;function ba(r){const[o,a]=R.useState(hv());return So(()=>{a(s=>s??String(Av++))},[r]),o?`radix-${o}`:""}var pv=au[" useInsertionEffect ".trim().toString()]||So;function Ai({prop:r,defaultProp:o,onChange:a=()=>{},caller:s}){const[c,l,A]=mv({defaultProp:o,onChange:a}),u=r!==void 0,f=u?r:c;{const m=R.useRef(r!==void 0);R.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,s])}const h=R.useCallback(m=>{var p;if(u){const v=gv(m)?m(r):m;v!==r&&((p=A.current)==null||p.call(A,v))}else l(m)},[u,r,l,A]);return[f,h]}function mv({defaultProp:r,onChange:o}){const[a,s]=R.useState(r),c=R.useRef(a),l=R.useRef(o);return pv(()=>{l.current=o},[o]),R.useEffect(()=>{var A;c.current!==a&&((A=l.current)==null||A.call(l,a),c.current=a)},[a,c]),[a,s,l]}function gv(r){return typeof r=="function"}function vv(r){const o=yv(r),a=R.forwardRef((s,c)=>{const{children:l,...A}=s,u=R.Children.toArray(l),f=u.find(wv);if(f){const h=f.props.children,m=u.map(p=>p===f?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function yv(r){const o=R.forwardRef((a,s)=>{const{children:c,...l}=a;if(R.isValidElement(c)){const A=_v(c),u=bv(l,c.props);return c.type!==R.Fragment&&(u.ref=s?Ca(s,A):A),R.cloneElement(c,u)}return R.Children.count(c)>1?R.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var xv=Symbol("radix.slottable");function wv(r){return R.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===xv}function bv(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function _v(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.getLine truncated
.`.concat(qv,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(u,"px ").concat(s,`;
}
body[`).concat(_o,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(s,";"),a==="margin"&&`
padding-left: `.concat(c,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(A,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(s,`;
`),a==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(oi,` {
right: `).concat(u,"px ").concat(s,`;
}
.`).concat(ai,` {
margin-right: `).concat(u,"px ").concat(s,`;
}
.`).concat(oi," .").concat(oi,` {
right: 0 `).concat(s,`;
}
.`).concat(ai," .").concat(ai,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(_o,`] {
`).concat(Kv,": ").concat(u,`px;
}
`)},Ph=function(){var r=parseInt(document.body.getAttribute(_o)||"0",10);return isFinite(r)?r:0},h2=function(){R.useEffect(function(){return document.body.setAttribute(_o,(Ph()+1).toString()),function(){var r=Ph()-1;r<=0?document.body.removeAttribute(_o):document.body.setAttribute(_o,r.toString())}},[])},A2=function(r){var o=r.noRelative,a=r.noImportant,s=r.gapMode,c=s===void 0?"margin":s;h2();var l=R.useMemo(function(){return u2(c)},[c]);return R.createElement(d2,{styles:f2(l,!o,c,a?"":"!important")})},Xc=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Xc=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Xc=!1}var mo=Xc?{passive:!1}:!1,p2=function(r){return r.tagName==="TEXTAREA"},MA=function(r,o){if(!(r instanceof Element))return!1;var a=window.getComputedStyle(r);return a[o]!=="hidden"&&!(a.overflowY===a.overflowX&&!p2(r)&&a[o]==="visible")},m2=function(r){return MA(r,"overflowY")},g2=function(r){return MA(r,"overflowX")},Nh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=OA(r,s);if(c){var l=FA(r,s),A=l[1],u=l[2];if(A>u)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},v2=function(r){var o=r.scrollTop,a=r.scrollHeight,s=r.clientHeight;return[o,a,s]},y2=function(r){var o=r.scrollLeft,a=r.scrollWidth,s=r.clientWidth;return[o,a,s]},OA=function(r,o){return r==="v"?m2(o):g2(o)},FA=function(r,o){return r==="v"?v2(o):y2(o)},x2=function(r,o){return r==="h"&&o==="rtl"?-1:1},w2=function(r,o,a,s,c){var l=x2(r,window.getComputedStyle(o).direction),A=l*s,u=a.target,f=o.contains(u),h=!1,m=A>0,p=0,v=0;do{if(!u)break;var k=FA(r,u),w=k[0],S=k[1],y=k[2],x=S-y-l*w;(w||x)&&OA(r,u)&&(p+=x,v+=w);var _=u.parentNode;u=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&u!==document.body||f&&(o.contains(u)||o===u));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},zs=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Dh=function(r){return[r.deltaX,r.deltaY]},jh=function(r){return r&&"current"in r?r.current:r},b2=function(r,o){return r[0]===o[0]&&r[1]===o[1]},_2=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},k2=0,go=[];function C2(r){var o=R.useRef([]),a=R.useRef([0,0]),s=R.useRef(),c=R.useState(k2++)[0],l=R.useState(IA)[0],A=R.useRef(r);R.useEffect(function(){A.current=r},[r]),R.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Gv([r.lockRef.current],(r.shards||[]).map(jh),!0).filter(Boolean);return S.forEach(function(y){return y.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=R.useCallback(function(S,y){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!A.current.allowPinchZoom;var x=zs(S),_=a.current,b="deltaX"in S?S.deltaX:_[0]-x[0],B="deltaY"in S?S.deltaY:_[1]-x[1],T,N=S.target,j=Math.abs(b)>Math.abs(B)?"h":"v";if("touches"in S&&j==="h"&&N.type==="range")return!1;var I=window.getSelection(),L=I&&I.anchorNode,D=L?L===N||L.contains(N):!1;if(D)return!1;var O=Nh(j,N);if(!O)return!0;if(O?T=j:(T=j==="v"?"h":"v",O=Nh(j,N)),!O)return!1;if(!s.current&&"changedTouches"in S&&(b||B)&&(s.current=T),!T)return!0;var Q=s.current||T;return w2(Q,y,S,Q==="h"?b:B)},[]),f=R.useCallback(function(S){var y=S;if(!(!go.length||go[go.length-1]!==l)){var x="deltaY"in y?Dh(y):zs(y),_=o.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&b2(T.delta,x)})[0];if(_&&_.should){y.cancelable&&y.preventDefault();return}if(!_){var b=(A.current.shards||[]).map(jh).filter(Boolean).filter(function(T){return T.contains(y.target)}),B=b.length>0?u(y,b[0]):!A.current.noIsolation;B&&y.cancelable&&y.preventDefault()}}},[]),h=R.useCallback(function(S,y,x,_){var b={name:S,delta:y,target:x,should:_,shadowParent:S2(x)};o.current.push(b),setTimeout(function(){o.current=o.current.filter(function(B){return B!==b})},1)},[]),m=R.useCallback(function(S){a.current=zs(S),s.current=void 0},[]),p=R.useCallback(function(S){h(S.type,Dh(S),S.target,u(S,r.lockRef.current))},[]),v=R.useCallback(function(S){h(S.type,zs(S),S.target,u(S,r.lockRef.current))},[]);R.useEffect(function(){return go.push(l),r.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,mo),document.addEventListener("touchmove",f,mo),document.addEventListener("touchstart",m,mo),function(){go=go.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,mo),document.removeEventListener("touchmove",f,mo),document.removeEventListener("touchstart",m,mo)}},[]);var k=r.removeScrollBar,w=r.inert;return R.createElement(R.Fragment,null,w?R.createElement(l,{styles:_2(c)}):null,k?R.createElement(A2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function S2(r){for(var o=null;r!==null;)r instanceof ShadowRoot&&(o=r.host,r=r.host),r=r.parentNode;return o}const E2=t2(jA,C2);var LA=R.forwardRef(function(r,o){return R.createElement(pi,zr({},r,{ref:o,sideCar:E2}))});LA.classNames=pi.classNames;var T2=function(r){if(typeof document>"u")return null;var o=Array.isArray(r)?r[0]:r;return o.ownerDocument.body},vo=new WeakMap,Vs=new WeakMap,Us={},wc=0,HA=function(r){return r&&(r.host||HA(r.parentNode))},R2=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=HA(a);return s&&r.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",r,". Doing nothing"),null)}).filter(function(a){return!!a})},B2=function(r,o,a,s){var c=R2(o,Array.isArray(r)?r:[r]);Us[a]||(Us[a]=new WeakMap);var l=Us[a],A=[],u=new Set,f=new Set(c),h=function(p){!p||u.has(p)||(u.add(p),h(p.parentNode))};c.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))m(v);else try{var k=v.getAttribute(s),w=k!==null&&k!=="false",S=(vo.get(v)||0)+1,y=(l.get(v)||0)+1;vo.set(v,S),l.set(v,y),A.push(v),S===1&&w&&Vs.set(v,!0),y===1&&v.setAttribute(a,"true"),w||v.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return m(o),u.clear(),wc++,function(){A.forEach(function(p){var v=vo.get(p)-1,k=l.get(p)-1;vo.set(p,v),l.set(p,k),v||(Vs.has(p)||p.removeAttribute(s),Vs.delete(p)),k||p.removeAttribute(a)}),wc--,wc||(vo=new WeakMap,vo=new WeakMap,Vs=new WeakMap,Us={})}},P2=function(r,o,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(r)?r:[r]),c=T2(r);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),B2(s,c,a,"aria-hidden")):function(){return null}};function N2(r){const o=D2(r),a=R.forwardRef((s,c)=>{const{children:l,...A}=s,u=R.Children.toArray(l),f=u.find(I2);if(f){const h=f.props.children,m=u.map(p=>p===f?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function D2(r){const o=R.forwardRef((a,s)=>{const{children:c Line truncated
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return R.useEffect(()=>{r&&(document.getElementById(r)||console.error(a))},[a,r]),null},G2="DialogDescriptionWarning",q2=({contentRef:r,descriptionId:o})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t0(G2).contentName}}.`;return R.useEffect(()=>{var l;const c=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(s))},[s,r,o]),null},r0=VA,n0=QA,gi=GA,vi=qA,yi=YA,xi=XA,o0=$A;const a0=r0,K2=n0,s0=R.forwardRef(({className:r,...o},a)=>P.jsx(gi,{ref:a,className:Ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...o}));s0.displayName=gi.displayName;const fu=R.forwardRef(({className:r,children:o,...a},s)=>P.jsxs(K2,{children:[P.jsx(s0,{}),P.jsxs(vi,{ref:s,className:Ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...a,children:[o,P.jsxs(o0,{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:[P.jsx(aA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fu.displayName=vi.displayName;const hu=({className:r,...o})=>P.jsx("div",{className:Ge("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});hu.displayName="DialogHeader";const Au=({className:r,...o})=>P.jsx("div",{className:Ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});Au.displayName="DialogFooter";const pu=R.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ge("text-lg font-semibold leading-none tracking-tight",r),...o}));pu.displayName=yi.displayName;const Y2=R.forwardRef(({className:r,...o},a)=>P.jsx(xi,{ref:a,className:Ge("text-sm text-muted-foreground",r),...o}));Y2.displayName=xi.displayName;function Ih(r){const o=Z2(r),a=R.forwardRef((s,c)=>{const{children:l,...A}=s,u=R.Children.toArray(l),f=u.find(J2);if(f){const h=f.props.children,m=u.map(p=>p===f?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return P.jsx(o,{...A,ref:c,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return P.jsx(o,{...A,ref:c,children:l})});return a.displayName=`${r}.Slot`,a}function Z2(r){const o=R.forwardRef((a,s)=>{const{children:c,...l}=a;if(R.isValidElement(c)){const A=ey(c),u=$2(l,c.props);return c.type!==R.Fragment&&(u.ref=s?Ca(s,A):A),R.cloneElement(c,u)}return R.Children.count(c)>1?R.Children.only(null):null});return o.displayName=`${r}.SlotClone`,o}var X2=Symbol("radix.slottable");function J2(r){return R.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===X2}function $2(r,o){const a={...o};for(const s in o){const c=r[s],l=o[s];/^on[A-Z]/.test(s)?c&&l?a[s]=(...u)=>{const f=l(...u);return c(...u),f}:c&&(a[s]=c):s==="style"?a[s]={...c,...l}:s==="className"&&(a[s]=[c,l].filter(Boolean).join(" "))}return{...r,...a}}function ey(r){var s,c;let o=(s=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:s.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?r.ref:(o=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?r.props.ref:r.props.ref||r.ref)}function ty(r){const o=r+"CollectionProvider",[a,s]=Sa(o),[c,l]=a(o,{collectionRef:{current:null},itemMap:new Map}),A=S=>{const{scope:y,children:x}=S,_=he.useRef(null),b=he.useRef(new Map).current;return P.jsx(c,{scope:y,itemMap:b,collectionRef:_,children:x})};A.displayName=o;const u=r+"CollectionSlot",f=Ih(u),h=he.forwardRef((S,y)=>{const{scope:x,children:_}=S,b=l(u,x),B=vr(y,b.collectionRef);return P.jsx(f,{ref:B,children:_})});h.displayName=u;const m=r+"CollectionItemSlot",p="data-radix-collection-item",v=Ih(m),k=he.forwardRef((S,y)=>{const{scope:x,children:_,...b}=S,B=he.useRef(null),T=vr(y,B),N=l(m,x);return he.useEffect(()=>(N.itemMap.set(B,{ref:B,...b}),()=>void N.itemMap.delete(B))),P.jsx(v,{[p]:"",ref:T,children:_})});k.displayName=m;function w(S){const y=l(r+"CollectionConsumer",S);return he.useCallback(()=>{const _=y.collectionRef.current;if(!_)return[];const b=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((N,j)=>b.indexOf(N.ref.current)-b.indexOf(j.ref.current))},[y.coll Line truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:u+f,endByte:u+c.length-1,value:v});const k={type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v};return l!=null&&l.includeSegments&&(k.segments=A),k}catch(A){return{type:o.PayloadType.Request,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:o.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}};r.RequestPayloadDecoder=s}}),T4=ke({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/response.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ResponsePayloadDecoder=void 0;var o=ur(),a=Ot(),s=class{static decode(c,l){try{if(c.length<4){const w={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),w}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:u+f,endByte:u+c.length-1,value:v});const k={type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.includeSegments&&(k.segments=A),k}catch(A){return{type:o.PayloadType.Response,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.ResponsePayloadDecoder=s}}),R4=ke({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/anon-request.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AnonRequestPayloadDecoder=void 0;var o=ur(),a=Ot(),s=class{static decode(c,l){try{if(c.length<35){const w={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),w}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${h}`,startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.bytesToHex)(c.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:u+f,endByte:u+f+31,value:m}),f+=32;const p=(0,a.bytesToHex)(c.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(35));l!=null&&l.includeSegments&&c.length>35&&A.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:u+f,endByte:u+c.length-1,value:v});const k={type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,senderPublicKey:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-35};return l!=null&&l.includeSegments&&(k.segments=A),k}catch(A){return{type:o.PayloadType.AnonRequest,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}};r.AnonRequestPayloadDecoder=s}}),B4=ke({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/ack.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AckPayloadDecoder=void 0;var o=ur(),a=Ot(),s=class{static decode(c,l){try{if(c.length<4){const m={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(m.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),m}const A=[],u=(l==null?void 0:l.segmentOffset)||0,f=(0,a.bytesToHex)(c.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${f}`,startByte:u,endByte:u+3,value:f}),l!=null&&l.includeSegments&&c.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:u+4,endByte:u+c.length-1,value:(0,a.bytesToHex)(c.subarray(4))});const h={type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!0,checksum:f};return l!=null&&l.includeSegments&&(h.segments=A),h}catch(A){return{type:o.PayloadType.Ack,version:o.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}};r.AckPayloadDecoder=s}}),P4=ke({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/path.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathPayloadDecoder=void 0;var o=ur(),a=Ot(),s=class{static decode(c){try{if(c.length<2)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=c[0];if(c.length<1+l+1)return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let h=0;h<l;h++)A.push((0,a.byteToHex)(c[1+h]));const u=c[1+l];let f="";return c.length>1+l+1&&(f=(0,a.bytesToHex)(c.subarray(1+l+1))),{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:u,extraData:f}}catch(l){return{type:o.PayloadType.Path,version:o.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}};r.PathPayloadDecoder=s}}),N4=ke({"node_modules/@michaelhart/meshcore-decoder/dist/decoder/payload-decoders/text-message.js"(r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextMessagePayloadDecoder=void 0;var o=ur(),a=Ot(),s=class{static decode(c,l){try{if(c.length<4){const w={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+c.length-1,value:(0,a.bytesToHex)(c)}]),w}const A=[],u=(l==null?void 0:l.segmentOffset)||0;let f=0;const h=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:u+f,endByte:u+f,value:h}),f+=1;const m=(0,a.byteToHex)(c[f]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:u+f,endByte:u+f,value:m}),f+=1;const p=(0,a.bytesToHex)(c.subarray(f,f+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:u+f,endByte:u+f+1,value:p}),f+=2;const v=(0,a.bytesToHex)(c.subarray(f));l!=null&&l.includeSegments&&c.length>f&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:u+f,endByte:u+c.length-1,value:v});const k={type:o.PayloadType.TextMessage,version:o.PayloadVersion.Version1,isValid:!0,destinationHash:h,sourceHash:m,cipherMac:p,ciphertext:v,ciphertextLength:c.length-4};return l!=null&&l.include Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
);
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
const CHARS: array<u32, 37> = array<u32, 37>(
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
0x2du // dash
);
struct Params {
target_channel_hash: u32,
batch_offset: u32,
name_length: u32,
batch_size: u32,
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
ciphertext_words: u32, // Number of 32-bit words in ciphertext
ciphertext_len_bits: u32, // Length of ciphertext in bits
verify_mac: u32, // 1 to verify MAC, 0 to skip
}
@group(0) @binding(0) var<uniform> params: Params;
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
fn rotr(x: u32, n: u32) -> u32 {
return (x >> n) | (x << (32u - n));
}
fn ch(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (~x & z);
}
fn maj(x: u32, y: u32, z: u32) -> u32 {
return (x & y) ^ (x & z) ^ (y & z);
}
fn sigma0(x: u32) -> u32 {
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
}
fn sigma1(x: u32) -> u32 {
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
}
fn gamma0(x: u32) -> u32 {
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
}
fn gamma1(x: u32) -> u32 {
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
}
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
// Message starts with '#' (0x23)
var byte_pos = 0u;
var word_idx = 0u;
var current_word = 0x23000000u; // '#' in big-endian position 0
byte_pos = 1u;
var remaining = idx;
var prev_was_dash = false;
// Generate room name from index
for (var i = 0u; i < length; i++) {
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
var char_idx = remaining % char_count;
remaining = remaining / char_count;
// Check for consecutive dashes (invalid)
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
if (is_dash && prev_was_dash) {
return false; // Invalid: consecutive dashes
}
prev_was_dash = is_dash;
// Map char index to actual character
let c = CHARS[char_idx];
// Pack byte into current word (big-endian)
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u && byte_pos > 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0u;
}
current_word = current_word | (c << shift);
byte_pos = byte_pos + 1u;
}
// Add padding: 0x80 followed by zeros, then length in bits
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
// Add 0x80 padding byte
let shift = (3u - byte_pos % 4u) * 8u;
if (byte_pos % 4u == 0u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
current_word = 0x80000000u;
} else {
current_word = current_word | (0x80u << shift);
}
byte_pos = byte_pos + 1u;
// Store current word
if (byte_pos % 4u == 0u || word_idx < 14u) {
(*msg)[word_idx] = current_word;
word_idx = word_idx + 1u;
}
// Zero-fill until word 14
for (var i = word_idx; i < 14u; i++) {
(*msg)[i] = 0u;
}
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
(*msg)[14u] = 0u;
(*msg)[15u] = msg_len_bits;
return true;
}
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
// Initialize hash values
var h: array<u32, 8> = array<u32, 8>(
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
);
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Compute SHA256 of the key (16 bytes) to get channel hash
fn sha256_key(key: array<u32, 4>) -> u32 {
var msg: array<u32, 16>;
// Key bytes (16 bytes = 4 words)
msg[0] = key[0];
msg[1] = key[1];
msg[2] = key[2];
msg[3] = key[3];
// Padding: 0x80 followed by zeros
msg[4] = 0x80000000u;
for (var i = 5u; i < 14u; i++) {
msg[i] = 0u;
}
// Length: 128 bits
msg[14] = 0u;
msg[15] = 128u;
let hash = sha256_block(&msg);
// Return first byte of hash (big-endian)
return hash[0] >> 24u;
}
// HMAC-SHA256 for MAC verification
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
// ipad = 0x36 repeated, opad = 0x5c repeated
// Build padded key (64 bytes = 16 words)
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
var k_pad: array<u32, 16>;
k_pad[0] = key[0];
k_pad[1] = key[1];
k_pad[2] = key[2];
k_pad[3] = key[3];
for (var i = 4u; i < 16u; i++) {
k_pad[i] = 0u;
}
// Inner hash: SHA256((K' ^ ipad) || message)
// First block: K' ^ ipad (64 bytes)
var inner_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
inner_block[i] = k_pad[i] ^ 0x36363636u;
}
// Initialize hash state with first block
var h: array<u32, 8> = sha256_block(&inner_block);
// Process ciphertext blocks (continuing from h state)
let ciphertext_words = params.ciphertext_words;
var word_idx = 0u;
// Process full 64-byte blocks of ciphertext
while (word_idx + 16u <= ciphertext_words) {
var block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
block[i] = ciphertext[word_idx + i];
}
h = sha256_block_continue(&block, h);
word_idx = word_idx + 16u;
}
// Final block with remaining ciphertext + padding
var final_block: array<u32, 16>;
var remaining = ciphertext_words - word_idx;
for (var i = 0u; i < 16u; i++) {
if (i < remaining) {
final_block[i] = ciphertext[word_idx + i];
} else if (i == remaining) {
// Add 0x80 padding
final_block[i] = 0x80000000u;
} else {
final_block[i] = 0u;
}
}
// Add length (64 bytes of ipad + ciphertext length)
let total_bits = 512u + params.ciphertext_len_bits;
if (remaining < 14u) {
final_block[14] = 0u;
final_block[15] = total_bits;
h = sha256_block_continue(&final_block, h);
} else {
// Need extra block for length
h = sha256_block_continue(&final_block, h);
var len_block: array<u32, 16>;
for (var i = 0u; i < 14u; i++) {
len_block[i] = 0u;
}
len_block[14] = 0u;
len_block[15] = total_bits;
h = sha256_block_continue(&len_block, h);
}
let inner_hash = h;
// Outer hash: SHA256((K' ^ opad) || inner_hash)
var outer_block: array<u32, 16>;
for (var i = 0u; i < 16u; i++) {
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
}
h = sha256_block(&outer_block);
// Second block: inner_hash (32 bytes) + padding
var hash_block: array<u32, 16>;
for (var i = 0u; i < 8u; i++) {
hash_block[i] = inner_hash[i];
}
hash_block[8] = 0x80000000u;
for (var i = 9u; i < 14u; i++) {
hash_block[i] = 0u;
}
hash_block[14] = 0u;
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
h = sha256_block_continue(&hash_block, h);
// Return first 2 bytes (high 16 bits of first word)
return h[0] & 0xFFFF0000u;
}
// SHA256 block computation continuing from existing state
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
var h = h_in;
// Message schedule
var w: array<u32, 64>;
for (var i = 0u; i < 16u; i++) {
w[i] = (*msg)[i];
}
for (var i = 16u; i < 64u; i++) {
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
}
// Compression
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
for (var i = 0u; i < 64u; i++) {
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
let t2 = sigma0(a) + maj(a, b, c);
hh = g; g = f; f = e; e = d + t1;
d = c; c = b; b = a; a = t1 + t2;
}
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
return h;
}
// Process a single candidate and record match if found
fn process_candidate(name_idx: u32) {
// Generate message for this room name
var msg: array<u32, 16>;
let valid = index_to_room_name(name_idx, params.name_length, &msg);
if (!valid) {
return;
}
// Compute SHA256("#roomname") - this gives us the key
let key_hash = sha256_block(&msg);
// Take first 16 bytes (4 words) as the key
var key: array<u32, 4>;
key[0] = key_hash[0];
key[1] = key_hash[1];
key[2] = key_hash[2];
key[3] = key_hash[3];
// Compute SHA256(key) to get channel hash
let channel_hash = sha256_key(key);
// Check if channel hash matches target
if (channel_hash != params.target_channel_hash) {
return;
}
// Channel hash matches - verify MAC if enabled
if (params.verify_mac == 1u) {
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
if (computed_mac != params.target_mac) {
return;
}
}
// Found a match - record the index
let match_idx = atomicAdd(&match_count, 1u);
if (match_idx < 1024u) { // Limit stored matches
match_indices[match_idx] = name_idx;
}
}
// Each thread processes 16 candidates to amortize thread overhead
const CANDIDATES_PER_THREAD: u32 = 16u;
@compute @workgroup_size(256)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
let idx = base_idx + i;
if (idx >= params.batch_size) {
return;
}
let name_idx = params.batch_offset + idx;
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const o=await navigator.gpu.requestAdapter();if(!o)return console.warn("No GPU adapter found"),!1;this.device=await o.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let 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 a=this.device.createShaderModule({code:this.shaderCode}),s=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:s,compute:{module:a,entryPoint:"main"}}),!0}catch(o){return console.error("WebGPU initialization failed:",o),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(o,a){return bo(a,o)}countNamesForLength(o){return xa(o)}async runBatch(o,a,s,c,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const u=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const f=this.matchCountReadBuffers[u],h=this.matchIndicesReadBuffers[u],m=l&&A?1:0;let p,v=0,k=0;if(m){const T=new Uint8Array(l.length/2);for(let D=0;D<T.length;D++)T[D]=parseInt(l.substr(D*2,2),16);v=T.length*8;const N=Math.ceil(T.length/4)*4,j=new Uint8Array(N);j.set(T),p=new Uint32Array(N/4);for(let D=0;D<p.length;D++)p[D]=j[D*4]<<24|j[D*4+1]<<16|j[D*4+2]<<8|j[D*4+3];const I=parseInt(A.substr(0,2),16),L=parseInt(A.substr(2,2),16);k=I<<24|L<<16}else p=new Uint32Array([0]);const w=Math.max(p.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<w)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:w,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=w,this.bindGroupDirty=!0);const S=new Uint32Array([o,s,a,c,k,p.length,v,m]);this.device.queue.writeBuffer(this.paramsBuffer,0,S),this.device.queue.writeBuffer(this.ciphertextBuffer,0,p),this.device.queue.writeBuffer(this.matchCountBuffer,0,sp.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 y=this.device.createCommandEncoder(),x=y.beginComputePass();x.setPipeline(this.pipeline),x.setBindGroup(0,this.bindGroup),x.dispatchWorkgroups(Math.ceil(c/(256*16))),x.end(),y.copyBufferToBuffer(this.matchCountBuffer,0,f,0,4),y.copyBufferToBuffer(this.matchIndicesBuffer,0,h,0,1024*4),this.device.queue.submit([y.finish()]),await f.mapAsync(GPUMapMode.READ);const b=new Uint32Array(f.getMappedRange())[0];f.unmap();const B=[];if(b>0){await h.mapAsync(GPUMapMode.READ);const T=new Uint32Array(h.getMappedRange());for(let N=0;N<Math.min(b,1024);N++)B.push(T[N]);h.unmap()}return B}destroy(){var o,a,s,c,l,A,u,f;(o=this.paramsBuffer)==null||o.destroy(),(a=this.matchCountBuffer)==null||a.destroy(),(s=this.matchIndicesBuffer)==null||s.destroy(),(c=this.ciphertextBuffer)==null||c.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(A=this.matchCountReadBuffers[1])==null||A.destroy(),(u=this.matchIndicesReadBuffers[0])==null||u.destroy(),(f=this.matchIndicesReadBuffers[1])==null||f.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}};ap.ZERO_DATA=new Uint32Array([0]);var V4=ap;function U4(){return typeof navigator<"u"&&"gpu"in navigator}var W4=/^[a-z0-9-]+$/,Q4=/^[a-z0-9].*[a-z0-9]$|^[a-z0-9]$/,G4=/ Line truncated
`).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);this.wordlist=s.filter($h)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter($h)}abort(){this.abortFlag=!0}isGpuAvailable(){return U4()}async decodePacket(r){var a;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const c=(a=(await Zh.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:a.decoded;return!(c!=null&&c.channelHash)||!(c!=null&&c.ciphertext)||!(c!=null&&c.cipherMac)?null:{channelHash:c.channelHash,ciphertext:c.ciphertext,cipherMac:c.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,a){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0;const s=(o==null?void 0:o.maxLength)??8,c=await this.decodePacket(r);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:l,ciphertext:A,cipherMac:u}=c,f=parseInt(l,16);if(!this.gpuInstance&&(this.gpuInstance=new V4,!await this.gpuInstance.init()))return{found:!1,error:"WebGPU not available"};const h=performance.now();let m=0,p=performance.now(),v=1,k=0;if(o!=null&&o.startFrom){const N=F4(o.startFrom);N&&(v=N.length,k=N.index+1,k>=xa(v)&&(v++,k=0))}let w=0;for(let N=v;N<=s;N++)w+=xa(N);w-=k;const S=(N,j,I)=>{if(!a)return;const D=(performance.now()-h)/1e3,O=D>0?Math.round(m/D):0,Q=w-m,G=O>0?Q/O:0;a({checked:m,total:w,percent:w>0?Math.min(100,m/w*100):0,rateKeysPerSec:O,etaSeconds:G,elapsedSeconds:D,currentLength:j,currentPosition:I,phase:N})},y=N=>{if(!L4(A,u,N))return{valid:!1};const j=Zh.ChannelCrypto.decryptGroupTextMessage(A,u,N);return!j.success||!j.data?{valid:!1}:this.useTimestampFilter&&!H4(j.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!z4(j.data.message)?{valid:!1}:{valid:!0,message:j.data.message}};if(v===1&&k===0){S("public-key",0,ru);const N=Jh(li);if(l===N){const j=y(li);if(j.valid)return{found:!0,roomName:ru,key:li,decryptedMessage:j.message}}}if(this.wordlist.length>0&&v===1&&k===0)for(let N=0;N<this.wordlist.length;N++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[N]};const j=this.wordlist[N],I=Xh("#"+j),L=Jh(I);if(parseInt(L,16)===f){const O=y(I);if(O.valid)return{found:!0,roomName:j,key:I,decryptedMessage:O.message}}const D=performance.now();D-p>=200&&(S("wordlist",j.length,j),p=D,await new Promise(O=>setTimeout(O,0)))}const x=32768,_=1e3;let b=x,B=!1;for(let N=v;N<=s;N++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(N,0)||void 0};const j=xa(N);let I=N===v?k:0;for(;I<j;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(N,I)||void 0};const L=Math.min(b,j-I),D=performance.now(),O=await this.gpuInstance.runBatch(f,N,I,L,A,u),Q=performance.now()-D;if(m+=L,!B&&L>=x&&Q>0){const $=_/Q,oe=Math.round(L*$),J=Math.pow(2,Math.round(Math.log2(Math.max(x,oe))));b=Math.max(x,J),B=!0}for(const $ of O){const oe=bo(N,$);if(!oe)continue;const J=Xh("#"+oe),re=y(J);if(re.valid)return{found:!0,roomName:oe,key:J,decryptedMessage:re.message}}I+=L;const G=performance.now();if(G-p>=200){const $=bo(N,Math.min(I,j-1))||"";S("bruteforce",N,$),p=G,await new Promise(oe=>setTimeout(oe,0))}}}return{found:!1,resumeFrom:bo(s,xa(s)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null)}};/*! Bundled license information:
crypto-js/ripemd160.js:
(** @preserve
(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.
*)
crypto-js/mode-ctr-gladman.js:
(** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*)
@noble/ed25519/index.js:
(*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
*/var Uc,eA;function K4(){return eA||(eA=1,Uc={webm:"data:video/webm;base64,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 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(u=>(this.enabled=!0,u)).catch(u=>{throw this.enabled=!1,u})}disable(){s()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?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 Wc=c,Wc}var Z4=Y4();const X4=nu(Z4);function J4({packets:r,channels:o,onChannelCreate:a,onRunningChange:s}){const[c,l]=R.useState(!1),[A,u]=R.useState(6),[f,h]=R.useState(!1),[m,p]=R.useState(null),[v,k]=R.useState(new Map),[w,S]=R.useState([]),[y,x]=R.useState(!1),[_,b]=R.useState(null),B=R.useRef(null),T=R.useRef(null),N=R.useRef(!1),j=R.useRef(!1),I=R.useRef(!1),L=R.useRef(new Map),D=R.useRef(!1),O=R.useRef(6);R.useEffect(()=>{const Y=new q4;B.current=Y,b(Y.isGpuAvailable());const C=new X4;return T.current=C,Y.loadWordlist("/words_alpha.txt").then(()=>x(!0)).catch(F=>console.error("Failed to load wordlist:",F)),()=>{Y.destroy(),B.current=null,C.disable(),T.current=null}},[]);const Q=new Set(o.map(Y=>Y.key.toUpperCase())),G=r.filter(Y=>Y.payload_type==="GROUP_TEXT"&&!Y.decrypted);R.useEffect(()=>{k(Y=>{const C=new Map(Y);let F=!1;for(const z of G)C.has(z.id)||(C.set(z.id,{packet:z,attempts:0,lastAttemptLength:0,status:"pending"}),F=!0);return F?(L.current=C,C):Y})},[G.length]),R.useEffect(()=>{L.current=v},[v]),R.useEffect(()=>{D.current=f},[f]),R.useEffect(()=>{O.current=A},[A]),R.useEffect(()=>{s==null||s(c)},[c,s]);const $=Array.from(v.values()).filter(Y=>Y.status==="pending").length,oe=Array.from(v.values()).filter(Y=>Y.status==="cracked").length,J=Array.from(v.values()).filter(Y=>Y.status==="failed").length,re=R.useCallback(async()=>{if(I.current||!B.current||!N.current)return;const Y=L.current;let C=null,F=null;for(const[ne,ue]of Y.entries())if(ue.status==="pending"){C=ue,F=ne;break}if(!C&&D.current){const ne=Array.from(Y.entries()).filter(([,ue])=>ue.status==="failed"&&ue.lastAttemptLength<10);ne.length>0&&(ne.sort((ue,de)=>ue[1].lastAttemptLength-de[1].lastAttemptLength),[F,C]=ne[0])}if(!C||F===null){N.current&&setTimeout(()=>re(),1e3);return}I.current=!0;const z=O.current,U=C.lastAttemptLength>0?C.lastAttemptLength+1:z;try{const ne=await B.current.crack(C.packet.data,{maxLength:U,useTimestampFilter:!0,useUtf8Filter:!0},ue=>{p(ue)});if(j.current){j.current=!1,I.current=!1,p(null);return}if(ne.found&&ne.roomName&&ne.key){k(te=>{const Ee=new Map(te),je=Ee.get(F);return je&&Ee.set(F,{...je,status:"cracked",attempts:je.attempts+1,lastAttemptLength:U}),Ee});const ue={roomName:ne.roomName,key:ne.key,packetId:F,message:ne.decryptedMessage||"",crackedAt:Date.now()};S(te=>[...te,ue]);const de=ne.key.toUpperCase();if(!Q.has(de))try{await a("#"+ne.roomName,ne.key)}catch(te){console.error("Failed to create channel:",te)}}else k(ue=>{const de=new Map(ue),te=de.get(F);return te&&de.set(F,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:U}),de})}catch(ne){console.error("Cracking error:",ne),k(ue=>{const de=new Map(ue),te=de.get(F);return te&&de.set(F,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:U}),de})}I.current=!1,p(null),N.current&&setTimeout(()=>re(),100)},[Q,a]),W=()=>{var Y;if(!_){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}l(!0),N.current=!0,j.current=!1,(Y=T.current)==null||Y.enable(),re()},ie=()=>{var Y,C;l(!1),N.current=!1,j.current=!0,(Y=B.current)==null||Y.abort(),(C=T.current)==null||C.disable()};return P.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[P.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[P.jsx("button",{onClick:c?ie:W,disabled:!y||_===!1,className:Ge("px-4 py-1.5 rounded text-sm font-medium",c?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90","disabled:opacity-50 disabled:cursor-not-allowed"),children:c?"Stop":"Start Cracking"}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),P.jsx("input",{type:"number",min:1,max:10,value:A,onChange:Y=>u(Math.min(10,Math.max(1,parseInt(Y.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),P.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[P.jsx("input",{type:"checkbox",checked:f,onChange:Y=>h(Y.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),P.jsxs("div",{className:"flex gap-4 text-sm",children:[P.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",P.jsx("span",{className:"text-foreground font-medium",children:$})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",P.jsx("span",{className:"text-green-500 font-medium",children:oe})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",P.jsx("span",{className:"text-destructive font-medium",children:J})]})]}),m&&P.jsxs("div",{className:"space-y-1",children:[P.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[P.jsxs("span",{children:[m.phase==="wordli Line truncated
+1
View File
@@ -0,0 +1 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 10%;--foreground: 0 0% 88%;--card: 0 0% 14%;--card-foreground: 0 0% 88%;--popover: 0 0% 14%;--popover-foreground: 0 0% 88%;--primary: 122 39% 49%;--primary-foreground: 0 0% 100%;--secondary: 0 0% 20%;--secondaLine truncated
-1
View File
@@ -1 +0,0 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 10%;--foreground: 0 0% 88%;--card: 0 0% 14%;--card-foreground: 0 0% 88%;--popover: 0 0% 14%;--popover-foreground: 0 0% 88%;--primary: 122 39% 49%;--primary-foreground: 0 0% 100%;--secondary: 0 0% 20%;--secondaLine truncated
+2 -2
View File
@@ -4,8 +4,8 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RemoteTerm for MeshCore</title>
<script type="module" crossorigin src="/assets/index-B-xot-vl.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DlaqriQ9.css">
<script type="module" crossorigin src="/assets/index-BKnk_LMx.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BdHgsPJQ.css">
</head>
<body>
<div id="root"></div>
+32 -22
View File
@@ -20,6 +20,7 @@ import {
type ConversationTimes,
} from './utils/conversationState';
import { pubkeysMatch, getContactDisplayName } from './utils/pubkey';
import { cn } from '@/lib/utils';
import type {
AppSettings,
AppSettingsUpdate,
@@ -59,6 +60,8 @@ export function App() {
const [showConfig, setShowConfig] = useState(false);
const [sidebarOpen, setSidebarOpen] = useState(false);
const [undecryptedCount, setUndecryptedCount] = useState(0);
const [showCracker, setShowCracker] = useState(false);
const [crackerRunning, setCrackerRunning] = useState(false);
// Track last message times (persisted in localStorage, used for sorting)
const [lastMessageTimes, setLastMessageTimes] = useState<ConversationTimes>(getLastMessageTimes);
// Track unread counts (calculated on load and incremented during session)
@@ -634,6 +637,9 @@ export function App() {
}}
lastMessageTimes={lastMessageTimes}
unreadCounts={unreadCounts}
showCracker={showCracker}
crackerRunning={crackerRunning}
onToggleCracker={() => setShowCracker((prev) => !prev)}
/>
);
@@ -670,28 +676,8 @@ export function App() {
activeConversation.type === 'raw' ? (
<>
<div className="flex justify-between items-center px-4 py-3 border-b border-border font-medium">Raw Packet Feed</div>
<div className="flex-1 flex flex-col overflow-hidden">
<div className="flex-1 overflow-hidden min-h-0">
<RawPacketList packets={rawPackets} />
</div>
<div className="h-[280px] flex-shrink-0 border-t border-border overflow-hidden">
<CrackerPanel
packets={rawPackets}
channels={channels}
onChannelCreate={async (name, key) => {
// Create channel without navigating to it
const created = await api.createChannel(name, key);
const data = await api.getChannels();
setChannels(data);
// Try to decrypt historical packets with this key
await api.decryptHistoricalPackets({
key_type: 'channel',
channel_key: created.key,
});
fetchUndecryptedCount();
}}
/>
</div>
<div className="flex-1 overflow-hidden">
<RawPacketList packets={rawPackets} />
</div>
</>
) : (
@@ -750,6 +736,30 @@ export function App() {
</div>
</div>
{/* Global Cracker Panel - always rendered to maintain state */}
<div
className={cn(
"border-t border-border bg-background transition-all duration-200 overflow-hidden",
showCracker ? "h-[275px]" : "h-0"
)}
>
<CrackerPanel
packets={rawPackets}
channels={channels}
onChannelCreate={async (name, key) => {
const created = await api.createChannel(name, key);
const data = await api.getChannels();
setChannels(data);
await api.decryptHistoricalPackets({
key_type: 'channel',
channel_key: created.key,
});
fetchUndecryptedCount();
}}
onRunningChange={setCrackerRunning}
/>
</div>
<NewMessageModal
open={showNewMessage}
contacts={contacts}
+7 -1
View File
@@ -23,9 +23,10 @@ interface CrackerPanelProps {
packets: RawPacket[];
channels: Channel[];
onChannelCreate: (name: string, key: string) => Promise<void>;
onRunningChange?: (running: boolean) => void;
}
export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPanelProps) {
export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChange }: CrackerPanelProps) {
const [isRunning, setIsRunning] = useState(false);
const [maxLength, setMaxLength] = useState(6);
const [retryFailedAtNextLength, setRetryFailedAtNextLength] = useState(false);
@@ -113,6 +114,11 @@ export function CrackerPanel({ packets, channels, onChannelCreate }: CrackerPane
maxLengthRef.current = maxLength;
}, [maxLength]);
// Notify parent of running state changes
useEffect(() => {
onRunningChange?.(isRunning);
}, [isRunning, onRunningChange]);
// Stats (cracking count is implicit - if progress is shown, we're cracking one)
const pendingCount = Array.from(queue.values()).filter(q => q.status === 'pending').length;
const crackedCount = Array.from(queue.values()).filter(q => q.status === 'cracked').length;
+28
View File
@@ -18,6 +18,9 @@ interface SidebarProps {
onNewMessage: () => void;
lastMessageTimes: ConversationTimes;
unreadCounts: Record<string, number>;
showCracker: boolean;
crackerRunning: boolean;
onToggleCracker: () => void;
}
// Load sort preference from localStorage
@@ -47,6 +50,9 @@ export function Sidebar({
onNewMessage,
lastMessageTimes,
unreadCounts,
showCracker,
crackerRunning,
onToggleCracker,
}: SidebarProps) {
const [sortOrder, setSortOrder] = useState<SortOrder>(loadSortOrder);
const [searchQuery, setSearchQuery] = useState('');
@@ -219,6 +225,28 @@ export function Sidebar({
</div>
)}
{/* Cracker Toggle */}
{!query && (
<div
className={cn(
"px-3 py-2.5 cursor-pointer flex items-center gap-2 border-l-2 border-transparent hover:bg-accent",
showCracker && "bg-accent border-l-primary"
)}
onClick={onToggleCracker}
>
<span className="text-muted-foreground text-xs">🔓</span>
<span className="flex-1 truncate">
{showCracker ? 'Hide' : 'Show'} Cracker
<span className={cn(
"ml-1 text-xs",
crackerRunning ? "text-green-500" : "text-muted-foreground"
)}>
({crackerRunning ? 'running' : 'stopped'})
</span>
</span>
</div>
)}
{/* Channels */}
{filteredChannels.length > 0 && (
<>