mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-11-06 17:42:22 +01:00
Add automatic usage of known rooms
This commit is contained in:
1 parent
2463c14c9b
commit
f14c512777
4 files changed
+561
-535
No files matched your search
-532
@@ -1,532 +0,0 @@
|
||||
var Kg=Object.defineProperty;var Yg=(r,a,o)=>a in r?Kg(r,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[a]=o;var zn=(r,a,o)=>Yg(r,typeof a!="symbol"?a+"":a,o);function Zg(r,a){for(var o=0;o<a.length;o++){const i=a[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in r)){const l=Object.getOwnPropertyDescriptor(i,u);l&&Object.defineProperty(r,u,l.get?l:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const l of u)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&i(A)}).observe(document,{childList:!0,subtree:!0});function o(u){const l={};return u.integrity&&(l.integrity=u.integrity),u.referrerPolicy&&(l.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?l.credentials="include":u.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(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 Po(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Uh(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var a=r.default;if(typeof a=="function"){var o=function i(){return this instanceof i?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};o.prototype=a.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var u=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(o,i,u.get?u:{enumerable:!0,get:function(){return r[i]}})}),o}var Zc={exports:{}},ma={},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 Hf;function Xg(){if(Hf)return Oe;Hf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.iterator;function g(w){return w===null||typeof w!="object"?null:(w=x&&w[x]||w["@@iterator"],typeof w=="function"?w:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,k={};function v(w,j,V){this.props=w,this.context=j,this.refs=k,this.updater=V||C}v.prototype.isReactComponent={},v.prototype.setState=function(w,j){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,j,"setState")},v.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function S(){}S.prototype=v.prototype;function E(w,j,V){this.props=w,this.context=j,this.refs=k,this.updater=V||C}var y=E.prototype=new S;y.constructor=E,b(y,v.prototype),y.isPureReactComponent=!0;var B=Array.isArray,D=Object.prototype.hasOwnProperty,T={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function P(w,j,V){var W,ae={},ue=null,de=null;if(j!=null)for(W in j.ref!==void 0&&(de=j.ref),j.key!==void 0&&(ue=""+j.key),j)D.call(j,W)&&!I.hasOwnProperty(W)&&(ae[W]=j[W]);var te=arguments.length-2;if(te===1)ae.children=V;else if(1<te){for(var Se=Array(te),Ne=0;Ne<te;Ne++)Se[Ne]=arguments[Ne+2];ae.children=Se}if(w&&w.defaultProps)for(W in te=w.defaultProps,te)ae[W]===void 0&&(ae[W]=te[W]);return{$$typeof:r,type:w,key:ue,ref:de,props:ae,_owner:T.current}}function H(w,j){return{$$typeof:r,type:w.type,key:j,ref:w.ref,props:w.props,_owner:w._owner}}function M(w){return typeof w=="object"&&w!==null&&w.$$typeof===r}function N(w){var j={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(V){return j[V]})}var z=/\/+/g;function Q(w,j){return typeof w=="object"&&w!==null&&w.key!=null?N(""+w.key):j.toString(36)}function J(w,j,V,W,ae){var ue=typeof w;(ue==="undefined"||ue==="boolean")&&(w=null);var de=!1;if(w===null)de=!0;else switch(ue){case"string":case"number":de=!0;break;case"object":switch(w.$$typeof){case r:case a:de=!0}}if(de)return de=w,ae=ae(de),w=W===""?"."+Q(de,0):W,B(ae)?(V="",w!=null&&(V=w.replace(z,"$&/")+"/"),J(ae,j,V,"",function(Ne){return Ne})):ae!=null&&(M(ae)&&(ae=H(ae,V+(!ae.key||de&&de.key===ae.key?"":(""+ae.key).replace(z,"$&/")+"/")+w)),j.push(ae)),1;if(de=0,W=W===""?".":W+":",B(w))for(var te=0;te<w.length;te++){ue=w[te];var Se=W+Q(ue,te);de+=J(ue,j,V,Se,ae)}else if(Se=g(w),typeof Se=="function")for(w=Se.call(w),te=0;!(ue=w.next()).done;)ue=ue.value,Se=W+Q(ue,te++),de+=J(ue,j,V,Se,ae);else if(ue==="object")throw j=String(w),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return de}function se(w,j,V){if(w==null)return w;var W=[],ae=0;return J(w,W,"","",function(ue){return j.call(V,ue,ae++)}),W}function ee(w){if(w._status===-1){var j=w._result;j=j(),j.then(function(V){(w._status===0||w._status===-1)&&(w._status=1,w._result=V)},function(V){(w._status===0||w._status===-1)&&(w._status=2,w._result=V)}),w._status===-1&&(w._status=0,w._result=j)}if(w._status===1)return w._result.default;throw w._result}var re={current:null},q={transition:null},oe={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:q,ReactCurrentOwner:T};function $(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:se,forEach:function(w,j,V){se(w,function(){j.apply(this,arguments)},V)},count:function(w){var j=0;return se(w,function(){j++}),j},toArray:function(w){return se(w,function(j){return j})||[]},only:function(w){if(!M(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},Oe.Component=v,Oe.Fragment=o,Oe.Profiler=u,Oe.PureComponent=E,Oe.StrictMode=i,Oe.Suspense=h,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,Oe.act=$,Oe.cloneElement=function(w,j,V){if(w==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+w+".");var W=b({},w.props),ae=w.key,ue=w.ref,de=w._owner;if(j!=null){if(j.ref!==void 0&&(ue=j.ref,de=T.current),j.key!==void 0&&(ae=""+j.key),w.type&&w.type.defaultProps)var te=w.type.defaultProps;for(Se in j)D.call(j,Se)&&!I.hasOwnProperty(Se)&&(W[Se]=j[Se]===void 0&&te!==void 0?te[Se]:j[Se])}var Se=arguments.length-2;if(Se===1)W.children=V;else if(1<Se){te=Array(Se);for(var Ne=0;Ne<Se;Ne++)te[Ne]=arguments[Ne+2];W.children=te}return{$$typeof:r,type:w.type,key:ae,ref:ue,props:W,_owner:de}},Oe.createConteLine 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 zf;function Jg(){if(zf)return ma;zf=1;var r=Nu(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function A(c,h,d){var p,x={},g=null,C=null;d!==void 0&&(g=""+d),h.key!==void 0&&(g=""+h.key),h.ref!==void 0&&(C=h.ref);for(p in h)i.call(h,p)&&!l.hasOwnProperty(p)&&(x[p]=h[p]);if(c&&c.defaultProps)for(p in h=c.defaultProps,h)x[p]===void 0&&(x[p]=h[p]);return{$$typeof:a,type:c,key:g,ref:C,props:x,_owner:u.current}}return ma.Fragment=o,ma.jsx=A,ma.jsxs=A,ma}var Vf;function ev(){return Vf||(Vf=1,Zc.exports=Jg()),Zc.exports}var R=ev(),F=Nu();const he=Po(F),Iu=Zg({__proto__:null,default:he},[F]);var Ks={},Jc={exports:{}},rr={},eu={exports:{}},tu={};/**
|
||||
* @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 Uf;function tv(){return Uf||(Uf=1,(function(r){function a(q,oe){var $=q.length;q.push(oe);e:for(;0<$;){var w=$-1>>>1,j=q[w];if(0<u(j,oe))q[w]=oe,q[$]=j,$=w;else break e}}function o(q){return q.length===0?null:q[0]}function i(q){if(q.length===0)return null;var oe=q[0],$=q.pop();if($!==oe){q[0]=$;e:for(var w=0,j=q.length,V=j>>>1;w<V;){var W=2*(w+1)-1,ae=q[W],ue=W+1,de=q[ue];if(0>u(ae,$))ue<j&&0>u(de,ae)?(q[w]=de,q[ue]=$,w=ue):(q[w]=ae,q[W]=$,w=W);else if(ue<j&&0>u(de,$))q[w]=de,q[ue]=$,w=ue;else break e}}return oe}function u(q,oe){var $=q.sortIndex-oe.sortIndex;return $!==0?$:q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,c=A.now();r.unstable_now=function(){return A.now()-c}}var h=[],d=[],p=1,x=null,g=3,C=!1,b=!1,k=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(q){for(var oe=o(d);oe!==null;){if(oe.callback===null)i(d);else if(oe.startTime<=q)i(d),oe.sortIndex=oe.expirationTime,a(h,oe);else break;oe=o(d)}}function B(q){if(k=!1,y(q),!b)if(o(h)!==null)b=!0,ee(D);else{var oe=o(d);oe!==null&&re(B,oe.startTime-q)}}function D(q,oe){b=!1,k&&(k=!1,S(P),P=-1),C=!0;var $=g;try{for(y(oe),x=o(h);x!==null&&(!(x.expirationTime>oe)||q&&!N());){var w=x.callback;if(typeof w=="function"){x.callback=null,g=x.priorityLevel;var j=w(x.expirationTime<=oe);oe=r.unstable_now(),typeof j=="function"?x.callback=j:x===o(h)&&i(h),y(oe)}else i(h);x=o(h)}if(x!==null)var V=!0;else{var W=o(d);W!==null&&re(B,W.startTime-oe),V=!1}return V}finally{x=null,g=$,C=!1}}var T=!1,I=null,P=-1,H=5,M=-1;function N(){return!(r.unstable_now()-M<H)}function z(){if(I!==null){var q=r.unstable_now();M=q;var oe=!0;try{oe=I(!0,q)}finally{oe?Q():(T=!1,I=null)}}else T=!1}var Q;if(typeof E=="function")Q=function(){E(z)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,se=J.port2;J.port1.onmessage=z,Q=function(){se.postMessage(null)}}else Q=function(){v(z,0)};function ee(q){I=q,T||(T=!0,Q())}function re(q,oe){P=v(function(){q(r.unstable_now())},oe)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(q){q.callback=null},r.unstable_continueExecution=function(){b||C||(b=!0,ee(D))},r.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<q?Math.floor(1e3/q):5},r.unstable_getCurrentPriorityLevel=function(){return g},r.unstable_getFirstCallbackNode=function(){return o(h)},r.unstable_next=function(q){switch(g){case 1:case 2:case 3:var oe=3;break;default:oe=g}var $=g;g=oe;try{return q()}finally{g=$}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(q,oe){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var $=g;g=q;try{return oe()}finally{g=$}},r.unstable_scheduleCallback=function(q,oe,$){var w=r.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?w+$:w):$=w,q){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=$+j,q={id:p++,callback:oe,priorityLevel:q,startTime:$,expirationTime:j,sortIndex:-1},$>w?(q.sortIndex=$,a(d,q),o(h)===null&&q===o(d)&&(k?(S(P),P=-1):k=!0,re(B,$-w))):(q.sortIndex=j,a(h,q),b||C||(b=!0,ee(D))),q},r.unstable_shouldYield=N,r.unstable_wrapCallback=function(q){var oe=g;return function(){var $=g;g=oe;try{return q.apply(this,arguments)}finally{g=$}}}})(tu)),tu}var Wf;function rv(){return Wf||(Wf=1,eu.exports=tv()),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 qf;function nv(){if(qf)return rr;qf=1;var r=Nu(),a=rv();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,u={};function l(e,t){A(e,t),A(e+"Capture",t)}function A(e,t){for(u[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},x={};function g(e){return h.call(x,e)?!0:h.call(p,e)?!1:d.test(e)?x[e]=!0:(p[e]=!0,!1)}function C(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){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 b(e,t,n,s){if(t===null||typeof t>"u"||C(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function k(e,t,n,s,f,m,_){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=f,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=m,this.removeEmptyString=_}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new k(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];v[t]=new k(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new k(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new k(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){v[e]=new k(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new k(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new k(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new k(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new k(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(S,E);v[t]=new k(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(S,E);v[t]=new k(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(S,E);v[t]=new k(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new k(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new k(e,1,!1,e.toLowerCase(),null,!0,!0)});function y(e,t,n,s){var f=v.hasOwnProperty(t)?v[t]:null;(f!==null?f.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=
Line truncated
|
||||
`+w+e}var V=!1;function W(e,t){if(!e||V)return"";V=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(X){var s=X}Reflect.construct(e,[],t)}else{try{t.call()}catch(X){s=X}e.call(t.prototype)}else{try{throw Error()}catch(X){s=X}e()}}catch(X){if(X&&s&&typeof X.stack=="string"){for(var f=X.stack.split(`
|
||||
`),m=s.stack.split(`
|
||||
`),_=f.length-1,O=m.length-1;1<=_&&0<=O&&f[_]!==m[O];)O--;for(;1<=_&&0<=O;_--,O--)if(f[_]!==m[O]){if(_!==1||O!==1)do if(_--,O--,0>O||f[_]!==m[O]){var L=`
|
||||
`+f[_].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=_&&0<=O);break}}}finally{V=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function ae(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1),e;case 11:return e=W(e.type.render,!1),e;case 1:return e=W(e.type,!0),e;default:return""}}function ue(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I:return"Fragment";case T:return"Portal";case H:return"Profiler";case P:return"StrictMode";case Q:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case N:return(e.displayName||"Context")+".Consumer";case M:return(e._context.displayName||"Context")+".Provider";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(t);case 8:return t===P?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ne(e){var t=Se(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var f=n.get,m=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,m.call(this,_)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rt(e){e._valueTracker||(e._valueTracker=Ne(e))}function nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Se(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function st(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,t){var n=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gt(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=te(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ot(e,t){t=t.checked,t!=null&&y(e,"checked",t,!1)}function St(e,t){Ot(e,t);var n=te(t.value),s=t.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}t.hasOwnProperty("value")?ct(e,t.type,n):t.hasOwnProperty("defaultValue")&&ct(e,t.type,te(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ct(e,t,n){(t!=="number"||st(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tt=Array.isArray;function Je(e,t,n,s){if(e=e.options,t){t={};for(var f=0;f<n.length;f++)t["$"+n[f]]=!0;for(n=0;n<e.length;n++)f=t.hasOwnProperty("$"+e[n].value),e[n].selected!==f&&(e[n].selected=f),f&&s&&(e[n].defaultSelected=!0)}else{for(n=""+te(n),t=null,f=0;f<e.length;f++){if(e[f].value===n){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function Ve(e,t){if(t.dangerouslySetInnerHTML!
Line truncated
|
||||
`).replace(lg,"")}function ls(e,t,n){if(t=nd(t),nd(e)!==t&&n)throw Error(o(425))}function cs(){}var zl=null,Vl=null;function Ul(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wl=typeof setTimeout=="function"?setTimeout:void 0,cg=typeof clearTimeout=="function"?clearTimeout:void 0,od=typeof Promise=="function"?Promise:void 0,ug=typeof queueMicrotask=="function"?queueMicrotask:typeof od<"u"?function(e){return od.resolve(null).then(e).catch(dg)}:Wl;function dg(e){setTimeout(function(){throw e})}function ql(e,t){var n=t,s=0;do{var f=n.nextSibling;if(e.removeChild(n),f&&f.nodeType===8)if(n=f.data,n==="/$"){if(s===0){e.removeChild(f),Wo(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=f}while(n);Wo(t)}function un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ad(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var so=Math.random().toString(36).slice(2),Pr="__reactFiber$"+so,ta="__reactProps$"+so,Ur="__reactContainer$"+so,Ql="__reactEvents$"+so,fg="__reactListeners$"+so,Ag="__reactHandles$"+so;function Dn(e){var t=e[Pr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Pr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ad(e);e!==null;){if(n=e[Pr])return n;e=ad(e)}return t}e=n,n=e.parentNode}return null}function ra(e){return e=e[Pr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function io(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function us(e){return e[ta]||null}var Gl=[],lo=-1;function dn(e){return{current:e}}function tt(e){0>lo||(e.current=Gl[lo],Gl[lo]=null,lo--)}function Ye(e,t){lo++,Gl[lo]=e.current,e.current=t}var fn={},Ht=dn(fn),Zt=dn(!1),Fn=fn;function co(e,t){var n=e.type.contextTypes;if(!n)return fn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in n)f[m]=t[m];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=f),f}function Xt(e){return e=e.childContextTypes,e!=null}function ds(){tt(Zt),tt(Ht)}function sd(e,t,n){if(Ht.current!==fn)throw Error(o(168));Ye(Ht,t),Ye(Zt,n)}function id(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var f in s)if(!(f in t))throw Error(o(108,de(e)||"Unknown",f));return $({},n,s)}function fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,Fn=Ht.current,Ye(Ht,e),Ye(Zt,Zt.current),!0}function ld(e,t,n){var s=e.stateNode;if(!s)throw Error(o(169));n?(e=id(e,t,Fn),s.__reactInternalMemoizedMergedChildContext=e,tt(Zt),tt(Ht),Ye(Ht,e)):tt(Zt),Ye(Zt,n)}var Wr=null,As=!1,$l=!1;function cd(e){Wr===null?Wr=[e]:Wr.push(e)}function hg(e){As=!0,cd(e)}function An(){if(!$l&&Wr!==null){$l=!0;var e=0,t=Ge;try{var n=Wr;for(Ge=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}Wr=null,As=!1}catch(f){throw Wr!==null&&(Wr=Wr.slice(e+1)),d0(xl,An),f}finally{Ge=t,$l=!1}}return null}var uo=[],fo=0,hs=null,ps=0,fr=[],Ar=0,Rn=null,qr=1,Qr="";function Tn(e,t){uo[fo++]=ps,uo[fo++]=hs,hs=e,ps=t}function ud(e,t,n){fr[Ar++]=qr,fr[Ar++]=Qr,fr[Ar++]=Rn,Rn=e;var s=qr;e=Qr;var f=32-wr(s)-1;s&=~(1<<f),n+=1;var m=32-wr(t)+f;if(30<m){var _=f-f%5;m=(s&(1<<_)-1).toString(32),s>>=_,f-=_,qr=1<<32-wr(t)+f|n<<f|s,Qr=m+e}else qr=1<<m|n<<f|s,Qr=e}function Kl(e){e.return!==null&&(Tn(e,1),ud(e,1,0))}function Yl(e){for(;e===hs;)hs=uo[--fo],uo[fo]=null,ps=uo[--fo],uo[fo]=null;for(;e===Rn;)Rn=fr[--Ar],fr[Ar]=null,Qr=fr[--Ar],fr[Ar]=null,qr=fr[--Ar],fr[Ar]=null}var sr=null,ir=null,at=!1,Er=null;function dd(e,t){var n=mr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fd(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ir=un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ir=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rn!==null?{id:qr,overflow:Qr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sr=e,ir=null,!0):!1;default:return!1}}function Zl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xl(e){if(at){var t=ir;if(t){var n=t;if(!fd(e,t)){if(Zl(e))throw Error(o(418));t=un(n.nextSibling);var s=sr;t&&fd(e,t)?dd(s,n):(e.flags=e.flags&-4097|2,at=!1,sr=e)}}else{if(Zl(e))throw Error(o(418));e.flags=e.flags&-4097|2,at=!1,sr=e}}}function Ad(e){for(e=e.
Line truncated
|
||||
Error generating stack: `+m.message+`
|
||||
`+m.stack}return{value:e,source:t,stack:f,digest:null}}function yc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Cc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var bg=typeof WeakMap=="function"?WeakMap:Map;function Gd(e,t,n){n=$r(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Is||(Is=!0,Mc=s),Cc(e,t)},n}function $d(e,t,n){n=$r(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var f=t.value;n.payload=function(){return s(f)},n.callback=function(){Cc(e,t)}}var m=e.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(n.callback=function(){Cc(e,t),typeof s!="function"&&(mn===null?mn=new Set([this]):mn.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),n}function Kd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new bg;var f=new Set;s.set(t,f)}else f=s.get(t),f===void 0&&(f=new Set,s.set(t,f));f.has(n)||(f.add(n),e=Og.bind(null,e,t,n),t.then(e,e))}function Yd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zd(e,t,n,s,f){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$r(-1,1),t.tag=2,pn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var Eg=B.ReactCurrentOwner,Jt=!1;function qt(e,t,n,s){t.child=e===null?md(t,null,n,s):ho(t,e.child,n,s)}function Xd(e,t,n,s,f){n=n.render;var m=t.ref;return xo(t,f),s=fc(e,t,n,s,m,f),n=Ac(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,Kr(e,t,f)):(at&&n&&Kl(t),t.flags|=1,qt(e,t,s,f),t.child)}function Jd(e,t,n,s,f){if(e===null){var m=n.type;return typeof m=="function"&&!Uc(m)&&m.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=m,ef(e,t,m,s,f)):(e=zs(n.type,null,s,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,(e.lanes&f)===0){var _=m.memoizedProps;if(n=n.compare,n=n!==null?n:Yo,n(_,s)&&e.ref===t.ref)return Kr(e,t,f)}return t.flags|=1,e=Cn(m,s),e.ref=t.ref,e.return=t,t.child=e}function ef(e,t,n,s,f){if(e!==null){var m=e.memoizedProps;if(Yo(m,s)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=s=m,(e.lanes&f)!==0)(e.flags&131072)!==0&&(Jt=!0);else return t.lanes=e.lanes,Kr(e,t,f)}return wc(e,t,n,s,f)}function tf(e,t,n){var s=t.pendingProps,f=s.children,m=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ye(yo,lr),lr|=n;else{if((n&1073741824)===0)return e=m!==null?m.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ye(yo,lr),lr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=m!==null?m.baseLanes:n,Ye(yo,lr),lr|=s}else m!==null?(s=m.baseLanes|n,t.memoizedState=null):s=n,Ye(yo,lr),lr|=s;return qt(e,t,f,n),t.child}function rf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function wc(e,t,n,s,f){var m=Xt(n)?Fn:Ht.current;return m=co(t,m),xo(t,f),n=fc(e,t,n,s,m,f),s=Ac(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,Kr(e,t,f)):(at&&s&&Kl(t),t.flags|=1,qt(e,t,n,f),t.child)}function nf(e,t,n,s,f){if(Xt(n)){var m=!0;fs(t)}else m=!1;if(xo(t,f),t.stateNode===null)Fs(e,t),qd(t,n,s),vc(t,n,s,f),s=!0;else if(e===null){var _=t.stateNode,O=t.memoizedProps;_.props=O;var L=_.context,X=n.contextType;typeof X=="object"&&X!==null?X=hr(X):(X=Xt(n)?Fn:Ht.current,X=co(t,X));var le=n.getDerivedStateFromProps,ce=typeof le=="function"||typeof _.getSnapshotBeforeUpdate=="function";ce||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==s||L!==X)&&Qd(t,_,s,X),hn=!1;var ie=t.memoizedState;_.state=ie,Cs(t,s,_,f),L=t.memoizedState,O!==s||ie!==L||Zt.current||hn?(typeof le=="function"&&(gc(t,n,le,s),L=t.memoizedState),(O=hn||Wd(t,n,O,s,ie,L,X))?(ce||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=L),_.props=s,_.state=L,_.context=X,s=O):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{_=t.stateNode,vd(e,t),O=t.memoizedProps,X=t.type===t.elementType?O:kr(t.type,O),_.props=X,ce=t.pendingProps,ie=_.context,L=n.contextType,typeof L=="object"&&L!==null?L=hr(L):(L=Xt(n)?Fn:Ht.current,L=co(t,L));var xe=n.getDerivedStateFromProps;(le=typeof xe=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==ce||ie!==L)&&Qd(t,_,s,L),hn=!1,ie=t.memoizedState,_
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 lv=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cv=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,i)=>i?i.toUpperCase():o.toLowerCase()),$f=r=>{const a=cv(r);return a.charAt(0).toUpperCase()+a.slice(1)},qh=(...r)=>r.filter((a,o,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===o).join(" ").trim(),uv=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var dv={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 fv=F.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:l,iconNode:A,...c},h)=>F.createElement("svg",{ref:h,...dv,width:a,height:a,stroke:r,strokeWidth:i?Number(o)*24/Number(a):o,className:qh("lucide",u),...!l&&!uv(c)&&{"aria-hidden":"true"},...c},[...A.map(([d,p])=>F.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Mu=(r,a)=>{const o=F.forwardRef(({className:i,...u},l)=>F.createElement(fv,{ref:l,iconNode:a,className:qh(`lucide-${lv($f(r))}`,`lucide-${r}`,i),...u}));return o.displayName=$f(r),o};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Av=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hv=Mu("check",Av);/**
|
||||
* @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 pv=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],xv=Mu("menu",pv);/**
|
||||
* @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 mv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qh=Mu("x",mv);var Gh=Wh();const $h=Po(Gh);function gv(r){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a.appendChild(o),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r))}const vv=r=>{switch(r){case"success":return wv;case"info":return Ev;case"warning":return bv;case"error":return kv;default:return null}},yv=Array(12).fill(0),Cv=({visible:r,className:a})=>he.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":r},he.createElement("div",{className:"sonner-spinner"},yv.map((o,i)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),wv=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"})),bv=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"})),Ev=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"})),kv=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"})),Sv=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"})),Bv=()=>{const[r,a]=he.useState(document.hidden);return he.useEffect(()=>{const o=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),r};let vu=1;class _v{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const o=this.subscribers.indexOf(a);this.subscribers.splice(o,1)}),this.publish=a=>{this.subscribers.forEach(o=>o(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var o;const{message:i,...u}=a,l=typeof(a==null?void 0:a.id)=="number"||((o=a.id)==null?void 0:o.length)>0?a.id:vu++,A=this.toasts.find(h=>h.id===l),c=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),A?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...a,id:l,title:i}),{...h,...a,id:l,dismissible:c,title:i}):h):this.addToast({title:i,...u,dismissible:c,id:l}),l},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:a,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(i=>i({id:o.id,dismiss:!0}))}),a),this.message=(a,o)=>this.create({...o,message:a}),this.error=(a,o)=>this.create({...o,message:a,type:"error"}),this.success=(a,o)=>this.create({...o,type:"success",message:a}),this.info=(a,o)=>this.create({...o,type:"info",message:a}),this.warning=(a,o)=>this.create({...o,type:"warning",message:a}),this.loading=(a,o)=>this.create({...o,type:"loading",message:a}),this.promise=(a,o)=>{if(!o)return;let i;o.loading!==void 0&&(i=this.create({...o,promise:a,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const u=Promise.resolve(a instanceof Function?a():a);let l=i!==void 0,A;const c=u.then(async d=>{if(A=["resolve",d],he.isValidElement(d))l=!1,this.create({id:i,type:"default",message:d});else if(Fv(d)&&!d.ok){l=!1;const x=typeof o.error=="function"?await o.error(`HTTP error! status: ${d.status}`):o.error,g=typeof o.description=="function"?await o.description(`HTTP error! status: ${d.status}`):o.description,b=typeof x=="object"&&!he.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:g,...b})}else if(d instanceof Error){l=!1;const x=typeof o.error=="function"?await o.error(d):o.error,Line truncated
|
||||
`).map((oe,$,w)=>R.jsxs("span",{children:[oe,$<w.length-1&&R.jsx("br",{})]},$)),!J&&R.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:iA(B.sender_timestamp||B.received_at)}),B.outgoing&&(B.acked?" ✓":" ?")]})]})]},B.id)})]}),p&&R.jsx("button",{onClick:b,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:R.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:R.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const r1=F.forwardRef(function({onSend:a,disabled:o,placeholder:i},u){const[l,A]=F.useState(""),[c,h]=F.useState(!1),d=F.useRef(null);F.useImperativeHandle(u,()=>({appendText:g=>{var C;A(b=>b+g),(C=d.current)==null||C.focus()}}));const p=F.useCallback(async g=>{g.preventDefault();const C=l.trim();if(!(!C||c||o)){h(!0);try{await a(C),A("")}catch(b){console.error("Failed to send message:",b)}finally{h(!1)}}},[l,c,o,a]),x=F.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),p(g))},[p]);return R.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:p,children:[R.jsx(gt,{ref:d,type:"text",value:l,onChange:g=>A(g.target.value),onKeyDown:x,placeholder:i||"Type a message...",disabled:o||c,className:"flex-1"}),R.jsx(zr,{type:"submit",disabled:o||c||!l.trim(),children:c?"Sending...":"Send"})]})});function kt(r,a,{checkForDefaultPrevented:o=!0}={}){return function(u){if(r==null||r(u),o===!1||!u.defaultPrevented)return a==null?void 0:a(u)}}function n1(r,a){const o=F.createContext(a),i=l=>{const{children:A,...c}=l,h=F.useMemo(()=>c,Object.values(c));return R.jsx(o.Provider,{value:h,children:A})};i.displayName=r+"Provider";function u(l){const A=F.useContext(o);if(A)return A;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[i,u]}function za(r,a=[]){let o=[];function i(l,A){const c=F.createContext(A),h=o.length;o=[...o,A];const d=x=>{var S;const{scope:g,children:C,...b}=x,k=((S=g==null?void 0:g[r])==null?void 0:S[h])||c,v=F.useMemo(()=>b,Object.values(b));return R.jsx(k.Provider,{value:v,children:C})};d.displayName=l+"Provider";function p(x,g){var k;const C=((k=g==null?void 0:g[r])==null?void 0:k[h])||c,b=F.useContext(C);if(b)return b;if(A!==void 0)return A;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[d,p]}const u=()=>{const l=o.map(A=>F.createContext(A));return function(c){const h=(c==null?void 0:c[r])||l;return F.useMemo(()=>({[`__scope${r}`]:{...c,[r]:h}}),[c,h])}};return u.scopeName=r,[i,o1(u,...a)]}function o1(...r){const a=r[0];if(r.length===1)return a;const o=()=>{const i=r.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const A=i.reduce((c,{useScope:h,scopeName:d})=>{const x=h(l)[`__scope${d}`];return{...c,...x}},{});return F.useMemo(()=>({[`__scope${a.scopeName}`]:A}),[A])}};return o.scopeName=a.scopeName,o}var Ro=globalThis!=null&&globalThis.document?F.useLayoutEffect:()=>{},a1=Iu[" useId ".trim().toString()]||(()=>{}),s1=0;function Ma(r){const[a,o]=F.useState(a1());return Ro(()=>{o(i=>i??String(s1++))},[r]),a?`radix-${a}`:""}var i1=Iu[" useInsertionEffect ".trim().toString()]||Ro;function rl({prop:r,defaultProp:a,onChange:o=()=>{},caller:i}){const[u,l,A]=l1({defaultProp:a,onChange:o}),c=r!==void 0,h=c?r:u;{const p=F.useRef(r!==void 0);F.useEffect(()=>{const x=p.current;x!==c&&console.warn(`${i} is changing from ${x?"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.`),p.current=c},[c,i])}const d=F.useCallback(p=>{var x;if(c){const g=c1(p)?p(r):p;g!==r&&((x=A.current)==null||x.call(A,g))}else l(p)},[c,r,l,A]);return[h,d]}function l1({defaultProp:r,onChange:a}){const[o,i]=F.useState(r),u=F.useRef(o),l=F.useRef(a);return i1(()=>{l.current=a},[a]),F.useEffect(()=>{var A;u.current!==o&&((A=l.current)==null||A.call(l,o),u.current=o)},[o,u]),[o,i,l]}function c1(r){return typeof r=="function"}function u1(r){const a=d1(r),o=F.forwardRef((i,u)=>{const{children:l,...A}=i,c=F.Children.toArray(l),h=c.find(A1);if(h){const d=h.props.children,p=c.map(x=>x===h?F.Children.count(d)>1?F.Children.only(null):F.isValidElement(d)?d.props.children:null:x);return R.jsx(a,{...A,ref:u,children:F.isValidElement(d)?F.cloneElement(d,void 0,p):null})}return R.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function d1(r){const a=F.forwardRef((o,i)=>{const{children:u,...l}=o;if(F.isValidElement(u)){const A=p1(u),c=h1(l,u.props);return u.type!==F.Fragment&&(c.ref=i?La(i,A):A),F.cloneElement(u,c)}return F.Children.count(u)>1?F.Children.only(null):null});return a.displayName=`${r}.Slot
Line truncated
|
||||
.`.concat(H1,` {
|
||||
overflow: hidden `).concat(i,`;
|
||||
padding-right: `).concat(c,"px ").concat(i,`;
|
||||
}
|
||||
body[`).concat(_o,`] {
|
||||
overflow: hidden `).concat(i,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([a&&"position: relative ".concat(i,";"),o==="margin"&&`
|
||||
padding-left: `.concat(u,`px;
|
||||
padding-top: `).concat(l,`px;
|
||||
padding-right: `).concat(A,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(c,"px ").concat(i,`;
|
||||
`),o==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(oi,` {
|
||||
right: `).concat(c,"px ").concat(i,`;
|
||||
}
|
||||
|
||||
.`).concat(ai,` {
|
||||
margin-right: `).concat(c,"px ").concat(i,`;
|
||||
}
|
||||
|
||||
.`).concat(oi," .").concat(oi,` {
|
||||
right: 0 `).concat(i,`;
|
||||
}
|
||||
|
||||
.`).concat(ai," .").concat(ai,` {
|
||||
margin-right: 0 `).concat(i,`;
|
||||
}
|
||||
|
||||
body[`).concat(_o,`] {
|
||||
`).concat(L1,": ").concat(c,`px;
|
||||
}
|
||||
`)},xA=function(){var r=parseInt(document.body.getAttribute(_o)||"0",10);return isFinite(r)?r:0},a2=function(){F.useEffect(function(){return document.body.setAttribute(_o,(xA()+1).toString()),function(){var r=xA()-1;r<=0?document.body.removeAttribute(_o):document.body.setAttribute(_o,r.toString())}},[])},s2=function(r){var a=r.noRelative,o=r.noImportant,i=r.gapMode,u=i===void 0?"margin":i;a2();var l=F.useMemo(function(){return r2(u)},[u]);return F.createElement(n2,{styles:o2(l,!a,u,o?"":"!important")})},ku=!1;if(typeof window<"u")try{var ei=Object.defineProperty({},"passive",{get:function(){return ku=!0,!0}});window.addEventListener("test",ei,ei),window.removeEventListener("test",ei,ei)}catch{ku=!1}var Eo=ku?{passive:!1}:!1,i2=function(r){return r.tagName==="TEXTAREA"},bp=function(r,a){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!i2(r)&&o[a]==="visible")},l2=function(r){return bp(r,"overflowY")},c2=function(r){return bp(r,"overflowX")},mA=function(r,a){var o=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=Ep(r,i);if(u){var l=kp(r,i),A=l[1],c=l[2];if(A>c)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},u2=function(r){var a=r.scrollTop,o=r.scrollHeight,i=r.clientHeight;return[a,o,i]},d2=function(r){var a=r.scrollLeft,o=r.scrollWidth,i=r.clientWidth;return[a,o,i]},Ep=function(r,a){return r==="v"?l2(a):c2(a)},kp=function(r,a){return r==="v"?u2(a):d2(a)},f2=function(r,a){return r==="h"&&a==="rtl"?-1:1},A2=function(r,a,o,i,u){var l=f2(r,window.getComputedStyle(a).direction),A=l*i,c=o.target,h=a.contains(c),d=!1,p=A>0,x=0,g=0;do{if(!c)break;var C=kp(r,c),b=C[0],k=C[1],v=C[2],S=k-v-l*b;(b||S)&&Ep(r,c)&&(x+=S,g+=b);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!h&&c!==document.body||h&&(a.contains(c)||a===c));return(p&&Math.abs(x)<1||!p&&Math.abs(g)<1)&&(d=!0),d},ti=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},gA=function(r){return[r.deltaX,r.deltaY]},vA=function(r){return r&&"current"in r?r.current:r},h2=function(r,a){return r[0]===a[0]&&r[1]===a[1]},p2=function(r){return`
|
||||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||||
`)},x2=0,ko=[];function m2(r){var a=F.useRef([]),o=F.useRef([0,0]),i=F.useRef(),u=F.useState(x2++)[0],l=F.useState(wp)[0],A=F.useRef(r);F.useEffect(function(){A.current=r},[r]),F.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(u));var k=j1([r.lockRef.current],(r.shards||[]).map(vA),!0).filter(Boolean);return k.forEach(function(v){return v.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),k.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(u))})}}},[r.inert,r.lockRef.current,r.shards]);var c=F.useCallback(function(k,v){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!A.current.allowPinchZoom;var S=ti(k),E=o.current,y="deltaX"in k?k.deltaX:E[0]-S[0],B="deltaY"in k?k.deltaY:E[1]-S[1],D,T=k.target,I=Math.abs(y)>Math.abs(B)?"h":"v";if("touches"in k&&I==="h"&&T.type==="range")return!1;var P=window.getSelection(),H=P&&P.anchorNode,M=H?H===T||H.contains(T):!1;if(M)return!1;var N=mA(I,T);if(!N)return!0;if(N?D=I:(D=I==="v"?"h":"v",N=mA(I,T)),!N)return!1;if(!i.current&&"changedTouches"in k&&(y||B)&&(i.current=D),!D)return!0;var z=i.current||D;return A2(z,v,k,z==="h"?y:B)},[]),h=F.useCallback(function(k){var v=k;if(!(!ko.length||ko[ko.length-1]!==l)){var S="deltaY"in v?gA(v):ti(v),E=a.current.filter(function(D){return D.name===v.type&&(D.target===v.target||v.target===D.shadowParent)&&h2(D.delta,S)})[0];if(E&&E.should){v.cancelable&&v.preventDefault();return}if(!E){var y=(A.current.shards||[]).map(vA).filter(Boolean).filter(function(D){return D.contains(v.target)}),B=y.length>0?c(v,y[0]):!A.current.noIsolation;B&&v.cancelable&&v.preventDefault()}}},[]),d=F.useCallback(function(k,v,S,E){var y={name:k,delta:v,target:S,should:E,shadowParent:g2(S)};a.current.push(y),setTimeout(function(){a.current=a.current.filter(function(B){return B!==y})},1)},[]),p=F.useCallback(function(k){o.current=ti(k),i.current=void 0},[]),x=F.useCallback(function(k){d(k.type,gA(k),k.target,c(k,r.lockRef.current))},[]),g=F.useCallback(function(k){d(k.type,ti(k),k.target,c(k,r.lockRef.current))},[]);F.useEffect(function(){return ko.push(l),r.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:g}),document.addEventListener("wheel",h,Eo),document.addEventListener("touchmove",h,Eo),document.addEventListener("touchstart",p,Eo),function(){ko=ko.filter(function(k){return k!==l}),document.removeEventListener("wheel",h,Eo),document.removeEventListener("touchmove",h,Eo),document.removeEventListener("touchstart",p,Eo)}},[]);var C=r.removeScrollBar,b=r.inert;return F.createElement(F.Fragment,null,b?F.createElement(l,{styles:p2(u)}):null,C?F.createElement(s2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function g2(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const v2=G1(Cp,m2);var Sp=F.forwardRef(function(r,a){return F.createElement(nl,Lr({},r,{ref:a,sideCar:v2}))});Sp.classNames=nl.classNames;var y2=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},So=new WeakMap,ri=new WeakMap,ni={},fu=0,Bp=function(r){return r&&(r.host||Bp(r.parentNode))},C2=function(r,a){return a.map(function(o){if(r.contains(o))return o;var i=Bp(o);return i&&r.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},w2=function(r,a,o,i){var u=C2(a,Array.isArray(r)?r:[r]);ni[o]||(ni[o]=new WeakMap);var l=ni[o],A=[],c=new Set,h=new Set(u),d=function(x){!x||c.has(x)||(c.add(x),d(x.parentNode))};u.forEach(d);var p=function(x){!x||h.has(x)||Array.prototype.forEach.call(x.children,function(g){if(c.has(g))p(g);else try{var C=g.getAttribute(i),b=C!==null&&C!=="false",k=(So.get(g)||0)+1,v=(l.get(g)||0)+1;So.set(g,k),l.set(g,v),A.push(g),k===1&&b&&ri.set(g,!0),v===1&&g.setAttribute(o,"true"),b||g.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return p(a),c.clear(),fu++,function(){A.forEach(function(x){var g=So.get(x)-1,C=l.get(x)-1;So.set(x,g),l.set(x,C),g||(ri.has(x)||x.removeAttribute(i),ri.delete(x)),C||x.removeAttribute(o)}),fu--,fu||(So=new WeakMap,So=new WeakMap,ri=new WeakMap,ni={})}},b2=function(r,a,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),u=y2(r);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),w2(i,u,o,"aria-hidden")):function(){return null}};function E2(r){const a=k2(r),o=F.forwardRef((i,u)=>{const{children:l,...A}=i,c=F.Children.toArray(l),h=c.find(B2);if(h){const d=h.props.children,p=c.map(x=>x===h?F.Children.count(d)>1?F.Children.only(null):F.isValidElement(d)?d.props.children:null:x);return R.jsx(a,{...A,ref:u,children:F.isValidElement(d)?F.cloneElement(d,void 0,p):null})}return R.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function k2(r){const a=F.forwardRef((o,i)=>{const{children:u
Line truncated
|
||||
|
||||
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return F.useEffect(()=>{r&&(document.getElementById(r)||console.error(o))},[o,r]),null},j2="DialogDescriptionWarning",H2=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vp(j2).contentName}}.`;return F.useEffect(()=>{var l;const u=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");a&&u&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},Up=Dp,Wp=Tp,al=Pp,sl=Np,il=Mp,ll=jp,qp=Lp;const Qp=Up,L2=Wp,Gp=F.forwardRef(({className:r,...a},o)=>R.jsx(al,{ref:o,className:qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a}));Gp.displayName=al.displayName;const Vu=F.forwardRef(({className:r,children:a,...o},i)=>R.jsxs(L2,{children:[R.jsx(Gp,{}),R.jsxs(sl,{ref:i,className:qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...o,children:[a,R.jsxs(qp,{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:[R.jsx(Qh,{className:"h-4 w-4"}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vu.displayName=sl.displayName;const Uu=({className:r,...a})=>R.jsx("div",{className:qe("flex flex-col space-y-1.5 text-center sm:text-left",r),...a});Uu.displayName="DialogHeader";const Wu=({className:r,...a})=>R.jsx("div",{className:qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});Wu.displayName="DialogFooter";const qu=F.forwardRef(({className:r,...a},o)=>R.jsx(il,{ref:o,className:qe("text-lg font-semibold leading-none tracking-tight",r),...a}));qu.displayName=il.displayName;const z2=F.forwardRef(({className:r,...a},o)=>R.jsx(ll,{ref:o,className:qe("text-sm text-muted-foreground",r),...a}));z2.displayName=ll.displayName;function yA(r){const a=V2(r),o=F.forwardRef((i,u)=>{const{children:l,...A}=i,c=F.Children.toArray(l),h=c.find(W2);if(h){const d=h.props.children,p=c.map(x=>x===h?F.Children.count(d)>1?F.Children.only(null):F.isValidElement(d)?d.props.children:null:x);return R.jsx(a,{...A,ref:u,children:F.isValidElement(d)?F.cloneElement(d,void 0,p):null})}return R.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function V2(r){const a=F.forwardRef((o,i)=>{const{children:u,...l}=o;if(F.isValidElement(u)){const A=Q2(u),c=q2(l,u.props);return u.type!==F.Fragment&&(c.ref=i?La(i,A):A),F.cloneElement(u,c)}return F.Children.count(u)>1?F.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var U2=Symbol("radix.slottable");function W2(r){return F.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===U2}function q2(r,a){const o={...a};for(const i in a){const u=r[i],l=a[i];/^on[A-Z]/.test(i)?u&&l?o[i]=(...c)=>{const h=l(...c);return u(...c),h}:u&&(o[i]=u):i==="style"?o[i]={...u,...l}:i==="className"&&(o[i]=[u,l].filter(Boolean).join(" "))}return{...r,...o}}function Q2(r){var i,u;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?r.ref:(a=(u=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:u.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?r.props.ref:r.props.ref||r.ref)}function G2(r){const a=r+"CollectionProvider",[o,i]=za(a),[u,l]=o(a,{collectionRef:{current:null},itemMap:new Map}),A=k=>{const{scope:v,children:S}=k,E=he.useRef(null),y=he.useRef(new Map).current;return R.jsx(u,{scope:v,itemMap:y,collectionRef:E,children:S})};A.displayName=a;const c=r+"CollectionSlot",h=yA(c),d=he.forwardRef((k,v)=>{const{scope:S,children:E}=k,y=l(c,S),B=gr(v,y.collectionRef);return R.jsx(h,{ref:B,children:E})});d.displayName=c;const p=r+"CollectionItemSlot",x="data-radix-collection-item",g=yA(p),C=he.forwardRef((k,v)=>{const{scope:S,children:E,...y}=k,B=he.useRef(null),D=gr(v,B),T=l(p,S);return he.useEffect(()=>(T.itemMap.set(B,{ref:B,...y}),()=>void T.itemMap.delete(B))),R.jsx(g,{[x]:"",ref:D,children:E})});C.displayName=p;function b(k){const v=l(r+"CollectionConsumer",k);return he.useCallback(()=>{const E=v.collectionRef.current;if(!E)return[];const y=Array.from(E.querySelectorAll(`[${x}]`));return Array.from(v.itemMap.values()).sort((T,I)=>y.indexOf(T.ref.current)-y.indexOf(I.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(i){var u=o,l=u.lib,A=l.WordArray,c=l.Hasher,h=u.algo,d=A.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=A.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),x=A.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),g=A.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),C=A.create([0,1518500249,1859775393,2400959708,2840853838]),b=A.create([1352829926,1548603684,1836072691,2053994217,0]),k=h.RIPEMD160=c.extend({_doReset:function(){this._hash=A.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(T,I){for(var P=0;P<16;P++){var H=I+P,M=T[H];T[H]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}var N=this._hash.words,z=C.words,Q=b.words,J=d.words,se=p.words,ee=x.words,re=g.words,q,oe,$,w,j,V,W,ae,ue,de;V=q=N[0],W=oe=N[1],ae=$=N[2],ue=w=N[3],de=j=N[4];for(var te,P=0;P<80;P+=1)te=q+T[I+J[P]]|0,P<16?te+=v(oe,$,w)+z[0]:P<32?te+=S(oe,$,w)+z[1]:P<48?te+=E(oe,$,w)+z[2]:P<64?te+=y(oe,$,w)+z[3]:te+=B(oe,$,w)+z[4],te=te|0,te=D(te,ee[P]),te=te+j|0,q=j,j=w,w=D($,10),$=oe,oe=te,te=V+T[I+se[P]]|0,P<16?te+=B(W,ae,ue)+Q[0]:P<32?te+=y(W,ae,ue)+Q[1]:P<48?te+=E(W,ae,ue)+Q[2]:P<64?te+=S(W,ae,ue)+Q[3]:te+=v(W,ae,ue)+Q[4],te=te|0,te=D(te,re[P]),te=te+de|0,V=de,de=ue,ue=D(ae,10),ae=W,W=te;te=N[1]+$+ue|0,N[1]=N[2]+w+de|0,N[2]=N[3]+j+V|0,N[3]=N[4]+q+W|0,N[4]=N[0]+oe+ae|0,N[0]=te},_doFinalize:function(){var T=this._data,I=T.words,P=this._nDataBytes*8,H=T.sigBytes*8;I[H>>>5]|=128<<24-H%32,I[(H+64>>>9<<4)+14]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360,T.sigBytes=(I.length+1)*4,this._process();for(var M=this._hash,N=M.words,z=0;z<5;z++){var Q=N[z];N[z]=(Q<<8|Q>>>24)&16711935|(Q<<24|Q>>>8)&4278255360}return M},clone:function(){var T=c.clone.call(this);return T._hash=this._hash.clone(),T}});function v(T,I,P){return T^I^P}function S(T,I,P){return T&I|~T&P}function E(T,I,P){return(T|~I)^P}function y(T,I,P){return T&P|I&~P}function B(T,I,P){return T^(I|~P)}function D(T,I){return T<<I|T>>>32-I}u.RIPEMD160=c._createHelper(k),u.HmacRIPEMD160=c._createHmacHelper(k)})(),o.RIPEMD160})})(Ci)),Ci.exports}var wi={exports:{}},n4=wi.exports,LA;function fl(){return LA||(LA=1,(function(r,a){(function(o,i){r.exports=i(Le())})(n4,function(o){(function(){var i=o,u=i.lib,l=u.Base,A=i.enc,c=A.Utf8,h=i.algo;h.HMAC=l.extend({init:function(d,p){d=this._hasher=new d.init,typeof p=="string"&&(p=c.parse(p));var x=d.blockSize,g=x*4;p.sigBytes>g&&(p=d.finalize(p)),p.clamp();for(var C=this._oKey=p.clone(),b=this._iKey=p.clone(),k=C.words,v=b.words,S=0;S<x;S++)k[S]^=1549556828,v[S]^=909522486;C.sigBytes=b.sigBytes=g,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var p=this._hasher,x=p.finalize(d);p.reset();var g=p.finalize(this._oKey.clone().concat(x));return g}})})()})})(wi)),wi.exports}var bi={exports:{}},o4=bi.exports,zA;function a4(){return zA||(zA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Ua(),fl())})(o4,function(o){return(function(){var i=o,u=i.lib,l=u.Base,A=u.WordArray,c=i.algo,h=c.SHA256,d=c.HMAC,p=c.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,g){for(var C=this.cfg,b=d.create(C.hasher,x),k=A.create(),v=A.create([1]),S=k.words,E=v.words,y=C.keySize,B=C.iterations;S.length<y;){var D=b.update(g).finalize(v);b.reset();for(var T=D.words,I=T.length,P=D,H=1;H<B;H++){P=b.finalize(P),b.reset();for(var M=P.words,N=0;N<I;N++)T[N]^=M[N]}k.concat(D),E[0]++}return k.sigBytes=y*4,k}});i.PBKDF2=function(x,g,C){return p.create(C).compute(x,g)}})(),o.PBKDF2})})(bi)),bi.exports}var Ei={exports:{}},s4=Ei.exports,VA;function Bn(){return VA||(VA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Dx(),fl())})(s4,function(o){return(function(){var i=o,u=i.lib,l=u.Base,A=u.WordArray,c=i.algo,h=c.MD5,d=c.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:1}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,x){for(var g,C=this.cfg,b=C.hasher.create(),k=A.create(),v=k.words,S=C.keySize,E=C.iterations;v.length<S;){g&&b.update(g),g=b.update(p).finalize(x),b.reset();for(var y=1;y<E;y++)g=b.finalize(g),b.reset();k.concat(g)}return k.sigBytes=S*4,k}});i.EvpKDF=function(p,x,g){return d.create(g).compute(p,x)}})(),o.EvpKDF})})(Ei)),Ei.exports}var ki={exports:{}},i4=ki.exports,UA;function RLine 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 i=o.lib.BlockCipherMode.extend();function u(c){if((c>>24&255)===255){var h=c>>16&255,d=c>>8&255,p=c&255;h===255?(h=0,d===255?(d=0,p===255?p=0:++p):++d):++h,c=0,c+=h<<16,c+=d<<8,c+=p}else c+=1<<24;return c}function l(c){return(c[0]=u(c[0]))===0&&(c[1]=u(c[1])),c}var A=i.Encryptor=i.extend({processBlock:function(c,h){var d=this._cipher,p=d.blockSize,x=this._iv,g=this._counter;x&&(g=this._counter=x.slice(0),this._iv=void 0),l(g);var C=g.slice(0);d.encryptBlock(C,0);for(var b=0;b<p;b++)c[h+b]^=C[b]}});return i.Decryptor=A,i})(),o.mode.CTRGladman})})(_i)),_i.exports}var Di={exports:{}},h4=Di.exports,GA;function p4(){return GA||(GA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(h4,function(o){return o.mode.OFB=(function(){var i=o.lib.BlockCipherMode.extend(),u=i.Encryptor=i.extend({processBlock:function(l,A){var c=this._cipher,h=c.blockSize,d=this._iv,p=this._keystream;d&&(p=this._keystream=d.slice(0),this._iv=void 0),c.encryptBlock(p,0);for(var x=0;x<h;x++)l[A+x]^=p[x]}});return i.Decryptor=u,i})(),o.mode.OFB})})(Di)),Di.exports}var Fi={exports:{}},x4=Fi.exports,$A;function m4(){return $A||($A=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(x4,function(o){return o.mode.ECB=(function(){var i=o.lib.BlockCipherMode.extend();return i.Encryptor=i.extend({processBlock:function(u,l){this._cipher.encryptBlock(u,l)}}),i.Decryptor=i.extend({processBlock:function(u,l){this._cipher.decryptBlock(u,l)}}),i})(),o.mode.ECB})})(Fi)),Fi.exports}var Ri={exports:{}},g4=Ri.exports,KA;function v4(){return KA||(KA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(g4,function(o){return o.pad.AnsiX923={pad:function(i,u){var l=i.sigBytes,A=u*4,c=A-l%A,h=l+c-1;i.clamp(),i.words[h>>>2]|=c<<24-h%4*8,i.sigBytes+=c},unpad:function(i){var u=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=u}},o.pad.Ansix923})})(Ri)),Ri.exports}var Ti={exports:{}},y4=Ti.exports,YA;function C4(){return YA||(YA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(y4,function(o){return o.pad.Iso10126={pad:function(i,u){var l=u*4,A=l-i.sigBytes%l;i.concat(o.lib.WordArray.random(A-1)).concat(o.lib.WordArray.create([A<<24],1))},unpad:function(i){var u=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=u}},o.pad.Iso10126})})(Ti)),Ti.exports}var Pi={exports:{}},w4=Pi.exports,ZA;function b4(){return ZA||(ZA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(w4,function(o){return o.pad.Iso97971={pad:function(i,u){i.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(i,u)},unpad:function(i){o.pad.ZeroPadding.unpad(i),i.sigBytes--}},o.pad.Iso97971})})(Pi)),Pi.exports}var Ni={exports:{}},E4=Ni.exports,XA;function k4(){return XA||(XA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(E4,function(o){return o.pad.ZeroPadding={pad:function(i,u){var l=u*4;i.clamp(),i.sigBytes+=l-(i.sigBytes%l||l)},unpad:function(i){for(var u=i.words,l=i.sigBytes-1,l=i.sigBytes-1;l>=0;l--)if(u[l>>>2]>>>24-l%4*8&255){i.sigBytes=l+1;break}}},o.pad.ZeroPadding})})(Ni)),Ni.exports}var Ii={exports:{}},S4=Ii.exports,JA;function B4(){return JA||(JA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(S4,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(Ii)),Ii.exports}var Mi={exports:{}},_4=Mi.exports,eh;function D4(){return eh||(eh=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(_4,function(o){return(function(i){var u=o,l=u.lib,A=l.CipherParams,c=u.enc,h=c.Hex,d=u.format;d.Hex={stringify:function(p){return p.ciphertext.toString(h)},parse:function(p){var x=h.parse(p);return A.create({ciphertext:x})}}})(),o.format.Hex})})(Mi)),Mi.exports}var Oi={exports:{}},F4=Oi.exports,th;function R4(){return th||(th=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Xn(),Jn(),Bn(),Rt())})(F4,function(o){return(function(){var i=o,u=i.lib,l=u.BlockCipher,A=i.algo,c=[],h=[],d=[],p=[],x=[],g=[],C=[],b=[],k=[],v=[];(function(){for(var y=[],B=0;B<256;B++)B<128?y[B]=B<<1:y[B]=B<<1^283;for(var D=0,T=0,B=0;B<256;B++){var I=T^T<<1^T<<2^T<<3^T<<4;I=I>>>8^I&255^99,c[D]=I,h[I]=D;var P=y[D],H=y[P],M=y[H],N=y[I]*257^I*16843008;d[D]=N<<24|N>>>8,p[D]=N<<16|N>>>16,x[D]=N<<8|N>>>24,g[D]=N;var N=M*16843009^H*65537^P*257^D*16843008;C[I]=N<<24|N>>>8,b[I]=N<<16|N>>>16,k[I]=N<<8|N>>>24,v[I]=N,D?(D=P^y[y[y[M^P]]],T^=y[y[T]]):D=T=1}})();var S=[0,1,2,4,8,16,32,64,128,27,54],E=A.AES=l.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var B=this._keyPriorReset=this._key,D=B.words,T=B.sigBytes/4,I=this._nRounds=T+6,P=(I+1)*4,H=this._keySchedule=[],M=0;M<P;M++)M<T?H[M]=D[M]:(y=H[M-1],M%T?T>6&&M%T==4&&(y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[y&255]):(y=y<<8|y>>>24,y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[y&255],y^=S[M/T|0]<<24),H[M]=H[M-T]^y);for(var N=this._invKeySchedule=[],z=0;z<P;z++){var M=P-z;if(z%4)var y=H[M];else var y=H[M-4];z<4||M<=4?N[z]=y:N[z]=C[c[y>>>24]]^b[c[y>>>16&255]]^k[c[y>>>8&255]]^v[c[y&255]]}}},encryptBlock:Line truncated
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
|
||||
• Request Data (remaining bytes) - additional request-specific data`,startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return ka.RequestPayloadDecoder=o,ka}var Sa={},Eh;function Aw(){if(Eh)return Sa;Eh=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.ResponsePayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<4){const b={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),b}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:p}),h+=1;const x=(0,a.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Sa.ResponsePayloadDecoder=o,Sa}var Ba={},kh;function hw(){if(kh)return Ba;kh=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.AnonRequestPayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<35){const b={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),b}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${d}`,startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.bytesToHex)(u.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:c+h,endByte:c+h+31,value:p}),h+=32;const x=(0,a.bytesToHex)(u.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(35));l!=null&&l.includeSegments&&u.length>35&&A.push({name:"Ciphertext",description:`Encrypted message data (${u.length-35} bytes). Contains encrypted plaintext with this structure:
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
|
||||
• Password (remaining bytes) - password for repeater/room`,startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,senderPublicKey:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-35};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ba.AnonRequestPayloadDecoder=o,Ba}var _a={},Sh;function pw(){if(Sh)return _a;Sh=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.AckPayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<4){const p={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(p.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),p}const A=[],c=(l==null?void 0:l.segmentOffset)||0,h=(0,a.bytesToHex)(u.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${h}`,startByte:c,endByte:c+3,value:h}),l!=null&&l.includeSegments&&u.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:c+4,endByte:c+u.length-1,value:(0,a.bytesToHex)(u.subarray(4))});const d={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!0,checksum:h};return l!=null&&l.includeSegments&&(d.segments=A),d}catch(A){return{type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}}return _a.AckPayloadDecoder=o,_a}var Da={},Bh;function xw(){if(Bh)return Da;Bh=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.PathPayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u){try{if(u.length<2)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=u[0];if(u.length<1+l+1)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let d=0;d<l;d++)A.push((0,a.byteToHex)(u[1+d]));const c=u[1+l];let h="";return u.length>1+l+1&&(h=(0,a.bytesToHex)(u.subarray(1+l+1))),{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:c,extraData:h}}catch(l){return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Da.PathPayloadDecoder=o,Da}var Fa={},_h;function mw(){if(_h)return Fa;_h=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.TextMessagePayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<4){const b={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),b}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:p}),h+=1;const x=(0,a.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:c+h,endByte:c+u.length-1,value:g});const C={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(C.segments=A),C}catch(A){return{type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,i
Line truncated
|
||||
// SHA256 round constants
|
||||
const K: array<u32, 64> = array<u32, 64>(
|
||||
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
|
||||
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
|
||||
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
|
||||
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
|
||||
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
|
||||
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
|
||||
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
|
||||
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
|
||||
);
|
||||
|
||||
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
|
||||
const CHARS: array<u32, 37> = array<u32, 37>(
|
||||
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
|
||||
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
|
||||
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
|
||||
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
|
||||
0x2du // dash
|
||||
);
|
||||
|
||||
struct Params {
|
||||
target_channel_hash: u32,
|
||||
batch_offset: u32,
|
||||
name_length: u32,
|
||||
batch_size: u32,
|
||||
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
|
||||
ciphertext_words: u32, // Number of 32-bit words in ciphertext
|
||||
ciphertext_len_bits: u32, // Length of ciphertext in bits
|
||||
verify_mac: u32, // 1 to verify MAC, 0 to skip
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> params: Params;
|
||||
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
|
||||
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
|
||||
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
|
||||
|
||||
fn rotr(x: u32, n: u32) -> u32 {
|
||||
return (x >> n) | (x << (32u - n));
|
||||
}
|
||||
|
||||
fn ch(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (~x & z);
|
||||
}
|
||||
|
||||
fn maj(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (x & z) ^ (y & z);
|
||||
}
|
||||
|
||||
fn sigma0(x: u32) -> u32 {
|
||||
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
|
||||
}
|
||||
|
||||
fn sigma1(x: u32) -> u32 {
|
||||
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
|
||||
}
|
||||
|
||||
fn gamma0(x: u32) -> u32 {
|
||||
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
|
||||
}
|
||||
|
||||
fn gamma1(x: u32) -> u32 {
|
||||
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
|
||||
}
|
||||
|
||||
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
|
||||
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
|
||||
// Message starts with '#' (0x23)
|
||||
var byte_pos = 0u;
|
||||
var word_idx = 0u;
|
||||
var current_word = 0x23000000u; // '#' in big-endian position 0
|
||||
byte_pos = 1u;
|
||||
|
||||
var remaining = idx;
|
||||
var prev_was_dash = false;
|
||||
|
||||
// Generate room name from index
|
||||
for (var i = 0u; i < length; i++) {
|
||||
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
|
||||
var char_idx = remaining % char_count;
|
||||
remaining = remaining / char_count;
|
||||
|
||||
// Check for consecutive dashes (invalid)
|
||||
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
|
||||
if (is_dash && prev_was_dash) {
|
||||
return false; // Invalid: consecutive dashes
|
||||
}
|
||||
prev_was_dash = is_dash;
|
||||
|
||||
// Map char index to actual character
|
||||
let c = CHARS[char_idx];
|
||||
|
||||
// Pack byte into current word (big-endian)
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u && byte_pos > 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0u;
|
||||
}
|
||||
current_word = current_word | (c << shift);
|
||||
byte_pos = byte_pos + 1u;
|
||||
}
|
||||
|
||||
// Add padding: 0x80 followed by zeros, then length in bits
|
||||
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
|
||||
|
||||
// Add 0x80 padding byte
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0x80000000u;
|
||||
} else {
|
||||
current_word = current_word | (0x80u << shift);
|
||||
}
|
||||
byte_pos = byte_pos + 1u;
|
||||
|
||||
// Store current word
|
||||
if (byte_pos % 4u == 0u || word_idx < 14u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
}
|
||||
|
||||
// Zero-fill until word 14
|
||||
for (var i = word_idx; i < 14u; i++) {
|
||||
(*msg)[i] = 0u;
|
||||
}
|
||||
|
||||
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
|
||||
(*msg)[14u] = 0u;
|
||||
(*msg)[15u] = msg_len_bits;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
|
||||
// Initialize hash values
|
||||
var h: array<u32, 8> = array<u32, 8>(
|
||||
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
|
||||
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
|
||||
);
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Compute SHA256 of the key (16 bytes) to get channel hash
|
||||
fn sha256_key(key: array<u32, 4>) -> u32 {
|
||||
var msg: array<u32, 16>;
|
||||
|
||||
// Key bytes (16 bytes = 4 words)
|
||||
msg[0] = key[0];
|
||||
msg[1] = key[1];
|
||||
msg[2] = key[2];
|
||||
msg[3] = key[3];
|
||||
|
||||
// Padding: 0x80 followed by zeros
|
||||
msg[4] = 0x80000000u;
|
||||
for (var i = 5u; i < 14u; i++) {
|
||||
msg[i] = 0u;
|
||||
}
|
||||
|
||||
// Length: 128 bits
|
||||
msg[14] = 0u;
|
||||
msg[15] = 128u;
|
||||
|
||||
let hash = sha256_block(&msg);
|
||||
|
||||
// Return first byte of hash (big-endian)
|
||||
return hash[0] >> 24u;
|
||||
}
|
||||
|
||||
// HMAC-SHA256 for MAC verification
|
||||
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
|
||||
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
|
||||
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
|
||||
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
|
||||
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
|
||||
// ipad = 0x36 repeated, opad = 0x5c repeated
|
||||
|
||||
// Build padded key (64 bytes = 16 words)
|
||||
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
|
||||
var k_pad: array<u32, 16>;
|
||||
k_pad[0] = key[0];
|
||||
k_pad[1] = key[1];
|
||||
k_pad[2] = key[2];
|
||||
k_pad[3] = key[3];
|
||||
for (var i = 4u; i < 16u; i++) {
|
||||
k_pad[i] = 0u;
|
||||
}
|
||||
|
||||
// Inner hash: SHA256((K' ^ ipad) || message)
|
||||
// First block: K' ^ ipad (64 bytes)
|
||||
var inner_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
inner_block[i] = k_pad[i] ^ 0x36363636u;
|
||||
}
|
||||
|
||||
// Initialize hash state with first block
|
||||
var h: array<u32, 8> = sha256_block(&inner_block);
|
||||
|
||||
// Process ciphertext blocks (continuing from h state)
|
||||
let ciphertext_words = params.ciphertext_words;
|
||||
var word_idx = 0u;
|
||||
|
||||
// Process full 64-byte blocks of ciphertext
|
||||
while (word_idx + 16u <= ciphertext_words) {
|
||||
var block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
block[i] = ciphertext[word_idx + i];
|
||||
}
|
||||
h = sha256_block_continue(&block, h);
|
||||
word_idx = word_idx + 16u;
|
||||
}
|
||||
|
||||
// Final block with remaining ciphertext + padding
|
||||
var final_block: array<u32, 16>;
|
||||
var remaining = ciphertext_words - word_idx;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
if (i < remaining) {
|
||||
final_block[i] = ciphertext[word_idx + i];
|
||||
} else if (i == remaining) {
|
||||
// Add 0x80 padding
|
||||
final_block[i] = 0x80000000u;
|
||||
} else {
|
||||
final_block[i] = 0u;
|
||||
}
|
||||
}
|
||||
|
||||
// Add length (64 bytes of ipad + ciphertext length)
|
||||
let total_bits = 512u + params.ciphertext_len_bits;
|
||||
if (remaining < 14u) {
|
||||
final_block[14] = 0u;
|
||||
final_block[15] = total_bits;
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
} else {
|
||||
// Need extra block for length
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
var len_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 14u; i++) {
|
||||
len_block[i] = 0u;
|
||||
}
|
||||
len_block[14] = 0u;
|
||||
len_block[15] = total_bits;
|
||||
h = sha256_block_continue(&len_block, h);
|
||||
}
|
||||
|
||||
let inner_hash = h;
|
||||
|
||||
// Outer hash: SHA256((K' ^ opad) || inner_hash)
|
||||
var outer_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
|
||||
}
|
||||
h = sha256_block(&outer_block);
|
||||
|
||||
// Second block: inner_hash (32 bytes) + padding
|
||||
var hash_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 8u; i++) {
|
||||
hash_block[i] = inner_hash[i];
|
||||
}
|
||||
hash_block[8] = 0x80000000u;
|
||||
for (var i = 9u; i < 14u; i++) {
|
||||
hash_block[i] = 0u;
|
||||
}
|
||||
hash_block[14] = 0u;
|
||||
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
|
||||
|
||||
h = sha256_block_continue(&hash_block, h);
|
||||
|
||||
// Return first 2 bytes (high 16 bits of first word)
|
||||
return h[0] & 0xFFFF0000u;
|
||||
}
|
||||
|
||||
// SHA256 block computation continuing from existing state
|
||||
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
|
||||
var h = h_in;
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Process a single candidate and record match if found
|
||||
fn process_candidate(name_idx: u32) {
|
||||
// Generate message for this room name
|
||||
var msg: array<u32, 16>;
|
||||
let valid = index_to_room_name(name_idx, params.name_length, &msg);
|
||||
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute SHA256("#roomname") - this gives us the key
|
||||
let key_hash = sha256_block(&msg);
|
||||
|
||||
// Take first 16 bytes (4 words) as the key
|
||||
var key: array<u32, 4>;
|
||||
key[0] = key_hash[0];
|
||||
key[1] = key_hash[1];
|
||||
key[2] = key_hash[2];
|
||||
key[3] = key_hash[3];
|
||||
|
||||
// Compute SHA256(key) to get channel hash
|
||||
let channel_hash = sha256_key(key);
|
||||
|
||||
// Check if channel hash matches target
|
||||
if (channel_hash != params.target_channel_hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Channel hash matches - verify MAC if enabled
|
||||
if (params.verify_mac == 1u) {
|
||||
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
|
||||
if (computed_mac != params.target_mac) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Found a match - record the index
|
||||
let match_idx = atomicAdd(&match_count, 1u);
|
||||
if (match_idx < 1024u) { // Limit stored matches
|
||||
match_indices[match_idx] = name_idx;
|
||||
}
|
||||
}
|
||||
|
||||
// Each thread processes 16 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 16u;
|
||||
|
||||
@compute @workgroup_size(256)
|
||||
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
||||
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
|
||||
|
||||
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
|
||||
let idx = base_idx + i;
|
||||
if (idx >= params.batch_size) {
|
||||
return;
|
||||
}
|
||||
let name_idx = params.batch_offset + idx;
|
||||
process_candidate(name_idx);
|
||||
}
|
||||
}
|
||||
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const a=await navigator.gpu.requestAdapter();if(!a)return console.warn("No GPU adapter found"),!1;this.device=await a.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let u=0;u<2;u++)this.matchCountReadBuffers[u]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[u]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),i=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:i,compute:{module:o,entryPoint:"main"}}),!0}catch(a){return console.error("WebGPU initialization failed:",a),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(a,o){return $n(o,a)}countNamesForLength(a){return Na(a)}async runBatch(a,o,i,u,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const c=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const h=this.matchCountReadBuffers[c],d=this.matchIndicesReadBuffers[c],p=l&&A?1:0;let x,g=0,C=0;if(p){const D=new Uint8Array(l.length/2);for(let M=0;M<D.length;M++)D[M]=parseInt(l.substr(M*2,2),16);g=D.length*8;const T=Math.ceil(D.length/4)*4,I=new Uint8Array(T);I.set(D),x=new Uint32Array(T/4);for(let M=0;M<x.length;M++)x[M]=I[M*4]<<24|I[M*4+1]<<16|I[M*4+2]<<8|I[M*4+3];const P=parseInt(A.substr(0,2),16),H=parseInt(A.substr(2,2),16);C=P<<24|H<<16}else x=new Uint32Array([0]);const b=Math.max(x.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<b)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:b,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=b,this.bindGroupDirty=!0);const k=new Uint32Array([a,i,o,u,C,x.length,g,p]);this.device.queue.writeBuffer(this.paramsBuffer,0,k),this.device.queue.writeBuffer(this.ciphertextBuffer,0,x),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(),S=v.beginComputePass();S.setPipeline(this.pipeline),S.setBindGroup(0,this.bindGroup),S.dispatchWorkgroups(Math.ceil(u/(256*16))),S.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 y=new Uint32Array(h.getMappedRange())[0];h.unmap();const B=[];if(y>0){await d.mapAsync(GPUMapMode.READ);const D=new Uint32Array(d.getMappedRange());for(let T=0;T<Math.min(y,1024);T++)B.push(D[T]);d.unmap()}return B}destroy(){var a,o,i,u,l,A,c,h;(a=this.paramsBuffer)==null||a.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(i=this.matchIndicesBuffer)==null||i.destroy(),(u=this.ciphertextBuffer)==null||u.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(A=this.matchCountReadBuffers[1])==null||A.destroy(),(c=this.matchIndicesReadBuffers[0])==null||c.destroy(),(h=this.matchIndicesReadBuffers[1])==null||h.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}hl.ZERO_DATA=new Uint32Array([0]);function Rw(){return typeof navigator<"u"&&"gpu"in navigator}class jh{runBatch(a,o,i,u,l,A){const c=[],h=a.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);this.wordlist=u.filter(Hh)}setWordlist(a){this.wordlist=a.map(o=>o.trim().toLowerCase()).filter(Hh)}abort(){this.abortFlag=!0}isGpuAvailable(){return Rw()}async decodePacket(a){var i;const o=a.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const l=(i=(await Ih.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:i.decoded;return!(l!=null&&l.channelHash)||!(l!=null&&l.ciphertext)||!(l!=null&&l.cipherMac)?null:{channelHash:l.channelHash,ciphertext:l.ciphertext,cipherMac:l.cipherMac,isGroupText:!0}}catch{return null}}async crack(a,o,i){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)??Ru,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const u=(o==null?void 0:o.maxLength)??8,l=(o==null?void 0:o.startingLength)??1,A=(o==null?void 0:o.useDictionary)??!0,c=await this.decodePacket(a);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:h,ciphertext:d,cipherMac:p}=c,x=parseInt(h,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new jh):this.gpuInstance||(this.gpuInstance=new hl,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new jh));const g=performance.now();let C=0,b=performance.now(),k=l,v=0;if(o!=null&&o.startFrom){const H=_w(o.startFrom);H&&(k=Math.max(l,H.length),v=H.index+1,v>=Na(k)&&(k++,v=0))}let S=0;for(let H=k;H<=u;H++)S+=Na(H);S-=v;const E=(H,M,N)=>{if(!i)return;const Q=(performance.now()-g)/1e3,J=Q>0?Math.round(C/Q):0,se=S-C,ee=J>0?se/J:0;i({checked:C,total:S,percent:S>0?Math.min(100,C/S*100):0,rateKeysPerSec:J,etaSeconds:ee,elapsedSeconds:Q,currentLength:M,currentPosition:N,phase:H})},y=H=>{if(!Zx(d,p,H))return{valid:!1};const M=Ih.ChannelCrypto.decryptGroupTextMessage(d,p,H);return!M.success||!M.data?{valid:!1}:this.useTimestampFilter&&!Dw(M.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Fw(M.data.message)?{valid:!1}:{valid:!0,message:M.data.message}};if(k===1&&v===0){E("public-key",0,Fu);const H=Pu(Qi);if(h===H){const M=y(Qi);if(M.valid)return{found:!0,roomName:Fu,key:Qi,decryptedMessage:M.message}}}if(A&&this.wordlist.length>0&&k===1&&v===0)for(let H=0;H<this.wordlist.length;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[H]};const M=this.wordlist[H],N=Tu("#"+M),z=Pu(N);if(parseInt(z,16)===x){const J=y(N);if(J.valid)return{found:!0,roomName:M,key:N,decryptedMessage:J.message}}const Q=performance.now();Q-b>=200&&(E("wordlist",M.length,M),b=Q,await new Promise(J=>setTimeout(J,0)))}const B=this.useCpu?1024:32768,D=1e3;let T=B,I=!1;for(let H=k;H<=u;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(H,0)||void 0};const M=Na(H);let N=H===k?v:0;for(;N<M;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(H,N)||void 0};const z=Math.min(T,M-N),Q=performance.now();let J;this.useCpu?J=this.cpuInstance.runBatch(x,H,N,z,d,p):J=await this.gpuInstance.runBatch(x,H,N,z,d,p);const se=performance.now()-Q;if(C+=z,!this.useCpu&&!I&&z>=B&&se>0){const re=D/se,q=Math.round(z*re),oe=Math.pow(2,Math.round(Math.log2(Math.max(B,q))));T=Math.max(B,oe),I=!0}for(const re of J){const q=$n(H,re);if(!q)continue;const oe=Tu("#"+q),$=y(oe);if($.valid)return{found:!0,roomName:q,key:oe,decryptedMessage:$.message}}N+=z;const ee=performance.now();if(ee-b>=200){const re=$n(H,Math.min(N,M-1))||"";E("bruteforce",H,re),b=ee,await new Promise(q=>setTimeout(q,0))}}}return{found:!1,resumeFrom:$n(u,Na(u)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var mu,Lh;function Mw(){return Lh||(Lh=1,mu={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAA
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(){i()?(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 gu=u,gu}var jw=Ow();const Hw=Po(jw);function Lw({packets:r,channels:a,onChannelCreate:o,onRunningChange:i}){const[u,l]=F.useState(!1),[A,c]=F.useState(6),[h,d]=F.useState(!1),[p,x]=F.useState(null),[g,C]=F.useState(new Map),[b,k]=F.useState([]),[v,S]=F.useState(!1),[E,y]=F.useState(null),B=F.useRef(null),D=F.useRef(null),T=F.useRef(!1),I=F.useRef(!1),P=F.useRef(!1),H=F.useRef(new Map),M=F.useRef(!1),N=F.useRef(6);F.useEffect(()=>{const $=new Iw;B.current=$,y($.isGpuAvailable());const w=new Hw;return D.current=w,$.loadWordlist("/words_alpha.txt").then(()=>S(!0)).catch(j=>console.error("Failed to load wordlist:",j)),()=>{$.destroy(),B.current=null,w.disable(),D.current=null}},[]);const z=new Set(a.map($=>$.key.toUpperCase())),Q=r.filter($=>$.payload_type==="GROUP_TEXT"&&!$.decrypted);F.useEffect(()=>{C($=>{const w=new Map($);let j=!1;for(const V of Q)w.has(V.id)||(w.set(V.id,{packet:V,attempts:0,lastAttemptLength:0,status:"pending"}),j=!0);return j?(H.current=w,w):$})},[Q.length]),F.useEffect(()=>{H.current=g},[g]),F.useEffect(()=>{M.current=h},[h]),F.useEffect(()=>{N.current=A},[A]),F.useEffect(()=>{i==null||i(u)},[u,i]);const J=Array.from(g.values()).filter($=>$.status==="pending").length,se=Array.from(g.values()).filter($=>$.status==="cracked").length,ee=Array.from(g.values()).filter($=>$.status==="failed").length,re=F.useCallback(async()=>{if(P.current||!B.current||!T.current)return;const $=H.current;let w=null,j=null;for(const[ae,ue]of $.entries())if(ue.status==="pending"){w=ue,j=ae;break}if(!w&&M.current){const ae=Array.from($.entries()).filter(([,ue])=>ue.status==="failed"&&ue.lastAttemptLength<10);ae.length>0&&(ae.sort((ue,de)=>ue[1].lastAttemptLength-de[1].lastAttemptLength),[j,w]=ae[0])}if(!w||j===null){T.current&&setTimeout(()=>re(),1e3);return}P.current=!0;const V=N.current,W=w.lastAttemptLength>0?w.lastAttemptLength+1:V;try{const ae=await B.current.crack(w.packet.data,{maxLength:W,useTimestampFilter:!0,useUtf8Filter:!0},ue=>{x(ue)});if(I.current){I.current=!1,P.current=!1,x(null);return}if(ae.found&&ae.roomName&&ae.key){C(te=>{const Se=new Map(te),Ne=Se.get(j);return Ne&&Se.set(j,{...Ne,status:"cracked",attempts:Ne.attempts+1,lastAttemptLength:W}),Se});const ue={roomName:ae.roomName,key:ae.key,packetId:j,message:ae.decryptedMessage||"",crackedAt:Date.now()};k(te=>[...te,ue]);const de=ae.key.toUpperCase();if(!z.has(de))try{await o("#"+ae.roomName,ae.key)}catch(te){console.error("Failed to create channel:",te)}}else C(ue=>{const de=new Map(ue),te=de.get(j);return te&&de.set(j,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:W}),de})}catch(ae){console.error("Cracking error:",ae),C(ue=>{const de=new Map(ue),te=de.get(j);return te&&de.set(j,{...te,status:"failed",attempts:te.attempts+1,lastAttemptLength:W}),de})}P.current=!1,x(null),T.current&&setTimeout(()=>re(),100)},[z,o]),q=()=>{var $;if(!E){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}l(!0),T.current=!0,I.current=!1,($=D.current)==null||$.enable(),re()},oe=()=>{var $,w;l(!1),T.current=!1,I.current=!0,($=B.current)==null||$.abort(),(w=D.current)==null||w.disable()};return R.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[R.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[R.jsx("button",{onClick:u?oe:q,disabled:!v||E===!1,className:qe("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"}),R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),R.jsx("input",{type:"number",min:1,max:10,value:A,onChange:$=>c(Math.min(10,Math.max(1,parseInt($.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),R.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[R.jsx("input",{type:"checkbox",checked:h,onChange:$=>d($.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),R.jsxs("div",{className:"flex gap-4 text-sm",children:[R.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",R.jsx("span",{className:"text-foreground font-medium",children:J})]}),R.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",R.jsx("span",{className:"text-green-500 font-medium",children:se})]}),R.jsxs("span",{className:"text-muted-foreground",children:["Failed: ",R.jsx("span",{className:"text-destructive font-medium",children:ee})]})]}),p&&R.jsxs("div",{className:"space-y-1",children:[R.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[R.jsxs("span",{children:[p.phase==="word
Line truncated
|
||||
+532
@@ -0,0 +1,532 @@
|
||||
var Kg=Object.defineProperty;var Yg=(r,a,o)=>a in r?Kg(r,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[a]=o;var zn=(r,a,o)=>Yg(r,typeof a!="symbol"?a+"":a,o);function Zg(r,a){for(var o=0;o<a.length;o++){const i=a[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in r)){const l=Object.getOwnPropertyDescriptor(i,u);l&&Object.defineProperty(r,u,l.get?l:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const l of u)if(l.type==="childList")for(const A of l.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&i(A)}).observe(document,{childList:!0,subtree:!0});function o(u){const l={};return u.integrity&&(l.integrity=u.integrity),u.referrerPolicy&&(l.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?l.credentials="include":u.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(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 Po(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Uh(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var a=r.default;if(typeof a=="function"){var o=function i(){return this instanceof i?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};o.prototype=a.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var u=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(o,i,u.get?u:{enumerable:!0,get:function(){return r[i]}})}),o}var Zc={exports:{}},ma={},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 Hf;function Xg(){if(Hf)return Oe;Hf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),A=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.iterator;function g(y){return y===null||typeof y!="object"?null:(y=x&&y[x]||y["@@iterator"],typeof y=="function"?y:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,k={};function v(y,j,L){this.props=y,this.context=j,this.refs=k,this.updater=L||w}v.prototype.isReactComponent={},v.prototype.setState=function(y,j){if(typeof y!="object"&&typeof y!="function"&&y!=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,y,j,"setState")},v.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function S(){}S.prototype=v.prototype;function E(y,j,L){this.props=y,this.context=j,this.refs=k,this.updater=L||w}var C=E.prototype=new S;C.constructor=E,b(C,v.prototype),C.isPureReactComponent=!0;var B=Array.isArray,D=Object.prototype.hasOwnProperty,T={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function P(y,j,L){var W,ue={},le=null,ce=null;if(j!=null)for(W in j.ref!==void 0&&(ce=j.ref),j.key!==void 0&&(le=""+j.key),j)D.call(j,W)&&!I.hasOwnProperty(W)&&(ue[W]=j[W]);var te=arguments.length-2;if(te===1)ue.children=L;else if(1<te){for(var me=Array(te),Ne=0;Ne<te;Ne++)me[Ne]=arguments[Ne+2];ue.children=me}if(y&&y.defaultProps)for(W in te=y.defaultProps,te)ue[W]===void 0&&(ue[W]=te[W]);return{$$typeof:r,type:y,key:le,ref:ce,props:ue,_owner:T.current}}function H(y,j){return{$$typeof:r,type:y.type,key:j,ref:y.ref,props:y.props,_owner:y._owner}}function M(y){return typeof y=="object"&&y!==null&&y.$$typeof===r}function N(y){var j={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(L){return j[L]})}var V=/\/+/g;function Q(y,j){return typeof y=="object"&&y!==null&&y.key!=null?N(""+y.key):j.toString(36)}function X(y,j,L,W,ue){var le=typeof y;(le==="undefined"||le==="boolean")&&(y=null);var ce=!1;if(y===null)ce=!0;else switch(le){case"string":case"number":ce=!0;break;case"object":switch(y.$$typeof){case r:case a:ce=!0}}if(ce)return ce=y,ue=ue(ce),y=W===""?"."+Q(ce,0):W,B(ue)?(L="",y!=null&&(L=y.replace(V,"$&/")+"/"),X(ue,j,L,"",function(Ne){return Ne})):ue!=null&&(M(ue)&&(ue=H(ue,L+(!ue.key||ce&&ce.key===ue.key?"":(""+ue.key).replace(V,"$&/")+"/")+y)),j.push(ue)),1;if(ce=0,W=W===""?".":W+":",B(y))for(var te=0;te<y.length;te++){le=y[te];var me=W+Q(le,te);ce+=X(le,j,L,me,ue)}else if(me=g(y),typeof me=="function")for(y=me.call(y),te=0;!(le=y.next()).done;)le=le.value,me=W+Q(le,te++),ce+=X(le,j,L,me,ue);else if(le==="object")throw j=String(y),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return ce}function ae(y,j,L){if(y==null)return y;var W=[],ue=0;return X(y,W,"","",function(le){return j.call(L,le,ue++)}),W}function J(y){if(y._status===-1){var j=y._result;j=j(),j.then(function(L){(y._status===0||y._status===-1)&&(y._status=1,y._result=L)},function(L){(y._status===0||y._status===-1)&&(y._status=2,y._result=L)}),y._status===-1&&(y._status=0,y._result=j)}if(y._status===1)return y._result.default;throw y._result}var re={current:null},q={transition:null},oe={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:q,ReactCurrentOwner:T};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:ae,forEach:function(y,j,L){ae(y,function(){j.apply(this,arguments)},L)},count:function(y){var j=0;return ae(y,function(){j++}),j},toArray:function(y){return ae(y,function(j){return j})||[]},only:function(y){if(!M(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},Oe.Component=v,Oe.Fragment=o,Oe.Profiler=u,Oe.PureComponent=E,Oe.StrictMode=i,Oe.Suspense=h,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,Oe.act=ee,Oe.cloneElement=function(y,j,L){if(y==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+y+".");var W=b({},y.props),ue=y.key,le=y.ref,ce=y._owner;if(j!=null){if(j.ref!==void 0&&(le=j.ref,ce=T.current),j.key!==void 0&&(ue=""+j.key),y.type&&y.type.defaultProps)var te=y.type.defaultProps;for(me in j)D.call(j,me)&&!I.hasOwnProperty(me)&&(W[me]=j[me]===void 0&&te!==void 0?te[me]:j[me])}var me=arguments.length-2;if(me===1)W.children=L;else if(1<me){te=Array(me);for(var Ne=0;Ne<me;Ne++)te[Ne]=arguments[Ne+2];W.children=te}return{$$typeof:r,type:y.type,key:ue,ref:le,props:W,_owner:ce}},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 zf;function Jg(){if(zf)return ma;zf=1;var r=Nu(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function A(c,h,d){var p,x={},g=null,w=null;d!==void 0&&(g=""+d),h.key!==void 0&&(g=""+h.key),h.ref!==void 0&&(w=h.ref);for(p in h)i.call(h,p)&&!l.hasOwnProperty(p)&&(x[p]=h[p]);if(c&&c.defaultProps)for(p in h=c.defaultProps,h)x[p]===void 0&&(x[p]=h[p]);return{$$typeof:a,type:c,key:g,ref:w,props:x,_owner:u.current}}return ma.Fragment=o,ma.jsx=A,ma.jsxs=A,ma}var Vf;function ev(){return Vf||(Vf=1,Zc.exports=Jg()),Zc.exports}var R=ev(),F=Nu();const he=Po(F),Iu=Zg({__proto__:null,default:he},[F]);var Ks={},Jc={exports:{}},rr={},eu={exports:{}},tu={};/**
|
||||
* @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 Uf;function tv(){return Uf||(Uf=1,(function(r){function a(q,oe){var ee=q.length;q.push(oe);e:for(;0<ee;){var y=ee-1>>>1,j=q[y];if(0<u(j,oe))q[y]=oe,q[ee]=j,ee=y;else break e}}function o(q){return q.length===0?null:q[0]}function i(q){if(q.length===0)return null;var oe=q[0],ee=q.pop();if(ee!==oe){q[0]=ee;e:for(var y=0,j=q.length,L=j>>>1;y<L;){var W=2*(y+1)-1,ue=q[W],le=W+1,ce=q[le];if(0>u(ue,ee))le<j&&0>u(ce,ue)?(q[y]=ce,q[le]=ee,y=le):(q[y]=ue,q[W]=ee,y=W);else if(le<j&&0>u(ce,ee))q[y]=ce,q[le]=ee,y=le;else break e}}return oe}function u(q,oe){var ee=q.sortIndex-oe.sortIndex;return ee!==0?ee:q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var A=Date,c=A.now();r.unstable_now=function(){return A.now()-c}}var h=[],d=[],p=1,x=null,g=3,w=!1,b=!1,k=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(q){for(var oe=o(d);oe!==null;){if(oe.callback===null)i(d);else if(oe.startTime<=q)i(d),oe.sortIndex=oe.expirationTime,a(h,oe);else break;oe=o(d)}}function B(q){if(k=!1,C(q),!b)if(o(h)!==null)b=!0,J(D);else{var oe=o(d);oe!==null&&re(B,oe.startTime-q)}}function D(q,oe){b=!1,k&&(k=!1,S(P),P=-1),w=!0;var ee=g;try{for(C(oe),x=o(h);x!==null&&(!(x.expirationTime>oe)||q&&!N());){var y=x.callback;if(typeof y=="function"){x.callback=null,g=x.priorityLevel;var j=y(x.expirationTime<=oe);oe=r.unstable_now(),typeof j=="function"?x.callback=j:x===o(h)&&i(h),C(oe)}else i(h);x=o(h)}if(x!==null)var L=!0;else{var W=o(d);W!==null&&re(B,W.startTime-oe),L=!1}return L}finally{x=null,g=ee,w=!1}}var T=!1,I=null,P=-1,H=5,M=-1;function N(){return!(r.unstable_now()-M<H)}function V(){if(I!==null){var q=r.unstable_now();M=q;var oe=!0;try{oe=I(!0,q)}finally{oe?Q():(T=!1,I=null)}}else T=!1}var Q;if(typeof E=="function")Q=function(){E(V)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ae=X.port2;X.port1.onmessage=V,Q=function(){ae.postMessage(null)}}else Q=function(){v(V,0)};function J(q){I=q,T||(T=!0,Q())}function re(q,oe){P=v(function(){q(r.unstable_now())},oe)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(q){q.callback=null},r.unstable_continueExecution=function(){b||w||(b=!0,J(D))},r.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<q?Math.floor(1e3/q):5},r.unstable_getCurrentPriorityLevel=function(){return g},r.unstable_getFirstCallbackNode=function(){return o(h)},r.unstable_next=function(q){switch(g){case 1:case 2:case 3:var oe=3;break;default:oe=g}var ee=g;g=oe;try{return q()}finally{g=ee}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(q,oe){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ee=g;g=q;try{return oe()}finally{g=ee}},r.unstable_scheduleCallback=function(q,oe,ee){var y=r.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?y+ee:y):ee=y,q){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=ee+j,q={id:p++,callback:oe,priorityLevel:q,startTime:ee,expirationTime:j,sortIndex:-1},ee>y?(q.sortIndex=ee,a(d,q),o(h)===null&&q===o(d)&&(k?(S(P),P=-1):k=!0,re(B,ee-y))):(q.sortIndex=j,a(h,q),b||w||(b=!0,J(D))),q},r.unstable_shouldYield=N,r.unstable_wrapCallback=function(q){var oe=g;return function(){var ee=g;g=oe;try{return q.apply(this,arguments)}finally{g=ee}}}})(tu)),tu}var Wf;function rv(){return Wf||(Wf=1,eu.exports=tv()),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 qf;function nv(){if(qf)return rr;qf=1;var r=Nu(),a=rv();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,u={};function l(e,t){A(e,t),A(e+"Capture",t)}function A(e,t){for(u[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},x={};function g(e){return h.call(x,e)?!0:h.call(p,e)?!1:d.test(e)?x[e]=!0:(p[e]=!0,!1)}function w(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){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 b(e,t,n,s){if(t===null||typeof t>"u"||w(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function k(e,t,n,s,f,m,_){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=f,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=m,this.removeEmptyString=_}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new k(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];v[t]=new k(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new k(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new k(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){v[e]=new k(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new k(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new k(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new k(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new k(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(S,E);v[t]=new k(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(S,E);v[t]=new k(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(S,E);v[t]=new k(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new k(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new k(e,1,!1,e.toLowerCase(),null,!0,!0)});function C(e,t,n,s){var f=v.hasOwnProperty(t)?v[t]:null;(f!==null?f.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=
Line truncated
|
||||
`+y+e}var L=!1;function W(e,t){if(!e||L)return"";L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(Z){var s=Z}Reflect.construct(e,[],t)}else{try{t.call()}catch(Z){s=Z}e.call(t.prototype)}else{try{throw Error()}catch(Z){s=Z}e()}}catch(Z){if(Z&&s&&typeof Z.stack=="string"){for(var f=Z.stack.split(`
|
||||
`),m=s.stack.split(`
|
||||
`),_=f.length-1,O=m.length-1;1<=_&&0<=O&&f[_]!==m[O];)O--;for(;1<=_&&0<=O;_--,O--)if(f[_]!==m[O]){if(_!==1||O!==1)do if(_--,O--,0>O||f[_]!==m[O]){var z=`
|
||||
`+f[_].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=_&&0<=O);break}}}finally{L=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function ue(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1),e;case 11:return e=W(e.type.render,!1),e;case 1:return e=W(e.type,!0),e;default:return""}}function le(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 I:return"Fragment";case T:return"Portal";case H:return"Profiler";case P:return"StrictMode";case Q:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case N:return(e.displayName||"Context")+".Consumer";case M:return(e._context.displayName||"Context")+".Provider";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:le(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}function ce(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(t);case 8:return t===P?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ne(e){var t=me(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var f=n.get,m=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,m.call(this,_)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $e(e){e._valueTracker||(e._valueTracker=Ne(e))}function nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=me(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function st(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 Ke(e,t){var n=t.checked;return ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gt(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=te(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ot(e,t){t=t.checked,t!=null&&C(e,"checked",t,!1)}function St(e,t){Ot(e,t);var n=te(t.value),s=t.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}t.hasOwnProperty("value")?ct(e,t.type,n):t.hasOwnProperty("defaultValue")&&ct(e,t.type,te(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ct(e,t,n){(t!=="number"||st(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tt=Array.isArray;function et(e,t,n,s){if(e=e.options,t){t={};for(var f=0;f<n.length;f++)t["$"+n[f]]=!0;for(n=0;n<e.length;n++)f=t.hasOwnProperty("$"+e[n].value),e[n].selected!==f&&(e[n].selected=f),f&&s&&(e[n].defaultSelected=!0)}else{for(n=""+te(n),t=null,f=0;f<e.length;f++){if(e[f].value===n){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function Ve(e,t){if(t.dangerouslySetInnerHTML!
Line truncated
|
||||
`).replace(lg,"")}function ls(e,t,n){if(t=nd(t),nd(e)!==t&&n)throw Error(o(425))}function cs(){}var zl=null,Vl=null;function Ul(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wl=typeof setTimeout=="function"?setTimeout:void 0,cg=typeof clearTimeout=="function"?clearTimeout:void 0,od=typeof Promise=="function"?Promise:void 0,ug=typeof queueMicrotask=="function"?queueMicrotask:typeof od<"u"?function(e){return od.resolve(null).then(e).catch(dg)}:Wl;function dg(e){setTimeout(function(){throw e})}function ql(e,t){var n=t,s=0;do{var f=n.nextSibling;if(e.removeChild(n),f&&f.nodeType===8)if(n=f.data,n==="/$"){if(s===0){e.removeChild(f),Wo(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=f}while(n);Wo(t)}function un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ad(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var so=Math.random().toString(36).slice(2),Pr="__reactFiber$"+so,ta="__reactProps$"+so,Ur="__reactContainer$"+so,Ql="__reactEvents$"+so,fg="__reactListeners$"+so,Ag="__reactHandles$"+so;function Dn(e){var t=e[Pr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Pr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ad(e);e!==null;){if(n=e[Pr])return n;e=ad(e)}return t}e=n,n=e.parentNode}return null}function ra(e){return e=e[Pr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function io(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function us(e){return e[ta]||null}var Gl=[],lo=-1;function dn(e){return{current:e}}function rt(e){0>lo||(e.current=Gl[lo],Gl[lo]=null,lo--)}function Xe(e,t){lo++,Gl[lo]=e.current,e.current=t}var fn={},Ht=dn(fn),Zt=dn(!1),Fn=fn;function co(e,t){var n=e.type.contextTypes;if(!n)return fn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in n)f[m]=t[m];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=f),f}function Xt(e){return e=e.childContextTypes,e!=null}function ds(){rt(Zt),rt(Ht)}function sd(e,t,n){if(Ht.current!==fn)throw Error(o(168));Xe(Ht,t),Xe(Zt,n)}function id(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var f in s)if(!(f in t))throw Error(o(108,ce(e)||"Unknown",f));return ee({},n,s)}function fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,Fn=Ht.current,Xe(Ht,e),Xe(Zt,Zt.current),!0}function ld(e,t,n){var s=e.stateNode;if(!s)throw Error(o(169));n?(e=id(e,t,Fn),s.__reactInternalMemoizedMergedChildContext=e,rt(Zt),rt(Ht),Xe(Ht,e)):rt(Zt),Xe(Zt,n)}var Wr=null,As=!1,$l=!1;function cd(e){Wr===null?Wr=[e]:Wr.push(e)}function hg(e){As=!0,cd(e)}function An(){if(!$l&&Wr!==null){$l=!0;var e=0,t=Ge;try{var n=Wr;for(Ge=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}Wr=null,As=!1}catch(f){throw Wr!==null&&(Wr=Wr.slice(e+1)),d0(xl,An),f}finally{Ge=t,$l=!1}}return null}var uo=[],fo=0,hs=null,ps=0,fr=[],Ar=0,Rn=null,qr=1,Qr="";function Tn(e,t){uo[fo++]=ps,uo[fo++]=hs,hs=e,ps=t}function ud(e,t,n){fr[Ar++]=qr,fr[Ar++]=Qr,fr[Ar++]=Rn,Rn=e;var s=qr;e=Qr;var f=32-wr(s)-1;s&=~(1<<f),n+=1;var m=32-wr(t)+f;if(30<m){var _=f-f%5;m=(s&(1<<_)-1).toString(32),s>>=_,f-=_,qr=1<<32-wr(t)+f|n<<f|s,Qr=m+e}else qr=1<<m|n<<f|s,Qr=e}function Kl(e){e.return!==null&&(Tn(e,1),ud(e,1,0))}function Yl(e){for(;e===hs;)hs=uo[--fo],uo[fo]=null,ps=uo[--fo],uo[fo]=null;for(;e===Rn;)Rn=fr[--Ar],fr[Ar]=null,Qr=fr[--Ar],fr[Ar]=null,qr=fr[--Ar],fr[Ar]=null}var sr=null,ir=null,at=!1,Er=null;function dd(e,t){var n=mr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fd(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ir=un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ir=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rn!==null?{id:qr,overflow:Qr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sr=e,ir=null,!0):!1;default:return!1}}function Zl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xl(e){if(at){var t=ir;if(t){var n=t;if(!fd(e,t)){if(Zl(e))throw Error(o(418));t=un(n.nextSibling);var s=sr;t&&fd(e,t)?dd(s,n):(e.flags=e.flags&-4097|2,at=!1,sr=e)}}else{if(Zl(e))throw Error(o(418));e.flags=e.flags&-4097|2,at=!1,sr=e}}}function Ad(e){for(e=e
Line truncated
|
||||
Error generating stack: `+m.message+`
|
||||
`+m.stack}return{value:e,source:t,stack:f,digest:null}}function yc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Cc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var bg=typeof WeakMap=="function"?WeakMap:Map;function Gd(e,t,n){n=$r(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Is||(Is=!0,Mc=s),Cc(e,t)},n}function $d(e,t,n){n=$r(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var f=t.value;n.payload=function(){return s(f)},n.callback=function(){Cc(e,t)}}var m=e.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(n.callback=function(){Cc(e,t),typeof s!="function"&&(mn===null?mn=new Set([this]):mn.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),n}function Kd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new bg;var f=new Set;s.set(t,f)}else f=s.get(t),f===void 0&&(f=new Set,s.set(t,f));f.has(n)||(f.add(n),e=Og.bind(null,e,t,n),t.then(e,e))}function Yd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zd(e,t,n,s,f){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$r(-1,1),t.tag=2,pn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var Eg=B.ReactCurrentOwner,Jt=!1;function qt(e,t,n,s){t.child=e===null?md(t,null,n,s):ho(t,e.child,n,s)}function Xd(e,t,n,s,f){n=n.render;var m=t.ref;return xo(t,f),s=fc(e,t,n,s,m,f),n=Ac(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,Kr(e,t,f)):(at&&n&&Kl(t),t.flags|=1,qt(e,t,s,f),t.child)}function Jd(e,t,n,s,f){if(e===null){var m=n.type;return typeof m=="function"&&!Uc(m)&&m.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=m,ef(e,t,m,s,f)):(e=zs(n.type,null,s,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,(e.lanes&f)===0){var _=m.memoizedProps;if(n=n.compare,n=n!==null?n:Yo,n(_,s)&&e.ref===t.ref)return Kr(e,t,f)}return t.flags|=1,e=Cn(m,s),e.ref=t.ref,e.return=t,t.child=e}function ef(e,t,n,s,f){if(e!==null){var m=e.memoizedProps;if(Yo(m,s)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=s=m,(e.lanes&f)!==0)(e.flags&131072)!==0&&(Jt=!0);else return t.lanes=e.lanes,Kr(e,t,f)}return wc(e,t,n,s,f)}function tf(e,t,n){var s=t.pendingProps,f=s.children,m=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(yo,lr),lr|=n;else{if((n&1073741824)===0)return e=m!==null?m.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Xe(yo,lr),lr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=m!==null?m.baseLanes:n,Xe(yo,lr),lr|=s}else m!==null?(s=m.baseLanes|n,t.memoizedState=null):s=n,Xe(yo,lr),lr|=s;return qt(e,t,f,n),t.child}function rf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function wc(e,t,n,s,f){var m=Xt(n)?Fn:Ht.current;return m=co(t,m),xo(t,f),n=fc(e,t,n,s,m,f),s=Ac(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~f,Kr(e,t,f)):(at&&s&&Kl(t),t.flags|=1,qt(e,t,n,f),t.child)}function nf(e,t,n,s,f){if(Xt(n)){var m=!0;fs(t)}else m=!1;if(xo(t,f),t.stateNode===null)Fs(e,t),qd(t,n,s),vc(t,n,s,f),s=!0;else if(e===null){var _=t.stateNode,O=t.memoizedProps;_.props=O;var z=_.context,Z=n.contextType;typeof Z=="object"&&Z!==null?Z=hr(Z):(Z=Xt(n)?Fn:Ht.current,Z=co(t,Z));var ie=n.getDerivedStateFromProps,de=typeof ie=="function"||typeof _.getSnapshotBeforeUpdate=="function";de||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==s||z!==Z)&&Qd(t,_,s,Z),hn=!1;var se=t.memoizedState;_.state=se,Cs(t,s,_,f),z=t.memoizedState,O!==s||se!==z||Zt.current||hn?(typeof ie=="function"&&(gc(t,n,ie,s),z=t.memoizedState),(O=hn||Wd(t,n,O,s,se,z,Z))?(de||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=z),_.props=s,_.state=z,_.context=Z,s=O):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{_=t.stateNode,vd(e,t),O=t.memoizedProps,Z=t.type===t.elementType?O:kr(t.type,O),_.props=Z,de=t.pendingProps,se=_.context,z=n.contextType,typeof z=="object"&&z!==null?z=hr(z):(z=Xt(n)?Fn:Ht.current,z=co(t,z));var xe=n.getDerivedStateFromProps;(ie=typeof xe=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==de||se!==z)&&Qd(t,_,s,z),hn=!1,se=t.memoizedState,_
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 lv=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cv=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,i)=>i?i.toUpperCase():o.toLowerCase()),$f=r=>{const a=cv(r);return a.charAt(0).toUpperCase()+a.slice(1)},qh=(...r)=>r.filter((a,o,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===o).join(" ").trim(),uv=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var dv={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 fv=F.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:l,iconNode:A,...c},h)=>F.createElement("svg",{ref:h,...dv,width:a,height:a,stroke:r,strokeWidth:i?Number(o)*24/Number(a):o,className:qh("lucide",u),...!l&&!uv(c)&&{"aria-hidden":"true"},...c},[...A.map(([d,p])=>F.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Mu=(r,a)=>{const o=F.forwardRef(({className:i,...u},l)=>F.createElement(fv,{ref:l,iconNode:a,className:qh(`lucide-${lv($f(r))}`,`lucide-${r}`,i),...u}));return o.displayName=$f(r),o};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Av=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hv=Mu("check",Av);/**
|
||||
* @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 pv=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],xv=Mu("menu",pv);/**
|
||||
* @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 mv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qh=Mu("x",mv);var Gh=Wh();const $h=Po(Gh);function gv(r){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a.appendChild(o),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r))}const vv=r=>{switch(r){case"success":return wv;case"info":return Ev;case"warning":return bv;case"error":return kv;default:return null}},yv=Array(12).fill(0),Cv=({visible:r,className:a})=>he.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":r},he.createElement("div",{className:"sonner-spinner"},yv.map((o,i)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),wv=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"})),bv=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"})),Ev=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"})),kv=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"})),Sv=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"})),Bv=()=>{const[r,a]=he.useState(document.hidden);return he.useEffect(()=>{const o=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),r};let vu=1;class _v{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const o=this.subscribers.indexOf(a);this.subscribers.splice(o,1)}),this.publish=a=>{this.subscribers.forEach(o=>o(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var o;const{message:i,...u}=a,l=typeof(a==null?void 0:a.id)=="number"||((o=a.id)==null?void 0:o.length)>0?a.id:vu++,A=this.toasts.find(h=>h.id===l),c=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),A?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...a,id:l,title:i}),{...h,...a,id:l,dismissible:c,title:i}):h):this.addToast({title:i,...u,dismissible:c,id:l}),l},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:a,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(i=>i({id:o.id,dismiss:!0}))}),a),this.message=(a,o)=>this.create({...o,message:a}),this.error=(a,o)=>this.create({...o,message:a,type:"error"}),this.success=(a,o)=>this.create({...o,type:"success",message:a}),this.info=(a,o)=>this.create({...o,type:"info",message:a}),this.warning=(a,o)=>this.create({...o,type:"warning",message:a}),this.loading=(a,o)=>this.create({...o,type:"loading",message:a}),this.promise=(a,o)=>{if(!o)return;let i;o.loading!==void 0&&(i=this.create({...o,promise:a,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const u=Promise.resolve(a instanceof Function?a():a);let l=i!==void 0,A;const c=u.then(async d=>{if(A=["resolve",d],he.isValidElement(d))l=!1,this.create({id:i,type:"default",message:d});else if(Fv(d)&&!d.ok){l=!1;const x=typeof o.error=="function"?await o.error(`HTTP error! status: ${d.status}`):o.error,g=typeof o.description=="function"?await o.description(`HTTP error! status: ${d.status}`):o.description,b=typeof x=="object"&&!he.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:g,...b})}else if(d instanceof Error){l=!1;const x=typeof o.error=="function"?await o.error(d):o.error,Line truncated
|
||||
`).map((oe,ee,y)=>R.jsxs("span",{children:[oe,ee<y.length-1&&R.jsx("br",{})]},ee)),!X&&R.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:iA(B.sender_timestamp||B.received_at)}),B.outgoing&&(B.acked?" ✓":" ?")]})]})]},B.id)})]}),p&&R.jsx("button",{onClick:b,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:R.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:R.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const r1=F.forwardRef(function({onSend:a,disabled:o,placeholder:i},u){const[l,A]=F.useState(""),[c,h]=F.useState(!1),d=F.useRef(null);F.useImperativeHandle(u,()=>({appendText:g=>{var w;A(b=>b+g),(w=d.current)==null||w.focus()}}));const p=F.useCallback(async g=>{g.preventDefault();const w=l.trim();if(!(!w||c||o)){h(!0);try{await a(w),A("")}catch(b){console.error("Failed to send message:",b)}finally{h(!1)}}},[l,c,o,a]),x=F.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),p(g))},[p]);return R.jsxs("form",{className:"px-4 py-3 border-t border-border flex gap-2",onSubmit:p,children:[R.jsx(gt,{ref:d,type:"text",value:l,onChange:g=>A(g.target.value),onKeyDown:x,placeholder:i||"Type a message...",disabled:o||c,className:"flex-1"}),R.jsx(zr,{type:"submit",disabled:o||c||!l.trim(),children:c?"Sending...":"Send"})]})});function kt(r,a,{checkForDefaultPrevented:o=!0}={}){return function(u){if(r==null||r(u),o===!1||!u.defaultPrevented)return a==null?void 0:a(u)}}function n1(r,a){const o=F.createContext(a),i=l=>{const{children:A,...c}=l,h=F.useMemo(()=>c,Object.values(c));return R.jsx(o.Provider,{value:h,children:A})};i.displayName=r+"Provider";function u(l){const A=F.useContext(o);if(A)return A;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[i,u]}function za(r,a=[]){let o=[];function i(l,A){const c=F.createContext(A),h=o.length;o=[...o,A];const d=x=>{var S;const{scope:g,children:w,...b}=x,k=((S=g==null?void 0:g[r])==null?void 0:S[h])||c,v=F.useMemo(()=>b,Object.values(b));return R.jsx(k.Provider,{value:v,children:w})};d.displayName=l+"Provider";function p(x,g){var k;const w=((k=g==null?void 0:g[r])==null?void 0:k[h])||c,b=F.useContext(w);if(b)return b;if(A!==void 0)return A;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[d,p]}const u=()=>{const l=o.map(A=>F.createContext(A));return function(c){const h=(c==null?void 0:c[r])||l;return F.useMemo(()=>({[`__scope${r}`]:{...c,[r]:h}}),[c,h])}};return u.scopeName=r,[i,o1(u,...a)]}function o1(...r){const a=r[0];if(r.length===1)return a;const o=()=>{const i=r.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(l){const A=i.reduce((c,{useScope:h,scopeName:d})=>{const x=h(l)[`__scope${d}`];return{...c,...x}},{});return F.useMemo(()=>({[`__scope${a.scopeName}`]:A}),[A])}};return o.scopeName=a.scopeName,o}var Ro=globalThis!=null&&globalThis.document?F.useLayoutEffect:()=>{},a1=Iu[" useId ".trim().toString()]||(()=>{}),s1=0;function Ma(r){const[a,o]=F.useState(a1());return Ro(()=>{o(i=>i??String(s1++))},[r]),a?`radix-${a}`:""}var i1=Iu[" useInsertionEffect ".trim().toString()]||Ro;function rl({prop:r,defaultProp:a,onChange:o=()=>{},caller:i}){const[u,l,A]=l1({defaultProp:a,onChange:o}),c=r!==void 0,h=c?r:u;{const p=F.useRef(r!==void 0);F.useEffect(()=>{const x=p.current;x!==c&&console.warn(`${i} is changing from ${x?"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.`),p.current=c},[c,i])}const d=F.useCallback(p=>{var x;if(c){const g=c1(p)?p(r):p;g!==r&&((x=A.current)==null||x.call(A,g))}else l(p)},[c,r,l,A]);return[h,d]}function l1({defaultProp:r,onChange:a}){const[o,i]=F.useState(r),u=F.useRef(o),l=F.useRef(a);return i1(()=>{l.current=a},[a]),F.useEffect(()=>{var A;u.current!==o&&((A=l.current)==null||A.call(l,o),u.current=o)},[o,u]),[o,i,l]}function c1(r){return typeof r=="function"}function u1(r){const a=d1(r),o=F.forwardRef((i,u)=>{const{children:l,...A}=i,c=F.Children.toArray(l),h=c.find(A1);if(h){const d=h.props.children,p=c.map(x=>x===h?F.Children.count(d)>1?F.Children.only(null):F.isValidElement(d)?d.props.children:null:x);return R.jsx(a,{...A,ref:u,children:F.isValidElement(d)?F.cloneElement(d,void 0,p):null})}return R.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function d1(r){const a=F.forwardRef((o,i)=>{const{children:u,...l}=o;if(F.isValidElement(u)){const A=p1(u),c=h1(l,u.props);return u.type!==F.Fragment&&(c.ref=i?La(i,A):A),F.cloneElement(u,c)}return F.Children.count(u)>1?F.Children.only(null):null});return a.displayName=`${r}.S
Line truncated
|
||||
.`.concat(H1,` {
|
||||
overflow: hidden `).concat(i,`;
|
||||
padding-right: `).concat(c,"px ").concat(i,`;
|
||||
}
|
||||
body[`).concat(_o,`] {
|
||||
overflow: hidden `).concat(i,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([a&&"position: relative ".concat(i,";"),o==="margin"&&`
|
||||
padding-left: `.concat(u,`px;
|
||||
padding-top: `).concat(l,`px;
|
||||
padding-right: `).concat(A,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(c,"px ").concat(i,`;
|
||||
`),o==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(oi,` {
|
||||
right: `).concat(c,"px ").concat(i,`;
|
||||
}
|
||||
|
||||
.`).concat(ai,` {
|
||||
margin-right: `).concat(c,"px ").concat(i,`;
|
||||
}
|
||||
|
||||
.`).concat(oi," .").concat(oi,` {
|
||||
right: 0 `).concat(i,`;
|
||||
}
|
||||
|
||||
.`).concat(ai," .").concat(ai,` {
|
||||
margin-right: 0 `).concat(i,`;
|
||||
}
|
||||
|
||||
body[`).concat(_o,`] {
|
||||
`).concat(L1,": ").concat(c,`px;
|
||||
}
|
||||
`)},xA=function(){var r=parseInt(document.body.getAttribute(_o)||"0",10);return isFinite(r)?r:0},a2=function(){F.useEffect(function(){return document.body.setAttribute(_o,(xA()+1).toString()),function(){var r=xA()-1;r<=0?document.body.removeAttribute(_o):document.body.setAttribute(_o,r.toString())}},[])},s2=function(r){var a=r.noRelative,o=r.noImportant,i=r.gapMode,u=i===void 0?"margin":i;a2();var l=F.useMemo(function(){return r2(u)},[u]);return F.createElement(n2,{styles:o2(l,!a,u,o?"":"!important")})},ku=!1;if(typeof window<"u")try{var ei=Object.defineProperty({},"passive",{get:function(){return ku=!0,!0}});window.addEventListener("test",ei,ei),window.removeEventListener("test",ei,ei)}catch{ku=!1}var Eo=ku?{passive:!1}:!1,i2=function(r){return r.tagName==="TEXTAREA"},bp=function(r,a){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!i2(r)&&o[a]==="visible")},l2=function(r){return bp(r,"overflowY")},c2=function(r){return bp(r,"overflowX")},mA=function(r,a){var o=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=Ep(r,i);if(u){var l=kp(r,i),A=l[1],c=l[2];if(A>c)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},u2=function(r){var a=r.scrollTop,o=r.scrollHeight,i=r.clientHeight;return[a,o,i]},d2=function(r){var a=r.scrollLeft,o=r.scrollWidth,i=r.clientWidth;return[a,o,i]},Ep=function(r,a){return r==="v"?l2(a):c2(a)},kp=function(r,a){return r==="v"?u2(a):d2(a)},f2=function(r,a){return r==="h"&&a==="rtl"?-1:1},A2=function(r,a,o,i,u){var l=f2(r,window.getComputedStyle(a).direction),A=l*i,c=o.target,h=a.contains(c),d=!1,p=A>0,x=0,g=0;do{if(!c)break;var w=kp(r,c),b=w[0],k=w[1],v=w[2],S=k-v-l*b;(b||S)&&Ep(r,c)&&(x+=S,g+=b);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!h&&c!==document.body||h&&(a.contains(c)||a===c));return(p&&Math.abs(x)<1||!p&&Math.abs(g)<1)&&(d=!0),d},ti=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},gA=function(r){return[r.deltaX,r.deltaY]},vA=function(r){return r&&"current"in r?r.current:r},h2=function(r,a){return r[0]===a[0]&&r[1]===a[1]},p2=function(r){return`
|
||||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||||
`)},x2=0,ko=[];function m2(r){var a=F.useRef([]),o=F.useRef([0,0]),i=F.useRef(),u=F.useState(x2++)[0],l=F.useState(wp)[0],A=F.useRef(r);F.useEffect(function(){A.current=r},[r]),F.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(u));var k=j1([r.lockRef.current],(r.shards||[]).map(vA),!0).filter(Boolean);return k.forEach(function(v){return v.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),k.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(u))})}}},[r.inert,r.lockRef.current,r.shards]);var c=F.useCallback(function(k,v){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!A.current.allowPinchZoom;var S=ti(k),E=o.current,C="deltaX"in k?k.deltaX:E[0]-S[0],B="deltaY"in k?k.deltaY:E[1]-S[1],D,T=k.target,I=Math.abs(C)>Math.abs(B)?"h":"v";if("touches"in k&&I==="h"&&T.type==="range")return!1;var P=window.getSelection(),H=P&&P.anchorNode,M=H?H===T||H.contains(T):!1;if(M)return!1;var N=mA(I,T);if(!N)return!0;if(N?D=I:(D=I==="v"?"h":"v",N=mA(I,T)),!N)return!1;if(!i.current&&"changedTouches"in k&&(C||B)&&(i.current=D),!D)return!0;var V=i.current||D;return A2(V,v,k,V==="h"?C:B)},[]),h=F.useCallback(function(k){var v=k;if(!(!ko.length||ko[ko.length-1]!==l)){var S="deltaY"in v?gA(v):ti(v),E=a.current.filter(function(D){return D.name===v.type&&(D.target===v.target||v.target===D.shadowParent)&&h2(D.delta,S)})[0];if(E&&E.should){v.cancelable&&v.preventDefault();return}if(!E){var C=(A.current.shards||[]).map(vA).filter(Boolean).filter(function(D){return D.contains(v.target)}),B=C.length>0?c(v,C[0]):!A.current.noIsolation;B&&v.cancelable&&v.preventDefault()}}},[]),d=F.useCallback(function(k,v,S,E){var C={name:k,delta:v,target:S,should:E,shadowParent:g2(S)};a.current.push(C),setTimeout(function(){a.current=a.current.filter(function(B){return B!==C})},1)},[]),p=F.useCallback(function(k){o.current=ti(k),i.current=void 0},[]),x=F.useCallback(function(k){d(k.type,gA(k),k.target,c(k,r.lockRef.current))},[]),g=F.useCallback(function(k){d(k.type,ti(k),k.target,c(k,r.lockRef.current))},[]);F.useEffect(function(){return ko.push(l),r.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:g}),document.addEventListener("wheel",h,Eo),document.addEventListener("touchmove",h,Eo),document.addEventListener("touchstart",p,Eo),function(){ko=ko.filter(function(k){return k!==l}),document.removeEventListener("wheel",h,Eo),document.removeEventListener("touchmove",h,Eo),document.removeEventListener("touchstart",p,Eo)}},[]);var w=r.removeScrollBar,b=r.inert;return F.createElement(F.Fragment,null,b?F.createElement(l,{styles:p2(u)}):null,w?F.createElement(s2,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function g2(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const v2=G1(Cp,m2);var Sp=F.forwardRef(function(r,a){return F.createElement(nl,Lr({},r,{ref:a,sideCar:v2}))});Sp.classNames=nl.classNames;var y2=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},So=new WeakMap,ri=new WeakMap,ni={},fu=0,Bp=function(r){return r&&(r.host||Bp(r.parentNode))},C2=function(r,a){return a.map(function(o){if(r.contains(o))return o;var i=Bp(o);return i&&r.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},w2=function(r,a,o,i){var u=C2(a,Array.isArray(r)?r:[r]);ni[o]||(ni[o]=new WeakMap);var l=ni[o],A=[],c=new Set,h=new Set(u),d=function(x){!x||c.has(x)||(c.add(x),d(x.parentNode))};u.forEach(d);var p=function(x){!x||h.has(x)||Array.prototype.forEach.call(x.children,function(g){if(c.has(g))p(g);else try{var w=g.getAttribute(i),b=w!==null&&w!=="false",k=(So.get(g)||0)+1,v=(l.get(g)||0)+1;So.set(g,k),l.set(g,v),A.push(g),k===1&&b&&ri.set(g,!0),v===1&&g.setAttribute(o,"true"),b||g.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return p(a),c.clear(),fu++,function(){A.forEach(function(x){var g=So.get(x)-1,w=l.get(x)-1;So.set(x,g),l.set(x,w),g||(ri.has(x)||x.removeAttribute(i),ri.delete(x)),w||x.removeAttribute(o)}),fu--,fu||(So=new WeakMap,So=new WeakMap,ri=new WeakMap,ni={})}},b2=function(r,a,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),u=y2(r);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),w2(i,u,o,"aria-hidden")):function(){return null}};function E2(r){const a=k2(r),o=F.forwardRef((i,u)=>{const{children:l,...A}=i,c=F.Children.toArray(l),h=c.find(B2);if(h){const d=h.props.children,p=c.map(x=>x===h?F.Children.count(d)>1?F.Children.only(null):F.isValidElement(d)?d.props.children:null:x);return R.jsx(a,{...A,ref:u,children:F.isValidElement(d)?F.cloneElement(d,void 0,p):null})}return R.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function k2(r){const a=F.forwardRef((o,i)=>{const{children:u
Line truncated
|
||||
|
||||
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return F.useEffect(()=>{r&&(document.getElementById(r)||console.error(o))},[o,r]),null},j2="DialogDescriptionWarning",H2=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vp(j2).contentName}}.`;return F.useEffect(()=>{var l;const u=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");a&&u&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},Up=Dp,Wp=Tp,al=Pp,sl=Np,il=Mp,ll=jp,qp=Lp;const Qp=Up,L2=Wp,Gp=F.forwardRef(({className:r,...a},o)=>R.jsx(al,{ref:o,className:qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a}));Gp.displayName=al.displayName;const Vu=F.forwardRef(({className:r,children:a,...o},i)=>R.jsxs(L2,{children:[R.jsx(Gp,{}),R.jsxs(sl,{ref:i,className:qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...o,children:[a,R.jsxs(qp,{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:[R.jsx(Qh,{className:"h-4 w-4"}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vu.displayName=sl.displayName;const Uu=({className:r,...a})=>R.jsx("div",{className:qe("flex flex-col space-y-1.5 text-center sm:text-left",r),...a});Uu.displayName="DialogHeader";const Wu=({className:r,...a})=>R.jsx("div",{className:qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});Wu.displayName="DialogFooter";const qu=F.forwardRef(({className:r,...a},o)=>R.jsx(il,{ref:o,className:qe("text-lg font-semibold leading-none tracking-tight",r),...a}));qu.displayName=il.displayName;const z2=F.forwardRef(({className:r,...a},o)=>R.jsx(ll,{ref:o,className:qe("text-sm text-muted-foreground",r),...a}));z2.displayName=ll.displayName;function yA(r){const a=V2(r),o=F.forwardRef((i,u)=>{const{children:l,...A}=i,c=F.Children.toArray(l),h=c.find(W2);if(h){const d=h.props.children,p=c.map(x=>x===h?F.Children.count(d)>1?F.Children.only(null):F.isValidElement(d)?d.props.children:null:x);return R.jsx(a,{...A,ref:u,children:F.isValidElement(d)?F.cloneElement(d,void 0,p):null})}return R.jsx(a,{...A,ref:u,children:l})});return o.displayName=`${r}.Slot`,o}function V2(r){const a=F.forwardRef((o,i)=>{const{children:u,...l}=o;if(F.isValidElement(u)){const A=Q2(u),c=q2(l,u.props);return u.type!==F.Fragment&&(c.ref=i?La(i,A):A),F.cloneElement(u,c)}return F.Children.count(u)>1?F.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var U2=Symbol("radix.slottable");function W2(r){return F.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===U2}function q2(r,a){const o={...a};for(const i in a){const u=r[i],l=a[i];/^on[A-Z]/.test(i)?u&&l?o[i]=(...c)=>{const h=l(...c);return u(...c),h}:u&&(o[i]=u):i==="style"?o[i]={...u,...l}:i==="className"&&(o[i]=[u,l].filter(Boolean).join(" "))}return{...r,...o}}function Q2(r){var i,u;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?r.ref:(a=(u=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:u.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?r.props.ref:r.props.ref||r.ref)}function G2(r){const a=r+"CollectionProvider",[o,i]=za(a),[u,l]=o(a,{collectionRef:{current:null},itemMap:new Map}),A=k=>{const{scope:v,children:S}=k,E=he.useRef(null),C=he.useRef(new Map).current;return R.jsx(u,{scope:v,itemMap:C,collectionRef:E,children:S})};A.displayName=a;const c=r+"CollectionSlot",h=yA(c),d=he.forwardRef((k,v)=>{const{scope:S,children:E}=k,C=l(c,S),B=gr(v,C.collectionRef);return R.jsx(h,{ref:B,children:E})});d.displayName=c;const p=r+"CollectionItemSlot",x="data-radix-collection-item",g=yA(p),w=he.forwardRef((k,v)=>{const{scope:S,children:E,...C}=k,B=he.useRef(null),D=gr(v,B),T=l(p,S);return he.useEffect(()=>(T.itemMap.set(B,{ref:B,...C}),()=>void T.itemMap.delete(B))),R.jsx(g,{[x]:"",ref:D,children:E})});w.displayName=p;function b(k){const v=l(r+"CollectionConsumer",k);return he.useCallback(()=>{const E=v.collectionRef.current;if(!E)return[];const C=Array.from(E.querySelectorAll(`[${x}]`));return Array.from(v.itemMap.values()).sort((T,I)=>C.indexOf(T.ref.current)-C.indexOf(I.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(i){var u=o,l=u.lib,A=l.WordArray,c=l.Hasher,h=u.algo,d=A.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=A.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),x=A.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),g=A.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),w=A.create([0,1518500249,1859775393,2400959708,2840853838]),b=A.create([1352829926,1548603684,1836072691,2053994217,0]),k=h.RIPEMD160=c.extend({_doReset:function(){this._hash=A.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(T,I){for(var P=0;P<16;P++){var H=I+P,M=T[H];T[H]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}var N=this._hash.words,V=w.words,Q=b.words,X=d.words,ae=p.words,J=x.words,re=g.words,q,oe,ee,y,j,L,W,ue,le,ce;L=q=N[0],W=oe=N[1],ue=ee=N[2],le=y=N[3],ce=j=N[4];for(var te,P=0;P<80;P+=1)te=q+T[I+X[P]]|0,P<16?te+=v(oe,ee,y)+V[0]:P<32?te+=S(oe,ee,y)+V[1]:P<48?te+=E(oe,ee,y)+V[2]:P<64?te+=C(oe,ee,y)+V[3]:te+=B(oe,ee,y)+V[4],te=te|0,te=D(te,J[P]),te=te+j|0,q=j,j=y,y=D(ee,10),ee=oe,oe=te,te=L+T[I+ae[P]]|0,P<16?te+=B(W,ue,le)+Q[0]:P<32?te+=C(W,ue,le)+Q[1]:P<48?te+=E(W,ue,le)+Q[2]:P<64?te+=S(W,ue,le)+Q[3]:te+=v(W,ue,le)+Q[4],te=te|0,te=D(te,re[P]),te=te+ce|0,L=ce,ce=le,le=D(ue,10),ue=W,W=te;te=N[1]+ee+le|0,N[1]=N[2]+y+ce|0,N[2]=N[3]+j+L|0,N[3]=N[4]+q+W|0,N[4]=N[0]+oe+ue|0,N[0]=te},_doFinalize:function(){var T=this._data,I=T.words,P=this._nDataBytes*8,H=T.sigBytes*8;I[H>>>5]|=128<<24-H%32,I[(H+64>>>9<<4)+14]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360,T.sigBytes=(I.length+1)*4,this._process();for(var M=this._hash,N=M.words,V=0;V<5;V++){var Q=N[V];N[V]=(Q<<8|Q>>>24)&16711935|(Q<<24|Q>>>8)&4278255360}return M},clone:function(){var T=c.clone.call(this);return T._hash=this._hash.clone(),T}});function v(T,I,P){return T^I^P}function S(T,I,P){return T&I|~T&P}function E(T,I,P){return(T|~I)^P}function C(T,I,P){return T&P|I&~P}function B(T,I,P){return T^(I|~P)}function D(T,I){return T<<I|T>>>32-I}u.RIPEMD160=c._createHelper(k),u.HmacRIPEMD160=c._createHmacHelper(k)})(),o.RIPEMD160})})(Ci)),Ci.exports}var wi={exports:{}},n4=wi.exports,LA;function fl(){return LA||(LA=1,(function(r,a){(function(o,i){r.exports=i(Le())})(n4,function(o){(function(){var i=o,u=i.lib,l=u.Base,A=i.enc,c=A.Utf8,h=i.algo;h.HMAC=l.extend({init:function(d,p){d=this._hasher=new d.init,typeof p=="string"&&(p=c.parse(p));var x=d.blockSize,g=x*4;p.sigBytes>g&&(p=d.finalize(p)),p.clamp();for(var w=this._oKey=p.clone(),b=this._iKey=p.clone(),k=w.words,v=b.words,S=0;S<x;S++)k[S]^=1549556828,v[S]^=909522486;w.sigBytes=b.sigBytes=g,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var p=this._hasher,x=p.finalize(d);p.reset();var g=p.finalize(this._oKey.clone().concat(x));return g}})})()})})(wi)),wi.exports}var bi={exports:{}},o4=bi.exports,zA;function a4(){return zA||(zA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Ua(),fl())})(o4,function(o){return(function(){var i=o,u=i.lib,l=u.Base,A=u.WordArray,c=i.algo,h=c.SHA256,d=c.HMAC,p=c.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,g){for(var w=this.cfg,b=d.create(w.hasher,x),k=A.create(),v=A.create([1]),S=k.words,E=v.words,C=w.keySize,B=w.iterations;S.length<C;){var D=b.update(g).finalize(v);b.reset();for(var T=D.words,I=T.length,P=D,H=1;H<B;H++){P=b.finalize(P),b.reset();for(var M=P.words,N=0;N<I;N++)T[N]^=M[N]}k.concat(D),E[0]++}return k.sigBytes=C*4,k}});i.PBKDF2=function(x,g,w){return p.create(w).compute(x,g)}})(),o.PBKDF2})})(bi)),bi.exports}var Ei={exports:{}},s4=Ei.exports,VA;function Bn(){return VA||(VA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Dx(),fl())})(s4,function(o){return(function(){var i=o,u=i.lib,l=u.Base,A=u.WordArray,c=i.algo,h=c.MD5,d=c.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:h,iterations:1}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,x){for(var g,w=this.cfg,b=w.hasher.create(),k=A.create(),v=k.words,S=w.keySize,E=w.iterations;v.length<S;){g&&b.update(g),g=b.update(p).finalize(x),b.reset();for(var C=1;C<E;C++)g=b.finalize(g),b.reset();k.concat(g)}return k.sigBytes=S*4,k}});i.EvpKDF=function(p,x,g){return d.create(g).compute(p,x)}})(),o.EvpKDF})})(Ei)),Ei.exports}var ki={exports:{}},i4=ki.exports,UA;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 i=o.lib.BlockCipherMode.extend();function u(c){if((c>>24&255)===255){var h=c>>16&255,d=c>>8&255,p=c&255;h===255?(h=0,d===255?(d=0,p===255?p=0:++p):++d):++h,c=0,c+=h<<16,c+=d<<8,c+=p}else c+=1<<24;return c}function l(c){return(c[0]=u(c[0]))===0&&(c[1]=u(c[1])),c}var A=i.Encryptor=i.extend({processBlock:function(c,h){var d=this._cipher,p=d.blockSize,x=this._iv,g=this._counter;x&&(g=this._counter=x.slice(0),this._iv=void 0),l(g);var w=g.slice(0);d.encryptBlock(w,0);for(var b=0;b<p;b++)c[h+b]^=w[b]}});return i.Decryptor=A,i})(),o.mode.CTRGladman})})(_i)),_i.exports}var Di={exports:{}},h4=Di.exports,GA;function p4(){return GA||(GA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(h4,function(o){return o.mode.OFB=(function(){var i=o.lib.BlockCipherMode.extend(),u=i.Encryptor=i.extend({processBlock:function(l,A){var c=this._cipher,h=c.blockSize,d=this._iv,p=this._keystream;d&&(p=this._keystream=d.slice(0),this._iv=void 0),c.encryptBlock(p,0);for(var x=0;x<h;x++)l[A+x]^=p[x]}});return i.Decryptor=u,i})(),o.mode.OFB})})(Di)),Di.exports}var Fi={exports:{}},x4=Fi.exports,$A;function m4(){return $A||($A=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(x4,function(o){return o.mode.ECB=(function(){var i=o.lib.BlockCipherMode.extend();return i.Encryptor=i.extend({processBlock:function(u,l){this._cipher.encryptBlock(u,l)}}),i.Decryptor=i.extend({processBlock:function(u,l){this._cipher.decryptBlock(u,l)}}),i})(),o.mode.ECB})})(Fi)),Fi.exports}var Ri={exports:{}},g4=Ri.exports,KA;function v4(){return KA||(KA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(g4,function(o){return o.pad.AnsiX923={pad:function(i,u){var l=i.sigBytes,A=u*4,c=A-l%A,h=l+c-1;i.clamp(),i.words[h>>>2]|=c<<24-h%4*8,i.sigBytes+=c},unpad:function(i){var u=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=u}},o.pad.Ansix923})})(Ri)),Ri.exports}var Ti={exports:{}},y4=Ti.exports,YA;function C4(){return YA||(YA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(y4,function(o){return o.pad.Iso10126={pad:function(i,u){var l=u*4,A=l-i.sigBytes%l;i.concat(o.lib.WordArray.random(A-1)).concat(o.lib.WordArray.create([A<<24],1))},unpad:function(i){var u=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=u}},o.pad.Iso10126})})(Ti)),Ti.exports}var Pi={exports:{}},w4=Pi.exports,ZA;function b4(){return ZA||(ZA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(w4,function(o){return o.pad.Iso97971={pad:function(i,u){i.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(i,u)},unpad:function(i){o.pad.ZeroPadding.unpad(i),i.sigBytes--}},o.pad.Iso97971})})(Pi)),Pi.exports}var Ni={exports:{}},E4=Ni.exports,XA;function k4(){return XA||(XA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(E4,function(o){return o.pad.ZeroPadding={pad:function(i,u){var l=u*4;i.clamp(),i.sigBytes+=l-(i.sigBytes%l||l)},unpad:function(i){for(var u=i.words,l=i.sigBytes-1,l=i.sigBytes-1;l>=0;l--)if(u[l>>>2]>>>24-l%4*8&255){i.sigBytes=l+1;break}}},o.pad.ZeroPadding})})(Ni)),Ni.exports}var Ii={exports:{}},S4=Ii.exports,JA;function B4(){return JA||(JA=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(S4,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(Ii)),Ii.exports}var Mi={exports:{}},_4=Mi.exports,eh;function D4(){return eh||(eh=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Rt())})(_4,function(o){return(function(i){var u=o,l=u.lib,A=l.CipherParams,c=u.enc,h=c.Hex,d=u.format;d.Hex={stringify:function(p){return p.ciphertext.toString(h)},parse:function(p){var x=h.parse(p);return A.create({ciphertext:x})}}})(),o.format.Hex})})(Mi)),Mi.exports}var Oi={exports:{}},F4=Oi.exports,th;function R4(){return th||(th=1,(function(r,a){(function(o,i,u){r.exports=i(Le(),Xn(),Jn(),Bn(),Rt())})(F4,function(o){return(function(){var i=o,u=i.lib,l=u.BlockCipher,A=i.algo,c=[],h=[],d=[],p=[],x=[],g=[],w=[],b=[],k=[],v=[];(function(){for(var C=[],B=0;B<256;B++)B<128?C[B]=B<<1:C[B]=B<<1^283;for(var D=0,T=0,B=0;B<256;B++){var I=T^T<<1^T<<2^T<<3^T<<4;I=I>>>8^I&255^99,c[D]=I,h[I]=D;var P=C[D],H=C[P],M=C[H],N=C[I]*257^I*16843008;d[D]=N<<24|N>>>8,p[D]=N<<16|N>>>16,x[D]=N<<8|N>>>24,g[D]=N;var N=M*16843009^H*65537^P*257^D*16843008;w[I]=N<<24|N>>>8,b[I]=N<<16|N>>>16,k[I]=N<<8|N>>>24,v[I]=N,D?(D=P^C[C[C[M^P]]],T^=C[C[T]]):D=T=1}})();var S=[0,1,2,4,8,16,32,64,128,27,54],E=A.AES=l.extend({_doReset:function(){var C;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var B=this._keyPriorReset=this._key,D=B.words,T=B.sigBytes/4,I=this._nRounds=T+6,P=(I+1)*4,H=this._keySchedule=[],M=0;M<P;M++)M<T?H[M]=D[M]:(C=H[M-1],M%T?T>6&&M%T==4&&(C=c[C>>>24]<<24|c[C>>>16&255]<<16|c[C>>>8&255]<<8|c[C&255]):(C=C<<8|C>>>24,C=c[C>>>24]<<24|c[C>>>16&255]<<16|c[C>>>8&255]<<8|c[C&255],C^=S[M/T|0]<<24),H[M]=H[M-T]^C);for(var N=this._invKeySchedule=[],V=0;V<P;V++){var M=P-V;if(V%4)var C=H[M];else var C=H[M-4];V<4||M<=4?N[V]=C:N[V]=w[c[C>>>24]]^b[c[C>>>16&255]]^k[c[C>>>8&255]]^v[c[C&255]]}}},encryptBlock:Line truncated
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
|
||||
• Request Data (remaining bytes) - additional request-specific data`,startByte:c+h,endByte:c+u.length-1,value:g});const w={type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g};return l!=null&&l.includeSegments&&(w.segments=A),w}catch(A){return{type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode request payload"],timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return ka.RequestPayloadDecoder=o,ka}var Sa={},Eh;function Aw(){if(Eh)return Sa;Eh=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.ResponsePayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<4){const b={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),b}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:p}),h+=1;const x=(0,a.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&A.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:c+h,endByte:c+u.length-1,value:g});const w={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(w.segments=A),w}catch(A){return{type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Sa.ResponsePayloadDecoder=o,Sa}var Ba={},kh;function hw(){if(kh)return Ba;kh=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.AnonRequestPayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<35){const b={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),b}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[0]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${d}`,startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.bytesToHex)(u.subarray(1,33));l!=null&&l.includeSegments&&A.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:c+h,endByte:c+h+31,value:p}),h+=32;const x=(0,a.bytesToHex)(u.subarray(33,35));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(35));l!=null&&l.includeSegments&&u.length>35&&A.push({name:"Ciphertext",description:`Encrypted message data (${u.length-35} bytes). Contains encrypted plaintext with this structure:
|
||||
• Timestamp (4 bytes) - send time as unix timestamp
|
||||
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
|
||||
• Password (remaining bytes) - password for repeater/room`,startByte:c+h,endByte:c+u.length-1,value:g});const w={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,senderPublicKey:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-35};return l!=null&&l.includeSegments&&(w.segments=A),w}catch(A){return{type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ba.AnonRequestPayloadDecoder=o,Ba}var _a={},Sh;function pw(){if(Sh)return _a;Sh=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.AckPayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<4){const p={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return l!=null&&l.includeSegments&&(p.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),p}const A=[],c=(l==null?void 0:l.segmentOffset)||0,h=(0,a.bytesToHex)(u.subarray(0,4));l!=null&&l.includeSegments&&A.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${h}`,startByte:c,endByte:c+3,value:h}),l!=null&&l.includeSegments&&u.length>4&&A.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:c+4,endByte:c+u.length-1,value:(0,a.bytesToHex)(u.subarray(4))});const d={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!0,checksum:h};return l!=null&&l.includeSegments&&(d.segments=A),d}catch(A){return{type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:[A instanceof Error?A.message:"Failed to decode Ack payload"],checksum:""}}}}return _a.AckPayloadDecoder=o,_a}var Da={},Bh;function xw(){if(Bh)return Da;Bh=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.PathPayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u){try{if(u.length<2)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const l=u[0];if(u.length<1+l+1)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+l+1} bytes for path length + path + extra type)`],pathLength:l,pathHashes:[],extraType:0,extraData:""};const A=[];for(let d=0;d<l;d++)A.push((0,a.byteToHex)(u[1+d]));const c=u[1+l];let h="";return u.length>1+l+1&&(h=(0,a.bytesToHex)(u.subarray(1+l+1))),{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!0,pathLength:l,pathHashes:A,extraType:c,extraData:h}}catch(l){return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[l instanceof Error?l.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Da.PathPayloadDecoder=o,Da}var Fa={},_h;function mw(){if(_h)return Fa;_h=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.TextMessagePayloadDecoder=void 0;const r=ur(),a=Mt();class o{static decode(u,l){try{if(u.length<4){const b={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return l!=null&&l.includeSegments&&(b.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:l.segmentOffset||0,endByte:(l.segmentOffset||0)+u.length-1,value:(0,a.bytesToHex)(u)}]),b}const A=[],c=(l==null?void 0:l.segmentOffset)||0;let h=0;const d=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:c+h,endByte:c+h,value:d}),h+=1;const p=(0,a.byteToHex)(u[h]);l!=null&&l.includeSegments&&A.push({name:"Source Hash",description:"First byte of source node public key",startByte:c+h,endByte:c+h,value:p}),h+=1;const x=(0,a.bytesToHex)(u.subarray(h,h+2));l!=null&&l.includeSegments&&A.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:c+h,endByte:c+h+1,value:x}),h+=2;const g=(0,a.bytesToHex)(u.subarray(h));l!=null&&l.includeSegments&&u.length>h&&A.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:c+h,endByte:c+u.length-1,value:g});const w={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:d,sourceHash:p,cipherMac:x,ciphertext:g,ciphertextLength:u.length-4};return l!=null&&l.includeSegments&&(w.segments=A),w}catch(A){return{type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,i
Line truncated
|
||||
// SHA256 round constants
|
||||
const K: array<u32, 64> = array<u32, 64>(
|
||||
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
|
||||
0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, 0x72be5d74u, 0x80deb1feu, 0x9bdc06a7u, 0xc19bf174u,
|
||||
0xe49b69c1u, 0xefbe4786u, 0x0fc19dc6u, 0x240ca1ccu, 0x2de92c6fu, 0x4a7484aau, 0x5cb0a9dcu, 0x76f988dau,
|
||||
0x983e5152u, 0xa831c66du, 0xb00327c8u, 0xbf597fc7u, 0xc6e00bf3u, 0xd5a79147u, 0x06ca6351u, 0x14292967u,
|
||||
0x27b70a85u, 0x2e1b2138u, 0x4d2c6dfcu, 0x53380d13u, 0x650a7354u, 0x766a0abbu, 0x81c2c92eu, 0x92722c85u,
|
||||
0xa2bfe8a1u, 0xa81a664bu, 0xc24b8b70u, 0xc76c51a3u, 0xd192e819u, 0xd6990624u, 0xf40e3585u, 0x106aa070u,
|
||||
0x19a4c116u, 0x1e376c08u, 0x2748774cu, 0x34b0bcb5u, 0x391c0cb3u, 0x4ed8aa4au, 0x5b9cca4fu, 0x682e6ff3u,
|
||||
0x748f82eeu, 0x78a5636fu, 0x84c87814u, 0x8cc70208u, 0x90befffau, 0xa4506cebu, 0xbef9a3f7u, 0xc67178f2u
|
||||
);
|
||||
|
||||
// Character lookup table (a-z = 0-25, 0-9 = 26-35, dash = 36)
|
||||
const CHARS: array<u32, 37> = array<u32, 37>(
|
||||
0x61u, 0x62u, 0x63u, 0x64u, 0x65u, 0x66u, 0x67u, 0x68u, 0x69u, 0x6au, // a-j
|
||||
0x6bu, 0x6cu, 0x6du, 0x6eu, 0x6fu, 0x70u, 0x71u, 0x72u, 0x73u, 0x74u, // k-t
|
||||
0x75u, 0x76u, 0x77u, 0x78u, 0x79u, 0x7au, // u-z
|
||||
0x30u, 0x31u, 0x32u, 0x33u, 0x34u, 0x35u, 0x36u, 0x37u, 0x38u, 0x39u, // 0-9
|
||||
0x2du // dash
|
||||
);
|
||||
|
||||
struct Params {
|
||||
target_channel_hash: u32,
|
||||
batch_offset: u32,
|
||||
name_length: u32,
|
||||
batch_size: u32,
|
||||
target_mac: u32, // First 2 bytes of target MAC (in high 16 bits)
|
||||
ciphertext_words: u32, // Number of 32-bit words in ciphertext
|
||||
ciphertext_len_bits: u32, // Length of ciphertext in bits
|
||||
verify_mac: u32, // 1 to verify MAC, 0 to skip
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> params: Params;
|
||||
@group(0) @binding(1) var<storage, read_write> match_count: atomic<u32>;
|
||||
@group(0) @binding(2) var<storage, read_write> match_indices: array<u32>;
|
||||
@group(0) @binding(3) var<storage, read> ciphertext: array<u32>; // Ciphertext data
|
||||
|
||||
fn rotr(x: u32, n: u32) -> u32 {
|
||||
return (x >> n) | (x << (32u - n));
|
||||
}
|
||||
|
||||
fn ch(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (~x & z);
|
||||
}
|
||||
|
||||
fn maj(x: u32, y: u32, z: u32) -> u32 {
|
||||
return (x & y) ^ (x & z) ^ (y & z);
|
||||
}
|
||||
|
||||
fn sigma0(x: u32) -> u32 {
|
||||
return rotr(x, 2u) ^ rotr(x, 13u) ^ rotr(x, 22u);
|
||||
}
|
||||
|
||||
fn sigma1(x: u32) -> u32 {
|
||||
return rotr(x, 6u) ^ rotr(x, 11u) ^ rotr(x, 25u);
|
||||
}
|
||||
|
||||
fn gamma0(x: u32) -> u32 {
|
||||
return rotr(x, 7u) ^ rotr(x, 18u) ^ (x >> 3u);
|
||||
}
|
||||
|
||||
fn gamma1(x: u32) -> u32 {
|
||||
return rotr(x, 17u) ^ rotr(x, 19u) ^ (x >> 10u);
|
||||
}
|
||||
|
||||
// Convert index to room name bytes, returns the hash as a u32 for the first byte check
|
||||
fn index_to_room_name(idx: u32, length: u32, msg: ptr<function, array<u32, 16>>) -> bool {
|
||||
// Message starts with '#' (0x23)
|
||||
var byte_pos = 0u;
|
||||
var word_idx = 0u;
|
||||
var current_word = 0x23000000u; // '#' in big-endian position 0
|
||||
byte_pos = 1u;
|
||||
|
||||
var remaining = idx;
|
||||
var prev_was_dash = false;
|
||||
|
||||
// Generate room name from index
|
||||
for (var i = 0u; i < length; i++) {
|
||||
let char_count = select(37u, 36u, i == 0u || i == length - 1u); // no dash at start/end
|
||||
var char_idx = remaining % char_count;
|
||||
remaining = remaining / char_count;
|
||||
|
||||
// Check for consecutive dashes (invalid)
|
||||
let is_dash = char_idx == 36u && i > 0u && i < length - 1u;
|
||||
if (is_dash && prev_was_dash) {
|
||||
return false; // Invalid: consecutive dashes
|
||||
}
|
||||
prev_was_dash = is_dash;
|
||||
|
||||
// Map char index to actual character
|
||||
let c = CHARS[char_idx];
|
||||
|
||||
// Pack byte into current word (big-endian)
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u && byte_pos > 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0u;
|
||||
}
|
||||
current_word = current_word | (c << shift);
|
||||
byte_pos = byte_pos + 1u;
|
||||
}
|
||||
|
||||
// Add padding: 0x80 followed by zeros, then length in bits
|
||||
let msg_len_bits = (length + 1u) * 8u; // +1 for '#'
|
||||
|
||||
// Add 0x80 padding byte
|
||||
let shift = (3u - byte_pos % 4u) * 8u;
|
||||
if (byte_pos % 4u == 0u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
current_word = 0x80000000u;
|
||||
} else {
|
||||
current_word = current_word | (0x80u << shift);
|
||||
}
|
||||
byte_pos = byte_pos + 1u;
|
||||
|
||||
// Store current word
|
||||
if (byte_pos % 4u == 0u || word_idx < 14u) {
|
||||
(*msg)[word_idx] = current_word;
|
||||
word_idx = word_idx + 1u;
|
||||
}
|
||||
|
||||
// Zero-fill until word 14
|
||||
for (var i = word_idx; i < 14u; i++) {
|
||||
(*msg)[i] = 0u;
|
||||
}
|
||||
|
||||
// Length in bits (64-bit, but we only use lower 32 bits for short messages)
|
||||
(*msg)[14u] = 0u;
|
||||
(*msg)[15u] = msg_len_bits;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
fn sha256_block(msg: ptr<function, array<u32, 16>>) -> array<u32, 8> {
|
||||
// Initialize hash values
|
||||
var h: array<u32, 8> = array<u32, 8>(
|
||||
0x6a09e667u, 0xbb67ae85u, 0x3c6ef372u, 0xa54ff53au,
|
||||
0x510e527fu, 0x9b05688cu, 0x1f83d9abu, 0x5be0cd19u
|
||||
);
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Compute SHA256 of the key (16 bytes) to get channel hash
|
||||
fn sha256_key(key: array<u32, 4>) -> u32 {
|
||||
var msg: array<u32, 16>;
|
||||
|
||||
// Key bytes (16 bytes = 4 words)
|
||||
msg[0] = key[0];
|
||||
msg[1] = key[1];
|
||||
msg[2] = key[2];
|
||||
msg[3] = key[3];
|
||||
|
||||
// Padding: 0x80 followed by zeros
|
||||
msg[4] = 0x80000000u;
|
||||
for (var i = 5u; i < 14u; i++) {
|
||||
msg[i] = 0u;
|
||||
}
|
||||
|
||||
// Length: 128 bits
|
||||
msg[14] = 0u;
|
||||
msg[15] = 128u;
|
||||
|
||||
let hash = sha256_block(&msg);
|
||||
|
||||
// Return first byte of hash (big-endian)
|
||||
return hash[0] >> 24u;
|
||||
}
|
||||
|
||||
// HMAC-SHA256 for MAC verification
|
||||
// Key is 16 bytes (4 words), padded to 32 bytes with zeros for MeshCore
|
||||
// Returns first 2 bytes of HMAC (as u32 in high 16 bits)
|
||||
fn hmac_sha256_mac(key: array<u32, 4>, ciphertext_len: u32) -> u32 {
|
||||
// HMAC: H((K' ^ opad) || H((K' ^ ipad) || message))
|
||||
// K' is 64 bytes (32 bytes key + 32 bytes zero padding for MeshCore, then padded to 64)
|
||||
// ipad = 0x36 repeated, opad = 0x5c repeated
|
||||
|
||||
// Build padded key (64 bytes = 16 words)
|
||||
// MeshCore uses 32-byte secret: 16-byte key + 16 zero bytes
|
||||
var k_pad: array<u32, 16>;
|
||||
k_pad[0] = key[0];
|
||||
k_pad[1] = key[1];
|
||||
k_pad[2] = key[2];
|
||||
k_pad[3] = key[3];
|
||||
for (var i = 4u; i < 16u; i++) {
|
||||
k_pad[i] = 0u;
|
||||
}
|
||||
|
||||
// Inner hash: SHA256((K' ^ ipad) || message)
|
||||
// First block: K' ^ ipad (64 bytes)
|
||||
var inner_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
inner_block[i] = k_pad[i] ^ 0x36363636u;
|
||||
}
|
||||
|
||||
// Initialize hash state with first block
|
||||
var h: array<u32, 8> = sha256_block(&inner_block);
|
||||
|
||||
// Process ciphertext blocks (continuing from h state)
|
||||
let ciphertext_words = params.ciphertext_words;
|
||||
var word_idx = 0u;
|
||||
|
||||
// Process full 64-byte blocks of ciphertext
|
||||
while (word_idx + 16u <= ciphertext_words) {
|
||||
var block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
block[i] = ciphertext[word_idx + i];
|
||||
}
|
||||
h = sha256_block_continue(&block, h);
|
||||
word_idx = word_idx + 16u;
|
||||
}
|
||||
|
||||
// Final block with remaining ciphertext + padding
|
||||
var final_block: array<u32, 16>;
|
||||
var remaining = ciphertext_words - word_idx;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
if (i < remaining) {
|
||||
final_block[i] = ciphertext[word_idx + i];
|
||||
} else if (i == remaining) {
|
||||
// Add 0x80 padding
|
||||
final_block[i] = 0x80000000u;
|
||||
} else {
|
||||
final_block[i] = 0u;
|
||||
}
|
||||
}
|
||||
|
||||
// Add length (64 bytes of ipad + ciphertext length)
|
||||
let total_bits = 512u + params.ciphertext_len_bits;
|
||||
if (remaining < 14u) {
|
||||
final_block[14] = 0u;
|
||||
final_block[15] = total_bits;
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
} else {
|
||||
// Need extra block for length
|
||||
h = sha256_block_continue(&final_block, h);
|
||||
var len_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 14u; i++) {
|
||||
len_block[i] = 0u;
|
||||
}
|
||||
len_block[14] = 0u;
|
||||
len_block[15] = total_bits;
|
||||
h = sha256_block_continue(&len_block, h);
|
||||
}
|
||||
|
||||
let inner_hash = h;
|
||||
|
||||
// Outer hash: SHA256((K' ^ opad) || inner_hash)
|
||||
var outer_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
outer_block[i] = k_pad[i] ^ 0x5c5c5c5cu;
|
||||
}
|
||||
h = sha256_block(&outer_block);
|
||||
|
||||
// Second block: inner_hash (32 bytes) + padding
|
||||
var hash_block: array<u32, 16>;
|
||||
for (var i = 0u; i < 8u; i++) {
|
||||
hash_block[i] = inner_hash[i];
|
||||
}
|
||||
hash_block[8] = 0x80000000u;
|
||||
for (var i = 9u; i < 14u; i++) {
|
||||
hash_block[i] = 0u;
|
||||
}
|
||||
hash_block[14] = 0u;
|
||||
hash_block[15] = 512u + 256u; // 64 bytes opad + 32 bytes inner hash
|
||||
|
||||
h = sha256_block_continue(&hash_block, h);
|
||||
|
||||
// Return first 2 bytes (high 16 bits of first word)
|
||||
return h[0] & 0xFFFF0000u;
|
||||
}
|
||||
|
||||
// SHA256 block computation continuing from existing state
|
||||
fn sha256_block_continue(msg: ptr<function, array<u32, 16>>, h_in: array<u32, 8>) -> array<u32, 8> {
|
||||
var h = h_in;
|
||||
|
||||
// Message schedule
|
||||
var w: array<u32, 64>;
|
||||
for (var i = 0u; i < 16u; i++) {
|
||||
w[i] = (*msg)[i];
|
||||
}
|
||||
for (var i = 16u; i < 64u; i++) {
|
||||
w[i] = gamma1(w[i-2u]) + w[i-7u] + gamma0(w[i-15u]) + w[i-16u];
|
||||
}
|
||||
|
||||
// Compression
|
||||
var a = h[0]; var b = h[1]; var c = h[2]; var d = h[3];
|
||||
var e = h[4]; var f = h[5]; var g = h[6]; var hh = h[7];
|
||||
|
||||
for (var i = 0u; i < 64u; i++) {
|
||||
let t1 = hh + sigma1(e) + ch(e, f, g) + K[i] + w[i];
|
||||
let t2 = sigma0(a) + maj(a, b, c);
|
||||
hh = g; g = f; f = e; e = d + t1;
|
||||
d = c; c = b; b = a; a = t1 + t2;
|
||||
}
|
||||
|
||||
h[0] = h[0] + a; h[1] = h[1] + b; h[2] = h[2] + c; h[3] = h[3] + d;
|
||||
h[4] = h[4] + e; h[5] = h[5] + f; h[6] = h[6] + g; h[7] = h[7] + hh;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
// Process a single candidate and record match if found
|
||||
fn process_candidate(name_idx: u32) {
|
||||
// Generate message for this room name
|
||||
var msg: array<u32, 16>;
|
||||
let valid = index_to_room_name(name_idx, params.name_length, &msg);
|
||||
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute SHA256("#roomname") - this gives us the key
|
||||
let key_hash = sha256_block(&msg);
|
||||
|
||||
// Take first 16 bytes (4 words) as the key
|
||||
var key: array<u32, 4>;
|
||||
key[0] = key_hash[0];
|
||||
key[1] = key_hash[1];
|
||||
key[2] = key_hash[2];
|
||||
key[3] = key_hash[3];
|
||||
|
||||
// Compute SHA256(key) to get channel hash
|
||||
let channel_hash = sha256_key(key);
|
||||
|
||||
// Check if channel hash matches target
|
||||
if (channel_hash != params.target_channel_hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Channel hash matches - verify MAC if enabled
|
||||
if (params.verify_mac == 1u) {
|
||||
let computed_mac = hmac_sha256_mac(key, params.ciphertext_len_bits);
|
||||
if (computed_mac != params.target_mac) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Found a match - record the index
|
||||
let match_idx = atomicAdd(&match_count, 1u);
|
||||
if (match_idx < 1024u) { // Limit stored matches
|
||||
match_indices[match_idx] = name_idx;
|
||||
}
|
||||
}
|
||||
|
||||
// Each thread processes 16 candidates to amortize thread overhead
|
||||
const CANDIDATES_PER_THREAD: u32 = 16u;
|
||||
|
||||
@compute @workgroup_size(256)
|
||||
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
|
||||
let base_idx = global_id.x * CANDIDATES_PER_THREAD;
|
||||
|
||||
for (var i = 0u; i < CANDIDATES_PER_THREAD; i++) {
|
||||
let idx = base_idx + i;
|
||||
if (idx >= params.batch_size) {
|
||||
return;
|
||||
}
|
||||
let name_idx = params.batch_offset + idx;
|
||||
process_candidate(name_idx);
|
||||
}
|
||||
}
|
||||
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const a=await navigator.gpu.requestAdapter();if(!a)return console.warn("No GPU adapter found"),!1;this.device=await a.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let u=0;u<2;u++)this.matchCountReadBuffers[u]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[u]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),i=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:i,compute:{module:o,entryPoint:"main"}}),!0}catch(a){return console.error("WebGPU initialization failed:",a),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(a,o){return $n(o,a)}countNamesForLength(a){return Na(a)}async runBatch(a,o,i,u,l,A){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const c=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const h=this.matchCountReadBuffers[c],d=this.matchIndicesReadBuffers[c],p=l&&A?1:0;let x,g=0,w=0;if(p){const D=new Uint8Array(l.length/2);for(let M=0;M<D.length;M++)D[M]=parseInt(l.substr(M*2,2),16);g=D.length*8;const T=Math.ceil(D.length/4)*4,I=new Uint8Array(T);I.set(D),x=new Uint32Array(T/4);for(let M=0;M<x.length;M++)x[M]=I[M*4]<<24|I[M*4+1]<<16|I[M*4+2]<<8|I[M*4+3];const P=parseInt(A.substr(0,2),16),H=parseInt(A.substr(2,2),16);w=P<<24|H<<16}else x=new Uint32Array([0]);const b=Math.max(x.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<b)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:b,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=b,this.bindGroupDirty=!0);const k=new Uint32Array([a,i,o,u,w,x.length,g,p]);this.device.queue.writeBuffer(this.paramsBuffer,0,k),this.device.queue.writeBuffer(this.ciphertextBuffer,0,x),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(),S=v.beginComputePass();S.setPipeline(this.pipeline),S.setBindGroup(0,this.bindGroup),S.dispatchWorkgroups(Math.ceil(u/(256*16))),S.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 C=new Uint32Array(h.getMappedRange())[0];h.unmap();const B=[];if(C>0){await d.mapAsync(GPUMapMode.READ);const D=new Uint32Array(d.getMappedRange());for(let T=0;T<Math.min(C,1024);T++)B.push(D[T]);d.unmap()}return B}destroy(){var a,o,i,u,l,A,c,h;(a=this.paramsBuffer)==null||a.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(i=this.matchIndicesBuffer)==null||i.destroy(),(u=this.ciphertextBuffer)==null||u.destroy(),(l=this.matchCountReadBuffers[0])==null||l.destroy(),(A=this.matchCountReadBuffers[1])==null||A.destroy(),(c=this.matchIndicesReadBuffers[0])==null||c.destroy(),(h=this.matchIndicesReadBuffers[1])==null||h.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}hl.ZERO_DATA=new Uint32Array([0]);function Rw(){return typeof navigator<"u"&&"gpu"in navigator}class jh{runBatch(a,o,i,u,l,A){const c=[],h=a.toString(16).padStart(2,"0")
Line truncated
|
||||
`).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);this.wordlist=u.filter(Hh)}setWordlist(a){this.wordlist=a.map(o=>o.trim().toLowerCase()).filter(Hh)}abort(){this.abortFlag=!0}isGpuAvailable(){return Rw()}async decodePacket(a){var i;const o=a.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const l=(i=(await Ih.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:i.decoded;return!(l!=null&&l.channelHash)||!(l!=null&&l.ciphertext)||!(l!=null&&l.cipherMac)?null:{channelHash:l.channelHash,ciphertext:l.ciphertext,cipherMac:l.cipherMac,isGroupText:!0}}catch{return null}}async crack(a,o,i){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)??Ru,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const u=(o==null?void 0:o.maxLength)??8,l=(o==null?void 0:o.startingLength)??1,A=(o==null?void 0:o.useDictionary)??!0,c=await this.decodePacket(a);if(!c)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:h,ciphertext:d,cipherMac:p}=c,x=parseInt(h,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new jh):this.gpuInstance||(this.gpuInstance=new hl,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new jh));const g=performance.now();let w=0,b=performance.now(),k=l,v=0;if(o!=null&&o.startFrom){const H=_w(o.startFrom);H&&(k=Math.max(l,H.length),v=H.index+1,v>=Na(k)&&(k++,v=0))}let S=0;for(let H=k;H<=u;H++)S+=Na(H);S-=v;const E=(H,M,N)=>{if(!i)return;const Q=(performance.now()-g)/1e3,X=Q>0?Math.round(w/Q):0,ae=S-w,J=X>0?ae/X:0;i({checked:w,total:S,percent:S>0?Math.min(100,w/S*100):0,rateKeysPerSec:X,etaSeconds:J,elapsedSeconds:Q,currentLength:M,currentPosition:N,phase:H})},C=H=>{if(!Zx(d,p,H))return{valid:!1};const M=Ih.ChannelCrypto.decryptGroupTextMessage(d,p,H);return!M.success||!M.data?{valid:!1}:this.useTimestampFilter&&!Dw(M.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!Fw(M.data.message)?{valid:!1}:{valid:!0,message:M.data.message}};if(k===1&&v===0){E("public-key",0,Fu);const H=Pu(Qi);if(h===H){const M=C(Qi);if(M.valid)return{found:!0,roomName:Fu,key:Qi,decryptedMessage:M.message}}}if(A&&this.wordlist.length>0&&k===1&&v===0)for(let H=0;H<this.wordlist.length;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[H]};const M=this.wordlist[H],N=Tu("#"+M),V=Pu(N);if(parseInt(V,16)===x){const X=C(N);if(X.valid)return{found:!0,roomName:M,key:N,decryptedMessage:X.message}}const Q=performance.now();Q-b>=200&&(E("wordlist",M.length,M),b=Q,await new Promise(X=>setTimeout(X,0)))}const B=this.useCpu?1024:32768,D=1e3;let T=B,I=!1;for(let H=k;H<=u;H++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(H,0)||void 0};const M=Na(H);let N=H===k?v:0;for(;N<M;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:$n(H,N)||void 0};const V=Math.min(T,M-N),Q=performance.now();let X;this.useCpu?X=this.cpuInstance.runBatch(x,H,N,V,d,p):X=await this.gpuInstance.runBatch(x,H,N,V,d,p);const ae=performance.now()-Q;if(w+=V,!this.useCpu&&!I&&V>=B&&ae>0){const re=D/ae,q=Math.round(V*re),oe=Math.pow(2,Math.round(Math.log2(Math.max(B,q))));T=Math.max(B,oe),I=!0}for(const re of X){const q=$n(H,re);if(!q)continue;const oe=Tu("#"+q),ee=C(oe);if(ee.valid)return{found:!0,roomName:q,key:oe,decryptedMessage:ee.message}}N+=V;const J=performance.now();if(J-b>=200){const re=$n(H,Math.min(N,M-1))||"";E("bruteforce",H,re),b=J,await new Promise(q=>setTimeout(q,0))}}}return{found:!1,resumeFrom:$n(u,Na(u)-1)||void 0}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var mu,Lh;function Mw(){return Lh||(Lh=1,mu={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQ
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(){i()?(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 gu=u,gu}var jw=Ow();const Hw=Po(jw);function Lw({packets:r,channels:a,onChannelCreate:o,onRunningChange:i}){const[u,l]=F.useState(!1),[A,c]=F.useState(6),[h,d]=F.useState(!1),[p,x]=F.useState(null),[g,w]=F.useState(new Map),[b,k]=F.useState([]),[v,S]=F.useState(!1),[E,C]=F.useState(null),B=F.useRef(null),D=F.useRef(null),T=F.useRef(!1),I=F.useRef(!1),P=F.useRef(!1),H=F.useRef(new Map),M=F.useRef(!1),N=F.useRef(6),V=F.useRef(new Set);F.useEffect(()=>{const y=new Iw;B.current=y,C(y.isGpuAvailable());const j=new Hw;return D.current=j,y.loadWordlist("/words_alpha.txt").then(()=>S(!0)).catch(L=>console.error("Failed to load wordlist:",L)),()=>{y.destroy(),B.current=null,j.disable(),D.current=null}},[]);const Q=new Set(a.map(y=>y.key.toUpperCase())),X=r.filter(y=>y.payload_type==="GROUP_TEXT"&&!y.decrypted);F.useEffect(()=>{w(y=>{const j=new Map(y);let L=!1;for(const W of X)j.has(W.id)||(j.set(W.id,{packet:W,attempts:0,lastAttemptLength:0,status:"pending"}),L=!0);return L?(H.current=j,j):y})},[X.length]),F.useEffect(()=>{H.current=g},[g]),F.useEffect(()=>{M.current=h},[h]),F.useEffect(()=>{N.current=A},[A]),F.useEffect(()=>{V.current=new Set(X.map(y=>y.id))},[X]),F.useEffect(()=>{i==null||i(u)},[u,i]);const ae=Array.from(g.values()).filter(y=>y.status==="pending").length,J=Array.from(g.values()).filter(y=>y.status==="cracked").length,re=Array.from(g.values()).filter(y=>y.status==="failed").length,q=F.useCallback(async()=>{if(P.current||!B.current||!T.current)return;const y=H.current;let j=null,L=null;for(const[le,ce]of y.entries())if(ce.status==="pending"){j=ce,L=le;break}if(!j&&M.current){const le=Array.from(y.entries()).filter(([,ce])=>ce.status==="failed"&&ce.lastAttemptLength<10);le.length>0&&(le.sort((ce,te)=>ce[1].lastAttemptLength-te[1].lastAttemptLength),[L,j]=le[0])}if(!j||L===null){T.current&&setTimeout(()=>q(),1e3);return}if(!V.current.has(L)){w(le=>{const ce=new Map(le);return ce.delete(L),ce}),T.current&&setTimeout(()=>q(),10);return}P.current=!0;const W=N.current,ue=j.lastAttemptLength>0?j.lastAttemptLength+1:W;try{const le=await B.current.crack(j.packet.data,{maxLength:ue,useTimestampFilter:!0,useUtf8Filter:!0},ce=>{x(ce)});if(I.current){I.current=!1,P.current=!1,x(null);return}if(le.found&&le.roomName&&le.key){w(me=>{const Ne=new Map(me),$e=Ne.get(L);return $e&&Ne.set(L,{...$e,status:"cracked",attempts:$e.attempts+1,lastAttemptLength:ue}),Ne});const ce={roomName:le.roomName,key:le.key,packetId:L,message:le.decryptedMessage||"",crackedAt:Date.now()};k(me=>[...me,ce]);const te=le.key.toUpperCase();if(!Q.has(te))try{const me="#"+le.roomName;await o(me,le.key),await Ye.decryptHistoricalPackets({key_type:"channel",channel_name:me})}catch(me){console.error("Failed to create channel or decrypt historical:",me)}}else w(ce=>{const te=new Map(ce),me=te.get(L);return me&&te.set(L,{...me,status:"failed",attempts:me.attempts+1,lastAttemptLength:ue}),te})}catch(le){console.error("Cracking error:",le),w(ce=>{const te=new Map(ce),me=te.get(L);return me&&te.set(L,{...me,status:"failed",attempts:me.attempts+1,lastAttemptLength:ue}),te})}P.current=!1,x(null),T.current&&setTimeout(()=>q(),100)},[Q,o]),oe=()=>{var y;if(!E){alert("WebGPU is not available in your browser. Please use Chrome 113+ or Edge 113+.");return}l(!0),T.current=!0,I.current=!1,(y=D.current)==null||y.enable(),q()},ee=()=>{var y,j;l(!1),T.current=!1,I.current=!0,(y=B.current)==null||y.abort(),(j=D.current)==null||j.disable()};return R.jsxs("div",{className:"flex flex-col h-full p-3 gap-3 bg-background border-t border-border",children:[R.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[R.jsx("button",{onClick:u?ee:oe,disabled:!v||E===!1,className:qe("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"}),R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("label",{className:"text-sm text-muted-foreground",children:"Max Length:"}),R.jsx("input",{type:"number",min:1,max:10,value:A,onChange:y=>c(Math.min(10,Math.max(1,parseInt(y.target.value)||6))),className:"w-14 px-2 py-1 text-sm bg-muted border border-border rounded"})]}),R.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[R.jsx("input",{type:"checkbox",checked:h,onChange:y=>d(y.target.checked),className:"rounded"}),"Retry failed at n+1"]})]}),R.jsxs("div",{className:"flex gap-4 text-sm",children:[R.jsxs("span",{className:"text-muted-foreground",children:["Pending: ",R.jsx("span",{className:"text-foreground font-medium",children:ae})]}),R.jsxs("span",{className:"text-muted-foreground",children:["Cracked: ",R.jsx("span",{className:"text-green-500 font-medium",children:J})]}),R.jsxs("span",{clas
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-BDNiwXbx.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-Bl6mT-Tv.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-RWG6EjFU.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { GroupTextCracker, type ProgressReport } from 'meshcore-hashtag-cracker';
|
||||
import NoSleep from 'nosleep.js';
|
||||
import type { RawPacket, Channel } from '../types';
|
||||
import { api } from '../api';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface CrackedRoom {
|
||||
@@ -44,6 +45,7 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
const queueRef = useRef<Map<number, QueueItem>>(new Map());
|
||||
const retryFailedRef = useRef(false);
|
||||
const maxLengthRef = useRef(6);
|
||||
const undecryptedIdsRef = useRef<Set<number>>(new Set());
|
||||
|
||||
// Initialize cracker and NoSleep
|
||||
useEffect(() => {
|
||||
@@ -114,6 +116,11 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
maxLengthRef.current = maxLength;
|
||||
}, [maxLength]);
|
||||
|
||||
// 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));
|
||||
}, [undecryptedGroupText]);
|
||||
|
||||
// Notify parent of running state changes
|
||||
useEffect(() => {
|
||||
onRunningChange?.(isRunning);
|
||||
@@ -164,6 +171,21 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if this packet is still undecrypted - it may have been decrypted
|
||||
// by historical decrypt when we cracked another packet from the same channel
|
||||
if (!undecryptedIdsRef.current.has(nextId)) {
|
||||
// Already decrypted by other means, remove from queue and continue
|
||||
setQueue(prev => {
|
||||
const updated = new Map(prev);
|
||||
updated.delete(nextId);
|
||||
return updated;
|
||||
});
|
||||
if (isRunningRef.current) {
|
||||
setTimeout(() => processNext(), 10);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Lock processing
|
||||
isProcessingRef.current = true;
|
||||
|
||||
@@ -221,9 +243,13 @@ export function CrackerPanel({ packets, channels, onChannelCreate, onRunningChan
|
||||
const keyUpper = result.key.toUpperCase();
|
||||
if (!existingChannelKeys.has(keyUpper)) {
|
||||
try {
|
||||
await onChannelCreate('#' + result.roomName, result.key);
|
||||
const channelName = '#' + result.roomName;
|
||||
await onChannelCreate(channelName, result.key);
|
||||
// Decrypt any other historical packets with this newly discovered key
|
||||
// This prevents wasting cracking cycles on packets from the same channel
|
||||
await api.decryptHistoricalPackets({ key_type: 'channel', channel_name: channelName });
|
||||
} catch (err) {
|
||||
console.error('Failed to create channel:', err);
|
||||
console.error('Failed to create channel or decrypt historical:', err);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user