mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-10-23 09:42:21 +00:00
Add turbo mode
This commit is contained in:
1 parent
b9fd96ac46
commit
541d66020b
6 files changed
+555
-538
No files matched your search
+532
@@ -0,0 +1,532 @@
|
||||
var Kv=Object.defineProperty;var Yv=(a,r,o)=>r in a?Kv(a,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[r]=o;var Hn=(a,r,o)=>Yv(a,typeof r!="symbol"?r+"":r,o);function Zv(a,r){for(var o=0;o<r.length;o++){const t=r[o];if(typeof t!="string"&&!Array.isArray(t)){for(const u in t)if(u!=="default"&&!(u in a)){const l=Object.getOwnPropertyDescriptor(t,u);l&&Object.defineProperty(a,u,l.get?l:{enumerable:!0,get:()=>t[u]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))t(u);new MutationObserver(u=>{for(const l of u)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&t(m)}).observe(document,{childList:!0,subtree:!0});function o(u){const l={};return u.integrity&&(l.integrity=u.integrity),u.referrerPolicy&&(l.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?l.credentials="include":u.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function t(u){if(u.ep)return;u.ep=!0;const l=o(u);fetch(u.href,l)}})();var Yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fo(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function Lg(a){if(Object.prototype.hasOwnProperty.call(a,"__esModule"))return a;var r=a.default;if(typeof r=="function"){var o=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};o.prototype=r.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(a).forEach(function(t){var u=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(o,t,u.get?u:{enumerable:!0,get:function(){return a[t]}})}),o}var Zc={exports:{}},br={},Xc={exports:{}},Me={};/**
|
||||
* @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 Im;function Xv(){if(Im)return Me;Im=1;var a=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),t=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function f(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function v(z,I,L){this.props=z,this.context=I,this.refs=j,this.updater=L||x}v.prototype.isReactComponent={},v.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,I,"setState")},v.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function A(){}A.prototype=v.prototype;function q(z,I,L){this.props=z,this.context=I,this.refs=j,this.updater=L||x}var k=q.prototype=new A;k.constructor=q,w(k,v.prototype),k.isPureReactComponent=!0;var C=Array.isArray,S=Object.prototype.hasOwnProperty,D={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function F(z,I,L){var G,ue={},he=null,ge=null;if(I!=null)for(G in I.ref!==void 0&&(ge=I.ref),I.key!==void 0&&(he=""+I.key),I)S.call(I,G)&&!T.hasOwnProperty(G)&&(ue[G]=I[G]);var re=arguments.length-2;if(re===1)ue.children=L;else if(1<re){for(var le=Array(re),je=0;je<re;je++)le[je]=arguments[je+2];ue.children=le}if(z&&z.defaultProps)for(G in re=z.defaultProps,re)ue[G]===void 0&&(ue[G]=re[G]);return{$$typeof:a,type:z,key:he,ref:ge,props:ue,_owner:D.current}}function O(z,I){return{$$typeof:a,type:z.type,key:I,ref:z.ref,props:z.props,_owner:z._owner}}function N(z){return typeof z=="object"&&z!==null&&z.$$typeof===a}function R(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(L){return I[L]})}var V=/\/+/g;function H(z,I){return typeof z=="object"&&z!==null&&z.key!=null?R(""+z.key):I.toString(36)}function $(z,I,L,G,ue){var he=typeof z;(he==="undefined"||he==="boolean")&&(z=null);var ge=!1;if(z===null)ge=!0;else switch(he){case"string":case"number":ge=!0;break;case"object":switch(z.$$typeof){case a:case r:ge=!0}}if(ge)return ge=z,ue=ue(ge),z=G===""?"."+H(ge,0):G,C(ue)?(L="",z!=null&&(L=z.replace(V,"$&/")+"/"),$(ue,I,L,"",function(je){return je})):ue!=null&&(N(ue)&&(ue=O(ue,L+(!ue.key||ge&&ge.key===ue.key?"":(""+ue.key).replace(V,"$&/")+"/")+z)),I.push(ue)),1;if(ge=0,G=G===""?".":G+":",C(z))for(var re=0;re<z.length;re++){he=z[re];var le=G+H(he,re);ge+=$(he,I,L,le,ue)}else if(le=f(z),typeof le=="function")for(z=le.call(z),re=0;!(he=z.next()).done;)he=he.value,le=G+H(he,re++),ge+=$(he,I,L,le,ue);else if(he==="object")throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return ge}function ae(z,I,L){if(z==null)return z;var G=[],ue=0;return $(z,G,"","",function(he){return I.call(L,he,ue++)}),G}function J(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(L){(z._status===0||z._status===-1)&&(z._status=1,z._result=L)},function(L){(z._status===0||z._status===-1)&&(z._status=2,z._result=L)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var ie={current:null},W={transition:null},oe={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Me.Children={map:ae,forEach:function(z,I,L){ae(z,function(){I.apply(this,arguments)},L)},count:function(z){var I=0;return ae(z,function(){I++}),I},toArray:function(z){return ae(z,function(I){return I})||[]},only:function(z){if(!N(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Me.Component=v,Me.Fragment=o,Me.Profiler=u,Me.PureComponent=q,Me.StrictMode=t,Me.Suspense=h,Me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,Me.act=ee,Me.cloneElement=function(z,I,L){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var G=w({},z.props),ue=z.key,he=z.ref,ge=z._owner;if(I!=null){if(I.ref!==void 0&&(he=I.ref,ge=D.current),I.key!==void 0&&(ue=""+I.key),z.type&&z.type.defaultProps)var re=z.type.defaultProps;for(le in I)S.call(I,le)&&!T.hasOwnProperty(le)&&(G[le]=I[le]===void 0&&re!==void 0?re[le]:I[le])}var le=arguments.length-2;if(le===1)G.children=L;else if(1<le){re=Array(le);for(var je=0;je<le;je++)re[je]=arguments[je+2];G.children=re}return{$$typeof:a,type:z.type,key:ue,ref:he,props:G,_owner:ge}},Me.createContLine truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Om;function Jv(){if(Om)return br;Om=1;var a=Ru(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function m(c,h,d){var y,g={},f=null,x=null;d!==void 0&&(f=""+d),h.key!==void 0&&(f=""+h.key),h.ref!==void 0&&(x=h.ref);for(y in h)t.call(h,y)&&!l.hasOwnProperty(y)&&(g[y]=h[y]);if(c&&c.defaultProps)for(y in h=c.defaultProps,h)g[y]===void 0&&(g[y]=h[y]);return{$$typeof:r,type:c,key:f,ref:x,props:g,_owner:u.current}}return br.Fragment=o,br.jsx=m,br.jsxs=m,br}var Hm;function ek(){return Hm||(Hm=1,Zc.exports=Jv()),Zc.exports}var _=ek(),B=Ru();const me=Fo(B),Tu=Zv({__proto__:null,default:me},[B]);var Ks={},Jc={exports:{}},aa={},eu={exports:{}},iu={};/**
|
||||
* @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 Lm;function ik(){return Lm||(Lm=1,(function(a){function r(W,oe){var ee=W.length;W.push(oe);e:for(;0<ee;){var z=ee-1>>>1,I=W[z];if(0<u(I,oe))W[z]=oe,W[ee]=I,ee=z;else break e}}function o(W){return W.length===0?null:W[0]}function t(W){if(W.length===0)return null;var oe=W[0],ee=W.pop();if(ee!==oe){W[0]=ee;e:for(var z=0,I=W.length,L=I>>>1;z<L;){var G=2*(z+1)-1,ue=W[G],he=G+1,ge=W[he];if(0>u(ue,ee))he<I&&0>u(ge,ue)?(W[z]=ge,W[he]=ee,z=he):(W[z]=ue,W[G]=ee,z=G);else if(he<I&&0>u(ge,ee))W[z]=ge,W[he]=ee,z=he;else break e}}return oe}function u(W,oe){var ee=W.sortIndex-oe.sortIndex;return ee!==0?ee:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;a.unstable_now=function(){return l.now()}}else{var m=Date,c=m.now();a.unstable_now=function(){return m.now()-c}}var h=[],d=[],y=1,g=null,f=3,x=!1,w=!1,j=!1,v=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(W){for(var oe=o(d);oe!==null;){if(oe.callback===null)t(d);else if(oe.startTime<=W)t(d),oe.sortIndex=oe.expirationTime,r(h,oe);else break;oe=o(d)}}function C(W){if(j=!1,k(W),!w)if(o(h)!==null)w=!0,J(S);else{var oe=o(d);oe!==null&&ie(C,oe.startTime-W)}}function S(W,oe){w=!1,j&&(j=!1,A(F),F=-1),x=!0;var ee=f;try{for(k(oe),g=o(h);g!==null&&(!(g.expirationTime>oe)||W&&!R());){var z=g.callback;if(typeof z=="function"){g.callback=null,f=g.priorityLevel;var I=z(g.expirationTime<=oe);oe=a.unstable_now(),typeof I=="function"?g.callback=I:g===o(h)&&t(h),k(oe)}else t(h);g=o(h)}if(g!==null)var L=!0;else{var G=o(d);G!==null&&ie(C,G.startTime-oe),L=!1}return L}finally{g=null,f=ee,x=!1}}var D=!1,T=null,F=-1,O=5,N=-1;function R(){return!(a.unstable_now()-N<O)}function V(){if(T!==null){var W=a.unstable_now();N=W;var oe=!0;try{oe=T(!0,W)}finally{oe?H():(D=!1,T=null)}}else D=!1}var H;if(typeof q=="function")H=function(){q(V)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,ae=$.port2;$.port1.onmessage=V,H=function(){ae.postMessage(null)}}else H=function(){v(V,0)};function J(W){T=W,D||(D=!0,H())}function ie(W,oe){F=v(function(){W(a.unstable_now())},oe)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(W){W.callback=null},a.unstable_continueExecution=function(){w||x||(w=!0,J(S))},a.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<W?Math.floor(1e3/W):5},a.unstable_getCurrentPriorityLevel=function(){return f},a.unstable_getFirstCallbackNode=function(){return o(h)},a.unstable_next=function(W){switch(f){case 1:case 2:case 3:var oe=3;break;default:oe=f}var ee=f;f=oe;try{return W()}finally{f=ee}},a.unstable_pauseExecution=function(){},a.unstable_requestPaint=function(){},a.unstable_runWithPriority=function(W,oe){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var ee=f;f=W;try{return oe()}finally{f=ee}},a.unstable_scheduleCallback=function(W,oe,ee){var z=a.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?z+ee:z):ee=z,W){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=ee+I,W={id:y++,callback:oe,priorityLevel:W,startTime:ee,expirationTime:I,sortIndex:-1},ee>z?(W.sortIndex=ee,r(d,W),o(h)===null&&W===o(d)&&(j?(A(F),F=-1):j=!0,ie(C,ee-z))):(W.sortIndex=I,r(h,W),w||x||(w=!0,J(S))),W},a.unstable_shouldYield=R,a.unstable_wrapCallback=function(W){var oe=f;return function(){var ee=f;f=oe;try{return W.apply(this,arguments)}finally{f=ee}}}})(iu)),iu}var Vm;function ak(){return Vm||(Vm=1,eu.exports=ik()),eu.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 Um;function nk(){if(Um)return aa;Um=1;var a=Ru(),r=ak();function o(e){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)i+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var t=new Set,u={};function l(e,i){m(e,i),m(e+"Capture",i)}function m(e,i){for(u[e]=i,e=0;e<i.length;e++)t.add(i[e])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},g={};function f(e){return h.call(g,e)?!0:h.call(y,e)?!1:d.test(e)?g[e]=!0:(y[e]=!0,!1)}function x(e,i,n,s){if(n!==null&&n.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function w(e,i,n,s){if(i===null||typeof i>"u"||x(e,i,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function j(e,i,n,s,p,b,E){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=s,this.attributeNamespace=p,this.mustUseProperty=n,this.propertyName=e,this.type=i,this.sanitizeURL=b,this.removeEmptyString=E}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var i=e[0];v[i]=new j(i,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new j(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){v[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var i=e.replace(A,q);v[i]=new j(i,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var i=e.replace(A,q);v[i]=new j(i,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var i=e.replace(A,q);v[i]=new j(i,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(e,i,n,s){var p=v.hasOwnProperty(i)?v[i]:null;(p!==null?p.type!==0:s||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=
Line truncated
|
||||
`+z+e}var L=!1;function G(e,i){if(!e||L)return"";L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(X){var s=X}Reflect.construct(e,[],i)}else{try{i.call()}catch(X){s=X}e.call(i.prototype)}else{try{throw Error()}catch(X){s=X}e()}}catch(X){if(X&&s&&typeof X.stack=="string"){for(var p=X.stack.split(`
|
||||
`),b=s.stack.split(`
|
||||
`),E=p.length-1,P=b.length-1;1<=E&&0<=P&&p[E]!==b[P];)P--;for(;1<=E&&0<=P;E--,P--)if(p[E]!==b[P]){if(E!==1||P!==1)do if(E--,P--,0>P||p[E]!==b[P]){var M=`
|
||||
`+p[E].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=E&&0<=P);break}}}finally{L=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function ue(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1),e;case 11:return e=G(e.type.render,!1),e;case 1:return e=G(e.type,!0),e;default:return""}}function he(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 T:return"Fragment";case D:return"Portal";case O:return"Profiler";case F:return"StrictMode";case H:return"Suspense";case $:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:return(e.displayName||"Context")+".Consumer";case N:return(e._context.displayName||"Context")+".Provider";case V:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return i=e.displayName||null,i!==null?i:he(e.type)||"Memo";case J:i=e._payload,e=e._init;try{return he(e(i))}catch{}}return null}function ge(e){var i=e.type;switch(e.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=i.render,e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(i);case 8:return i===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function le(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function je(e){var i=le(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,i),s=""+e[i];if(!e.hasOwnProperty(i)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,b=n.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return p.call(this)},set:function(E){s=""+E,b.call(this,E)}}),Object.defineProperty(e,i,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Pe(e){e._valueTracker||(e._valueTracker=je(e))}function Ze(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var n=i.getValue(),s="";return e&&(s=le(e)?e.checked?"true":"false":e.value),e=s,e!==n?(i.setValue(e),!0):!1}function Je(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 _e(e,i){var n=i.checked;return ee({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ge(e,i){var n=i.defaultValue==null?"":i.defaultValue,s=i.checked!=null?i.checked:i.defaultChecked;n=re(i.value!=null?i.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function ei(e,i){i=i.checked,i!=null&&k(e,"checked",i,!1)}function Ve(e,i){ei(e,i);var n=re(i.value),s=i.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}i.hasOwnProperty("value")?ai(e,i.type,n):i.hasOwnProperty("defaultValue")&&ai(e,i.type,re(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(e.defaultChecked=!!i.defaultChecked)}function xi(e,i,n){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var s=i.type;if(!(s!=="submit"&&s!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+e._wrapperState.initialValue,n||i===e.value||(e.value=i),e.defaultValue=i}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ai(e,i,n){(i!=="number"||Je(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ti=Array.isArray;function si(e,i,n,s){if(e=e.options,i){i={};for(var p=0;p<n.length;p++)i["$"+n[p]]=!0;for(n=0;n<e.length;n++)p=i.hasOwnProperty("$"+e[n].value),e[n].selected!==p&&(e[n].selected=p),p&&s&&(e[n].defaultSelected=!0)}else{for(n=""+re(n),i=null,p=0;p<e.length;p++){if(e[p].value===n){e[p].selected=!0,s&&(e[p].defaultSelected=!0);return}i!==null||e[p].disabled||(i=e[p])}i!==null&&(i.selected=!0)}}function We(e,i){if(i.dangerouslySetInnerHTML!
Line truncated
|
||||
`).replace(lv,"")}function ls(e,i,n){if(i=np(i),np(e)!==i&&n)throw Error(o(425))}function cs(){}var Hl=null,Ll=null;function Vl(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ul=typeof setTimeout=="function"?setTimeout:void 0,cv=typeof clearTimeout=="function"?clearTimeout:void 0,op=typeof Promise=="function"?Promise:void 0,uv=typeof queueMicrotask=="function"?queueMicrotask:typeof op<"u"?function(e){return op.resolve(null).then(e).catch(dv)}:Ul;function dv(e){setTimeout(function(){throw e})}function Wl(e,i){var n=i,s=0;do{var p=n.nextSibling;if(e.removeChild(n),p&&p.nodeType===8)if(n=p.data,n==="/$"){if(s===0){e.removeChild(p),Uo(i);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=p}while(n);Uo(i)}function un(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return e}function rp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(i===0)return e;i--}else n==="/$"&&i++}e=e.previousSibling}return null}var so=Math.random().toString(36).slice(2),Fa="__reactFiber$"+so,ir="__reactProps$"+so,Va="__reactContainer$"+so,Gl="__reactEvents$"+so,pv="__reactListeners$"+so,mv="__reactHandles$"+so;function Sn(e){var i=e[Fa];if(i)return i;for(var n=e.parentNode;n;){if(i=n[Va]||n[Fa]){if(n=i.alternate,i.child!==null||n!==null&&n.child!==null)for(e=rp(e);e!==null;){if(n=e[Fa])return n;e=rp(e)}return i}e=n,n=e.parentNode}return null}function ar(e){return e=e[Fa]||e[Va],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function to(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function us(e){return e[ir]||null}var Ql=[],lo=-1;function dn(e){return{current:e}}function li(e){0>lo||(e.current=Ql[lo],Ql[lo]=null,lo--)}function oi(e,i){lo++,Ql[lo]=e.current,e.current=i}var pn={},Hi=dn(pn),Zi=dn(!1),Bn=pn;function co(e,i){var n=e.type.contextTypes;if(!n)return pn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===i)return s.__reactInternalMemoizedMaskedChildContext;var p={},b;for(b in n)p[b]=i[b];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=p),p}function Xi(e){return e=e.childContextTypes,e!=null}function ds(){li(Zi),li(Hi)}function sp(e,i,n){if(Hi.current!==pn)throw Error(o(168));oi(Hi,i),oi(Zi,n)}function tp(e,i,n){var s=e.stateNode;if(i=i.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var p in s)if(!(p in i))throw Error(o(108,ge(e)||"Unknown",p));return ee({},n,s)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pn,Bn=Hi.current,oi(Hi,e),oi(Zi,Zi.current),!0}function lp(e,i,n){var s=e.stateNode;if(!s)throw Error(o(169));n?(e=tp(e,i,Bn),s.__reactInternalMemoizedMergedChildContext=e,li(Zi),li(Hi),oi(Hi,e)):li(Zi),oi(Zi,n)}var Ua=null,ms=!1,$l=!1;function cp(e){Ua===null?Ua=[e]:Ua.push(e)}function hv(e){ms=!0,cp(e)}function mn(){if(!$l&&Ua!==null){$l=!0;var e=0,i=Xe;try{var n=Ua;for(Xe=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}Ua=null,ms=!1}catch(p){throw Ua!==null&&(Ua=Ua.slice(e+1)),dd(yl,mn),p}finally{Xe=i,$l=!1}}return null}var uo=[],po=0,hs=null,gs=0,pa=[],ma=0,_n=null,Wa=1,Ga="";function Dn(e,i){uo[po++]=gs,uo[po++]=hs,hs=e,gs=i}function up(e,i,n){pa[ma++]=Wa,pa[ma++]=Ga,pa[ma++]=_n,_n=e;var s=Wa;e=Ga;var p=32-xa(s)-1;s&=~(1<<p),n+=1;var b=32-xa(i)+p;if(30<b){var E=p-p%5;b=(s&(1<<E)-1).toString(32),s>>=E,p-=E,Wa=1<<32-xa(i)+p|n<<p|s,Ga=b+e}else Wa=1<<b|n<<p|s,Ga=e}function Kl(e){e.return!==null&&(Dn(e,1),up(e,1,0))}function Yl(e){for(;e===hs;)hs=uo[--po],uo[po]=null,gs=uo[--po],uo[po]=null;for(;e===_n;)_n=pa[--ma],pa[ma]=null,Ga=pa[--ma],pa[ma]=null,Wa=pa[--ma],pa[ma]=null}var sa=null,ta=null,ui=!1,qa=null;function dp(e,i){var n=ba(5,null,null,0);n.elementType="DELETED",n.stateNode=i,n.return=e,i=e.deletions,i===null?(e.deletions=[n],e.flags|=16):i.push(n)}function pp(e,i){switch(e.tag){case 5:var n=e.type;return i=i.nodeType!==1||n.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(e.stateNode=i,sa=e,ta=un(i.firstChild),!0):!1;case 6:return i=e.pendingProps===""||i.nodeType!==3?null:i,i!==null?(e.stateNode=i,sa=e,ta=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(n=_n!==null?{id:Wa,overflow:Ga}:null,e.memoizedState={dehydrated:i,treeContext:n,retryLane:1073741824},n=ba(18,null,null,0),n.stateNode=i,n.return=e,e.child=n,sa=e,ta=null,!0):!1;default:return!1}}function Zl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xl(e){if(ui){var i=ta;if(i){var n=i;if(!pp(e,i)){if(Zl(e))throw Error(o(418));i=un(n.nextSibling);var s=sa;i&&pp(e,i)?dp(s,n):(e.flags=e.flags&-4097|2,ui=!1,sa=e)}}else{if(Zl(e))throw Error(o(418));e.flags=e.flags&-4097|2,ui=!1,sa=e}}}function mp(e){for(e=e
Line truncated
|
||||
Error generating stack: `+b.message+`
|
||||
`+b.stack}return{value:e,source:i,stack:p,digest:null}}function kc(e,i,n){return{value:e,source:null,stack:n??null,digest:i??null}}function wc(e,i){try{console.error(i.value)}catch(n){setTimeout(function(){throw n})}}var zv=typeof WeakMap=="function"?WeakMap:Map;function Qp(e,i,n){n=$a(-1,n),n.tag=3,n.payload={element:null};var s=i.value;return n.callback=function(){Ts||(Ts=!0,Pc=s),wc(e,i)},n}function $p(e,i,n){n=$a(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var p=i.value;n.payload=function(){return s(p)},n.callback=function(){wc(e,i)}}var b=e.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(n.callback=function(){wc(e,i),typeof s!="function"&&(bn===null?bn=new Set([this]):bn.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})}),n}function Kp(e,i,n){var s=e.pingCache;if(s===null){s=e.pingCache=new zv;var p=new Set;s.set(i,p)}else p=s.get(i),p===void 0&&(p=new Set,s.set(i,p));p.has(n)||(p.add(n),e=Nv.bind(null,e,i,n),i.then(e,e))}function Yp(e){do{var i;if((i=e.tag===13)&&(i=e.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return e;e=e.return}while(e!==null);return null}function Zp(e,i,n,s,p){return(e.mode&1)===0?(e===i?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(i=$a(-1,1),i.tag=2,gn(n,i,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var qv=C.ReactCurrentOwner,Ji=!1;function Gi(e,i,n,s){i.child=e===null?bp(i,null,n,s):ho(i,e.child,n,s)}function Xp(e,i,n,s,p){n=n.render;var b=i.ref;return yo(i,p),s=pc(e,i,n,s,b,p),n=mc(),e!==null&&!Ji?(i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~p,Ka(e,i,p)):(ui&&n&&Kl(i),i.flags|=1,Gi(e,i,s,p),i.child)}function Jp(e,i,n,s,p){if(e===null){var b=n.type;return typeof b=="function"&&!Vc(b)&&b.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(i.tag=15,i.type=b,em(e,i,b,s,p)):(e=Hs(n.type,null,s,i,i.mode,p),e.ref=i.ref,e.return=i,i.child=e)}if(b=e.child,(e.lanes&p)===0){var E=b.memoizedProps;if(n=n.compare,n=n!==null?n:Yo,n(E,s)&&e.ref===i.ref)return Ka(e,i,p)}return i.flags|=1,e=wn(b,s),e.ref=i.ref,e.return=i,i.child=e}function em(e,i,n,s,p){if(e!==null){var b=e.memoizedProps;if(Yo(b,s)&&e.ref===i.ref)if(Ji=!1,i.pendingProps=s=b,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Ji=!0);else return i.lanes=e.lanes,Ka(e,i,p)}return xc(e,i,n,s,p)}function im(e,i,n){var s=i.pendingProps,p=s.children,b=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},oi(ko,la),la|=n;else{if((n&1073741824)===0)return e=b!==null?b.baseLanes|n:n,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:e,cachePool:null,transitions:null},i.updateQueue=null,oi(ko,la),la|=e,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=b!==null?b.baseLanes:n,oi(ko,la),la|=s}else b!==null?(s=b.baseLanes|n,i.memoizedState=null):s=n,oi(ko,la),la|=s;return Gi(e,i,p,n),i.child}function am(e,i){var n=i.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(i.flags|=512,i.flags|=2097152)}function xc(e,i,n,s,p){var b=Xi(n)?Bn:Hi.current;return b=co(i,b),yo(i,p),n=pc(e,i,n,s,b,p),s=mc(),e!==null&&!Ji?(i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~p,Ka(e,i,p)):(ui&&s&&Kl(i),i.flags|=1,Gi(e,i,n,p),i.child)}function nm(e,i,n,s,p){if(Xi(n)){var b=!0;ps(i)}else b=!1;if(yo(i,p),i.stateNode===null)Bs(e,i),Wp(i,n,s),vc(i,n,s,p),s=!0;else if(e===null){var E=i.stateNode,P=i.memoizedProps;E.props=P;var M=E.context,X=n.contextType;typeof X=="object"&&X!==null?X=ha(X):(X=Xi(n)?Bn:Hi.current,X=co(i,X));var te=n.getDerivedStateFromProps,ce=typeof te=="function"||typeof E.getSnapshotBeforeUpdate=="function";ce||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(P!==s||M!==X)&&Gp(i,E,s,X),hn=!1;var se=i.memoizedState;E.state=se,ws(i,s,E,p),M=i.memoizedState,P!==s||se!==M||Zi.current||hn?(typeof te=="function"&&(fc(i,n,te,s),M=i.memoizedState),(P=hn||Up(i,n,P,s,se,M,X))?(ce||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(i.flags|=4194308)):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=s,i.memoizedState=M),E.props=s,E.state=M,E.context=X,s=P):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),s=!1)}else{E=i.stateNode,vp(e,i),P=i.memoizedProps,X=i.type===i.elementType?P:ja(i.type,P),E.props=X,ce=i.pendingProps,se=E.context,M=n.contextType,typeof M=="object"&&M!==null?M=ha(M):(M=Xi(n)?Bn:Hi.current,M=co(i,M));var be=n.getDerivedStateFromProps;(te=typeof be=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(P!==ce||se!==M)&&Gp(i,E,s,M),hn=!1,se=i.memoizedState,E
Line truncated
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const lk=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ck=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,t)=>t?t.toUpperCase():o.toLowerCase()),Qm=a=>{const r=ck(a);return r.charAt(0).toUpperCase()+r.slice(1)},Ug=(...a)=>a.filter((r,o,t)=>!!r&&r.trim()!==""&&t.indexOf(r)===o).join(" ").trim(),uk=a=>{for(const r in a)if(r.startsWith("aria-")||r==="role"||r==="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 dk={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 pk=B.forwardRef(({color:a="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:t,className:u="",children:l,iconNode:m,...c},h)=>B.createElement("svg",{ref:h,...dk,width:r,height:r,stroke:a,strokeWidth:t?Number(o)*24/Number(r):o,className:Ug("lucide",u),...!l&&!uk(c)&&{"aria-hidden":"true"},...c},[...m.map(([d,y])=>B.createElement(d,y)),...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 Pu=(a,r)=>{const o=B.forwardRef(({className:t,...u},l)=>B.createElement(pk,{ref:l,iconNode:r,className:Ug(`lucide-${lk(Qm(a))}`,`lucide-${a}`,t),...u}));return o.displayName=Qm(a),o};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const mk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hk=Pu("check",mk);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const gk=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],yk=Pu("menu",gk);/**
|
||||
* @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 bk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wg=Pu("x",bk);var Gg=Vg();const Qg=Fo(Gg);function fk(a){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r.appendChild(o),o.styleSheet?o.styleSheet.cssText=a:o.appendChild(document.createTextNode(a))}const vk=a=>{switch(a){case"success":return xk;case"info":return qk;case"warning":return zk;case"error":return jk;default:return null}},kk=Array(12).fill(0),wk=({visible:a,className:r})=>me.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":a},me.createElement("div",{className:"sonner-spinner"},kk.map((o,t)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),xk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),zk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),qk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),jk=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),Ak=me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ck=()=>{const[a,r]=me.useState(document.hidden);return me.useEffect(()=>{const o=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a};let vu=1;class Ek{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{const o=this.subscribers.indexOf(r);this.subscribers.splice(o,1)}),this.publish=r=>{this.subscribers.forEach(o=>o(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var o;const{message:t,...u}=r,l=typeof(r==null?void 0:r.id)=="number"||((o=r.id)==null?void 0:o.length)>0?r.id:vu++,m=this.toasts.find(h=>h.id===l),c=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),m?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...r,id:l,title:t}),{...h,...r,id:l,dismissible:c,title:t}):h):this.addToast({title:t,...u,dismissible:c,id:l}),l},this.dismiss=r=>(r?(this.dismissedToasts.add(r),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:r,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(t=>t({id:o.id,dismiss:!0}))}),r),this.message=(r,o)=>this.create({...o,message:r}),this.error=(r,o)=>this.create({...o,message:r,type:"error"}),this.success=(r,o)=>this.create({...o,type:"success",message:r}),this.info=(r,o)=>this.create({...o,type:"info",message:r}),this.warning=(r,o)=>this.create({...o,type:"warning",message:r}),this.loading=(r,o)=>this.create({...o,type:"loading",message:r}),this.promise=(r,o)=>{if(!o)return;let t;o.loading!==void 0&&(t=this.create({...o,promise:r,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const u=Promise.resolve(r instanceof Function?r():r);let l=t!==void 0,m;const c=u.then(async d=>{if(m=["resolve",d],me.isValidElement(d))l=!1,this.create({id:t,type:"default",message:d});else if(Bk(d)&&!d.ok){l=!1;const g=typeof o.error=="function"?await o.error(`HTTP error! status: ${d.status}`):o.error,f=typeof o.description=="function"?await o.description(`HTTP error! status: ${d.status}`):o.description,w=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:t,type:"error",description:f,...w})}else if(d instanceof Error){l=!1;const g=typeof o.error=="function"?await o.error(d):o.error,Line truncated
|
||||
`).map((oe,ee,z)=>_.jsxs("span",{children:[oe,ee<z.length-1&&_.jsx("br",{})]},ee)),!$&&_.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:sh(C.sender_timestamp||C.received_at)}),C.outgoing&&(C.acked?" ✓":" ?")]})]})]},C.id)})]}),y&&_.jsx("button",{onClick:w,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:_.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const ax=B.forwardRef(function({onSend:r,disabled:o,placeholder:t},u){const[l,m]=B.useState(""),[c,h]=B.useState(!1),d=B.useRef(null);B.useImperativeHandle(u,()=>({appendText:f=>{var x;m(w=>w+f),(x=d.current)==null||x.focus()}}));const y=B.useCallback(async f=>{f.preventDefault();const x=l.trim();if(!(!x||c||o)){h(!0);try{await r(x),m("")}catch(w){console.error("Failed to send message:",w)}finally{h(!1)}}},[l,c,o,r]),g=B.useCallback(f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),y(f))},[y]);return _.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:y,children:[_.jsx(wi,{ref:d,type:"text",value:l,onChange:f=>m(f.target.value),onKeyDown:g,placeholder:t||"Type a message...",disabled:o||c,className:"flex-1"}),_.jsx(Ha,{type:"submit",disabled:o||c||!l.trim(),children:c?"Sending...":"Send"})]})});function Si(a,r,{checkForDefaultPrevented:o=!0}={}){return function(u){if(a==null||a(u),o===!1||!u.defaultPrevented)return r==null?void 0:r(u)}}function nx(a,r){const o=B.createContext(r),t=l=>{const{children:m,...c}=l,h=B.useMemo(()=>c,Object.values(c));return _.jsx(o.Provider,{value:h,children:m})};t.displayName=a+"Provider";function u(l){const m=B.useContext(o);if(m)return m;if(r!==void 0)return r;throw new Error(`\`${l}\` must be used within \`${a}\``)}return[t,u]}function Hr(a,r=[]){let o=[];function t(l,m){const c=B.createContext(m),h=o.length;o=[...o,m];const d=g=>{var A;const{scope:f,children:x,...w}=g,j=((A=f==null?void 0:f[a])==null?void 0:A[h])||c,v=B.useMemo(()=>w,Object.values(w));return _.jsx(j.Provider,{value:v,children:x})};d.displayName=l+"Provider";function y(g,f){var j;const x=((j=f==null?void 0:f[a])==null?void 0:j[h])||c,w=B.useContext(x);if(w)return w;if(m!==void 0)return m;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[d,y]}const u=()=>{const l=o.map(m=>B.createContext(m));return function(c){const h=(c==null?void 0:c[a])||l;return B.useMemo(()=>({[`__scope${a}`]:{...c,[a]:h}}),[c,h])}};return u.scopeName=a,[t,ox(u,...r)]}function ox(...a){const r=a[0];if(a.length===1)return r;const o=()=>{const t=a.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const m=t.reduce((c,{useScope:h,scopeName:d})=>{const g=h(l)[`__scope${d}`];return{...c,...g}},{});return B.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return o.scopeName=r.scopeName,o}var _o=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},rx=Tu[" useId ".trim().toString()]||(()=>{}),sx=0;function Pr(a){const[r,o]=B.useState(rx());return _o(()=>{o(t=>t??String(sx++))},[a]),r?`radix-${r}`:""}var tx=Tu[" useInsertionEffect ".trim().toString()]||_o;function al({prop:a,defaultProp:r,onChange:o=()=>{},caller:t}){const[u,l,m]=lx({defaultProp:r,onChange:o}),c=a!==void 0,h=c?a:u;{const y=B.useRef(a!==void 0);B.useEffect(()=>{const g=y.current;g!==c&&console.warn(`${t} is changing from ${g?"controlled":"uncontrolled"} to ${c?"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.`),y.current=c},[c,t])}const d=B.useCallback(y=>{var g;if(c){const f=cx(y)?y(a):y;f!==a&&((g=m.current)==null||g.call(m,f))}else l(y)},[c,a,l,m]);return[h,d]}function lx({defaultProp:a,onChange:r}){const[o,t]=B.useState(a),u=B.useRef(o),l=B.useRef(r);return tx(()=>{l.current=r},[r]),B.useEffect(()=>{var m;u.current!==o&&((m=l.current)==null||m.call(l,o),u.current=o)},[o,u]),[o,t,l]}function cx(a){return typeof a=="function"}function ux(a){const r=dx(a),o=B.forwardRef((t,u)=>{const{children:l,...m}=t,c=B.Children.toArray(l),h=c.find(mx);if(h){const d=h.props.children,y=c.map(g=>g===h?B.Children.count(d)>1?B.Children.only(null):B.isValidElement(d)?d.props.children:null:g);return _.jsx(r,{...m,ref:u,children:B.isValidElement(d)?B.cloneElement(d,void 0,y):null})}return _.jsx(r,{...m,ref:u,children:l})});return o.displayName=`${a}.Slot`,o}function dx(a){const r=B.forwardRef((o,t)=>{const{children:u,...l}=o;if(B.isValidElement(u)){const m=gx(u),c=hx(l,u.props);return u.type!==B.Fragment&&(c.ref=t?Or(t,m):m),B.cloneElement(u,c)}return B.Children.count(u)>1?B.Children.only(null):null});return r.displayName=`${a}.S
Line truncated
|
||||
.`.concat(Mx,` {
|
||||
overflow: hidden `).concat(t,`;
|
||||
padding-right: `).concat(c,"px ").concat(t,`;
|
||||
}
|
||||
body[`).concat(Eo,`] {
|
||||
overflow: hidden `).concat(t,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([r&&"position: relative ".concat(t,";"),o==="margin"&&`
|
||||
padding-left: `.concat(u,`px;
|
||||
padding-top: `).concat(l,`px;
|
||||
padding-right: `).concat(m,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(c,"px ").concat(t,`;
|
||||
`),o==="padding"&&"padding-right: ".concat(c,"px ").concat(t,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(ot,` {
|
||||
right: `).concat(c,"px ").concat(t,`;
|
||||
}
|
||||
|
||||
.`).concat(rt,` {
|
||||
margin-right: `).concat(c,"px ").concat(t,`;
|
||||
}
|
||||
|
||||
.`).concat(ot," .").concat(ot,` {
|
||||
right: 0 `).concat(t,`;
|
||||
}
|
||||
|
||||
.`).concat(rt," .").concat(rt,` {
|
||||
margin-right: 0 `).concat(t,`;
|
||||
}
|
||||
|
||||
body[`).concat(Eo,`] {
|
||||
`).concat(Ox,": ").concat(c,`px;
|
||||
}
|
||||
`)},gh=function(){var a=parseInt(document.body.getAttribute(Eo)||"0",10);return isFinite(a)?a:0},rz=function(){B.useEffect(function(){return document.body.setAttribute(Eo,(gh()+1).toString()),function(){var a=gh()-1;a<=0?document.body.removeAttribute(Eo):document.body.setAttribute(Eo,a.toString())}},[])},sz=function(a){var r=a.noRelative,o=a.noImportant,t=a.gapMode,u=t===void 0?"margin":t;rz();var l=B.useMemo(function(){return az(u)},[u]);return B.createElement(nz,{styles:oz(l,!r,u,o?"":"!important")})},ju=!1;if(typeof window<"u")try{var et=Object.defineProperty({},"passive",{get:function(){return ju=!0,!0}});window.addEventListener("test",et,et),window.removeEventListener("test",et,et)}catch{ju=!1}var qo=ju?{passive:!1}:!1,tz=function(a){return a.tagName==="TEXTAREA"},xy=function(a,r){if(!(a instanceof Element))return!1;var o=window.getComputedStyle(a);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!tz(a)&&o[r]==="visible")},lz=function(a){return xy(a,"overflowY")},cz=function(a){return xy(a,"overflowX")},yh=function(a,r){var o=r.ownerDocument,t=r;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var u=zy(a,t);if(u){var l=qy(a,t),m=l[1],c=l[2];if(m>c)return!0}t=t.parentNode}while(t&&t!==o.body);return!1},uz=function(a){var r=a.scrollTop,o=a.scrollHeight,t=a.clientHeight;return[r,o,t]},dz=function(a){var r=a.scrollLeft,o=a.scrollWidth,t=a.clientWidth;return[r,o,t]},zy=function(a,r){return a==="v"?lz(r):cz(r)},qy=function(a,r){return a==="v"?uz(r):dz(r)},pz=function(a,r){return a==="h"&&r==="rtl"?-1:1},mz=function(a,r,o,t,u){var l=pz(a,window.getComputedStyle(r).direction),m=l*t,c=o.target,h=r.contains(c),d=!1,y=m>0,g=0,f=0;do{if(!c)break;var x=qy(a,c),w=x[0],j=x[1],v=x[2],A=j-v-l*w;(w||A)&&zy(a,c)&&(g+=A,f+=w);var q=c.parentNode;c=q&&q.nodeType===Node.DOCUMENT_FRAGMENT_NODE?q.host:q}while(!h&&c!==document.body||h&&(r.contains(c)||r===c));return(y&&Math.abs(g)<1||!y&&Math.abs(f)<1)&&(d=!0),d},it=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bh=function(a){return[a.deltaX,a.deltaY]},fh=function(a){return a&&"current"in a?a.current:a},hz=function(a,r){return a[0]===r[0]&&a[1]===r[1]},gz=function(a){return`
|
||||
.block-interactivity-`.concat(a,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(a,` {pointer-events: all;}
|
||||
`)},yz=0,jo=[];function bz(a){var r=B.useRef([]),o=B.useRef([0,0]),t=B.useRef(),u=B.useState(yz++)[0],l=B.useState(wy)[0],m=B.useRef(a);B.useEffect(function(){m.current=a},[a]),B.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(u));var j=Ix([a.lockRef.current],(a.shards||[]).map(fh),!0).filter(Boolean);return j.forEach(function(v){return v.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),j.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(u))})}}},[a.inert,a.lockRef.current,a.shards]);var c=B.useCallback(function(j,v){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!m.current.allowPinchZoom;var A=it(j),q=o.current,k="deltaX"in j?j.deltaX:q[0]-A[0],C="deltaY"in j?j.deltaY:q[1]-A[1],S,D=j.target,T=Math.abs(k)>Math.abs(C)?"h":"v";if("touches"in j&&T==="h"&&D.type==="range")return!1;var F=window.getSelection(),O=F&&F.anchorNode,N=O?O===D||O.contains(D):!1;if(N)return!1;var R=yh(T,D);if(!R)return!0;if(R?S=T:(S=T==="v"?"h":"v",R=yh(T,D)),!R)return!1;if(!t.current&&"changedTouches"in j&&(k||C)&&(t.current=S),!S)return!0;var V=t.current||S;return mz(V,v,j,V==="h"?k:C)},[]),h=B.useCallback(function(j){var v=j;if(!(!jo.length||jo[jo.length-1]!==l)){var A="deltaY"in v?bh(v):it(v),q=r.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&hz(S.delta,A)})[0];if(q&&q.should){v.cancelable&&v.preventDefault();return}if(!q){var k=(m.current.shards||[]).map(fh).filter(Boolean).filter(function(S){return S.contains(v.target)}),C=k.length>0?c(v,k[0]):!m.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),d=B.useCallback(function(j,v,A,q){var k={name:j,delta:v,target:A,should:q,shadowParent:fz(A)};r.current.push(k),setTimeout(function(){r.current=r.current.filter(function(C){return C!==k})},1)},[]),y=B.useCallback(function(j){o.current=it(j),t.current=void 0},[]),g=B.useCallback(function(j){d(j.type,bh(j),j.target,c(j,a.lockRef.current))},[]),f=B.useCallback(function(j){d(j.type,it(j),j.target,c(j,a.lockRef.current))},[]);B.useEffect(function(){return jo.push(l),a.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:f}),document.addEventListener("wheel",h,qo),document.addEventListener("touchmove",h,qo),document.addEventListener("touchstart",y,qo),function(){jo=jo.filter(function(j){return j!==l}),document.removeEventListener("wheel",h,qo),document.removeEventListener("touchmove",h,qo),document.removeEventListener("touchstart",y,qo)}},[]);var x=a.removeScrollBar,w=a.inert;return B.createElement(B.Fragment,null,w?B.createElement(l,{styles:gz(u)}):null,x?B.createElement(sz,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function fz(a){for(var r=null;a!==null;)a instanceof ShadowRoot&&(r=a.host,a=a.host),a=a.parentNode;return r}const vz=Qx(ky,bz);var jy=B.forwardRef(function(a,r){return B.createElement(nl,Oa({},a,{ref:r,sideCar:vz}))});jy.classNames=nl.classNames;var kz=function(a){if(typeof document>"u")return null;var r=Array.isArray(a)?a[0]:a;return r.ownerDocument.body},Ao=new WeakMap,at=new WeakMap,nt={},pu=0,Ay=function(a){return a&&(a.host||Ay(a.parentNode))},wz=function(a,r){return r.map(function(o){if(a.contains(o))return o;var t=Ay(o);return t&&a.contains(t)?t:(console.error("aria-hidden",o,"in not contained inside",a,". Doing nothing"),null)}).filter(function(o){return!!o})},xz=function(a,r,o,t){var u=wz(r,Array.isArray(a)?a:[a]);nt[o]||(nt[o]=new WeakMap);var l=nt[o],m=[],c=new Set,h=new Set(u),d=function(g){!g||c.has(g)||(c.add(g),d(g.parentNode))};u.forEach(d);var y=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(f){if(c.has(f))y(f);else try{var x=f.getAttribute(t),w=x!==null&&x!=="false",j=(Ao.get(f)||0)+1,v=(l.get(f)||0)+1;Ao.set(f,j),l.set(f,v),m.push(f),j===1&&w&&at.set(f,!0),v===1&&f.setAttribute(o,"true"),w||f.setAttribute(t,"true")}catch(A){console.error("aria-hidden: cannot operate on ",f,A)}})};return y(r),c.clear(),pu++,function(){m.forEach(function(g){var f=Ao.get(g)-1,x=l.get(g)-1;Ao.set(g,f),l.set(g,x),f||(at.has(g)||g.removeAttribute(t),at.delete(g)),x||g.removeAttribute(o)}),pu--,pu||(Ao=new WeakMap,Ao=new WeakMap,at=new WeakMap,nt={})}},zz=function(a,r,o){o===void 0&&(o="data-aria-hidden");var t=Array.from(Array.isArray(a)?a:[a]),u=kz(a);return u?(t.push.apply(t,Array.from(u.querySelectorAll("[aria-live], script"))),xz(t,u,o,"aria-hidden")):function(){return null}};function qz(a){const r=jz(a),o=B.forwardRef((t,u)=>{const{children:l,...m}=t,c=B.Children.toArray(l),h=c.find(Cz);if(h){const d=h.props.children,y=c.map(g=>g===h?B.Children.count(d)>1?B.Children.only(null):B.isValidElement(d)?d.props.children:null:g);return _.jsx(r,{...m,ref:u,children:B.isValidElement(d)?B.cloneElement(d,void 0,y):null})}return _.jsx(r,{...m,ref:u,children:l})});return o.displayName=`${a}.Slot`,o}function jz(a){const r=B.forwardRef((o,t)=>{const{children:u
Line truncated
|
||||
|
||||
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return B.useEffect(()=>{a&&(document.getElementById(a)||console.error(o))},[o,a]),null},Iz="DialogDescriptionWarning",Mz=({contentRef:a,descriptionId:r})=>{const t=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hy(Iz).contentName}}.`;return B.useEffect(()=>{var l;const u=(l=a.current)==null?void 0:l.getAttribute("aria-describedby");r&&u&&(document.getElementById(r)||console.warn(t))},[t,a,r]),null},Ly=Ey,Vy=_y,rl=Dy,sl=Fy,tl=Ty,ll=Ny,Uy=My;const Wy=Ly,Oz=Vy,Gy=B.forwardRef(({className:a,...r},o)=>_.jsx(rl,{ref:o,className:Ke("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r}));Gy.displayName=rl.displayName;const Lu=B.forwardRef(({className:a,children:r,...o},t)=>_.jsxs(Oz,{children:[_.jsx(Gy,{}),_.jsxs(sl,{ref:t,className:Ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...o,children:[r,_.jsxs(Uy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(Wg,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Lu.displayName=sl.displayName;const Vu=({className:a,...r})=>_.jsx("div",{className:Ke("flex flex-col space-y-1.5 text-center sm:text-left",a),...r});Vu.displayName="DialogHeader";const Uu=({className:a,...r})=>_.jsx("div",{className:Ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...r});Uu.displayName="DialogFooter";const Wu=B.forwardRef(({className:a,...r},o)=>_.jsx(tl,{ref:o,className:Ke("text-lg font-semibold leading-none tracking-tight",a),...r}));Wu.displayName=tl.displayName;const Hz=B.forwardRef(({className:a,...r},o)=>_.jsx(ll,{ref:o,className:Ke("text-sm text-muted-foreground",a),...r}));Hz.displayName=ll.displayName;function vh(a){const r=Lz(a),o=B.forwardRef((t,u)=>{const{children:l,...m}=t,c=B.Children.toArray(l),h=c.find(Uz);if(h){const d=h.props.children,y=c.map(g=>g===h?B.Children.count(d)>1?B.Children.only(null):B.isValidElement(d)?d.props.children:null:g);return _.jsx(r,{...m,ref:u,children:B.isValidElement(d)?B.cloneElement(d,void 0,y):null})}return _.jsx(r,{...m,ref:u,children:l})});return o.displayName=`${a}.Slot`,o}function Lz(a){const r=B.forwardRef((o,t)=>{const{children:u,...l}=o;if(B.isValidElement(u)){const m=Gz(u),c=Wz(l,u.props);return u.type!==B.Fragment&&(c.ref=t?Or(t,m):m),B.cloneElement(u,c)}return B.Children.count(u)>1?B.Children.only(null):null});return r.displayName=`${a}.SlotClone`,r}var Vz=Symbol("radix.slottable");function Uz(a){return B.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Vz}function Wz(a,r){const o={...r};for(const t in r){const u=a[t],l=r[t];/^on[A-Z]/.test(t)?u&&l?o[t]=(...c)=>{const h=l(...c);return u(...c),h}:u&&(o[t]=u):t==="style"?o[t]={...u,...l}:t==="className"&&(o[t]=[u,l].filter(Boolean).join(" "))}return{...a,...o}}function Gz(a){var t,u;let r=(t=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?a.ref:(r=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}function Qz(a){const r=a+"CollectionProvider",[o,t]=Hr(r),[u,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),m=j=>{const{scope:v,children:A}=j,q=me.useRef(null),k=me.useRef(new Map).current;return _.jsx(u,{scope:v,itemMap:k,collectionRef:q,children:A})};m.displayName=r;const c=a+"CollectionSlot",h=vh(c),d=me.forwardRef((j,v)=>{const{scope:A,children:q}=j,k=l(c,A),C=fa(v,k.collectionRef);return _.jsx(h,{ref:C,children:q})});d.displayName=c;const y=a+"CollectionItemSlot",g="data-radix-collection-item",f=vh(y),x=me.forwardRef((j,v)=>{const{scope:A,children:q,...k}=j,C=me.useRef(null),S=fa(v,C),D=l(y,A);return me.useEffect(()=>(D.itemMap.set(C,{ref:C,...k}),()=>void D.itemMap.delete(C))),_.jsx(f,{[g]:"",ref:S,children:q})});x.displayName=y;function w(j){const v=l(a+"CollectionConsumer",j);return me.useCallback(()=>{const q=v.collectionRef.current;if(!q)return[];const k=Array.from(q.querySelectorAll(`[${g}]`));return Array.from(v.itemMap.values()).sort((D,T)=>k.indexOf(D.ref.current)-k.indexOf(T.ref.current))},[v.coll
Line truncated
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/return(function(t){var u=o,l=u.lib,m=l.WordArray,c=l.Hasher,h=u.algo,d=m.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),y=m.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=m.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=m.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),x=m.create([0,1518500249,1859775393,2400959708,2840853838]),w=m.create([1352829926,1548603684,1836072691,2053994217,0]),j=h.RIPEMD160=c.extend({_doReset:function(){this._hash=m.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,T){for(var F=0;F<16;F++){var O=T+F,N=D[O];D[O]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}var R=this._hash.words,V=x.words,H=w.words,$=d.words,ae=y.words,J=g.words,ie=f.words,W,oe,ee,z,I,L,G,ue,he,ge;L=W=R[0],G=oe=R[1],ue=ee=R[2],he=z=R[3],ge=I=R[4];for(var re,F=0;F<80;F+=1)re=W+D[T+$[F]]|0,F<16?re+=v(oe,ee,z)+V[0]:F<32?re+=A(oe,ee,z)+V[1]:F<48?re+=q(oe,ee,z)+V[2]:F<64?re+=k(oe,ee,z)+V[3]:re+=C(oe,ee,z)+V[4],re=re|0,re=S(re,J[F]),re=re+I|0,W=I,I=z,z=S(ee,10),ee=oe,oe=re,re=L+D[T+ae[F]]|0,F<16?re+=C(G,ue,he)+H[0]:F<32?re+=k(G,ue,he)+H[1]:F<48?re+=q(G,ue,he)+H[2]:F<64?re+=A(G,ue,he)+H[3]:re+=v(G,ue,he)+H[4],re=re|0,re=S(re,ie[F]),re=re+ge|0,L=ge,ge=he,he=S(ue,10),ue=G,G=re;re=R[1]+ee+he|0,R[1]=R[2]+z+ge|0,R[2]=R[3]+I+L|0,R[3]=R[4]+W+G|0,R[4]=R[0]+oe+ue|0,R[0]=re},_doFinalize:function(){var D=this._data,T=D.words,F=this._nDataBytes*8,O=D.sigBytes*8;T[O>>>5]|=128<<24-O%32,T[(O+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,D.sigBytes=(T.length+1)*4,this._process();for(var N=this._hash,R=N.words,V=0;V<5;V++){var H=R[V];R[V]=(H<<8|H>>>24)&16711935|(H<<24|H>>>8)&4278255360}return N},clone:function(){var D=c.clone.call(this);return D._hash=this._hash.clone(),D}});function v(D,T,F){return D^T^F}function A(D,T,F){return D&T|~D&F}function q(D,T,F){return(D|~T)^F}function k(D,T,F){return D&F|T&~F}function C(D,T,F){return D^(T|~F)}function S(D,T){return D<<T|D>>>32-T}u.RIPEMD160=c._createHelper(j),u.HmacRIPEMD160=c._createHmacHelper(j)})(),o.RIPEMD160})})(wt)),wt.exports}var xt={exports:{}},nq=xt.exports,Mh;function pl(){return Mh||(Mh=1,(function(a,r){(function(o,t){a.exports=t(Le())})(nq,function(o){(function(){var t=o,u=t.lib,l=u.Base,m=t.enc,c=m.Utf8,h=t.algo;h.HMAC=l.extend({init:function(d,y){d=this._hasher=new d.init,typeof y=="string"&&(y=c.parse(y));var g=d.blockSize,f=g*4;y.sigBytes>f&&(y=d.finalize(y)),y.clamp();for(var x=this._oKey=y.clone(),w=this._iKey=y.clone(),j=x.words,v=w.words,A=0;A<g;A++)j[A]^=1549556828,v[A]^=909522486;x.sigBytes=w.sigBytes=f,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var y=this._hasher,g=y.finalize(d);y.reset();var f=y.finalize(this._oKey.clone().concat(g));return f}})})()})})(xt)),xt.exports}var zt={exports:{}},oq=zt.exports,Oh;function rq(){return Oh||(Oh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Vr(),pl())})(oq,function(o){return(function(){var t=o,u=t.lib,l=u.Base,m=u.WordArray,c=t.algo,h=c.SHA256,d=c.HMAC,y=c.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,f){for(var x=this.cfg,w=d.create(x.hasher,g),j=m.create(),v=m.create([1]),A=j.words,q=v.words,k=x.keySize,C=x.iterations;A.length<k;){var S=w.update(f).finalize(v);w.reset();for(var D=S.words,T=D.length,F=S,O=1;O<C;O++){F=w.finalize(F),w.reset();for(var N=F.words,R=0;R<T;R++)D[R]^=N[R]}j.concat(S),q[0]++}return j.sigBytes=k*4,j}});t.PBKDF2=function(g,f,x){return y.create(x).compute(g,f)}})(),o.PBKDF2})})(zt)),zt.exports}var qt={exports:{}},sq=qt.exports,Hh;function Cn(){return Hh||(Hh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Eb(),pl())})(sq,function(o){return(function(){var t=o,u=t.lib,l=u.Base,m=u.WordArray,c=t.algo,h=c.MD5,d=c.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,g){for(var f,x=this.cfg,w=x.hasher.create(),j=m.create(),v=j.words,A=x.keySize,q=x.iterations;v.length<A;){f&&w.update(f),f=w.update(y).finalize(g),w.reset();for(var k=1;k<q;k++)f=w.finalize(f),w.reset();j.concat(f)}return j.sigBytes=A*4,j}});t.EvpKDF=function(y,g,f){return d.create(f).compute(y,g)}})(),o.EvpKDF})})(qt)),qt.exports}var jt={exports:{}},tq=jt.exports,Lh;fuLine truncated
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return o.mode.CTRGladman=(function(){var t=o.lib.BlockCipherMode.extend();function u(c){if((c>>24&255)===255){var h=c>>16&255,d=c>>8&255,y=c&255;h===255?(h=0,d===255?(d=0,y===255?y=0:++y):++d):++h,c=0,c+=h<<16,c+=d<<8,c+=y}else c+=1<<24;return c}function l(c){return(c[0]=u(c[0]))===0&&(c[1]=u(c[1])),c}var m=t.Encryptor=t.extend({processBlock:function(c,h){var d=this._cipher,y=d.blockSize,g=this._iv,f=this._counter;g&&(f=this._counter=g.slice(0),this._iv=void 0),l(f);var x=f.slice(0);d.encryptBlock(x,0);for(var w=0;w<y;w++)c[h+w]^=x[w]}});return t.Decryptor=m,t})(),o.mode.CTRGladman})})(Et)),Et.exports}var St={exports:{}},hq=St.exports,Gh;function gq(){return Gh||(Gh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(hq,function(o){return o.mode.OFB=(function(){var t=o.lib.BlockCipherMode.extend(),u=t.Encryptor=t.extend({processBlock:function(l,m){var c=this._cipher,h=c.blockSize,d=this._iv,y=this._keystream;d&&(y=this._keystream=d.slice(0),this._iv=void 0),c.encryptBlock(y,0);for(var g=0;g<h;g++)l[m+g]^=y[g]}});return t.Decryptor=u,t})(),o.mode.OFB})})(St)),St.exports}var Bt={exports:{}},yq=Bt.exports,Qh;function bq(){return Qh||(Qh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(yq,function(o){return o.mode.ECB=(function(){var t=o.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(u,l){this._cipher.encryptBlock(u,l)}}),t.Decryptor=t.extend({processBlock:function(u,l){this._cipher.decryptBlock(u,l)}}),t})(),o.mode.ECB})})(Bt)),Bt.exports}var _t={exports:{}},fq=_t.exports,$h;function vq(){return $h||($h=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(fq,function(o){return o.pad.AnsiX923={pad:function(t,u){var l=t.sigBytes,m=u*4,c=m-l%m,h=l+c-1;t.clamp(),t.words[h>>>2]|=c<<24-h%4*8,t.sigBytes+=c},unpad:function(t){var u=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=u}},o.pad.Ansix923})})(_t)),_t.exports}var Dt={exports:{}},kq=Dt.exports,Kh;function wq(){return Kh||(Kh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(kq,function(o){return o.pad.Iso10126={pad:function(t,u){var l=u*4,m=l-t.sigBytes%l;t.concat(o.lib.WordArray.random(m-1)).concat(o.lib.WordArray.create([m<<24],1))},unpad:function(t){var u=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=u}},o.pad.Iso10126})})(Dt)),Dt.exports}var Ft={exports:{}},xq=Ft.exports,Yh;function zq(){return Yh||(Yh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(xq,function(o){return o.pad.Iso97971={pad:function(t,u){t.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(t,u)},unpad:function(t){o.pad.ZeroPadding.unpad(t),t.sigBytes--}},o.pad.Iso97971})})(Ft)),Ft.exports}var Rt={exports:{}},qq=Rt.exports,Zh;function jq(){return Zh||(Zh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(qq,function(o){return o.pad.ZeroPadding={pad:function(t,u){var l=u*4;t.clamp(),t.sigBytes+=l-(t.sigBytes%l||l)},unpad:function(t){for(var u=t.words,l=t.sigBytes-1,l=t.sigBytes-1;l>=0;l--)if(u[l>>>2]>>>24-l%4*8&255){t.sigBytes=l+1;break}}},o.pad.ZeroPadding})})(Rt)),Rt.exports}var Tt={exports:{}},Aq=Tt.exports,Xh;function Cq(){return Xh||(Xh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(Aq,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(Tt)),Tt.exports}var Pt={exports:{}},Eq=Pt.exports,Jh;function Sq(){return Jh||(Jh=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Ri())})(Eq,function(o){return(function(t){var u=o,l=u.lib,m=l.CipherParams,c=u.enc,h=c.Hex,d=u.format;d.Hex={stringify:function(y){return y.ciphertext.toString(h)},parse:function(y){var g=h.parse(y);return m.create({ciphertext:g})}}})(),o.format.Hex})})(Pt)),Pt.exports}var Nt={exports:{}},Bq=Nt.exports,eg;function _q(){return eg||(eg=1,(function(a,r){(function(o,t,u){a.exports=t(Le(),Xn(),Jn(),Cn(),Ri())})(Bq,function(o){return(function(){var t=o,u=t.lib,l=u.BlockCipher,m=t.algo,c=[],h=[],d=[],y=[],g=[],f=[],x=[],w=[],j=[],v=[];(function(){for(var k=[],C=0;C<256;C++)C<128?k[C]=C<<1:k[C]=C<<1^283;for(var S=0,D=0,C=0;C<256;C++){var T=D^D<<1^D<<2^D<<3^D<<4;T=T>>>8^T&255^99,c[S]=T,h[T]=S;var F=k[S],O=k[F],N=k[O],R=k[T]*257^T*16843008;d[S]=R<<24|R>>>8,y[S]=R<<16|R>>>16,g[S]=R<<8|R>>>24,f[S]=R;var R=N*16843009^O*65537^F*257^S*16843008;x[T]=R<<24|R>>>8,w[T]=R<<16|R>>>16,j[T]=R<<8|R>>>24,v[T]=R,S?(S=F^k[k[k[N^F]]],D^=k[k[D]]):S=D=1}})();var A=[0,1,2,4,8,16,32,64,128,27,54],q=m.AES=l.extend({_doReset:function(){var k;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var C=this._keyPriorReset=this._key,S=C.words,D=C.sigBytes/4,T=this._nRounds=D+6,F=(T+1)*4,O=this._keySchedule=[],N=0;N<F;N++)N<D?O[N]=S[N]:(k=O[N-1],N%D?D>6&&N%D==4&&(k=c[k>>>24]<<24|c[k>>>16&255]<<16|c[k>>>8&255]<<8|c[k&255]):(k=k<<8|k>>>24,k=c[k>>>24]<<24|c[k>>>16&255]<<16|c[k>>>8&255]<<8|c[k&255],k^=A[N/D|0]<<24),O[N]=O[N-D]^k);for(var R=this._invKeySchedule=[],V=0;V<F;V++){var N=F-V;if(V%4)var k=O[N];else var k=O[N-4];V<4||N<=4?R[V]=k:R[V]=x[c[k>>>24]]^w[c[k>>>16&255]]^j[c[k>>>8&255]]^v[c[k&255]]}}},encryptBlock:Line truncated
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
|
||||
• Request Data (remaining bytes) - additional request-specific data`,startByte:c+h,endByte:c+u.length-1,value:f});const x={type:a.PayloadType.Request,version:a.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:a.RequestType.GetStats,requestData:"",destinationHash:d,sourceHash:y,cipherMac:g,ciphertext:f};return l!=null&&l.includeSegments&&(x.segments=m),x}catch(m){return{type:a.PayloadType.Request,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode request payload"],timestamp:0,requestType:a.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return jr.RequestPayloadDecoder=o,jr}var Ar={},zg;function mj(){if(zg)return Ar;zg=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.ResponsePayloadDecoder=void 0;const a=ua(),r=Mi();class o{static decode(u,l){try{if(u.length<4){const w={type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),w}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const y=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:y}),h+=1;const g=(0,r.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:g}),h+=2;const f=(0,r.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&m.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:c+h,endByte:c+u.length-1,value:f});const x={type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:y,cipherMac:g,ciphertext:f,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(x.segments=m),x}catch(m){return{type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ar.ResponsePayloadDecoder=o,Ar}var Cr={},qg;function hj(){if(qg)return Cr;qg=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.AnonRequestPayloadDecoder=void 0;const a=ua(),r=Mi();class o{static decode(u,l){try{if(u.length<35){const w={type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),w}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,r.byteToHex)(u[0]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${d}`,startByte:c+h,endByte:c+h,value:d}),h+=1;const y=(0,r.bytesToHex)(u.subarray(1,33));l!=null&&l.includeSegments&&m.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:c+h,endByte:c+h+31,value:y}),h+=32;const g=(0,r.bytesToHex)(u.subarray(33,35));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:c+h,endByte:c+h+1,value:g}),h+=2;const f=(0,r.bytesToHex)(u.subarray(35));l!=null&&l.includeSegments&&u.length>35&&m.push({name:"Ciphertext",description:`Encrypted message data (${u.length-35} bytes). Contains encrypted plaintext with this structure:
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
|
||||
• Password (remaining bytes) - password for repeater/room`,startByte:c+h,endByte:c+u.length-1,value:f});const x={type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,senderPublicKey:y,cipherMac:g,ciphertext:f,ciphertextLength:u.length-35};return l!=null&&l.includeSegments&&(x.segments=m),x}catch(m){return{type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Cr.AnonRequestPayloadDecoder=o,Cr}var Er={},jg;function gj(){if(jg)return Er;jg=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.AckPayloadDecoder=void 0;const a=ua(),r=Mi();class o{static decode(u,l){try{if(u.length<4){const y={type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(y.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),y}const m=[],c=(l==null?void 0:l.segmentOffset)||0,h=(0,r.bytesToHex)(u.subarray(0,4));l!=null&&l.includeSegments&&m.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${h}`,startByte:c,endByte:c+3,value:h}),l!=null&&l.includeSegments&&u.length>4&&m.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:c+4,endByte:c+u.length-1,value:(0,r.bytesToHex)(u.subarray(4))});const d={type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!0,checksum:h};return l!=null&&l.includeSegments&&(d.segments=m),d}catch(m){return{type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode Ack payload"],checksum:""}}}}return Er.AckPayloadDecoder=o,Er}var Sr={},Ag;function yj(){if(Ag)return Sr;Ag=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.PathPayloadDecoder=void 0;const a=ua(),r=Mi();class o{static decode(u){try{if(u.length<2)return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=u[0];if(u.length<1+l+1)return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const m=[];for(let d=0;d<l;d++)m.push((0,r.byteToHex)(u[1+d]));const c=u[1+l];let h="";return u.length>1+l+1&&(h=(0,r.bytesToHex)(u.subarray(1+l+1))),{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:m,extraType:c,extraData:h}}catch(l){return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Sr.PathPayloadDecoder=o,Sr}var Br={},Cg;function bj(){if(Cg)return Br;Cg=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.TextMessagePayloadDecoder=void 0;const a=ua(),r=Mi();class o{static decode(u,l){try{if(u.length<4){const w={type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(w.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),w}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const y=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:y}),h+=1;const g=(0,r.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:g}),h+=2;const f=(0,r.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&m.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:c+h,endByte:c+u.length-1,value:f});const x={type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:y,cipherMac:g,ciphertext:f,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(x.segments=m),x}catch(m){return{type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,i
Line truncated
|
||||
// SHA256 round constants
|
||||
const K: array<u32, 64> = array<u32, 64>(
|
||||
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
|
||||
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
|
||||
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
|
||||
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
|
||||
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
|
||||
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
|
||||
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
|
||||
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
|
||||
);
|
||||
|
||||
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
|
||||
const CHARS: array<u32, 37> = array<u32, 37>(
|
||||
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
|
||||
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
|
||||
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
|
||||
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
|
||||
0x2du // dash
|
||||
);
|
||||
|
||||
struct Params {
|
||||
target_channel_hash: u32,
|
||||
batch_offset: u32,
|
||||
name_length: u32,
|
||||
batch_size: u32,
|
||||
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
|
||||
ciphertext_words: u32, // Number of 32-bit words in ciphertext
|
||||
ciphertext_len_bits: u32, // Length of ciphertext in bits
|
||||
verify_mac: u32, // 1 to verify MAC, 0 to skip
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> params: Params;
|
||||
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
|
||||
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
|
||||
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
|
||||
|
||||
fn rotr(x: u32, n: u32) -> u32 {
|
||||
return (x >> n) | (x << (32u - n));
|
||||
}
|
||||
|
||||
fn ch(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (~x & z);
|
||||
}
|
||||
|
||||
fn maj(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (x & z) ^ (y & z);
|
||||
}
|
||||
|
||||
fn sigma0(x: u32) -> u32 {
|
||||
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
|
||||
}
|
||||
|
||||
fn sigma1(x: u32) -> u32 {
|
||||
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
|
||||
}
|
||||
|
||||
fn gamma0(x: u32) -> u32 {
|
||||
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
|
||||
}
|
||||
|
||||
fn gamma1(x: u32) -> u32 {
|
||||
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
|
||||
}
|
||||
|
||||
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
|
||||
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
|
||||
// Message starts with '#' (0x23)
|
||||
var byte_pos = 0u;
|
||||
var word_idx = 0u;
|
||||
var current_word = 0x23000000u; // '#' in big-endian position 0
|
||||
byte_pos = 1u;
|
||||
|
||||
var remaining = idx;
|
||||
var prev_was_dash = false;
|
||||
|
||||
// Generate room name from index
|
||||
for (var i = 0u; i < length; i++) {
|
||||
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
|
||||
var char_idx = remaining % char_count;
|
||||
remaining = remaining / char_count;
|
||||
|
||||
// Check for consecutive dashes (invalid)
|
||||
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
|
||||
if (is_dash && prev_was_dash) {
|
||||
return false; // Invalid: consecutive dashes
|
||||
}
|
||||
prev_was_dash = is_dash;
|
||||
|
||||
// Map char index to actual character
|
||||
let c = CHARS[char_idx];
|
||||
|
||||
// Pack byte into current word (big-endian)
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u && byte_pos > 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0u;
|
||||
}
|
||||
current_word = current_word | (c << shift);
|
||||
byte_pos = byte_pos + 1u;
|
||||
}
|
||||
|
||||
// Add padding: 0x80 followed by zeros, then length in bits
|
||||
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
|
||||
|
||||
// Add 0x80 padding byte
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0x80000000u;
|
||||
} else {
|
||||
current_word = current_word | (0x80u << shift);
|
||||
}
|
||||
byte_pos = byte_pos + 1u;
|
||||
|
||||
// Store current word
|
||||
if (byte_pos % 4u == 0u || word_idx < 14u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
}
|
||||
|
||||
// Zero-fill until word 14
|
||||
for (var i = word_idx; i < 14u; i++) {
|
||||
(*msg)[i] = 0u;
|
||||
}
|
||||
|
||||
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
|
||||
(*msg)[14u] = 0u;
|
||||
(*msg)[15u] = msg_len_bits;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
|
||||
// Initialize hash values
|
||||
var h: array<u32, 8> = array<u32, 8>(
|
||||
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
|
||||
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
|
||||
);
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Compute SHA256 of the key (16 bytes) to get channel hash
|
||||
fn sha256_key(key: array<u32, 4>) -> u32 {
|
||||
var msg: array<u32, 16>;
|
||||
|
||||
// Key bytes (16 bytes = 4 words)
|
||||
msg[0] = key[0];
|
||||
msg[1] = key[1];
|
||||
msg[2] = key[2];
|
||||
msg[3] = key[3];
|
||||
|
||||
// Padding: 0x80 followed by zeros
|
||||
msg[4] = 0x80000000u;
|
||||
for (var i = 5u; i < 14u; i++) {
|
||||
msg[i] = 0u;
|
||||
}
|
||||
|
||||
// Length: 128 bits
|
||||
msg[14] = 0u;
|
||||
msg[15] = 128u;
|
||||
|
||||
let hash = sha256_block(&msg);
|
||||
|
||||
// Return first byte of hash (big-endian)
|
||||
return hash[0] >> 24u;
|
||||
}
|
||||
|
||||
// HMAC-SHA256 for MAC verification
|
||||
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
|
||||
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
|
||||
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
|
||||
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
|
||||
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
|
||||
// ipad = 0x36 repeated, opad = 0x5c repeated
|
||||
|
||||
// Build padded key (64 bytes = 16 words)
|
||||
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
|
||||
var k_pad: array<u32, 16>;
|
||||
k_pad[0] = key[0];
|
||||
k_pad[1] = key[1];
|
||||
k_pad[2] = key[2];
|
||||
k_pad[3] = key[3];
|
||||
for (var i = 4u; i < 16u; i++) {
|
||||
k_pad[i] = 0u;
|
||||
}
|
||||
|
||||
// Inner hash: SHA256((K' ^ ipad) || message)
|
||||
// First block: K' ^ ipad (64 bytes)
|
||||
var inner_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
inner_block[i] = k_pad[i] ^ 0x36363636u;
|
||||
}
|
||||
|
||||
// Initialize hash state with first block
|
||||
var h: array<u32, 8> = sha256_block(&inner_block);
|
||||
|
||||
// Process ciphertext blocks (continuing from h state)
|
||||
let ciphertext_words = params.ciphertext_words;
|
||||
var word_idx = 0u;
|
||||
|
||||
// Process full 64-byte blocks of ciphertext
|
||||
while (word_idx + 16u <= ciphertext_words) {
|
||||
var block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
block[i] = ciphertext[word_idx + i];
|
||||
}
|
||||
h = sha256_block_continue(&block, h);
|
||||
word_idx = word_idx + 16u;
|
||||
}
|
||||
|
||||
// Final block with remaining ciphertext + padding
|
||||
var final_block: array<u32, 16>;
|
||||
var remaining = ciphertext_words - word_idx;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
if (i < remaining) {
|
||||
final_block[i] = ciphertext[word_idx + i];
|
||||
} else if (i == remaining) {
|
||||
// Add 0x80 padding
|
||||
final_block[i] = 0x80000000u;
|
||||
} else {
|
||||
final_block[i] = 0u;
|
||||
}
|
||||
}
|
||||
|
||||
// Add length (64 bytes of ipad + ciphertext length)
|
||||
let total_bits = 512u + params.ciphertext_len_bits;
|
||||
if (remaining < 14u) {
|
||||
final_block[14] = 0u;
|
||||
final_block[15] = total_bits;
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
} else {
|
||||
// Need extra block for length
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
var len_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 14u; i++) {
|
||||
len_block[i] = 0u;
|
||||
}
|
||||
len_block[14] = 0u;
|
||||
len_block[15] = total_bits;
|
||||
h = sha256_block_continue(&len_block, h);
|
||||
}
|
||||
|
||||
let inner_hash = h;
|
||||
|
||||
// Outer hash: SHA256((K' ^ opad) || inner_hash)
|
||||
var outer_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
|
||||
}
|
||||
h = sha256_block(&outer_block);
|
||||
|
||||
// Second block: inner_hash (32 bytes) + padding
|
||||
var hash_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 8u; i++) {
|
||||
hash_block[i] = inner_hash[i];
|
||||
}
|
||||
hash_block[8] = 0x80000000u;
|
||||
for (var i = 9u; i < 14u; i++) {
|
||||
hash_block[i] = 0u;
|
||||
}
|
||||
hash_block[14] = 0u;
|
||||
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
|
||||
|
||||
h = sha256_block_continue(&hash_block, h);
|
||||
|
||||
// Return first 2 bytes (high 16 bits of first word)
|
||||
return h[0] & 0xFFFF0000u;
|
||||
}
|
||||
|
||||
// SHA256 block computation continuing from existing state
|
||||
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
|
||||
var h = h_in;
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Process a single candidate and record match if found
|
||||
fn process_candidate(name_idx: u32) {
|
||||
// Generate message for this room name
|
||||
var msg: array<u32, 16>;
|
||||
let valid = index_to_room_name(name_idx, params.name_length, &msg);
|
||||
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute SHA256("#roomname") - this gives us the key
|
||||
let key_hash = sha256_block(&msg);
|
||||
|
||||
// Take first 16 bytes (4 words) as the key
|
||||
var key: array<u32, 4>;
|
||||
key[0] = key_hash[0];
|
||||
key[1] = key_hash[1];
|
||||
key[2] = key_hash[2];
|
||||
key[3] = key_hash[3];
|
||||
|
||||
// Compute SHA256(key) to get channel hash
|
||||
let channel_hash = sha256_key(key);
|
||||
|
||||
// Check if channel hash matches target
|
||||
if (channel_hash != params.target_channel_hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Channel hash matches - verify MAC if enabled
|
||||
if (params.verify_mac == 1u) {
|
||||
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
|
||||
if (computed_mac != params.target_mac) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Found a match - record the index
|
||||
let match_idx = atomicAdd(&match_count, 1u);
|
||||
if (match_idx < 1024u) { // Limit stored matches
|
||||
match_indices[match_idx] = name_idx;
|
||||
}
|
||||
}
|
||||
|
||||
// Each thread processes 16 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 16u;
|
||||
|
||||
@compute @workgroup_size(256)
|
||||
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
||||
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
|
||||
|
||||
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
|
||||
let idx = base_idx + i;
|
||||
if (idx >= params.batch_size) {
|
||||
return;
|
||||
}
|
||||
let name_idx = params.batch_offset + idx;
|
||||
process_candidate(name_idx);
|
||||
}
|
||||
}
|
||||
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const r=await navigator.gpu.requestAdapter();if(!r)return console.warn("No GPU adapter found"),!1;this.device=await r.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let u=0;u<2;u++)this.matchCountReadBuffers[u]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[u]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),t=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:t,compute:{module:o,entryPoint:"main"}}),!0}catch(r){return console.error("WebGPU initialization failed:",r),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(r,o){return $n(o,r)}countNamesForLength(r){return Rr(r)}async runBatch(r,o,t,u,l,m){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const c=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const h=this.matchCountReadBuffers[c],d=this.matchIndicesReadBuffers[c],y=l&&m?1:0;let g,f=0,x=0;if(y){const S=new Uint8Array(l.length/2);for(let N=0;N<S.length;N++)S[N]=parseInt(l.substr(N*2,2),16);f=S.length*8;const D=Math.ceil(S.length/4)*4,T=new Uint8Array(D);T.set(S),g=new Uint32Array(D/4);for(let N=0;N<g.length;N++)g[N]=T[N*4]<<24|T[N*4+1]<<16|T[N*4+2]<<8|T[N*4+3];const F=parseInt(m.substr(0,2),16),O=parseInt(m.substr(2,2),16);x=F<<24|O<<16}else g=new Uint32Array([0]);const w=Math.max(g.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<w)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:w,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=w,this.bindGroupDirty=!0);const j=new Uint32Array([r,t,o,u,x,g.length,f,y]);this.device.queue.writeBuffer(this.paramsBuffer,0,j),this.device.queue.writeBuffer(this.ciphertextBuffer,0,g),this.device.queue.writeBuffer(this.matchCountBuffer,0,hl.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const v=this.device.createCommandEncoder(),A=v.beginComputePass();A.setPipeline(this.pipeline),A.setBindGroup(0,this.bindGroup),A.dispatchWorkgroups(Math.ceil(u/(256*16))),A.end(),v.copyBufferToBuffer(this.matchCountBuffer,0,h,0,4),v.copyBufferToBuffer(this.matchIndicesBuffer,0,d,0,1024*4),this.device.queue.submit([v.finish()]),await h.mapAsync(GPUMapMode.READ);const k=new Uint32Array(h.getMappedRange())[0];h.unmap();const C=[];if(k>0){await d.mapAsync(GPUMapMode.READ);const S=new Uint32Array(d.getMappedRange());for(let D=0;D<Math.min(k,1024);D++)C.push(S[D]);d.unmap()}return C}destroy(){var r,o,t,u,l,m,c,h;(r=this.paramsBuffer)==null||r.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(t=this.matchIndicesBuffer)==null||t.destroy(),(u=this.ciphertextBuffer)==null||u.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(m=this.matchCountReadBuffers[1])==null||m.destroy(),(c=this.matchIndicesReadBuffers[0])==null||c.destroy(),(h=this.matchIndicesReadBuffers[1])==null||h.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}hl.ZERO_DATA=new Uint32Array([0]);function _j(){return typeof navigator<"u"&&"gpu"in navigator}class Ng{runBatch(r,o,t,u,l,m){const c=[],h=r.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);this.wordlist=u.filter(Ig)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter(Ig)}abort(){this.abortFlag=!0}isGpuAvailable(){return _j()}async decodePacket(r){var t;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const l=(t=(await Rg.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:t.decoded;return!(l!=null&&l.channelHash)||!(l!=null&&l.ciphertext)||!(l!=null&&l.cipherMac)?null:{channelHash:l.channelHash,ciphertext:l.ciphertext,cipherMac:l.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,t){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0,this.validSeconds=(o==null?void 0:o.validSeconds)??_u,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const u=(o==null?void 0:o.maxLength)??8,l=(o==null?void 0:o.startingLength)??1,m=(o==null?void 0:o.useDictionary)??!0,c=(o==null?void 0:o.startFromType)??"bruteforce",h=r.toLowerCase(),d=await this.decodePacket(h);if(!d)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:y,ciphertext:g,cipherMac:f}=d,x=parseInt(y,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new Ng):this.gpuInstance||(this.gpuInstance=new hl,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new Ng));const w=performance.now();let j=0,v=performance.now(),A=l,q=0,k=0,C=!1;if(o!=null&&o.startFrom){const H=o.startFrom.toLowerCase();if(c==="dictionary"){const $=this.wordlist.indexOf(H);$>=0&&(k=$+1)}else{C=!0;const $=Ej(H);$&&(A=Math.max(l,$.length),q=$.index+1,q>=Rr(A)&&(A++,q=0))}}let S=0;m&&!C&&this.wordlist.length>0&&(S+=this.wordlist.length-k);for(let H=A;H<=u;H++)S+=Rr(H);S-=q;const D=(H,$,ae)=>{if(!t)return;const ie=(performance.now()-w)/1e3,W=ie>0?Math.round(j/ie):0,oe=S-j,ee=W>0?oe/W:0;t({checked:j,total:S,percent:S>0?Math.min(100,j/S*100):0,rateKeysPerSec:W,etaSeconds:ee,elapsedSeconds:ie,currentLength:$,currentPosition:ae,phase:H})},T=H=>{if(!Yb(g,f,H))return{valid:!1};const $=Rg.ChannelCrypto.decryptGroupTextMessage(g,f,H);return!$.success||!$.data?{valid:!1}:this.useTimestampFilter&&!Sj($.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Bj($.data.message)?{valid:!1}:{valid:!0,message:$.data.message}};if(!C&&k===0&&A===l&&q===0){D("public-key",0,Bu);const H=Fu(Gt);if(y===H){const $=T(Gt);if($.valid)return{found:!0,roomName:Bu,key:Gt,decryptedMessage:$.message}}}if(m&&!C&&this.wordlist.length>0)for(let H=k;H<this.wordlist.length;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[H],resumeType:"dictionary"};const $=this.wordlist[H],ae=Du("#"+$),J=Fu(ae);if(parseInt(J,16)===x){const W=T(ae);if(W.valid)return{found:!0,roomName:$,key:ae,decryptedMessage:W.message,resumeFrom:$,resumeType:"dictionary"}}j++;const ie=performance.now();ie-v>=200&&(D("wordlist",$.length,$),v=ie,await new Promise(W=>setTimeout(W,0)))}const F=this.useCpu?1024:32768,O=(o==null?void 0:o.gpuDispatchMs)??1e3;let N=F,R=!1;for(let H=A;H<=u;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(H,0)||void 0,resumeType:"bruteforce"};const $=Rr(H);let ae=H===A?q:0;for(;ae<$;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(H,ae)||void 0,resumeType:"bruteforce"};const J=Math.min(N,$-ae),ie=performance.now();let W;this.useCpu?W=this.cpuInstance.runBatch(x,H,ae,J,g,f):W=await this.gpuInstance.runBatch(x,H,ae,J,g,f);const oe=performance.now()-ie;if(j+=J,!this.useCpu&&!R&&J>=F&&oe>0){const z=O/oe,I=Math.round(J*z),L=Math.pow(2,Math.round(Math.log2(Math.max(F,I))));N=Math.max(F,L),R=!0}for(const z of W){const I=$n(H,z);if(!I)continue;const L=Du("#"+I),G=T(L);if(G.valid)return{found:!0,roomName:I,key:L,decryptedMessage:G.message,resumeFrom:I,resumeType:"bruteforce"}}ae+=J;const ee=performance.now();if(ee-v>=200){const z=$n(H,Math.min(ae,$-1))||"";D("bruteforce",H,z),v=ee,await new Promise(I=>setTimeout(I,0))}}}return{found:!1,resumeFrom:$n(u,Rr(u)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}const Pj=["a","aa","aaa","aah","aahed","aahing","aahs","aal","aalii","aaliis","aals","aam","aani","aardvark","aardvarks","aardwolf","aardwolves","aargh","aaron","aaronic","aaronical","aaronite","aaronitic","aarrgh","aarrghh","aaru","aas","aasvogel","aasvogels","ab","aba","ababdeh","ababua","abac","abaca","abacay","abacas","abacate","abacaxi","abaci","abacinate","abacination","abacisci","abaciscus","abacist","aback","abacli","abacot","abacterial","abactinal","abactinally","abaction","abactor","abaculi","abaculus","abacus","abacuses","abada","abaddon","abadejo","abadengo","abadia","abadite","abaff","abaft","abay","abayah","abaisance","abaised","abaiser","abaisse","abaissed","abaka","abakas","abalation","abalienate","abalienated","abalienating","abalienation","ab
Line truncated
|
||||
NoSleep enabled for older iOS devices. This can interrupt
|
||||
active or long-running network requests from completing successfully.
|
||||
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
|
||||
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(c=>(this.enabled=!0,c)).catch(c=>{throw this.enabled=!1,c})}disable(){t()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):o()?this.noSleepTimer&&(console.warn(`
|
||||
NoSleep now disabled for older iOS devices.
|
||||
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return fu=u,fu}var Mj=Ij();const Oj=Fo(Mj);function Hj({packets:a,channels:r,onChannelCreate:o,onRunningChange:t}){const[u,l]=B.useState(!1),[m,c]=B.useState(6),[h,d]=B.useState(!1),[y,g]=B.useState(!0),[f,x]=B.useState(!1),[w,j]=B.useState(null),[v,A]=B.useState(new Map),[q,k]=B.useState([]),[C,S]=B.useState(!1),[D,T]=B.useState(null),[F,O]=B.useState(null),N=B.useRef(null),R=B.useRef(null),V=B.useRef(!1),H=B.useRef(!1),$=B.useRef(!1),ae=B.useRef(new Map),J=B.useRef(!1),ie=B.useRef(6),W=B.useRef(!0),oe=B.useRef(!1),ee=B.useRef(new Set);B.useEffect(()=>{const le=new Tj;N.current=le,T(le.isGpuAvailable());const je=new Oj;return R.current=je,le.setWordlist(Pj),S(!0),()=>{le.destroy(),N.current=null,je.disable(),R.current=null}},[]),B.useEffect(()=>{const le=()=>{ii.getUndecryptedPacketCount().then(({count:Pe})=>O(Pe)).catch(()=>O(null))};le();const je=setInterval(le,3e4);return()=>clearInterval(je)},[]);const z=new Set(r.map(le=>le.key.toUpperCase())),I=a.filter(le=>le.payload_type==="GROUP_TEXT"&&!le.decrypted);B.useEffect(()=>{A(le=>{const je=new Map(le);let Pe=!1;for(const Ze of I)je.has(Ze.id)||(je.set(Ze.id,{packet:Ze,attempts:0,lastAttemptLength:0,status:"pending"}),Pe=!0);return Pe?(ae.current=je,je):le})},[I.length]),B.useEffect(()=>{ae.current=v},[v]),B.useEffect(()=>{J.current=h},[h]),B.useEffect(()=>{ie.current=m},[m]),B.useEffect(()=>{W.current=y},[y]),B.useEffect(()=>{oe.current=f},[f]),B.useEffect(()=>{ee.current=new Set(I.map(le=>le.id))},[I]),B.useEffect(()=>{t==null||t(u)},[u,t]);const L=Array.from(v.values()).filter(le=>le.status==="pending").length,G=Array.from(v.values()).filter(le=>le.status==="cracked").length,ue=Array.from(v.values()).filter(le=>le.status==="failed").length,he=B.useCallback(async()=>{if($.current||!N.current||!V.current)return;const le=ae.current;let je=null,Pe=null;for(const[_e,Ge]of le.entries())if(Ge.status==="pending"){je=Ge,Pe=_e;break}if(!je&&J.current){const _e=Array.from(le.entries()).filter(([,Ge])=>Ge.status==="failed"&&Ge.lastAttemptLength<10);_e.length>0&&(_e.sort((Ge,ei)=>Ge[1].lastAttemptLength-ei[1].lastAttemptLength),[Pe,je]=_e[0])}if(!je||Pe===null){V.current&&setTimeout(()=>he(),1e3);return}if(!ee.current.has(Pe)){A(_e=>{const Ge=new Map(_e);return Ge.delete(Pe),Ge}),V.current&&setTimeout(()=>he(),10);return}$.current=!0;const Ze=ie.current,Je=je.lastAttemptLength>0?je.lastAttemptLength+1:Ze;try{const _e=await N.current.crack(je.packet.data,{maxLength:Je,useTimestampFilter:!0,useUtf8Filter:!0,...oe.current&&{gpuDispatchMs:1e4}},Ge=>{j(Ge)});if(H.current){H.current=!1,$.current=!1,j(null);return}if(_e.found&&_e.roomName&&_e.key){A(Ve=>{const xi=new Map(Ve),ai=xi.get(Pe);return ai&&xi.set(Pe,{...ai,status:"cracked",attempts:ai.attempts+1,lastAttemptLength:Je}),xi});const Ge={roomName:_e.roomName,key:_e.key,packetId:Pe,message:_e.decryptedMessage||"",crackedAt:Date.now()};k(Ve=>[...Ve,Ge]);const ei=_e.key.toUpperCase();if(!z.has(ei))try{const Ve="#"+_e.roomName;await o(Ve,_e.key),W.current&&await ii.decryptHistoricalPackets({key_type:"channel",channel_name:Ve})}catch(Ve){console.error("Failed to create channel or decrypt historical:",Ve)}}else A(Ge=>{const ei=new Map(Ge),Ve=ei.get(Pe);return Ve&&ei.set(Pe,{...Ve,status:"failed",attempts:Ve.attempts+1,lastAttemptLength:Je}),ei})}catch(_e){console.error("Cracking error:",_e),A(Ge=>{const ei=new Map(Ge),Ve=ei.get(Pe);return Ve&&ei.set(Pe,{...Ve,status:"failed",attempts:Ve.attempts+1,lastAttemptLength:Je}),ei})}$.current=!1,j(null),V.current&&setTimeout(()=>he(),100)},[z,o]),ge=()=>{var le;if(!D){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}l(!0),V.current=!0,H.current=!1,(le=R.current)==null||le.enable(),he()},re=()=>{var le,je;l(!1),V.current=!1,H.current=!0,(le=N.current)==null||le.abort(),(je=R.current)==null||je.disable()};return _.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[_.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[_.jsx("button",{onClick:u?re:ge,disabled:!C||D===!1,className:Ke("px-4 py-1.5 rounded text-sm font-medium",u?"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:u?"Stop":"Start Cracking"}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),_.jsx("input",{type:"number",min:1,max:10,value:m,onChange:le=>c(Math.min(10,Math.max(1,parseInt(le.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),_.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:h,onChange:le=>d(le.target.checked),className:
Line truncated
|
||||
-532
@@ -1,532 +0,0 @@
|
||||
var Kv=Object.defineProperty;var Yv=(a,r,o)=>r in a?Kv(a,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[r]=o;var Hn=(a,r,o)=>Yv(a,typeof r!="symbol"?r+"":r,o);function Zv(a,r){for(var o=0;o<r.length;o++){const t=r[o];if(typeof t!="string"&&!Array.isArray(t)){for(const u in t)if(u!=="default"&&!(u in a)){const l=Object.getOwnPropertyDescriptor(t,u);l&&Object.defineProperty(a,u,l.get?l:{enumerable:!0,get:()=>t[u]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))t(u);new MutationObserver(u=>{for(const l of u)if(l.type==="childList")for(const m of l.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&t(m)}).observe(document,{childList:!0,subtree:!0});function o(u){const l={};return u.integrity&&(l.integrity=u.integrity),u.referrerPolicy&&(l.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?l.credentials="include":u.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function t(u){if(u.ep)return;u.ep=!0;const l=o(u);fetch(u.href,l)}})();var Yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fo(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function Lg(a){if(Object.prototype.hasOwnProperty.call(a,"__esModule"))return a;var r=a.default;if(typeof r=="function"){var o=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};o.prototype=r.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(a).forEach(function(t){var u=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(o,t,u.get?u:{enumerable:!0,get:function(){return a[t]}})}),o}var Zc={exports:{}},br={},Xc={exports:{}},Oe={};/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Im;function Xv(){if(Im)return Oe;Im=1;var a=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),t=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function f(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,j={};function v(z,I,H){this.props=z,this.context=I,this.refs=j,this.updater=H||w}v.prototype.isReactComponent={},v.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,I,"setState")},v.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function A(){}A.prototype=v.prototype;function q(z,I,H){this.props=z,this.context=I,this.refs=j,this.updater=H||w}var k=q.prototype=new A;k.constructor=q,x(k,v.prototype),k.isPureReactComponent=!0;var C=Array.isArray,S=Object.prototype.hasOwnProperty,D={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function F(z,I,H){var G,de={},ie=null,le=null;if(I!=null)for(G in I.ref!==void 0&&(le=I.ref),I.key!==void 0&&(ie=""+I.key),I)S.call(I,G)&&!T.hasOwnProperty(G)&&(de[G]=I[G]);var ae=arguments.length-2;if(ae===1)de.children=H;else if(1<ae){for(var Ae=Array(ae),Pe=0;Pe<ae;Pe++)Ae[Pe]=arguments[Pe+2];de.children=Ae}if(z&&z.defaultProps)for(G in ae=z.defaultProps,ae)de[G]===void 0&&(de[G]=ae[G]);return{$$typeof:a,type:z,key:ie,ref:le,props:de,_owner:D.current}}function O(z,I){return{$$typeof:a,type:z.type,key:I,ref:z.ref,props:z.props,_owner:z._owner}}function N(z){return typeof z=="object"&&z!==null&&z.$$typeof===a}function R(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(H){return I[H]})}var U=/\/+/g;function L(z,I){return typeof z=="object"&&z!==null&&z.key!=null?R(""+z.key):I.toString(36)}function Y(z,I,H,G,de){var ie=typeof z;(ie==="undefined"||ie==="boolean")&&(z=null);var le=!1;if(z===null)le=!0;else switch(ie){case"string":case"number":le=!0;break;case"object":switch(z.$$typeof){case a:case r:le=!0}}if(le)return le=z,de=de(le),z=G===""?"."+L(le,0):G,C(de)?(H="",z!=null&&(H=z.replace(U,"$&/")+"/"),Y(de,I,H,"",function(Pe){return Pe})):de!=null&&(N(de)&&(de=O(de,H+(!de.key||le&&le.key===de.key?"":(""+de.key).replace(U,"$&/")+"/")+z)),I.push(de)),1;if(le=0,G=G===""?".":G+":",C(z))for(var ae=0;ae<z.length;ae++){ie=z[ae];var Ae=G+L(ie,ae);le+=Y(ie,I,H,Ae,de)}else if(Ae=f(z),typeof Ae=="function")for(z=Ae.call(z),ae=0;!(ie=z.next()).done;)ie=ie.value,Ae=G+L(ie,ae++),le+=Y(ie,I,H,Ae,de);else if(ie==="object")throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return le}function re(z,I,H){if(z==null)return z;var G=[],de=0;return Y(z,G,"","",function(ie){return I.call(H,ie,de++)}),G}function J(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(H){(z._status===0||z._status===-1)&&(z._status=1,z._result=H)},function(H){(z._status===0||z._status===-1)&&(z._status=2,z._result=H)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var ne={current:null},W={transition:null},se={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:re,forEach:function(z,I,H){re(z,function(){I.apply(this,arguments)},H)},count:function(z){var I=0;return re(z,function(){I++}),I},toArray:function(z){return re(z,function(I){return I})||[]},only:function(z){if(!N(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Oe.Component=v,Oe.Fragment=o,Oe.Profiler=u,Oe.PureComponent=q,Oe.StrictMode=t,Oe.Suspense=h,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Oe.act=ee,Oe.cloneElement=function(z,I,H){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var G=x({},z.props),de=z.key,ie=z.ref,le=z._owner;if(I!=null){if(I.ref!==void 0&&(ie=I.ref,le=D.current),I.key!==void 0&&(de=""+I.key),z.type&&z.type.defaultProps)var ae=z.type.defaultProps;for(Ae in I)S.call(I,Ae)&&!T.hasOwnProperty(Ae)&&(G[Ae]=I[Ae]===void 0&&ae!==void 0?ae[Ae]:I[Ae])}var Ae=arguments.length-2;if(Ae===1)G.children=H;else if(1<Ae){ae=Array(Ae);for(var Pe=0;Pe<Ae;Pe++)ae[Pe]=arguments[Pe+2];G.children=ae}return{$$typeof:a,type:z.type,key:de,ref:ie,props:G,_owner:le}},Oe.createContLine truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Om;function Jv(){if(Om)return br;Om=1;var a=Ru(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function m(c,h,d){var y,g={},f=null,w=null;d!==void 0&&(f=""+d),h.key!==void 0&&(f=""+h.key),h.ref!==void 0&&(w=h.ref);for(y in h)t.call(h,y)&&!l.hasOwnProperty(y)&&(g[y]=h[y]);if(c&&c.defaultProps)for(y in h=c.defaultProps,h)g[y]===void 0&&(g[y]=h[y]);return{$$typeof:r,type:c,key:f,ref:w,props:g,_owner:u.current}}return br.Fragment=o,br.jsx=m,br.jsxs=m,br}var Hm;function ek(){return Hm||(Hm=1,Zc.exports=Jv()),Zc.exports}var _=ek(),B=Ru();const he=Fo(B),Tu=Zv({__proto__:null,default:he},[B]);var Ks={},Jc={exports:{}},aa={},eu={exports:{}},iu={};/**
|
||||
* @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 Lm;function ik(){return Lm||(Lm=1,(function(a){function r(W,se){var ee=W.length;W.push(se);e:for(;0<ee;){var z=ee-1>>>1,I=W[z];if(0<u(I,se))W[z]=se,W[ee]=I,ee=z;else break e}}function o(W){return W.length===0?null:W[0]}function t(W){if(W.length===0)return null;var se=W[0],ee=W.pop();if(ee!==se){W[0]=ee;e:for(var z=0,I=W.length,H=I>>>1;z<H;){var G=2*(z+1)-1,de=W[G],ie=G+1,le=W[ie];if(0>u(de,ee))ie<I&&0>u(le,de)?(W[z]=le,W[ie]=ee,z=ie):(W[z]=de,W[G]=ee,z=G);else if(ie<I&&0>u(le,ee))W[z]=le,W[ie]=ee,z=ie;else break e}}return se}function u(W,se){var ee=W.sortIndex-se.sortIndex;return ee!==0?ee:W.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;a.unstable_now=function(){return l.now()}}else{var m=Date,c=m.now();a.unstable_now=function(){return m.now()-c}}var h=[],d=[],y=1,g=null,f=3,w=!1,x=!1,j=!1,v=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(W){for(var se=o(d);se!==null;){if(se.callback===null)t(d);else if(se.startTime<=W)t(d),se.sortIndex=se.expirationTime,r(h,se);else break;se=o(d)}}function C(W){if(j=!1,k(W),!x)if(o(h)!==null)x=!0,J(S);else{var se=o(d);se!==null&&ne(C,se.startTime-W)}}function S(W,se){x=!1,j&&(j=!1,A(F),F=-1),w=!0;var ee=f;try{for(k(se),g=o(h);g!==null&&(!(g.expirationTime>se)||W&&!R());){var z=g.callback;if(typeof z=="function"){g.callback=null,f=g.priorityLevel;var I=z(g.expirationTime<=se);se=a.unstable_now(),typeof I=="function"?g.callback=I:g===o(h)&&t(h),k(se)}else t(h);g=o(h)}if(g!==null)var H=!0;else{var G=o(d);G!==null&&ne(C,G.startTime-se),H=!1}return H}finally{g=null,f=ee,w=!1}}var D=!1,T=null,F=-1,O=5,N=-1;function R(){return!(a.unstable_now()-N<O)}function U(){if(T!==null){var W=a.unstable_now();N=W;var se=!0;try{se=T(!0,W)}finally{se?L():(D=!1,T=null)}}else D=!1}var L;if(typeof q=="function")L=function(){q(U)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,re=Y.port2;Y.port1.onmessage=U,L=function(){re.postMessage(null)}}else L=function(){v(U,0)};function J(W){T=W,D||(D=!0,L())}function ne(W,se){F=v(function(){W(a.unstable_now())},se)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(W){W.callback=null},a.unstable_continueExecution=function(){x||w||(x=!0,J(S))},a.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<W?Math.floor(1e3/W):5},a.unstable_getCurrentPriorityLevel=function(){return f},a.unstable_getFirstCallbackNode=function(){return o(h)},a.unstable_next=function(W){switch(f){case 1:case 2:case 3:var se=3;break;default:se=f}var ee=f;f=se;try{return W()}finally{f=ee}},a.unstable_pauseExecution=function(){},a.unstable_requestPaint=function(){},a.unstable_runWithPriority=function(W,se){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var ee=f;f=W;try{return se()}finally{f=ee}},a.unstable_scheduleCallback=function(W,se,ee){var z=a.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?z+ee:z):ee=z,W){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=ee+I,W={id:y++,callback:se,priorityLevel:W,startTime:ee,expirationTime:I,sortIndex:-1},ee>z?(W.sortIndex=ee,r(d,W),o(h)===null&&W===o(d)&&(j?(A(F),F=-1):j=!0,ne(C,ee-z))):(W.sortIndex=I,r(h,W),x||w||(x=!0,J(S))),W},a.unstable_shouldYield=R,a.unstable_wrapCallback=function(W){var se=f;return function(){var ee=f;f=se;try{return W.apply(this,arguments)}finally{f=ee}}}})(iu)),iu}var Vm;function ak(){return Vm||(Vm=1,eu.exports=ik()),eu.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 Um;function nk(){if(Um)return aa;Um=1;var a=Ru(),r=ak();function o(e){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)i+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var t=new Set,u={};function l(e,i){m(e,i),m(e+"Capture",i)}function m(e,i){for(u[e]=i,e=0;e<i.length;e++)t.add(i[e])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},g={};function f(e){return h.call(g,e)?!0:h.call(y,e)?!1:d.test(e)?g[e]=!0:(y[e]=!0,!1)}function w(e,i,n,s){if(n!==null&&n.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x(e,i,n,s){if(i===null||typeof i>"u"||w(e,i,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function j(e,i,n,s,p,b,E){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=s,this.attributeNamespace=p,this.mustUseProperty=n,this.propertyName=e,this.type=i,this.sanitizeURL=b,this.removeEmptyString=E}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var i=e[0];v[i]=new j(i,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new j(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){v[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var i=e.replace(A,q);v[i]=new j(i,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var i=e.replace(A,q);v[i]=new j(i,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var i=e.replace(A,q);v[i]=new j(i,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(e,i,n,s){var p=v.hasOwnProperty(i)?v[i]:null;(p!==null?p.type!==0:s||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=
Line truncated
|
||||
`+z+e}var H=!1;function G(e,i){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(X){var s=X}Reflect.construct(e,[],i)}else{try{i.call()}catch(X){s=X}e.call(i.prototype)}else{try{throw Error()}catch(X){s=X}e()}}catch(X){if(X&&s&&typeof X.stack=="string"){for(var p=X.stack.split(`
|
||||
`),b=s.stack.split(`
|
||||
`),E=p.length-1,P=b.length-1;1<=E&&0<=P&&p[E]!==b[P];)P--;for(;1<=E&&0<=P;E--,P--)if(p[E]!==b[P]){if(E!==1||P!==1)do if(E--,P--,0>P||p[E]!==b[P]){var M=`
|
||||
`+p[E].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=E&&0<=P);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function de(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1),e;case 11:return e=G(e.type.render,!1),e;case 1:return e=G(e.type,!0),e;default:return""}}function ie(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 T:return"Fragment";case D:return"Portal";case O:return"Profiler";case F:return"StrictMode";case L:return"Suspense";case Y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:return(e.displayName||"Context")+".Consumer";case N:return(e._context.displayName||"Context")+".Provider";case U:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return i=e.displayName||null,i!==null?i:ie(e.type)||"Memo";case J:i=e._payload,e=e._init;try{return ie(e(i))}catch{}}return null}function le(e){var i=e.type;switch(e.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=i.render,e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ie(i);case 8:return i===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function ae(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ae(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Pe(e){var i=Ae(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,i),s=""+e[i];if(!e.hasOwnProperty(i)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var p=n.get,b=n.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return p.call(this)},set:function(E){s=""+E,b.call(this,E)}}),Object.defineProperty(e,i,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Re(e){e._valueTracker||(e._valueTracker=Pe(e))}function Ne(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var n=i.getValue(),s="";return e&&(s=Ae(e)?e.checked?"true":"false":e.value),e=s,e!==n?(i.setValue(e),!0):!1}function Ue(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 _e(e,i){var n=i.checked;return ee({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ci(e,i){var n=i.defaultValue==null?"":i.defaultValue,s=i.checked!=null?i.checked:i.defaultChecked;n=ae(i.value!=null?i.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function yi(e,i){i=i.checked,i!=null&&k(e,"checked",i,!1)}function Ei(e,i){yi(e,i);var n=ae(i.value),s=i.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}i.hasOwnProperty("value")?ci(e,i.type,n):i.hasOwnProperty("defaultValue")&&ci(e,i.type,ae(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(e.defaultChecked=!!i.defaultChecked)}function Wi(e,i,n){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var s=i.type;if(!(s!=="submit"&&s!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+e._wrapperState.initialValue,n||i===e.value||(e.value=i),e.defaultValue=i}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ci(e,i,n){(i!=="number"||Ue(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ri=Array.isArray;function ai(e,i,n,s){if(e=e.options,i){i={};for(var p=0;p<n.length;p++)i["$"+n[p]]=!0;for(n=0;n<e.length;n++)p=i.hasOwnProperty("$"+e[n].value),e[n].selected!==p&&(e[n].selected=p),p&&s&&(e[n].defaultSelected=!0)}else{for(n=""+ae(n),i=null,p=0;p<e.length;p++){if(e[p].value===n){e[p].selected=!0,s&&(e[p].defaultSelected=!0);return}i!==null||e[p].disabled||(i=e[p])}i!==null&&(i.selected=!0)}}function Ge(e,i){if(i.dangerouslySetInnerHTML!
Line truncated
|
||||
`).replace(lv,"")}function ls(e,i,n){if(i=np(i),np(e)!==i&&n)throw Error(o(425))}function cs(){}var Hl=null,Ll=null;function Vl(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ul=typeof setTimeout=="function"?setTimeout:void 0,cv=typeof clearTimeout=="function"?clearTimeout:void 0,op=typeof Promise=="function"?Promise:void 0,uv=typeof queueMicrotask=="function"?queueMicrotask:typeof op<"u"?function(e){return op.resolve(null).then(e).catch(dv)}:Ul;function dv(e){setTimeout(function(){throw e})}function Wl(e,i){var n=i,s=0;do{var p=n.nextSibling;if(e.removeChild(n),p&&p.nodeType===8)if(n=p.data,n==="/$"){if(s===0){e.removeChild(p),Uo(i);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=p}while(n);Uo(i)}function un(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return e}function rp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(i===0)return e;i--}else n==="/$"&&i++}e=e.previousSibling}return null}var so=Math.random().toString(36).slice(2),Fa="__reactFiber$"+so,ir="__reactProps$"+so,Va="__reactContainer$"+so,Gl="__reactEvents$"+so,pv="__reactListeners$"+so,mv="__reactHandles$"+so;function Sn(e){var i=e[Fa];if(i)return i;for(var n=e.parentNode;n;){if(i=n[Va]||n[Fa]){if(n=i.alternate,i.child!==null||n!==null&&n.child!==null)for(e=rp(e);e!==null;){if(n=e[Fa])return n;e=rp(e)}return i}e=n,n=e.parentNode}return null}function ar(e){return e=e[Fa]||e[Va],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function to(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function us(e){return e[ir]||null}var Ql=[],lo=-1;function dn(e){return{current:e}}function oi(e){0>lo||(e.current=Ql[lo],Ql[lo]=null,lo--)}function ei(e,i){lo++,Ql[lo]=e.current,e.current=i}var pn={},Oi=dn(pn),Zi=dn(!1),Bn=pn;function co(e,i){var n=e.type.contextTypes;if(!n)return pn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===i)return s.__reactInternalMemoizedMaskedChildContext;var p={},b;for(b in n)p[b]=i[b];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=p),p}function Xi(e){return e=e.childContextTypes,e!=null}function ds(){oi(Zi),oi(Oi)}function sp(e,i,n){if(Oi.current!==pn)throw Error(o(168));ei(Oi,i),ei(Zi,n)}function tp(e,i,n){var s=e.stateNode;if(i=i.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var p in s)if(!(p in i))throw Error(o(108,le(e)||"Unknown",p));return ee({},n,s)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pn,Bn=Oi.current,ei(Oi,e),ei(Zi,Zi.current),!0}function lp(e,i,n){var s=e.stateNode;if(!s)throw Error(o(169));n?(e=tp(e,i,Bn),s.__reactInternalMemoizedMergedChildContext=e,oi(Zi),oi(Oi),ei(Oi,e)):oi(Zi),ei(Zi,n)}var Ua=null,ms=!1,$l=!1;function cp(e){Ua===null?Ua=[e]:Ua.push(e)}function hv(e){ms=!0,cp(e)}function mn(){if(!$l&&Ua!==null){$l=!0;var e=0,i=Ze;try{var n=Ua;for(Ze=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}Ua=null,ms=!1}catch(p){throw Ua!==null&&(Ua=Ua.slice(e+1)),dd(yl,mn),p}finally{Ze=i,$l=!1}}return null}var uo=[],po=0,hs=null,gs=0,pa=[],ma=0,_n=null,Wa=1,Ga="";function Dn(e,i){uo[po++]=gs,uo[po++]=hs,hs=e,gs=i}function up(e,i,n){pa[ma++]=Wa,pa[ma++]=Ga,pa[ma++]=_n,_n=e;var s=Wa;e=Ga;var p=32-xa(s)-1;s&=~(1<<p),n+=1;var b=32-xa(i)+p;if(30<b){var E=p-p%5;b=(s&(1<<E)-1).toString(32),s>>=E,p-=E,Wa=1<<32-xa(i)+p|n<<p|s,Ga=b+e}else Wa=1<<b|n<<p|s,Ga=e}function Kl(e){e.return!==null&&(Dn(e,1),up(e,1,0))}function Yl(e){for(;e===hs;)hs=uo[--po],uo[po]=null,gs=uo[--po],uo[po]=null;for(;e===_n;)_n=pa[--ma],pa[ma]=null,Ga=pa[--ma],pa[ma]=null,Wa=pa[--ma],pa[ma]=null}var sa=null,ta=null,si=!1,qa=null;function dp(e,i){var n=ba(5,null,null,0);n.elementType="DELETED",n.stateNode=i,n.return=e,i=e.deletions,i===null?(e.deletions=[n],e.flags|=16):i.push(n)}function pp(e,i){switch(e.tag){case 5:var n=e.type;return i=i.nodeType!==1||n.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(e.stateNode=i,sa=e,ta=un(i.firstChild),!0):!1;case 6:return i=e.pendingProps===""||i.nodeType!==3?null:i,i!==null?(e.stateNode=i,sa=e,ta=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(n=_n!==null?{id:Wa,overflow:Ga}:null,e.memoizedState={dehydrated:i,treeContext:n,retryLane:1073741824},n=ba(18,null,null,0),n.stateNode=i,n.return=e,e.child=n,sa=e,ta=null,!0):!1;default:return!1}}function Zl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xl(e){if(si){var i=ta;if(i){var n=i;if(!pp(e,i)){if(Zl(e))throw Error(o(418));i=un(n.nextSibling);var s=sa;i&&pp(e,i)?dp(s,n):(e.flags=e.flags&-4097|2,si=!1,sa=e)}}else{if(Zl(e))throw Error(o(418));e.flags=e.flags&-4097|2,si=!1,sa=e}}}function mp(e){for(e=e
Line truncated
|
||||
Error generating stack: `+b.message+`
|
||||
`+b.stack}return{value:e,source:i,stack:p,digest:null}}function kc(e,i,n){return{value:e,source:null,stack:n??null,digest:i??null}}function wc(e,i){try{console.error(i.value)}catch(n){setTimeout(function(){throw n})}}var zv=typeof WeakMap=="function"?WeakMap:Map;function Qp(e,i,n){n=$a(-1,n),n.tag=3,n.payload={element:null};var s=i.value;return n.callback=function(){Ts||(Ts=!0,Pc=s),wc(e,i)},n}function $p(e,i,n){n=$a(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var p=i.value;n.payload=function(){return s(p)},n.callback=function(){wc(e,i)}}var b=e.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(n.callback=function(){wc(e,i),typeof s!="function"&&(bn===null?bn=new Set([this]):bn.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})}),n}function Kp(e,i,n){var s=e.pingCache;if(s===null){s=e.pingCache=new zv;var p=new Set;s.set(i,p)}else p=s.get(i),p===void 0&&(p=new Set,s.set(i,p));p.has(n)||(p.add(n),e=Nv.bind(null,e,i,n),i.then(e,e))}function Yp(e){do{var i;if((i=e.tag===13)&&(i=e.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return e;e=e.return}while(e!==null);return null}function Zp(e,i,n,s,p){return(e.mode&1)===0?(e===i?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(i=$a(-1,1),i.tag=2,gn(n,i,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var qv=C.ReactCurrentOwner,Ji=!1;function Gi(e,i,n,s){i.child=e===null?bp(i,null,n,s):ho(i,e.child,n,s)}function Xp(e,i,n,s,p){n=n.render;var b=i.ref;return yo(i,p),s=pc(e,i,n,s,b,p),n=mc(),e!==null&&!Ji?(i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~p,Ka(e,i,p)):(si&&n&&Kl(i),i.flags|=1,Gi(e,i,s,p),i.child)}function Jp(e,i,n,s,p){if(e===null){var b=n.type;return typeof b=="function"&&!Vc(b)&&b.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(i.tag=15,i.type=b,em(e,i,b,s,p)):(e=Hs(n.type,null,s,i,i.mode,p),e.ref=i.ref,e.return=i,i.child=e)}if(b=e.child,(e.lanes&p)===0){var E=b.memoizedProps;if(n=n.compare,n=n!==null?n:Yo,n(E,s)&&e.ref===i.ref)return Ka(e,i,p)}return i.flags|=1,e=wn(b,s),e.ref=i.ref,e.return=i,i.child=e}function em(e,i,n,s,p){if(e!==null){var b=e.memoizedProps;if(Yo(b,s)&&e.ref===i.ref)if(Ji=!1,i.pendingProps=s=b,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Ji=!0);else return i.lanes=e.lanes,Ka(e,i,p)}return xc(e,i,n,s,p)}function im(e,i,n){var s=i.pendingProps,p=s.children,b=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ei(ko,la),la|=n;else{if((n&1073741824)===0)return e=b!==null?b.baseLanes|n:n,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:e,cachePool:null,transitions:null},i.updateQueue=null,ei(ko,la),la|=e,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=b!==null?b.baseLanes:n,ei(ko,la),la|=s}else b!==null?(s=b.baseLanes|n,i.memoizedState=null):s=n,ei(ko,la),la|=s;return Gi(e,i,p,n),i.child}function am(e,i){var n=i.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(i.flags|=512,i.flags|=2097152)}function xc(e,i,n,s,p){var b=Xi(n)?Bn:Oi.current;return b=co(i,b),yo(i,p),n=pc(e,i,n,s,b,p),s=mc(),e!==null&&!Ji?(i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~p,Ka(e,i,p)):(si&&s&&Kl(i),i.flags|=1,Gi(e,i,n,p),i.child)}function nm(e,i,n,s,p){if(Xi(n)){var b=!0;ps(i)}else b=!1;if(yo(i,p),i.stateNode===null)Bs(e,i),Wp(i,n,s),vc(i,n,s,p),s=!0;else if(e===null){var E=i.stateNode,P=i.memoizedProps;E.props=P;var M=E.context,X=n.contextType;typeof X=="object"&&X!==null?X=ha(X):(X=Xi(n)?Bn:Oi.current,X=co(i,X));var ce=n.getDerivedStateFromProps,ue=typeof ce=="function"||typeof E.getSnapshotBeforeUpdate=="function";ue||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(P!==s||M!==X)&&Gp(i,E,s,X),hn=!1;var te=i.memoizedState;E.state=te,ws(i,s,E,p),M=i.memoizedState,P!==s||te!==M||Zi.current||hn?(typeof ce=="function"&&(fc(i,n,ce,s),M=i.memoizedState),(P=hn||Up(i,n,P,s,te,M,X))?(ue||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(i.flags|=4194308)):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=s,i.memoizedState=M),E.props=s,E.state=M,E.context=X,s=P):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),s=!1)}else{E=i.stateNode,vp(e,i),P=i.memoizedProps,X=i.type===i.elementType?P:ja(i.type,P),E.props=X,ue=i.pendingProps,te=E.context,M=n.contextType,typeof M=="object"&&M!==null?M=ha(M):(M=Xi(n)?Bn:Oi.current,M=co(i,M));var ye=n.getDerivedStateFromProps;(ce=typeof ye=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(P!==ue||te!==M)&&Gp(i,E,s,M),hn=!1,te=i.memoizedState,E
Line truncated
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const lk=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ck=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,t)=>t?t.toUpperCase():o.toLowerCase()),Qm=a=>{const r=ck(a);return r.charAt(0).toUpperCase()+r.slice(1)},Ug=(...a)=>a.filter((r,o,t)=>!!r&&r.trim()!==""&&t.indexOf(r)===o).join(" ").trim(),uk=a=>{for(const r in a)if(r.startsWith("aria-")||r==="role"||r==="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 dk={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 pk=B.forwardRef(({color:a="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:t,className:u="",children:l,iconNode:m,...c},h)=>B.createElement("svg",{ref:h,...dk,width:r,height:r,stroke:a,strokeWidth:t?Number(o)*24/Number(r):o,className:Ug("lucide",u),...!l&&!uk(c)&&{"aria-hidden":"true"},...c},[...m.map(([d,y])=>B.createElement(d,y)),...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 Pu=(a,r)=>{const o=B.forwardRef(({className:t,...u},l)=>B.createElement(pk,{ref:l,iconNode:r,className:Ug(`lucide-${lk(Qm(a))}`,`lucide-${a}`,t),...u}));return o.displayName=Qm(a),o};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const mk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hk=Pu("check",mk);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const gk=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],yk=Pu("menu",gk);/**
|
||||
* @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 bk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wg=Pu("x",bk);var Gg=Vg();const Qg=Fo(Gg);function fk(a){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r.appendChild(o),o.styleSheet?o.styleSheet.cssText=a:o.appendChild(document.createTextNode(a))}const vk=a=>{switch(a){case"success":return xk;case"info":return qk;case"warning":return zk;case"error":return jk;default:return null}},kk=Array(12).fill(0),wk=({visible:a,className:r})=>he.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":a},he.createElement("div",{className:"sonner-spinner"},kk.map((o,t)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),xk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),qk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ak=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ck=()=>{const[a,r]=he.useState(document.hidden);return he.useEffect(()=>{const o=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a};let vu=1;class Ek{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{const o=this.subscribers.indexOf(r);this.subscribers.splice(o,1)}),this.publish=r=>{this.subscribers.forEach(o=>o(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var o;const{message:t,...u}=r,l=typeof(r==null?void 0:r.id)=="number"||((o=r.id)==null?void 0:o.length)>0?r.id:vu++,m=this.toasts.find(h=>h.id===l),c=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),m?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...r,id:l,title:t}),{...h,...r,id:l,dismissible:c,title:t}):h):this.addToast({title:t,...u,dismissible:c,id:l}),l},this.dismiss=r=>(r?(this.dismissedToasts.add(r),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:r,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(t=>t({id:o.id,dismiss:!0}))}),r),this.message=(r,o)=>this.create({...o,message:r}),this.error=(r,o)=>this.create({...o,message:r,type:"error"}),this.success=(r,o)=>this.create({...o,type:"success",message:r}),this.info=(r,o)=>this.create({...o,type:"info",message:r}),this.warning=(r,o)=>this.create({...o,type:"warning",message:r}),this.loading=(r,o)=>this.create({...o,type:"loading",message:r}),this.promise=(r,o)=>{if(!o)return;let t;o.loading!==void 0&&(t=this.create({...o,promise:r,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const u=Promise.resolve(r instanceof Function?r():r);let l=t!==void 0,m;const c=u.then(async d=>{if(m=["resolve",d],he.isValidElement(d))l=!1,this.create({id:t,type:"default",message:d});else if(Bk(d)&&!d.ok){l=!1;const g=typeof o.error=="function"?await o.error(`HTTP error! status: ${d.status}`):o.error,f=typeof o.description=="function"?await o.description(`HTTP error! status: ${d.status}`):o.description,x=typeof g=="object"&&!he.isValidElement(g)?g:{message:g};this.create({id:t,type:"error",description:f,...x})}else if(d instanceof Error){l=!1;const g=typeof o.error=="function"?await o.error(d):o.error,Line truncated
|
||||
`).map((se,ee,z)=>_.jsxs("span",{children:[se,ee<z.length-1&&_.jsx("br",{})]},ee)),!Y&&_.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:sh(C.sender_timestamp||C.received_at)}),C.outgoing&&(C.acked?" ✓":" ?")]})]})]},C.id)})]}),y&&_.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:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:_.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const ax=B.forwardRef(function({onSend:r,disabled:o,placeholder:t},u){const[l,m]=B.useState(""),[c,h]=B.useState(!1),d=B.useRef(null);B.useImperativeHandle(u,()=>({appendText:f=>{var w;m(x=>x+f),(w=d.current)==null||w.focus()}}));const y=B.useCallback(async f=>{f.preventDefault();const w=l.trim();if(!(!w||c||o)){h(!0);try{await r(w),m("")}catch(x){console.error("Failed to send message:",x)}finally{h(!1)}}},[l,c,o,r]),g=B.useCallback(f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),y(f))},[y]);return _.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:y,children:[_.jsx(vi,{ref:d,type:"text",value:l,onChange:f=>m(f.target.value),onKeyDown:g,placeholder:t||"Type a message...",disabled:o||c,className:"flex-1"}),_.jsx(Ha,{type:"submit",disabled:o||c||!l.trim(),children:c?"Sending...":"Send"})]})});function Ai(a,r,{checkForDefaultPrevented:o=!0}={}){return function(u){if(a==null||a(u),o===!1||!u.defaultPrevented)return r==null?void 0:r(u)}}function nx(a,r){const o=B.createContext(r),t=l=>{const{children:m,...c}=l,h=B.useMemo(()=>c,Object.values(c));return _.jsx(o.Provider,{value:h,children:m})};t.displayName=a+"Provider";function u(l){const m=B.useContext(o);if(m)return m;if(r!==void 0)return r;throw new Error(`\`${l}\` must be used within \`${a}\``)}return[t,u]}function Hr(a,r=[]){let o=[];function t(l,m){const c=B.createContext(m),h=o.length;o=[...o,m];const d=g=>{var A;const{scope:f,children:w,...x}=g,j=((A=f==null?void 0:f[a])==null?void 0:A[h])||c,v=B.useMemo(()=>x,Object.values(x));return _.jsx(j.Provider,{value:v,children:w})};d.displayName=l+"Provider";function y(g,f){var j;const w=((j=f==null?void 0:f[a])==null?void 0:j[h])||c,x=B.useContext(w);if(x)return x;if(m!==void 0)return m;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[d,y]}const u=()=>{const l=o.map(m=>B.createContext(m));return function(c){const h=(c==null?void 0:c[a])||l;return B.useMemo(()=>({[`__scope${a}`]:{...c,[a]:h}}),[c,h])}};return u.scopeName=a,[t,ox(u,...r)]}function ox(...a){const r=a[0];if(a.length===1)return r;const o=()=>{const t=a.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const m=t.reduce((c,{useScope:h,scopeName:d})=>{const g=h(l)[`__scope${d}`];return{...c,...g}},{});return B.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return o.scopeName=r.scopeName,o}var _o=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},rx=Tu[" useId ".trim().toString()]||(()=>{}),sx=0;function Pr(a){const[r,o]=B.useState(rx());return _o(()=>{o(t=>t??String(sx++))},[a]),r?`radix-${r}`:""}var tx=Tu[" useInsertionEffect ".trim().toString()]||_o;function al({prop:a,defaultProp:r,onChange:o=()=>{},caller:t}){const[u,l,m]=lx({defaultProp:r,onChange:o}),c=a!==void 0,h=c?a:u;{const y=B.useRef(a!==void 0);B.useEffect(()=>{const g=y.current;g!==c&&console.warn(`${t} is changing from ${g?"controlled":"uncontrolled"} to ${c?"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.`),y.current=c},[c,t])}const d=B.useCallback(y=>{var g;if(c){const f=cx(y)?y(a):y;f!==a&&((g=m.current)==null||g.call(m,f))}else l(y)},[c,a,l,m]);return[h,d]}function lx({defaultProp:a,onChange:r}){const[o,t]=B.useState(a),u=B.useRef(o),l=B.useRef(r);return tx(()=>{l.current=r},[r]),B.useEffect(()=>{var m;u.current!==o&&((m=l.current)==null||m.call(l,o),u.current=o)},[o,u]),[o,t,l]}function cx(a){return typeof a=="function"}function ux(a){const r=dx(a),o=B.forwardRef((t,u)=>{const{children:l,...m}=t,c=B.Children.toArray(l),h=c.find(mx);if(h){const d=h.props.children,y=c.map(g=>g===h?B.Children.count(d)>1?B.Children.only(null):B.isValidElement(d)?d.props.children:null:g);return _.jsx(r,{...m,ref:u,children:B.isValidElement(d)?B.cloneElement(d,void 0,y):null})}return _.jsx(r,{...m,ref:u,children:l})});return o.displayName=`${a}.Slot`,o}function dx(a){const r=B.forwardRef((o,t)=>{const{children:u,...l}=o;if(B.isValidElement(u)){const m=gx(u),c=hx(l,u.props);return u.type!==B.Fragment&&(c.ref=t?Or(t,m):m),B.cloneElement(u,c)}return B.Children.count(u)>1?B.Children.only(null):null});return r.displayName=`${a}.S
Line truncated
|
||||
.`.concat(Mx,` {
|
||||
overflow: hidden `).concat(t,`;
|
||||
padding-right: `).concat(c,"px ").concat(t,`;
|
||||
}
|
||||
body[`).concat(Eo,`] {
|
||||
overflow: hidden `).concat(t,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([r&&"position: relative ".concat(t,";"),o==="margin"&&`
|
||||
padding-left: `.concat(u,`px;
|
||||
padding-top: `).concat(l,`px;
|
||||
padding-right: `).concat(m,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(c,"px ").concat(t,`;
|
||||
`),o==="padding"&&"padding-right: ".concat(c,"px ").concat(t,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(ot,` {
|
||||
right: `).concat(c,"px ").concat(t,`;
|
||||
}
|
||||
|
||||
.`).concat(rt,` {
|
||||
margin-right: `).concat(c,"px ").concat(t,`;
|
||||
}
|
||||
|
||||
.`).concat(ot," .").concat(ot,` {
|
||||
right: 0 `).concat(t,`;
|
||||
}
|
||||
|
||||
.`).concat(rt," .").concat(rt,` {
|
||||
margin-right: 0 `).concat(t,`;
|
||||
}
|
||||
|
||||
body[`).concat(Eo,`] {
|
||||
`).concat(Ox,": ").concat(c,`px;
|
||||
}
|
||||
`)},gh=function(){var a=parseInt(document.body.getAttribute(Eo)||"0",10);return isFinite(a)?a:0},rz=function(){B.useEffect(function(){return document.body.setAttribute(Eo,(gh()+1).toString()),function(){var a=gh()-1;a<=0?document.body.removeAttribute(Eo):document.body.setAttribute(Eo,a.toString())}},[])},sz=function(a){var r=a.noRelative,o=a.noImportant,t=a.gapMode,u=t===void 0?"margin":t;rz();var l=B.useMemo(function(){return az(u)},[u]);return B.createElement(nz,{styles:oz(l,!r,u,o?"":"!important")})},ju=!1;if(typeof window<"u")try{var et=Object.defineProperty({},"passive",{get:function(){return ju=!0,!0}});window.addEventListener("test",et,et),window.removeEventListener("test",et,et)}catch{ju=!1}var qo=ju?{passive:!1}:!1,tz=function(a){return a.tagName==="TEXTAREA"},xy=function(a,r){if(!(a instanceof Element))return!1;var o=window.getComputedStyle(a);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!tz(a)&&o[r]==="visible")},lz=function(a){return xy(a,"overflowY")},cz=function(a){return xy(a,"overflowX")},yh=function(a,r){var o=r.ownerDocument,t=r;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var u=zy(a,t);if(u){var l=qy(a,t),m=l[1],c=l[2];if(m>c)return!0}t=t.parentNode}while(t&&t!==o.body);return!1},uz=function(a){var r=a.scrollTop,o=a.scrollHeight,t=a.clientHeight;return[r,o,t]},dz=function(a){var r=a.scrollLeft,o=a.scrollWidth,t=a.clientWidth;return[r,o,t]},zy=function(a,r){return a==="v"?lz(r):cz(r)},qy=function(a,r){return a==="v"?uz(r):dz(r)},pz=function(a,r){return a==="h"&&r==="rtl"?-1:1},mz=function(a,r,o,t,u){var l=pz(a,window.getComputedStyle(r).direction),m=l*t,c=o.target,h=r.contains(c),d=!1,y=m>0,g=0,f=0;do{if(!c)break;var w=qy(a,c),x=w[0],j=w[1],v=w[2],A=j-v-l*x;(x||A)&&zy(a,c)&&(g+=A,f+=x);var q=c.parentNode;c=q&&q.nodeType===Node.DOCUMENT_FRAGMENT_NODE?q.host:q}while(!h&&c!==document.body||h&&(r.contains(c)||r===c));return(y&&Math.abs(g)<1||!y&&Math.abs(f)<1)&&(d=!0),d},it=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bh=function(a){return[a.deltaX,a.deltaY]},fh=function(a){return a&&"current"in a?a.current:a},hz=function(a,r){return a[0]===r[0]&&a[1]===r[1]},gz=function(a){return`
|
||||
.block-interactivity-`.concat(a,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(a,` {pointer-events: all;}
|
||||
`)},yz=0,jo=[];function bz(a){var r=B.useRef([]),o=B.useRef([0,0]),t=B.useRef(),u=B.useState(yz++)[0],l=B.useState(wy)[0],m=B.useRef(a);B.useEffect(function(){m.current=a},[a]),B.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(u));var j=Ix([a.lockRef.current],(a.shards||[]).map(fh),!0).filter(Boolean);return j.forEach(function(v){return v.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),j.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(u))})}}},[a.inert,a.lockRef.current,a.shards]);var c=B.useCallback(function(j,v){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!m.current.allowPinchZoom;var A=it(j),q=o.current,k="deltaX"in j?j.deltaX:q[0]-A[0],C="deltaY"in j?j.deltaY:q[1]-A[1],S,D=j.target,T=Math.abs(k)>Math.abs(C)?"h":"v";if("touches"in j&&T==="h"&&D.type==="range")return!1;var F=window.getSelection(),O=F&&F.anchorNode,N=O?O===D||O.contains(D):!1;if(N)return!1;var R=yh(T,D);if(!R)return!0;if(R?S=T:(S=T==="v"?"h":"v",R=yh(T,D)),!R)return!1;if(!t.current&&"changedTouches"in j&&(k||C)&&(t.current=S),!S)return!0;var U=t.current||S;return mz(U,v,j,U==="h"?k:C)},[]),h=B.useCallback(function(j){var v=j;if(!(!jo.length||jo[jo.length-1]!==l)){var A="deltaY"in v?bh(v):it(v),q=r.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&hz(S.delta,A)})[0];if(q&&q.should){v.cancelable&&v.preventDefault();return}if(!q){var k=(m.current.shards||[]).map(fh).filter(Boolean).filter(function(S){return S.contains(v.target)}),C=k.length>0?c(v,k[0]):!m.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),d=B.useCallback(function(j,v,A,q){var k={name:j,delta:v,target:A,should:q,shadowParent:fz(A)};r.current.push(k),setTimeout(function(){r.current=r.current.filter(function(C){return C!==k})},1)},[]),y=B.useCallback(function(j){o.current=it(j),t.current=void 0},[]),g=B.useCallback(function(j){d(j.type,bh(j),j.target,c(j,a.lockRef.current))},[]),f=B.useCallback(function(j){d(j.type,it(j),j.target,c(j,a.lockRef.current))},[]);B.useEffect(function(){return jo.push(l),a.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:f}),document.addEventListener("wheel",h,qo),document.addEventListener("touchmove",h,qo),document.addEventListener("touchstart",y,qo),function(){jo=jo.filter(function(j){return j!==l}),document.removeEventListener("wheel",h,qo),document.removeEventListener("touchmove",h,qo),document.removeEventListener("touchstart",y,qo)}},[]);var w=a.removeScrollBar,x=a.inert;return B.createElement(B.Fragment,null,x?B.createElement(l,{styles:gz(u)}):null,w?B.createElement(sz,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function fz(a){for(var r=null;a!==null;)a instanceof ShadowRoot&&(r=a.host,a=a.host),a=a.parentNode;return r}const vz=Qx(ky,bz);var jy=B.forwardRef(function(a,r){return B.createElement(nl,Oa({},a,{ref:r,sideCar:vz}))});jy.classNames=nl.classNames;var kz=function(a){if(typeof document>"u")return null;var r=Array.isArray(a)?a[0]:a;return r.ownerDocument.body},Ao=new WeakMap,at=new WeakMap,nt={},pu=0,Ay=function(a){return a&&(a.host||Ay(a.parentNode))},wz=function(a,r){return r.map(function(o){if(a.contains(o))return o;var t=Ay(o);return t&&a.contains(t)?t:(console.error("aria-hidden",o,"in not contained inside",a,". Doing nothing"),null)}).filter(function(o){return!!o})},xz=function(a,r,o,t){var u=wz(r,Array.isArray(a)?a:[a]);nt[o]||(nt[o]=new WeakMap);var l=nt[o],m=[],c=new Set,h=new Set(u),d=function(g){!g||c.has(g)||(c.add(g),d(g.parentNode))};u.forEach(d);var y=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(f){if(c.has(f))y(f);else try{var w=f.getAttribute(t),x=w!==null&&w!=="false",j=(Ao.get(f)||0)+1,v=(l.get(f)||0)+1;Ao.set(f,j),l.set(f,v),m.push(f),j===1&&x&&at.set(f,!0),v===1&&f.setAttribute(o,"true"),x||f.setAttribute(t,"true")}catch(A){console.error("aria-hidden: cannot operate on ",f,A)}})};return y(r),c.clear(),pu++,function(){m.forEach(function(g){var f=Ao.get(g)-1,w=l.get(g)-1;Ao.set(g,f),l.set(g,w),f||(at.has(g)||g.removeAttribute(t),at.delete(g)),w||g.removeAttribute(o)}),pu--,pu||(Ao=new WeakMap,Ao=new WeakMap,at=new WeakMap,nt={})}},zz=function(a,r,o){o===void 0&&(o="data-aria-hidden");var t=Array.from(Array.isArray(a)?a:[a]),u=kz(a);return u?(t.push.apply(t,Array.from(u.querySelectorAll("[aria-live], script"))),xz(t,u,o,"aria-hidden")):function(){return null}};function qz(a){const r=jz(a),o=B.forwardRef((t,u)=>{const{children:l,...m}=t,c=B.Children.toArray(l),h=c.find(Cz);if(h){const d=h.props.children,y=c.map(g=>g===h?B.Children.count(d)>1?B.Children.only(null):B.isValidElement(d)?d.props.children:null:g);return _.jsx(r,{...m,ref:u,children:B.isValidElement(d)?B.cloneElement(d,void 0,y):null})}return _.jsx(r,{...m,ref:u,children:l})});return o.displayName=`${a}.Slot`,o}function jz(a){const r=B.forwardRef((o,t)=>{const{children:u
Line truncated
|
||||
|
||||
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return B.useEffect(()=>{a&&(document.getElementById(a)||console.error(o))},[o,a]),null},Iz="DialogDescriptionWarning",Mz=({contentRef:a,descriptionId:r})=>{const t=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hy(Iz).contentName}}.`;return B.useEffect(()=>{var l;const u=(l=a.current)==null?void 0:l.getAttribute("aria-describedby");r&&u&&(document.getElementById(r)||console.warn(t))},[t,a,r]),null},Ly=Ey,Vy=_y,rl=Dy,sl=Fy,tl=Ty,ll=Ny,Uy=My;const Wy=Ly,Oz=Vy,Gy=B.forwardRef(({className:a,...r},o)=>_.jsx(rl,{ref:o,className:Ke("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r}));Gy.displayName=rl.displayName;const Lu=B.forwardRef(({className:a,children:r,...o},t)=>_.jsxs(Oz,{children:[_.jsx(Gy,{}),_.jsxs(sl,{ref:t,className:Ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...o,children:[r,_.jsxs(Uy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(Wg,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Lu.displayName=sl.displayName;const Vu=({className:a,...r})=>_.jsx("div",{className:Ke("flex flex-col space-y-1.5 text-center sm:text-left",a),...r});Vu.displayName="DialogHeader";const Uu=({className:a,...r})=>_.jsx("div",{className:Ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...r});Uu.displayName="DialogFooter";const Wu=B.forwardRef(({className:a,...r},o)=>_.jsx(tl,{ref:o,className:Ke("text-lg font-semibold leading-none tracking-tight",a),...r}));Wu.displayName=tl.displayName;const Hz=B.forwardRef(({className:a,...r},o)=>_.jsx(ll,{ref:o,className:Ke("text-sm text-muted-foreground",a),...r}));Hz.displayName=ll.displayName;function vh(a){const r=Lz(a),o=B.forwardRef((t,u)=>{const{children:l,...m}=t,c=B.Children.toArray(l),h=c.find(Uz);if(h){const d=h.props.children,y=c.map(g=>g===h?B.Children.count(d)>1?B.Children.only(null):B.isValidElement(d)?d.props.children:null:g);return _.jsx(r,{...m,ref:u,children:B.isValidElement(d)?B.cloneElement(d,void 0,y):null})}return _.jsx(r,{...m,ref:u,children:l})});return o.displayName=`${a}.Slot`,o}function Lz(a){const r=B.forwardRef((o,t)=>{const{children:u,...l}=o;if(B.isValidElement(u)){const m=Gz(u),c=Wz(l,u.props);return u.type!==B.Fragment&&(c.ref=t?Or(t,m):m),B.cloneElement(u,c)}return B.Children.count(u)>1?B.Children.only(null):null});return r.displayName=`${a}.SlotClone`,r}var Vz=Symbol("radix.slottable");function Uz(a){return B.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Vz}function Wz(a,r){const o={...r};for(const t in r){const u=a[t],l=r[t];/^on[A-Z]/.test(t)?u&&l?o[t]=(...c)=>{const h=l(...c);return u(...c),h}:u&&(o[t]=u):t==="style"?o[t]={...u,...l}:t==="className"&&(o[t]=[u,l].filter(Boolean).join(" "))}return{...a,...o}}function Gz(a){var t,u;let r=(t=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?a.ref:(r=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}function Qz(a){const r=a+"CollectionProvider",[o,t]=Hr(r),[u,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),m=j=>{const{scope:v,children:A}=j,q=he.useRef(null),k=he.useRef(new Map).current;return _.jsx(u,{scope:v,itemMap:k,collectionRef:q,children:A})};m.displayName=r;const c=a+"CollectionSlot",h=vh(c),d=he.forwardRef((j,v)=>{const{scope:A,children:q}=j,k=l(c,A),C=fa(v,k.collectionRef);return _.jsx(h,{ref:C,children:q})});d.displayName=c;const y=a+"CollectionItemSlot",g="data-radix-collection-item",f=vh(y),w=he.forwardRef((j,v)=>{const{scope:A,children:q,...k}=j,C=he.useRef(null),S=fa(v,C),D=l(y,A);return he.useEffect(()=>(D.itemMap.set(C,{ref:C,...k}),()=>void D.itemMap.delete(C))),_.jsx(f,{[g]:"",ref:S,children:q})});w.displayName=y;function x(j){const v=l(a+"CollectionConsumer",j);return he.useCallback(()=>{const q=v.collectionRef.current;if(!q)return[];const k=Array.from(q.querySelectorAll(`[${g}]`));return Array.from(v.itemMap.values()).sort((D,T)=>k.indexOf(D.ref.current)-k.indexOf(T.ref.current))},[v.coll
Line truncated
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/return(function(t){var u=o,l=u.lib,m=l.WordArray,c=l.Hasher,h=u.algo,d=m.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),y=m.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=m.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=m.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),w=m.create([0,1518500249,1859775393,2400959708,2840853838]),x=m.create([1352829926,1548603684,1836072691,2053994217,0]),j=h.RIPEMD160=c.extend({_doReset:function(){this._hash=m.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,T){for(var F=0;F<16;F++){var O=T+F,N=D[O];D[O]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}var R=this._hash.words,U=w.words,L=x.words,Y=d.words,re=y.words,J=g.words,ne=f.words,W,se,ee,z,I,H,G,de,ie,le;H=W=R[0],G=se=R[1],de=ee=R[2],ie=z=R[3],le=I=R[4];for(var ae,F=0;F<80;F+=1)ae=W+D[T+Y[F]]|0,F<16?ae+=v(se,ee,z)+U[0]:F<32?ae+=A(se,ee,z)+U[1]:F<48?ae+=q(se,ee,z)+U[2]:F<64?ae+=k(se,ee,z)+U[3]:ae+=C(se,ee,z)+U[4],ae=ae|0,ae=S(ae,J[F]),ae=ae+I|0,W=I,I=z,z=S(ee,10),ee=se,se=ae,ae=H+D[T+re[F]]|0,F<16?ae+=C(G,de,ie)+L[0]:F<32?ae+=k(G,de,ie)+L[1]:F<48?ae+=q(G,de,ie)+L[2]:F<64?ae+=A(G,de,ie)+L[3]:ae+=v(G,de,ie)+L[4],ae=ae|0,ae=S(ae,ne[F]),ae=ae+le|0,H=le,le=ie,ie=S(de,10),de=G,G=ae;ae=R[1]+ee+ie|0,R[1]=R[2]+z+le|0,R[2]=R[3]+I+H|0,R[3]=R[4]+W+G|0,R[4]=R[0]+se+de|0,R[0]=ae},_doFinalize:function(){var D=this._data,T=D.words,F=this._nDataBytes*8,O=D.sigBytes*8;T[O>>>5]|=128<<24-O%32,T[(O+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,D.sigBytes=(T.length+1)*4,this._process();for(var N=this._hash,R=N.words,U=0;U<5;U++){var L=R[U];R[U]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return N},clone:function(){var D=c.clone.call(this);return D._hash=this._hash.clone(),D}});function v(D,T,F){return D^T^F}function A(D,T,F){return D&T|~D&F}function q(D,T,F){return(D|~T)^F}function k(D,T,F){return D&F|T&~F}function C(D,T,F){return D^(T|~F)}function S(D,T){return D<<T|D>>>32-T}u.RIPEMD160=c._createHelper(j),u.HmacRIPEMD160=c._createHmacHelper(j)})(),o.RIPEMD160})})(wt)),wt.exports}var xt={exports:{}},nq=xt.exports,Mh;function pl(){return Mh||(Mh=1,(function(a,r){(function(o,t){a.exports=t(Ve())})(nq,function(o){(function(){var t=o,u=t.lib,l=u.Base,m=t.enc,c=m.Utf8,h=t.algo;h.HMAC=l.extend({init:function(d,y){d=this._hasher=new d.init,typeof y=="string"&&(y=c.parse(y));var g=d.blockSize,f=g*4;y.sigBytes>f&&(y=d.finalize(y)),y.clamp();for(var w=this._oKey=y.clone(),x=this._iKey=y.clone(),j=w.words,v=x.words,A=0;A<g;A++)j[A]^=1549556828,v[A]^=909522486;w.sigBytes=x.sigBytes=f,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var y=this._hasher,g=y.finalize(d);y.reset();var f=y.finalize(this._oKey.clone().concat(g));return f}})})()})})(xt)),xt.exports}var zt={exports:{}},oq=zt.exports,Oh;function rq(){return Oh||(Oh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Vr(),pl())})(oq,function(o){return(function(){var t=o,u=t.lib,l=u.Base,m=u.WordArray,c=t.algo,h=c.SHA256,d=c.HMAC,y=c.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,f){for(var w=this.cfg,x=d.create(w.hasher,g),j=m.create(),v=m.create([1]),A=j.words,q=v.words,k=w.keySize,C=w.iterations;A.length<k;){var S=x.update(f).finalize(v);x.reset();for(var D=S.words,T=D.length,F=S,O=1;O<C;O++){F=x.finalize(F),x.reset();for(var N=F.words,R=0;R<T;R++)D[R]^=N[R]}j.concat(S),q[0]++}return j.sigBytes=k*4,j}});t.PBKDF2=function(g,f,w){return y.create(w).compute(g,f)}})(),o.PBKDF2})})(zt)),zt.exports}var qt={exports:{}},sq=qt.exports,Hh;function Cn(){return Hh||(Hh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Eb(),pl())})(sq,function(o){return(function(){var t=o,u=t.lib,l=u.Base,m=u.WordArray,c=t.algo,h=c.MD5,d=c.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,g){for(var f,w=this.cfg,x=w.hasher.create(),j=m.create(),v=j.words,A=w.keySize,q=w.iterations;v.length<A;){f&&x.update(f),f=x.update(y).finalize(g),x.reset();for(var k=1;k<q;k++)f=x.finalize(f),x.reset();j.concat(f)}return j.sigBytes=A*4,j}});t.EvpKDF=function(y,g,f){return d.create(f).compute(y,g)}})(),o.EvpKDF})})(qt)),qt.exports}var jt={exports:{}},tq=jt.exports,Lh;fuLine truncated
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/return o.mode.CTRGladman=(function(){var t=o.lib.BlockCipherMode.extend();function u(c){if((c>>24&255)===255){var h=c>>16&255,d=c>>8&255,y=c&255;h===255?(h=0,d===255?(d=0,y===255?y=0:++y):++d):++h,c=0,c+=h<<16,c+=d<<8,c+=y}else c+=1<<24;return c}function l(c){return(c[0]=u(c[0]))===0&&(c[1]=u(c[1])),c}var m=t.Encryptor=t.extend({processBlock:function(c,h){var d=this._cipher,y=d.blockSize,g=this._iv,f=this._counter;g&&(f=this._counter=g.slice(0),this._iv=void 0),l(f);var w=f.slice(0);d.encryptBlock(w,0);for(var x=0;x<y;x++)c[h+x]^=w[x]}});return t.Decryptor=m,t})(),o.mode.CTRGladman})})(Et)),Et.exports}var St={exports:{}},hq=St.exports,Gh;function gq(){return Gh||(Gh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(hq,function(o){return o.mode.OFB=(function(){var t=o.lib.BlockCipherMode.extend(),u=t.Encryptor=t.extend({processBlock:function(l,m){var c=this._cipher,h=c.blockSize,d=this._iv,y=this._keystream;d&&(y=this._keystream=d.slice(0),this._iv=void 0),c.encryptBlock(y,0);for(var g=0;g<h;g++)l[m+g]^=y[g]}});return t.Decryptor=u,t})(),o.mode.OFB})})(St)),St.exports}var Bt={exports:{}},yq=Bt.exports,Qh;function bq(){return Qh||(Qh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(yq,function(o){return o.mode.ECB=(function(){var t=o.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(u,l){this._cipher.encryptBlock(u,l)}}),t.Decryptor=t.extend({processBlock:function(u,l){this._cipher.decryptBlock(u,l)}}),t})(),o.mode.ECB})})(Bt)),Bt.exports}var _t={exports:{}},fq=_t.exports,$h;function vq(){return $h||($h=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(fq,function(o){return o.pad.AnsiX923={pad:function(t,u){var l=t.sigBytes,m=u*4,c=m-l%m,h=l+c-1;t.clamp(),t.words[h>>>2]|=c<<24-h%4*8,t.sigBytes+=c},unpad:function(t){var u=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=u}},o.pad.Ansix923})})(_t)),_t.exports}var Dt={exports:{}},kq=Dt.exports,Kh;function wq(){return Kh||(Kh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(kq,function(o){return o.pad.Iso10126={pad:function(t,u){var l=u*4,m=l-t.sigBytes%l;t.concat(o.lib.WordArray.random(m-1)).concat(o.lib.WordArray.create([m<<24],1))},unpad:function(t){var u=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=u}},o.pad.Iso10126})})(Dt)),Dt.exports}var Ft={exports:{}},xq=Ft.exports,Yh;function zq(){return Yh||(Yh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(xq,function(o){return o.pad.Iso97971={pad:function(t,u){t.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(t,u)},unpad:function(t){o.pad.ZeroPadding.unpad(t),t.sigBytes--}},o.pad.Iso97971})})(Ft)),Ft.exports}var Rt={exports:{}},qq=Rt.exports,Zh;function jq(){return Zh||(Zh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(qq,function(o){return o.pad.ZeroPadding={pad:function(t,u){var l=u*4;t.clamp(),t.sigBytes+=l-(t.sigBytes%l||l)},unpad:function(t){for(var u=t.words,l=t.sigBytes-1,l=t.sigBytes-1;l>=0;l--)if(u[l>>>2]>>>24-l%4*8&255){t.sigBytes=l+1;break}}},o.pad.ZeroPadding})})(Rt)),Rt.exports}var Tt={exports:{}},Aq=Tt.exports,Xh;function Cq(){return Xh||(Xh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(Aq,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(Tt)),Tt.exports}var Pt={exports:{}},Eq=Pt.exports,Jh;function Sq(){return Jh||(Jh=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Fi())})(Eq,function(o){return(function(t){var u=o,l=u.lib,m=l.CipherParams,c=u.enc,h=c.Hex,d=u.format;d.Hex={stringify:function(y){return y.ciphertext.toString(h)},parse:function(y){var g=h.parse(y);return m.create({ciphertext:g})}}})(),o.format.Hex})})(Pt)),Pt.exports}var Nt={exports:{}},Bq=Nt.exports,eg;function _q(){return eg||(eg=1,(function(a,r){(function(o,t,u){a.exports=t(Ve(),Xn(),Jn(),Cn(),Fi())})(Bq,function(o){return(function(){var t=o,u=t.lib,l=u.BlockCipher,m=t.algo,c=[],h=[],d=[],y=[],g=[],f=[],w=[],x=[],j=[],v=[];(function(){for(var k=[],C=0;C<256;C++)C<128?k[C]=C<<1:k[C]=C<<1^283;for(var S=0,D=0,C=0;C<256;C++){var T=D^D<<1^D<<2^D<<3^D<<4;T=T>>>8^T&255^99,c[S]=T,h[T]=S;var F=k[S],O=k[F],N=k[O],R=k[T]*257^T*16843008;d[S]=R<<24|R>>>8,y[S]=R<<16|R>>>16,g[S]=R<<8|R>>>24,f[S]=R;var R=N*16843009^O*65537^F*257^S*16843008;w[T]=R<<24|R>>>8,x[T]=R<<16|R>>>16,j[T]=R<<8|R>>>24,v[T]=R,S?(S=F^k[k[k[N^F]]],D^=k[k[D]]):S=D=1}})();var A=[0,1,2,4,8,16,32,64,128,27,54],q=m.AES=l.extend({_doReset:function(){var k;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var C=this._keyPriorReset=this._key,S=C.words,D=C.sigBytes/4,T=this._nRounds=D+6,F=(T+1)*4,O=this._keySchedule=[],N=0;N<F;N++)N<D?O[N]=S[N]:(k=O[N-1],N%D?D>6&&N%D==4&&(k=c[k>>>24]<<24|c[k>>>16&255]<<16|c[k>>>8&255]<<8|c[k&255]):(k=k<<8|k>>>24,k=c[k>>>24]<<24|c[k>>>16&255]<<16|c[k>>>8&255]<<8|c[k&255],k^=A[N/D|0]<<24),O[N]=O[N-D]^k);for(var R=this._invKeySchedule=[],U=0;U<F;U++){var N=F-U;if(U%4)var k=O[N];else var k=O[N-4];U<4||N<=4?R[U]=k:R[U]=w[c[k>>>24]]^x[c[k>>>16&255]]^j[c[k>>>8&255]]^v[c[k&255]]}}},encryptBlock:Line truncated
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
|
||||
• Request Data (remaining bytes) - additional request-specific data`,startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.Request,version:a.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:a.RequestType.GetStats,requestData:"",destinationHash:d,sourceHash:y,cipherMac:g,ciphertext:f};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.Request,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode request payload"],timestamp:0,requestType:a.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return jr.RequestPayloadDecoder=o,jr}var Ar={},zg;function mj(){if(zg)return Ar;zg=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.ResponsePayloadDecoder=void 0;const a=ua(),r=Ii();class o{static decode(u,l){try{if(u.length<4){const x={type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(x.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),x}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const y=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:y}),h+=1;const g=(0,r.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:g}),h+=2;const f=(0,r.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&m.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:y,cipherMac:g,ciphertext:f,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.Response,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ar.ResponsePayloadDecoder=o,Ar}var Cr={},qg;function hj(){if(qg)return Cr;qg=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.AnonRequestPayloadDecoder=void 0;const a=ua(),r=Ii();class o{static decode(u,l){try{if(u.length<35){const x={type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(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)+u.length-1,value:(0,r.bytesToHex)(u)}]),x}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,r.byteToHex)(u[0]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${d}`,startByte:c+h,endByte:c+h,value:d}),h+=1;const y=(0,r.bytesToHex)(u.subarray(1,33));l!=null&&l.includeSegments&&m.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:c+h,endByte:c+h+31,value:y}),h+=32;const g=(0,r.bytesToHex)(u.subarray(33,35));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:c+h,endByte:c+h+1,value:g}),h+=2;const f=(0,r.bytesToHex)(u.subarray(35));l!=null&&l.includeSegments&&u.length>35&&m.push({name:"Ciphertext",description:`Encrypted message data (${u.length-35} bytes). Contains encrypted plaintext with this structure:
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
|
||||
• Password (remaining bytes) - password for repeater/room`,startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,senderPublicKey:y,cipherMac:g,ciphertext:f,ciphertextLength:u.length-35};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.AnonRequest,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Cr.AnonRequestPayloadDecoder=o,Cr}var Er={},jg;function gj(){if(jg)return Er;jg=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.AckPayloadDecoder=void 0;const a=ua(),r=Ii();class o{static decode(u,l){try{if(u.length<4){const y={type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(y.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),y}const m=[],c=(l==null?void 0:l.segmentOffset)||0,h=(0,r.bytesToHex)(u.subarray(0,4));l!=null&&l.includeSegments&&m.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${h}`,startByte:c,endByte:c+3,value:h}),l!=null&&l.includeSegments&&u.length>4&&m.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:c+4,endByte:c+u.length-1,value:(0,r.bytesToHex)(u.subarray(4))});const d={type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!0,checksum:h};return l!=null&&l.includeSegments&&(d.segments=m),d}catch(m){return{type:a.PayloadType.Ack,version:a.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode Ack payload"],checksum:""}}}}return Er.AckPayloadDecoder=o,Er}var Sr={},Ag;function yj(){if(Ag)return Sr;Ag=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.PathPayloadDecoder=void 0;const a=ua(),r=Ii();class o{static decode(u){try{if(u.length<2)return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=u[0];if(u.length<1+l+1)return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const m=[];for(let d=0;d<l;d++)m.push((0,r.byteToHex)(u[1+d]));const c=u[1+l];let h="";return u.length>1+l+1&&(h=(0,r.bytesToHex)(u.subarray(1+l+1))),{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:m,extraType:c,extraData:h}}catch(l){return{type:a.PayloadType.Path,version:a.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Sr.PathPayloadDecoder=o,Sr}var Br={},Cg;function bj(){if(Cg)return Br;Cg=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.TextMessagePayloadDecoder=void 0;const a=ua(),r=Ii();class o{static decode(u,l){try{if(u.length<4){const x={type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(x.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,r.bytesToHex)(u)}]),x}const m=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const y=(0,r.byteToHex)(u[h]);l!=null&&l.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:y}),h+=1;const g=(0,r.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:g}),h+=2;const f=(0,r.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&m.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:c+h,endByte:c+u.length-1,value:f});const w={type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:y,cipherMac:g,ciphertext:f,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(w.segments=m),w}catch(m){return{type:a.PayloadType.TextMessage,version:a.PayloadVersion.Version1,i
Line truncated
|
||||
// SHA256 round constants
|
||||
const K: array<u32, 64> = array<u32, 64>(
|
||||
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
|
||||
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
|
||||
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
|
||||
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
|
||||
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
|
||||
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
|
||||
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
|
||||
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
|
||||
);
|
||||
|
||||
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
|
||||
const CHARS: array<u32, 37> = array<u32, 37>(
|
||||
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
|
||||
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
|
||||
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
|
||||
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
|
||||
0x2du // dash
|
||||
);
|
||||
|
||||
struct Params {
|
||||
target_channel_hash: u32,
|
||||
batch_offset: u32,
|
||||
name_length: u32,
|
||||
batch_size: u32,
|
||||
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
|
||||
ciphertext_words: u32, // Number of 32-bit words in ciphertext
|
||||
ciphertext_len_bits: u32, // Length of ciphertext in bits
|
||||
verify_mac: u32, // 1 to verify MAC, 0 to skip
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> params: Params;
|
||||
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
|
||||
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
|
||||
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
|
||||
|
||||
fn rotr(x: u32, n: u32) -> u32 {
|
||||
return (x >> n) | (x << (32u - n));
|
||||
}
|
||||
|
||||
fn ch(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (~x & z);
|
||||
}
|
||||
|
||||
fn maj(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (x & z) ^ (y & z);
|
||||
}
|
||||
|
||||
fn sigma0(x: u32) -> u32 {
|
||||
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
|
||||
}
|
||||
|
||||
fn sigma1(x: u32) -> u32 {
|
||||
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
|
||||
}
|
||||
|
||||
fn gamma0(x: u32) -> u32 {
|
||||
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
|
||||
}
|
||||
|
||||
fn gamma1(x: u32) -> u32 {
|
||||
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
|
||||
}
|
||||
|
||||
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
|
||||
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
|
||||
// Message starts with '#' (0x23)
|
||||
var byte_pos = 0u;
|
||||
var word_idx = 0u;
|
||||
var current_word = 0x23000000u; // '#' in big-endian position 0
|
||||
byte_pos = 1u;
|
||||
|
||||
var remaining = idx;
|
||||
var prev_was_dash = false;
|
||||
|
||||
// Generate room name from index
|
||||
for (var i = 0u; i < length; i++) {
|
||||
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
|
||||
var char_idx = remaining % char_count;
|
||||
remaining = remaining / char_count;
|
||||
|
||||
// Check for consecutive dashes (invalid)
|
||||
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
|
||||
if (is_dash && prev_was_dash) {
|
||||
return false; // Invalid: consecutive dashes
|
||||
}
|
||||
prev_was_dash = is_dash;
|
||||
|
||||
// Map char index to actual character
|
||||
let c = CHARS[char_idx];
|
||||
|
||||
// Pack byte into current word (big-endian)
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u && byte_pos > 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0u;
|
||||
}
|
||||
current_word = current_word | (c << shift);
|
||||
byte_pos = byte_pos + 1u;
|
||||
}
|
||||
|
||||
// Add padding: 0x80 followed by zeros, then length in bits
|
||||
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
|
||||
|
||||
// Add 0x80 padding byte
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0x80000000u;
|
||||
} else {
|
||||
current_word = current_word | (0x80u << shift);
|
||||
}
|
||||
byte_pos = byte_pos + 1u;
|
||||
|
||||
// Store current word
|
||||
if (byte_pos % 4u == 0u || word_idx < 14u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
}
|
||||
|
||||
// Zero-fill until word 14
|
||||
for (var i = word_idx; i < 14u; i++) {
|
||||
(*msg)[i] = 0u;
|
||||
}
|
||||
|
||||
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
|
||||
(*msg)[14u] = 0u;
|
||||
(*msg)[15u] = msg_len_bits;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
|
||||
// Initialize hash values
|
||||
var h: array<u32, 8> = array<u32, 8>(
|
||||
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
|
||||
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
|
||||
);
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Compute SHA256 of the key (16 bytes) to get channel hash
|
||||
fn sha256_key(key: array<u32, 4>) -> u32 {
|
||||
var msg: array<u32, 16>;
|
||||
|
||||
// Key bytes (16 bytes = 4 words)
|
||||
msg[0] = key[0];
|
||||
msg[1] = key[1];
|
||||
msg[2] = key[2];
|
||||
msg[3] = key[3];
|
||||
|
||||
// Padding: 0x80 followed by zeros
|
||||
msg[4] = 0x80000000u;
|
||||
for (var i = 5u; i < 14u; i++) {
|
||||
msg[i] = 0u;
|
||||
}
|
||||
|
||||
// Length: 128 bits
|
||||
msg[14] = 0u;
|
||||
msg[15] = 128u;
|
||||
|
||||
let hash = sha256_block(&msg);
|
||||
|
||||
// Return first byte of hash (big-endian)
|
||||
return hash[0] >> 24u;
|
||||
}
|
||||
|
||||
// HMAC-SHA256 for MAC verification
|
||||
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
|
||||
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
|
||||
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
|
||||
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
|
||||
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
|
||||
// ipad = 0x36 repeated, opad = 0x5c repeated
|
||||
|
||||
// Build padded key (64 bytes = 16 words)
|
||||
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
|
||||
var k_pad: array<u32, 16>;
|
||||
k_pad[0] = key[0];
|
||||
k_pad[1] = key[1];
|
||||
k_pad[2] = key[2];
|
||||
k_pad[3] = key[3];
|
||||
for (var i = 4u; i < 16u; i++) {
|
||||
k_pad[i] = 0u;
|
||||
}
|
||||
|
||||
// Inner hash: SHA256((K' ^ ipad) || message)
|
||||
// First block: K' ^ ipad (64 bytes)
|
||||
var inner_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
inner_block[i] = k_pad[i] ^ 0x36363636u;
|
||||
}
|
||||
|
||||
// Initialize hash state with first block
|
||||
var h: array<u32, 8> = sha256_block(&inner_block);
|
||||
|
||||
// Process ciphertext blocks (continuing from h state)
|
||||
let ciphertext_words = params.ciphertext_words;
|
||||
var word_idx = 0u;
|
||||
|
||||
// Process full 64-byte blocks of ciphertext
|
||||
while (word_idx + 16u <= ciphertext_words) {
|
||||
var block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
block[i] = ciphertext[word_idx + i];
|
||||
}
|
||||
h = sha256_block_continue(&block, h);
|
||||
word_idx = word_idx + 16u;
|
||||
}
|
||||
|
||||
// Final block with remaining ciphertext + padding
|
||||
var final_block: array<u32, 16>;
|
||||
var remaining = ciphertext_words - word_idx;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
if (i < remaining) {
|
||||
final_block[i] = ciphertext[word_idx + i];
|
||||
} else if (i == remaining) {
|
||||
// Add 0x80 padding
|
||||
final_block[i] = 0x80000000u;
|
||||
} else {
|
||||
final_block[i] = 0u;
|
||||
}
|
||||
}
|
||||
|
||||
// Add length (64 bytes of ipad + ciphertext length)
|
||||
let total_bits = 512u + params.ciphertext_len_bits;
|
||||
if (remaining < 14u) {
|
||||
final_block[14] = 0u;
|
||||
final_block[15] = total_bits;
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
} else {
|
||||
// Need extra block for length
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
var len_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 14u; i++) {
|
||||
len_block[i] = 0u;
|
||||
}
|
||||
len_block[14] = 0u;
|
||||
len_block[15] = total_bits;
|
||||
h = sha256_block_continue(&len_block, h);
|
||||
}
|
||||
|
||||
let inner_hash = h;
|
||||
|
||||
// Outer hash: SHA256((K' ^ opad) || inner_hash)
|
||||
var outer_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
|
||||
}
|
||||
h = sha256_block(&outer_block);
|
||||
|
||||
// Second block: inner_hash (32 bytes) + padding
|
||||
var hash_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 8u; i++) {
|
||||
hash_block[i] = inner_hash[i];
|
||||
}
|
||||
hash_block[8] = 0x80000000u;
|
||||
for (var i = 9u; i < 14u; i++) {
|
||||
hash_block[i] = 0u;
|
||||
}
|
||||
hash_block[14] = 0u;
|
||||
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
|
||||
|
||||
h = sha256_block_continue(&hash_block, h);
|
||||
|
||||
// Return first 2 bytes (high 16 bits of first word)
|
||||
return h[0] & 0xFFFF0000u;
|
||||
}
|
||||
|
||||
// SHA256 block computation continuing from existing state
|
||||
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
|
||||
var h = h_in;
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Process a single candidate and record match if found
|
||||
fn process_candidate(name_idx: u32) {
|
||||
// Generate message for this room name
|
||||
var msg: array<u32, 16>;
|
||||
let valid = index_to_room_name(name_idx, params.name_length, &msg);
|
||||
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute SHA256("#roomname") - this gives us the key
|
||||
let key_hash = sha256_block(&msg);
|
||||
|
||||
// Take first 16 bytes (4 words) as the key
|
||||
var key: array<u32, 4>;
|
||||
key[0] = key_hash[0];
|
||||
key[1] = key_hash[1];
|
||||
key[2] = key_hash[2];
|
||||
key[3] = key_hash[3];
|
||||
|
||||
// Compute SHA256(key) to get channel hash
|
||||
let channel_hash = sha256_key(key);
|
||||
|
||||
// Check if channel hash matches target
|
||||
if (channel_hash != params.target_channel_hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Channel hash matches - verify MAC if enabled
|
||||
if (params.verify_mac == 1u) {
|
||||
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
|
||||
if (computed_mac != params.target_mac) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Found a match - record the index
|
||||
let match_idx = atomicAdd(&match_count, 1u);
|
||||
if (match_idx < 1024u) { // Limit stored matches
|
||||
match_indices[match_idx] = name_idx;
|
||||
}
|
||||
}
|
||||
|
||||
// Each thread processes 16 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 16u;
|
||||
|
||||
@compute @workgroup_size(256)
|
||||
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
||||
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
|
||||
|
||||
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
|
||||
let idx = base_idx + i;
|
||||
if (idx >= params.batch_size) {
|
||||
return;
|
||||
}
|
||||
let name_idx = params.batch_offset + idx;
|
||||
process_candidate(name_idx);
|
||||
}
|
||||
}
|
||||
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const r=await navigator.gpu.requestAdapter();if(!r)return console.warn("No GPU adapter found"),!1;this.device=await r.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let u=0;u<2;u++)this.matchCountReadBuffers[u]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[u]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),t=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:t,compute:{module:o,entryPoint:"main"}}),!0}catch(r){return console.error("WebGPU initialization failed:",r),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(r,o){return $n(o,r)}countNamesForLength(r){return Rr(r)}async runBatch(r,o,t,u,l,m){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const c=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const h=this.matchCountReadBuffers[c],d=this.matchIndicesReadBuffers[c],y=l&&m?1:0;let g,f=0,w=0;if(y){const S=new Uint8Array(l.length/2);for(let N=0;N<S.length;N++)S[N]=parseInt(l.substr(N*2,2),16);f=S.length*8;const D=Math.ceil(S.length/4)*4,T=new Uint8Array(D);T.set(S),g=new Uint32Array(D/4);for(let N=0;N<g.length;N++)g[N]=T[N*4]<<24|T[N*4+1]<<16|T[N*4+2]<<8|T[N*4+3];const F=parseInt(m.substr(0,2),16),O=parseInt(m.substr(2,2),16);w=F<<24|O<<16}else g=new Uint32Array([0]);const x=Math.max(g.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 j=new Uint32Array([r,t,o,u,w,g.length,f,y]);this.device.queue.writeBuffer(this.paramsBuffer,0,j),this.device.queue.writeBuffer(this.ciphertextBuffer,0,g),this.device.queue.writeBuffer(this.matchCountBuffer,0,hl.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const v=this.device.createCommandEncoder(),A=v.beginComputePass();A.setPipeline(this.pipeline),A.setBindGroup(0,this.bindGroup),A.dispatchWorkgroups(Math.ceil(u/(256*16))),A.end(),v.copyBufferToBuffer(this.matchCountBuffer,0,h,0,4),v.copyBufferToBuffer(this.matchIndicesBuffer,0,d,0,1024*4),this.device.queue.submit([v.finish()]),await h.mapAsync(GPUMapMode.READ);const k=new Uint32Array(h.getMappedRange())[0];h.unmap();const C=[];if(k>0){await d.mapAsync(GPUMapMode.READ);const S=new Uint32Array(d.getMappedRange());for(let D=0;D<Math.min(k,1024);D++)C.push(S[D]);d.unmap()}return C}destroy(){var r,o,t,u,l,m,c,h;(r=this.paramsBuffer)==null||r.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(t=this.matchIndicesBuffer)==null||t.destroy(),(u=this.ciphertextBuffer)==null||u.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(m=this.matchCountReadBuffers[1])==null||m.destroy(),(c=this.matchIndicesReadBuffers[0])==null||c.destroy(),(h=this.matchIndicesReadBuffers[1])==null||h.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}hl.ZERO_DATA=new Uint32Array([0]);function _j(){return typeof navigator<"u"&&"gpu"in navigator}class Ng{runBatch(r,o,t,u,l,m){const c=[],h=r.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);this.wordlist=u.filter(Ig)}setWordlist(r){this.wordlist=r.map(o=>o.trim().toLowerCase()).filter(Ig)}abort(){this.abortFlag=!0}isGpuAvailable(){return _j()}async decodePacket(r){var t;const o=r.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const l=(t=(await Rg.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:t.decoded;return!(l!=null&&l.channelHash)||!(l!=null&&l.ciphertext)||!(l!=null&&l.cipherMac)?null:{channelHash:l.channelHash,ciphertext:l.ciphertext,cipherMac:l.cipherMac,isGroupText:!0}}catch{return null}}async crack(r,o,t){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0,this.validSeconds=(o==null?void 0:o.validSeconds)??_u,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const u=(o==null?void 0:o.maxLength)??8,l=(o==null?void 0:o.startingLength)??1,m=(o==null?void 0:o.useDictionary)??!0,c=(o==null?void 0:o.startFromType)??"bruteforce",h=r.toLowerCase(),d=await this.decodePacket(h);if(!d)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:y,ciphertext:g,cipherMac:f}=d,w=parseInt(y,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new Ng):this.gpuInstance||(this.gpuInstance=new hl,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new Ng));const x=performance.now();let j=0,v=performance.now(),A=l,q=0,k=0,C=!1;if(o!=null&&o.startFrom){const L=o.startFrom.toLowerCase();if(c==="dictionary"){const Y=this.wordlist.indexOf(L);Y>=0&&(k=Y+1)}else{C=!0;const Y=Ej(L);Y&&(A=Math.max(l,Y.length),q=Y.index+1,q>=Rr(A)&&(A++,q=0))}}let S=0;m&&!C&&this.wordlist.length>0&&(S+=this.wordlist.length-k);for(let L=A;L<=u;L++)S+=Rr(L);S-=q;const D=(L,Y,re)=>{if(!t)return;const ne=(performance.now()-x)/1e3,W=ne>0?Math.round(j/ne):0,se=S-j,ee=W>0?se/W:0;t({checked:j,total:S,percent:S>0?Math.min(100,j/S*100):0,rateKeysPerSec:W,etaSeconds:ee,elapsedSeconds:ne,currentLength:Y,currentPosition:re,phase:L})},T=L=>{if(!Yb(g,f,L))return{valid:!1};const Y=Rg.ChannelCrypto.decryptGroupTextMessage(g,f,L);return!Y.success||!Y.data?{valid:!1}:this.useTimestampFilter&&!Sj(Y.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Bj(Y.data.message)?{valid:!1}:{valid:!0,message:Y.data.message}};if(!C&&k===0&&A===l&&q===0){D("public-key",0,Bu);const L=Fu(Gt);if(y===L){const Y=T(Gt);if(Y.valid)return{found:!0,roomName:Bu,key:Gt,decryptedMessage:Y.message}}}if(m&&!C&&this.wordlist.length>0)for(let L=k;L<this.wordlist.length;L++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[L],resumeType:"dictionary"};const Y=this.wordlist[L],re=Du("#"+Y),J=Fu(re);if(parseInt(J,16)===w){const W=T(re);if(W.valid)return{found:!0,roomName:Y,key:re,decryptedMessage:W.message,resumeFrom:Y,resumeType:"dictionary"}}j++;const ne=performance.now();ne-v>=200&&(D("wordlist",Y.length,Y),v=ne,await new Promise(W=>setTimeout(W,0)))}const F=this.useCpu?1024:32768,O=1e3;let N=F,R=!1;for(let L=A;L<=u;L++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(L,0)||void 0,resumeType:"bruteforce"};const Y=Rr(L);let re=L===A?q:0;for(;re<Y;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(L,re)||void 0,resumeType:"bruteforce"};const J=Math.min(N,Y-re),ne=performance.now();let W;this.useCpu?W=this.cpuInstance.runBatch(w,L,re,J,g,f):W=await this.gpuInstance.runBatch(w,L,re,J,g,f);const se=performance.now()-ne;if(j+=J,!this.useCpu&&!R&&J>=F&&se>0){const z=O/se,I=Math.round(J*z),H=Math.pow(2,Math.round(Math.log2(Math.max(F,I))));N=Math.max(F,H),R=!0}for(const z of W){const I=$n(L,z);if(!I)continue;const H=Du("#"+I),G=T(H);if(G.valid)return{found:!0,roomName:I,key:H,decryptedMessage:G.message,resumeFrom:I,resumeType:"bruteforce"}}re+=J;const ee=performance.now();if(ee-v>=200){const z=$n(L,Math.min(re,Y-1))||"";D("bruteforce",L,z),v=ee,await new Promise(I=>setTimeout(I,0))}}}return{found:!1,resumeFrom:$n(u,Rr(u)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}const Pj=["a","aa","aaa","aah","aahed","aahing","aahs","aal","aalii","aaliis","aals","aam","aani","aardvark","aardvarks","aardwolf","aardwolves","aargh","aaron","aaronic","aaronical","aaronite","aaronitic","aarrgh","aarrghh","aaru","aas","aasvogel","aasvogels","ab","aba","ababdeh","ababua","abac","abaca","abacay","abacas","abacate","abacaxi","abaci","abacinate","abacination","abacisci","abaciscus","abacist","aback","abacli","abacot","abacterial","abactinal","abactinally","abaction","abactor","abaculi","abaculus","abacus","abacuses","abada","abaddon","abadejo","abadengo","abadia","abadite","abaff","abaft","abay","abayah","abaisance","abaised","abaiser","abaisse","abaissed","abaka","abakas","abalation","abalienate","abalienated","abalienating","abalienation","abalone","abalones","abama","abamp",
Line truncated
|
||||
NoSleep enabled for older iOS devices. This can interrupt
|
||||
active or long-running network requests from completing successfully.
|
||||
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
|
||||
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(c=>(this.enabled=!0,c)).catch(c=>{throw this.enabled=!1,c})}disable(){t()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):o()?this.noSleepTimer&&(console.warn(`
|
||||
NoSleep now disabled for older iOS devices.
|
||||
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return fu=u,fu}var Mj=Ij();const Oj=Fo(Mj);function Hj({packets:a,channels:r,onChannelCreate:o,onRunningChange:t}){const[u,l]=B.useState(!1),[m,c]=B.useState(6),[h,d]=B.useState(!1),[y,g]=B.useState(!0),[f,w]=B.useState(null),[x,j]=B.useState(new Map),[v,A]=B.useState([]),[q,k]=B.useState(!1),[C,S]=B.useState(null),[D,T]=B.useState(null),F=B.useRef(null),O=B.useRef(null),N=B.useRef(!1),R=B.useRef(!1),U=B.useRef(!1),L=B.useRef(new Map),Y=B.useRef(!1),re=B.useRef(6),J=B.useRef(!0),ne=B.useRef(new Set);B.useEffect(()=>{const ie=new Tj;F.current=ie,S(ie.isGpuAvailable());const le=new Oj;return O.current=le,ie.setWordlist(Pj),k(!0),()=>{ie.destroy(),F.current=null,le.disable(),O.current=null}},[]),B.useEffect(()=>{const ie=()=>{Xe.getUndecryptedPacketCount().then(({count:ae})=>T(ae)).catch(()=>T(null))};ie();const le=setInterval(ie,3e4);return()=>clearInterval(le)},[]);const W=new Set(r.map(ie=>ie.key.toUpperCase())),se=a.filter(ie=>ie.payload_type==="GROUP_TEXT"&&!ie.decrypted);B.useEffect(()=>{j(ie=>{const le=new Map(ie);let ae=!1;for(const Ae of se)le.has(Ae.id)||(le.set(Ae.id,{packet:Ae,attempts:0,lastAttemptLength:0,status:"pending"}),ae=!0);return ae?(L.current=le,le):ie})},[se.length]),B.useEffect(()=>{L.current=x},[x]),B.useEffect(()=>{Y.current=h},[h]),B.useEffect(()=>{re.current=m},[m]),B.useEffect(()=>{J.current=y},[y]),B.useEffect(()=>{ne.current=new Set(se.map(ie=>ie.id))},[se]),B.useEffect(()=>{t==null||t(u)},[u,t]);const ee=Array.from(x.values()).filter(ie=>ie.status==="pending").length,z=Array.from(x.values()).filter(ie=>ie.status==="cracked").length,I=Array.from(x.values()).filter(ie=>ie.status==="failed").length,H=B.useCallback(async()=>{if(U.current||!F.current||!N.current)return;const ie=L.current;let le=null,ae=null;for(const[Re,Ne]of ie.entries())if(Ne.status==="pending"){le=Ne,ae=Re;break}if(!le&&Y.current){const Re=Array.from(ie.entries()).filter(([,Ne])=>Ne.status==="failed"&&Ne.lastAttemptLength<10);Re.length>0&&(Re.sort((Ne,Ue)=>Ne[1].lastAttemptLength-Ue[1].lastAttemptLength),[ae,le]=Re[0])}if(!le||ae===null){N.current&&setTimeout(()=>H(),1e3);return}if(!ne.current.has(ae)){j(Re=>{const Ne=new Map(Re);return Ne.delete(ae),Ne}),N.current&&setTimeout(()=>H(),10);return}U.current=!0;const Ae=re.current,Pe=le.lastAttemptLength>0?le.lastAttemptLength+1:Ae;try{const Re=await F.current.crack(le.packet.data,{maxLength:Pe,useTimestampFilter:!0,useUtf8Filter:!0},Ne=>{w(Ne)});if(R.current){R.current=!1,U.current=!1,w(null);return}if(Re.found&&Re.roomName&&Re.key){j(_e=>{const Ci=new Map(_e),yi=Ci.get(ae);return yi&&Ci.set(ae,{...yi,status:"cracked",attempts:yi.attempts+1,lastAttemptLength:Pe}),Ci});const Ne={roomName:Re.roomName,key:Re.key,packetId:ae,message:Re.decryptedMessage||"",crackedAt:Date.now()};A(_e=>[..._e,Ne]);const Ue=Re.key.toUpperCase();if(!W.has(Ue))try{const _e="#"+Re.roomName;await o(_e,Re.key),J.current&&await Xe.decryptHistoricalPackets({key_type:"channel",channel_name:_e})}catch(_e){console.error("Failed to create channel or decrypt historical:",_e)}}else j(Ne=>{const Ue=new Map(Ne),_e=Ue.get(ae);return _e&&Ue.set(ae,{..._e,status:"failed",attempts:_e.attempts+1,lastAttemptLength:Pe}),Ue})}catch(Re){console.error("Cracking error:",Re),j(Ne=>{const Ue=new Map(Ne),_e=Ue.get(ae);return _e&&Ue.set(ae,{..._e,status:"failed",attempts:_e.attempts+1,lastAttemptLength:Pe}),Ue})}U.current=!1,w(null),N.current&&setTimeout(()=>H(),100)},[W,o]),G=()=>{var ie;if(!C){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}l(!0),N.current=!0,R.current=!1,(ie=O.current)==null||ie.enable(),H()},de=()=>{var ie,le;l(!1),N.current=!1,R.current=!0,(ie=F.current)==null||ie.abort(),(le=O.current)==null||le.disable()};return _.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[_.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[_.jsx("button",{onClick:u?de:G,disabled:!q||C===!1,className:Ke("px-4 py-1.5 rounded text-sm font-medium",u?"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:u?"Stop":"Start Cracking"}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),_.jsx("input",{type:"number",min:1,max:10,value:m,onChange:ie=>c(Math.min(10,Math.max(1,parseInt(ie.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),_.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:h,onChange:ie=>d(ie.target.checked),className:"rounded"}),"Retry failed at n+1"]}),_.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foregro
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-Buy_tNL1.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-B4aoszDr.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-C3_XTTUI.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Generated
+4
-4
@@ -17,7 +17,7 @@
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.562.0",
|
||||
"meshcore-hashtag-cracker": "^1.3.1",
|
||||
"meshcore-hashtag-cracker": "^1.4.0",
|
||||
"nosleep.js": "^0.12.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
@@ -2439,9 +2439,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/meshcore-hashtag-cracker": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/meshcore-hashtag-cracker/-/meshcore-hashtag-cracker-1.3.1.tgz",
|
||||
"integrity": "sha512-0isl0fdb+WA+baBT1uCOnsfpgcO4I8+7n4DWMyzgM/QjXrcMss/scKCUwik4PshKx+uzWxIpsvIRSmGmZooznA==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/meshcore-hashtag-cracker/-/meshcore-hashtag-cracker-1.4.0.tgz",
|
||||
"integrity": "sha512-CfDFueRIz6bHHdBT4yQSSrGS6JEKKn+yiw5tIHfW2tTP7LhNRo084OlURXhLk+30PVPGNNUBA2M4ZnxLZe55MQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@michaelhart/meshcore-decoder": "^0.2.7",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.562.0",
|
||||
"meshcore-hashtag-cracker": "^1.3.1",
|
||||
"meshcore-hashtag-cracker": "^1.4.0",
|
||||
"nosleep.js": "^0.12.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
||||
@@ -33,6 +33,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
const [maxLength, setMaxLength] = useState(6);
|
||||
const [retryFailedAtNextLength, setRetryFailedAtNextLength] = useState(false);
|
||||
const [decryptHistorical, setDecryptHistorical] = useState(true);
|
||||
const [turboMode, setTurboMode] = useState(false);
|
||||
const [progress, setProgress] = useState<ProgressReport | null>(null);
|
||||
const [queue, setQueue] = useState<Map<number, QueueItem>>(new Map());
|
||||
const [crackedRooms, setCrackedRooms] = useState<CrackedRoom[]>([]);
|
||||
@@ -49,6 +50,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
const retryFailedRef = useRef(false);
|
||||
const maxLengthRef = useRef(6);
|
||||
const decryptHistoricalRef = useRef(true);
|
||||
const turboModeRef = useRef(false);
|
||||
const undecryptedIdsRef = useRef<Set<number>>(new Set());
|
||||
|
||||
// Initialize cracker and NoSleep
|
||||
@@ -136,6 +138,10 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
decryptHistoricalRef.current = decryptHistorical;
|
||||
}, [decryptHistorical]);
|
||||
|
||||
useEffect(() => {
|
||||
turboModeRef.current = turboMode;
|
||||
}, [turboMode]);
|
||||
|
||||
// Keep undecrypted IDs ref in sync - used to skip packets already decrypted by other means
|
||||
useEffect(() => {
|
||||
undecryptedIdsRef.current = new Set(undecryptedGroupText.map(p => p.id));
|
||||
@@ -221,6 +227,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
maxLength: targetLength,
|
||||
useTimestampFilter: true,
|
||||
useUtf8Filter: true,
|
||||
...(turboModeRef.current && { gpuDispatchMs: 10000 }),
|
||||
},
|
||||
(prog) => {
|
||||
setProgress(prog);
|
||||
@@ -394,6 +401,16 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
: '(messages stream in as decrypted)'}
|
||||
</span>
|
||||
)}
|
||||
|
||||
<label className="flex items-center gap-2 text-sm text-muted-foreground cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={turboMode}
|
||||
onChange={(e) => setTurboMode(e.target.checked)}
|
||||
className="rounded"
|
||||
/>
|
||||
Turbo mode (experimental)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Status */}
|
||||
|
||||
Reference in new issue
Block a user