mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-10-23 01:41:15 +00:00
Add room hash history
This commit is contained in:
1 parent
816a823147
commit
9d29ef059b
6 files changed
+635
-552
No files matched your search
@@ -40,10 +40,15 @@ uv run uvicorn app.main:app --reload
|
||||
|
||||
# Or specify port explicitly
|
||||
MESHCORE_SERIAL_PORT=/dev/cu.usbserial-0001 uv run uvicorn app.main:app --reload
|
||||
|
||||
# or disable hot reload for more permanent deployments
|
||||
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
```
|
||||
|
||||
Backend runs at http://localhost:8000, and will preferentially serve from `./frontend/dist` for the GUI. If you want to do GUI development, see below and use http://localhost:5173 for the GUI.
|
||||
|
||||
See the `HTTPS` section below if you're serving this anywhere but localhost and need the GPU cracker to function.
|
||||
|
||||
**If you just want to run this as-is (all commits push a distribution-ready frontend build), you can just run the backend and access the GUI from there; no need to boot the frontend**
|
||||
|
||||
### Frontend Dev
|
||||
|
||||
+542
@@ -0,0 +1,542 @@
|
||||
function a1(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 ou(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},fa={},lc={exports:{}},Fe={};/**
|
||||
* @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 th;function s1(){if(th)return Fe;th=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 b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function y(k,F,z){this.props=k,this.context=F,this.refs=C,this.updater=z||b}y.prototype.isReactComponent={},y.prototype.setState=function(k,F){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,F,"setState")},y.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function E(){}E.prototype=y.prototype;function _(k,F,z){this.props=k,this.context=F,this.refs=C,this.updater=z||b}var w=_.prototype=new E;w.constructor=_,x(w,y.prototype),w.isPureReactComponent=!0;var S=Array.isArray,R=Object.prototype.hasOwnProperty,N={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function D(k,F,z){var W,oe={},ue=null,de=null;if(F!=null)for(W in F.ref!==void 0&&(de=F.ref),F.key!==void 0&&(ue=""+F.key),F)R.call(F,W)&&!j.hasOwnProperty(W)&&(oe[W]=F[W]);var te=arguments.length-2;if(te===1)oe.children=z;else if(1<te){for(var Ee=Array(te),Ie=0;Ie<te;Ie++)Ee[Ie]=arguments[Ie+2];oe.children=Ee}if(k&&k.defaultProps)for(W in te=k.defaultProps,te)oe[W]===void 0&&(oe[W]=te[W]);return{$$typeof:r,type:k,key:ue,ref:de,props:oe,_owner:N.current}}function H(k,F){return{$$typeof:r,type:k.type,key:F,ref:k.ref,props:k.props,_owner:k._owner}}function O(k){return typeof k=="object"&&k!==null&&k.$$typeof===r}function I(k){var F={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(z){return F[z]})}var V=/\/+/g;function G(k,F){return typeof k=="object"&&k!==null&&k.key!=null?I(""+k.key):F.toString(36)}function ee(k,F,z,W,oe){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,oe=oe(de),k=W===""?"."+G(de,0):W,S(oe)?(z="",k!=null&&(z=k.replace(V,"$&/")+"/"),ee(oe,F,z,"",function(Ie){return Ie})):oe!=null&&(O(oe)&&(oe=H(oe,z+(!oe.key||de&&de.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+k)),F.push(oe)),1;if(de=0,W=W===""?".":W+":",S(k))for(var te=0;te<k.length;te++){ue=k[te];var Ee=W+G(ue,te);de+=ee(ue,F,z,Ee,oe)}else if(Ee=v(k),typeof Ee=="function")for(k=Ee.call(k),te=0;!(ue=k.next()).done;)ue=ue.value,Ee=W+G(ue,te++),de+=ee(ue,F,z,Ee,oe);else if(ue==="object")throw F=String(k),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return de}function ae(k,F,z){if(k==null)return k;var W=[],oe=0;return ee(k,W,"","",function(ue){return F.call(z,ue,oe++)}),W}function $(k){if(k._status===-1){var F=k._result;F=F(),F.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=F)}if(k._status===1)return k._result.default;throw k._result}var ne={current:null},Q={transition:null},se={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:Q,ReactCurrentOwner:N};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Fe.Children={map:ae,forEach:function(k,F,z){ae(k,function(){F.apply(this,arguments)},z)},count:function(k){var F=0;return ae(k,function(){F++}),F},toArray:function(k){return ae(k,function(F){return F})||[]},only:function(k){if(!O(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},Fe.Component=y,Fe.Fragment=a,Fe.Profiler=c,Fe.PureComponent=_,Fe.StrictMode=s,Fe.Suspense=f,Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Fe.act=Y,Fe.cloneElement=function(k,F,z){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var W=x({},k.props),oe=k.key,ue=k.ref,de=k._owner;if(F!=null){if(F.ref!==void 0&&(ue=F.ref,de=N.current),F.key!==void 0&&(oe=""+F.key),k.type&&k.type.defaultProps)var te=k.type.defaultProps;for(Ee in F)R.call(F,Ee)&&!j.hasOwnProperty(Ee)&&(W[Ee]=F[Ee]===void 0&&te!==void 0?te[Ee]:F[Ee])}var Ee=arguments.length-2;if(Ee===1)W.children=z;else if(1<Ee){te=Array(Ee);for(var Ie=0;Ie<Ee;Ie++)te[Ie]=arguments[Ie+2];W.children=te}return{$$typeof:r,type:k.type,key:oe,ref:ue,props:W,_owner:de}},Fe.createCLine 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 nh;function i1(){if(nh)return fa;nh=1;var r=au(),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,b=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(b=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:b,props:p,_owner:c.current}}return fa.Fragment=a,fa.jsx=A,fa.jsxs=A,fa}var oh;function l1(){return oh||(oh=1,ic.exports=i1()),ic.exports}var P=l1(),B=au();const Ae=ou(B),su=a1({__proto__:null,default:Ae},[B]);var Is={},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 ah;function c1(){return ah||(ah=1,(function(r){function o(Q,se){var Y=Q.length;Q.push(se);e:for(;0<Y;){var k=Y-1>>>1,F=Q[k];if(0<c(F,se))Q[k]=se,Q[Y]=F,Y=k;else break e}}function a(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var se=Q[0],Y=Q.pop();if(Y!==se){Q[0]=Y;e:for(var k=0,F=Q.length,z=F>>>1;k<z;){var W=2*(k+1)-1,oe=Q[W],ue=W+1,de=Q[ue];if(0>c(oe,Y))ue<F&&0>c(de,oe)?(Q[k]=de,Q[ue]=Y,k=ue):(Q[k]=oe,Q[W]=Y,k=W);else if(ue<F&&0>c(de,Y))Q[k]=de,Q[ue]=Y,k=ue;else break e}}return se}function c(Q,se){var Y=Q.sortIndex-se.sortIndex;return Y!==0?Y:Q.id-se.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,b=!1,x=!1,C=!1,y=typeof setTimeout=="function"?setTimeout:null,E=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 w(Q){for(var se=a(h);se!==null;){if(se.callback===null)s(h);else if(se.startTime<=Q)s(h),se.sortIndex=se.expirationTime,o(f,se);else break;se=a(h)}}function S(Q){if(C=!1,w(Q),!x)if(a(f)!==null)x=!0,$(R);else{var se=a(h);se!==null&&ne(S,se.startTime-Q)}}function R(Q,se){x=!1,C&&(C=!1,E(D),D=-1),b=!0;var Y=v;try{for(w(se),p=a(f);p!==null&&(!(p.expirationTime>se)||Q&&!I());){var k=p.callback;if(typeof k=="function"){p.callback=null,v=p.priorityLevel;var F=k(p.expirationTime<=se);se=r.unstable_now(),typeof F=="function"?p.callback=F:p===a(f)&&s(f),w(se)}else s(f);p=a(f)}if(p!==null)var z=!0;else{var W=a(h);W!==null&&ne(S,W.startTime-se),z=!1}return z}finally{p=null,v=Y,b=!1}}var N=!1,j=null,D=-1,H=5,O=-1;function I(){return!(r.unstable_now()-O<H)}function V(){if(j!==null){var Q=r.unstable_now();O=Q;var se=!0;try{se=j(!0,Q)}finally{se?G():(N=!1,j=null)}}else N=!1}var G;if(typeof _=="function")G=function(){_(V)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ae=ee.port2;ee.port1.onmessage=V,G=function(){ae.postMessage(null)}}else G=function(){y(V,0)};function $(Q){j=Q,N||(N=!0,G())}function ne(Q,se){D=y(function(){Q(r.unstable_now())},se)}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(Q){Q.callback=null},r.unstable_continueExecution=function(){x||b||(x=!0,$(R))},r.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<Q?Math.floor(1e3/Q):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return a(f)},r.unstable_next=function(Q){switch(v){case 1:case 2:case 3:var se=3;break;default:se=v}var Y=v;v=se;try{return Q()}finally{v=Y}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(Q,se){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var Y=v;v=Q;try{return se()}finally{v=Y}},r.unstable_scheduleCallback=function(Q,se,Y){var k=r.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?k+Y:k):Y=k,Q){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,Q={id:m++,callback:se,priorityLevel:Q,startTime:Y,expirationTime:F,sortIndex:-1},Y>k?(Q.sortIndex=Y,o(h,Q),a(f)===null&&Q===a(h)&&(C?(E(D),D=-1):C=!0,ne(S,Y-k))):(Q.sortIndex=F,o(f,Q),x||b||(x=!0,$(R))),Q},r.unstable_shouldYield=I,r.unstable_wrapCallback=function(Q){var se=v;return function(){var Y=v;v=se;try{return Q.apply(this,arguments)}finally{v=Y}}}})(dc)),dc}var sh;function u1(){return sh||(sh=1,uc.exports=c1()),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 ih;function d1(){if(ih)return rr;ih=1;var r=au(),o=u1();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 b(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 x(e,t,n,i){if(t===null||typeof t>"u"||b(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 C(e,t,n,i,d,g,T){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=T}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new C(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 C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){y[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([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(E,_);y[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(E,_);y[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(E,_);y[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new C(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 W(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(J){var i=J}Reflect.construct(e,[],t)}else{try{t.call()}catch(J){i=J}e.call(t.prototype)}else{try{throw Error()}catch(J){i=J}e()}}catch(J){if(J&&i&&typeof J.stack=="string"){for(var d=J.stack.split(`
|
||||
`),g=i.stack.split(`
|
||||
`),T=d.length-1,M=g.length-1;1<=T&&0<=M&&d[T]!==g[M];)M--;for(;1<=T&&0<=M;T--,M--)if(d[T]!==g[M]){if(T!==1||M!==1)do if(T--,M--,0>M||d[T]!==g[M]){var L=`
|
||||
`+d[T].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=T&&0<=M);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function oe(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=W(e.type,!1),e;case 11:return e=W(e.type.render,!1),e;case 1:return e=W(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 H:return"Profiler";case D:return"StrictMode";case G:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case I:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case $: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===D?"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 Ie(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(T){i=""+T,g.call(this,T)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nt(e){e._valueTracker||(e._valueTracker=Ie(e))}function ot(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 it(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 Ye(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 Ft(e,t){t=t.checked,t!=null&&w(e,"checked",t,!1)}function Et(e,t){Ft(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")?ut(e,t.type,n):t.hasOwnProperty("defaultValue")&&ut(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 ut(e,t,n){(t!=="number"||it(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dt=Array.isArray;function et(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 Ue(e,t){if(t.dangerouslySetInnerHTML!
Line truncated
|
||||
`).replace(vm,"")}function Ka(e,t,n){if(t=yd(t),yd(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,ym=typeof clearTimeout=="function"?clearTimeout:void 0,xd=typeof Promise=="function"?Promise:void 0,xm=typeof queueMicrotask=="function"?queueMicrotask:typeof xd<"u"?function(e){return xd.resolve(null).then(e).catch(wm)}:tl;function wm(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),Ho(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=d}while(n);Ho(t)}function sn(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 wd(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 $n=Math.random().toString(36).slice(2),Dr="__reactFiber$"+$n,Zo="__reactProps$"+$n,Ur="__reactContainer$"+$n,nl="__reactEvents$"+$n,bm="__reactListeners$"+$n,km="__reactHandles$"+$n;function En(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=wd(e);e!==null;){if(n=e[Dr])return n;e=wd(e)}return t}e=n,n=e.parentNode}return null}function Xo(e){return e=e[Dr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function eo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Za(e){return e[Zo]||null}var ol=[],to=-1;function ln(e){return{current:e}}function rt(e){0>to||(e.current=ol[to],ol[to]=null,to--)}function Xe(e,t){to++,ol[to]=e.current,e.current=t}var cn={},Lt=ln(cn),Xt=ln(!1),Tn=cn;function ro(e,t){var n=e.type.contextTypes;if(!n)return cn;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(){rt(Xt),rt(Lt)}function bd(e,t,n){if(Lt.current!==cn)throw Error(a(168));Xe(Lt,t),Xe(Xt,n)}function kd(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||cn,Tn=Lt.current,Xe(Lt,e),Xe(Xt,Xt.current),!0}function _d(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=kd(e,t,Tn),i.__reactInternalMemoizedMergedChildContext=e,rt(Xt),rt(Lt),Xe(Lt,e)):rt(Xt),Xe(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 un(){if(!al&&Wr!==null){al=!0;var e=0,t=Ke;try{var n=Wr;for(Ke=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)),Eu(Ei,un),d}finally{Ke=t,al=!1}}return null}var no=[],oo=0,es=null,ts=0,fr=[],hr=0,Rn=null,Qr=1,Gr="";function Bn(e,t){no[oo++]=ts,no[oo++]=es,es=e,ts=t}function Sd(e,t,n){fr[hr++]=Qr,fr[hr++]=Gr,fr[hr++]=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 T=d-d%5;g=(i&(1<<T)-1).toString(32),i>>=T,d-=T,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&&(Bn(e,1),Sd(e,1,0))}function il(e){for(;e===es;)es=no[--oo],no[oo]=null,ts=no[--oo],no[oo]=null;for(;e===Rn;)Rn=fr[--hr],fr[hr]=null,Gr=fr[--hr],fr[hr]=null,Qr=fr[--hr],fr[hr]=null}var ir=null,lr=null,st=!1,_r=null;function Ed(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 Td(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=sn(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=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(st){var t=lr;if(t){var n=t;if(!Td(e,t)){if(ll(e))throw Error(a(418));t=sn(n.nextSibling);var i=ir;t&&Td(e,t)?Ed(i,n):(e.flags=e.flags&-4097|2,st=!1,ir=e)}}else{if(ll(e))throw Error(a(418));e.flags=e.flags&-4097|2,st=!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 Dm=typeof WeakMap=="function"?WeakMap:Map;function uf(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 df(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"&&(An===null?An=new Set([this]):An.add(this));var T=t.stack;this.componentDidCatch(t.value,{componentStack:T!==null?T:""})}),n}function ff(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Dm;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=qm.bind(null,e,t,n),t.then(e,e))}function hf(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 Af(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,fn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var jm=S.ReactCurrentOwner,$t=!1;function Qt(e,t,n,i){t.child=e===null?Dd(t,null,n,i):so(t,e.child,n,i)}function pf(e,t,n,i,d){n=n.render;var g=t.ref;return lo(t,d),i=kl(e,t,n,i,g,d),n=_l(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(st&&n&&sl(t),t.flags|=1,Qt(e,t,i,d),t.child)}function mf(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,gf(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 T=g.memoizedProps;if(n=n.compare,n=n!==null?n:Qo,n(T,i)&&e.ref===t.ref)return Yr(e,t,d)}return t.flags|=1,e=vn(g,i),e.ref=t.ref,e.return=t,t.child=e}function gf(e,t,n,i,d){if(e!==null){var g=e.memoizedProps;if(Qo(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 vf(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},Xe(ho,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,Xe(ho,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=g!==null?g.baseLanes:n,Xe(ho,cr),cr|=i}else g!==null?(i=g.baseLanes|n,t.memoizedState=null):i=n,Xe(ho,cr),cr|=i;return Qt(e,t,d,n),t.child}function yf(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)?Tn:Lt.current;return g=ro(t,g),lo(t,d),n=kl(e,t,n,i,g,d),i=_l(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(st&&i&&sl(t),t.flags|=1,Qt(e,t,n,d),t.child)}function xf(e,t,n,i,d){if(Jt(n)){var g=!0;Ja(t)}else g=!1;if(lo(t,d),t.stateNode===null)ms(e,t),lf(t,n,i),Bl(t,n,i,d),i=!0;else if(e===null){var T=t.stateNode,M=t.memoizedProps;T.props=M;var L=T.context,J=n.contextType;typeof J=="object"&&J!==null?J=Ar(J):(J=Jt(n)?Tn:Lt.current,J=ro(t,J));var le=n.getDerivedStateFromProps,ce=typeof le=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==i||L!==J)&&cf(t,T,i,J),dn=!1;var ie=t.memoizedState;T.state=ie,is(t,i,T,d),L=t.memoizedState,M!==i||ie!==L||Xt.current||dn?(typeof le=="function"&&(Rl(t,n,le,i),L=t.memoizedState),(M=dn||sf(t,n,M,i,ie,L,J))?(ce||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(t.flags|=4194308)):(typeof T.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=L),T.props=i,T.state=L,T.context=J,i=M):(typeof T.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{T=t.stateNode,Id(e,t),M=t.memoizedProps,J=t.type===t.elementType?M:Cr(t.type,M),T.props=J,ce=t.pendingProps,ie=T.context,L=n.contextType,typeof L=="object"&&L!==null?L=Ar(L):(L=Jt(n)?Tn:Lt.current,L=ro(t,L));var me=n.getDerivedStateFromProps;(le=typeof me=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==ce||ie!==L)&&cf(t,T,i,L),dn=!1,ie=t.memoizedState,T
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 m1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),g1=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),uh=r=>{const o=g1(r);return o.charAt(0).toUpperCase()+o.slice(1)},aA=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),v1=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 y1={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 x1=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,...y1,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:aA("lucide",c),...!l&&!v1(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 iu=(r,o)=>{const a=B.forwardRef(({className:s,...c},l)=>B.createElement(x1,{ref:l,iconNode:o,className:aA(`lucide-${m1(uh(r))}`,`lucide-${r}`,s),...c}));return a.displayName=uh(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 w1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b1=iu("check",w1);/**
|
||||
* @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:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],_1=iu("menu",k1);/**
|
||||
* @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"}]],sA=iu("x",C1);var iA=oA();const lA=ou(iA);function S1(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 E1=r=>{switch(r){case"success":return B1;case"info":return N1;case"warning":return P1;case"error":return D1;default:return null}},T1=Array(12).fill(0),R1=({visible:r,className:o})=>Ae.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},Ae.createElement("div",{className:"sonner-spinner"},T1.map((a,s)=>Ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),B1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.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"})),P1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ae.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"})),N1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.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"})),D1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.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"})),j1=Ae.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"},Ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I1=()=>{const[r,o]=Ae.useState(document.hidden);return Ae.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Gc=1;class M1{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:Gc++,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],Ae.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(F1(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,x=typeof p=="object"&&!Ae.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...x})}else if(h instanceof Error){l=!1;const p=typeof a.error=="function"?await a.error(h):a.error,Line truncated
|
||||
`).map((se,Y,k)=>P.jsxs("span",{children:[se,Y<k.length-1&&P.jsx("br",{})]},Y)),!ee&&P.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:kh(S.sender_timestamp||S.received_at)}),S.outgoing&&(S.acked?" ✓":" ?")]})]})]},S.id)})]}),m&&P.jsx("button",{onClick:x,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:P.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}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 b;A(x=>x+v),(b=h.current)==null||b.focus()}}));const m=B.useCallback(async v=>{v.preventDefault();const b=l.trim();if(!(!b||u||a)){f(!0);try{await o(b),A("")}catch(x){console.error("Failed to send message:",x)}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(yt,{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 E;const{scope:v,children:b,...x}=p,C=((E=v==null?void 0:v[r])==null?void 0:E[f])||u,y=B.useMemo(()=>x,Object.values(x));return P.jsx(C.Provider,{value:y,children:b})};h.displayName=l+"Provider";function m(p,v){var C;const b=((C=v==null?void 0:v[r])==null?void 0:C[f])||u,x=B.useContext(b);if(x)return x;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 Eo=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},hv=su[" useId ".trim().toString()]||(()=>{}),Av=0;function ka(r){const[o,a]=B.useState(hv());return Eo(()=>{a(s=>s??String(Av++))},[r]),o?`radix-${o}`:""}var pv=su[" useInsertionEffect ".trim().toString()]||Eo;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=kv(c),u=bv(l,c.props);return c.type!==B.Fragment&&(u.ref=s?Ca(s,A):A),B.cloneElement(c,u)}return B.Children.count(c)>1?B.Children.only(null):null});return o.displayName=`${r}.Slo
Line 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;
|
||||
}
|
||||
`)},Nh=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,(Nh()+1).toString()),function(){var r=Nh()-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")})},Jc=!1;if(typeof window<"u")try{var Ls=Object.defineProperty({},"passive",{get:function(){return Jc=!0,!0}});window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Jc=!1}var go=Jc?{passive:!1}:!1,p2=function(r){return r.tagName==="TEXTAREA"},OA=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 OA(r,"overflowY")},g2=function(r){return OA(r,"overflowX")},Dh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=FA(r,s);if(c){var l=HA(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]},FA=function(r,o){return r==="v"?m2(o):g2(o)},HA=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 b=HA(r,u),x=b[0],C=b[1],y=b[2],E=C-y-l*x;(x||E)&&FA(r,u)&&(p+=E,v+=x);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]},jh=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]},k2=function(r){return`
|
||||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||||
`)},_2=0,vo=[];function C2(r){var o=B.useRef([]),a=B.useRef([0,0]),s=B.useRef(),c=B.useState(_2++)[0],l=B.useState(MA)[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 C=Gv([r.lockRef.current],(r.shards||[]).map(Ih),!0).filter(Boolean);return C.forEach(function(y){return y.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=B.useCallback(function(C,y){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!A.current.allowPinchZoom;var E=zs(C),_=a.current,w="deltaX"in C?C.deltaX:_[0]-E[0],S="deltaY"in C?C.deltaY:_[1]-E[1],R,N=C.target,j=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in C&&j==="h"&&N.type==="range")return!1;var D=window.getSelection(),H=D&&D.anchorNode,O=H?H===N||H.contains(N):!1;if(O)return!1;var I=Dh(j,N);if(!I)return!0;if(I?R=j:(R=j==="v"?"h":"v",I=Dh(j,N)),!I)return!1;if(!s.current&&"changedTouches"in C&&(w||S)&&(s.current=R),!R)return!0;var V=s.current||R;return w2(V,y,C,V==="h"?w:S)},[]),f=B.useCallback(function(C){var y=C;if(!(!vo.length||vo[vo.length-1]!==l)){var E="deltaY"in y?jh(y):zs(y),_=o.current.filter(function(R){return R.name===y.type&&(R.target===y.target||y.target===R.shadowParent)&&b2(R.delta,E)})[0];if(_&&_.should){y.cancelable&&y.preventDefault();return}if(!_){var w=(A.current.shards||[]).map(Ih).filter(Boolean).filter(function(R){return R.contains(y.target)}),S=w.length>0?u(y,w[0]):!A.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),h=B.useCallback(function(C,y,E,_){var w={name:C,delta:y,target:E,should:_,shadowParent:S2(E)};o.current.push(w),setTimeout(function(){o.current=o.current.filter(function(S){return S!==w})},1)},[]),m=B.useCallback(function(C){a.current=zs(C),s.current=void 0},[]),p=B.useCallback(function(C){h(C.type,jh(C),C.target,u(C,r.lockRef.current))},[]),v=B.useCallback(function(C){h(C.type,zs(C),C.target,u(C,r.lockRef.current))},[]);B.useEffect(function(){return vo.push(l),r.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,go),document.addEventListener("touchmove",f,go),document.addEventListener("touchstart",m,go),function(){vo=vo.filter(function(C){return C!==l}),document.removeEventListener("wheel",f,go),document.removeEventListener("touchmove",f,go),document.removeEventListener("touchstart",m,go)}},[]);var b=r.removeScrollBar,x=r.inert;return B.createElement(B.Fragment,null,x?B.createElement(l,{styles:k2(c)}):null,b?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,C2);var LA=B.forwardRef(function(r,o){return B.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},yo=new WeakMap,Vs=new WeakMap,Us={},bc=0,zA=function(r){return r&&(r.host||zA(r.parentNode))},R2=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=zA(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 b=v.getAttribute(s),x=b!==null&&b!=="false",C=(yo.get(v)||0)+1,y=(l.get(v)||0)+1;yo.set(v,C),l.set(v,y),A.push(v),C===1&&x&&Vs.set(v,!0),y===1&&v.setAttribute(a,"true"),x||v.setAttribute(s,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return m(o),u.clear(),bc++,function(){A.forEach(function(p){var v=yo.get(p)-1,b=l.get(p)-1;yo.set(p,v),l.set(p,b),v||(Vs.has(p)||p.removeAttribute(s),Vs.delete(p)),b||p.removeAttribute(a)}),bc--,bc||(yo=new WeakMap,yo=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=B.forwardRef((s,c)=>{const{children:l,...A}=s,u=B.Children.toArray(l),f=u.find(I2);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 {${r0(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},n0=UA,o0=GA,gi=qA,vi=KA,yi=ZA,xi=JA,a0=e0;const s0=n0,K2=o0,i0=B.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}));i0.displayName=gi.displayName;const hu=B.forwardRef(({className:r,children:o,...a},s)=>P.jsxs(K2,{children:[P.jsx(i0,{}),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(a0,{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(sA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hu.displayName=vi.displayName;const Au=({className:r,...o})=>P.jsx("div",{className:Ge("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});Au.displayName="DialogHeader";const pu=({className:r,...o})=>P.jsx("div",{className:Ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});pu.displayName="DialogFooter";const mu=B.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ge("text-lg font-semibold leading-none tracking-tight",r),...o}));mu.displayName=yi.displayName;const Y2=B.forwardRef(({className:r,...o},a)=>P.jsx(xi,{ref:a,className:Ge("text-sm text-muted-foreground",r),...o}));Y2.displayName=xi.displayName;function Mh(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?Ca(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=C=>{const{scope:y,children:E}=C,_=Ae.useRef(null),w=Ae.useRef(new Map).current;return P.jsx(c,{scope:y,itemMap:w,collectionRef:_,children:E})};A.displayName=o;const u=r+"CollectionSlot",f=Mh(u),h=Ae.forwardRef((C,y)=>{const{scope:E,children:_}=C,w=l(u,E),S=vr(y,w.collectionRef);return P.jsx(f,{ref:S,children:_})});h.displayName=u;const m=r+"CollectionItemSlot",p="data-radix-collection-item",v=Mh(m),b=Ae.forwardRef((C,y)=>{const{scope:E,children:_,...w}=C,S=Ae.useRef(null),R=vr(y,S),N=l(m,E);return Ae.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),P.jsx(v,{[p]:"",ref:R,children:_})});b.displayName=m;function x(C){const y=l(r+"CollectionConsumer",C);return Ae.useCallback(()=>{const _=y.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((N,j)=>w.indexOf(N.ref.current)-w.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 b={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&&(b.segments=A),b}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=_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=Ot(),s=class{static decode(c,l){try{if(c.length<4){const x={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&&(x.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)}]),x}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 b={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&&(b.segments=A),b}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=_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=Ot(),s=class{static decode(c,l){try{if(c.length<35){const x={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&&(x.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)}]),x}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 b={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&&(b.segments=A),b}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=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=_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=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=_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=Ot(),s=class{static decode(c,l){try{if(c.length<4){const x={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&&(x.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)}]),x}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 b={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 ko(a,o)}countNamesForLength(o){return wa(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,b=0;if(m){const R=new Uint8Array(l.length/2);for(let O=0;O<R.length;O++)R[O]=parseInt(l.substr(O*2,2),16);v=R.length*8;const N=Math.ceil(R.length/4)*4,j=new Uint8Array(N);j.set(R),p=new Uint32Array(N/4);for(let O=0;O<p.length;O++)p[O]=j[O*4]<<24|j[O*4+1]<<16|j[O*4+2]<<8|j[O*4+3];const D=parseInt(A.substr(0,2),16),H=parseInt(A.substr(2,2),16);b=D<<24|H<<16}else p=new Uint32Array([0]);const x=Math.max(p.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<x)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:x,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=x,this.bindGroupDirty=!0);const C=new Uint32Array([o,s,a,c,b,p.length,v,m]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,p),this.device.queue.writeBuffer(this.matchCountBuffer,0,ip.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(),E=y.beginComputePass();E.setPipeline(this.pipeline),E.setBindGroup(0,this.bindGroup),E.dispatchWorkgroups(Math.ceil(c/(256*16))),E.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 S=[];if(w>0){await h.mapAsync(GPUMapMode.READ);const R=new Uint32Array(h.getMappedRange());for(let N=0;N<Math.min(w,1024);N++)S.push(R[N]);h.unmap()}return S}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}};sp.ZERO_DATA=new Uint32Array([0]);var V4=sp;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(eA)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter(eA)}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 Xh.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,b=0;if(o!=null&&o.startFrom){const N=F4(o.startFrom);N&&(v=N.length,b=N.index+1,b>=wa(v)&&(v++,b=0))}let x=0;for(let N=v;N<=s;N++)x+=wa(N);x-=b;const C=(N,j,D)=>{if(!a)return;const O=(performance.now()-h)/1e3,I=O>0?Math.round(m/O):0,V=x-m,G=I>0?V/I:0;a({checked:m,total:x,percent:x>0?Math.min(100,m/x*100):0,rateKeysPerSec:I,etaSeconds:G,elapsedSeconds:O,currentLength:j,currentPosition:D,phase:N})},y=N=>{if(!H4(A,u,N))return{valid:!1};const j=Xh.ChannelCrypto.decryptGroupTextMessage(A,u,N);return!j.success||!j.data?{valid:!1}:this.useTimestampFilter&&!L4(j.data.timestamp)?{valid:!1}:this.useUtf8Filter&&!z4(j.data.message)?{valid:!1}:{valid:!0,message:j.data.message}};if(v===1&&b===0){C("public-key",0,nu);const N=$h(li);if(l===N){const j=y(li);if(j.valid)return{found:!0,roomName:nu,key:li,decryptedMessage:j.message}}}if(this.wordlist.length>0&&v===1&&b===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],D=Jh("#"+j),H=$h(D);if(parseInt(H,16)===f){const I=y(D);if(I.valid)return{found:!0,roomName:j,key:D,decryptedMessage:I.message}}const O=performance.now();O-p>=200&&(C("wordlist",j.length,j),p=O,await new Promise(I=>setTimeout(I,0)))}const E=32768,_=1e3;let w=E,S=!1;for(let N=v;N<=s;N++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:ko(N,0)||void 0};const j=wa(N);let D=N===v?b:0;for(;D<j;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:ko(N,D)||void 0};const H=Math.min(w,j-D),O=performance.now(),I=await this.gpuInstance.runBatch(f,N,D,H,A,u),V=performance.now()-O;if(m+=H,!S&&H>=E&&V>0){const ee=_/V,ae=Math.round(H*ee),$=Math.pow(2,Math.round(Math.log2(Math.max(E,ae))));w=Math.max(E,$),S=!0}for(const ee of I){const ae=ko(N,ee);if(!ae)continue;const $=Jh("#"+ae),ne=y($);if(ne.valid)return{found:!0,roomName:ae,key:$,decryptedMessage:ne.message}}D+=H;const G=performance.now();if(G-p>=200){const ee=ko(N,Math.min(D,j-1))||"";C("bruteforce",N,ee),p=G,await new Promise(ae=>setTimeout(ae,0))}}}return{found:!1,resumeFrom:ko(s,wa(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 Wc,tA;function K4(){return tA||(tA=1,Wc={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 Qc=c,Qc}var Z4=Y4();const X4=ou(Z4);function J4({packets:r,channels:o,onChannelCreate:a,onRunningChange:s}){const[c,l]=B.useState(!1),[A,u]=B.useState(6),[f,h]=B.useState(!1),[m,p]=B.useState(null),[v,b]=B.useState(new Map),[x,C]=B.useState([]),[y,E]=B.useState(!1),[_,w]=B.useState(null),S=B.useRef(null),R=B.useRef(null),N=B.useRef(!1),j=B.useRef(!1),D=B.useRef(!1),H=B.useRef(new Map),O=B.useRef(!1),I=B.useRef(6);B.useEffect(()=>{const Y=new q4;S.current=Y,w(Y.isGpuAvailable());const k=new X4;return R.current=k,Y.loadWordlist("/words_alpha.txt").then(()=>E(!0)).catch(F=>console.error("Failed to load wordlist:",F)),()=>{Y.destroy(),S.current=null,k.disable(),R.current=null}},[]);const V=new Set(o.map(Y=>Y.key.toUpperCase())),G=r.filter(Y=>Y.payload_type==="GROUP_TEXT"&&!Y.decrypted);B.useEffect(()=>{b(Y=>{const k=new Map(Y);let F=!1;for(const z of G)k.has(z.id)||(k.set(z.id,{packet:z,attempts:0,lastAttemptLength:0,status:"pending"}),F=!0);return F?(H.current=k,k):Y})},[G.length]),B.useEffect(()=>{H.current=v},[v]),B.useEffect(()=>{O.current=f},[f]),B.useEffect(()=>{I.current=A},[A]),B.useEffect(()=>{s==null||s(c)},[c,s]);const ee=Array.from(v.values()).filter(Y=>Y.status==="pending").length,ae=Array.from(v.values()).filter(Y=>Y.status==="cracked").length,$=Array.from(v.values()).filter(Y=>Y.status==="failed").length,ne=B.useCallback(async()=>{if(D.current||!S.current||!N.current)return;const Y=H.current;let k=null,F=null;for(const[oe,ue]of Y.entries())if(ue.status==="pending"){k=ue,F=oe;break}if(!k&&O.current){const oe=Array.from(Y.entries()).filter(([,ue])=>ue.status==="failed"&&ue.lastAttemptLength<10);oe.length>0&&(oe.sort((ue,de)=>ue[1].lastAttemptLength-de[1].lastAttemptLength),[F,k]=oe[0])}if(!k||F===null){N.current&&setTimeout(()=>ne(),1e3);return}D.current=!0;const z=I.current,W=k.lastAttemptLength>0?k.lastAttemptLength+1:z;try{const oe=await S.current.crack(k.packet.data,{maxLength:W,useTimestampFilter:!0,useUtf8Filter:!0},ue=>{p(ue)});if(j.current){j.current=!1,D.current=!1,p(null);return}if(oe.found&&oe.roomName&&oe.key){b(te=>{const Ee=new Map(te),Ie=Ee.get(F);return Ie&&Ee.set(F,{...Ie,status:"cracked",attempts:Ie.attempts+1,lastAttemptLength:W}),Ee});const ue={roomName:oe.roomName,key:oe.key,packetId:F,message:oe.decryptedMessage||"",crackedAt:Date.now()};C(te=>[...te,ue]);const de=oe.key.toUpperCase();if(!V.has(de))try{await a("#"+oe.roomName,oe.key)}catch(te){console.error("Failed to create channel:",te)}}else b(ue=>{const de=new Map(ue),te=de.get(F);return te&&de.set(F,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:W}),de})}catch(oe){console.error("Cracking error:",oe),b(ue=>{const de=new Map(ue),te=de.get(F);return te&&de.set(F,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:W}),de})}D.current=!1,p(null),N.current&&setTimeout(()=>ne(),100)},[V,a]),Q=()=>{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=R.current)==null||Y.enable(),ne()},se=()=>{var Y,k;l(!1),N.current=!1,j.current=!0,(Y=S.current)==null||Y.abort(),(k=R.current)==null||k.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?se:Q,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:ee})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",P.jsx("span",{className:"text-green-500 font-medium",children:ae})]}),P.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",P.jsx("span",{className:"text-destructive font-medium",children:$})]})]}),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==="word
Line truncated
|
||||
-542
@@ -1,542 +0,0 @@
|
||||
function a1(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 ou(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ic={exports:{}},da={},lc={exports:{}},He={};/**
|
||||
* @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 th;function s1(){if(th)return He;th=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(_){return _===null||typeof _!="object"?null:(_=p&&_[p]||_["@@iterator"],typeof _=="function"?_:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function y(_,F,z){this.props=_,this.context=F,this.refs=C,this.updater=z||b}y.prototype.isReactComponent={},y.prototype.setState=function(_,F){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,F,"setState")},y.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function E(){}E.prototype=y.prototype;function k(_,F,z){this.props=_,this.context=F,this.refs=C,this.updater=z||b}var w=k.prototype=new E;w.constructor=k,x(w,y.prototype),w.isPureReactComponent=!0;var S=Array.isArray,B=Object.prototype.hasOwnProperty,N={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function D(_,F,z){var W,ne={},ue=null,de=null;if(F!=null)for(W in F.ref!==void 0&&(de=F.ref),F.key!==void 0&&(ue=""+F.key),F)B.call(F,W)&&!j.hasOwnProperty(W)&&(ne[W]=F[W]);var te=arguments.length-2;if(te===1)ne.children=z;else if(1<te){for(var Se=Array(te),je=0;je<te;je++)Se[je]=arguments[je+2];ne.children=Se}if(_&&_.defaultProps)for(W in te=_.defaultProps,te)ne[W]===void 0&&(ne[W]=te[W]);return{$$typeof:r,type:_,key:ue,ref:de,props:ne,_owner:N.current}}function L(_,F){return{$$typeof:r,type:_.type,key:F,ref:_.ref,props:_.props,_owner:_._owner}}function O(_){return typeof _=="object"&&_!==null&&_.$$typeof===r}function I(_){var F={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(z){return F[z]})}var V=/\/+/g;function G(_,F){return typeof _=="object"&&_!==null&&_.key!=null?I(""+_.key):F.toString(36)}function ee(_,F,z,W,ne){var ue=typeof _;(ue==="undefined"||ue==="boolean")&&(_=null);var de=!1;if(_===null)de=!0;else switch(ue){case"string":case"number":de=!0;break;case"object":switch(_.$$typeof){case r:case o:de=!0}}if(de)return de=_,ne=ne(de),_=W===""?"."+G(de,0):W,S(ne)?(z="",_!=null&&(z=_.replace(V,"$&/")+"/"),ee(ne,F,z,"",function(je){return je})):ne!=null&&(O(ne)&&(ne=L(ne,z+(!ne.key||de&&de.key===ne.key?"":(""+ne.key).replace(V,"$&/")+"/")+_)),F.push(ne)),1;if(de=0,W=W===""?".":W+":",S(_))for(var te=0;te<_.length;te++){ue=_[te];var Se=W+G(ue,te);de+=ee(ue,F,z,Se,ne)}else if(Se=v(_),typeof Se=="function")for(_=Se.call(_),te=0;!(ue=_.next()).done;)ue=ue.value,Se=W+G(ue,te++),de+=ee(ue,F,z,Se,ne);else if(ue==="object")throw F=String(_),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return de}function oe(_,F,z){if(_==null)return _;var W=[],ne=0;return ee(_,W,"","",function(ue){return F.call(z,ue,ne++)}),W}function $(_){if(_._status===-1){var F=_._result;F=F(),F.then(function(z){(_._status===0||_._status===-1)&&(_._status=1,_._result=z)},function(z){(_._status===0||_._status===-1)&&(_._status=2,_._result=z)}),_._status===-1&&(_._status=0,_._result=F)}if(_._status===1)return _._result.default;throw _._result}var re={current:null},Q={transition:null},ae={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:Q,ReactCurrentOwner:N};function K(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:oe,forEach:function(_,F,z){oe(_,function(){F.apply(this,arguments)},z)},count:function(_){var F=0;return oe(_,function(){F++}),F},toArray:function(_){return oe(_,function(F){return F})||[]},only:function(_){if(!O(_))throw Error("React.Children.only expected to receive a single React element child.");return _}},He.Component=y,He.Fragment=a,He.Profiler=c,He.PureComponent=k,He.StrictMode=s,He.Suspense=f,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,He.act=K,He.cloneElement=function(_,F,z){if(_==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+_+".");var W=x({},_.props),ne=_.key,ue=_.ref,de=_._owner;if(F!=null){if(F.ref!==void 0&&(ue=F.ref,de=N.current),F.key!==void 0&&(ne=""+F.key),_.type&&_.type.defaultProps)var te=_.type.defaultProps;for(Se in F)B.call(F,Se)&&!j.hasOwnProperty(Se)&&(W[Se]=F[Se]===void 0&&te!==void 0?te[Se]:F[Se])}var Se=arguments.length-2;if(Se===1)W.children=z;else if(1<Se){te=Array(Se);for(var je=0;je<Se;je++)te[je]=arguments[je+2];W.children=te}return{$$typeof:r,type:_.type,key:ne,ref:ue,props:W,_owner:de}},He.createCLine 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 nh;function i1(){if(nh)return da;nh=1;var r=au(),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,b=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(b=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:b,props:p,_owner:c.current}}return da.Fragment=a,da.jsx=A,da.jsxs=A,da}var oh;function l1(){return oh||(oh=1,ic.exports=i1()),ic.exports}var P=l1(),R=au();const Ae=ou(R),su=a1({__proto__:null,default:Ae},[R]);var Is={},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 ah;function c1(){return ah||(ah=1,(function(r){function o(Q,ae){var K=Q.length;Q.push(ae);e:for(;0<K;){var _=K-1>>>1,F=Q[_];if(0<c(F,ae))Q[_]=ae,Q[K]=F,K=_;else break e}}function a(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var ae=Q[0],K=Q.pop();if(K!==ae){Q[0]=K;e:for(var _=0,F=Q.length,z=F>>>1;_<z;){var W=2*(_+1)-1,ne=Q[W],ue=W+1,de=Q[ue];if(0>c(ne,K))ue<F&&0>c(de,ne)?(Q[_]=de,Q[ue]=K,_=ue):(Q[_]=ne,Q[W]=K,_=W);else if(ue<F&&0>c(de,K))Q[_]=de,Q[ue]=K,_=ue;else break e}}return ae}function c(Q,ae){var K=Q.sortIndex-ae.sortIndex;return K!==0?K:Q.id-ae.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,b=!1,x=!1,C=!1,y=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(Q){for(var ae=a(h);ae!==null;){if(ae.callback===null)s(h);else if(ae.startTime<=Q)s(h),ae.sortIndex=ae.expirationTime,o(f,ae);else break;ae=a(h)}}function S(Q){if(C=!1,w(Q),!x)if(a(f)!==null)x=!0,$(B);else{var ae=a(h);ae!==null&&re(S,ae.startTime-Q)}}function B(Q,ae){x=!1,C&&(C=!1,E(D),D=-1),b=!0;var K=v;try{for(w(ae),p=a(f);p!==null&&(!(p.expirationTime>ae)||Q&&!I());){var _=p.callback;if(typeof _=="function"){p.callback=null,v=p.priorityLevel;var F=_(p.expirationTime<=ae);ae=r.unstable_now(),typeof F=="function"?p.callback=F:p===a(f)&&s(f),w(ae)}else s(f);p=a(f)}if(p!==null)var z=!0;else{var W=a(h);W!==null&&re(S,W.startTime-ae),z=!1}return z}finally{p=null,v=K,b=!1}}var N=!1,j=null,D=-1,L=5,O=-1;function I(){return!(r.unstable_now()-O<L)}function V(){if(j!==null){var Q=r.unstable_now();O=Q;var ae=!0;try{ae=j(!0,Q)}finally{ae?G():(N=!1,j=null)}}else N=!1}var G;if(typeof k=="function")G=function(){k(V)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,oe=ee.port2;ee.port1.onmessage=V,G=function(){oe.postMessage(null)}}else G=function(){y(V,0)};function $(Q){j=Q,N||(N=!0,G())}function re(Q,ae){D=y(function(){Q(r.unstable_now())},ae)}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(Q){Q.callback=null},r.unstable_continueExecution=function(){x||b||(x=!0,$(B))},r.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<Q?Math.floor(1e3/Q):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return a(f)},r.unstable_next=function(Q){switch(v){case 1:case 2:case 3:var ae=3;break;default:ae=v}var K=v;v=ae;try{return Q()}finally{v=K}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(Q,ae){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var K=v;v=Q;try{return ae()}finally{v=K}},r.unstable_scheduleCallback=function(Q,ae,K){var _=r.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?_+K:_):K=_,Q){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=K+F,Q={id:m++,callback:ae,priorityLevel:Q,startTime:K,expirationTime:F,sortIndex:-1},K>_?(Q.sortIndex=K,o(h,Q),a(f)===null&&Q===a(h)&&(C?(E(D),D=-1):C=!0,re(S,K-_))):(Q.sortIndex=F,o(f,Q),x||b||(x=!0,$(B))),Q},r.unstable_shouldYield=I,r.unstable_wrapCallback=function(Q){var ae=v;return function(){var K=v;v=ae;try{return Q.apply(this,arguments)}finally{v=K}}}})(dc)),dc}var sh;function u1(){return sh||(sh=1,uc.exports=c1()),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 ih;function d1(){if(ih)return rr;ih=1;var r=au(),o=u1();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 b(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 x(e,t,n,i){if(t===null||typeof t>"u"||b(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 C(e,t,n,i,d,g,T){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=T}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new C(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 C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){y[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function k(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(E,k);y[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(E,k);y[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(E,k);y[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new C(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
|
||||
`+_+e}var z=!1;function W(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(`
|
||||
`),T=d.length-1,M=g.length-1;1<=T&&0<=M&&d[T]!==g[M];)M--;for(;1<=T&&0<=M;T--,M--)if(d[T]!==g[M]){if(T!==1||M!==1)do if(T--,M--,0>M||d[T]!==g[M]){var H=`
|
||||
`+d[T].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=T&&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=W(e.type,!1),e;case 11:return e=W(e.type.render,!1),e;case 1:return e=W(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 D:return"StrictMode";case G:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case I:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case V: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 $: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===D?"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 Se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function je(e){var t=Se(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(T){i=""+T,g.call(this,T)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ot(e){e._valueTracker||(e._valueTracker=je(e))}function at(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Se(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function it(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 Ye(e,t){var n=t.checked;return K({},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&&w(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")?ut(e,t.type,n):t.hasOwnProperty("defaultValue")&&ut(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 ut(e,t,n){(t!=="number"||it(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dt=Array.isArray;function et(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 Ue(e,t){if(t.dangerouslySetInnerHTML!
Line truncated
|
||||
`).replace(vm,"")}function Ka(e,t,n){if(t=yd(t),yd(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,ym=typeof clearTimeout=="function"?clearTimeout:void 0,xd=typeof Promise=="function"?Promise:void 0,xm=typeof queueMicrotask=="function"?queueMicrotask:typeof xd<"u"?function(e){return xd.resolve(null).then(e).catch(wm)}:tl;function wm(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 sn(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 wd(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,bm="__reactListeners$"+Jn,_m="__reactHandles$"+Jn;function En(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=wd(e);e!==null;){if(n=e[Dr])return n;e=wd(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 ln(e){return{current:e}}function nt(e){0>eo||(e.current=ol[eo],ol[eo]=null,eo--)}function Xe(e,t){eo++,ol[eo]=e.current,e.current=t}var cn={},Lt=ln(cn),Xt=ln(!1),Tn=cn;function to(e,t){var n=e.type.contextTypes;if(!n)return cn;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(){nt(Xt),nt(Lt)}function bd(e,t,n){if(Lt.current!==cn)throw Error(a(168));Xe(Lt,t),Xe(Xt,n)}function _d(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 K({},n,i)}function Ja(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cn,Tn=Lt.current,Xe(Lt,e),Xe(Xt,Xt.current),!0}function kd(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=_d(e,t,Tn),i.__reactInternalMemoizedMergedChildContext=e,nt(Xt),nt(Lt),Xe(Lt,e)):nt(Xt),Xe(Xt,n)}var Wr=null,$a=!1,al=!1;function Cd(e){Wr===null?Wr=[e]:Wr.push(e)}function km(e){$a=!0,Cd(e)}function un(){if(!al&&Wr!==null){al=!0;var e=0,t=Ke;try{var n=Wr;for(Ke=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)),Eu(Ei,un),d}finally{Ke=t,al=!1}}return null}var ro=[],no=0,es=null,ts=0,fr=[],hr=0,Bn=null,Qr=1,Gr="";function Rn(e,t){ro[no++]=ts,ro[no++]=es,es=e,ts=t}function Sd(e,t,n){fr[hr++]=Qr,fr[hr++]=Gr,fr[hr++]=Bn,Bn=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 T=d-d%5;g=(i&(1<<T)-1).toString(32),i>>=T,d-=T,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),Sd(e,1,0))}function il(e){for(;e===es;)es=ro[--no],ro[no]=null,ts=ro[--no],ro[no]=null;for(;e===Bn;)Bn=fr[--hr],fr[hr]=null,Gr=fr[--hr],fr[hr]=null,Qr=fr[--hr],fr[hr]=null}var ir=null,lr=null,st=!1,kr=null;function Ed(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 Td(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=sn(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=Bn!==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(st){var t=lr;if(t){var n=t;if(!Td(e,t)){if(ll(e))throw Error(a(418));t=sn(n.nextSibling);var i=ir;t&&Td(e,t)?Ed(i,n):(e.flags=e.flags&-4097|2,st=!1,ir=e)}}else{if(ll(e))throw Error(a(418));e.flags=e.flags&-4097|2,st=!1,ir=e}}}function Bd(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 Dm=typeof WeakMap=="function"?WeakMap:Map;function uf(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 df(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"&&(An===null?An=new Set([this]):An.add(this));var T=t.stack;this.componentDidCatch(t.value,{componentStack:T!==null?T:""})}),n}function ff(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Dm;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=qm.bind(null,e,t,n),t.then(e,e))}function hf(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 Af(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,fn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var jm=S.ReactCurrentOwner,$t=!1;function Qt(e,t,n,i){t.child=e===null?Dd(t,null,n,i):ao(t,e.child,n,i)}function pf(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&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(st&&n&&sl(t),t.flags|=1,Qt(e,t,i,d),t.child)}function mf(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,gf(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 T=g.memoizedProps;if(n=n.compare,n=n!==null?n:Wo,n(T,i)&&e.ref===t.ref)return Yr(e,t,d)}return t.flags|=1,e=vn(g,i),e.ref=t.ref,e.return=t,t.child=e}function gf(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 vf(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},Xe(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,Xe(fo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=g!==null?g.baseLanes:n,Xe(fo,cr),cr|=i}else g!==null?(i=g.baseLanes|n,t.memoizedState=null):i=n,Xe(fo,cr),cr|=i;return Qt(e,t,d,n),t.child}function yf(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)?Tn:Lt.current;return g=to(t,g),io(t,d),n=_l(e,t,n,i,g,d),i=kl(),e!==null&&!$t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Yr(e,t,d)):(st&&i&&sl(t),t.flags|=1,Qt(e,t,n,d),t.child)}function xf(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),lf(t,n,i),Rl(t,n,i,d),i=!0;else if(e===null){var T=t.stateNode,M=t.memoizedProps;T.props=M;var H=T.context,Z=n.contextType;typeof Z=="object"&&Z!==null?Z=Ar(Z):(Z=Jt(n)?Tn:Lt.current,Z=to(t,Z));var le=n.getDerivedStateFromProps,ce=typeof le=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==i||H!==Z)&&cf(t,T,i,Z),dn=!1;var se=t.memoizedState;T.state=se,is(t,i,T,d),H=t.memoizedState,M!==i||se!==H||Xt.current||dn?(typeof le=="function"&&(Bl(t,n,le,i),H=t.memoizedState),(M=dn||sf(t,n,M,i,se,H,Z))?(ce||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(t.flags|=4194308)):(typeof T.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),T.props=i,T.state=H,T.context=Z,i=M):(typeof T.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{T=t.stateNode,Id(e,t),M=t.memoizedProps,Z=t.type===t.elementType?M:Cr(t.type,M),T.props=Z,ce=t.pendingProps,se=T.context,H=n.contextType,typeof H=="object"&&H!==null?H=Ar(H):(H=Jt(n)?Tn:Lt.current,H=to(t,H));var me=n.getDerivedStateFromProps;(le=typeof me=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(M!==ce||se!==H)&&cf(t,T,i,H),dn=!1,se=t.memoizedState,T
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 m1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),g1=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,a,s)=>s?s.toUpperCase():a.toLowerCase()),uh=r=>{const o=g1(r);return o.charAt(0).toUpperCase()+o.slice(1)},aA=(...r)=>r.filter((o,a,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===a).join(" ").trim(),v1=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 y1={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 x1=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,...y1,width:o,height:o,stroke:r,strokeWidth:s?Number(a)*24/Number(o):a,className:aA("lucide",c),...!l&&!v1(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 iu=(r,o)=>{const a=R.forwardRef(({className:s,...c},l)=>R.createElement(x1,{ref:l,iconNode:o,className:aA(`lucide-${m1(uh(r))}`,`lucide-${r}`,s),...c}));return a.displayName=uh(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 w1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b1=iu("check",w1);/**
|
||||
* @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 _1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],k1=iu("menu",_1);/**
|
||||
* @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"}]],sA=iu("x",C1);var iA=oA();const lA=ou(iA);function S1(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 E1=r=>{switch(r){case"success":return R1;case"info":return N1;case"warning":return P1;case"error":return D1;default:return null}},T1=Array(12).fill(0),B1=({visible:r,className:o})=>Ae.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},Ae.createElement("div",{className:"sonner-spinner"},T1.map((a,s)=>Ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),R1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.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"})),P1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ae.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"})),N1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.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"})),D1=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.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"})),j1=Ae.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"},Ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I1=()=>{const[r,o]=Ae.useState(document.hidden);return Ae.useEffect(()=>{const a=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),r};let Gc=1;class M1{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:Gc++,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],Ae.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(F1(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,x=typeof p=="object"&&!Ae.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...x})}else if(h instanceof Error){l=!1;const p=typeof a.error=="function"?await a.error(h):a.error,Line truncated
|
||||
`).map((ae,K,_)=>P.jsxs("span",{children:[ae,K<_.length-1&&P.jsx("br",{})]},K)),!ee&&P.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:_h(S.sender_timestamp||S.received_at)}),S.outgoing&&(S.acked?" ✓":" ?")]})]})]},S.id)})]}),m&&P.jsx("button",{onClick:x,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:P.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}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 b;A(x=>x+v),(b=h.current)==null||b.focus()}}));const m=R.useCallback(async v=>{v.preventDefault();const b=l.trim();if(!(!b||u||a)){f(!0);try{await o(b),A("")}catch(x){console.error("Failed to send message:",x)}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 E;const{scope:v,children:b,...x}=p,C=((E=v==null?void 0:v[r])==null?void 0:E[f])||u,y=R.useMemo(()=>x,Object.values(x));return P.jsx(C.Provider,{value:y,children:b})};h.displayName=l+"Provider";function m(p,v){var C;const b=((C=v==null?void 0:v[r])==null?void 0:C[f])||u,x=R.useContext(b);if(x)return x;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=su[" 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=su[" 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}.Slo
Line 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;
|
||||
}
|
||||
`)},Nh=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,(Nh()+1).toString()),function(){var r=Nh()-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")})},Jc=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Jc=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Jc=!1}var mo=Jc?{passive:!1}:!1,p2=function(r){return r.tagName==="TEXTAREA"},OA=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 OA(r,"overflowY")},g2=function(r){return OA(r,"overflowX")},Dh=function(r,o){var a=o.ownerDocument,s=o;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=FA(r,s);if(c){var l=LA(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]},FA=function(r,o){return r==="v"?m2(o):g2(o)},LA=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 b=LA(r,u),x=b[0],C=b[1],y=b[2],E=C-y-l*x;(x||E)&&FA(r,u)&&(p+=E,v+=x);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}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]},jh=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;}
|
||||
`)},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(MA)[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 C=Gv([r.lockRef.current],(r.shards||[]).map(Ih),!0).filter(Boolean);return C.forEach(function(y){return y.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var u=R.useCallback(function(C,y){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!A.current.allowPinchZoom;var E=zs(C),k=a.current,w="deltaX"in C?C.deltaX:k[0]-E[0],S="deltaY"in C?C.deltaY:k[1]-E[1],B,N=C.target,j=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in C&&j==="h"&&N.type==="range")return!1;var D=window.getSelection(),L=D&&D.anchorNode,O=L?L===N||L.contains(N):!1;if(O)return!1;var I=Dh(j,N);if(!I)return!0;if(I?B=j:(B=j==="v"?"h":"v",I=Dh(j,N)),!I)return!1;if(!s.current&&"changedTouches"in C&&(w||S)&&(s.current=B),!B)return!0;var V=s.current||B;return w2(V,y,C,V==="h"?w:S)},[]),f=R.useCallback(function(C){var y=C;if(!(!go.length||go[go.length-1]!==l)){var E="deltaY"in y?jh(y):zs(y),k=o.current.filter(function(B){return B.name===y.type&&(B.target===y.target||y.target===B.shadowParent)&&b2(B.delta,E)})[0];if(k&&k.should){y.cancelable&&y.preventDefault();return}if(!k){var w=(A.current.shards||[]).map(Ih).filter(Boolean).filter(function(B){return B.contains(y.target)}),S=w.length>0?u(y,w[0]):!A.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),h=R.useCallback(function(C,y,E,k){var w={name:C,delta:y,target:E,should:k,shadowParent:S2(E)};o.current.push(w),setTimeout(function(){o.current=o.current.filter(function(S){return S!==w})},1)},[]),m=R.useCallback(function(C){a.current=zs(C),s.current=void 0},[]),p=R.useCallback(function(C){h(C.type,jh(C),C.target,u(C,r.lockRef.current))},[]),v=R.useCallback(function(C){h(C.type,zs(C),C.target,u(C,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(C){return C!==l}),document.removeEventListener("wheel",f,mo),document.removeEventListener("touchmove",f,mo),document.removeEventListener("touchstart",m,mo)}},[]);var b=r.removeScrollBar,x=r.inert;return R.createElement(R.Fragment,null,x?R.createElement(l,{styles:_2(c)}):null,b?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(IA,C2);var HA=R.forwardRef(function(r,o){return R.createElement(pi,zr({},r,{ref:o,sideCar:E2}))});HA.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={},bc=0,zA=function(r){return r&&(r.host||zA(r.parentNode))},B2=function(r,o){return o.map(function(a){if(r.contains(a))return a;var s=zA(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})},R2=function(r,o,a,s){var c=B2(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 b=v.getAttribute(s),x=b!==null&&b!=="false",C=(vo.get(v)||0)+1,y=(l.get(v)||0)+1;vo.set(v,C),l.set(v,y),A.push(v),C===1&&x&&Vs.set(v,!0),y===1&&v.setAttribute(a,"true"),x||v.setAttribute(s,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return m(o),u.clear(),bc++,function(){A.forEach(function(p){var v=vo.get(p)-1,b=l.get(p)-1;vo.set(p,v),l.set(p,b),v||(Vs.has(p)||p.removeAttribute(s),Vs.delete(p)),b||p.removeAttribute(a)}),bc--,bc||(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"))),R2(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 {${r0(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},n0=UA,o0=GA,gi=qA,vi=KA,yi=ZA,xi=JA,a0=e0;const s0=n0,K2=o0,i0=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}));i0.displayName=gi.displayName;const hu=R.forwardRef(({className:r,children:o,...a},s)=>P.jsxs(K2,{children:[P.jsx(i0,{}),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(a0,{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(sA,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hu.displayName=vi.displayName;const Au=({className:r,...o})=>P.jsx("div",{className:Ge("flex flex-col space-y-1.5 text-center sm:text-left",r),...o});Au.displayName="DialogHeader";const pu=({className:r,...o})=>P.jsx("div",{className:Ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...o});pu.displayName="DialogFooter";const mu=R.forwardRef(({className:r,...o},a)=>P.jsx(yi,{ref:a,className:Ge("text-lg font-semibold leading-none tracking-tight",r),...o}));mu.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 Mh(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=C=>{const{scope:y,children:E}=C,k=Ae.useRef(null),w=Ae.useRef(new Map).current;return P.jsx(c,{scope:y,itemMap:w,collectionRef:k,children:E})};A.displayName=o;const u=r+"CollectionSlot",f=Mh(u),h=Ae.forwardRef((C,y)=>{const{scope:E,children:k}=C,w=l(u,E),S=vr(y,w.collectionRef);return P.jsx(f,{ref:S,children:k})});h.displayName=u;const m=r+"CollectionItemSlot",p="data-radix-collection-item",v=Mh(m),b=Ae.forwardRef((C,y)=>{const{scope:E,children:k,...w}=C,S=Ae.useRef(null),B=vr(y,S),N=l(m,E);return Ae.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),P.jsx(v,{[p]:"",ref:B,children:k})});b.displayName=m;function x(C){const y=l(r+"CollectionConsumer",C);return Ae.useCallback(()=>{const k=y.collectionRef.current;if(!k)return[];const w=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((N,j)=>w.indexOf(N.ref.current)-w.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 b={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&&(b.segments=A),b}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=_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=Ot(),s=class{static decode(c,l){try{if(c.length<4){const x={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&&(x.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)}]),x}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 b={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&&(b.segments=A),b}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}}),B4=_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=Ot(),s=class{static decode(c,l){try{if(c.length<35){const x={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&&(x.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)}]),x}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 b={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&&(b.segments=A),b}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}}),R4=_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=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=_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=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=_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=Ot(),s=class{static decode(c,l){try{if(c.length<4){const x={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&&(x.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)}]),x}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 b={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,b=0;if(m){const B=new Uint8Array(l.length/2);for(let O=0;O<B.length;O++)B[O]=parseInt(l.substr(O*2,2),16);v=B.length*8;const N=Math.ceil(B.length/4)*4,j=new Uint8Array(N);j.set(B),p=new Uint32Array(N/4);for(let O=0;O<p.length;O++)p[O]=j[O*4]<<24|j[O*4+1]<<16|j[O*4+2]<<8|j[O*4+3];const D=parseInt(A.substr(0,2),16),L=parseInt(A.substr(2,2),16);b=D<<24|L<<16}else p=new Uint32Array([0]);const x=Math.max(p.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<x)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:x,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=x,this.bindGroupDirty=!0);const C=new Uint32Array([o,s,a,c,b,p.length,v,m]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,p),this.device.queue.writeBuffer(this.matchCountBuffer,0,ip.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(),E=y.beginComputePass();E.setPipeline(this.pipeline),E.setBindGroup(0,this.bindGroup),E.dispatchWorkgroups(Math.ceil(c/(256*16))),E.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 S=[];if(w>0){await h.mapAsync(GPUMapMode.READ);const B=new Uint32Array(h.getMappedRange());for(let N=0;N<Math.min(w,1024);N++)S.push(B[N]);h.unmap()}return S}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}};sp.ZERO_DATA=new Uint32Array([0]);var V4=sp;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(eA)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter(eA)}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 Xh.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,b=0;if(o!=null&&o.startFrom){const N=F4(o.startFrom);N&&(v=N.length,b=N.index+1,b>=xa(v)&&(v++,b=0))}let x=0;for(let N=v;N<=s;N++)x+=xa(N);x-=b;const C=(N,j,D)=>{if(!a)return;const O=(performance.now()-h)/1e3,I=O>0?Math.round(m/O):0,V=x-m,G=I>0?V/I:0;a({checked:m,total:x,percent:x>0?Math.min(100,m/x*100):0,rateKeysPerSec:I,etaSeconds:G,elapsedSeconds:O,currentLength:j,currentPosition:D,phase:N})},y=N=>{if(!L4(A,u,N))return{valid:!1};const j=Xh.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&&b===0){C("public-key",0,nu);const N=$h(li);if(l===N){const j=y(li);if(j.valid)return{found:!0,roomName:nu,key:li,decryptedMessage:j.message}}}if(this.wordlist.length>0&&v===1&&b===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],D=Jh("#"+j),L=$h(D);if(parseInt(L,16)===f){const I=y(D);if(I.valid)return{found:!0,roomName:j,key:D,decryptedMessage:I.message}}const O=performance.now();O-p>=200&&(C("wordlist",j.length,j),p=O,await new Promise(I=>setTimeout(I,0)))}const E=32768,k=1e3;let w=E,S=!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 D=N===v?b:0;for(;D<j;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:bo(N,D)||void 0};const L=Math.min(w,j-D),O=performance.now(),I=await this.gpuInstance.runBatch(f,N,D,L,A,u),V=performance.now()-O;if(m+=L,!S&&L>=E&&V>0){const ee=k/V,oe=Math.round(L*ee),$=Math.pow(2,Math.round(Math.log2(Math.max(E,oe))));w=Math.max(E,$),S=!0}for(const ee of I){const oe=bo(N,ee);if(!oe)continue;const $=Jh("#"+oe),re=y($);if(re.valid)return{found:!0,roomName:oe,key:$,decryptedMessage:re.message}}D+=L;const G=performance.now();if(G-p>=200){const ee=bo(N,Math.min(D,j-1))||"";C("bruteforce",N,ee),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 Wc,tA;function K4(){return tA||(tA=1,Wc={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 Qc=c,Qc}var Z4=Y4();const X4=ou(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,b]=R.useState(new Map),[x,C]=R.useState([]),[y,E]=R.useState(!1),[k,w]=R.useState(null),S=R.useRef(null),B=R.useRef(null),N=R.useRef(!1),j=R.useRef(!1),D=R.useRef(!1),L=R.useRef(new Map),O=R.useRef(!1),I=R.useRef(6);R.useEffect(()=>{const K=new q4;S.current=K,w(K.isGpuAvailable());const _=new X4;return B.current=_,K.loadWordlist("/words_alpha.txt").then(()=>E(!0)).catch(F=>console.error("Failed to load wordlist:",F)),()=>{K.destroy(),S.current=null,_.disable(),B.current=null}},[]);const V=new Set(o.map(K=>K.key.toUpperCase())),G=r.filter(K=>K.payload_type==="GROUP_TEXT"&&!K.decrypted);R.useEffect(()=>{b(K=>{const _=new Map(K);let F=!1;for(const z of G)_.has(z.id)||(_.set(z.id,{packet:z,attempts:0,lastAttemptLength:0,status:"pending"}),F=!0);return F?(L.current=_,_):K})},[G.length]),R.useEffect(()=>{L.current=v},[v]),R.useEffect(()=>{O.current=f},[f]),R.useEffect(()=>{I.current=A},[A]),R.useEffect(()=>{s==null||s(c)},[c,s]);const ee=Array.from(v.values()).filter(K=>K.status==="pending").length,oe=Array.from(v.values()).filter(K=>K.status==="cracked").length,$=Array.from(v.values()).filter(K=>K.status==="failed").length,re=R.useCallback(async()=>{if(D.current||!S.current||!N.current)return;const K=L.current;let _=null,F=null;for(const[ne,ue]of K.entries())if(ue.status==="pending"){_=ue,F=ne;break}if(!_&&O.current){const ne=Array.from(K.entries()).filter(([,ue])=>ue.status==="failed"&&ue.lastAttemptLength<10);ne.length>0&&(ne.sort((ue,de)=>ue[1].lastAttemptLength-de[1].lastAttemptLength),[F,_]=ne[0])}if(!_||F===null){N.current&&setTimeout(()=>re(),1e3);return}D.current=!0;const z=I.current,W=_.lastAttemptLength>0?_.lastAttemptLength+1:z;try{const ne=await S.current.crack(_.packet.data,{maxLength:W,useTimestampFilter:!0,useUtf8Filter:!0},ue=>{p(ue)});if(j.current){j.current=!1,D.current=!1,p(null);return}if(ne.found&&ne.roomName&&ne.key){b(te=>{const Se=new Map(te),je=Se.get(F);return je&&Se.set(F,{...je,status:"cracked",attempts:je.attempts+1,lastAttemptLength:W}),Se});const ue={roomName:ne.roomName,key:ne.key,packetId:F,message:ne.decryptedMessage||"",crackedAt:Date.now()};C(te=>[...te,ue]);const de=ne.key.toUpperCase();if(!V.has(de))try{await a("#"+ne.roomName,ne.key)}catch(te){console.error("Failed to create channel:",te)}}else b(ue=>{const de=new Map(ue),te=de.get(F);return te&&de.set(F,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:W}),de})}catch(ne){console.error("Cracking error:",ne),b(ue=>{const de=new Map(ue),te=de.get(F);return te&&de.set(F,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:W}),de})}D.current=!1,p(null),N.current&&setTimeout(()=>re(),100)},[V,a]),Q=()=>{var K;if(!k){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}l(!0),N.current=!0,j.current=!1,(K=B.current)==null||K.enable(),re()},ae=()=>{var K,_;l(!1),N.current=!1,j.current=!0,(K=S.current)==null||K.abort(),(_=B.current)==null||_.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?ae:Q,disabled:!y||k===!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:K=>u(Math.min(10,Math.max(1,parseInt(K.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:K=>h(K.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:ee})]}),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:$})]})]}),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==="word
Line truncated
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
<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-D9RuHvp1.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-BDVBgoJZ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-RWG6EjFU.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+81
-3
@@ -41,6 +41,38 @@ function getMessageContentKey(msg: Message): string {
|
||||
return `${msg.type}-${msg.conversation_key}-${msg.text}-${msg.sender_timestamp}`;
|
||||
}
|
||||
|
||||
// Parse URL hash to get conversation (e.g., #channel/Public or #contact/JohnDoe or #raw)
|
||||
function parseHashConversation(): { type: 'channel' | 'contact' | 'raw'; name: string } | null {
|
||||
const hash = window.location.hash.slice(1); // Remove leading #
|
||||
if (!hash) return null;
|
||||
|
||||
if (hash === 'raw') {
|
||||
return { type: 'raw', name: 'raw' };
|
||||
}
|
||||
|
||||
const slashIndex = hash.indexOf('/');
|
||||
if (slashIndex === -1) return null;
|
||||
|
||||
const type = hash.slice(0, slashIndex);
|
||||
const name = decodeURIComponent(hash.slice(slashIndex + 1));
|
||||
|
||||
if ((type === 'channel' || type === 'contact') && name) {
|
||||
return { type, name };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Generate URL hash from conversation
|
||||
function getConversationHash(conv: Conversation | null): string {
|
||||
if (!conv) return '';
|
||||
if (conv.type === 'raw') return '#raw';
|
||||
// Strip leading # from channel names for cleaner URLs
|
||||
const name = conv.type === 'channel' && conv.name.startsWith('#')
|
||||
? conv.name.slice(1)
|
||||
: conv.name;
|
||||
return `#${conv.type}/${encodeURIComponent(name)}`;
|
||||
}
|
||||
|
||||
export function App() {
|
||||
const messageInputRef = useRef<MessageInputHandle>(null);
|
||||
const activeConversationRef = useRef<Conversation | null>(null);
|
||||
@@ -305,11 +337,49 @@ export function App() {
|
||||
fetchUndecryptedCount();
|
||||
}, [fetchConfig, fetchAppSettings, fetchUndecryptedCount]);
|
||||
|
||||
// Select Public channel by default when channels first load
|
||||
// Resolve URL hash to a conversation
|
||||
const resolveHashToConversation = useCallback((): Conversation | null => {
|
||||
const hashConv = parseHashConversation();
|
||||
if (!hashConv) return null;
|
||||
|
||||
if (hashConv.type === 'raw') {
|
||||
return { type: 'raw', id: 'raw', name: 'Raw Packet Feed' };
|
||||
}
|
||||
if (hashConv.type === 'channel') {
|
||||
// Match with or without leading # (URL strips it for cleaner URLs)
|
||||
const channel = channels.find(c => c.name === hashConv.name || c.name === `#${hashConv.name}`);
|
||||
if (channel) {
|
||||
return { type: 'channel', id: channel.key, name: channel.name };
|
||||
}
|
||||
}
|
||||
if (hashConv.type === 'contact') {
|
||||
const contact = contacts.find(c => getContactDisplayName(c.name, c.public_key) === hashConv.name);
|
||||
if (contact) {
|
||||
return {
|
||||
type: 'contact',
|
||||
id: contact.public_key,
|
||||
name: getContactDisplayName(contact.name, contact.public_key),
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}, [channels, contacts]);
|
||||
|
||||
// Set initial conversation from URL hash or default to Public channel
|
||||
const hasSetDefaultConversation = useRef(false);
|
||||
useEffect(() => {
|
||||
if (hasSetDefaultConversation.current || channels.length === 0 || activeConversation) return;
|
||||
if (hasSetDefaultConversation.current || activeConversation) return;
|
||||
if (channels.length === 0 && contacts.length === 0) return;
|
||||
|
||||
// Try to restore from URL hash first
|
||||
const conv = resolveHashToConversation();
|
||||
if (conv) {
|
||||
setActiveConversation(conv);
|
||||
hasSetDefaultConversation.current = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Fall back to Public channel
|
||||
const publicChannel = channels.find(c => c.name === 'Public');
|
||||
if (publicChannel) {
|
||||
setActiveConversation({
|
||||
@@ -319,7 +389,7 @@ export function App() {
|
||||
});
|
||||
hasSetDefaultConversation.current = true;
|
||||
}
|
||||
}, [channels, activeConversation]);
|
||||
}, [channels, contacts, activeConversation, resolveHashToConversation]);
|
||||
|
||||
// Fetch messages and count unreads for all conversations on load (single bulk request)
|
||||
const fetchedChannels = useRef<Set<string>>(new Set());
|
||||
@@ -427,6 +497,14 @@ export function App() {
|
||||
return prev;
|
||||
});
|
||||
}
|
||||
|
||||
// Update URL hash (replaceState doesn't add to history)
|
||||
if (activeConversation) {
|
||||
const newHash = getConversationHash(activeConversation);
|
||||
if (newHash !== window.location.hash) {
|
||||
window.history.replaceState(null, '', newHash);
|
||||
}
|
||||
}
|
||||
}, [activeConversation]);
|
||||
|
||||
// Fetch messages when conversation changes
|
||||
|
||||
+6
-6
@@ -22,7 +22,7 @@ class TestHealthEndpoint:
|
||||
from app.main import app
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.get("/health")
|
||||
response = client.get("/api/health")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -40,7 +40,7 @@ class TestHealthEndpoint:
|
||||
from app.main import app
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.get("/health")
|
||||
response = client.get("/api/health")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -63,7 +63,7 @@ class TestMessagesEndpoint:
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.post(
|
||||
"/messages/direct",
|
||||
"/api/messages/direct",
|
||||
json={"destination": "abc123", "text": "Hello"}
|
||||
)
|
||||
|
||||
@@ -82,7 +82,7 @@ class TestMessagesEndpoint:
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.post(
|
||||
"/messages/channel",
|
||||
"/api/messages/channel",
|
||||
json={"channel_key": "0123456789ABCDEF0123456789ABCDEF", "text": "Hello"}
|
||||
)
|
||||
|
||||
@@ -105,7 +105,7 @@ class TestMessagesEndpoint:
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.post(
|
||||
"/messages/direct",
|
||||
"/api/messages/direct",
|
||||
json={"destination": "nonexistent", "text": "Hello"}
|
||||
)
|
||||
|
||||
@@ -179,7 +179,7 @@ class TestPacketsEndpoint:
|
||||
from app.main import app
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.get("/packets/undecrypted/count")
|
||||
response = client.get("/api/packets/undecrypted/count")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json()["count"] == 42
|
||||
Reference in new issue
Block a user