levix-bot 4.6.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/app.cjs +32 -7
- package/package.json +2 -2
- package/public/dashboard/assets/index-B8E5IYlB.js +540 -0
- package/public/dashboard/assets/index-C5D4wzm4.css +2 -0
- package/public/dashboard/index.html +4 -3
- package/public/dashboard.css +152 -53
- package/public/gateway-i18n.js +295 -0
- package/public/gateway.js +30 -1
- package/public/ui-boot.js +71 -0
- package/src/bootstrap/core.js +9 -0
- package/src/commands/md.cjs +44 -0
- package/src/config/defaults.cjs +1 -0
- package/src/core/socket.js +23 -0
- package/src/db/store.cjs +8 -0
- package/src/diagnostics/crashReports.cjs +491 -0
- package/src/diagnostics/device.cjs +119 -0
- package/src/diagnostics/sanitize.cjs +90 -0
- package/src/handlers/command.handler.js +2 -1
- package/src/index.js +9 -1
- package/src/panel/feedback.cjs +13 -1
- package/src/routes/dashboard.api.esm.js +186 -15
- package/src/services/autoDelete.cjs +3 -1
- package/src/utils/logger.cjs +88 -34
- package/src/utils/markdownParser.cjs +208 -136
- package/src/utils/storage.cjs +1 -0
- package/src/utils/storage.esm.js +1 -0
- package/views/dashboard.ejs +2 -1
- package/views/login.ejs +102 -71
- package/views/qr.ejs +59 -30
- package/views/setup.ejs +34 -30
- package/public/dashboard/assets/index-Con1xdhN.js +0 -515
- package/public/dashboard/assets/index-De78KNvv.css +0 -2
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function gh(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var rf={exports:{}},Ji={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ey;function PS(){if(ey)return Ji;ey=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(o,d,f){var h=null;if(f!==void 0&&(h=""+f),d.key!==void 0&&(h=""+d.key),"key"in d){f={};for(var g in d)g!=="key"&&(f[g]=d[g])}else f=d;return d=f.ref,{$$typeof:a,type:o,key:h,ref:d!==void 0?d:null,props:f}}return Ji.Fragment=i,Ji.jsx=r,Ji.jsxs=r,Ji}var ty;function GS(){return ty||(ty=1,rf.exports=PS()),rf.exports}var s=GS(),of={exports:{}},Ue={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ny;function VS(){if(ny)return Ue;ny=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),k=Symbol.for("react.view_transition"),E=Symbol.iterator;function _(w){return w===null||typeof w!="object"?null:(w=E&&w[E]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,T={};function D(w,z,de){this.props=w,this.context=z,this.refs=T,this.updater=de||N}D.prototype.isReactComponent={},D.prototype.setState=function(w,z){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,z,"setState")},D.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function Z(){}Z.prototype=D.prototype;function ne(w,z,de){this.props=w,this.context=z,this.refs=T,this.updater=de||N}var pe=ne.prototype=new Z;pe.constructor=ne,j(pe,D.prototype),pe.isPureReactComponent=!0;var I=Array.isArray;function M(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function G(w,z,de){var ue=de.ref;return{$$typeof:a,type:w,key:z,ref:ue!==void 0?ue:null,props:de}}function q(w,z){return G(w.type,z,w.props)}function W(w){return typeof w=="object"&&w!==null&&w.$$typeof===a}function ie(w){var z={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(de){return z[de]})}var ae=/\/+/g;function Q(w,z){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):z.toString(36)}function V(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(M,M):(w.status="pending",w.then(function(z){w.status==="pending"&&(w.status="fulfilled",w.value=z)},function(z){w.status==="pending"&&(w.status="rejected",w.reason=z)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function le(w,z,de,ue,ee){var me=typeof w;(me==="undefined"||me==="boolean")&&(w=null);var te=!1;if(w===null)te=!0;else switch(me){case"bigint":case"string":case"number":te=!0;break;case"object":switch(w.$$typeof){case a:case i:te=!0;break;case b:return te=w._init,le(te(w._payload),z,de,ue,ee)}}if(te)return ee=ee(w),te=ue===""?"."+Q(w,0):ue,I(ee)?(de="",te!=null&&(de=te.replace(ae,"$&/")+"/"),le(ee,z,de,"",function(Te){return Te})):ee!=null&&(W(ee)&&(ee=q(ee,de+(ee.key==null||w&&w.key===ee.key?"":(""+ee.key).replace(ae,"$&/")+"/")+te)),z.push(ee)),1;te=0;var U=ue===""?".":ue+":";if(I(w))for(var fe=0;fe<w.length;fe++)ue=w[fe],me=U+Q(ue,fe),te+=le(ue,z,de,me,ee);else if(fe=_(w),typeof fe=="function")for(w=fe.call(w),fe=0;!(ue=w.next()).done;)ue=ue.value,me=U+Q(ue,fe++),te+=le(ue,z,de,me,ee);else if(me==="object"){if(typeof w.then=="function")return le(V(w),z,de,ue,ee);throw z=String(w),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return te}function he(w,z,de){if(w==null)return w;var ue=[],ee=0;return le(w,ue,"","",function(me){return z.call(de,me,ee++)}),ue}function ve(w){if(w._status===-1){var z=w._result,de=z();de.then(function(ue){(w._status===0||w._status===-1)&&(w._status=1,w._result=ue,de.status===void 0&&(de.status="fulfilled",de.value=ue))},function(ue){(w._status===0||w._status===-1)&&(w._status=2,w._result=ue,de.status===void 0&&(de.status="rejected",de.reason=ue))}),w._status===-1&&(w._status=0,w._result=de)}if(w._status===1)return w._result.default;throw w._result}var K=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function X(w){var z=A.T,de={};de.types=z!==null?z.types:null,A.T=de;try{var ue=w(),ee=A.S;ee!==null&&ee(de,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(M,K)}catch(me){K(me)}finally{z!==null&&de.types!==null&&(z.types=de.types),A.T=z}}function xe(w){var z=A.T;if(z!==null){var de=z.types;de===null?z.types=[w]:de.indexOf(w)===-1&&de.push(w)}else X(xe.bind(null,w))}var ke={map:he,forEach:function(w,z,de){he(w,function(){z.apply(this,arguments)},de)},count:function(w){var z=0;return he(w,function(){z++}),z},toArray:function(w){return he(w,function(z){return z})||[]},only:function(w){if(!W(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Ue.Activity=y,Ue.Children=ke,Ue.Component=D,Ue.Fragment=r,Ue.Profiler=d,Ue.PureComponent=ne,Ue.StrictMode=o,Ue.Suspense=p,Ue.ViewTransition=k,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(w){return A.H.useMemoCache(w)}},Ue.addTransitionType=xe,Ue.cache=function(w){return function(){return w.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(w,z,de){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var ue=j({},w.props),ee=w.key;if(z!=null)for(me in z.key!==void 0&&(ee=""+z.key),z)!P.call(z,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&z.ref===void 0||(ue[me]=z[me]);var me=arguments.length-2;if(me===1)ue.children=de;else if(1<me){for(var te=Array(me),U=0;U<me;U++)te[U]=arguments[U+2];ue.children=te}return G(w.type,ee,ue)},Ue.createContext=function(w){return w={$$typeof:h,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:f,_context:w},w},Ue.createElement=function(w,z,de){var ue,ee={},me=null;if(z!=null)for(ue in z.key!==void 0&&(me=""+z.key),z)P.call(z,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ee[ue]=z[ue]);var te=arguments.length-2;if(te===1)ee.children=de;else if(1<te){for(var U=Array(te),fe=0;fe<te;fe++)U[fe]=arguments[fe+2];ee.children=U}if(w&&w.defaultProps)for(ue in te=w.defaultProps,te)ee[ue]===void 0&&(ee[ue]=te[ue]);return G(w,me,ee)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(w){return{$$typeof:g,render:w}},Ue.isValidElement=W,Ue.lazy=function(w){return{$$typeof:b,_payload:{_status:-1,_result:w},_init:ve}},Ue.memo=function(w,z){return{$$typeof:x,type:w,compare:z===void 0?null:z}},Ue.startTransition=X,Ue.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ue.use=function(w){return A.H.use(w)},Ue.useActionState=function(w,z,de){return A.H.useActionState(w,z,de)},Ue.useCallback=function(w,z){return A.H.useCallback(w,z)},Ue.useContext=function(w){return A.H.useContext(w)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(w,z){return A.H.useDeferredValue(w,z)},Ue.useEffect=function(w,z){return A.H.useEffect(w,z)},Ue.useEffectEvent=function(w){return A.H.useEffectEvent(w)},Ue.useId=function(){return A.H.useId()},Ue.useImperativeHandle=function(w,z,de){return A.H.useImperativeHandle(w,z,de)},Ue.useInsertionEffect=function(w,z){return A.H.useInsertionEffect(w,z)},Ue.useLayoutEffect=function(w,z){return A.H.useLayoutEffect(w,z)},Ue.useMemo=function(w,z){return A.H.useMemo(w,z)},Ue.useOptimistic=function(w,z){return A.H.useOptimistic(w,z)},Ue.useReducer=function(w,z,de){return A.H.useReducer(w,z,de)},Ue.useRef=function(w){return A.H.useRef(w)},Ue.useState=function(w){return A.H.useState(w)},Ue.useSyncExternalStore=function(w,z,de){return A.H.useSyncExternalStore(w,z,de)},Ue.useTransition=function(){return A.H.useTransition()},Ue.version="19.3.0",Ue}var ay;function xh(){return ay||(ay=1,of.exports=VS()),of.exports}var v=xh();const YS=gh(v);var cf={exports:{}},$i={},uf={exports:{}},df={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var ly;function IS(){return ly||(ly=1,(function(a){function i(V,le){var he=V.length;V.push(le);e:for(;0<he;){var ve=he-1>>>1,K=V[ve];if(0<d(K,le))V[ve]=le,V[he]=K,he=ve;else break e}}function r(V){return V.length===0?null:V[0]}function o(V){if(V.length===0)return null;var le=V[0],he=V.pop();if(he!==le){V[0]=he;e:for(var ve=0,K=V.length,X=K>>>1;ve<X;){var xe=2*(ve+1)-1,ke=V[xe],w=xe+1,z=V[w];if(0>d(ke,he))w<K&&0>d(z,ke)?(V[ve]=z,V[w]=he,ve=w):(V[ve]=ke,V[xe]=he,ve=xe);else if(w<K&&0>d(z,he))V[ve]=z,V[w]=he,ve=w;else break e}}return le}function d(V,le){var he=V.sortIndex-le.sortIndex;return he!==0?he:V.id-le.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,g=h.now();a.unstable_now=function(){return h.now()-g}}var p=[],x=[],b=1,y=null,k=3,E=!1,_=!1,N=!1,j=!1,T=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function ne(V){for(var le=r(x);le!==null;){if(le.callback===null)o(x);else if(le.startTime<=V)o(x),le.sortIndex=le.expirationTime,i(p,le);else break;le=r(x)}}function pe(V){if(N=!1,ne(V),!_)if(r(p)!==null)_=!0,I||(I=!0,W());else{var le=r(x);le!==null&&Q(pe,le.startTime-V)}}var I=!1,M=-1,A=5,P=-1;function G(){return j?!0:!(a.unstable_now()-P<A)}function q(){if(j=!1,I){var V=a.unstable_now();P=V;var le=!0;try{e:{_=!1,N&&(N=!1,D(M),M=-1),E=!0;var he=k;try{t:{for(ne(V),y=r(p);y!==null&&!(y.expirationTime>V&&G());){var ve=y.callback;if(typeof ve=="function"){y.callback=null,k=y.priorityLevel;var K=ve(y.expirationTime<=V);if(V=a.unstable_now(),typeof K=="function"){y.callback=K,ne(V),le=!0;break t}y===r(p)&&o(p),ne(V)}else o(p);y=r(p)}if(y!==null)le=!0;else{var X=r(x);X!==null&&Q(pe,X.startTime-V),le=!1}}break e}finally{y=null,k=he,E=!1}le=void 0}}finally{le?W():I=!1}}}var W;if(typeof Z=="function")W=function(){Z(q)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=q,W=function(){ae.postMessage(null)}}else W=function(){T(q,0)};function Q(V,le){M=T(function(){V(a.unstable_now())},le)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(V){V.callback=null},a.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<V?Math.floor(1e3/V):5},a.unstable_getCurrentPriorityLevel=function(){return k},a.unstable_next=function(V){switch(k){case 1:case 2:case 3:var le=3;break;default:le=k}var he=k;k=le;try{return V()}finally{k=he}},a.unstable_requestPaint=function(){j=!0},a.unstable_runWithPriority=function(V,le){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var he=k;k=V;try{return le()}finally{k=he}},a.unstable_scheduleCallback=function(V,le,he){var ve=a.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?ve+he:ve):he=ve,V){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=he+K,V={id:b++,callback:le,priorityLevel:V,startTime:he,expirationTime:K,sortIndex:-1},he>ve?(V.sortIndex=he,i(x,V),r(p)===null&&V===r(x)&&(N?(D(M),M=-1):N=!0,Q(pe,he-ve))):(V.sortIndex=K,i(p,V),_||E||(_=!0,I||(I=!0,W()))),V},a.unstable_shouldYield=G,a.unstable_wrapCallback=function(V){var le=k;return function(){var he=k;k=le;try{return V.apply(this,arguments)}finally{k=he}}}})(df)),df}var sy;function KS(){return sy||(sy=1,uf.exports=IS()),uf.exports}var ff={exports:{}},Wt={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var iy;function FS(){if(iy)return Wt;iy=1;var a=xh();function i(b){var y="https://react.dev/errors/"+b;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)y+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+b+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key");function g(b,y,k){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:E==null?null:E===h?h:""+E,children:b,containerInfo:y,implementation:k}}var p=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(b,y){if(b==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Wt.browser=function(b){return{$$typeof:f,_reason:b}},Wt.createPortal=function(b,y){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return g(b,y,null,k)},Wt.flushSync=function(b){var y=p.T,k=o.p;try{if(p.T=null,o.p=2,b)return b()}finally{p.T=y,o.p=k,o.d.f()}},Wt.preconnect=function(b,y){typeof b=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,o.d.C(b,y))},Wt.prefetchDNS=function(b){typeof b=="string"&&o.d.D(b)},Wt.preinit=function(b,y){if(typeof b=="string"&&y&&typeof y.as=="string"){var k=y.as,E=x(k,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,N=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;k==="style"?o.d.S(b,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:E,integrity:_,fetchPriority:N}):k==="script"&&o.d.X(b,{crossOrigin:E,integrity:_,fetchPriority:N,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Wt.preinitModule=function(b,y){if(typeof b=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var k=x(y.as,y.crossOrigin);o.d.M(b,{crossOrigin:k,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&o.d.M(b)},Wt.preload=function(b,y){if(typeof b=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var k=y.as,E=x(k,y.crossOrigin);o.d.L(b,k,{crossOrigin:E,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Wt.preloadModule=function(b,y){if(typeof b=="string")if(y){var k=x(y.as,y.crossOrigin);o.d.m(b,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:k,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else o.d.m(b)},Wt.requestFormReset=function(b){o.d.r(b)},Wt.unstable_batchedUpdates=function(b,y){return b(y)},Wt.useFormState=function(b,y,k){return p.H.useFormState(b,y,k)},Wt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Wt.version="19.3.0",Wt}var ry;function f0(){if(ry)return ff.exports;ry=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),ff.exports=FS(),ff.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var oy;function QS(){if(oy)return $i;oy=1;var a=KS(),i=xh(),r=f0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(l=c.return,l!==null){n=l;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return p(c),e;if(u===l)return p(c),t;u=u.sibling}throw Error(o(188))}if(n.return!==l.return)n=c,l=u;else{for(var m=!1,S=c.child;S;){if(S===n){m=!0,n=c,l=u;break}if(S===l){m=!0,l=c,n=u;break}S=S.sibling}if(!m){for(S=u.child;S;){if(S===n){m=!0,n=u,l=c;break}if(S===l){m=!0,l=u,n=c;break}S=S.sibling}if(!m)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function y(e,t,n,l,c,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,l,c,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&y(e.child,t,n,l,c,u))return!0;e=e.sibling}return!1}function k(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function E(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function _(e){var t=[null,null],n=k(e);return n===null||N(t,e,n.child,{foundSelf:!1}),t}function N(e,t,n,l){for(;n!==null;){if(n===t)l.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(l.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&N(e,t,n.child,l))return!0;n=n.sibling}return!1}function j(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var T=null,D=null;function Z(e,t,n){return e===n?!0:e===t?(T=e,!0):!1}function ne(e,t,n){return e===n?(D=e,!1):e===t?(D!==null&&(T=e),!0):!1}function pe(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function I(e,t,n){for(var l=0,c=e;c;c=n(c))l++;c=0;for(var u=t;u;u=n(u))c++;for(;0<l-c;)e=n(e),l--;for(;0<c-l;)t=n(t),c--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var M=Object.assign,A=Symbol.for("react.element"),P=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ie=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),ve=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),xe=Symbol.for("react.legacy_hidden"),ke=Symbol.for("react.memo_cache_sentinel"),w=Symbol.for("react.view_transition"),z=Symbol.for("react.recoverable"),de=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function me(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case ie:return"Profiler";case W:return"StrictMode";case le:return"Suspense";case he:return"SuspenseList";case X:return"Activity";case w:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case Q:return e.displayName||"Context";case ae:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ve:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var te=Array.isArray,U=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},De=[],Ge=-1;function Pe(e){return{current:e}}function Ae(e){0>Ge||(e.current=De[Ge],De[Ge]=null,Ge--)}function Ve(e,t){Ge++,De[Ge]=e.current,e.current=t}var Ct=Pe(null),ln=Pe(null),Et=Pe(null),sn=Pe(null);function rn(e,t){switch(Ve(Et,t),Ve(ln,e),Ve(Ct,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cx(t),e=ux(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ae(Ct),Ve(Ct,e)}function ye(){Ae(Ct),Ae(ln),Ae(Et)}function Ce(e){var t=e.memoizedState;t!==null&&(Us._currentValue=t.memoizedState,Ve(sn,e)),t=Ct.current;var n=ux(t,e.type);t!==n&&(Ve(ln,e),Ve(Ct,n))}function We(e){ln.current===e&&(Ae(Ct),Ae(ln)),sn.current===e&&(Ae(sn),Us._currentValue=Te)}var pt,tn;function _t(e){if(pt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",tn=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+pt+e+tn}var re=!1;function O(e,t){if(!e||re)return"";re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(Se){var L=Se}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(Se){L=Se}ce=!1;try{var F=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ce=!0,new e}finally{ce&&(F!==void 0?Object.defineProperty(e.prototype,"props",F):delete e.prototype.props)}}}else{try{throw Error()}catch(Se){L=Se}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(Se){if(Se&&L&&typeof Se.stack=="string")return[Se.stack,L.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),m=u[0],S=u[1];if(m&&S){var C=m.split(`
|
|
44
|
-
`),H=S.split(`
|
|
45
|
-
`);for(c=l=0;l<C.length&&!C[l].includes("DetermineComponentFrameRoot");)l++;for(;c<H.length&&!H[c].includes("DetermineComponentFrameRoot");)c++;if(l===C.length||c===H.length)for(l=C.length-1,c=H.length-1;1<=l&&0<=c&&C[l]!==H[c];)c--;for(;1<=l&&0<=c;l--,c--)if(C[l]!==H[c]){if(l!==1||c!==1)do if(l--,c--,0>c||C[l]!==H[c]){var J=`
|
|
46
|
-
`+C[l].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=l&&0<=c);break}}}finally{re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?_t(n):""}function we(e,t){switch(e.tag){case 26:case 27:case 5:return _t(e.type);case 16:return _t("Lazy");case 13:return e.child!==t&&t!==null?_t("Suspense Fallback"):_t("Suspense");case 19:return _t("SuspenseList");case 0:case 15:return O(e.type,!1);case 11:return O(e.type.render,!1);case 1:return O(e.type,!0);case 31:return _t("Activity");case 30:return _t("ViewTransition");default:return""}}function Me(e){try{var t="",n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
-
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var yt=Object.prototype.hasOwnProperty,It=a.unstable_scheduleCallback,on=a.unstable_cancelCallback,hn=a.unstable_shouldYield,Kt=a.unstable_requestPaint,Ot=a.unstable_now,Jn=a.unstable_getCurrentPriorityLevel,ti=a.unstable_ImmediatePriority,ni=a.unstable_UserBlockingPriority,gl=a.unstable_NormalPriority,yr=a.unstable_LowPriority,ai=a.unstable_IdlePriority,se=a.log,ze=a.unstable_setDisableYieldValue,Ye=null,lt=null;function mn(e){if(typeof se=="function"&&ze(e),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Ye,e)}catch{}}var et=Math.clz32?Math.clz32:e1,li=Math.log,xl=Math.LN2;function e1(e){return e>>>=0,e===0?32:31-(li(e)/xl|0)|0}var br=256,vr=262144,Sr=4194304;function yl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function wr(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var c=0,u=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var S=l&134217727;return S!==0?(l=S&~u,l!==0?c=yl(l):(m&=S,m!==0?c=yl(m):n||(n=S&~e,n!==0&&(c=yl(n))))):(S=l&~u,S!==0?c=yl(S):m!==0?c=yl(m):n||(n=l&~e,n!==0&&(c=yl(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function si(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Oh(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-et(n),c=1<<l;t|=e[l],n&=~c}return t}function t1(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lh(){var e=Sr;return Sr<<=1,(Sr&62914560)===0&&(Sr=4194304),e}function Rc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ii(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function n1(e,t,n,l,c,u){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,C=e.expirationTimes,H=e.hiddenUpdates;for(n=m&~n;0<n;){var J=31-et(n),ce=1<<J;S[J]=0,C[J]=-1;var L=H[J];if(L!==null)for(H[J]=null,J=0;J<L.length;J++){var F=L[J];F!==null&&(F.lane&=-536870913)}n&=~ce}l!==0&&Uh(e,l,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(m&~t))}function Uh(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-et(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Bh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-et(n),c=1<<l;c&t|e[l]&t&&(e[l]|=t),n&=~c}}function Hh(e,t){var n=t&-t;return n=(n&42)!==0?1:Dc(n),(n&(e.suspendedLanes|t))!==0?0:n}function Dc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function qh(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:Fx(e.type))}function Ph(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var ga=Math.random().toString(36).slice(2),Ft="__reactFiber$"+ga,pn="__reactProps$"+ga,Jl="__reactContainer$"+ga,Gh="__reactEvents$"+ga,a1="__reactListeners$"+ga,l1="__reactHandles$"+ga,Vh="__reactResources$"+ga,ri="__reactMarker$"+ga,kr="__reactLoad$"+ga;function jr(e){delete e[Ft],delete e[pn],delete e[a1],delete e[l1]}function bl(e){var t;if(t=e[Ft])return t;for(var n=e.parentNode;n;){if(t=n[Jl]||n[Ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ex(e);e!==null;){if(n=e[Ft])return n;e=Ex(e)}return t}e=n,n=e.parentNode}return null}function $l(e){if(e=e[Ft]||e[Jl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function oi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Wl(e){var t=e[Vh];return t||(t=e[Vh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pt(e){e[ri]=!0}function Yh(e){e[kr]=void 0}var Ih=new Set,Kh={};function vl(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(Kh[e]=t,e=0;e<t.length;e++)Ih.add(t[e])}var s1=RegExp("^[: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]*$"),Fh={},Qh={};function i1(e){return yt.call(Qh,e)?!0:yt.call(Fh,e)?!1:s1.test(e)?Qh[e]=!0:(Fh[e]=!0,!1)}var st=!1;function Xh(){var e=st;return st=!1,e}function Nr(e,t,n){if(i1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Cr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function xa(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,l)}}function wn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function r1(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(m){n=""+m,u.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lc(e){if(!e._valueTracker){var t=Zh(e)?"checked":"value";e._valueTracker=r1(e,t,""+e[t])}}function Jh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Zh(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}var o1=/[\n"\\]/g;function Mn(e){return e.replace(o1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Uc(e,t,n,l,c,u,m,S){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wn(t)):e.value!==""+wn(t)&&(e.value=""+wn(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Bc(e,wn(e.value)):Bc(e,wn(t)):n!=null?Bc(e,wn(n)):l!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+wn(S):e.removeAttribute("name")}function $h(e,t,n,l,c,u,m,S){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Lc(e);return}n=n!=null?""+wn(n):"",t=t!=null?""+wn(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=S?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Lc(e)}function Bc(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ts(e,t,n,l){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&l&&(e[n].defaultSelected=!0)}else{for(n=""+wn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Wh(e,t,n){if(t!=null&&(t=""+wn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+wn(n):""}function em(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(te(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=wn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Lc(e)}function ns(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var c1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tm(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||c1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function nm(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",st=!0);for(var c in t)l=t[c],t.hasOwnProperty(c)&&n[c]!==l&&(tm(e,c,l),st=!0)}else for(var u in t)t.hasOwnProperty(u)&&tm(e,u,t[u])}function Hc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var u1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),d1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Er(e){return d1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var qc=null;function Pc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var as=null,ls=null;function am(e){var t=$l(e);if(t&&(e=t.stateNode)){var n=e[pn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Uc(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Mn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var c=l[pn]||null;if(!c)throw Error(o(90));Uc(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Jh(l)}break e;case"textarea":Wh(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ts(e,!!n.multiple,t,!1)}}}var Gc=!1;function lm(e,t,n){if(Gc)return e(t,n);Gc=!0;try{var l=e(t);return l}finally{if(Gc=!1,(as!==null||ls!==null)&&(_o(),as&&(t=as,e=ls,ls=as=null,am(t),e)))for(t=0;t<e.length;t++)am(e[t])}}function ci(e,t){var n=e.stateNode;if(n===null)return null;var l=n[pn]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vc=!1;if(ya)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Vc=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Vc=!1}var Ua=null,Yc=null,_r=null;function sm(){if(_r)return _r;var e,t=Yc,n=t.length,l,c="value"in Ua?Ua.value:Ua.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var m=n-e;for(l=1;l<=m&&t[n-l]===c[u-l];l++);return _r=c.slice(e,1<l?1-l:void 0)}function Ar(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tr(){return!0}function im(){return!1}function cn(e){function t(n,l,c,u,m){this._reactName=n,this._targetInst=c,this.type=l,this.nativeEvent=u,this.target=m,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(u):u[S]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Tr:im,this.isPropagationStopped=im,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tr)},persist:function(){},isPersistent:Tr}),t}var Ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zr=cn(Ba),di=M({},Ba,{view:0,detail:0}),f1=cn(di),Ic,Kc,fi,Mr=M({},di,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fi&&(fi&&e.type==="mousemove"?(Ic=e.screenX-fi.screenX,Kc=e.screenY-fi.screenY):Kc=Ic=0,fi=e),Ic)},movementY:function(e){return"movementY"in e?e.movementY:Kc}}),rm=cn(Mr),h1=M({},Mr,{dataTransfer:0}),m1=cn(h1),p1=M({},di,{relatedTarget:0}),Fc=cn(p1),g1=M({},Ba,{animationName:0,elapsedTime:0,pseudoElement:0}),x1=cn(g1),y1=M({},Ba,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),b1=cn(y1),v1=M({},Ba,{data:0}),om=cn(v1),S1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},k1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function j1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=k1[e])?!!t[e]:!1}function Qc(){return j1}var N1=M({},di,{key:function(e){if(e.key){var t=S1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ar(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?w1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qc,charCode:function(e){return e.type==="keypress"?Ar(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ar(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),C1=cn(N1),E1=M({},Mr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=cn(E1),_1=M({},Ba,{submitter:0}),A1=cn(_1),T1=M({},di,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qc}),z1=cn(T1),M1=M({},Ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),R1=cn(M1),D1=M({},Mr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),O1=cn(D1),L1=M({},Ba,{newState:0,oldState:0,source:0}),U1=cn(L1),B1=[9,13,27,32],Xc=ya&&"CompositionEvent"in window,hi=null;ya&&"documentMode"in document&&(hi=document.documentMode);var H1=ya&&"TextEvent"in window&&!hi,um=ya&&(!Xc||hi&&8<hi&&11>=hi),dm=" ",fm=!1;function hm(e,t){switch(e){case"keyup":return B1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ss=!1;function q1(e,t){switch(e){case"compositionend":return mm(t);case"keypress":return t.which!==32?null:(fm=!0,dm);case"textInput":return e=t.data,e===dm&&fm?null:e;default:return null}}function P1(e,t){if(ss)return e==="compositionend"||!Xc&&hm(e,t)?(e=sm(),_r=Yc=Ua=null,ss=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return um&&t.locale!=="ko"?null:t.data;default:return null}}var G1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G1[e.type]:t==="textarea"}function gm(e,t,n,l){as?ls?ls.push(l):ls=[l]:as=l,t=Do(t,"onChange"),0<t.length&&(n=new zr("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var mi=null,pi=null;function V1(e){ax(e,0)}function Rr(e){var t=oi(e);if(Jh(t))return e}function xm(e,t){if(e==="change")return t}var ym=!1;if(ya){var Zc;if(ya){var Jc="oninput"in document;if(!Jc){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),Jc=typeof bm.oninput=="function"}Zc=Jc}else Zc=!1;ym=Zc&&(!document.documentMode||9<document.documentMode)}function vm(){mi&&(mi.detachEvent("onpropertychange",Sm),pi=mi=null)}function Sm(e){if(e.propertyName==="value"&&Rr(pi)){var t=[];gm(t,pi,e,Pc(e)),lm(V1,t)}}function Y1(e,t,n){e==="focusin"?(vm(),mi=t,pi=n,mi.attachEvent("onpropertychange",Sm)):e==="focusout"&&vm()}function I1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rr(pi)}function K1(e,t){if(e==="click")return Rr(t)}function F1(e,t){if(e==="input"||e==="change")return Rr(t)}function Q1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kn=typeof Object.is=="function"?Object.is:Q1;function gi(e,t){if(kn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var c=n[l];if(!yt.call(t,c)||!kn(e[c],t[c]))return!1}return!0}function $c(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 wm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function km(e,t){var n=wm(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wm(n)}}function jm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$c(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$c(e.document)}return t}function Wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var X1=ya&&"documentMode"in document&&11>=document.documentMode,is=null,eu=null,xi=null,tu=!1;function Cm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tu||is==null||is!==$c(l)||(l=is,"selectionStart"in l&&Wc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),xi&&gi(xi,l)||(xi=l,l=Do(eu,"onSelect"),0<l.length&&(t=new zr("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=is)))}function Sl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var rs={animationend:Sl("Animation","AnimationEnd"),animationiteration:Sl("Animation","AnimationIteration"),animationstart:Sl("Animation","AnimationStart"),transitionrun:Sl("Transition","TransitionRun"),transitionstart:Sl("Transition","TransitionStart"),transitioncancel:Sl("Transition","TransitionCancel"),transitionend:Sl("Transition","TransitionEnd")},nu={},Em={};ya&&(Em=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function wl(e){if(nu[e])return nu[e];if(!rs[e])return e;var t=rs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Em)return nu[e]=t[n];return e}var _m=wl("animationend"),Am=wl("animationiteration"),Tm=wl("animationstart"),Z1=wl("transitionrun"),J1=wl("transitionstart"),$1=wl("transitioncancel"),zm=wl("transitionend"),Mm=new Map,au="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");au.push("scrollEnd");function Vn(e,t){Mm.set(e,t),vl(t,[e])}var W1=0;function ba(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Fn.identifierPrefix;var n=W1++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Rm(e){if(e==null||typeof e=="string")return e;var t=null,n=Es;if(n!==null)for(var l=0;l<n.length;l++){var c=e[n[l]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function va(e,t){return e=Rm(e),t=Rm(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Dr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Rn=[],os=0,lu=0;function Or(){for(var e=os,t=lu=os=0;t<e;){var n=Rn[t];Rn[t++]=null;var l=Rn[t];Rn[t++]=null;var c=Rn[t];Rn[t++]=null;var u=Rn[t];if(Rn[t++]=null,l!==null&&c!==null){var m=l.pending;m===null?c.next=c:(c.next=m.next,m.next=c),l.pending=c}u!==0&&Dm(n,c,u)}}function Lr(e,t,n,l){Rn[os++]=e,Rn[os++]=t,Rn[os++]=n,Rn[os++]=l,lu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function su(e,t,n,l){return Lr(e,t,n,l),Ur(e)}function kl(e,t){return Lr(e,null,null,t),Ur(e)}function Dm(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,l=u.alternate,l!==null&&(l.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-et(n),e=u.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=n|536870912),u):null}function Ur(e){if(50<Hi)throw Hi=0,Eo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var cs={};function e2(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,n,l){return new e2(e,t,n,l)}function iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sa(e,t){var n=e.alternate;return n===null?(n=gn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Om(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Br(e,t,n,l,c,u){var m=0;if(l=e,typeof l=="function")iu(l)&&(m=1);else if(typeof l=="string")m=_S(e,n,Ct.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case X:return e=gn(31,n,t,c),e.elementType=X,e.lanes=u,e;case q:return jl(n.children,c,u,t);case W:m=8,c|=24;break;case ie:return e=gn(12,n,t,c|2),e.elementType=ie,e.lanes=u,e;case le:return e=gn(13,n,t,c),e.elementType=le,e.lanes=u,e;case he:return e=gn(19,n,t,c),e.elementType=he,e.lanes=u,e;case xe:case w:return e=c|32,e=gn(30,n,t,e),e.elementType=w,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Q:m=10;break e;case ae:m=9;break e;case V:m=11;break e;case ve:m=14;break e;case K:m=16,l=null;break e}m=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=gn(m,n,t,c),t.elementType=e,t.type=l,t.lanes=u,t}function jl(e,t,n,l){return e=gn(7,e,l,t),e.lanes=n,e}function ru(e,t,n){return e=gn(6,e,null,t),e.lanes=n,e}function Lm(e){var t=gn(18,null,null,0);return t.stateNode=e,t}function ou(e,t,n){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Um=new WeakMap;function Dn(e,t){if(typeof e=="object"&&e!==null){var n=Um.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Me(t)},Um.set(e,t),t)}return{value:e,source:t,stack:Me(t)}}var us=[],ds=0,Hr=null,yi=0,On=[],Ln=0,Ha=null,Wn=1,ea="";function wa(e,t){us[ds++]=yi,us[ds++]=Hr,Hr=e,yi=t}function Bm(e,t,n){On[Ln++]=Wn,On[Ln++]=ea,On[Ln++]=Ha,Ha=e;var l=Wn;e=ea;var c=32-et(l)-1;l&=~(1<<c),n+=1;var u=32-et(t)+c;if(30<u){var m=c-c%5;u=(l&(1<<m)-1).toString(32),l>>=m,c-=m,Wn=1<<32-et(t)+c|n<<c|l,ea=u+e}else Wn=1<<u|n<<c|l,ea=e}function qr(e){e.return!==null&&(wa(e,1),Bm(e,1,0))}function cu(e){for(;e===Hr;)Hr=us[--ds],us[ds]=null,yi=us[--ds],us[ds]=null;for(;e===Ha;)Ha=On[--Ln],On[Ln]=null,ea=On[--Ln],On[Ln]=null,Wn=On[--Ln],On[Ln]=null}function Hm(e,t){On[Ln++]=Wn,On[Ln++]=ea,On[Ln++]=Ha,Wn=t.id,ea=t.overflow,Ha=e}var Gt=null,gt=null,Ie=!1,qa=null,Un=!1,uu=Error(o(519));function Pa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bi(Dn(t,e)),uu}function qm(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ft]=e,t[pn]=l,n){case"dialog":Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":case"embed":Xe("load",t);break;case"video":case"audio":for(n=0;n<Pi.length;n++)Xe(Pi[n],t);break;case"source":Xe("error",t);break;case"img":case"image":case"link":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"input":Xe("invalid",t),$h(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Xe("invalid",t);break;case"textarea":Xe("invalid",t),em(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||rx(t.textContent,n)?(l.popover!=null&&(Xe("beforetoggle",t),Xe("toggle",t)),l.onScroll!=null&&Xe("scroll",t),l.onScrollEnd!=null&&Xe("scrollend",t),l.onClick!=null&&(t.onclick=$n),t=!0):t=!1,t||Pa(e,!0)}function Pr(e){for(Gt=e.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:Un=!1;return;case 27:case 3:Un=!0;return;default:Gt=Gt.return}}function fs(e){if(e!==Gt)return!1;if(!Ie)return Pr(e),Ie=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||qd(e.type,e.memoizedProps)),n=!n),n&>&&Pa(e),Pr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));gt=Cx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));gt=Cx(e)}else t===27?(t=gt,al(e.type)?(e=Xd,Xd=null,gt=e):gt=t):gt=Gt?Hn(e.stateNode.nextSibling):null;return!0}function Nl(){gt=Gt=null,Ie=!1}function du(){var e=qa;return e!==null&&(bn===null?bn=e:bn.push.apply(bn,e),qa=null),e}function bi(e){qa===null?qa=[e]:qa.push(e)}var fu=Pe(null),Cl=null,ka=null;function Ga(e,t,n){Ve(fu,t._currentValue),t._currentValue=n}function ja(e){e._currentValue=fu.current,Ae(fu)}function Gr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function hu(e,t,n,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var m=c.child;u=u.firstContext;e:for(;u!==null;){var S=u;u=c;for(var C=0;C<t.length;C++)if(S.context===t[C]){u.lanes|=n,S=u.alternate,S!==null&&(S.lanes|=n),Gr(u.return,n,e),l||(m=null);break e}u=S.next}}else if(c.tag===18){if(m=c.return,m===null)throw Error(o(341));m.lanes|=n,u=m.alternate,u!==null&&(u.lanes|=n),Gr(m,n,e),m=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=n,m=c.alternate,m!==null&&(m.lanes|=n),Gr(c.return,n,e),m=c.child,m=m!==null?m.sibling:null):m=c.child;if(m!==null)m.return=c;else for(m=c;m!==null;){if(m===e){m=null;break}if(c=m.sibling,c!==null){c.return=m.return,m=c;break}m=m.return}c=m}}function El(e,t,n,l){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var m=c.alternate;if(m===null)throw Error(o(387));if(m=m.memoizedProps,m!==null){var S=c.type;kn(c.pendingProps.value,m.value)||(e!==null?e.push(S):e=[S])}}else if(c===sn.current){if(m=c.alternate,m===null)throw Error(o(387));m.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Us):e=[Us])}c=c.return}return e!==null&&hu(t,e,n,l),t.flags|=262144,e!==null}function Vr(e){for(e=e.firstContext;e!==null;){if(!kn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _l(e){Cl=e,ka=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qt(e){return Pm(Cl,e)}function Yr(e,t){return Cl===null&&_l(e),Pm(e,t)}function Pm(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ka===null){if(e===null)throw Error(o(308));ka=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ka=ka.next=t;return n}var t2=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},n2=a.unstable_scheduleCallback,a2=a.unstable_NormalPriority,At={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mu(){return{controller:new t2,data:new Map,refCount:0}}function vi(e){e.refCount--,e.refCount===0&&n2(a2,function(){e.controller.abort()})}function Gm(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];n.indexOf(l)===-1&&n.push(l)}}}var Si=null;function l2(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var wi=null,pu=0,Al=0,hs=null;function s2(e,t){if(wi===null){var n=wi=[];pu=0,Al=zd(),hs={status:"pending",value:void 0,then:function(l){n.push(l)}}}return pu++,t.then(Vm,Vm),t}function Vm(){if(--pu===0&&(Si=null,wi!==null)){hs!==null&&(hs.status="fulfilled");var e=wi;wi=null,Al=0,hs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function i2(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),l}var Ym=U.S;U.S=function(e,t){if(Lg=Ot(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&s2(e,t),Si!==null)for(var n=zs;n!==null;)Gm(n,Si),n=n.next;if(n=e.types,n!==null){for(var l=zs;l!==null;)Gm(l,n),l=l.next;if(Al!==0){l=Si,l===null&&(l=Si=[]);for(var c=0;c<n.length;c++){var u=n[c];l.indexOf(u)===-1&&l.push(u)}}}Ym!==null&&Ym(e,t)};var Tl=Pe(null);function gu(){var e=Tl.current;return e!==null?e:mt.pooledCache}function Ir(e,t){t===null?Ve(Tl,Tl.current):Ve(Tl,t.pool)}function Im(){var e=gu();return e===null?null:{parent:At._currentValue,pool:e}}var ms=Error(o(460)),xu=Error(o(474)),Kr=Error(o(542)),Fr={then:function(){}};function Km(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Fm(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($n,$n),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xm(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then($n,$n);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xm(e),e}throw Ml=t,ms}}function zl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ml=n,ms):n}}var Ml=null;function Qm(){if(Ml===null)throw Error(o(459));var e=Ml;return Ml=null,e}function Xm(e){if(e===ms||e===Kr)throw Error(o(483))}var ps=null,ki=0;function Qr(e){var t=ki;return ki+=1,ps===null&&(ps=[]),Fm(ps,e,t)}function Va(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xr(e,t){throw t.$$typeof===A?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Zm(e){function t(B,R){if(e){var Y=B.deletions;Y===null?(B.deletions=[R],B.flags|=16):Y.push(R)}}function n(B,R){if(!e)return null;for(;R!==null;)t(B,R),R=R.sibling;return null}function l(B){for(var R=new Map;B!==null;)B.key===null?R.set(B.index,B):R.set(B.key,B),B=B.sibling;return R}function c(B,R){return B=Sa(B,R),B.index=0,B.sibling=null,B}function u(B,R,Y){return B.index=Y,e?(Y=B.alternate,Y!==null?(Y=Y.index,Y<R?(B.flags|=2,R):Y):(B.flags|=134217730,R)):(B.flags|=1048576,R)}function m(B){return e&&B.alternate===null&&(B.flags|=134217730),B}function S(B,R,Y,oe){return R===null||R.tag!==6?(R=ru(Y,B.mode,oe),R.return=B,R):(R=c(R,Y),R.return=B,R)}function C(B,R,Y,oe){var je=Y.type;return je===q?(B=J(B,R,Y.props.children,oe,Y.key),Va(B,Y),B):R!==null&&(R.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&zl(je)===R.type)?(R=c(R,Y.props),Va(R,Y),R.return=B,R):(R=Br(Y.type,Y.key,Y.props,null,B.mode,oe),Va(R,Y),R.return=B,R)}function H(B,R,Y,oe){return R===null||R.tag!==4||R.stateNode.containerInfo!==Y.containerInfo||R.stateNode.implementation!==Y.implementation?(R=ou(Y,B.mode,oe),R.return=B,R):(R=c(R,Y.children||[]),R.return=B,R)}function J(B,R,Y,oe,je){return R===null||R.tag!==7?(R=jl(Y,B.mode,oe,je),R.return=B,R):(R=c(R,Y),R.return=B,R)}function ce(B,R,Y){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=ru(""+R,B.mode,Y),R.return=B,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case P:return Y=Br(R.type,R.key,R.props,null,B.mode,Y),Va(Y,R),Y.return=B,Y;case G:return R=ou(R,B.mode,Y),R.return=B,R;case K:return R=zl(R),ce(B,R,Y)}if(te(R)||ue(R))return R=jl(R,B.mode,Y,null),R.return=B,R;if(typeof R.then=="function")return ce(B,Qr(R),Y);if(R.$$typeof===Q)return ce(B,Yr(B,R),Y);Xr(B,R)}return null}function L(B,R,Y,oe){var je=R!==null?R.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return je!==null?null:S(B,R,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case P:return Y.key===je?C(B,R,Y,oe):null;case G:return Y.key===je?H(B,R,Y,oe):null;case K:return Y=zl(Y),L(B,R,Y,oe)}if(te(Y)||ue(Y))return je!==null?null:J(B,R,Y,oe,null);if(typeof Y.then=="function")return L(B,R,Qr(Y),oe);if(Y.$$typeof===Q)return L(B,R,Yr(B,Y),oe);Xr(B,Y)}return null}function F(B,R,Y,oe,je){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return B=B.get(Y)||null,S(R,B,""+oe,je);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case P:return B=B.get(oe.key===null?Y:oe.key)||null,C(R,B,oe,je);case G:return B=B.get(oe.key===null?Y:oe.key)||null,H(R,B,oe,je);case K:return oe=zl(oe),F(B,R,Y,oe,je)}if(te(oe)||ue(oe))return B=B.get(Y)||null,J(R,B,oe,je,null);if(typeof oe.then=="function")return F(B,R,Y,Qr(oe),je);if(oe.$$typeof===Q)return F(B,R,Y,Yr(R,oe),je);Xr(R,oe)}return null}function Se(B,R,Y,oe){for(var je=null,$e=null,Re=R,Oe=R=0,Mt=null;Re!==null&&Oe<Y.length;Oe++){Re.index>Oe?(Mt=Re,Re=null):Mt=Re.sibling;var nt=L(B,Re,Y[Oe],oe);if(nt===null){Re===null&&(Re=Mt);break}e&&Re&&nt.alternate===null&&t(B,Re),R=u(nt,R,Oe),$e===null?je=nt:$e.sibling=nt,$e=nt,Re=Mt}if(Oe===Y.length)return n(B,Re),Ie&&wa(B,Oe),je;if(Re===null){for(;Oe<Y.length;Oe++)Re=ce(B,Y[Oe],oe),Re!==null&&(R=u(Re,R,Oe),$e===null?je=Re:$e.sibling=Re,$e=Re);return Ie&&wa(B,Oe),je}for(Re=l(Re);Oe<Y.length;Oe++)Mt=F(Re,B,Oe,Y[Oe],oe),Mt!==null&&(e&&(nt=Mt.alternate,nt!==null&&Re.delete(nt.key===null?Oe:nt.key)),R=u(Mt,R,Oe),$e===null?je=Mt:$e.sibling=Mt,$e=Mt);return e&&Re.forEach(function(ol){return t(B,ol)}),Ie&&wa(B,Oe),je}function _e(B,R,Y,oe){if(Y==null)throw Error(o(151));for(var je=null,$e=null,Re=R,Oe=R=0,Mt=null,nt=Y.next();Re!==null&&!nt.done;Oe++,nt=Y.next()){Re.index>Oe?(Mt=Re,Re=null):Mt=Re.sibling;var ol=L(B,Re,nt.value,oe);if(ol===null){Re===null&&(Re=Mt);break}e&&Re&&ol.alternate===null&&t(B,Re),R=u(ol,R,Oe),$e===null?je=ol:$e.sibling=ol,$e=ol,Re=Mt}if(nt.done)return n(B,Re),Ie&&wa(B,Oe),je;if(Re===null){for(;!nt.done;Oe++,nt=Y.next())nt=ce(B,nt.value,oe),nt!==null&&(R=u(nt,R,Oe),$e===null?je=nt:$e.sibling=nt,$e=nt);return Ie&&wa(B,Oe),je}for(Re=l(Re);!nt.done;Oe++,nt=Y.next())nt=F(Re,B,Oe,nt.value,oe),nt!==null&&(e&&(Mt=nt.alternate,Mt!==null&&Re.delete(Mt.key===null?Oe:Mt.key)),R=u(nt,R,Oe),$e===null?je=nt:$e.sibling=nt,$e=nt);return e&&Re.forEach(function(qS){return t(B,qS)}),Ie&&wa(B,Oe),je}function qe(B,R,Y,oe){if(typeof Y=="object"&&Y!==null&&Y.type===q&&Y.key===null&&Y.props.ref===void 0&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case P:e:{for(var je=Y.key;R!==null;){if(R.key===je){if(je=Y.type,je===q){if(R.tag===7){n(B,R.sibling),oe=c(R,Y.props.children),Va(oe,Y),oe.return=B,B=oe;break e}}else if(R.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&zl(je)===R.type){n(B,R.sibling),oe=c(R,Y.props),Va(oe,Y),oe.return=B,B=oe;break e}n(B,R);break}else t(B,R);R=R.sibling}Y.type===q?(oe=jl(Y.props.children,B.mode,oe,Y.key),Va(oe,Y),oe.return=B,B=oe):(oe=Br(Y.type,Y.key,Y.props,null,B.mode,oe),Va(oe,Y),oe.return=B,B=oe)}return m(B);case G:e:{for(je=Y.key;R!==null;){if(R.key===je)if(R.tag===4&&R.stateNode.containerInfo===Y.containerInfo&&R.stateNode.implementation===Y.implementation){n(B,R.sibling),oe=c(R,Y.children||[]),oe.return=B,B=oe;break e}else{n(B,R);break}else t(B,R);R=R.sibling}oe=ou(Y,B.mode,oe),oe.return=B,B=oe}return m(B);case K:return Y=zl(Y),qe(B,R,Y,oe)}if(te(Y))return Se(B,R,Y,oe);if(ue(Y)){if(je=ue(Y),typeof je!="function")throw Error(o(150));return Y=je.call(Y),_e(B,R,Y,oe)}if(typeof Y.then=="function")return qe(B,R,Qr(Y),oe);if(Y.$$typeof===Q)return qe(B,R,Yr(B,Y),oe);Xr(B,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,R!==null&&R.tag===6?(n(B,R.sibling),oe=c(R,Y),oe.return=B,B=oe):(n(B,R),oe=ru(Y,B.mode,oe),oe.return=B,B=oe),m(B)):n(B,R)}return function(B,R,Y,oe){try{ki=0;var je=qe(B,R,Y,oe);return ps=null,je}catch(Re){if(Re===ms||Re===Kr)throw Re;var $e=gn(29,Re,null,B.mode);return $e.lanes=oe,$e.return=B,$e}finally{}}}var Rl=Zm(!0),Jm=Zm(!1),Ya=!1;function yu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(rt&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=Ur(e),Dm(e,null,n),t}return Lr(e,l,t,n),Ur(e)}function ji(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Bh(e,n)}}function vu(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=m:u=u.next=m,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Su=!1;function Ni(){if(Su){var e=hs;if(e!==null)throw e}}function Ci(e,t,n,l){Su=!1;var c=e.updateQueue;Ya=!1;var u=c.firstBaseUpdate,m=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var C=S,H=C.next;C.next=null,m===null?u=H:m.next=H,m=C;var J=e.alternate;J!==null&&(J=J.updateQueue,S=J.lastBaseUpdate,S!==m&&(S===null?J.firstBaseUpdate=H:S.next=H,J.lastBaseUpdate=C))}if(u!==null){var ce=c.baseState;m=0,J=H=C=null,S=u;do{var L=S.lane&-536870913,F=L!==S.lane;if(F?(Je&L)===L:(l&L)===L){L!==0&&L===Al&&(Su=!0),J!==null&&(J=J.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Se=e,_e=S;L=t;var qe=n;switch(_e.tag){case 1:if(Se=_e.payload,typeof Se=="function"){ce=Se.call(qe,ce,L);break e}ce=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=_e.payload,L=typeof Se=="function"?Se.call(qe,ce,L):Se,L==null)break e;ce=M({},ce,L);break e;case 2:Ya=!0}}L=S.callback,L!==null&&(e.flags|=64,F&&(e.flags|=8192),F=c.callbacks,F===null?c.callbacks=[L]:F.push(L))}else F={lane:L,tag:S.tag,payload:S.payload,callback:S.callback,next:null},J===null?(H=J=F,C=ce):J=J.next=F,m|=L;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;F=S,S=F.next,F.next=null,c.lastBaseUpdate=F,c.shared.pending=null}}while(!0);J===null&&(C=ce),c.baseState=C,c.firstBaseUpdate=H,c.lastBaseUpdate=J,u===null&&(c.shared.lanes=0),Wa|=m,e.lanes=m,e.memoizedState=ce}}function $m(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Wm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$m(n[e],t)}var Fa=Pe(null),Zr=Pe(0);function ep(e,t){e=Aa,Ve(Zr,e),Ve(Fa,t),Aa=e|t.baseLanes}function wu(){Ve(Zr,Aa),Ve(Fa,Fa.current)}function ku(){Aa=Zr.current,Ae(Fa),Ae(Zr)}var Xt=Pe(null),nn=null;function Qa(e){var t=e.alternate;Ve(Zt,Zt.current&1),Ve(Xt,e),nn===null&&(t===null||Fa.current!==null||t.memoizedState!==null)&&(nn=e)}function ju(e){Ve(Zt,Zt.current),Ve(Xt,e),nn===null&&(nn=e)}function tp(e){e.tag===22?(Ve(Zt,Zt.current),Ve(Xt,e),nn===null&&(nn=e)):Xa()}function Xa(){Ve(Zt,Zt.current),Ve(Xt,Xt.current)}function jn(e){Ae(Xt),nn===e&&(nn=null),Ae(Zt)}var Zt=Pe(0);function Ei(e,t){Ve(Xt,Xt.current),Ve(Zt,t)}function Nu(e){Ae(Zt),Ae(Xt),nn===e&&(nn=null)}function Jr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Fd(n)||Qd(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Na=0,He=null,ht=null,Tt=null,$r=!1,gs=!1,Dl=!1,Wr=0,_i=0,xs=null,r2=0;function kt(){throw Error(o(321))}function Cu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kn(e[n],t[n]))return!1;return!0}function Eu(e,t,n,l,c,u){return Na=u,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Bp:Hp,Dl=!1,u=n(l,c),Dl=!1,gs&&(u=ap(t,n,l,c)),np(e),u}function np(e){U.H=io;var t=ht!==null&&ht.next!==null;if(Na=0,Tt=ht=He=null,$r=!1,_i=0,xs=null,t)throw Error(o(300));e===null||zt||(e=e.dependencies,e!==null&&Vr(e)&&(zt=!0))}function ap(e,t,n,l){He=e;var c=0;do{if(gs&&(xs=null),_i=0,gs=!1,25<=c)throw Error(o(301));if(c+=1,Tt=ht=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}U.H=p2,u=t(n,l)}while(gs);return u}function o2(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Ai(t):t,e=e.useState()[0],(ht!==null?ht.memoizedState:null)!==e&&(He.flags|=1024),t}function _u(){var e=Wr!==0;return Wr=0,e}function Au(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Tu(e){if($r){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}$r=!1}Na=0,Tt=ht=He=null,gs=!1,_i=Wr=0,xs=null}function un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?He.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function Nt(){if(ht===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=ht.next;var t=Tt===null?He.memoizedState:Tt.next;if(t!==null)Tt=t,ht=e;else{if(e===null)throw He.alternate===null?Error(o(467)):Error(o(310));ht=e,e={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Tt===null?He.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ai(e){var t=_i;return _i+=1,xs===null&&(xs=[]),e=Fm(xs,e,t),t=He,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Bp:Hp),e}function to(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ai(e);if(e.$$typeof===z)return;if(e.$$typeof===Q)return Qt(e)}throw Error(o(438,String(e)))}function zu(e){var t=null,n=He.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=He.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=eo(),He.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ke;return t.index++,n}function Ca(e,t){return typeof t=="function"?t(e):t}function no(e){var t=Nt();return Mu(t,ht,e)}function Mu(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var c=e.baseQueue,u=l.pending;if(u!==null){if(c!==null){var m=c.next;c.next=u.next,u.next=m}t.baseQueue=c=u,l.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var S=m=null,C=null,H=t,J=!1;do{var ce=H.lane&-536870913;if(ce!==H.lane?(Je&ce)===ce:(Na&ce)===ce){var L=H.revertLane;if(L===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),ce===Al&&(J=!0);else if((Na&L)===L){H=H.next,L===Al&&(J=!0);continue}else ce={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},C===null?(S=C=ce,m=u):C=C.next=ce,He.lanes|=L,Wa|=L;ce=H.action,Dl&&n(u,ce),u=H.hasEagerState?H.eagerState:n(u,ce)}else L={lane:ce,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},C===null?(S=C=L,m=u):C=C.next=L,He.lanes|=ce,Wa|=ce;H=H.next}while(H!==null&&H!==t);if(C===null?m=u:C.next=S,!kn(u,e.memoizedState)&&(zt=!0,J&&(n=hs,n!==null)))throw n;e.memoizedState=u,e.baseState=m,e.baseQueue=C,l.lastRenderedState=u}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ru(e){var t=Nt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var m=c=c.next;do u=e(u,m.action),m=m.next;while(m!==c);kn(u,t.memoizedState)||(zt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function lp(e,t,n){var l=He,c=Nt(),u=Ie;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var m=!kn((ht||c).memoizedState,n);if(m&&(c.memoizedState=n,zt=!0),c=c.queue,Lu(rp.bind(null,l,c,e),[e]),e=c.getSnapshot!==t||m||Tt!==null&&(Tt.memoizedState.tag&1)!==0,ys(e?9:8,{destroy:void 0},ip.bind(null,l,c,n,t),null),e){if(l.flags|=2048,mt===null)throw Error(o(349));u||(Na&127)!==0||sp(l,t,n)}return n}function sp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=He.updateQueue,t===null?(t=eo(),He.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ip(e,t,n,l){t.value=n,t.getSnapshot=l,op(t)&&cp(e)}function rp(e,t,n){return n(function(){op(t)&&cp(e)})}function op(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kn(e,n)}catch{return!0}}function cp(e){var t=kl(e,2);t!==null&&vn(t,e,2)}function Du(e){var t=un();if(typeof e=="function"){var n=e;if(e=n(),Dl){mn(!0);try{n()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:e},t}function up(e,t,n,l){return e.baseState=n,Mu(e,ht,typeof l=="function"?l:Ca)}function c2(e,t,n,l,c){if(so(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){u.listeners.push(m)}};U.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,dp(t,u)):(u.next=n.next,t.pending=n.next=u)}}function dp(e,t){var n=t.action,l=t.payload,c=e.state;if(t.isTransition){var u=U.T,m={};m.types=u!==null?u.types:null,U.T=m;try{var S=n(c,l),C=U.S;C!==null&&C(m,S),fp(e,t,S)}catch(H){Ou(e,t,H)}finally{u!==null&&m.types!==null&&(u.types=m.types),U.T=u}}else try{u=n(c,l),fp(e,t,u)}catch(H){Ou(e,t,H)}}function fp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){hp(e,t,l)},function(l){return Ou(e,t,l)}):hp(e,t,n)}function hp(e,t,n){t.status="fulfilled",t.value=n,mp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,dp(e,n)))}function Ou(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,mp(t),t=t.next;while(t!==l)}e.action=null}function mp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pp(e,t){return t}function gp(e,t){if(Ie){var n=mt.formState;if(n!==null){e:{var l=He;if(Ie){if(gt){t:{for(var c=gt,u=Un;c.nodeType!==8;){if(!u){c=null;break t}if(c=Hn(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){gt=Hn(c.nextSibling),l=c.data==="F!";break e}}Pa(l)}l=!1}l&&(t=n[0])}}return n=un(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pp,lastRenderedState:t},n.queue=l,n=Op.bind(null,He,l),l.dispatch=n,l=Du(!1),u=Pu.bind(null,He,!1,l.queue),l=un(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,n=c2.bind(null,He,c,u,n),c.dispatch=n,l.memoizedState=e,[t,n,!1]}function xp(e){var t=Nt();return yp(t,ht,e)}function yp(e,t,n){if(t=Mu(e,t,pp)[0],e=no(Ca)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ai(t)}catch(m){throw m===ms?Kr:m}else l=t;t=Nt();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(He.flags|=2048,ys(9,{destroy:void 0},u2.bind(null,c,n),null)),[l,u,e]}function u2(e,t){e.action=t}function bp(e){var t=Nt(),n=ht;if(n!==null)return yp(t,n,e);Nt(),t=t.memoizedState,n=Nt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function ys(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=He.updateQueue,t===null&&(t=eo(),He.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function vp(){return Nt().memoizedState}function ao(e,t,n,l){var c=un();He.flags|=e,c.memoizedState=ys(1|t,{destroy:void 0},n,l===void 0?null:l)}function lo(e,t,n,l){var c=Nt();l=l===void 0?null:l;var u=c.memoizedState.inst;ht!==null&&l!==null&&Cu(l,ht.memoizedState.deps)?c.memoizedState=ys(t,u,n,l):(He.flags|=e,c.memoizedState=ys(1|t,u,n,l))}function Sp(e,t){ao(8390656,8,e,t)}function Lu(e,t){lo(2048,8,e,t)}function d2(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=eo(),He.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function wp(e){var t=Nt().memoizedState;return d2({ref:t,nextImpl:e}),function(){if((rt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function kp(e,t){return lo(4,2,e,t)}function jp(e,t){return lo(4,4,e,t)}function Np(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Cp(e,t,n){n=n!=null?n.concat([e]):null,lo(4,4,Np.bind(null,t,e),n)}function Uu(){}function Ep(e,t){var n=Nt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Cu(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function _p(e,t){var n=Nt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Cu(t,l[1]))return l[0];if(l=e(),Dl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l}function Bu(e,t,n){return n===void 0||(Na&1073741824)!==0&&(Je&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Bg(),He.lanes|=e,Wa|=e,n)}function Ap(e,t,n,l){return kn(n,t)?n:Fa.current!==null?(e=Bu(e,n,l),kn(e,t)||(zt=!0),e):(Na&106)===0||(Na&1073741824)!==0&&(Je&261930)===0?(zt=!0,e.memoizedState=n):(e=Bg(),He.lanes|=e,Wa|=e,t)}function Tp(e,t,n,l,c){var u=fe.p;fe.p=u!==0&&8>u?u:8;var m=U.T,S={};S.types=m!==null?m.types:null,U.T=S,Pu(e,!1,t,n);try{var C=c(),H=U.S;if(H!==null&&H(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var J=i2(C,l);Ti(e,t,J,_n(e))}else Ti(e,t,l,_n(e))}catch(ce){Ti(e,t,{then:function(){},status:"rejected",reason:ce},_n())}finally{fe.p=u,m!==null&&S.types!==null&&(m.types=S.types),U.T=m}}function f2(){}function Hu(e,t,n,l){if(e.tag!==5)throw Error(o(476));var c=zp(e).queue;Tp(e,c,t,Te,n===null?f2:function(){return Mp(e),n(l)})}function zp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:Te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Mp(e){var t=zp(e);t.next===null&&(t=e.alternate.memoizedState),Ti(e,t.next.queue,{},_n())}function qu(){return Qt(Us)}function Rp(){return Nt().memoizedState}function Dp(){return Nt().memoizedState}function h2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_n();e=Ia(n);var l=Ka(t,e,n);l!==null&&(vn(l,t,n),ji(l,t,n)),t={cache:mu()},e.payload=t;return}t=t.return}}function m2(e,t,n){var l=_n();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},so(e)?Lp(t,n):(n=su(e,t,n,l),n!==null&&(vn(n,e,l),Up(n,t,l)))}function Op(e,t,n){var l=_n();Ti(e,t,n,l)}function Ti(e,t,n,l){var c={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(so(e))Lp(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var m=t.lastRenderedState,S=u(m,n);if(c.hasEagerState=!0,c.eagerState=S,kn(S,m))return Lr(e,t,c,0),mt===null&&Or(),!1}catch{}finally{}if(n=su(e,t,c,l),n!==null)return vn(n,e,l),Up(n,t,l),!0}return!1}function Pu(e,t,n,l){if(l={lane:2,revertLane:zd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},so(e)){if(t)throw Error(o(479))}else t=su(e,n,l,2),t!==null&&vn(t,e,2)}function so(e){var t=e.alternate;return e===He||t!==null&&t===He}function Lp(e,t){gs=$r=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Up(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Bh(e,n)}}var io={readContext:Qt,use:to,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt,useEffectEvent:kt},Bp={readContext:Qt,use:to,useCallback:function(e,t){return un().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:Sp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ao(4194308,4,Np.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ao(4194308,4,e,t)},useInsertionEffect:function(e,t){ao(4,2,e,t)},useMemo:function(e,t){var n=un();t=t===void 0?null:t;var l=e();if(Dl){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=un();if(n!==void 0){var c=n(t);if(Dl){mn(!0);try{n(t)}finally{mn(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=m2.bind(null,He,e),[l.memoizedState,e]},useRef:function(e){var t=un();return e={current:e},t.memoizedState=e},useState:function(e){e=Du(e);var t=e.queue,n=Op.bind(null,He,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Uu,useDeferredValue:function(e,t){var n=un();return Bu(n,e,t)},useTransition:function(){var e=Du(!1);return e=Tp.bind(null,He,e.queue,!0,!1),un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=He,c=un();if(Ie){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),mt===null)throw Error(o(349));(Je&127)!==0||sp(l,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,Sp(rp.bind(null,l,u,e),[e]),l.flags|=2048,ys(9,{destroy:void 0},ip.bind(null,l,u,n,t),null),n},useId:function(){var e=un(),t=mt.identifierPrefix;if(Ie){var n=ea,l=Wn;n=(l&~(1<<32-et(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Wr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=r2++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:qu,useFormState:gp,useActionState:gp,useOptimistic:function(e){var t=un();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Pu.bind(null,He,!0,n),n.dispatch=t,[e,t]},useMemoCache:zu,useCacheRefresh:function(){return un().memoizedState=h2.bind(null,He)},useEffectEvent:function(e){var t=un(),n={impl:e};return t.memoizedState=n,function(){if((rt&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Hp={readContext:Qt,use:to,useCallback:Ep,useContext:Qt,useEffect:Lu,useImperativeHandle:Cp,useInsertionEffect:kp,useLayoutEffect:jp,useMemo:_p,useReducer:no,useRef:vp,useState:function(){return no(Ca)},useDebugValue:Uu,useDeferredValue:function(e,t){var n=Nt();return Ap(n,ht.memoizedState,e,t)},useTransition:function(){var e=no(Ca)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:Ai(e),t]},useSyncExternalStore:lp,useId:Rp,useHostTransitionStatus:qu,useFormState:xp,useActionState:xp,useOptimistic:function(e,t){var n=Nt();return up(n,ht,e,t)},useMemoCache:zu,useCacheRefresh:Dp,useEffectEvent:wp},p2={readContext:Qt,use:to,useCallback:Ep,useContext:Qt,useEffect:Lu,useImperativeHandle:Cp,useInsertionEffect:kp,useLayoutEffect:jp,useMemo:_p,useReducer:Ru,useRef:vp,useState:function(){return Ru(Ca)},useDebugValue:Uu,useDeferredValue:function(e,t){var n=Nt();return ht===null?Bu(n,e,t):Ap(n,ht.memoizedState,e,t)},useTransition:function(){var e=Ru(Ca)[0],t=Nt().memoizedState;return[typeof e=="boolean"?e:Ai(e),t]},useSyncExternalStore:lp,useId:Rp,useHostTransitionStatus:qu,useFormState:bp,useActionState:bp,useOptimistic:function(e,t){var n=Nt();return ht!==null?up(n,ht,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:zu,useCacheRefresh:Dp,useEffectEvent:wp};function Gu(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:M({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vu={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=_n(),c=Ia(l);c.payload=t,n!=null&&(c.callback=n),t=Ka(e,c,l),t!==null&&(vn(t,e,l),ji(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=_n(),c=Ia(l);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=Ka(e,c,l),t!==null&&(vn(t,e,l),ji(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),l=Ia(n);l.tag=2,t!=null&&(l.callback=t),t=Ka(e,l,n),t!==null&&(vn(t,e,n),ji(t,e,n))}};function qp(e,t,n,l,c,u,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,m):t.prototype&&t.prototype.isPureReactComponent?!gi(n,l)||!gi(c,u):!0}function Pp(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Vu.enqueueReplaceState(t,t.state,null)}function Ol(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=M({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Gp(e){Dr(e)}function Vp(e){console.error(e)}function Yp(e){Dr(e)}function ro(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Ip(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Yu(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){ro(e,t)},n}function Kp(e){return e=Ia(e),e.tag=3,e}function Fp(e,t,n,l){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=l.value;e.payload=function(){return c(u)},e.callback=function(){Ip(t,n,l)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Ip(t,n,l),typeof c!="function"&&(el===null?el=new Set([this]):el.add(this));var S=l.stack;this.componentDidCatch(l.value,{componentStack:S!==null?S:""})})}function g2(e,t,n,l,c){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&El(t,n,c,!0),n=Xt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return nn===null?Ao():n.alternate===null&&jt===0&&(jt=3),n.flags&=-257,n.flags|=65536,n.lanes=c,l===Fr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),_d(e,l,c)),!1;case 22:return n.flags|=65536,l===Fr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),_d(e,l,c)),!1}throw Error(o(435,n.tag))}return _d(e,l,c),Ao(),!1}if(Ie)return t=Xt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==uu&&(e=Error(o(422),{cause:l}),bi(Dn(e,n)))):(l!==uu&&(t=Error(o(423),{cause:l}),bi(Dn(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=Dn(l,n),c=Yu(e.stateNode,l,c),vu(e,c),jt!==4&&(jt=2)),!1;var u=Error(o(520),{cause:l});if(u=Dn(u,n),Bi===null?Bi=[u]:Bi.push(u),jt!==4&&(jt=2),t===null)return!0;l=Dn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Yu(n.stateNode,l,e),vu(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(el===null||!el.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Kp(c),Fp(c,e,n,l),vu(n,c),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Iu=Error(o(461)),zt=!1;function Lt(e,t,n,l){t.child=e===null?Jm(t,null,n,l):Rl(t,e.child,n,l)}function Qp(e,t,n,l,c){n=n.render;var u=t.ref;if("ref"in l){var m={};for(var S in l)S!=="ref"&&(m[S]=l[S])}else m=l;return _l(t),l=Eu(e,t,n,m,u,c),S=_u(),e!==null&&!zt?(Au(e,t,c),Ea(e,t,c)):(Ie&&S&&qr(t),t.flags|=1,Lt(e,t,l,c),t.child)}function Xp(e,t,n,l,c){if(e===null){var u=n.type;return typeof u=="function"&&!iu(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Zp(e,t,u,l,c)):(e=Br(n.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Wu(e,c)){var m=u.memoizedProps;if(n=n.compare,n=n!==null?n:gi,n(m,l)&&e.ref===t.ref)return Ea(e,t,c)}return t.flags|=1,e=Sa(u,l),e.ref=t.ref,e.return=t,t.child=e}function Zp(e,t,n,l,c){if(e!==null){var u=e.memoizedProps;if(gi(u,l)&&e.ref===t.ref)if(zt=!1,t.pendingProps=l=u,Wu(e,c))(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,Ea(e,t,c)}return Ku(e,t,n,l,c)}function Jp(e,t,n,l){var c=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~u}else l=0,t.child=null;return $p(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ir(t,u!==null?u.cachePool:null),u!==null?ep(t,u):wu(),tp(t);else return l=t.lanes=536870912,$p(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(Ir(t,u.cachePool),ep(t,u),Xa(),t.memoizedState=null):(e!==null&&Ir(t,null),wu(),Xa());return Lt(e,t,c,n),t.child}function zi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $p(e,t,n,l,c){var u=gu();return u=u===null?null:{parent:At._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Ir(t,null),wu(),tp(t),e!==null&&El(e,t,l,!0),t.childLanes=c,null}function oo(e,t){return t=co({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wp(e,t,n){return Rl(t,e.child,null,n),e=oo(t,t.pendingProps),e.flags|=2,jn(t),t.memoizedState=null,e}function x2(e,t,n){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(l.mode==="hidden")return e=oo(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zi(null,e);if(ju(t),(e=gt)?(e=Nx(e,Un),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ha!==null?{id:Wn,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},n=Lm(e),n.return=t,t.child=n,Gt=t,gt=null)):e=null,e===null)throw Pa(t);return t.lanes=536870912,null}return oo(t,l)}var u=e.memoizedState;if(u!==null){var m=u.dehydrated;if(ju(t),c)if(t.flags&256)t.flags&=-257,t=Wp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(zt||El(e,t,n,!1),c=(n&e.childLanes)!==0,zt||c){if(Fa.current===null){if(l=mt,l!==null&&(m=Hh(l,n),m!==0&&m!==u.retryLane))throw u.retryLane=m,kl(e,m),vn(l,e,m),Iu;Ao()}t=Wp(e,t,n)}else e=u.treeContext,gt=Hn(m.nextSibling),Gt=t,Ie=!0,qa=null,Un=!1,e!==null&&Hm(t,e),t=oo(t,l),t.flags|=134221824;return t}return e=Sa(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ku(e,t,n,l,c){return _l(t),n=Eu(e,t,n,l,void 0,c),l=_u(),e!==null&&!zt?(Au(e,t,c),Ea(e,t,c)):(Ie&&l&&qr(t),t.flags|=1,Lt(e,t,n,c),t.child)}function eg(e,t,n,l,c,u){return _l(t),t.updateQueue=null,n=ap(t,l,n,c),np(e),l=_u(),e!==null&&!zt?(Au(e,t,u),Ea(e,t,u)):(Ie&&l&&qr(t),t.flags|=1,Lt(e,t,n,u),t.child)}function tg(e,t,n,l,c){if(_l(t),t.stateNode===null){var u=cs,m=n.contextType;typeof m=="object"&&m!==null&&(u=Qt(m)),u=new n(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Vu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},yu(t),m=n.contextType,u.context=typeof m=="object"&&m!==null?Qt(m):cs,u.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Gu(t,n,m,l),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(m=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),m!==u.state&&Vu.enqueueReplaceState(u,u.state,null),Ci(t,l,u,c),Ni(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var S=t.memoizedProps,C=Ol(n,S);u.props=C;var H=u.context,J=n.contextType;m=cs,typeof J=="object"&&J!==null&&(m=Qt(J));var ce=n.getDerivedStateFromProps;J=typeof ce=="function"||typeof u.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,J||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(S||H!==m)&&Pp(t,u,l,m),Ya=!1;var L=t.memoizedState;u.state=L,Ci(t,l,u,c),Ni(),H=t.memoizedState,S||L!==H||Ya?(typeof ce=="function"&&(Gu(t,n,ce,l),H=t.memoizedState),(C=Ya||qp(t,n,C,l,L,H,m))?(J||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=H),u.props=l,u.state=H,u.context=m,l=C):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,bu(e,t),m=t.memoizedProps,J=Ol(n,m),u.props=J,ce=t.pendingProps,L=u.context,H=n.contextType,C=cs,typeof H=="object"&&H!==null&&(C=Qt(H)),S=n.getDerivedStateFromProps,(H=typeof S=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==ce||L!==C)&&Pp(t,u,l,C),Ya=!1,L=t.memoizedState,u.state=L,Ci(t,l,u,c),Ni();var F=t.memoizedState;m!==ce||L!==F||Ya||e!==null&&e.dependencies!==null&&Vr(e.dependencies)?(typeof S=="function"&&(Gu(t,n,S,l),F=t.memoizedState),(J=Ya||qp(t,n,J,l,L,F,C)||e!==null&&e.dependencies!==null&&Vr(e.dependencies))?(H||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,F,C),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,F,C)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=F),u.props=l,u.state=F,u.context=C,l=J):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,bs(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Rl(t,e.child,null,c),t.child=Rl(t,null,n,c)):Lt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Ea(e,t,c),e}function ng(e,t,n,l){return Nl(),t.flags|=256,Lt(e,t,n,l),t.child}var Fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qu(e){return{baseLanes:e,cachePool:Im()}}function Xu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=En),e}function ag(e,t,n){var l=t.pendingProps,c=!1,u=(t.flags&128)!==0,m;if((m=u)||(m=e!==null&&e.memoizedState===null?!1:(Zt.current&2)!==0),m&&(c=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(c?Qa(t):Xa(),(e=gt)?(e=Nx(e,Un),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ha!==null?{id:Wn,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},n=Lm(e),n.return=t,t.child=n,Gt=t,gt=null)):e=null,e===null)throw Pa(t);return Qd(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,c?(Xa(),c=t.mode,u=co({mode:"hidden",children:u},c),l=jl(l,c,n,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=Qu(n),l.childLanes=Xu(e,m,n),t.memoizedState=Fu,zi(null,l)):(Qa(t),Zu(t,u))}var S=e.memoizedState;if(S!==null){var C=S.dehydrated;if(C!==null)return y2(e,t,u,m,l,C,S,n)}return c?(Xa(),c=l.fallback,u=t.mode,S=e.child,C=S.sibling,l=Sa(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&1206910976,C!==null?c=Sa(C,c):(c=jl(c,u,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,zi(null,l),l=t.child,c=e.child.memoizedState,c===null?c=Qu(n):(u=c.cachePool,u!==null?(S=At._currentValue,u=u.parent!==S?{parent:S,pool:S}:u):u=Im(),c={baseLanes:c.baseLanes|n,cachePool:u}),l.memoizedState=c,l.childLanes=Xu(e,m,n),t.memoizedState=Fu,zi(e.child,l)):(Qa(t),n=e.child,e=n.sibling,n=Sa(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Zu(e,t){return t=co({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function co(e,t){return e=gn(22,e,null,t),e.lanes=0,e}function uo(e,t,n){return Rl(t,e.child,null,n),e=Zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function y2(e,t,n,l,c,u,m,S){if(n)return t.flags&256?(Qa(t),t.flags&=-257,uo(e,t,S)):t.memoizedState!==null?(Xa(),t.child=e.child,t.flags|=128,null):(Xa(),u=c.fallback,m=t.mode,c=co({mode:"visible",children:c.children},m),u=jl(u,m,S,null),u.flags|=2,c.return=t,u.return=t,c.sibling=u,t.child=c,Rl(t,e.child,null,S),c=t.child,c.memoizedState=Qu(S),c.childLanes=Xu(e,l,S),t.memoizedState=Fu,zi(null,c));if(Qa(t),Qd(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var C=l.dgst;return l=C,l!==""&&(c=Error(o(419)),c.stack="",c.digest=l,bi({value:c,source:null,stack:null})),uo(e,t,S)}if(zt||El(e,t,S,!1),l=(S&e.childLanes)!==0,zt||l){if(Fa.current!==null)return uo(e,t,S);if(l=mt,l!==null&&(c=Hh(l,S),c!==0&&c!==m.retryLane))throw m.retryLane=c,kl(e,c),vn(l,e,c),Iu;return Fd(u)||Ao(),uo(e,t,S)}return Fd(u)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,gt=Hn(u.nextSibling),Gt=t,Ie=!0,qa=null,Un=!1,e!==null&&Hm(t,e),t=Zu(t,c.children),t.flags|=134221824,t)}function lg(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Gr(e.return,t,n)}function sg(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Jr(n)===null&&(t=e),e=e.sibling}return t}function fo(e,t,n,l,c,u){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:c,treeForkCount:u}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=n,m.tailMode=c,m.treeForkCount=u)}function Ju(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function $u(e,t,n){var l=t.pendingProps,c=l.revealOrder,u=l.tail;l=l.children;var m=Zt.current;if(t.flags&128)return Ei(t,m),null;var S=(m&2)!==0;if(S?(m=m&1|2,t.flags|=128):m&=1,Ei(t,m),c==="backwards"&&e!==null?(Ju(e),Lt(e,t,l,n),Ju(e)):Lt(e,t,l,n),l=Ie?yi:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lg(e,n,t);else if(e.tag===19)lg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":n=sg(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null,Ju(t)),fo(t,!0,c,null,u,l);break;case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Jr(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}fo(t,!0,n,null,u,l);break;case"together":fo(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:n=sg(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),fo(t,!1,c,n,u,l)}return t.child}function ig(e,t,n){var l=t.pendingProps;return Ga(t,t.type,l.value),Lt(e,t,l.children,n),t.child}function Ea(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(El(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Sa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Sa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Wu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vr(e)))}function b2(e,t,n){switch(t.tag){case 3:rn(t,t.stateNode.containerInfo),Ga(t,At,e.memoizedState.cache),Nl();break;case 27:case 5:Ce(t);break;case 4:rn(t,t.stateNode.containerInfo);break;case 10:Ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ju(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return Qa(t),t.flags|=128,null;l=El(e,t,n,!1);var c=t.child.childLanes;return l||(n&c)!==0?ag(e,t,n):(Qa(t),e=Ea(e,t,n),e!==null?e.sibling:null)}Qa(t);break;case 19:if(t.flags&128)return $u(e,t,n);if(c=(e.flags&128)!==0,l=(n&t.childLanes)!==0,l||(El(e,t,n,!1),l=(n&t.childLanes)!==0),c){if(l)return $u(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Ei(t,Zt.current),l)break;return null;case 22:return t.lanes=0,Jp(e,t,n,t.pendingProps);case 24:Ga(t,At,e.memoizedState.cache)}return Ea(e,t,n)}function rg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)zt=!0;else{if(!Wu(e,n)&&(t.flags&128)===0)return zt=!1,b2(e,t,n);zt=(e.flags&131072)!==0}else zt=!1,Ie&&(t.flags&1048576)!==0&&Bm(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=zl(t.elementType),t.type=e,typeof e=="function")iu(e)?(l=Ol(e,l),t.tag=1,t=tg(null,t,e,l,n)):(t.tag=0,t=Ku(null,t,e,l,n));else{if(e!=null){var c=e.$$typeof;if(c===V){t.tag=11,t=Qp(null,t,e,l,n);break e}else if(c===ve){t.tag=14,t=Xp(null,t,e,l,n);break e}else if(c===Q){t.tag=10,t.type=e,t=ig(null,t,n);break e}}throw t=me(e)||e,Error(o(306,t,""))}}return t;case 0:return Ku(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,c=Ol(l,t.pendingProps),tg(e,t,l,c,n);case 3:e:{if(rn(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var u=t.memoizedState;c=u.element,bu(e,t),Ci(t,l,null,n);var m=t.memoizedState;if(l=m.cache,Ga(t,At,l),l!==u.cache&&hu(t,[At],n,!0),Ni(),l=m.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=ng(e,t,l,n);break e}else if(l!==c){c=Dn(Error(o(424)),t),bi(c),t=ng(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(gt=Hn(e.firstChild),Gt=t,Ie=!0,qa=null,Un=!0,n=Jm(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Nl(),l===c){t=Ea(e,t,n);break e}Lt(e,t,l,n)}t=t.child}return t;case 26:return bs(e,t),e===null?(n=Mx(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ie||(t.stateNode=dx(t.type,t.pendingProps,Et.current,t)):t.memoizedState=Mx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&Ie&&(l=t.stateNode=_x(t.type,t.pendingProps,Et.current),Gt=t,Un=!0,c=gt,al(t.type)?(Xd=c,gt=Hn(l.firstChild)):gt=c),Lt(e,t,t.pendingProps.children,n),bs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((c=l=gt)&&(l=hS(l,t.type,t.pendingProps,Un),l!==null?(t.stateNode=l,Gt=t,gt=Hn(l.firstChild),Un=!1,c=!0):c=!1),c||Pa(t)),Ce(t),c=t.type,u=t.pendingProps,m=e!==null?e.memoizedProps:null,l=u.children,qd(c,u)?l=null:m!==null&&qd(c,m)&&(t.flags|=32),t.memoizedState!==null&&(c=Eu(e,t,o2,null,null,n),Us._currentValue=c),bs(e,t),Lt(e,t,l,n),t.child;case 6:return e===null&&Ie&&((e=n=gt)&&(n=mS(n,t.pendingProps,Un),n!==null?(t.stateNode=n,Gt=t,gt=null,e=!0):e=!1),e||Pa(t)),null;case 13:return ag(e,t,n);case 4:return rn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Rl(t,null,l,n):Lt(e,t,l,n),t.child;case 11:return Qp(e,t,t.type,t.pendingProps,n);case 7:return l=t.pendingProps,bs(e,t),Lt(e,t,l,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:return ig(e,t,n);case 9:return c=t.type._context,l=t.pendingProps.children,_l(t),c=Qt(c),l=l(c),t.flags|=1,Lt(e,t,l,n),t.child;case 14:return Xp(e,t,t.type,t.pendingProps,n);case 15:return Zp(e,t,t.type,t.pendingProps,n);case 19:return $u(e,t,n);case 31:return x2(e,t,n);case 22:return Jp(e,t,n,t.pendingProps);case 24:return _l(t),l=Qt(At),e===null?(c=gu(),c===null&&(c=mt,u=mu(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:l,cache:c},yu(t),Ga(t,At,c)):((e.lanes&n)!==0&&(bu(e,t),Ci(t,null,null,n),Ni()),c=e.memoizedState,u=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Ga(t,At,l)):(l=u.cache,Ga(t,At,l),l!==c.cache&&hu(t,[At],n,!0))),Lt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:Ie&&qr(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:bs(e,t),Lt(e,t,l.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function _a(e){e.flags|=4}function ed(e,t,n,l,c){var u;if((u=(e.mode&32)!==0)&&(u=n===null?Lx(t,l):Lx(t,l)&&(l.src!==n.src||l.srcSet!==n.srcSet)),u){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Gg())e.flags|=8192;else throw Ml=Fr,xu}else e.flags&=-16777217}function og(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ux(t))if(Gg())e.flags|=8192;else throw Ml=Fr,xu}function ho(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Lh():536870912,e.lanes|=t,js|=t)}function Mi(e,t){if(!Ie)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,l|=c.subtreeFlags&1206910976,l|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function v2(e,t,n){var l=t.pendingProps;switch(cu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return xt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ja(At),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fs(t)?_a(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,du())),xt(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(_a(t),u!==null?(xt(t),og(t,u)):(xt(t),ed(t,c,null,l,n))):u?u!==e.memoizedState?(_a(t),xt(t),og(t,u)):(xt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&_a(t),xt(t),ed(t,c,e,l,n)),null;case 27:if(We(t),n=Et.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&_a(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return xt(t),t.subtreeFlags&=-33554433,null}e=Ct.current,fs(t)?qm(t):(e=_x(c,l,n),t.stateNode=e,_a(t))}return xt(t),t.subtreeFlags&=-33554433,null;case 5:if(We(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&_a(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return xt(t),t.subtreeFlags&=-33554433,null}if(u=Ct.current,fs(t))qm(t);else{var m=Vi(Et.current);switch(u){case 1:u=m.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=m.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=m.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=m.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=m.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?m.createElement(c,{is:l.is}):m.createElement(c)}}u[Ft]=t,u[pn]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)u.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=u;e:switch($t(u,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&_a(t)}}return xt(t),t.subtreeFlags&=-33554433,ed(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&_a(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Et.current,fs(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,c=Gt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Ft]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||rx(e.nodeValue,n)),e||Pa(t,!0)}else e=Vi(e).createTextNode(l),e[Ft]=t,t.stateNode=e}return xt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=fs(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Ft]=t}else Nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else n=du(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jn(t),t):(jn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return xt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=fs(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[Ft]=t}else Nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),c=!1}else c=du(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(jn(t),t):(jn(t),null)}return jn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==c&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ho(t,t.updateQueue),xt(t),null);case 4:return ye(),e===null&&Od(t.stateNode.containerInfo),t.flags|=67108864,xt(t),null;case 10:return ja(t.type),xt(t),null;case 19:if(Nu(t),l=t.memoizedState,l===null)return xt(t),null;if(c=(t.flags&128)!==0,u=l.rendering,u===null)if(c)Mi(l,!1);else{if(jt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Jr(e),u!==null){for(t.flags|=128,Mi(l,!1),e=u.updateQueue,t.updateQueue=e,ho(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Om(n,e),n=n.sibling;return Ei(t,Zt.current&1|2),Ie&&wa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ot()>No&&(t.flags|=128,c=!0,Mi(l,!1),t.lanes=4194304)}else{if(!c)if(e=Jr(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,ho(t,e),Mi(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!Ie)return xt(t),null}else 2*Ot()-l.renderingStartTime>No&&n!==536870912&&(t.flags|=128,c=!0,Mi(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ot(),e.sibling=null,u=Zt.current,u=c?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!n||Ie?Ei(t,u):(n=u,Ve(Xt,t),Ve(Zt,n),nn===null&&(nn=t)),Ie&&wa(t,l.treeForkCount),e}return xt(t),null;case 22:case 23:return jn(t),ku(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),n=t.updateQueue,n!==null&&ho(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Ae(Tl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ja(At),xt(t),null;case 25:return null;case 30:return t.flags|=33554432,xt(t),null}throw Error(o(156,t.tag))}function S2(e,t){switch(cu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ja(At),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return We(t),null;case 31:if(t.memoizedState!==null){if(jn(t),t.alternate===null)throw Error(o(340));Nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Nu(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ye(),null;case 10:return ja(t.type),null;case 22:case 23:return jn(t),ku(),e!==null&&Ae(Tl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ja(At),null;case 25:return null;default:return null}}function cg(e,t){switch(cu(t),t.tag){case 3:ja(At),ye();break;case 26:case 27:case 5:We(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&jn(t);break;case 13:jn(t);break;case 19:Nu(t);break;case 10:ja(t.type);break;case 22:case 23:jn(t),ku(),e!==null&&Ae(Tl);break;case 24:ja(At)}}function Ri(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var c=l.next;n=c;do{if((n.tag&e)===e){l=void 0;var u=n.create,m=n.inst;l=u(),m.destroy=l}n=n.next}while(n!==c)}}catch(S){dt(t,t.return,S)}}function Za(e,t,n){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var u=c.next;l=u;do{if((l.tag&e)===e){var m=l.inst,S=m.destroy;if(S!==void 0){m.destroy=void 0,c=t;var C=n,H=S;try{H()}catch(J){dt(c,C,J)}}}l=l.next}while(l!==u)}}catch(J){dt(t,t.return,J)}}function ug(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wm(t,n)}catch(l){dt(e,e.return,l)}}}function dg(e,t,n){n.props=Ol(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){dt(e,t,l)}}function ta(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var c=e.stateNode,u=ba(e.memoizedProps,c);(c.ref===null||c.ref.name!==u)&&(c.ref=yx(u)),l=c.ref;break;case 7:if(e.stateNode===null){var m=new An(e);y(e.child,!1,dS,m,void 0,void 0),e.stateNode=m}l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(S){dt(e,t,S)}}function Jt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(c){dt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){dt(e,t,c)}else n.current=null}function mo(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)jx(e.stateNode,t[n])}function fg(e){for(var t=e.return;t!==null&&(nd(t)&&jx(e.stateNode,t.stateNode),!td(t));)t=t.return}function Di(e){for(var t=e.return;t!==null&&(nd(t)&&fS(e.stateNode,t.stateNode),!td(t));)t=t.return}function td(e){return e.tag===5||e.tag===3||e.tag===27}function nd(e){return e&&e.tag===7&&e.stateNode!==null}function ad(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(c){dt(e,e.return,c)}}function ld(e,t,n){try{var l=e.stateNode;F2(l,e.type,n,t),l[pn]=t}catch(c){dt(e,e.return,c)}}function hg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&al(e.type)||e.tag===4}function sd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&al(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function id(e,t,n,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(c,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(c),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$n)),mo(e,l),st=!0;else if(c!==4&&(c===27&&(mo(e,l),l=null,al(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(id(e,t,n,l),e=e.sibling;e!==null;)id(e,t,n,l),e=e.sibling}function po(e,t,n,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?n.insertBefore(c,t):n.appendChild(c),mo(e,l),st=!0;else if(c!==4&&(c===27&&(mo(e,l),l=null,al(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(po(e,t,n,l),e=e.sibling;e!==null;)po(e,t,n,l),e=e.sibling}function mg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);$t(t,l,n),t[Ft]=e,t[pn]=n}catch(u){dt(e,e.return,u)}}var go=!1,Nn=null;function pg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(go=!0)}var na=null;function gg(){var e=na;return na=null,e}var xn=0;function vs(e,t,n,l,c){return xn=0,xg(e.child,t,n,l,c)}function xg(e,t,n,l,c){for(var u=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(l!==null){var S=Vd(m);l.push(S),S.view&&(u=!0)}else u||Vd(m).view&&(u=!0);go=!0,gx(m,xn===0?t:t+"_"+xn,n),xn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||xg(e.child,t,n,l,c)&&(u=!0));e=e.sibling}return u}function aa(e,t){for(;e!==null;)e.tag===5?xx(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||aa(e.child,t)),e=e.sibling}function xo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(xo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var n=t.name;t=va(t.default,t.share),t!=="none"&&(vs(e,n,t,null,!1)||aa(e.child,!1))}e=e.sibling}}function rd(e,t){if(e.tag===30){var n=e.stateNode,l=e.memoizedProps,c=ba(l,n),u=va(l.default,n.paired?l.share:l.enter);u!=="none"?vs(e,c,u,null,!1)?(xo(e),n.paired||t||_s(e,l.onEnter)):aa(e.child,!1):xo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)rd(e,t),e=e.sibling;else xo(e)}function od(e){if(Nn!==null&&Nn.size!==0){var t=Nn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,l=n.name;if(l!=null&&l!=="auto"){var c=t.get(l);if(c!==void 0){var u=va(n.default,n.share);if(u!=="none"&&(vs(e,l,u,null,!1)?(u=e.stateNode,c.paired=u,u.paired=c,_s(e,n.onShare)):aa(e.child,!1)),t.delete(l),t.size===0)break}}}od(e)}e=e.sibling}}}function cd(e){if(e.tag===30){var t=e.memoizedProps,n=ba(t,e.stateNode),l=Nn!==null?Nn.get(n):void 0,c=va(t.default,l!==void 0?t.share:t.exit);c!=="none"&&(vs(e,n,c,null,!1)?l!==void 0?(c=e.stateNode,l.paired=c,c.paired=l,Nn.delete(n),_s(e,t.onShare)):_s(e,t.onExit):aa(e.child,!1)),Nn!==null&&od(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)cd(e),e=e.sibling;else Nn!==null&&od(e)}function yg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ba(t,e.stateNode);t=va(t.default,t.update),e.flags&=-5,t!=="none"&&vs(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&yg(e);e=e.sibling}}function ud(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,aa(e.child,!1))}ud(e)}e=e.sibling}}function yo(e){if(e.tag===30)e.stateNode.paired=null,aa(e.child,!1),ud(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)yo(e),e=e.sibling;else ud(e)}function bg(e){for(e=e.child;e!==null;)e.tag===30?aa(e.child,!1):(e.subtreeFlags&33554432)!==0&&bg(e),e=e.sibling}function dd(e,t,n,l,c,u,m){for(var S=!1;t!==null;){if(t.tag===5){var C=t.stateNode;if(u!==null&&xn<u.length){var H=u[xn],J=Vd(C);(H.view||J.view)&&(S=!0);var ce;if(ce=(e.flags&4)===0)if(J.clip)ce=!0;else{ce=H.rect;var L=J.rect;ce=ce.y!==L.y||ce.x!==L.x||ce.height!==L.height||ce.width!==L.width}ce&&(e.flags|=4),J.abs?J=!H.abs:(H=H.rect,J=J.rect,J=H.height!==J.height||H.width!==J.width),J&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&gx(C,xn===0?n:n+"_"+xn,c),S&&(e.flags&4)!==0||(na===null&&(na=[]),na.push(C,xn===0?l:l+"_"+xn,t.memoizedProps)),xn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:dd(e,t.child,n,l,c,u,m)&&(S=!0));t=t.sibling}return S}function vg(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=e.stateNode,c=ba(n,l),u=va(n.default,n.update),m;m=e.memoizedState,e.memoizedState=null,l=e;var S=e.child;xn=0,c=dd(l,S,c,c,u,m,!1),(e.flags&4)!==0&&c&&_s(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&vg(e);e=e.sibling}}var Vt=!1,ct=!1,la=!1,fd=!1,Sg=typeof WeakSet=="function"?WeakSet:Set,Yt=null,sa=!1,Oi=!1,bo=!1,hd=!1;function w2(e,t,n){if(e=e.containerInfo,Bd=Bs,e=Nm(e),Wc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var u=c.anchorOffset,m=c.focusNode;c=c.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var S=0,C=-1,H=-1,J=0,ce=0,L=e,F=null;t:for(;;){for(var Se;L!==l||u!==0&&L.nodeType!==3||(C=S+u),L!==m||c!==0&&L.nodeType!==3||(H=S+c),L.nodeType===3&&(S+=L.nodeValue.length),(Se=L.firstChild)!==null;)F=L,L=Se;for(;;){if(L===e)break t;if(F===l&&++J===u&&(C=S),F===m&&++ce===c&&(H=S),(Se=L.nextSibling)!==null)break;L=F,F=L.parentNode}L=Se}l=C===-1||H===-1?null:{start:C,end:H}}else l=null}l=l||{start:0,end:0}}else l=null;for(Hd={focusedElem:e,selectionRange:l},Bs=!1,n=(n&335544064)===n,Yt=t,t=n?9270:1024;Yt!==null;){if(e=Yt,n&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)n&&cd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)n&&pg(e),vo(n);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&n&&cd(l),vo(n);continue}else if(l!==null&&l.memoizedState!==null){n&&pg(e),vo(n);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Yt=l):(n&&yg(e),vo(n))}}Nn=null}function vo(e){for(;Yt!==null;){var t=Yt,n=e,l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&l!==null){n=void 0,c=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var m=Ol(t.type,c);n=u.getSnapshotBeforeUpdate(m,l),u.__reactInternalSnapshotBeforeUpdate=n}catch(S){dt(t,t.return,S)}}break;case 3:if((c&1024)!==0){if(l=t.stateNode.containerInfo,n=l.nodeType,n===9)Kd(l);else if(n===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Kd(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&l!==null&&(n=ba(l.memoizedProps,l.stateNode),c=t.memoizedProps,c=va(c.default,c.update),c!=="none"&&vs(l,n,c,l.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(o(163))}if(l=t.sibling,l!==null){l.return=t.return,Yt=l;break}Yt=t.return}}function wg(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:ia(e,n),l&4&&Ri(5,n);break;case 1:if(ia(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){dt(n,n.return,m)}else{var c=Ol(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){dt(n,n.return,m)}}l&64&&ug(n),l&512&&ta(n,n.return);break;case 3:if(ia(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wm(e,t)}catch(m){dt(n,n.return,m)}}break;case 27:t===null&&l&4&&mg(n);case 26:case 5:ia(e,n),t===null&&l&4&&ad(n),l&512&&ta(n,n.return);break;case 12:ia(e,n);break;case 31:ia(e,n),l&4&&Cg(e,n);break;case 13:ia(e,n),l&4&&Eg(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=D2.bind(null,n),pS(e,n))));break;case 22:if(l=n.memoizedState!==null||Vt,!l){var u=t!==null&&t.memoizedState!==null||ct;t=Vt,c=ct,Vt=l,(ct=u)&&!c?(l=2,(n.subtreeFlags&8772)!==0&&(l|=1),Kn(e,n,l)):ia(e,n),Vt=t,ct=c}break;case 30:ia(e,n),l&512&&ta(n,n.return);break;case 7:l&512&&ta(n,n.return);default:ia(e,n)}}function md(e,t){for(e=e.child;e!==null;)kg(e,t),e=e.sibling}function kg(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var l=n.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var c=e.stateNode,u=e.memoizedProps.style,m=u!=null&&u.hasOwnProperty("display")?u.display:null;c.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(C){dt(e,e.return,C)}pd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,st=!0}catch(C){dt(e,e.return,C)}break;case 18:try{var S=e.stateNode;t?px(S,!0):px(e.stateNode,!1)}catch(C){dt(e,e.return,C)}break;case 22:case 23:e.memoizedState===null&&md(e,t);break;default:md(e,t)}}function pd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,l=t;switch(n.tag){case 4:kg(n,l);break e;case 22:n.memoizedState===null&&pd(n,l);break e;default:pd(n,l)}}e=e.sibling}}function jg(e){var t=e.alternate;t!==null&&(e.alternate=null,jg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,yn=!1;function Yn(e,t,n){for(n=n.child;n!==null;)Ng(e,t,n),n=n.sibling}function Ng(e,t,n){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:ct||Jt(n,t),Yn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ct&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ct||Jt(n,t),Di(n);var l=St,c=yn;al(n.type)&&(St=n.stateNode,yn=!1),Yn(e,t,n),Ax(n.stateNode,n.type,n.memoizedProps),St=l,yn=c;break;case 5:ct||Jt(n,t),Di(n);case 6:if(n.tag===6&&Di(n),l=St,c=yn,St=null,Yn(e,t,n),St=l,yn=c,St!==null)if(yn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(n.stateNode),st=!0}catch(u){dt(n,t,u)}else try{St.removeChild(n.stateNode),st=!0}catch(u){dt(n,t,u)}break;case 18:St!==null&&(yn?(e=St,mx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Hs(e)):mx(St,n.stateNode));break;case 4:l=St,c=yn,St=n.stateNode.containerInfo,yn=!0,Yn(e,t,n),St=l,yn=c;break;case 0:case 11:case 14:case 15:Za(2,n,t),ct||Za(4,n,t),Yn(e,t,n);break;case 1:ct||(Jt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&dg(n,t,l)),Yn(e,t,n);break;case 21:Yn(e,t,n);break;case 22:ct=(l=ct)||n.memoizedState!==null,Yn(e,t,n),ct=l;break;case 30:Jt(n,t),Yn(e,t,n);break;case 7:ct||Jt(n,t),Yn(e,t,n);break;default:Yn(e,t,n)}}function Cg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hs(e)}catch(n){dt(t,t.return,n)}}}function Eg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hs(e)}catch(n){dt(t,t.return,n)}}function k2(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sg),t;default:throw Error(o(435,e.tag))}}function So(e,t){var n=k2(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var c=O2.bind(null,e,l);l.then(c,c)}})}function dn(e,t,n){var l=t.deletions;if(l!==null)for(var c=0;c<l.length;c++){var u=l[c],m=e,S=t,C=S;e:for(;C!==null;){switch(C.tag){case 27:if(al(C.type)){St=C.stateNode,yn=!1;break e}break;case 5:St=C.stateNode,yn=!1;break e;case 3:case 4:St=C.stateNode.containerInfo,yn=!0;break e}C=C.return}if(St===null)throw Error(o(160));Ng(m,S,u),St=null,yn=!1,m=u.alternate,m!==null&&(m.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_g(t,e,n),t=t.sibling}var In=null;function _g(e,t,n){var l=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var u=0;u<l.length;u++){var m=l[u];m.ref.impl=m.nextImpl}dn(t,e,n),fn(e),c&4&&(Za(3,e,e.return),Ri(3,e),Za(5,e,e.return));break;case 1:dn(t,e,n),fn(e),c&512&&(ct||l===null||Jt(l,l.return)),c&64&&Vt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(u=In,dn(t,e,n),fn(e),c&512&&(ct||l===null||Jt(l,l.return)),c&4)if(c=l!==null?l.memoizedState:null,n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null)if(Vt)e.stateNode=dx(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,c=u.ownerDocument||u;t:switch(t){case"title":l=c.getElementsByTagName("title")[0],(!l||l[ri]||l[Ft]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=c.createElement(t),c.head.insertBefore(l,c.querySelector("head > title"))),$t(l,t,n),l[Ft]=e,Pt(l),t=l;break e;case"link":if(u=Ox("link","href",c).get(t+(n.href||""))){for(m=0;m<u.length;m++)if(l=u[m],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){u.splice(m,1);break t}}l=c.createElement(t),$t(l,t,n),c.head.appendChild(l);break;case"meta":if(u=Ox("meta","content",c).get(t+(n.content||""))){for(m=0;m<u.length;m++)if(l=u[m],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){u.splice(m,1);break t}}l=c.createElement(t),$t(l,t,n),c.head.appendChild(l);break;default:throw Error(o(468,t))}l[Ft]=e,Pt(l),t=l}e.stateNode=t}else Vt||Wd(u,e.type,e.stateNode);else e.stateNode=Dx(u,n,e.memoizedProps);else c!==n?(c===null?(t=l.stateNode,t===null||ct||t.parentNode.removeChild(t)):c.count--,n===null?Vt||Wd(u,e.type,e.stateNode):Dx(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&ld(e,e.memoizedProps,l.memoizedProps);break;case 27:dn(t,e,n),fn(e),c&512&&(ct||l===null||Jt(l,l.return)),l!==null&&c&4&&ld(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=la,la=!1,dn(t,e,n),la=u,fn(e),c&512&&(ct||l===null||Jt(l,l.return)),e.flags&32){t=e.stateNode;try{ns(t,""),st=!0}catch(J){dt(e,e.return,J)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,ld(e,t,l!==null?l.memoizedProps:t)),c&1024&&(fd=!0);break;case 6:if(dn(t,e,n),fn(e),c&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,st=!0}catch(J){dt(e,e.return,J)}}break;case 3:if(st=!1,Lo=null,u=In,In=Yi(t.containerInfo),dn(t,e,n),In=u,fn(e),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Hs(t.containerInfo)}catch(J){dt(e,e.return,J)}fd&&(fd=!1,Ag(e)),st=!1;break;case 4:c=la,la=Vt,l=Xh(),u=In,In=Yi(e.stateNode.containerInfo),dn(t,e,n),fn(e),In=u,st&&Oi&&(bo=!0),st=l,la=c;break;case 12:dn(t,e,n),fn(e);break;case 31:dn(t,e,n),fn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,So(e,t)));break;case 13:dn(t,e,n),fn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(jo=Ot()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,So(e,t)));break;case 22:u=e.memoizedState!==null,m=l!==null&&l.memoizedState!==null;var S=Vt,C=ct,H=la;Vt=S||u,la=H||u,ct=C||m,dn(t,e,n),ct=C,la=H,Vt=S,fn(e),c&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||m||Vt||ct||(t=m||ct,n=Vt,l=ct,Vt=u||Vt,ct=t,Ja(e,2),Vt=n,ct=l),!u&&la||md(e,u)),c&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,So(e,n))));break;case 19:dn(t,e,n),fn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,So(e,t)));break;case 30:c&512&&(ct||l===null||Jt(l,l.return)),c=Xh(),u=Oi,m=(n&335544064)===n,S=e.memoizedProps,Oi=m&&va(S.default,S.update)!=="none",dn(t,e,n),fn(e),m&&l!==null&&st&&(e.flags|=4),Oi=u,st=c;break;case 21:break;case 7:c&512&&(ct||l===null||Jt(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:dn(t,e,n),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(hg(l)){n=l;break}l=l.return}l=null;for(var c=e.return;c!==null;){if(nd(c)){var u=c.stateNode;l===null?l=[u]:l.push(u)}if(td(c))break;c=c.return}var m=l;if(n==null)throw Error(o(160));switch(n.tag){case 27:var S=n.stateNode,C=sd(e);po(e,C,S,m);break;case 5:var H=n.stateNode;n.flags&32&&(ns(H,""),n.flags&=-33);var J=sd(e);po(e,J,H,m);break;case 3:case 4:var ce=n.stateNode.containerInfo,L=sd(e);id(e,L,ce,m);break;default:throw Error(o(161))}}catch(F){dt(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ag(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ag(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Bs=!0,t.reset(),Bs=!1),e=e.sibling}}function Ss(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Tg(t,e),t=t.sibling;else vg(t)}function Tg(e,t){var n=e.alternate;if(n===null)rd(e,!1);else switch(e.tag){case 3:if(hd=sa=!1,gg(),Ss(t,e),!sa&&!bo){if(e=na,e!==null)for(var l=0;l<e.length;l+=3){n=e[l];var c=e[l+1];xx(n,e[l+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),hd=!0}na=null;break;case 5:Ss(t,e);break;case 4:l=sa,sa=!1,Ss(t,e),sa&&(bo=!0),sa=l;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?rd(e,!1):Ss(t,e));break;case 30:l=sa,c=gg(),sa=!1,Ss(t,e),sa&&(e.flags|=4);var u=e.memoizedProps,m=e.stateNode;t=ba(u,m),m=ba(n.memoizedProps,m);var S=va(u.default,u.update);S==="none"?t=!1:(u=n.memoizedState,n.memoizedState=null,n=e.child,xn=0,t=dd(e,n,t,m,S,u,!0),xn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(_s(e,e.memoizedProps.onUpdate),na=c):c!==null&&(c.push.apply(c,na),na=c),sa=(e.flags&32)!==0?!0:l;break;default:Ss(t,e)}}function ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wg(e,t.alternate,t),t=t.sibling}function Ja(e,t){for(e=e.child;e!==null;){var n=e,l=t;switch(n.tag){case 0:case 11:case 14:case 15:Za(4,n,n.return),Ja(n,l);break;case 1:Jt(n,n.return);var c=n.stateNode;typeof c.componentWillUnmount=="function"&&dg(n,n.return,c),Ja(n,l);break;case 27:(l&2)!==0&&Ax(n.stateNode,n.type,n.memoizedProps);case 5:Jt(n,n.return),n.tag!==5&&n.tag!==27||Di(n),Ja(n,l);break;case 6:Di(n);break;case 26:Jt(n,n.return),c=n.stateNode,n.memoizedState!==null||c===null||ct||c.parentNode.removeChild(c),Ja(n,l);break;case 22:n.memoizedState===null&&Ja(n,l);break;case 30:Jt(n,n.return),Ja(n,l);break;case 7:Jt(n,n.return);default:Ja(n,l)}e=e.sibling}}function Kn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var l=t.alternate,c=e,u=t,m=u.flags,S=(n&1)!==0;switch(u.tag){case 0:case 11:case 15:Kn(c,u,n),Ri(4,u);break;case 1:if(Kn(c,u,n),l=u,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(J){dt(l,l.return,J)}if(l=u,c=l.updateQueue,c!==null){var C=l.stateNode;try{var H=c.shared.hiddenCallbacks;if(H!==null)for(c.shared.hiddenCallbacks=null,c=0;c<H.length;c++)$m(H[c],C)}catch(J){dt(l,l.return,J)}}S&&m&64&&ug(u),ta(u,u.return);break;case 27:(n&2)!==0&&mg(u);case 5:u.tag!==5&&u.tag!==27||fg(u),Kn(c,u,n),S&&l===null&&m&4&&ad(u),ta(u,u.return);break;case 6:fg(u);break;case 26:C=u.stateNode,u.memoizedState!==null||C===null||Vt||Wd(Yi(C.ownerDocument),u.type,C),Kn(c,u,n),S&&l===null&&m&4&&ad(u),ta(u,u.return);break;case 12:Kn(c,u,n);break;case 31:Kn(c,u,n),S&&m&4&&Cg(c,u);break;case 13:Kn(c,u,n),S&&m&4&&Eg(c,u);break;case 22:u.memoizedState===null&&Kn(c,u,n),ta(u,u.return);break;case 30:Kn(c,u,n),ta(u,u.return);break;case 7:ta(u,u.return);default:Kn(c,u,n)}t=t.sibling}}function gd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&vi(n))}function xd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vi(e))}function Bn(e,t,n,l){var c=(n&335544064)===n;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)zg(e,t,n,l),t=t.sibling;else c&&bg(t)}function zg(e,t,n,l){var c=(n&335544064)===n;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&yo(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:Bn(e,t,n,l),u&2048&&Ri(9,t);break;case 1:Bn(e,t,n,l);break;case 3:Bn(e,t,n,l),c&&hd&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&vi(u)));break;case 12:if(u&2048){Bn(e,t,n,l),u=t.stateNode;try{var m=t.memoizedProps,S=m.id,C=m.onPostCommit;typeof C=="function"&&C(S,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(H){dt(t,t.return,H)}}else Bn(e,t,n,l);break;case 31:Bn(e,t,n,l);break;case 13:Bn(e,t,n,l);break;case 23:break;case 22:m=t.stateNode,S=t.alternate,t.memoizedState!==null?(c&&S!==null&&S.memoizedState===null&&yo(S),m._visibility&2?Bn(e,t,n,l):Li(e,t)):(c&&S!==null&&S.memoizedState!==null&&yo(t),m._visibility&2?Bn(e,t,n,l):(m._visibility|=2,ws(e,t,n,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&gd(S,t);break;case 24:Bn(e,t,n,l),u&2048&&xd(t.alternate,t);break;case 30:c&&(u=t.alternate,u!==null&&(aa(u.child,!0),aa(t.child,!0))),Bn(e,t,n,l);break;default:Bn(e,t,n,l)}}function ws(e,t,n,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,m=t,S=n,C=l,H=m.flags;switch(m.tag){case 0:case 11:case 15:ws(u,m,S,C,c),Ri(8,m);break;case 23:break;case 22:var J=m.stateNode;m.memoizedState!==null?J._visibility&2?ws(u,m,S,C,c):Li(u,m):(J._visibility|=2,ws(u,m,S,C,c)),c&&H&2048&&gd(m.alternate,m);break;case 24:ws(u,m,S,C,c),c&&H&2048&&xd(m.alternate,m);break;default:ws(u,m,S,C,c)}t=t.sibling}}function Li(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,c=l.flags;switch(l.tag){case 22:Li(n,l),c&2048&&gd(l.alternate,l);break;case 24:Li(n,l),c&2048&&xd(l.alternate,l);break;default:Li(n,l)}t=t.sibling}}var Ll=8192;function Ul(e,t,n){if(e.subtreeFlags&Ll)for(e=e.child;e!==null;)Mg(e,t,n),e=e.sibling}function Mg(e,t,n){switch(e.tag){case 26:Ul(e,t,n),e.flags&Ll&&(e.memoizedState!==null?AS(n,In,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Hx(n,e)));break;case 5:Ul(e,t,n),e.flags&Ll&&(e=e.stateNode,(t&335544128)===t&&Hx(n,e));break;case 3:case 4:var l=In;In=Yi(e.stateNode.containerInfo),Ul(e,t,n),In=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ll,Ll=16777216,Ul(e,t,n),Ll=l):Ul(e,t,n));break;case 30:if((e.flags&Ll)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var c=e.stateNode;c.paired=null,Nn===null&&(Nn=new Map),Nn.set(l,c)}Ul(e,t,n);break;default:Ul(e,t,n)}}function Rg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Yt=l,Og(l,e)}Rg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dg(e),e=e.sibling}function Dg(e){switch(e.tag){case 0:case 11:case 15:Ui(e),e.flags&2048&&Za(9,e,e.return);break;case 3:Ui(e);break;case 12:Ui(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,wo(e)):Ui(e);break;default:Ui(e)}}function wo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Yt=l,Og(l,e)}Rg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Za(8,t,t.return),wo(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,wo(t));break;default:wo(t)}e=e.sibling}}function Og(e,t){for(;Yt!==null;){var n=Yt;switch(n.tag){case 0:case 11:case 15:Za(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:vi(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Yt=l;else e:for(n=e;Yt!==null;){l=Yt;var c=l.sibling,u=l.return;if(jg(l),l===n){Yt=null;break e}if(c!==null){c.return=u,Yt=c;break e}Yt=u}}}var j2={getCacheForType:function(e){var t=Qt(At),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qt(At).controller.signal}},N2=typeof WeakMap=="function"?WeakMap:Map,rt=0,mt=null,Qe=null,Je=0,ut=0,Cn=null,$a=!1,ks=!1,yd=!1,Aa=0,jt=0,Wa=0,Bl=0,ko=0,En=0,js=0,Bi=null,bn=null,bd=!1,jo=0,Lg=0,No=1/0,Co=null,el=null,wt=0,Fn=null,Hl=null,ra=0,vd=0,Sd=null,Ug=null,Ns=null,Cs=null,Es=null,Hi=0,Eo=null;function _n(){return(rt&2)!==0&&Je!==0?Je&-Je:U.T!==null?zd():qh()}function Bg(){if(En===0)if((Je&536870912)===0||Ie){var e=vr;vr<<=1,(vr&3932160)===0&&(vr=262144),En=e}else En=536870912;return e=Xt.current,e!==null&&(e.flags|=32),En}function _s(e,t){if(t!=null){var n=e.stateNode,l=n.ref;l===null&&(l=n.ref=yx(ba(e.memoizedProps,n))),Cs===null&&(Cs=[]),Cs.push(t.bind(null,l))}}function vn(e,t,n){(e===mt&&(ut===2||ut===9)||e.cancelPendingCommit!==null)&&(As(e,0),tl(e,Je,En,!1)),ii(e,n),((rt&2)===0||e!==mt)&&(e===mt&&((rt&2)===0&&(Bl|=n),jt===4&&tl(e,Je,En,!1)),oa(e))}function Hg(e,t,n){if((rt&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||si(e,t),c=l?_2(e,t):kd(e,t,!0),u=l;do{if(c===0){ks&&!l&&tl(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!C2(n)){c=kd(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var S=e;c=Bi;var C=S.current.memoizedState.isDehydrated;if(C&&(As(S,m).flags|=256),m=kd(S,m,!1),m!==2&&m!==6){if(yd&&!C){S.errorRecoveryDisabledLanes|=u,Bl|=u,c=4;break e}u=bn,bn=c,u!==null&&(bn===null?bn=u:bn.push.apply(bn,u))}c=m}if(u=!1,c!==2)continue}}if(c===1){As(e,0),tl(e,t,0,!0);break}e:{switch(l=e,u=c,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:tl(l,t,En,!$a);break e;case 2:bn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=jo+300-Ot(),10<c)){if(tl(l,t,En,!$a),wr(l,0,!0)!==0)break e;ra=t,l.timeoutHandle=Gd(qg.bind(null,l,n,bn,Co,bd,t,En,Bl,js,$a,u,"Throttled",-0,0),c);break e}qg(l,n,bn,Co,bd,t,En,Bl,js,$a,u,null,-0,0)}}break}while(!0);oa(e)}function qg(e,t,n,l,c,u,m,S,C,H,J,ce,L,F){e.timeoutHandle=-1;var Se=t.subtreeFlags,_e=(u&335544064)===u;if(ce=null,(_e||Se&8192||(Se&16785408)===16785408)&&(ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},Nn=null,Mg(t,u,ce),_e&&(Se=ce,_e=e.containerInfo,_e=(_e.nodeType===9?_e:_e.ownerDocument).__reactViewTransition,_e!=null&&(Se.count++,Se.waitingForViewTransition=!0,Se=Fi.bind(Se),_e.finished.then(Se,Se))),Se=(u&62914560)===u?jo-Ot():(u&4194048)===u?Lg-Ot():0,Se=TS(ce,Se),Se!==null)){ra=u,e.cancelPendingCommit=Se(Qg.bind(null,e,t,u,n,l,c,m,S,C,H,J,ce,null,L,F)),tl(e,u,m,!H);return}Qg(e,t,u,n,l,c,m,S,C,H,J,ce)}function C2(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var c=n[l],u=c.getSnapshot;c=c.value;try{if(!kn(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function tl(e,t,n,l){t=Oh(e,t),t&=~ko,t&=~Bl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var u=31-et(c),m=1<<u;l[u]=-1,c&=~m}n!==0&&Uh(e,n,t)}function _o(){return(rt&6)===0?(qi(0),!1):!0}function wd(){if(Qe!==null){if(ut===0)var e=Qe.return;else e=Qe,ka=Cl=null,Tu(e),ps=null,ki=0,e=Qe;for(;e!==null;)cg(e.alternate,e),e=e.return;Qe=null}}function As(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Z2(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ra=0,wd(),mt=e,Qe=n=Sa(e.current,null),Je=t,ut=0,Cn=null,$a=!1,ks=si(e,t),yd=!1,js=En=ko=Bl=Wa=jt=0,bn=Bi=null,bd=!1,Aa=Oh(e,t),Or(),n}function Pg(e,t){He=null,U.H=io,t===ms||t===Kr?(t=Qm(),ut=3):t===xu?(t=Qm(),ut=4):ut=t===Iu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Cn=t,Qe===null&&(jt=1,ro(e,Dn(t,e.current)))}function Gg(){var e=Xt.current;return e===null?!0:(Je&4194048)===Je?nn===null:(Je&62914560)===Je||(Je&536870912)!==0?e===nn:!1}function Vg(){var e=U.H;return U.H=io,e===null?io:e}function Yg(){var e=U.A;return U.A=j2,e}function Ao(){jt=4,$a||(Je&4194048)!==Je&&Xt.current!==null||(ks=!0),(Wa&134217727)===0&&(Bl&134217727)===0||mt===null||tl(mt,Je,En,!1)}function kd(e,t,n){var l=rt;rt|=2;var c=Vg(),u=Yg();(mt!==e||Je!==t)&&(Co=null,As(e,t)),t=!1;var m=jt;e:do try{if(ut!==0&&Qe!==null){var S=Qe,C=Cn;switch(ut){case 8:wd(),m=6;break e;case 3:case 2:case 9:case 6:Xt.current===null&&(t=!0);var H=ut;if(ut=0,Cn=null,Ts(e,S,C,H),n&&ks){m=0;break e}break;default:H=ut,ut=0,Cn=null,Ts(e,S,C,H)}}E2(),m=jt;break}catch(J){Pg(e,J)}while(!0);return t&&e.shellSuspendCounter++,ka=Cl=null,rt=l,U.H=c,U.A=u,Qe===null&&(mt=null,Je=0,Or()),m}function E2(){for(;Qe!==null;)Ig(Qe)}function _2(e,t){var n=rt;rt|=2;var l=Vg(),c=Yg();mt!==e||Je!==t?(Co=null,No=Ot()+500,As(e,t)):ks=si(e,t);e:do try{if(ut!==0&&Qe!==null){t=Qe;var u=Cn;t:switch(ut){case 1:ut=0,Cn=null,Ts(e,t,u,1);break;case 2:case 9:if(Km(u)){ut=0,Cn=null,Kg(t);break}t=function(){ut!==2&&ut!==9||mt!==e||(ut=7),oa(e)},u.then(t,t);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:Km(u)?(ut=0,Cn=null,Kg(t)):(ut=0,Cn=null,Ts(e,t,u,7));break;case 5:var m=null;switch(Qe.tag){case 26:m=Qe.memoizedState;case 5:case 27:var S=Qe;if(m?Ux(m):S.stateNode.complete){ut=0,Cn=null;var C=S.sibling;if(C!==null)Qe=C;else{var H=S.return;H!==null?(Qe=H,To(H)):Qe=null}break t}}ut=0,Cn=null,Ts(e,t,u,5);break;case 6:ut=0,Cn=null,Ts(e,t,u,6);break;case 8:wd(),jt=6;break e;default:throw Error(o(462))}}A2();break}catch(J){Pg(e,J)}while(!0);return ka=Cl=null,U.H=l,U.A=c,rt=n,Qe!==null?0:(mt=null,Je=0,Or(),jt)}function A2(){for(;Qe!==null&&!hn();)Ig(Qe)}function Ig(e){var t=rg(e.alternate,e,Aa);e.memoizedProps=e.pendingProps,t===null?To(e):Qe=t}function Kg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=eg(n,t,t.pendingProps,t.type,void 0,Je);break;case 11:t=eg(n,t,t.pendingProps,t.type.render,t.ref,Je);break;case 5:Tu(t);var l=t;l===Gt&&(Ie?(Pr(l),l.tag===5&&l.stateNode!=null&&(gt=l.stateNode)):(Pr(l),Ie=!0));default:cg(n,t),t=Qe=Om(t,Aa),t=rg(n,t,Aa)}e.memoizedProps=e.pendingProps,t===null?To(e):Qe=t}function Ts(e,t,n,l){ka=Cl=null,Tu(t),ps=null,ki=0;var c=t.return;try{if(g2(e,c,t,n,Je)){jt=1,ro(e,Dn(n,e.current)),Qe=null;return}}catch(u){if(c!==null)throw Qe=c,u;jt=1,ro(e,Dn(n,e.current)),Qe=null;return}t.flags&32768?(Ie||l===1?e=!0:ks||(Je&536870912)!==0?e=!1:($a=e=!0,(l===2||l===9||l===3||l===6)&&(l=Xt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Fg(t,e)):To(t)}function To(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,$a);return}e=t.return;var n=v2(t.alternate,t,Aa);if(n!==null){Qe=n;return}if(t=t.sibling,t!==null){Qe=t;return}Qe=t=e}while(t!==null);jt===0&&(jt=5)}function Fg(e,t){do{var n=S2(e.alternate,e);if(n!==null){n.flags&=32767,Qe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Qe=e;return}Qe=e=n}while(e!==null);jt=6,Qe=null}function Qg(e,t,n,l,c,u,m,S,C,H,J,ce){e.cancelPendingCommit=null;do zo();while(wt!==0);if((rt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===mt&&(Qe=mt=null,Je=0),Hl=t,Fn=e,ra=n,Sd=c,Ug=l,T2(e,t,n,m,S,C,ce)}}function T2(e,t,n,l,c,u,m){var S=t.lanes|t.childLanes;if(vd=S,S|=lu,n1(e,n,S,l,c,u),Cs=null,(n&335544064)===n?(Es=l2(e),l=10262):(Es=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,L2(gl,function(){return Ed(),null})):(e.callbackNode=null,e.callbackPriority=0),go=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=U.T,U.T=null,c=fe.p,fe.p=2,u=rt,rt|=4;try{w2(e,t,n)}finally{rt=u,fe.p=c,U.T=l}}wt=1,go?Ns=nS(m,e.containerInfo,Es,jd,Nd,M2,Cd,Ed,z2):(jd(),Nd(),Cd())}function z2(e){if(wt!==0){var t=Fn.onRecoverableError;t(e,{componentStack:null})}}function M2(){wt===3&&(wt=0,Tg(Hl,Fn),wt=4)}function jd(){if(wt===1){wt=0;var e=Fn,t=Hl,n=ra,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=U.T,U.T=null;var c=fe.p;fe.p=2;var u=rt;rt|=4;try{Oi=bo=!1,_g(t,e,n),n=Hd;var m=Nm(e.containerInfo),S=n.focusedElem,C=n.selectionRange;if(m!==S&&S&&S.ownerDocument&&jm(S.ownerDocument.documentElement,S)){if(C!==null&&Wc(S)){var H=C.start,J=C.end;if(J===void 0&&(J=H),"selectionStart"in S)S.selectionStart=H,S.selectionEnd=Math.min(J,S.value.length);else{var ce=S.ownerDocument||document,L=ce&&ce.defaultView||window;if(L.getSelection){var F=L.getSelection(),Se=S.textContent.length,_e=Math.min(C.start,Se),qe=C.end===void 0?_e:Math.min(C.end,Se);!F.extend&&_e>qe&&(m=qe,qe=_e,_e=m);var B=km(S,_e),R=km(S,qe);if(B&&R&&(F.rangeCount!==1||F.anchorNode!==B.node||F.anchorOffset!==B.offset||F.focusNode!==R.node||F.focusOffset!==R.offset)){var Y=ce.createRange();Y.setStart(B.node,B.offset),F.removeAllRanges(),_e>qe?(F.addRange(Y),F.extend(R.node,R.offset)):(Y.setEnd(R.node,R.offset),F.addRange(Y))}}}}for(ce=[],F=S;F=F.parentNode;)F.nodeType===1&&ce.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ce.length;S++){var oe=ce[S];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Bs=!!Bd,Hd=Bd=null}finally{rt=u,fe.p=c,U.T=l}}e.current=t,wt=2}}function Nd(){if(wt===2){wt=0;var e=Fn,t=Hl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var l=fe.p;fe.p=2;var c=rt;rt|=4;try{wg(e,t.alternate,t)}finally{rt=c,fe.p=l,U.T=n}}wt=3}}function Cd(){if(wt===4||wt===3){wt=0;var e=Ns;Ns=null,Kt();var t=Fn,n=Hl,l=ra,c=Ug,u=(l&335544064)===l?10262:10256;if((n.subtreeFlags&u)!==0||(n.flags&u)!==0?wt=5:(wt=0,Hl=Fn=null,Xg(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(el=null),Oc(l),n=n.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=U.T,u=fe.p,fe.p=2,U.T=null;try{for(var m=t.onRecoverableError,S=0;S<c.length;S++){var C=c[S];m(C.value,{componentStack:C.stack})}}finally{U.T=n,fe.p=u}}if(c=Cs,m=Es,Es=null,c!==null&&(Cs=null,m===null&&(m=[]),e!==null))for(C=0;C<c.length;C++)n=(0,c[C])(m),n!==void 0&&e.finished.finally(n);(ra&3)!==0&&zo(),oa(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Eo?Hi++:(Hi=0,Eo=t):(Hi=0,Eo=null),qi(0)}}function Xg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vi(t)))}function zo(){return Ns!==null&&(Ns.skipTransition(),Ns=null),jd(),Nd(),Cd(),Ed()}function Ed(){if(wt!==5)return!1;var e=Fn,t=vd;vd=0;var n=Oc(ra),l=U.T,c=fe.p;try{fe.p=32>n?32:n,U.T=null,n=Sd,Sd=null;var u=Fn,m=ra;if(wt=0,Hl=Fn=null,ra=0,(rt&6)!==0)throw Error(o(331));var S=rt;if(rt|=4,Dg(u.current),zg(u,u.current,m,n),rt=S,qi(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Ye,u)}catch{}return!0}finally{fe.p=c,U.T=l,Xg(e,t)}}function Zg(e,t,n){t=Dn(n,t),t=Yu(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(ii(e,2),oa(e))}function dt(e,t,n){if(e.tag===3)Zg(e,e,n);else for(;t!==null;){if(t.tag===3){Zg(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(el===null||!el.has(l))){e=Dn(n,e),n=Kp(2),l=Ka(t,n,2),l!==null&&(Fp(n,l,t,e),ii(l,2),oa(l));break}}t=t.return}}function _d(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new N2;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(n)||(yd=!0,c.add(n),e=R2.bind(null,e,t,n),t.then(e,e))}function R2(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,mt===e&&(Je&n)===n&&((jt===4||jt===3&&(Je&62914560)===Je&&300>Ot()-jo)&&(rt&2)===0?As(e,0):ko|=n,js===Je&&(js=0)),oa(e)}function Jg(e,t){t===0&&(t=Lh()),e=kl(e,t),e!==null&&(ii(e,t),oa(e))}function D2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jg(e,n)}function O2(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Jg(e,n)}function L2(e,t){return It(e,t)}var zs=null,Ms=null,Ad=!1,Mo=!1,Td=!1,nl=0;function oa(e){e!==Ms&&e.next===null&&(Ms===null?zs=Ms=e:Ms=Ms.next=e),Mo=!0,Ad||(Ad=!0,B2())}function qi(e,t){if(!Td&&Mo){Td=!0;do for(var n=!1,l=zs;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var u=0;else{var m=l.suspendedLanes,S=l.pingedLanes;u=(1<<31-et(42|e)+1)-1,u&=c&~(m&~S),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,tx(l,u))}else u=Je,u=wr(l,l===mt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||si(l,u)||(n=!0,tx(l,u));l=l.next}while(n);Td=!1}}function U2(){$g()}function $g(){Mo=Ad=!1;var e=0;nl!==0&&X2()&&(e=nl);for(var t=Ot(),n=null,l=zs;l!==null;){var c=l.next,u=Wg(l,t);u===0?(l.next=null,n===null?zs=c:n.next=c,c===null&&(Ms=n)):(n=l,(e!==0||(u&3)!==0)&&(Mo=!0)),l=c}wt!==0&&wt!==5||qi(e),nl!==0&&(nl=0)}function Wg(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var m=31-et(u),S=1<<m,C=c[m];C===-1?((S&n)===0||(S&l)!==0)&&(c[m]=t1(S,t)):C<=t&&(e.expiredLanes|=S),u&=~S}if(t=mt,n=Je,n=wr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(ut===2||ut===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&on(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||si(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&on(l),Oc(n)){case 2:case 8:n=ni;break;case 32:n=gl;break;case 268435456:n=ai;break;default:n=gl}return l=ex.bind(null,e),n=It(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&on(l),e.callbackPriority=2,e.callbackNode=null,2}function ex(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zo()&&e.callbackNode!==n)return null;var l=Je;return l=wr(e,e===mt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Hg(e,l,t),Wg(e,Ot()),e.callbackNode!=null&&e.callbackNode===n?ex.bind(null,e):null)}function tx(e,t){if(zo())return null;Hg(e,t,!0)}function B2(){J2(function(){(rt&6)!==0?It(ti,U2):$g()})}function zd(){if(nl===0){var e=Al;e===0&&(e=br,br<<=1,(br&261888)===0&&(br=256)),nl=e}return nl}function nx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Er(e)}function H2(e,t,n,l,c){if(t==="submit"&&n&&n.stateNode===c){var u=nx((c[pn]||null).action),m=l.submitter;m&&(t=(t=m[pn]||null)?nx(t.formAction):m.getAttribute("formAction"),t!==null&&(u=t,m=null));var S=new zr("action","action",null,l,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(nl!==0){var C=new FormData(c,m);Hu(n,{pending:!0,data:C,method:c.method,action:u},null,C)}}else typeof u=="function"&&(S.preventDefault(),C=new FormData(c,m),Hu(n,{pending:!0,data:C,method:c.method,action:u},u,C))},currentTarget:c}]})}}for(var Md=0;Md<au.length;Md++){var Rd=au[Md],q2=Rd.toLowerCase(),P2=Rd[0].toUpperCase()+Rd.slice(1);Vn(q2,"on"+P2)}Vn(_m,"onAnimationEnd"),Vn(Am,"onAnimationIteration"),Vn(Tm,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(Z1,"onTransitionRun"),Vn(J1,"onTransitionStart"),Vn($1,"onTransitionCancel"),Vn(zm,"onTransitionEnd"),es("onMouseEnter",["mouseout","mouseover"]),es("onMouseLeave",["mouseout","mouseover"]),es("onPointerEnter",["pointerout","pointerover"]),es("onPointerLeave",["pointerout","pointerover"]),vl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vl("onBeforeInput",["compositionend","keypress","textInput","paste"]),vl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),G2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pi));function ax(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],c=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var m=l.length-1;0<=m;m--){var S=l[m],C=S.instance,H=S.currentTarget;if(S=S.listener,C!==u&&c.isPropagationStopped())break e;u=S,c.currentTarget=H;try{u(c)}catch(J){Dr(J)}c.currentTarget=null,u=C}else for(m=0;m<l.length;m++){if(S=l[m],C=S.instance,H=S.currentTarget,S=S.listener,C!==u&&c.isPropagationStopped())break e;u=S,c.currentTarget=H;try{u(c)}catch(J){Dr(J)}c.currentTarget=null,u=C}}}}function Xe(e,t){var n=t[Gh];n===void 0&&(n=t[Gh]=new Set);var l=e+"__bubble";n.has(l)||(lx(t,e,2,!1),n.add(l))}function Dd(e,t,n){var l=0;t&&(l|=4),lx(n,e,l,t)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function Od(e){if(!e[Ro]){e[Ro]=!0,Ih.forEach(function(n){n!=="selectionchange"&&(G2.has(n)||Dd(n,!1,e),Dd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ro]||(t[Ro]=!0,Dd("selectionchange",!1,t))}}function lx(e,t,n,l){switch(Fx(t)){case 2:var c=DS;break;case 8:c=OS;break;default:c=tf}n=c.bind(null,t,n,e),c=void 0,!Vc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Ld(e,t,n,l,c){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var S=l.stateNode.containerInfo;if(S===c)break;if(m===4)for(m=l.return;m!==null;){var C=m.tag;if((C===3||C===4)&&m.stateNode.containerInfo===c)return;m=m.return}for(;S!==null;){if(m=bl(S),m===null)return;if(C=m.tag,C===5||C===6||C===26||C===27){l=u=m;continue e}S=S.parentNode}}l=l.return}lm(function(){var H=u,J=Pc(n),ce=[];e:{var L=Mm.get(e);if(L!==void 0){var F=zr,Se=e;switch(e){case"keypress":if(Ar(n)===0)break e;case"keydown":case"keyup":F=C1;break;case"focusin":Se="focus",F=Fc;break;case"focusout":Se="blur",F=Fc;break;case"beforeblur":case"afterblur":F=Fc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=rm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=m1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=z1;break;case _m:case Am:case Tm:F=x1;break;case zm:F=R1;break;case"scroll":case"scrollend":F=f1;break;case"wheel":F=O1;break;case"copy":case"cut":case"paste":F=b1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=cm;break;case"submit":F=A1;break;case"toggle":case"beforetoggle":F=U1}var _e=(t&4)!==0,qe=!_e&&(e==="scroll"||e==="scrollend"),B=_e?L!==null?L+"Capture":null:L;_e=[];for(var R=H,Y;R!==null;){var oe=R;if(Y=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Y===null||B===null||(oe=ci(R,B),oe!=null&&_e.push(Gi(R,oe,Y))),qe)break;R=R.return}0<_e.length&&(L=new F(L,Se,null,n,J),ce.push({event:L,listeners:_e}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",F&&n!==qc&&(Se=n.relatedTarget||n.fromElement)&&(bl(Se)||Se[Jl]))break e;(L||F)&&(Se=J.window===J?J:(F=J.ownerDocument)?F.defaultView||F.parentWindow:window,L?(F=n.relatedTarget||n.toElement,L=H,F=F?bl(F):null,F!==null&&(qe=f(F),_e=F.tag,F!==qe||_e!==5&&_e!==27&&_e!==6)&&(F=null)):(L=null,F=H),L!==F&&(_e=rm,oe="onMouseLeave",B="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(_e=cm,oe="onPointerLeave",B="onPointerEnter",R="pointer"),qe=L==null?Se:oi(L),Y=F==null?Se:oi(F),Se=new _e(oe,R+"leave",L,n,J),Se.target=qe,Se.relatedTarget=Y,oe=null,bl(J)===H&&(_e=new _e(B,R+"enter",F,n,J),_e.target=Y,_e.relatedTarget=qe,oe=_e),qe=oe,_e=L&&F?I(L,F,V2):null,L!==null&&sx(ce,Se,L,_e,!1),F!==null&&qe!==null&&sx(ce,qe,F,_e,!0)))}e:{if(L=H?oi(H):window,F=L.nodeName&&L.nodeName.toLowerCase(),F==="select"||F==="input"&&L.type==="file")var je=xm;else if(pm(L))if(ym)je=F1;else{je=I1;var $e=Y1}else F=L.nodeName,!F||F.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?H&&Hc(H.elementType)&&(je=xm):je=K1;if(je&&(je=je(e,H))){gm(ce,je,n,J);break e}$e&&$e(e,L,H)}switch($e=H?oi(H):window,e){case"focusin":(pm($e)||$e.contentEditable==="true")&&(is=$e,eu=H,xi=null);break;case"focusout":xi=eu=is=null;break;case"mousedown":tu=!0;break;case"contextmenu":case"mouseup":case"dragend":tu=!1,Cm(ce,n,J);break;case"selectionchange":if(X1)break;case"keydown":case"keyup":Cm(ce,n,J)}var Re;if(Xc)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else ss?hm(e,n)&&(Oe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Oe="onCompositionStart");Oe&&(um&&n.locale!=="ko"&&(ss||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&ss&&(Re=sm()):(Ua=J,Yc="value"in Ua?Ua.value:Ua.textContent,ss=!0)),$e=Do(H,Oe),0<$e.length&&(Oe=new om(Oe,e,null,n,J),ce.push({event:Oe,listeners:$e}),Re?Oe.data=Re:(Re=mm(n),Re!==null&&(Oe.data=Re)))),(Re=H1?q1(e,n):P1(e,n))&&(Oe=Do(H,"onBeforeInput"),0<Oe.length&&($e=new om("onBeforeInput","beforeinput",null,n,J),ce.push({event:$e,listeners:Oe}),$e.data=Re)),H2(ce,e,H,n,J)}ax(ce,t)})}function Gi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Do(e,t){for(var n=t+"Capture",l=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=ci(e,n),c!=null&&l.unshift(Gi(e,c,u)),c=ci(e,t),c!=null&&l.push(Gi(e,c,u))),e.tag===3)return l;e=e.return}return[]}function V2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sx(e,t,n,l,c){for(var u=t._reactName,m=[];n!==null&&n!==l;){var S=n,C=S.alternate,H=S.stateNode;if(S=S.tag,C!==null&&C===l)break;S!==5&&S!==26&&S!==27||H===null||(C=H,c?(H=ci(n,u),H!=null&&m.unshift(Gi(n,H,C))):c||(H=ci(n,u),H!=null&&m.push(Gi(n,H,C)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Y2=/\r\n?/g,I2=/\u0000|\uFFFD/g;function ix(e){return(typeof e=="string"?e:""+e).replace(Y2,`
|
|
49
|
-
`).replace(I2,"")}function rx(e,t){return t=ix(t),ix(e)===t}function ft(e,t,n,l,c,u){switch(n){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||ns(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&ns(e,""+l);else return;break;case"className":Cr(e,"class",l);break;case"tabIndex":Cr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Cr(e,n,l);break;case"style":nm(e,l,u);return;case"data":if(t!=="object"){Cr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Er(l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&ft(e,t,"name",c.name,c,null),ft(e,t,"formEncType",c.formEncType,c,null),ft(e,t,"formMethod",c.formMethod,c,null),ft(e,t,"formTarget",c.formTarget,c,null)):(ft(e,t,"encType",c.encType,c,null),ft(e,t,"method",c.method,c,null),ft(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Er(l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=$n);return;case"onScroll":l!=null&&Xe("scroll",e);return;case"onScrollEnd":l!=null&&Xe("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=Er(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Xe("beforetoggle",e),Xe("toggle",e),Nr(e,"popover",l);break;case"xlinkActuate":xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":xa(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":xa(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":xa(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":xa(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Nr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=u1.get(n)||n,Nr(e,n,l);else return}st=!0}function Ud(e,t,n,l,c,u){switch(n){case"style":nm(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof l=="string")ns(e,l);else if(typeof l=="number"||typeof l=="bigint")ns(e,""+l);else return;break;case"onScroll":l!=null&&Xe("scroll",e);return;case"onScrollEnd":l!=null&&Xe("scrollend",e);return;case"onClick":l!=null&&(e.onclick=$n);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Kh.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),u=n.slice(2,c?n.length-7:void 0),t=e[pn]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(u,t,c),typeof l=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(u,l,c);break e}st=!0,n in e?e[n]=l:l===!0?e.setAttribute(n,""):Nr(e,n,l)}return}st=!0}function $t(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",e),Xe("load",e);var l=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var m=n[u];if(m!=null)switch(u){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,u,m,n,null)}}c&&ft(e,t,"srcSet",n.srcSet,n,null),l&&ft(e,t,"src",n.src,n,null);return;case"input":Xe("invalid",e);var S=u=m=c=null,C=null,H=null;for(l in n)if(n.hasOwnProperty(l)){var J=n[l];if(J!=null)switch(l){case"name":c=J;break;case"type":m=J;break;case"checked":C=J;break;case"defaultChecked":H=J;break;case"value":u=J;break;case"defaultValue":S=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,t));break;default:ft(e,t,l,J,n,null)}}$h(e,u,S,C,H,m,c,!1);return;case"select":Xe("invalid",e),l=m=u=null;for(c in n)if(n.hasOwnProperty(c)&&(S=n[c],S!=null))switch(c){case"value":u=S;break;case"defaultValue":m=S;break;case"multiple":l=S;default:ft(e,t,c,S,n,null)}t=u,n=m,e.multiple=!!l,t!=null?ts(e,!!l,t,!1):n!=null&&ts(e,!!l,n,!0);return;case"textarea":Xe("invalid",e),u=c=l=null;for(m in n)if(n.hasOwnProperty(m)&&(S=n[m],S!=null))switch(m){case"value":l=S;break;case"defaultValue":c=S;break;case"children":u=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(o(91));break;default:ft(e,t,m,S,n,null)}em(e,l,c,u);return;case"option":for(C in n)if(n.hasOwnProperty(C)&&(l=n[C],l!=null))switch(C){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ft(e,t,C,l,n,null)}return;case"dialog":Xe("beforetoggle",e),Xe("toggle",e),Xe("cancel",e),Xe("close",e);break;case"iframe":case"object":Xe("load",e);break;case"video":case"audio":for(l=0;l<Pi.length;l++)Xe(Pi[l],e);break;case"image":Xe("error",e),Xe("load",e);break;case"details":Xe("toggle",e);break;case"embed":case"source":case"link":Xe("error",e),Xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in n)if(n.hasOwnProperty(H)&&(l=n[H],l!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,H,l,n,null)}return;default:if(Hc(t)){for(J in n)n.hasOwnProperty(J)&&(l=n[J],l!==void 0&&Ud(e,t,J,l,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(l=n[S],l!=null&&ft(e,t,S,l,n,null))}var K2={};function F2(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,m=null,S=null,C=null,H=null,J=null;for(F in n){var ce=n[F];if(n.hasOwnProperty(F)&&ce!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":C=ce;default:l.hasOwnProperty(F)||ft(e,t,F,null,l,ce)}}for(var L in l){var F=l[L];if(ce=n[L],l.hasOwnProperty(L)&&(F!=null||ce!=null))switch(L){case"type":F!==ce&&(st=!0),u=F;break;case"name":F!==ce&&(st=!0),c=F;break;case"checked":F!==ce&&(st=!0),H=F;break;case"defaultChecked":F!==ce&&(st=!0),J=F;break;case"value":F!==ce&&(st=!0),m=F;break;case"defaultValue":F!==ce&&(st=!0),S=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(137,t));break;default:F!==ce&&ft(e,t,L,F,l,ce)}}Uc(e,m,S,C,H,J,u,c);return;case"select":F=m=S=L=null;for(u in n)if(C=n[u],n.hasOwnProperty(u)&&C!=null)switch(u){case"value":break;case"multiple":F=C;default:l.hasOwnProperty(u)||ft(e,t,u,null,l,C)}for(c in l)if(u=l[c],C=n[c],l.hasOwnProperty(c)&&(u!=null||C!=null))switch(c){case"value":u!==C&&(st=!0),L=u;break;case"defaultValue":u!==C&&(st=!0),S=u;break;case"multiple":u!==C&&(st=!0),m=u;default:u!==C&&ft(e,t,c,u,l,C)}t=S,n=m,l=F,L!=null?ts(e,!!n,L,!1):!!l!=!!n&&(t!=null?ts(e,!!n,t,!0):ts(e,!!n,n?[]:"",!1));return;case"textarea":F=L=null;for(S in n)if(c=n[S],n.hasOwnProperty(S)&&c!=null&&!l.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ft(e,t,S,null,l,c)}for(m in l)if(c=l[m],u=n[m],l.hasOwnProperty(m)&&(c!=null||u!=null))switch(m){case"value":c!==u&&(st=!0),L=c;break;case"defaultValue":c!==u&&(st=!0),F=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==u&&ft(e,t,m,c,l,u)}Wh(e,L,F);return;case"option":for(var Se in n)if(L=n[Se],n.hasOwnProperty(Se)&&L!=null&&!l.hasOwnProperty(Se))switch(Se){case"selected":e.selected=!1;break;default:ft(e,t,Se,null,l,L)}for(C in l)if(L=l[C],F=n[C],l.hasOwnProperty(C)&&L!==F&&(L!=null||F!=null))switch(C){case"selected":L!==F&&(st=!0),e.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:ft(e,t,C,L,l,F)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in n)L=n[_e],n.hasOwnProperty(_e)&&L!=null&&!l.hasOwnProperty(_e)&&ft(e,t,_e,null,l,L);for(H in l)if(L=l[H],F=n[H],l.hasOwnProperty(H)&&L!==F&&(L!=null||F!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,t));break;default:ft(e,t,H,L,l,F)}return;default:if(Hc(t)){for(var qe in n)L=n[qe],n.hasOwnProperty(qe)&&L!==void 0&&!l.hasOwnProperty(qe)&&Ud(e,t,qe,void 0,l,L);for(J in l)L=l[J],F=n[J],!l.hasOwnProperty(J)||L===F||L===void 0&&F===void 0||Ud(e,t,J,L,l,F);return}}for(var B in n)L=n[B],n.hasOwnProperty(B)&&L!=null&&!l.hasOwnProperty(B)&&ft(e,t,B,null,l,L);for(ce in l)L=l[ce],F=n[ce],!l.hasOwnProperty(ce)||L===F||L==null&&F==null||ft(e,t,ce,L,l,F)}function ox(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var c=n[l],u=c.transferSize,m=c.initiatorType,S=c.duration;if(u&&S&&ox(m)){for(m=0,S=c.responseEnd,l+=1;l<n.length;l++){var C=n[l],H=C.startTime;if(H>S)break;var J=C.transferSize,ce=C.initiatorType;J&&ox(ce)&&(C=C.responseEnd,m+=J*(C<S?1:(S-H)/(C-H)))}if(--l,t+=8*(u+m)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Bd=null,Hd=null;function Vi(e){return e.nodeType===9?e:e.ownerDocument}function cx(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ux(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function dx(e,t,n,l){return n=Vi(n).createElement(e),n[Ft]=l,n[pn]=t,$t(n,e,t),Pt(n),n}function qd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pd=null;function X2(){var e=window.event;return e&&e.type==="popstate"?e===Pd?!1:(Pd=e,!0):(Pd=null,!1)}var Gd=typeof setTimeout=="function"?setTimeout:void 0,Z2=typeof clearTimeout=="function"?clearTimeout:void 0,fx=typeof Promise=="function"?Promise:void 0,hx=typeof requestAnimationFrame=="function"?requestAnimationFrame:Gd,J2=typeof queueMicrotask=="function"?queueMicrotask:typeof fx<"u"?function(e){return fx.resolve(null).then(e).catch($2)}:Gd;function $2(e){setTimeout(function(){throw e})}function al(e){return e==="head"}function mx(e,t){var n=t,l=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(c),Hs(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Zd(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Zd(n);for(var u=n.firstChild;u;){var m=u.nextSibling,S=u.nodeName;u[ri]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=m}}else n==="body"&&Zd(e.ownerDocument.body);n=c}while(n);Hs(t)}function px(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function gx(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var c=l=0;c<t.length;c++){var u=t[c];0<u.width&&0<u.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function xx(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function W2(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Vd(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return W2(t,n,e)}function eS(e){return e.documentElement.clientHeight}function tS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function nS(e,t,n,l,c,u,m,S,C){var H=t.nodeType===9?t:t.ownerDocument;try{var J=H.startViewTransition({update:function(){var L=H.defaultView,F=L.navigation&&L.navigation.transition,Se=H.fonts.status;l();var _e=[];if(Se==="loaded"&&(eS(H),H.fonts.status==="loading"&&_e.push(H.fonts.ready)),Se=_e.length,e!==null)for(var qe=e.suspenseyImages,B=0,R=0;R<qe.length;R++){var Y=qe[R];if(!Y.complete){var oe=Y.getBoundingClientRect();if(0<oe.bottom&&0<oe.right&&oe.top<L.innerHeight&&oe.left<L.innerWidth){if(B+=Bx(Y),B>Uo){_e.length=Se;break}Y=new Promise(tS.bind(Y)),_e.push(Y)}}}if(0<_e.length)return L=Promise.race([Promise.all(_e),new Promise(function(je){return setTimeout(je,500)})]).then(c,c),(F?Promise.allSettled([F.finished,L]):L).then(u,u);if(c(),F)return F.finished.then(u,u);u()},types:n});H.__reactViewTransition=J;var ce=[];return J.ready.then(function(){for(var L=H.documentElement.getAnimations({subtree:!0}),F=0;F<L.length;F++){var Se=L[F],_e=Se.effect,qe=_e.pseudoElement;if(qe!=null&&qe.startsWith("::view-transition")){ce.push(Se),Se=_e.getKeyframes();for(var B=qe=void 0,R=!0,Y=0;Y<Se.length;Y++){var oe=Se[Y],je=oe.width;if(qe===void 0)qe=je;else if(qe!==je){R=!1;break}if(je=oe.height,B===void 0)B=je;else if(B!==je){R=!1;break}delete oe.width,delete oe.height,oe.transform==="none"&&delete oe.transform}R&&qe!==void 0&&B!==void 0&&(_e.setKeyframes(Se),R=getComputedStyle(_e.target,_e.pseudoElement),R.width!==qe||R.height!==B)&&(R=Se[0],R.width=qe,R.height=B,R=Se[Se.length-1],R.width=qe,R.height=B,_e.setKeyframes(Se))}}m()},function(L){H.__reactViewTransition===J&&(H.__reactViewTransition=null);try{if(typeof L=="object"&&L!==null)switch(L.name){case"InvalidStateError":(L.message==="View transition was skipped because document visibility state is hidden."||L.message==="Skipping view transition because document visibility state has become hidden."||L.message==="Skipping view transition because viewport size changed."||L.message==="Transition was aborted because of invalid state")&&(L=null)}L!==null&&C(L)}finally{l(),c(),m()}}),J.finished.finally(function(){for(var L=0;L<ce.length;L++)ce[L].cancel();H.__reactViewTransition===J&&(H.__reactViewTransition=null),S()}),J}catch{return l(),c(),m(),null}}function ql(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ql.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:M({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ql.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),l=[],c=0;c<n.length;c++){var u=n[c].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(n[c])}return l},ql.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function yx(e){return{name:e,group:new ql("group",e),imagePair:new ql("image-pair",e),old:new ql("old",e),new:new ql("new",e)}}function An(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}An.prototype.addEventListener=function(e,t,n){var l=null,c=null;if(!(n!=null&&typeof n!="boolean"&&(l=n.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(vx(u,e,t,n)===-1){var m=this,S=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(S=function(C){m.removeEventListener(e,t,n),typeof t=="function"?t.call(this,C):t.handleEvent(C)}),l!==null&&(c=m.removeEventListener.bind(m,e,t,n),l.addEventListener("abort",c,{once:!0}),c=l.removeEventListener.bind(l,"abort",c)),l=Rs(n),u.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:S,cleanup:c}),y(this._fragmentFiber.child,!1,aS,e,S,l)}this._eventListeners=u}};function aS(e,t,n,l){return j(e).addEventListener(t,n,l),!1}An.prototype.removeEventListener=function(e,t,n){var l=this._eventListeners;if(l!==null&&(t=vx(l,e,t,n),t!==-1)){var c=l[t];n=c.attachedListener;var u=c.cleanup;c=Rs(c.optionsOrUseCapture),y(this._fragmentFiber.child,!1,lS,e,n,c),l.splice(t,1),u!==null&&u()}};function lS(e,t,n,l){return j(e).removeEventListener(t,n,l),!1}function Rs(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function bx(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function vx(e,t,n,l){if(e.length===0)return-1;l=bx(l);for(var c=0;c<e.length;c++){var u=e[c];if(u.type===t&&u.listener===n&&bx(u.optionsOrUseCapture)===l)return c}return-1}An.prototype.dispatchEvent=function(e){var t=k(this._fragmentFiber);if(t===null)return!0;t=j(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var c=0;c<n.length;c++){var u=n[c];l.addEventListener(u.type,u.attachedListener,Rs(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),n)for(c=0;c<n.length;c++)u=n[c],l.removeEventListener(u.type,u.attachedListener,Rs(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},An.prototype.focus=function(e){y(this._fragmentFiber.child,!0,Sx,e,void 0,void 0)};function Sx(e,t){return e.tag===6?!1:(e=j(e),gS(e,t))}An.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,Yd,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Sx(t[n],e);n--);};function Yd(e,t){return t.push(e),!1}An.prototype.blur=function(){var e=k(this._fragmentFiber);e!==null&&(e=j(e),e=Vi(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,sS,e,void 0,void 0))};function sS(e,t){return e.tag===6?!1:(e=j(e),e===t||e.contains(t)?(t.blur(),!0):!1)}An.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,iS,e,void 0,void 0)};function iS(e,t){return e.tag===6||(e=j(e),t.observe(e)),!1}An.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,rS,e,void 0,void 0);for(var n=t=0;n<Qn.length;n++){var l=Qn[n];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):Qn[t++]=l}Qn.length=t}};function rS(e,t){return e.tag===6||(e=j(e),t.unobserve(e)),!1}var Qn=[],Id=!1;function oS(e,t,n){Qn.push({fragmentInstance:e,observer:t,instance:n}),Id||(Id=!0,xS(function(){Id=!1;var l=Qn;Qn=[];for(var c=0;c<l.length;c++){var u=l[c];u.observer.unobserve(u.instance)}}))}An.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,cS,e,void 0,void 0),e};function cS(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=j(e),t.push.apply(t,e.getClientRects());return!1}An.prototype.getRootNode=function(e){var t=k(this._fragmentFiber);return t===null?this:j(t).getRootNode(e)},An.prototype.compareDocumentPosition=function(e){var t=k(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];y(this._fragmentFiber.child,!1,Yd,n,void 0,void 0);var l=j(t);if(n.length===0){if(n=l,E(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var c=l=n.compareDocumentPosition(e);return n===e?c=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=_(t)[1],n===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=j(n).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=j(n[0]),c=j(n[n.length-1]);var u=E(this._fragmentFiber)?t.parentElement:l;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),S=c.compareDocumentPosition(e),C=m&Node.DOCUMENT_POSITION_CONTAINED_BY||S&Node.DOCUMENT_POSITION_CONTAINED_BY;return S=l&&u&&m&Node.DOCUMENT_POSITION_FOLLOWING&&S&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&c===e||C||S?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!u&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||uS(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function uS(e,t,n,l,c){var u=bl(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){n=!0;break e}u=u.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=c.ownerDocument,c===u||c===u.documentElement||c===u.body;e:{for(u=t,t=k(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===n)&&(t=I(n,u,pe),t===null?t=!1:(y(t,!0,Z,u,n),u=T,T=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=I(l,u,pe),t===null?t=!1:(y(t,!0,ne,u,l),u=T,D=T=null,t=u!==null)),t):!1}function wx(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}An.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];y(this._fragmentFiber.child,!1,Yd,t,void 0,void 0);var n=e!==!1;if(t.length===0){var l=_(this._fragmentFiber);if(l=n?l[1]||l[0]||k(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=j(l),wx(e,n);return}if(l=j(l),l.nodeType!==9){if(l.nodeType===11){n="host"in l?l.host:null,n!==null&&n.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=n?t.length-1:0;l!==(n?-1:t.length);){var c=t[l];c.tag===6?(c=j(c),wx(c,n)):j(c).scrollIntoView(e),l+=n?-1:1}};function dS(e,t){return e=j(e),kx(e,t),!1}function kx(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function jx(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var c=n[l];e.addEventListener(c.type,c.attachedListener,Rs(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){for(var m=0,S=0;S<Qn.length;S++){var C=Qn[S];(C.fragmentInstance!==t||C.observer!==u||C.instance!==e)&&(Qn[m++]=C)}Qn.length=m,u.observe(e)}),kx(e,t))}function fS(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var c=n[l];e.removeEventListener(c.type,c.attachedListener,Rs(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){typeof u.rootMargin=="string"?oS(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Kd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Kd(n),jr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function hS(e,t,n,l){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ri])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Hn(e.nextSibling),e===null)break}return null}function mS(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Hn(e.nextSibling),e===null))return null;return e}function Nx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Hn(e.nextSibling),e===null))return null;return e}function Fd(e){return e.data==="$?"||e.data==="$~"}function Qd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function pS(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Hn(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Xd=null;function Cx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Hn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Ex(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function gS(e,t){function n(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return l}function xS(e){hx(function(){hx(function(t){return e(t)})})}function _x(e,t,n){switch(t=Vi(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ax(e,t,n){for(var l in n){var c=n[l];n.hasOwnProperty(l)&&c!=null&&ft(e,t,l,null,K2,c)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===$n&&(e.onclick=null),jr(e)}function Zd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jr(e)}var qn=new Map,Tx=new Set;function Yi(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ta=fe.d;fe.d={f:yS,r:bS,D:vS,C:SS,L:wS,m:kS,X:NS,S:jS,M:CS};function yS(){var e=Ta.f(),t=_o();return e||t}function bS(e){var t=$l(e);t!==null&&t.tag===5&&t.type==="form"?Mp(t):Ta.r(e)}var Ds=typeof document>"u"?null:document;function zx(e,t,n){var l=Ds;if(l&&typeof t=="string"&&t){var c=Mn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),Tx.has(c)||(Tx.add(c),e={rel:e,crossOrigin:n,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),$t(t,"link",e),Pt(t),l.head.appendChild(t)))}}function vS(e){Ta.D(e),zx("dns-prefetch",e,null)}function SS(e,t){Ta.C(e,t),zx("preconnect",e,t)}function wS(e,t,n){Ta.L(e,t,n);var l=Ds;if(l&&e&&t){var c='link[rel="preload"][as="'+Mn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+Mn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+Mn(n.imageSizes)+'"]')):c+='[href="'+Mn(e)+'"]';var u=c;switch(t){case"style":u=Os(e);break;case"script":u=Ls(e)}if(!(qn.has(u)||(e=M({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),qn.set(u,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(Ii(u))||t==="script"&&l.querySelector(Ki(u))))){var m=l.createElement("link");$t(m,"link",e),t==="style"&&(m[kr]=!0,m.onload=m.onerror=function(){Yh(m)}),Pt(m),l.head.appendChild(m)}}}function kS(e,t){Ta.m(e,t);var n=Ds;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Mn(l)+'"][href="'+Mn(e)+'"]',u=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ls(e)}if(!qn.has(u)&&(e=M({rel:"modulepreload",href:e},t),qn.set(u,e),n.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ki(u)))return}l=n.createElement("link"),$t(l,"link",e),Pt(l),n.head.appendChild(l)}}}function jS(e,t,n){Ta.S(e,t,n);var l=Ds;if(l&&e){var c=Wl(l).hoistableStyles,u=Os(e);t=t||"default";var m=c.get(u);if(!m){var S={loading:0,preload:null};if(m=l.querySelector(Ii(u)))S.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},n),(n=qn.get(u))&&Jd(e,n);var C=m=l.createElement("link");Pt(C),$t(C,"link",e),C._p=new Promise(function(H,J){C.onload=H,C.onerror=J}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Oo(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:S},c.set(u,m)}}}function NS(e,t){Ta.X(e,t);var n=Ds;if(n&&e){var l=Wl(n).hoistableScripts,c=Ls(e),u=l.get(c);u||(u=n.querySelector(Ki(c)),u||(e=M({src:e,async:!0},t),(t=qn.get(c))&&$d(e,t),u=n.createElement("script"),Pt(u),$t(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function CS(e,t){Ta.M(e,t);var n=Ds;if(n&&e){var l=Wl(n).hoistableScripts,c=Ls(e),u=l.get(c);u||(u=n.querySelector(Ki(c)),u||(e=M({src:e,async:!0,type:"module"},t),(t=qn.get(c))&&$d(e,t),u=n.createElement("script"),Pt(u),$t(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function Mx(e,t,n,l){var c=(c=Et.current)?Yi(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Os(n.href),t=Wl(c).hoistableStyles,l=t.get(n),l||(l={type:"style",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Os(n.href);var u=Wl(c).hoistableStyles,m=u.get(e);if(m||(c=c.ownerDocument||c,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,m),(u=c.querySelector(Ii(e)))?u._p||(m.instance=u,m.state.loading=5):(u=qn.get(e),u||(u={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},qn.set(e,u)),ES(c,e,u,m.state))),t&&l===null)throw Error(o(528,""));return m}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Ls(n),t=Wl(c).hoistableScripts,l=t.get(n),l||(l={type:"script",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Os(e){return'href="'+Mn(e)+'"'}function Ii(e){return'link[rel="stylesheet"]['+e+"]"}function Rx(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function ES(e,t,n,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[kr]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[kr]=!0,t.onload=t.onerror=Yh.bind(null,t),$t(t,"link",n),Pt(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function Ls(e){return'[src="'+Mn(e)+'"]'}function Ki(e){return"script[async]"+e}function Dx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Mn(n.href)+'"]');if(l)return t.instance=l,Pt(l),l;var c=M({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Pt(l),$t(l,"style",c),Oo(l,n.precedence,e),t.instance=l;case"stylesheet":c=Os(n.href);var u=e.querySelector(Ii(c));if(u)return t.state.loading|=4,t.instance=u,Pt(u),u;l=Rx(n),(c=qn.get(c))&&Jd(l,c),u=(e.ownerDocument||e).createElement("link"),Pt(u);var m=u;return m._p=new Promise(function(S,C){m.onload=S,m.onerror=C}),$t(u,"link",l),t.state.loading|=4,Oo(u,n.precedence,e),t.instance=u;case"script":return u=Ls(n.src),(c=e.querySelector(Ki(u)))?(t.instance=c,Pt(c),c):(l=n,(c=qn.get(u))&&(l=M({},n),$d(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),Pt(c),$t(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Oo(l,n.precedence,e));return t.instance}function Oo(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,u=c,m=0;m<l.length;m++){var S=l[m];if(S.dataset.precedence===t)u=S;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $d(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Lo=null;function Ox(e,t,n){if(Lo===null){var l=new Map,c=Lo=new Map;c.set(n,l)}else c=Lo,l=c.get(n),l||(l=new Map,c.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[ri]||u[Ft]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var m=u.getAttribute(t)||"";m=e+m;var S=l.get(m);S?S.push(u):l.set(m,[u])}}return l}function Wd(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function _S(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Lx(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Ux(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Bx(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Hx(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Bx(t),e.suspenseyImages.push(t)),e=zS.bind(e),t.decode().then(e,e))}function AS(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Os(l.href),u=t.querySelector(Ii(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Pt(u);return}u=t.ownerDocument||t,l=Rx(l),(c=qn.get(c))&&Jd(l,c),u=u.createElement("link"),Pt(u);var m=u;m._p=new Promise(function(S,C){m.onload=S,m.onerror=C}),$t(u,"link",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Fi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Uo=0;function TS(e,t){return e.stylesheets&&e.count===0&&Ho(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Ho(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Uo===0&&(Uo=62500*Q2());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ho(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Uo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function qx(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ho(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Fi(){this.count--,qx(this)}function zS(){this.imgCount--,qx(this)}var Bo=null;function Ho(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Bo=new Map,t.forEach(MS,e),Bo=null,Fi.call(e))}function MS(e,t){if(!(t.state.loading&4)){var n=Bo.get(e);if(n)var l=n.get(null);else{n=new Map,Bo.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var m=c[u];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),l=m)}l&&n.set(null,l)}c=t.instance,m=c.getAttribute("data-precedence"),u=n.get(m)||l,u===l&&n.set(null,c),n.set(m,c),this.count++,l=Fi.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Us={$$typeof:Q,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function RS(e,t,n,l,c,u,m,S,C){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rc(0),this.hiddenUpdates=Rc(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.transitionTypes=null,this.incompleteTransitions=new Map}function Px(e,t,n,l,c,u,m,S,C,H,J,ce){return e=new RS(e,t,n,m,C,H,J,ce,S),t=1,u===!0&&(t|=24),u=gn(3,null,null,t),e.current=u,u.stateNode=e,t=mu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},yu(u),e}function Gx(e){return e?(e=cs,e):cs}function Vx(e,t,n,l,c,u){c=Gx(c),l.context===null?l.context=c:l.pendingContext=c,l=Ia(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=Ka(e,l,t),n!==null&&(vn(n,e,t),ji(n,e,t))}function Yx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ef(e,t){Yx(e,t),(e=e.alternate)&&Yx(e,t)}function Ix(e){if(e.tag===13||e.tag===31){var t=kl(e,67108864);t!==null&&vn(t,e,67108864),ef(e,67108864)}}function Kx(e){if(e.tag===13||e.tag===31){var t=_n();t=Dc(t);var n=kl(e,t);n!==null&&vn(n,e,t),ef(e,t)}}var Bs=!0;function DS(e,t,n,l){var c=U.T;U.T=null;var u=fe.p;try{fe.p=2,tf(e,t,n,l)}finally{fe.p=u,U.T=c}}function OS(e,t,n,l){var c=U.T;U.T=null;var u=fe.p;try{fe.p=8,tf(e,t,n,l)}finally{fe.p=u,U.T=c}}function tf(e,t,n,l){if(Bs){var c=nf(l);if(c===null)Ld(e,t,l,qo,n),Qx(e,l);else if(US(c,e,t,n,l))l.stopPropagation();else if(Qx(e,l),t&4&&-1<LS.indexOf(e)){for(;c!==null;){var u=$l(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var m=yl(u.pendingLanes);if(m!==0){var S=u;for(S.pendingLanes|=2,S.entangledLanes|=2;m;){var C=1<<31-et(m);S.entanglements[1]|=C,m&=~C}oa(u),(rt&6)===0&&(No=Ot()+500,qi(0))}}break;case 31:case 13:S=kl(u,2),S!==null&&vn(S,u,2),_o(),ef(u,2)}if(u=nf(l),u===null&&Ld(e,t,l,qo,n),u===c)break;c=u}c!==null&&l.stopPropagation()}else Ld(e,t,l,null,n)}}function nf(e){return e=Pc(e),af(e)}var qo=null;function af(e){if(qo=null,e=bl(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=g(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qo=e,null}function Fx(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Jn()){case ti:return 2;case ni:return 8;case gl:case yr:return 32;case ai:return 268435456;default:return 32}default:return 32}}var lf=!1,ll=null,sl=null,il=null,Qi=new Map,Xi=new Map,rl=[],LS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Qx(e,t){switch(e){case"focusin":case"focusout":ll=null;break;case"dragenter":case"dragleave":sl=null;break;case"mouseover":case"mouseout":il=null;break;case"pointerover":case"pointerout":Qi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(t.pointerId)}}function Zi(e,t,n,l,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[c]},t!==null&&(t=$l(t),t!==null&&Ix(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function US(e,t,n,l,c){switch(t){case"focusin":return ll=Zi(ll,e,t,n,l,c),!0;case"dragenter":return sl=Zi(sl,e,t,n,l,c),!0;case"mouseover":return il=Zi(il,e,t,n,l,c),!0;case"pointerover":var u=c.pointerId;return Qi.set(u,Zi(Qi.get(u)||null,e,t,n,l,c)),!0;case"gotpointercapture":return u=c.pointerId,Xi.set(u,Zi(Xi.get(u)||null,e,t,n,l,c)),!0}return!1}function Xx(e){var t=bl(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,Ph(e.priority,function(){Kx(n)});return}}else if(t===31){if(t=g(n),t!==null){e.blockedOn=t,Ph(e.priority,function(){Kx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Po(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=nf(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);qc=l,n.target.dispatchEvent(l),qc=null}else return t=$l(n),t!==null&&Ix(t),e.blockedOn=n,!1;t.shift()}return!0}function Zx(e,t,n){Po(e)&&n.delete(t)}function BS(){lf=!1,ll!==null&&Po(ll)&&(ll=null),sl!==null&&Po(sl)&&(sl=null),il!==null&&Po(il)&&(il=null),Qi.forEach(Zx),Xi.forEach(Zx)}function Go(e,t){e.blockedOn===t&&(e.blockedOn=null,lf||(lf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,BS)))}var Vo=null;function Jx(e){Vo!==e&&(Vo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Vo===e&&(Vo=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(af(l||n)===null)continue;break}var u=$l(n);u!==null&&(e.splice(t,3),t-=3,Hu(u,{pending:!0,data:c,method:n.method,action:l},l,c))}}))}function Hs(e){function t(C){return Go(C,e)}ll!==null&&Go(ll,e),sl!==null&&Go(sl,e),il!==null&&Go(il,e),Qi.forEach(t),Xi.forEach(t);for(var n=0;n<rl.length;n++){var l=rl[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<rl.length&&(n=rl[0],n.blockedOn===null);)Xx(n),n.blockedOn===null&&rl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var c=n[l],u=n[l+1],m=c[pn]||null;if(typeof u=="function")m||Jx(n);else if(m){var S=null;if(u&&u.hasAttribute("formAction")){if(c=u,m=u[pn]||null)S=m.formAction;else if(af(c)!==null)continue}else S=m.action;typeof S=="function"?n[l+1]=S:(n.splice(l,3),l-=3),Jx(n)}}}function $x(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(m){return c=m})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function sf(e){this._internalRoot=e}Yo.prototype.render=sf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=_n();Vx(n,l,e,t,null,null)},Yo.prototype.unmount=sf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Vx(e.current,2,null,e,null,null),_o(),t[Jl]=null}};function Yo(e){this._internalRoot=e}Yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=qh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<rl.length&&t!==0&&t<rl[n].priority;n++);rl.splice(n,0,e),n===0&&Xx(e)}};var Wx=i.version;if(Wx!=="19.3.0")throw Error(o(527,Wx,"19.3.0"));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var HS={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Io=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Io.isDisabled&&Io.supportsFiber)try{Ye=Io.inject(HS),lt=Io}catch{}}return $i.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",c=Gp,u=Vp,m=Yp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Px(e,1,!1,null,null,n,l,null,c,u,m,$x),e[Jl]=t.current,Od(e),new sf(t)},$i.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,c="",u=Gp,m=Vp,S=Yp,C=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=Px(e,1,!0,t,n??null,l,c,C,u,m,S,$x),t.context=Gx(null),n=t.current,l=_n(),l=Dc(l),c=Ia(l),c.callback=null,Ka(n,c,l),n=l,t.current.lanes=n,ii(t,n),oa(t),e[Jl]=t.current,Od(e),new Yo(t)},$i.version="19.3.0",$i}var cy;function XS(){if(cy)return cf.exports;cy=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),cf.exports=QS(),cf.exports}var ZS=XS();const JS=gh(ZS);class Rt extends Error{constructor(i,r,o){super(r),this.status=i,this.data=o,this.name="ApiError"}get code(){var i;return(i=this.data)==null?void 0:i.code}}async function Pl(a,i={}){const r=a.startsWith("/dashboard/api")?a:`/dashboard/api${a.startsWith("/")?a:`/${a}`}`,o={...i.body instanceof Blob?{}:{"Content-Type":"application/json"},...i.headers},d=await fetch(r,{...i,headers:o});if(d.status===401)throw window.location.href="/login",new Rt(401,"Session expired, redirecting to login...");const f=await d.json().catch(()=>null);if(!d.ok)throw new Rt(d.status,(f==null?void 0:f.error)||(f==null?void 0:f.message)||`HTTP ${d.status}: Request failed`,f);return f}function $S(a){if(!a)return null;const i=/filename\*=UTF-8''([^;]+)/i.exec(a);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}const r=/filename="([^"]*)"/.exec(a);return(r==null?void 0:r[1])||null}async function uy(a,i={}){const r=await fetch(`/dashboard/api${a}`,i);if(r.status===401)throw window.location.href="/login",new Rt(401,"Session expired");if(!r.ok){const o=await r.json().catch(()=>null);throw new Rt(r.status,(o==null?void 0:o.error)||"Sticker operation failed",o)}return{blob:await r.blob(),fileName:$S(r.headers.get("Content-Disposition")),animated:r.headers.get("X-Levix-Animated")==="1"}}const $={get:a=>Pl(a,{method:"GET"}),post:(a,i)=>Pl(a,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(a,i)=>Pl(a,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(a,i)=>Pl(a,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:a=>Pl(a,{method:"DELETE"}),getStats:()=>$.get("/stats"),getSession:()=>$.get("/bot/session"),startSession:a=>$.post("/bot/session/start",a),reconnectSession:()=>$.post("/bot/session/reconnect"),stopSession:()=>$.post("/bot/session/stop"),unlinkSession:()=>$.post("/bot/logout"),restartBot:()=>$.post("/bot/restart"),getSettings:()=>$.get("/settings"),updateSetting:(a,i)=>$.patch("/settings",{key:a,value:i}),updatePrefix:a=>$.patch("/settings",{key:"prefix",value:a}),exportSettings:()=>$.get("/settings/export"),importSettings:a=>$.post("/settings/import",a),getCommands:()=>$.get("/commands"),updateCommand:(a,i)=>$.patch(`/commands/${encodeURIComponent(a)}`,i),postMultipart:(a,i,r)=>new Promise((o,d)=>{const f=new FormData;for(const[g,p]of Object.entries(i))p!=null&&p!==""&&f.set(g,p);f.set("file",r);const h=new XMLHttpRequest;h.open("POST",`/dashboard/api${a}`),h.responseType="json",h.onload=()=>{const g=h.response&&typeof h.response=="object"?h.response:null;if(h.status===401){window.location.href="/login",d(new Rt(401,"Session expired"));return}h.status>=200&&h.status<300?o(g):d(new Rt(h.status,(g==null?void 0:g.error)||(g==null?void 0:g.message)||`HTTP ${h.status}: Request failed`,g))},h.onerror=()=>d(new Rt(0,"Network error")),h.send(f)}),getSchedules:()=>$.get("/schedules"),createSchedule:a=>$.post("/schedules",a),deleteSchedule:a=>$.delete(`/schedules/${encodeURIComponent(a)}`),retrySchedule:a=>$.post(`/schedules/${encodeURIComponent(a)}/retry`),getGroups:()=>$.get("/groups"),updateGroup:(a,i)=>$.patch(`/groups/${encodeURIComponent(a)}`,i),getPersona:()=>$.get("/ai/persona"),updatePersona:a=>$.put("/ai/persona",{body:a}),getMemoryFiles:()=>$.get("/ai/memory"),getMemoryFile:a=>$.get(`/ai/memory/${encodeURIComponent(a)}`),updateMemoryFile:(a,i)=>$.put(`/ai/memory/${encodeURIComponent(a)}`,{content:i}),deleteMemoryFile:a=>$.delete(`/ai/memory/${encodeURIComponent(a)}`),getAiConversations:()=>$.get("/ai/conversations"),getAiConversation:a=>$.get(`/ai/conversations/${encodeURIComponent(a)}`),getRecipients:()=>$.get("/recipients"),fetchAiModels:a=>$.post("/ai/models",a||{}),changePassword:(a,i)=>$.post("/security/password",{current:a,next:i}),getFeedbackMeta:()=>$.get("/feedback/meta"),sendFeedback:a=>$.post("/feedback",a),sendFeedbackMultipart:(a,i,r)=>new Promise((o,d)=>{const f=new FormData;f.set("message",a.message),f.set("topic",a.topic),a.rating&&f.set("rating",String(a.rating)),a.contact&&f.set("contact",a.contact),f.set("file",i,i.name);const h=new XMLHttpRequest;h.open("POST","/dashboard/api/feedback"),h.responseType="json",h.upload.onprogress=g=>{g.lengthComputable&&r&&r(g.loaded/g.total)},h.onload=()=>{const g=h.response&&typeof h.response=="object"?h.response:null;if(h.status===401){window.location.href="/login",d(new Rt(401,"Session expired"));return}h.status>=200&&h.status<300?o(g??{success:!0}):d(new Rt(h.status,(g==null?void 0:g.error)||(g==null?void 0:g.message)||`HTTP ${h.status}: Request failed`,g))},h.onerror=()=>d(new Rt(0,"Network error")),h.send(f)}),getLogs:()=>$.get("/logs"),getStickerCapabilities:()=>$.get("/stickers/capabilities"),getStickers:a=>{const i=new URLSearchParams;return a.q&&i.set("q",a.q),a.sort&&i.set("sort",a.sort),a.filter&&i.set("filter",a.filter),a.pack&&i.set("pack",a.pack),a.offset!==void 0&&i.set("offset",a.offset.toString()),a.limit!==void 0&&i.set("limit",a.limit.toString()),$.get(`/stickers?${i.toString()}`)},uploadStickerSource:(a,i)=>{const r={};return i&&(r["X-Filename"]=encodeURIComponent(i)),Pl("/stickers/uploads",{method:"POST",body:a,headers:r})},uploadExistingStickerSource:a=>Pl(`/stickers/${encodeURIComponent(a)}/uploads`,{method:"POST"}),createStickerJob:a=>$.post("/stickers/jobs",a),getStickerJob:a=>$.get(`/stickers/jobs/${encodeURIComponent(a)}`),exportSticker:(a,i)=>uy(`/stickers/${encodeURIComponent(a)}/export?format=${i}`),exportStickers:(a,i)=>uy("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a,format:i})}),updateSticker:(a,i)=>$.patch(`/stickers/${encodeURIComponent(a)}`,i),deleteSticker:(a,i)=>$.delete(`/stickers/${encodeURIComponent(a)}${i?"?confirm=1":""}`),bulkStickers:a=>$.post("/stickers/bulk",a),sendStickers:a=>$.post("/stickers/send",a),getPacks:()=>$.get("/sticker-packs"),createPack:a=>$.post("/sticker-packs",{name:a}),getPack:a=>$.get(`/sticker-packs/${encodeURIComponent(a)}`),updatePack:(a,i)=>$.patch(`/sticker-packs/${encodeURIComponent(a)}`,{name:i}),deletePack:(a,i)=>$.delete(`/sticker-packs/${encodeURIComponent(a)}${i?"?deleteStickers=1":""}`),reorderPack:(a,i)=>$.put(`/sticker-packs/${encodeURIComponent(a)}/order`,{ids:i}),mergePack:(a,i)=>$.post(`/sticker-packs/${encodeURIComponent(a)}/merge`,{intoPackId:i}),listAutoDeleteRules:()=>$.get("/auto-delete/rules"),createAutoDeleteRule:a=>$.post("/auto-delete/rules",a),updateAutoDeleteRule:(a,i)=>$.patch(`/auto-delete/rules/${a}`,i),deleteAutoDeleteRule:a=>$.delete(`/auto-delete/rules/${a}`),resetAutoDeleteRule:a=>$.post(`/auto-delete/rules/${a}/reset`),listAutoDeleteLog:(a={})=>{const i=new URLSearchParams;a.ruleId&&i.set("ruleId",a.ruleId),a.limit!==void 0&&i.set("limit",String(a.limit)),a.offset!==void 0&&i.set("offset",String(a.offset));const r=i.toString();return $.get(`/auto-delete/log${r?`?${r}`:""}`)},clearAutoDeleteLog:a=>$.delete(a?`/auto-delete/log?ruleId=${encodeURIComponent(a)}`:"/auto-delete/log")};/**
|
|
50
|
-
* @license lucide-react v1.46.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const WS=a=>a==null?void 0:a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
55
|
-
* @license lucide-react v1.46.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/function ew(a,i,r=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:WS(a),size:24,node:i,...r.length>0?{aliases:r}:{}}}/**
|
|
60
|
-
* @license lucide-react v1.46.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const tw=a=>{let i="",r=!1;for(const o of a){if(o==="-"||o==="_"||o<=" "){r=i.length>0;continue}i.length===0?i+=o.toLowerCase():i+=r?o.toUpperCase():o,r=!1}return i};/**
|
|
65
|
-
* @license lucide-react v1.46.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const nw=a=>{const i=tw(a);return i.charAt(0).toUpperCase()+i.slice(1)};/**
|
|
70
|
-
* @license lucide-react v1.46.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const Wf=(...a)=>a.filter((i,r,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===r).join(" ").trim();/**
|
|
75
|
-
* @license lucide-react v1.46.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const Gl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
80
|
-
* @license lucide-react v1.46.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/function hf(a){return a!=null}function aw(a,i={}){var k,E;const r=i.attributeNames??{},o=_=>r[_]??_,d=a.size??a.width??Gl.width,f=a.size??a.height??Gl.height,h=((k=a.aliases)==null?void 0:k.filter(_=>typeof _=="string"&&_.trim()!=="").map(_=>`lucide-${_}`))??[],g=[...a.name?[`lucide-${a.name}`]:[],...h],p=((E=i.className)==null?void 0:E.split(" ").filter(Boolean))??[],x=i.includeDefaultClasses===!1?Wf(...p):Wf("lucide",...g,...p),b=i.absoluteStrokeWidth?Number(i.strokeWidth??Gl["stroke-width"])*Number(a.size??a.width??Gl.width)/Number(i.size??i.width??Gl.width):i.strokeWidth??Gl["stroke-width"];return["svg",{...Object.entries(Gl).reduce((_,[N,j])=>(_[o(N)]=j,_),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&hf(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&hf(i.width)&&{[o("width")]:i.width},..."height"in i&&hf(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:b,...x&&{[o("class")]:x},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},a.node.map(_=>{const[N,j,T]=_,D=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...j}:j;return T?[N,D,T]:[N,D]})]}/**
|
|
85
|
-
* @license lucide-react v1.46.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/function lw(a,i={}){return aw(a,{...i,attributeNames:{...i.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
90
|
-
* @license lucide-react v1.46.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const sw=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},iw=v.createContext({}),rw=()=>v.useContext(iw),ow=v.forwardRef(({color:a,size:i,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:h,className:g="",children:p,iconNode:x=[],icon:b={node:x,aliases:[],size:24},...y},k)=>{const{size:E=24,strokeWidth:_=2,absoluteStrokeWidth:N=!1,nonScalingStroke:j=!1,color:T="currentColor",className:D=""}=rw()??{},Z=!!p||sw(y),[ne,pe,I=[]]=lw(b,{color:a??T,width:r??i??E,height:o??i??E,strokeWidth:d??_,absoluteStrokeWidth:f??N,nonScalingStroke:h??j,className:Wf(D,g),hasA11yProp:Z,attributes:y});return v.createElement(ne,{ref:k,...pe},[...I.map(([M,A])=>v.createElement(M,A)),...Array.isArray(p)?p:[p]])});/**
|
|
95
|
-
* @license lucide-react v1.46.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/function be(a,i=[],r=[]){const o=typeof a=="string"?ew(a,i,r):a,d=v.forwardRef(({className:f,...h},g)=>v.createElement(ow,{ref:g,icon:o,className:f,...h}));return o.name&&(d.displayName=nw(o.name)),d}/**
|
|
100
|
-
* @license lucide-react v1.46.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const h0={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};h0.node;const cw=be(h0);/**
|
|
105
|
-
* @license lucide-react v1.46.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const m0={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};m0.node;const uw=be(m0);/**
|
|
110
|
-
* @license lucide-react v1.46.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const p0={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};p0.node;const dw=be(p0);/**
|
|
115
|
-
* @license lucide-react v1.46.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const g0={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};g0.node;const fw=be(g0);/**
|
|
120
|
-
* @license lucide-react v1.46.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const x0={name:"book-user",size:24,node:[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]]};x0.node;const hw=be(x0);/**
|
|
125
|
-
* @license lucide-react v1.46.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const y0={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};y0.node;const yh=be(y0);/**
|
|
130
|
-
* @license lucide-react v1.46.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const b0={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};b0.node;const mw=be(b0);/**
|
|
135
|
-
* @license lucide-react v1.46.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const v0={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};v0.node;const eh=be(v0);/**
|
|
140
|
-
* @license lucide-react v1.46.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const S0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};S0.node;const vc=be(S0);/**
|
|
145
|
-
* @license lucide-react v1.46.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const w0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};w0.node;const k0=be(w0);/**
|
|
150
|
-
* @license lucide-react v1.46.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const j0={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};j0.node;const N0=be(j0);/**
|
|
155
|
-
* @license lucide-react v1.46.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const C0={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};C0.node;const pw=be(C0);/**
|
|
160
|
-
* @license lucide-react v1.46.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const E0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};E0.node;const gw=be(E0);/**
|
|
165
|
-
* @license lucide-react v1.46.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const _0={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};_0.node;const ir=be(_0);/**
|
|
170
|
-
* @license lucide-react v1.46.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const A0={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};A0.node;const Ks=be(A0);/**
|
|
175
|
-
* @license lucide-react v1.46.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const T0={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};T0.node;const xw=be(T0);/**
|
|
180
|
-
* @license lucide-react v1.46.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const z0={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};z0.node;const yw=be(z0);/**
|
|
185
|
-
* @license lucide-react v1.46.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const M0={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};M0.node;const bw=be(M0);/**
|
|
190
|
-
* @license lucide-react v1.46.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const R0={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};R0.node;const vw=be(R0);/**
|
|
195
|
-
* @license lucide-react v1.46.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const D0={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};D0.node;const Sc=be(D0);/**
|
|
200
|
-
* @license lucide-react v1.46.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const O0={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};O0.node;const Sw=be(O0);/**
|
|
205
|
-
* @license lucide-react v1.46.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const L0={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};L0.node;const ww=be(L0);/**
|
|
210
|
-
* @license lucide-react v1.46.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const U0={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};U0.node;const qs=be(U0);/**
|
|
215
|
-
* @license lucide-react v1.46.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const B0={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};B0.node;const ha=be(B0);/**
|
|
220
|
-
* @license lucide-react v1.46.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const H0={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};H0.node;const ec=be(H0);/**
|
|
225
|
-
* @license lucide-react v1.46.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const q0={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};q0.node;const kw=be(q0);/**
|
|
230
|
-
* @license lucide-react v1.46.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const P0={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};P0.node;const jw=be(P0);/**
|
|
235
|
-
* @license lucide-react v1.46.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const G0={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};G0.node;const uc=be(G0);/**
|
|
240
|
-
* @license lucide-react v1.46.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const V0={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};V0.node;const dy=be(V0);/**
|
|
245
|
-
* @license lucide-react v1.46.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const Y0={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};Y0.node;const fy=be(Y0);/**
|
|
250
|
-
* @license lucide-react v1.46.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const I0={name:"heart-handshake",size:24,node:[["path",{d:"M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762",key:"17lmqv"}]]};I0.node;const Nw=be(I0);/**
|
|
255
|
-
* @license lucide-react v1.46.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const K0={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};K0.node;const Cw=be(K0);/**
|
|
260
|
-
* @license lucide-react v1.46.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const F0={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};F0.node;const th=be(F0);/**
|
|
265
|
-
* @license lucide-react v1.46.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const Q0={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Q0.node;const Ew=be(Q0);/**
|
|
270
|
-
* @license lucide-react v1.46.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const X0={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};X0.node;const _w=be(X0);/**
|
|
275
|
-
* @license lucide-react v1.46.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const Z0={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};Z0.node;const Aw=be(Z0);/**
|
|
280
|
-
* @license lucide-react v1.46.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const J0={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};J0.node;const Tw=be(J0);/**
|
|
285
|
-
* @license lucide-react v1.46.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const $0={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};$0.node;const zw=be($0);/**
|
|
290
|
-
* @license lucide-react v1.46.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const W0={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};W0.node;const Mw=be(W0);/**
|
|
295
|
-
* @license lucide-react v1.46.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const eb={name:"message-square-heart",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7.5 9.5c0 .687.265 1.383.697 1.844l3.009 3.264a1.14 1.14 0 0 0 .407.314 1 1 0 0 0 .783-.004 1.14 1.14 0 0 0 .398-.31l3.008-3.264A2.77 2.77 0 0 0 16.5 9.5 2.5 2.5 0 0 0 12 8a2.5 2.5 0 0 0-4.5 1.5",key:"1faxuh"}]]};eb.node;const Rw=be(eb);/**
|
|
300
|
-
* @license lucide-react v1.46.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const tb={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};tb.node;const tc=be(tb);/**
|
|
305
|
-
* @license lucide-react v1.46.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const nb={name:"message-square-x",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m14.5 8.5-5 5",key:"19tnj2"}],["path",{d:"m9.5 8.5 5 5",key:"1oa8ql"}]]};nb.node;const nh=be(nb);/**
|
|
310
|
-
* @license lucide-react v1.46.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const ab={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};ab.node;const hy=be(ab);/**
|
|
315
|
-
* @license lucide-react v1.46.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const lb={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};lb.node;const Dw=be(lb);/**
|
|
320
|
-
* @license lucide-react v1.46.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const sb={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};sb.node;const my=be(sb);/**
|
|
325
|
-
* @license lucide-react v1.46.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const ib={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};ib.node;const lr=be(ib);/**
|
|
330
|
-
* @license lucide-react v1.46.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const rb={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};rb.node;const Ow=be(rb);/**
|
|
335
|
-
* @license lucide-react v1.46.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const ob={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};ob.node;const cb=be(ob);/**
|
|
340
|
-
* @license lucide-react v1.46.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const ub={name:"phone",size:24,node:[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};ub.node;const Lw=be(ub);/**
|
|
345
|
-
* @license lucide-react v1.46.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const db={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};db.node;const Uw=be(db);/**
|
|
350
|
-
* @license lucide-react v1.46.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const fb={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};fb.node;const Fs=be(fb);/**
|
|
355
|
-
* @license lucide-react v1.46.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const hb={name:"qr-code",size:24,node:[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]};hb.node;const mf=be(hb);/**
|
|
360
|
-
* @license lucide-react v1.46.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const mb={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};mb.node;const hr=be(mb);/**
|
|
365
|
-
* @license lucide-react v1.46.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const pb={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};pb.node;const Qs=be(pb);/**
|
|
370
|
-
* @license lucide-react v1.46.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const gb={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};gb.node;const Bw=be(gb);/**
|
|
375
|
-
* @license lucide-react v1.46.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const xb={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};xb.node;const yb=be(xb);/**
|
|
380
|
-
* @license lucide-react v1.46.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const bb={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};bb.node;const Xs=be(bb);/**
|
|
385
|
-
* @license lucide-react v1.46.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const vb={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};vb.node;const bh=be(vb);/**
|
|
390
|
-
* @license lucide-react v1.46.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const Sb={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};Sb.node;const mr=be(Sb);/**
|
|
395
|
-
* @license lucide-react v1.46.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const wb={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};wb.node;const Hw=be(wb);/**
|
|
400
|
-
* @license lucide-react v1.46.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const kb={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};kb.node;const pr=be(kb);/**
|
|
405
|
-
* @license lucide-react v1.46.0 - ISC
|
|
406
|
-
*
|
|
407
|
-
* This source code is licensed under the ISC license.
|
|
408
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const jb={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};jb.node;const qw=be(jb);/**
|
|
410
|
-
* @license lucide-react v1.46.0 - ISC
|
|
411
|
-
*
|
|
412
|
-
* This source code is licensed under the ISC license.
|
|
413
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/const Nb={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};Nb.node;const vh=be(Nb);/**
|
|
415
|
-
* @license lucide-react v1.46.0 - ISC
|
|
416
|
-
*
|
|
417
|
-
* This source code is licensed under the ISC license.
|
|
418
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/const Cb={name:"sliders-vertical",size:24,node:[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],aliases:["sliders"]};Cb.node;const Eb=be(Cb);/**
|
|
420
|
-
* @license lucide-react v1.46.0 - ISC
|
|
421
|
-
*
|
|
422
|
-
* This source code is licensed under the ISC license.
|
|
423
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
-
*/const _b={name:"smartphone",size:24,node:[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]};_b.node;const rr=be(_b);/**
|
|
425
|
-
* @license lucide-react v1.46.0 - ISC
|
|
426
|
-
*
|
|
427
|
-
* This source code is licensed under the ISC license.
|
|
428
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
-
*/const Ab={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};Ab.node;const Tb=be(Ab);/**
|
|
430
|
-
* @license lucide-react v1.46.0 - ISC
|
|
431
|
-
*
|
|
432
|
-
* This source code is licensed under the ISC license.
|
|
433
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
-
*/const zb={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};zb.node;const ah=be(zb);/**
|
|
435
|
-
* @license lucide-react v1.46.0 - ISC
|
|
436
|
-
*
|
|
437
|
-
* This source code is licensed under the ISC license.
|
|
438
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
-
*/const Mb={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};Mb.node;const Sh=be(Mb);/**
|
|
440
|
-
* @license lucide-react v1.46.0 - ISC
|
|
441
|
-
*
|
|
442
|
-
* This source code is licensed under the ISC license.
|
|
443
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
-
*/const Rb={name:"sticker",size:24,node:[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}]]};Rb.node;const wh=be(Rb);/**
|
|
445
|
-
* @license lucide-react v1.46.0 - ISC
|
|
446
|
-
*
|
|
447
|
-
* This source code is licensed under the ISC license.
|
|
448
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
-
*/const Db={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};Db.node;const Pw=be(Db);/**
|
|
450
|
-
* @license lucide-react v1.46.0 - ISC
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the ISC license.
|
|
453
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/const Ob={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};Ob.node;const Gw=be(Ob);/**
|
|
455
|
-
* @license lucide-react v1.46.0 - ISC
|
|
456
|
-
*
|
|
457
|
-
* This source code is licensed under the ISC license.
|
|
458
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
-
*/const Lb={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};Lb.node;const Zs=be(Lb);/**
|
|
460
|
-
* @license lucide-react v1.46.0 - ISC
|
|
461
|
-
*
|
|
462
|
-
* This source code is licensed under the ISC license.
|
|
463
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/const Ub={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};Ub.node;const hl=be(Ub);/**
|
|
465
|
-
* @license lucide-react v1.46.0 - ISC
|
|
466
|
-
*
|
|
467
|
-
* This source code is licensed under the ISC license.
|
|
468
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
-
*/const Bb={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};Bb.node;const dc=be(Bb);/**
|
|
470
|
-
* @license lucide-react v1.46.0 - ISC
|
|
471
|
-
*
|
|
472
|
-
* This source code is licensed under the ISC license.
|
|
473
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
-
*/const Hb={name:"unlink",size:24,node:[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]};Hb.node;const Vw=be(Hb);/**
|
|
475
|
-
* @license lucide-react v1.46.0 - ISC
|
|
476
|
-
*
|
|
477
|
-
* This source code is licensed under the ISC license.
|
|
478
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
-
*/const qb={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};qb.node;const Pb=be(qb);/**
|
|
480
|
-
* @license lucide-react v1.46.0 - ISC
|
|
481
|
-
*
|
|
482
|
-
* This source code is licensed under the ISC license.
|
|
483
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
-
*/const Gb={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};Gb.node;const pf=be(Gb);/**
|
|
485
|
-
* @license lucide-react v1.46.0 - ISC
|
|
486
|
-
*
|
|
487
|
-
* This source code is licensed under the ISC license.
|
|
488
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
-
*/const Vb={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};Vb.node;const Vs=be(Vb);/**
|
|
490
|
-
* @license lucide-react v1.46.0 - ISC
|
|
491
|
-
*
|
|
492
|
-
* This source code is licensed under the ISC license.
|
|
493
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
494
|
-
*/const Yb={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};Yb.node;const Yw=be(Yb);/**
|
|
495
|
-
* @license lucide-react v1.46.0 - ISC
|
|
496
|
-
*
|
|
497
|
-
* This source code is licensed under the ISC license.
|
|
498
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
499
|
-
*/const Ib={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Ib.node;const Da=be(Ib);/**
|
|
500
|
-
* @license lucide-react v1.46.0 - ISC
|
|
501
|
-
*
|
|
502
|
-
* This source code is licensed under the ISC license.
|
|
503
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
504
|
-
*/const Kb={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};Kb.node;const Iw=be(Kb),gf={ar:{overview:"نظرة عامة",stickers:"استوديو الملصقات",connection:"حالة الاتصال",control:"التحكم والإدارة",commands:"كتالوج الأوامر",ai:"الذكاء الاصطناعي",groups:"المجموعات",roles:"الأدوار والمشرفين",schedules:"الرسائل المجدولة",notes:"الملاحظات والقوائم",settings:"الإعدادات العامة",logs:"السجلات المباشرة",connected:"متصل بالواتساب",disconnected:"غير متصل",starting:"جارٍ إنشاء الاتصال...",waiting_for_qr:"بانتظار مسح رمز الـ QR",linking:"جارٍ ربط الجلسة...",reconnecting:"جارٍ إعادة الاتصال...",retry_exhausted:"استُنفذت محاولات الاتصال",logged_out:"تم تسجيل الخروج من الهاتف",idle:"الجلسة خاملة",paused:"متوقف مؤقتاً",resume:"استئناف الجلسة",connectSession:"الاتصال",start:"بدء الاتصال",stop:"إيقاف مؤقت",reconnect:"إعادة الاتصال",unlink:"إلغاء الربط (Unlink)",restart:"إعادة تشغيل البوت",save:"حفظ التغييرات",saving:"جارٍ الحفظ...",discard:"تجاهل",unsavedChanges:"تغييرات غير محفوظة",toggleOn:"مفعل",toggleOff:"معطل",cancel:"إلغاء",delete:"حذف",edit:"تعديل",add:"إضافة",refresh:"تحديث",logout:"تسجيل الخروج",backToApp:"العودة للتطبيق",close:"إغلاق",copy:"نسخ",copied:"تم النسخ!",filter:"تصفية",sort:"ترتيب",more:"المزيد",reset:"إعادة التعيين",autoScroll:"تمرير تلقائي",dismiss:"إخفاء",openNavigation:"فتح القائمة",closeNavigation:"إغلاق القائمة",logsSubtitle:"سجل أحداث النظام واتصالات واتساب واستدعاءات الذكاء الاصطناعي في الوقت الفعلي",groupsSubtitle:"إدارة مجموعات واتساب، الحماية من الروابط، تقييد الوسائط، ورسائل الترحيب التلقائية",groupsCount:"{n} مجموعة",noGroupsTitle:"لا توجد مجموعات حتى الآن",noGroupsBody:"بمجرد إضافة البوت إلى مجموعات واتساب، ستظهر تلقائياً هنا مع خيارات الإشراف والحماية.",unnamedGroup:"مجموعة بدون اسم",mediaNone:"بلا قيود (الكل)",mediaBlockAll:"حظر كافة الوسائط",clientIdentity:"هوية العميل",noPhonePaired:"لم يتم ربط أي هاتف بعد",linkedAs:"مرتبط كـ",datastoreHealth:"حالة قاعدة البيانات",datastoreHealthy:"بيانات الاعتماد ومفاتيح الجلسة ومطابقات LID سليمة ومستقرة.",reconnectPolicy:"سياسة إعادة الاتصال",reconnectPolicyDesc:"تراجع خطي تدريجي (5ث، 10ث، 15ث، 20ث، 25ث) مع محاولات محدودة.",maxAttemptsAutoPause:"الحد الأقصى: 5 محاولات · إيقاف تلقائي دون إنترنت",platformWeb:"المنصة: واتساب ويب (v7 Multi-Device)",databaseNodeSqlite:"قاعدة البيانات: node:sqlite (تزامني)",totalGroups:"إجمالي المجموعات",totalUsers:"المستخدمون المسجلون",commandCount:"الأوامر المفعلة",uptime:"مدة التشغيل",uptimeDayUnit:"يوم",uptimeHourUnit:"ساعة",uptimeMinuteUnit:"دقيقة",online:"متصل",offline:"غير متصل",quickCommandsDesc:"{n} أمراً واختصاراً نشطاً",moreActions:"إجراءات إضافية",lightMode:"الوضع الفاتح",darkMode:"الوضع الداكن",dataDir:"مجلد البيانات",quickStatus:"حالة النظام",activeSchedules:"المهام المجدولة النشطة",activeListening:"المساعد نشط ويستقبل الرسائل",pausedOrLinking:"اتصال واتساب متوقف حالياً أو قيد المزامنة",aiTitle:"إعدادات الذكاء الاصطناعي",aiSubtitle:"اختر المزود المناسب بضغطة زر أو خصص النماذج والمفاتيح",aiAgentEnabled:"تفعيل وكيل الذكاء الاصطناعي",aiProvider:"المزود النشط",quickSetup:"معالج الإعداد السريع للمزودين",aiVision:"تحليل وفهم الصور (Vision)",aiVisionDesc:"تحويل الصور وتمريرها لنماذج الرؤية الذكية المتوافقة",aiStt:"محرك تحويل الصوت إلى نص (STT)",sttDesc:"محرك تفريغ الرسائل الصوتية وتحويلها إلى نص",sttAuto:"تلقائي (مطابق للمزود النشط)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"لغة ردود البوت",botLanguageDesc:"تحديد لغة ردود البوت أو تغييرها عبر الأمر !lang",langAuto:"تلقائي (حسب لغة رسالة المستخدم)",langAr:"العربية الفصحى (دائماً)",langEn:"English (دائماً)",modelName:"النموذج",apiKey:"مفتاح API",enterApiKey:"أدخل المفتاح",baseUrl:"Base URL",maxToolSteps:"الحد الأقصى لخطوات الأدوات",googleSearch:"أداة بحث جوجل المدمجة (Google Search)",personaPrompt:"توجيه شخصية البوت (AI Persona)",personaDesc:"تعديل التوجيه الأساسي الذي يحدد أسلوب وشخصية مساعدك الذكي",editPersona:"تعديل توجيه الشخصية",memoryFiles:"الذاكرة طويلة المدى",memoryDesc:"ذاكرة البوت الدائمة: تشترك جميع المحادثات في الذاكرة العامة، ولكل محادثة ملف خاص. يقرأ البوت المعلومات المحفوظة وأي نص حر تكتبه.",manageMemory:"إدارة ملفات الذاكرة",memoryGlobalScope:"الذاكرة العامة",memoryGlobalScopeHint:"تُضاف إلى سياق جميع المحادثات",memoryChatScopeHint:"تُضاف إلى سياق هذه المحادثة فقط",memoryEntriesCount:"{n} معلومة محفوظة",memoryProseHint:"يقرأ البوت محتوى الملف كله: الأسطر التي تبدأ بـ `-` معلومات منفصلة يمكنه إضافتها أو حذفها، ويقرأ أي نص حر كما كُتب.",memoryEditorPlaceholder:"اكتب هنا ما تريد أن يتذكره البوت دائمًا…",aiInspector:"معاينة محادثات الذكاء الاصطناعي",aiInspectorDesc:"نظرة للقراءة فقط على السياق المخزّن لكل محادثة: الردود، الوسائط، واستخدام الأدوات.",openInspector:"فتح المعاينة",noConversations:"لا توجد محادثات محفوظة بعد.",convTurns:"{n} جزء",backToList:"رجوع للقائمة",convTruncated:"يقتصر العرض على آخر 200 جزء.",convMedia:"ملف وسائط",capabilities:"القدرات والميزات المتقدمة",modelsAvailableLive:"نماذج متاحة لحسابك (تم التحقق عبر API)",modelsRecommendedSeed:"نماذج مقترحة / معروفة (دليل النماذج)",connectKeyFirstPrompt:"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك",refreshModels:"تحديث قائمة النماذج",refreshing:"جارٍ التحديث...",fetchModels:"فحص النماذج المتاحة",fetchingModels:"جارٍ فحص النماذج...",capVision:"الرؤية",capStt:"الصوت",capAudio:"إدخال الصوت",capText:"نص",capPdf:"PDF",capVideo:"فيديو",supported:"مدعوم",unsupported:"غير مدعوم",sourceLive:"حسابك",sourceSeed:"مقترح",sourceUnknown:"غير معروف",visionUnsupportedNotice:"النموذج المختار لا يدعم معالجة الصور والرؤية (Vision)، تم تعطيل الميزة تلقائياً.",sttUnsupportedNotice:"النموذج المختار لا يدعم تحويل وفهم الصوت (STT)، تم تعطيل الميزة تلقائياً.",aiSttEnabled:"تفعيل تحويل وفهم الصوت (STT)",aiSttEnabledDesc:"تفريغ الرسائل الصوتية وفهم الملفات الصوتية عبر النموذج المختار",providerGemini:"Google Gemini",providerGeminiDesc:"الافتراضي، يدعم البحث والملفات والصور والصوتيات محلياً",providerGroq:"Groq Cloud",providerGroqDesc:"فائق السرعة لنماذج Llama 3 و Mixtral مع دعم Vision",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"لنماذج GPT-4o أو أي خادم متوافق مع API OpenAI",providerOllama:"Ollama (محلي)",providerOllamaDesc:"تشغيل النماذج محلياً على جهازك مجاناً بدون إنترنت",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"لنماذج Claude 3.5 Sonnet الذكية والمتقدمة",scanQrHint:"افتح تطبيق واتساب على هاتفك > الأجهزة المرتبطة > ربط جهاز، وامسح الرمز أدناه.",pairingCode:"رمز الربط (Pairing Code)",reconnectingSoon:"إعادة الاتصال قريباً...",nextAttemptIn:"المحاولة القادمة خلال",seconds:"ثوانٍ",tabGeneral:"عام والبادئة",tabAI:"الذكاء الاصطناعي",tabSecurity:"الأمان والوصول",tabProxy:"بروكسي واتساب",tabStorage:"التخزين والوسائط",tabLogs:"سجلات النظام",prefixTitle:"بادئة أوامر البوت (Command Prefix)",prefixDesc:"الرمز أو الحرف الذي تبدأ به جميع الأوامر الموجهة للبوت في واتساب (مثل !help أو /ping)",prefixPlaceholder:"مثال: !",prefixPresets:"بادئات شائعة سريعة:",prefixPreview:"معاينة حية لشكل الأوامر:",prefixSaveBtn:"حفظ البادئة الجديدة",prefixUpdated:"تم تحديث بادئة الأوامر بنجاح!",prefixValidation:"يجب أن تكون البادئة من رمز واحد إلى 3 رموز",activePrefix:"البادئة الحالية",changePrefix:"تعديل البادئة",prefix:"بادئة الأوامر (Prefix)",botTimezone:"المنطقة الزمنية (Timezone)",botTimezoneDesc:"المنطقة الزمنية المعتمدة لحساب أوقات الصلاة والمهام المجدولة (مثل Africa/Cairo)",botMinDelay:"الحد الأدنى للتأخير البشري (ms)",botMaxDelay:"الحد الأقصى للتأخير البشري (ms)",delaysDesc:"فترة انتظار قصيرة قبل إرسال الردود ليبدو سلوك البوت طبيعياً وبشرياً",delayRangeError:"يجب ألا يزيد الحد الأدنى للتأخير عن الحد الأقصى.",shareSettingsTitle:"مشاركة الإعدادات",shareSettingsDesc:"صدّر إعداداتك في ملف JSON يشاركه أصدقاؤك، أو استورد ملف صديقك. المفاتيح السرية (مفاتيح الـ API وكلمات المرور) لا تُصدَّر أبداً ولا تُستبدل بالاستيراد.",exportAction:"تصدير",exportSettings:"تصدير الإعدادات",exportSettingsDesc:"ملف JSON يتضمن الإعدادات غير السرية التي غيّرتها",exportSettingsSuccess:"تم تصدير الإعدادات",exportSavedTo:"حُفظ في",exportSettingsError:"تعذر تصدير الإعدادات",importSettings:"استيراد من ملف",importSettingsError:"ملف غير صالح — يجب أن يكون ملفًا صادرًا من إعدادات Levix",importTitle:"استيراد الإعدادات",importSummary:"سيُطبّق على هذا الجهاز:",importSettingsCount:"إعداد",importPermissionsCount:"صلاحية أمر",importAliasesCount:"أسماء بديلة",importDisabledCount:"أمر مُعطَّل",importPrefix:"البادئة",importApply:"تطبيق الاستيراد",importSuccess:"تم استيراد الإعدادات بنجاح",importSkipped:"تم تخطي",importRestartNeeded:"تحتاج إعادة تشغيل البوت لتُطبَّق",changePassword:"تغيير كلمة مرور لوحة التحكم",currentPassword:"كلمة المرور الحالية",newPassword:"كلمة المرور الجديدة",confirmPassword:"تأكيد كلمة المرور الجديدة",passwordMatchError:"كلمتا المرور غير متطابقتين",passwordMinLength:"يجب ألا تقل كلمة المرور عن 8 خانات",passwordChangedSuccess:"تم تغيير كلمة مرور لوحة التحكم بنجاح!",proxyTitle:"بروكسي واتساب الصادر (Outbound Proxy)",proxyDesc:"توجيه اتصالات Baileys إلى واتساب عبر بروكسي خارجي لتجاوز قيود الشبكة أو الحظر",proxyEnabled:"تفعيل البروكسي لاتصالات واتساب",proxyProtocol:"بروتوكول البروكسي (Protocol)",proxyHost:"عنوان المضيف (Host / IP)",proxyPort:"المنفذ (Port)",proxyUsername:"اسم المستخدم (اختياري)",proxyPassword:"كلمة المرور (اختياري)",proxyApplyHint:"⚠️ ملاحظة: عند تعديل إعدادات البروكسي، اضغط على زر إعادة الاتصال في صفحة الاتصال لتطبيق التغييرات.",storageTitle:"إدارة البيانات والاحتفاظ بها",storageDesc:"تحديد مدد صلاحية البيانات المؤقتة وسجلات الرسائل الموجهة والحدود القصوى للجلب",forwardTtl:"صلاحية سجلات الرسائل الموجهة (أيام)",forwardTtlDesc:"حذف إحصائيات الرسائل الموجهة القديمة تلقائياً بعد مرور هذا العدد من الأيام",maxFetchBytes:"الحد الأقصى لجلب محتوى صفحات الويب (Bytes)",maxFetchBytesDesc:"حجم المحتوى الأقصى المسموح لأدوات الذكاء الاصطناعي بجلبه من صفحات الويب (افتراضي: 512KB)",ffmpegPath:"مسار محرك FFmpeg مخصص (اختياري)",weatherApiKey:"مفتاح OpenWeatherMap API (اختياري)",chooseLanguage:"اختر اللغة",langCardTitle:"لغة الواجهة: العربية (RTL)",langCardDesc:"تصميم مخصص بالكامل لاتجاه الكتابة العربي من اليمين لليسار مع خط تجوال",langSwitchBtn:"Switch to English",langName:"العربية",interfaceLanguage:"لغة لوحة التحكم",interfaceLanguageDesc:"العربية (RTL) أو الإنجليزية (LTR) لهذه اللوحة",botPort:"منفذ خادم لوحة التحكم (Port)",botPortHint:"* يتطلب تغيير المنفذ إعادة تشغيل البوت ليأخذ مفعوله",searchPlaceholder:"ابحث في الأوامر أو الأسماء البديلة...",thCommand:"الأمر",thAliases:"الأسماء البديلة",thDescription:"الوصف",thScope:"النطاق",thRequiredRole:"الرتبة المطلوبة",thStatus:"الحالة",thGroupName:"اسم المجموعة",thGroupJid:"معرف المجموعة (JID)",thMembers:"الأعضاء",thAntiLink:"مانع الروابط",thMedia:"الوسائط",thWelcome:"الترحيب",thTarget:"الوجهة",thMessage:"الرسالة",thSchedule:"الموعد",thType:"النوع",thDelivery:"حالة الإرسال",thActions:"إجراءات",scheduleNewMsg:"جدولة رسالة جديدة",liveServerLogs:"سجلات النظام المباشرة",clearLogs:"مسح السجلات",allLogs:"جميع المستويات",noLogs:"لا توجد سجلات مسجلة حتى الآن.",logSourceBot:"البوت",logSourceHost:"مضيف أندرويد",shareLogs:"مشاركة السجلات",share:"مشاركة",savedSuccessfully:"تم حفظ الإعدادات بنجاح!",saveFailed:"حدث خطأ أثناء حفظ الإعدادات.",connectionStatusUpdated:"تم تحديث حالة الاتصال.",networkError:"تعذر الاتصال بالخادم.",loading:"جارٍ التحميل...",aiAssistantDesc:"وكيل ذكي متعدد الأدوات مع ذاكرة طويلة الأمد",settingsSub:"البادئة، التأخير، الخدمات، والأمان",editAliases:"تعديل الأسماء المستعارة",aliasesFor:"الأسماء المستعارة لـ",addAlias:"إضافة اسم مستعار",newAliasPlaceholder:"اكتب اسماً جديداً...",noAliases:"لا توجد أسماء مستعارة",aliasesHelp:"الأسماء المستعارة تتيح استدعاء هذا الأمر بأسماء بديلة (مثل: p بدلاً من ping).",aliasAlreadyAdded:"هذا الاسم المستعار مضاف بالفعل",aliasScriptArabic:"اسم مستعار بالعربية",aliasScriptLatin:"اسم مستعار بالإنجليزية",commandsSub:"إدارة رتب الأوامر والأسماء المستعارة وتفعيلها أو تعطيلها مباشرة",editPrefixHint:"اضغط لتعديل البادئة",usage:"الاستخدام",usageHint:"الأمر كما يُرسل في واتساب",noMatchingCommands:"لا توجد أوامر مطابقة لبحثك.",commandEnabled:"تم تفعيل الأمر '{name}'",commandDisabled:"تم تعطيل الأمر '{name}'",permissionUpdated:"تم تحديث رتبة '{name}'",scopeAll:"الكل",scopeGroup:"المجموعات",scopePrivate:"خاص",permMembers:"الجميع (الأعضاء)",permAdminsOnly:"مشرفو المجموعة",permAdminsOwner:"مشرفو المجموعة أو المالك",permOwnerOnly:"مالك البوت فقط",selectRecipient:"اختر المحادثة المستهدفة",searchRecipients:"ابحث بالاسم أو رقم الهاتف...",recipients:"المستلمون",chooseChat:"اختر جهة اتصال أو مجموعة...",noRecipientsFound:"لم يتم العثور على محادثات",pickPhoneContact:"من دليل الهاتف",pickPhoneContactHint:"اختر جهة اتصال من هاتف أندرويد",maxSchedulesReached:"تم بلوغ الحد الأقصى (3 رسائل مجدولة)",limitReached:"الحد الأقصى مكتمل",scheduleType:"نوع الجدولة",scheduleRecurring:"دوري متكرر",scheduleOnce:"مرة واحدة (تاريخ ووقت محدد)",repeat:"التكرار",repeatDaily:"كل يوم",repeatWeekly:"كل أسبوع",repeatMonthly:"كل شهر",repeatHourly:"كل عدد من الساعات",weekdays:"أيام الأسبوع",dayOfMonth:"يوم الشهر",monthDayHint:"إذا كان الشهر أقصر من اليوم المختار (مثل 31 في فبراير) تُتخطى تلك المرة.",everyHours:"كل كم ساعة",atMinute:"عند الدقيقة",sendTime:"وقت الإرسال",deliveryDateTime:"موعد وتاريخ الإرسال",timezoneLabel:"المنطقة الزمنية",recurrencePreview:"المعاينة",weekdaySun:"الأحد",weekdayMon:"الاثنين",weekdayTue:"الثلاثاء",weekdayWed:"الأربعاء",weekdayThu:"الخميس",weekdayFri:"الجمعة",weekdaySat:"السبت",contactFallback:"جهة اتصال",groupFallback:"مجموعة",hoursUnit:"ساعة",messageText:"نص الرسالة",messagePlaceholder:"اكتب الرسالة التي سيتم إرسالها تلقائياً...",scheduleAction:"جدولة الرسالة",scheduledCount:"مجدول",headerSubtitle:"إرسال دوري ومحدد بالوقت",noSchedules:"لا توجد رسائل مجدولة حالياً.",typeRecurring:"متكرر",typeOnce:"مرة واحدة",deliveryFailed:"فشل الإرسال",deliveryActive:"نشط",changeChat:"تغيير المحادثة",weekdayRequired:"اختر يوماً واحداً على الأقل",tabIntegrations:"الربط والخدمات",integrationsDesc:"مفاتيح واجهات البرمجة (API) للخدمات الخارجية المرتبطة بالبوت",youtubeApiKey:"مفتاح YouTube Data API (اختياري)",selectModel:"اختر نموذجاً من القائمة...",availableModels:"النماذج المتاحة من المزود",customModel:"أو اكتب اسم نموذج مخصص",modelListToggle:"القائمة",modelCustomToggle:"مخصص",showSecret:"إظهار السر",hideSecret:"إخفاء السر",sessionStatus:"حالة الجلسة",sessionActive:"الجلسة متصلة وتستقبل الرسائل",sessionOffline:"الجلسة غير متصلة حالياً",connectedNumber:"الرقم المرتبط",tabFeedback:"الملاحظات والدعم",feedbackTitle:"أرسل ملاحظاتك إلى المطوّر",feedbackDesc:"مشكلة، اقتراح، أو سؤال — تُسلَّم رسالتك مباشرةً إلى مطوّر ليفيكس. لا يوجد وسيط ولا نظام تذاكر.",feedbackTopicLabel:"موضوع الرسالة",feedbackTopicBug:"هناك خلل",feedbackTopicIdea:"فكرة أو طلب",feedbackTopicQuestion:"سؤال",feedbackTopicPraise:"يعمل بشكل جيد",feedbackTopicOther:"شيء آخر",feedbackMessageLabel:"رسالتك",feedbackMessagePlaceholder:"ماذا حدث، وماذا كنت تتوقع، وماذا كنت تفعل في ذلك الوقت. التفاصيل تساعد — يقرأها شخص حقيقي.",feedbackCharsNeeded:"حرفاً إضافياً على الأقل",feedbackRatingLabel:"كيف يعمل ليفيكس معك؟ (اختياري)",feedbackContactLabel:"كيف نتواصل معك؟ (اختياري)",feedbackContactPlaceholder:"بريد إلكتروني أو معرّف واتساب/تيليجرام — فقط إن أردت رداً",feedbackSendBtn:"إرسال الملاحظات",feedbackSending:"جارٍ الإرسال...",feedbackSent:"تم الإرسال. شكراً لك!",feedbackSentDesc:"وصلت رسالتك إلى مطوّر ليفيكس. إن تركت وسيلة للتواصل، توقّع رداً.",feedbackSendAnother:"إرسال رسالة أخرى",feedbackWhatIsSent:"ما يُرسَل مع رسالتك",feedbackWhatIsSentDesc:"نص رسالتك، والموضوع، والتقييم ووسيلة التواصل إن أضفتهما، والملف الذي أرفقته إن وُجد، بالإضافة إلى إصدار ليفيكس والمنصة التي يعمل عليها. لا تُرسَل أي رسالة واتساب أو محادثة أو جهة اتصال أو مفتاح، ولا يُرسَل شيء إلا عند الضغط على إرسال.",feedbackRuntimeLabel:"يُرفَق مع الرسالة",feedbackGithubHint:"للأخطاء التي تريد تتبّعها علناً مع السجلات، افتح Issue على GitHub.",feedbackOpenGithub:"فتح Issue على GitHub",feedbackAttach:"إرفاق ملف",feedbackAttachmentHint:"اختياري — لقطة شاشة أو ملف سجل حتى {max} م.ب",feedbackRemoveAttachment:"إزالة المرفق",fileSizeKb:"{size} ك.ب",fileSizeMb:"{size} م.ب",feedbackFileTooLarge:"الملف كبير جداً — الحد الأقصى {max} م.ب",scheduleAttachMedia:"إرفاق وسائط",scheduleMediaHint:"اختياري — صورة أو فيديو أو صوت أو مستند حتى {max} م.ب",scheduleRemoveMedia:"إزالة الوسائط",scheduleDetails:"تفاصيل الرسالة المجدولة",detailMedia:"الوسائط",detailLastRun:"آخر إرسال",detailError:"الخطأ",detailCreated:"أُنشئت",retryDelivery:"إعادة محاولة الإرسال",mediaKindImage:"صورة",mediaKindVideo:"فيديو",mediaKindAudio:"صوت",mediaKindDocument:"مستند",stickerStudio:"استوديو الملصقات",stickersDesc:"إنشاء وإدارة ملصقات واتساب",library:"المكتبة",packs:"الحزم",favorites:"المفضلة",create:"إنشاء",recent:"مستخدمة حديثاً",allStickers:"الكل",static:"ثابت",animated:"متحرك",noPack:"بدون حزمة",anyPack:"أي حزمة",newPack:"حزمة جديدة…",addToPack:"إضافة لحزمة",moveToPack:"نقل لحزمة",removeFromPack:"إزالة من الحزمة",favorite:"إضافة للمفضلة",unfavorite:"إزالة من المفضلة",download:"تحميل",convertToImage:"تحويل لصورة",shareSticker:"مشاركة",sendViaWhatsapp:"إرسال عبر واتساب",deleteEverywhere:"حذف من كل مكان",deleteKeepStickers:"حذف الحزمة فقط (مع الاحتفاظ بالملصقات)",deletePackAndStickers:"حذف الحزمة والملصقات غير الموجودة في حزم أخرى",openInCreate:"فتح في المُنشئ",packName:"اسم الحزمة",mergeInto:"دمج في حزمة أخرى",merge:"دمج",stickersKept:"سيتم الاحتفاظ بالملصقات",trim:"اقتطاع المقطع",background:"الخلفية",transparent:"شفاف",white:"أبيض",black:"أسود",customColor:"لون مخصص",removePlainBackground:"إزالة الخلفية المسطحة",fit:"الملاءمة",contain:"احتواء",cover:"تغطية",zoom:"تكبير/تصغير",panX:"تحريك أفقي",panY:"تحريك عمودي",rotate:"تدوير",addText:"إضافة نص",addEmoji:"إضافة إيموجي",createAnother:"إنشاء آخر",qualityReduced:"تم ضغط الملصق ليناسب حد واتساب",alreadyInLibrary:"الملصق موجود بالفعل في المكتبة",encoderMissing:"لا يوجد محول WebP، إنشاء الملصقات معطل.",tryAgain:"حاول مرة أخرى",loadMore:"تحميل المزيد",selectAll:"تحديد الكل",clearSelection:"إلغاء التحديد",deleteConfirm:"هل أنت متأكد أنك تريد الحذف؟",nSelected:"{n} محددة",sizeLbl:"الحجم:",formatLbl:"التنسيق:",packsLbl:"الحزم:",gifBadge:"متحرك",startDur:"البداية: {start}ث | المدة: {dur}ث",outlineBox:"إطار/خلفية",toolsLbl:"الأدوات",clearLbl:"مسح",resetPan:"إعادة ضبط",clickOrDrag:"انقر أو اسحب صورة/فيديو للرفع",creatingSticker:"جارٍ إنشاء الملصق…",goToLibrary:"الذهاب للمكتبة",loadingLbl:"جارٍ التحميل…",selectPack:"اختر حزمة…",noPacksCreated:"لم يتم إنشاء أي حزم بعد",packCreated:"تم إنشاء الحزمة",packDeleted:"تم حذف الحزمة",packRenamed:"تم تغيير اسم الحزمة",failedToCreatePack:"فشل إنشاء الحزمة",failedToDeletePack:"فشل حذف الحزمة",failedToRenamePack:"فشل تغيير اسم الحزمة",failedToMerge:"فشل الدمج",someStickersInPacks:"بعض الملصقات موجودة في حزم: {packs}",deleteEverywherePrompt:"حذفها من كل مكان؟",packsMerged:"تم دمج الحزم",emptyLibrary:"المكتبة فارغة",jobStage_probing:"جارٍ الفحص…",jobStage_decoding:"جارٍ فك التشفير…",jobStage_encoding:"جارٍ التشفير…",jobStage_optimizing:"جارٍ التحسين…",jobStage_saving:"جارٍ الحفظ…",jobQueued:"جارٍ الانتظار في الطابور…",sortNewest:"الأحدث",sortOldest:"الأقدم",sortName:"الاسم",sortRecent:"الأحدث استخداماً",unlinkStickersWarning:"سيتم مسح مكتبة الملصقات بالكامل أيضاً.",stickerErr_NO_MEDIA:"أرسل صورة أو فيديو أو ملصقاً.",stickerErr_UNSUPPORTED_TYPE:"نوع الملف غير مدعوم.",stickerErr_TOO_LARGE:"الملف كبير جداً.",stickerErr_DIMENSIONS_TOO_LARGE:"أبعاد الصورة كبيرة جداً.",stickerErr_VIDEO_TOO_LONG:"الفيديو طويل جداً.",stickerErr_CORRUPT:"الملف تالف.",stickerErr_CONVERSION_FAILED:"فشل تحويل الملصق.",stickerErr_OUTPUT_TOO_LARGE:"حجم الملصق النهائي كبير جداً.",stickerErr_ENCODER_MISSING:"الخادم لا يدعم معالجة WebP.",stickerErr_TIMEOUT:"انتهى وقت المعالجة.",stickerErr_BUSY:"النظام مشغول، يرجى المحاولة لاحقاً.",stickerErr_NOT_FOUND:"الملصق غير موجود.",stickerErr_PACK_NOT_FOUND:"الحزمة غير موجودة.",stickerErr_PACK_EXISTS:"اسم الحزمة موجود بالفعل.",stickerErr_INVALID_NAME:"اسم الحزمة غير صالح.",stickerErr_INVALID_OPTIONS:"خيارات التعديل غير صالحة.",stickerErr_LIBRARY_FULL:"المكتبة ممتلئة.",stickerErr_PACK_LIMIT:"تم الوصول للحد الأقصى للحزم.",stickerErr_IN_USE:"الملصق مستخدم في حزم أخرى.",stickerErr_STORAGE_UNAVAILABLE:"مساحة التخزين غير متوفرة.",stickerErr_NOT_CONNECTED:"واتساب غير متصل.",stickerErr_INTERNAL:"خطأ داخلي في الخادم.",stickerErr_CANCELLED:"أُلغي التحويل.",stickerLibraryLimit:"الحد الأقصى للملصقات",stickerLibraryLimitDesc:"عدد الملصقات التي يمكن لكل شخص الاحتفاظ بها في استوديو الملصقات.",autoDeleteKeepDays:"مدة الاحتفاظ بنسخ الحذف التلقائي (أيام)",autoDeleteKeepDaysDesc:"كم يوماً تبقى نسخ النص التي تحتفظ بها قواعد الحذف التلقائي.",stickerUploadInfo:"{kind} · {size} كيلوبايت",stickerRemoveHint:"تُطبّق إزالة الخلفية المسطحة عند الإنشاء.",stickerSelect:"تحديد الملصق",stickerOpen:"فتح تفاصيل الملصق",stickerShareSaved:"حُفظ الملف في {dir}",stickerDrag:"اسحب ملفًا إلى هنا أو اختره",stickerAlignmentStart:"البداية",stickerAlignmentCenter:"الوسط",stickerAlignmentEnd:"النهاية",stickerKindImage:"صورة",stickerKindGif:"صورة متحركة",stickerKindVideo:"فيديو",stickerKindWebp:"ملصق WebP",stickerDeletePackWarning:"سيُحذف الملصق من جميع الحزم.",stickerSendLimit:"يمكن إرسال عدد محدود من الملصقات دفعة واحدة.",stickerExportLimit:"اختر عددًا أقل من الملصقات للتصدير.",tolerance:"نسبة التسامح",stickerName:"اسم الملصق",stickerNamePlaceholder:"اسم اختياري…",trimStart:"البداية",trimDuration:"المدة",trimSeconds:"ثوانٍ",textContent:"النص",textSize:"الحجم",textColor:"اللون",textAlignment:"المحاذاة",textOutline:"إطار",textBackground:"خلفية النص",layerRotation:"الدوران",deleteLayer:"حذف الطبقة",noLayers:"لا توجد طبقات",reorderUp:"تقديم",reorderDown:"تأخير",renamePack:"تغيير اسم الحزمة",deletePack:"حذف الحزمة",packEmpty:"هذه الحزمة فارغة",noPacks:"لا توجد حزم بعد",createFirstPack:"أنشئ حزمتك الأولى",stickerCount:"{n} ملصقات",notConnectedHint:"اتصل بواتساب أولاً",exportFirstFrame:"يصدّر الإطار الأول",downloadWebp:"تحميل WebP",downloadPng:"تحميل PNG",downloadGif:"تحميل GIF",reorderDragHint:"اسحب لإعادة الترتيب",saved:"تم الحفظ",createBtn:"إنشاء ملصق",uploadHint:"يقبل JPEG، PNG، WebP، GIF، MP4، WebM",stickerCreated:"تم إنشاء الملصق!",stickerSent:"تم إرسال الملصق",stickersSent:"تم إرسال الملصقات",stickerPreview:"معاينة الملصق",firstFrameHint:"يُصدَّر الملصق المتحرك كصورة ثابتة من إطاره الأول.",gifOnlyAnimated:"تصدير GIF متاح للملصقات المتحركة فقط.",rename:"إعادة التسمية",inUsePacksLabel:"في هذه الحزم",notInPack:"ليس في أي حزمة",retryLoad:"إعادة المحاولة",showingCount:"يُعرض {shown} من {total}",emojiPaletteLabel:"الرموز التعبيرية",customEmoji:"رمز آخر",emojiInputLabel:"اكتب رمزًا تعبيريًا",textPlaceholder:"نص",layerSelected:"الطبقة المحددة",selectVisible:"تحديد الظاهر",downloadZip:"تنزيل ملف مضغوط",noRecipients:"لا توجد محادثات",recipientGroup:"مجموعة",recipientContact:"جهة اتصال",sending:"جارٍ الإرسال…",deleteStickersTitle:"حذف الملصقات",inUseBody:"هذا الملصق داخل حزمة. حذفه يزيله من تلك الحزم أيضًا.",inUseBulkBody:"بعض الملصقات المحددة موجودة في حزم، ولم تُحذف.",deleteEverywhereHint:"الحذف من كل مكان يزيل الملصقات من جميع الحزم ومن المكتبة.",packNameLength:"يجب أن يكون اسم الحزمة بين حرف واحد و40 حرفًا.",newPackPlaceholder:"اسم الحزمة",createPack:"إنشاء حزمة",skippedOther:"تعذّر تحديث بعض الملصقات.",addedToPack:"أُضيف إلى الحزمة",movedToPack:"نُقل إلى الحزمة",removedFromPack:"أُزيل من الحزمة",renamed:"تم تحديث الاسم",downloaded:"بدأ التنزيل",shareDone:"تمت المشاركة",backToPacks:"كل الحزم",confirmMerge:"دمج الحزم",mergeTitle:"دمج في حزمة أخرى",mergeConfirmBody:"تبقى الملصقات في المكتبة. تُلحَق عناصر هذه الحزمة بالحزمة الأخرى، ويُتخطى المكرر، ثم تُحذف هذه الحزمة.",trimApplied:"يُطبَّق الاقتطاع عند إنشاء الملصق.",gifTrimNote:"يُطبَّق اقتطاع الصورة المتحركة عند الإنشاء، وقد لا يطابق المعاينة إطارًا بإطار.",animatedUnavailable:"هذا الخادم لا يستطيع ترميز الملصقات المتحركة.",targetPack:"إضافة إلى حزمة",previewStage:"معاينة الملصق",rotateQuarter:"تدوير 90 درجة",uploadReady:"الملف جاهز",stickerNameTooLong:"يمكن أن يبلغ اسم الملصق 60 حرفًا كحد أقصى.",noDestinationPack:"اختر حزمة للدمج فيها.",deletePackTitle:"حذف الحزمة",openPack:"فتح الحزمة",searchStickers:"البحث في الملصقات",sortBy:"الترتيب",filterBy:"التصفية",packFilter:"الحزمة",noResults:"لا توجد ملصقات مطابقة للبحث",favoritesEmpty:"لا توجد ملصقات مفضلة بعد",recentEmpty:"لا توجد ملصقات استُخدمت أو أُنشئت خلال آخر 30 يومًا",favoriteBadge:"مفضلة",deleted:"تم الحذف",autoDelete:"الحذف التلقائي",autoDeleteSubtitle:"احذف الرسائل التي تحتوي على كلمات تختارها.",newRule:"قاعدة جديدة",editRule:"تعديل القاعدة",searchRules:"ابحث بالاسم أو الكلمة",sortByName:"الاسم",sortMostDeleted:"الأكثر حذفًا",sortLastDeleted:"آخر حذف",filterStatus:"الحالة",statusAny:"الكل",statusEnabled:"مفعّلة",statusDisabled:"متوقفة",filterChat:"المحادثات",filterSender:"المرسلون",chatsAll:"كل المحادثات",chatsGroups:"المجموعات فقط",chatsPrivate:"الخاصة فقط",sendersEveryone:"الجميع",sendersSelected:"جهات محددة",oneContact:"جهة واحدة",sendersCount:"{n} جهات",matchMode:"المطابقة",matchContains:"يحتوي",matchWord:"كلمة كاملة",matchExact:"الرسالة كاملة",matchContainsHint:"تُحذف الرسالة إذا تضمن نصها الكلمة.",matchWordHint:"تُحذف عندما تقف الكلمة وحدها، لا داخل كلمة أطول.",matchExactHint:"تُحذف فقط عندما تكون الرسالة كلها هي الكلمة تمامًا.",chatScopeLabel:"المحادثات",ruleName:"الاسم",ruleNamePlaceholder:"اسم اختياري",keywordsLabel:"الكلمات",keywordsPlaceholder:"اكتب كلمة ثم اضغط Enter",keywordCount:"{n} / {max}",keywordTooLong:"يجب ألا تتجاوز الكلمة 100 حرف.",keywordEmpty:"هذه الكلمة فارغة بعد تنظيفها.",keywordDuplicate:"هذه الكلمة موجودة في القائمة.",keywordsRequired:"أضف من كلمة واحدة إلى 50 كلمة.",keywordsMax:"يمكن أن تضم القاعدة 50 كلمة كحد أقصى.",nameTooLong:"يجب ألا يتجاوز الاسم 60 حرفًا.",includeOwn:"احذف رسائلي أيضًا",includeOwnHint:"تُحذف رسائل الحساب المرتبط أيضًا.",forEveryone:"احذف لدى الجميع عندما يمكن ذلك",forEveryoneHint:"تُحذف رسائل الآخرين لدى الجميع فقط في المجموعات التي يكون فيها الحساب المرتبط مشرفًا. وإلا تُزال من هذا الجهاز فقط.",keepCopy:"احتفظ بنسخة في Levix",keepCopyHint:"يُحفظ النص أو التعليق فقط، ولا تُحفظ الوسائط أبدًا. تتبع النسخ إعداد «أيام الاحتفاظ بنسخ الحذف التلقائي».",keepCopyPrivacy:"تبقى النسخ على هذا الجهاز مع بيانات البوت. وهي ليست نسخة احتياطية للمحادثة.",ruleEnabled:"مفعّلة",deletedLabel:"محذوفة",lastDeleted:"آخر حذف",neverDeleted:"لم يُحذف شيء بعد",moreKeywords:"+{n}",resetCounter:"تصفير العداد",viewCopies:"عرض النسخ المحفوظة",deleteRule:"حذف القاعدة",deleteRuleTitle:"حذف هذه القاعدة؟",deleteRuleBody:"تتوقف «{name}» عن المطابقة. وتُحذف النسخ المحفوظة لهذه القاعدة أيضًا.",counterReset:"تم تصفير العداد",ruleSaved:"تم حفظ القاعدة",ruleDeleted:"تم حذف القاعدة",ruleSaveFailed:"تعذر حفظ القاعدة.",noRulesTitle:"لا توجد قواعد حذف تلقائي بعد",noRulesBody:"تُحذف تلقائيًا الرسائل التي تحتوي على الكلمات التي تضيفها.",noRulesMatch:"لا توجد قواعد تطابق هذا البحث",rulesTab:"القواعد",copiesTab:"النسخ المحفوظة",noCopiesTitle:"لا توجد نسخ محفوظة",noCopiesBody:"عندما تحتفظ قاعدة بنسخة، يظهر النص هنا.",noCopiesForRule:"لا توجد نسخ لهذه القاعدة",clearCopies:"مسح النسخ",clearCopiesForRule:"مسح نسخ هذه القاعدة",clearCopiesTitle:"مسح النسخ المحفوظة؟",clearCopiesBody:"هذا يزيل النص المخزن. ولا يمكن التراجع عنه.",clearCopiesRuleBody:"هذا يزيل النص المخزن لـ«{name}». ولا يمكن التراجع عنه.",copiesCleared:"تم مسح النسخ",copyChat:"المحادثة",copySender:"المرسل",mediaText:"نص",mediaImage:"صورة",mediaVideo:"فيديو",mediaAudio:"صوت",mediaSticker:"ملصق",mediaDocument:"مستند",modeRevoke:"حُذفت لدى الجميع",modeForMe:"حُذفت على هذا الجهاز",selectContacts:"اختيار جهات",addPhone:"إضافة رقم",phonePlaceholder:"رقم الهاتف",invalidPhone:"أدخل رقم هاتف من 8 إلى 15 رقمًا.",sendersRequired:"اختر جهة أو رقمًا واحدًا على الأقل.",sendersHelp:"اختر جهات، أو اكتب رقم هاتف.",tooManySenders:"يمكنك اختيار 200 جهة كحد أقصى.",removeKeyword:"إزالة {word}",removeContact:"إزالة {name}",groupSenderRejected:"يجب أن يكون المرسلون جهات اتصال، لا مجموعات.",rulesLimit:"يمكنك الاحتفاظ بـ 100 قاعدة كحد أقصى.",toggleFailed:"تعذر تحديث القاعدة.",rulesLoadFailed:"تعذر تحميل قواعد الحذف التلقائي.",copiesLoadFailed:"تعذر تحميل النسخ المحفوظة.",allRules:"كل القواعد",filterByRule:"القاعدة",noContacts:"لا توجد جهات اتصال",contactAdded:"مضافة",saveRule:"حفظ القاعدة",recipientsLoadFailed:"تعذر تحميل المحادثات."},en:{overview:"Overview",stickers:"Sticker Studio",connection:"Connection",control:"Control & Management",commands:"Command Catalog",ai:"AI & Memory",groups:"Groups",roles:"Roles & Admins",schedules:"Scheduled Messages",notes:"Notes & Lists",settings:"Settings",logs:"Live Logs",connected:"Connected to WhatsApp",disconnected:"Disconnected",starting:"Starting socket...",waiting_for_qr:"Waiting for QR scan",linking:"Linking session...",reconnecting:"Reconnecting...",retry_exhausted:"Retries exhausted",logged_out:"Logged out from phone",idle:"Session idle",paused:"Paused",resume:"Resume session",connectSession:"Connect",start:"Start Connection",stop:"Pause",reconnect:"Reconnect",unlink:"Unlink Device",restart:"Restart Bot",save:"Save Changes",saving:"Saving...",discard:"Discard",unsavedChanges:"Unsaved changes",toggleOn:"On",toggleOff:"Off",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",refresh:"Refresh",logout:"Sign Out",backToApp:"Back to app",close:"Close",copy:"Copy",copied:"Copied!",filter:"Filter",sort:"Sort",more:"More",reset:"Reset",autoScroll:"Auto-scroll",dismiss:"Dismiss",openNavigation:"Open navigation",closeNavigation:"Close menu",logsSubtitle:"Real-time streaming console for WhatsApp socket, AI calls, and bot commands",groupsSubtitle:"WhatsApp group moderation, anti-link defense, media filtering, and automated greetings",groupsCount:"{n} groups",noGroupsTitle:"No active groups found",noGroupsBody:"Once the bot is added to WhatsApp groups, they will automatically appear here with full moderation and anti-link controls.",unnamedGroup:"Unnamed group",mediaNone:"No Restrictions",mediaBlockAll:"Block All Media",clientIdentity:"Client Identity",noPhonePaired:"No phone paired yet",linkedAs:"Linked as",datastoreHealth:"Datastore Health",datastoreHealthy:"SQLite credentials, auth keys, and LID mappings are healthy.",reconnectPolicy:"Reconnect Policy",reconnectPolicyDesc:"Staged linear backoff (5s, 10s, 15s, 20s, 25s) with bounded retries.",maxAttemptsAutoPause:"Max attempts: 5 • Auto-pause offline",platformWeb:"Platform: WhatsApp Web (v7 Multi-Device)",databaseNodeSqlite:"Database: node:sqlite (Synchronous)",totalGroups:"Total Groups",totalUsers:"Registered Users",commandCount:"Enabled Commands",uptime:"Uptime",uptimeDayUnit:"d",uptimeHourUnit:"h",uptimeMinuteUnit:"m",online:"ONLINE",offline:"OFFLINE",quickCommandsDesc:"{n} active commands & aliases",moreActions:"More actions",lightMode:"Light mode",darkMode:"Dark mode",dataDir:"Data Directory",quickStatus:"System Status",activeSchedules:"Active Schedules",activeListening:"Active and listening to messages",pausedOrLinking:"WhatsApp connection is currently paused or linking",aiTitle:"AI Assistant Configuration",aiSubtitle:"Select a provider with one click or configure custom endpoints and keys",aiAgentEnabled:"Enable AI Agent",aiProvider:"Active Provider",quickSetup:"Quick Provider Setup Wizard",aiVision:"Image Understanding (Vision)",aiVisionDesc:"Encode attached images and pass to supported multimodal vision models",aiStt:"Speech-to-Text Provider (STT)",sttDesc:"Speech-to-text transcription engine for voice notes",sttAuto:"Auto (Matches active provider)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"Bot Response Language",botLanguageDesc:"Set bot response language directly or via command !lang",langAuto:"Auto-detect (matches user's language)",langAr:"Modern Standard Arabic (Always)",langEn:"English (Always)",modelName:"Model",apiKey:"API key",enterApiKey:"Enter API key",baseUrl:"Base URL",maxToolSteps:"Max Tool Steps",googleSearch:"Built-in Google Search Grounding",personaPrompt:"AI Persona System Prompt",personaDesc:"Edit the live system prompt that shapes your AI assistant's persona, tone, and behavior.",editPersona:"Edit System Prompt",memoryFiles:"Long-term Memory",memoryDesc:"The bot's durable memory. Global memory is shared by every chat; each chat also has its own file. The bot reads saved entries and any free-form text you write.",manageMemory:"Manage Memory Files",memoryGlobalScope:"Global memory",memoryGlobalScopeHint:"Injected into every chat",memoryChatScopeHint:"Injected into this chat only",memoryEntriesCount:"{n} saved entries",memoryProseHint:"Everything in this file reaches the bot: lines starting with '-' are separate entries it can add or forget, and free-form text is included verbatim.",memoryEditorPlaceholder:"Write anything you want the bot to remember for good…",aiInspector:"AI Conversation Inspector",aiInspectorDesc:"Read-only view of each chat's stored conversation context: replies, media references and tool usage.",openInspector:"Open Inspector",noConversations:"No stored conversations yet.",convTurns:"{n} parts",backToList:"Back to list",convTruncated:"Showing only the latest 200 parts.",convMedia:"media file",capabilities:"Capabilities & Toggles",modelsAvailableLive:"Models Available for Your Account (Live API Verified)",modelsRecommendedSeed:"Recommended / Known Models (Catalog)",connectKeyFirstPrompt:"Please connect your API key first to discover models available to your account",refreshModels:"Refresh Models",refreshing:"Refreshing...",fetchModels:"Fetch Available Models",fetchingModels:"Discovering models...",capVision:"Vision",capStt:"Speech",capAudio:"Audio in",capText:"Text",capPdf:"PDF",capVideo:"Video",supported:"Supported",unsupported:"Unsupported",sourceLive:"Your account",sourceSeed:"Catalog",sourceUnknown:"Unknown",visionUnsupportedNotice:"The selected model does not support Vision (image understanding). Feature disabled automatically.",sttUnsupportedNotice:"The selected model does not support Speech-to-Text (STT). Feature disabled automatically.",aiSttEnabled:"Enable Speech-to-Text (STT)",aiSttEnabledDesc:"Audio transcription and voice note understanding using the active model",providerGemini:"Google Gemini",providerGeminiDesc:"Default provider with native Google Search, Files upload, and Multimodal support",providerGroq:"Groq Cloud",providerGroqDesc:"Ultra-fast inference for Llama 3 & Mixtral models with Vision support",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"For GPT-4o models or any OpenAI-compatible API gateway",providerOllama:"Ollama (Local)",providerOllamaDesc:"Run local open-source models completely offline on your own machine",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"For Claude 3.5 Sonnet advanced reasoning models",scanQrHint:"Open WhatsApp on your phone > Settings > Linked Devices > Link a Device, and scan the QR code below.",pairingCode:"Pairing Code",reconnectingSoon:"Reconnecting soon...",nextAttemptIn:"Next attempt in",seconds:"seconds",tabGeneral:"General & Prefix",tabAI:"AI Assistant",tabSecurity:"Security & Access",tabProxy:"WhatsApp Proxy",tabStorage:"Storage & Media",tabLogs:"System Logs",prefixTitle:"Bot Command Prefix",prefixDesc:"The leading character or symbol that triggers commands in WhatsApp chats (e.g. !help, /ping)",prefixPlaceholder:"e.g. !",prefixPresets:"Common Quick Presets:",prefixPreview:"Live Command Syntax Preview:",prefixSaveBtn:"Save New Prefix",prefixUpdated:"Command prefix updated successfully!",prefixValidation:"Prefix must be 1 to 3 characters long",activePrefix:"Active Prefix",changePrefix:"Change Prefix",prefix:"Command Prefix",botTimezone:"Timezone",botTimezoneDesc:"IANA timezone used for prayer times, AI context, and cron schedules (e.g. Africa/Cairo)",botMinDelay:"Min Human Delay (ms)",botMaxDelay:"Max Human Delay (ms)",delaysDesc:"Simulated human typing pause before replying to avoid robotic triggers",delayRangeError:"Min delay must be less than or equal to max delay.",shareSettingsTitle:"Share Settings",shareSettingsDesc:"Export your settings as a JSON file to share with friends, or import a friend's file. Secrets (API keys and passwords) are never exported and never overwritten by an import.",exportAction:"Export",exportSettings:"Export settings",exportSettingsDesc:"A JSON file of the non-secret settings you changed",exportSettingsSuccess:"Settings exported",exportSavedTo:"Saved to",exportSettingsError:"Couldn't export the settings",importSettings:"Import from file",importSettingsError:"Invalid file — expected a Levix settings export",importTitle:"Import settings",importSummary:"This will apply to this install:",importSettingsCount:"settings",importPermissionsCount:"command permissions",importAliasesCount:"alias sets",importDisabledCount:"disabled commands",importPrefix:"Prefix",importApply:"Apply import",importSuccess:"Settings imported",importSkipped:"Skipped",importRestartNeeded:"Needs a bot restart to take effect",changePassword:"Change Dashboard Password",currentPassword:"Current Password",newPassword:"New Password",confirmPassword:"Confirm New Password",passwordMatchError:"Passwords do not match",passwordMinLength:"Password must be at least 8 characters long",passwordChangedSuccess:"Dashboard password changed successfully!",proxyTitle:"Outbound WhatsApp Proxy",proxyDesc:"Route Baileys WhatsApp traffic through an HTTP or SOCKS5 proxy to bypass restrictions",proxyEnabled:"Enable Outbound Proxy for WhatsApp",proxyProtocol:"Proxy Protocol",proxyHost:"Proxy Host / IP",proxyPort:"Proxy Port",proxyUsername:"Username (Optional)",proxyPassword:"Password (Optional)",proxyApplyHint:"⚠️ Note: To apply proxy changes, go to Connection and reconnect WhatsApp.",storageTitle:"Data Retention & Storage Limits",storageDesc:"Configure data cleanup thresholds, forward score retention, and fetch limits",forwardTtl:"Forward Score Expiry (Days)",forwardTtlDesc:"Automatically purge forwarded message scores after this many days",maxFetchBytes:"Web Fetch Byte Limit",maxFetchBytesDesc:"Maximum response body size AI tools are allowed to fetch from web pages (default: 512KB)",ffmpegPath:"Custom FFmpeg Binary Path (Optional)",weatherApiKey:"OpenWeatherMap API Key (Optional)",chooseLanguage:"Choose Language",langCardTitle:"Interface Language: English (LTR)",langCardDesc:"Full bidirectional layout support with optimized Arabic RTL & English LTR",langSwitchBtn:"التبديل إلى العربية",langName:"English",interfaceLanguage:"Dashboard Interface Language",interfaceLanguageDesc:"Arabic (RTL) or English (LTR) for this panel",botPort:"Control Panel Port",botPortHint:"* Changing port takes effect on next process restart",searchPlaceholder:"Search commands or aliases...",thCommand:"Command",thAliases:"Aliases",thDescription:"Description",thScope:"Scope",thRequiredRole:"Required Role",thStatus:"Status",thGroupName:"Group Name",thGroupJid:"Group JID",thMembers:"Members",thAntiLink:"Anti-Link",thMedia:"Media",thWelcome:"Welcome",thTarget:"Target",thMessage:"Message",thSchedule:"Schedule",thType:"Type",thDelivery:"Delivery Status",thActions:"Actions",scheduleNewMsg:"Schedule New Message",liveServerLogs:"Live Server Logs",clearLogs:"Clear Logs",allLogs:"All Levels",noLogs:"No log entries to display.",logSourceBot:"Bot",logSourceHost:"Android host",shareLogs:"Share logs",share:"Share",savedSuccessfully:"Settings saved successfully!",saveFailed:"Failed to save settings.",connectionStatusUpdated:"Connection status updated.",networkError:"Network error connecting to server.",loading:"Loading...",aiAssistantDesc:"Autonomous tool-calling AI agent with long-term memory",settingsSub:"Prefix, delays, integrations, & security",editAliases:"Edit Aliases",aliasesFor:"Aliases for",addAlias:"Add Alias",newAliasPlaceholder:"Type new alias...",noAliases:"No custom aliases",aliasesHelp:"Aliases allow invoking this command using alternative names.",aliasAlreadyAdded:"Alias already added",aliasScriptArabic:"Arabic alias",aliasScriptLatin:"Latin alias",commandsSub:"Manage role permissions, edit aliases, or enable/disable bot commands live",editPrefixHint:"Click to change prefix",usage:"Usage",usageHint:"The command as it is sent in WhatsApp",noMatchingCommands:"No commands match your search.",commandEnabled:"Command '{name}' enabled",commandDisabled:"Command '{name}' disabled",permissionUpdated:"Permission for '{name}' updated",scopeAll:"All",scopeGroup:"Group",scopePrivate:"Private",permMembers:"Members (Everyone)",permAdminsOnly:"Group Admins",permAdminsOwner:"Group Admins or Owner",permOwnerOnly:"Bot Owner Only",selectRecipient:"Select Target Chat",searchRecipients:"Search by name or phone...",recipients:"Recipients",chooseChat:"Choose a contact or group...",noRecipientsFound:"No matching chats found",pickPhoneContact:"From phone book",pickPhoneContactHint:"Pick a contact from this Android phone",maxSchedulesReached:"Maximum limit reached (3 scheduled messages)",limitReached:"Limit Reached",scheduleType:"Schedule Type",scheduleRecurring:"Recurring",scheduleOnce:"One-Off (Specific Date & Time)",repeat:"Repeat",repeatDaily:"Every day",repeatWeekly:"Every week",repeatMonthly:"Every month",repeatHourly:"Every N hours",weekdays:"Weekdays",dayOfMonth:"Day of month",monthDayHint:"If the month is shorter than the chosen day (for example 31 in February), that month is skipped.",everyHours:"Every how many hours",atMinute:"At minute",sendTime:"Send time",deliveryDateTime:"Delivery Date & Time",timezoneLabel:"Timezone",recurrencePreview:"Preview",weekdaySun:"Sun",weekdayMon:"Mon",weekdayTue:"Tue",weekdayWed:"Wed",weekdayThu:"Thu",weekdayFri:"Fri",weekdaySat:"Sat",contactFallback:"Contact",groupFallback:"Group",hoursUnit:"hours",messageText:"Message Text",messagePlaceholder:"Message to be sent automatically...",scheduleAction:"Schedule",scheduledCount:"scheduled",headerSubtitle:"Recurring and one-off automated message deliveries",noSchedules:"No active schedules found.",typeRecurring:"Recurring",typeOnce:"Once",deliveryFailed:"Failed",deliveryActive:"Active",changeChat:"Change chat",weekdayRequired:"Select at least one weekday",tabIntegrations:"Integrations",integrationsDesc:"API keys for external services connected to the bot",youtubeApiKey:"YouTube Data API Key (Optional)",selectModel:"Select a model from list...",availableModels:"Models Available from Provider",customModel:"Or type a custom model name",modelListToggle:"List",modelCustomToggle:"Custom",showSecret:"Show secret",hideSecret:"Hide secret",sessionStatus:"Session Status",sessionActive:"Session active and receiving messages",sessionOffline:"Session currently offline",connectedNumber:"Linked Phone",tabFeedback:"Feedback & Support",feedbackTitle:"Send feedback to the developer",feedbackDesc:"A bug, an idea, or a question — it is delivered straight to the person who builds Levix. No middle layer, no ticket queue.",feedbackTopicLabel:"What is this about?",feedbackTopicBug:"Something is broken",feedbackTopicIdea:"An idea or request",feedbackTopicQuestion:"A question",feedbackTopicPraise:"It works well",feedbackTopicOther:"Something else",feedbackMessageLabel:"Your message",feedbackMessagePlaceholder:"What happened, what you expected, and what you were doing at the time. Detail helps — it is read by a person.",feedbackCharsNeeded:"more characters",feedbackRatingLabel:"How is Levix working out? (optional)",feedbackContactLabel:"How to reach you (optional)",feedbackContactPlaceholder:"Email, or a WhatsApp/Telegram handle — only if you want an answer",feedbackSendBtn:"Send feedback",feedbackSending:"Sending...",feedbackSent:"Sent. Thank you!",feedbackSentDesc:"It reached the developer of Levix. If you left a way to reach you, expect a reply.",feedbackSendAnother:"Send something else",feedbackWhatIsSent:"What goes with your message",feedbackWhatIsSentDesc:"Your text, the topic, and the rating and contact if you added them, the file you attached if any, plus the Levix version and the platform it runs on. No WhatsApp message, chat, contact or key is ever attached, and nothing is sent until you press Send.",feedbackRuntimeLabel:"Attached to the message",feedbackGithubHint:"For reproducible bugs you want tracked in public with logs, open a GitHub issue.",feedbackOpenGithub:"Open an Issue on GitHub",feedbackAttach:"Attach a file",feedbackAttachmentHint:"Optional — a screenshot or log up to {max} MB",feedbackRemoveAttachment:"Remove attachment",fileSizeKb:"{size} KB",fileSizeMb:"{size} MB",feedbackFileTooLarge:"The file is too large — the limit is {max} MB",scheduleAttachMedia:"Attach media",scheduleMediaHint:"Optional — an image, video, audio or document up to {max} MB",scheduleRemoveMedia:"Remove media",scheduleDetails:"Schedule details",detailMedia:"Media",detailLastRun:"Last run",detailError:"Error",detailCreated:"Created",retryDelivery:"Retry delivery",mediaKindImage:"Image",mediaKindVideo:"Video",mediaKindAudio:"Audio",mediaKindDocument:"Document",stickerStudio:"Sticker Studio",stickersDesc:"Create and manage WhatsApp stickers",library:"Library",packs:"Packs",favorites:"Favorites",create:"Create",recent:"Recent",allStickers:"All",static:"Static",animated:"Animated",noPack:"No pack",anyPack:"Any pack",newPack:"New pack…",addToPack:"Add to pack",moveToPack:"Move to pack",removeFromPack:"Remove from pack",favorite:"Favorite",unfavorite:"Unfavorite",download:"Download",convertToImage:"Convert to image",shareSticker:"Share",sendViaWhatsapp:"Send via WhatsApp",deleteEverywhere:"Delete everywhere",deleteKeepStickers:"Delete pack only (keep stickers)",deletePackAndStickers:"Delete pack and stickers not in other packs",openInCreate:"Open in Create",packName:"Pack name",mergeInto:"Merge into another pack",merge:"Merge",stickersKept:"Stickers will be kept",trim:"Trim",background:"Background",transparent:"Transparent",white:"White",black:"Black",customColor:"Custom color",removePlainBackground:"Remove plain background",fit:"Fit",contain:"Contain",cover:"Cover",zoom:"Zoom",panX:"Pan X",panY:"Pan Y",rotate:"Rotate",addText:"Add text",addEmoji:"Add emoji",createAnother:"Create another",qualityReduced:"Sticker was compressed to fit WhatsApp's limit",alreadyInLibrary:"This sticker already exists in your library",encoderMissing:"No WebP encoder available. Sticker creation is disabled.",tryAgain:"Try again",loadMore:"Load more",selectAll:"Select all",clearSelection:"Clear selection",deleteConfirm:"Are you sure you want to delete?",nSelected:"{n} selected",sizeLbl:"Size:",formatLbl:"Format:",packsLbl:"Packs:",gifBadge:"Animated",startDur:"Start: {start}s | Duration: {dur}s",outlineBox:"Outline/Background",toolsLbl:"Tools",clearLbl:"Clear",resetPan:"Reset",clickOrDrag:"Click or drag an image/video to upload",creatingSticker:"Creating sticker…",goToLibrary:"Go to Library",loadingLbl:"Loading…",selectPack:"Select a pack…",noPacksCreated:"No packs created yet",packCreated:"Pack created",packDeleted:"Pack deleted",packRenamed:"Pack renamed",failedToCreatePack:"Failed to create pack",failedToDeletePack:"Failed to delete pack",failedToRenamePack:"Failed to rename pack",failedToMerge:"Failed to merge",someStickersInPacks:"Some stickers are in packs: {packs}",deleteEverywherePrompt:"Delete them everywhere?",packsMerged:"Packs merged",emptyLibrary:"Library is empty",jobStage_probing:"Probing…",jobStage_decoding:"Decoding…",jobStage_encoding:"Encoding…",jobStage_optimizing:"Optimizing…",jobStage_saving:"Saving…",jobQueued:"Queued…",sortNewest:"Newest",sortOldest:"Oldest",sortName:"Name",sortRecent:"Recently used",unlinkStickersWarning:"Your sticker library will also be cleared.",stickerErr_NO_MEDIA:"Send an image, video or sticker.",stickerErr_UNSUPPORTED_TYPE:"Unsupported file type.",stickerErr_TOO_LARGE:"File is too large.",stickerErr_DIMENSIONS_TOO_LARGE:"Image dimensions are too large.",stickerErr_VIDEO_TOO_LONG:"Video is too long.",stickerErr_CORRUPT:"File is corrupt.",stickerErr_CONVERSION_FAILED:"Sticker conversion failed.",stickerErr_OUTPUT_TOO_LARGE:"Output sticker is too large.",stickerErr_ENCODER_MISSING:"Server does not support WebP encoding.",stickerErr_TIMEOUT:"Processing timed out.",stickerErr_BUSY:"Server is busy, try again later.",stickerErr_NOT_FOUND:"Sticker not found.",stickerErr_PACK_NOT_FOUND:"Pack not found.",stickerErr_PACK_EXISTS:"Pack name already exists.",stickerErr_INVALID_NAME:"Invalid pack name.",stickerErr_INVALID_OPTIONS:"Invalid edit options.",stickerErr_LIBRARY_FULL:"Library is full.",stickerErr_PACK_LIMIT:"Pack limit reached.",stickerErr_IN_USE:"Sticker is in use by packs.",stickerErr_STORAGE_UNAVAILABLE:"Storage unavailable.",stickerErr_NOT_CONNECTED:"WhatsApp is not connected.",stickerErr_INTERNAL:"Internal server error.",stickerErr_CANCELLED:"Conversion was cancelled.",stickerLibraryLimit:"Sticker library limit",stickerLibraryLimitDesc:"How many stickers one person can keep in Sticker Studio.",autoDeleteKeepDays:"Auto-delete copies kept (days)",autoDeleteKeepDaysDesc:"How long opt-in text copies from auto-delete rules are kept.",stickerUploadInfo:"{kind} · {size} KB",stickerRemoveHint:"Flat background removal is applied when you create the sticker.",stickerSelect:"Select sticker",stickerOpen:"Open sticker details",stickerShareSaved:"Saved to {dir}",stickerDrag:"Drop a file here or choose one",stickerAlignmentStart:"Start",stickerAlignmentCenter:"Center",stickerAlignmentEnd:"End",stickerKindImage:"Image",stickerKindGif:"GIF",stickerKindVideo:"Video",stickerKindWebp:"WebP sticker",stickerDeletePackWarning:"The sticker will be removed from every pack.",stickerSendLimit:"Only a limited number of stickers can be sent at once.",stickerExportLimit:"Select fewer stickers to export.",tolerance:"Tolerance",stickerName:"Sticker name",stickerNamePlaceholder:"Optional name…",trimStart:"Start",trimDuration:"Duration",trimSeconds:"seconds",textContent:"Text",textSize:"Size",textColor:"Color",textAlignment:"Alignment",textOutline:"Outline",textBackground:"Background pill",layerRotation:"Rotation",deleteLayer:"Delete layer",noLayers:"No overlay layers",reorderUp:"Move earlier",reorderDown:"Move later",renamePack:"Rename pack",deletePack:"Delete pack",packEmpty:"This pack is empty",noPacks:"No packs yet",createFirstPack:"Create your first pack",stickerCount:"{n} stickers",notConnectedHint:"Connect WhatsApp first",exportFirstFrame:"Exports the first frame",downloadWebp:"Download WebP",downloadPng:"Download PNG",downloadGif:"Download GIF",reorderDragHint:"Drag to reorder",saved:"Saved",createBtn:"Create sticker",uploadHint:"Accepts JPEG, PNG, WebP, GIF, MP4, WebM",stickerCreated:"Sticker created!",stickerSent:"Sticker sent",stickersSent:"Stickers sent",stickerPreview:"Sticker preview",firstFrameHint:"An animated sticker exports its first frame as a still image.",gifOnlyAnimated:"GIF export is only available for animated stickers.",rename:"Rename",inUsePacksLabel:"In these packs",notInPack:"Not in any pack",retryLoad:"Try again",showingCount:"Showing {shown} of {total}",emojiPaletteLabel:"Emoji",customEmoji:"Other emoji",emojiInputLabel:"Type an emoji",textPlaceholder:"Text",layerSelected:"Selected layer",selectVisible:"Select visible",downloadZip:"Download ZIP",noRecipients:"No chats found",recipientGroup:"Group",recipientContact:"Contact",sending:"Sending…",deleteStickersTitle:"Delete stickers",inUseBody:"This sticker is in a pack. Deleting it removes it from those packs too.",inUseBulkBody:"Some selected stickers are in packs. They were not deleted.",deleteEverywhereHint:"Delete everywhere removes the stickers from every pack and from the library.",packNameLength:"A pack name must be between 1 and 40 characters.",newPackPlaceholder:"Pack name",createPack:"Create pack",skippedOther:"Some stickers could not be updated.",addedToPack:"Added to the pack",movedToPack:"Moved to the pack",removedFromPack:"Removed from the pack",renamed:"Name updated",downloaded:"Download started",shareDone:"Shared",backToPacks:"All packs",confirmMerge:"Merge packs",mergeTitle:"Merge into another pack",mergeConfirmBody:"Stickers stay in the library. Items from this pack are appended to the other pack, duplicates are skipped, and this pack is then deleted.",trimApplied:"The trim is applied when the sticker is created.",gifTrimNote:"GIF trim is applied on create and may not match the preview frame for frame.",animatedUnavailable:"This server cannot encode animated stickers.",targetPack:"Add to pack",previewStage:"Sticker preview",rotateQuarter:"Rotate 90 degrees",uploadReady:"File ready",stickerNameTooLong:"A sticker name can be at most 60 characters.",noDestinationPack:"Choose a pack to merge into.",deletePackTitle:"Delete pack",openPack:"Open pack",searchStickers:"Search stickers",sortBy:"Sort",filterBy:"Filter",packFilter:"Pack",noResults:"No stickers match this search",favoritesEmpty:"No favorite stickers yet",recentEmpty:"No stickers used or created in the last 30 days",favoriteBadge:"Favorite",deleted:"Deleted",autoDelete:"Auto-delete",autoDeleteSubtitle:"Delete messages that contain words you choose.",newRule:"New rule",editRule:"Edit rule",searchRules:"Search by name or keyword",sortByName:"Name",sortMostDeleted:"Most deleted",sortLastDeleted:"Last deleted",filterStatus:"Status",statusAny:"Any",statusEnabled:"Enabled",statusDisabled:"Disabled",filterChat:"Chats",filterSender:"Senders",chatsAll:"All chats",chatsGroups:"Groups only",chatsPrivate:"Private only",sendersEveryone:"Everyone",sendersSelected:"Selected contacts",oneContact:"1 contact",sendersCount:"{n} contacts",matchMode:"Match",matchContains:"Contains",matchWord:"Whole word",matchExact:"Exact message",matchContainsHint:"Deletes a message when its text includes the keyword.",matchWordHint:"Deletes when the keyword stands alone, not inside a longer word.",matchExactHint:"Deletes only when the whole message is exactly the keyword.",chatScopeLabel:"Chats",ruleName:"Name",ruleNamePlaceholder:"Optional name",keywordsLabel:"Keywords",keywordsPlaceholder:"Type a word, then press Enter",keywordCount:"{n} / {max}",keywordTooLong:"Each keyword must be 100 characters or fewer.",keywordEmpty:"That keyword is empty after it is cleaned up.",keywordDuplicate:"That keyword is already in the list.",keywordsRequired:"Add between 1 and 50 keywords.",keywordsMax:"A rule can have at most 50 keywords.",nameTooLong:"Name must be 60 characters or fewer.",includeOwn:"Also delete my own messages",includeOwnHint:"Messages sent by the linked account are deleted too.",forEveryone:"Delete for everyone when possible",forEveryoneHint:"Other people's messages are deleted for everyone only in groups where the linked account is an admin. Otherwise they are removed only from this device.",keepCopy:"Keep a copy in Levix",keepCopyHint:"Stores the text or caption only, never the media. Copies follow the “Auto-delete copies kept (days)” setting.",keepCopyPrivacy:"Copies stay on this device with the bot's data. They are not a backup of the chat.",ruleEnabled:"Enabled",deletedLabel:"Deleted",lastDeleted:"Last deleted",neverDeleted:"Nothing deleted yet",moreKeywords:"+{n}",resetCounter:"Reset counter",viewCopies:"View kept copies",deleteRule:"Delete rule",deleteRuleTitle:"Delete this rule?",deleteRuleBody:"“{name}” stops matching. Kept copies for this rule are removed too.",counterReset:"Counter reset",ruleSaved:"Rule saved",ruleDeleted:"Rule deleted",ruleSaveFailed:"Could not save the rule.",noRulesTitle:"No auto-delete rules yet",noRulesBody:"Messages that contain the words you add are deleted automatically.",noRulesMatch:"No rules match this search",rulesTab:"Rules",copiesTab:"Kept copies",noCopiesTitle:"No copies kept",noCopiesBody:"When a rule keeps a copy, the text shows up here.",noCopiesForRule:"No copies for this rule",clearCopies:"Clear copies",clearCopiesForRule:"Clear copies for this rule",clearCopiesTitle:"Clear kept copies?",clearCopiesBody:"This removes the stored text. It cannot be undone.",clearCopiesRuleBody:"This removes the stored text for “{name}”. It cannot be undone.",copiesCleared:"Copies cleared",copyChat:"Chat",copySender:"Sender",mediaText:"Text",mediaImage:"Image",mediaVideo:"Video",mediaAudio:"Audio",mediaSticker:"Sticker",mediaDocument:"Document",modeRevoke:"Deleted for everyone",modeForMe:"Deleted on this device",selectContacts:"Choose contacts",addPhone:"Add number",phonePlaceholder:"Phone number",invalidPhone:"Enter a phone number of 8 to 15 digits.",sendersRequired:"Select at least one contact or number.",sendersHelp:"Choose contacts, or type a phone number.",tooManySenders:"You can select at most 200 contacts.",removeKeyword:"Remove {word}",removeContact:"Remove {name}",groupSenderRejected:"Senders must be contacts, not groups.",rulesLimit:"You can keep at most 100 rules.",toggleFailed:"Could not update the rule.",rulesLoadFailed:"Could not load auto-delete rules.",copiesLoadFailed:"Could not load kept copies.",allRules:"All rules",filterByRule:"Rule",noContacts:"No contacts found",contactAdded:"Added",saveRule:"Save rule",recipientsLoadFailed:"Could not load chats."}},Fb=v.createContext(null),Kw=({children:a})=>{const[i,r]=v.useState(()=>{const h=localStorage.getItem("levix_lang");return h==="ar"||h==="en"?h:navigator.language.startsWith("ar")?"ar":"en"}),o=i==="ar"?"rtl":"ltr";v.useEffect(()=>{localStorage.setItem("levix_lang",i),document.documentElement.lang=i,document.documentElement.dir=o},[i,o]);const d=h=>{r(h)},f=v.useMemo(()=>(h,g)=>(gf[i]||gf.en)[h]??gf.en[h]??g??String(h),[i]);return s.jsx(Fb.Provider,{value:{language:i,direction:o,setLanguage:d,t:f},children:a})},Ze=()=>{const a=v.useContext(Fb);if(!a)throw new Error("useI18n must be used within an I18nProvider");return a};function Qb(a){var i,r,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(i=0;i<d;i++)a[i]&&(r=Qb(a[i]))&&(o&&(o+=" "),o+=r)}else for(r in a)a[r]&&(o&&(o+=" "),o+=r);return o}function Fw(){for(var a,i,r=0,o="",d=arguments.length;r<d;r++)(a=arguments[r])&&(i=Qb(a))&&(o&&(o+=" "),o+=i);return o}const Qw=(a,i)=>{const r=new Array(a.length+i.length);for(let o=0;o<a.length;o++)r[o]=a[o];for(let o=0;o<i.length;o++)r[a.length+o]=i[o];return r},Xw=(a,i)=>({classGroupId:a,validator:i}),Xb=(a=new Map,i=null,r)=>({nextPart:a,validators:i,classGroupId:r}),fc="-",py=[],Zw="arbitrary..",Jw=a=>{const i=Ww(a),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return $w(h);const g=h.split(fc),p=g[0]===""&&g.length>1?1:0;return Zb(g,p,i)},getConflictingClassGroupIds:(h,g)=>{if(g){const p=o[h],x=r[h];return p?x?Qw(x,p):p:x||py}return r[h]||py}}},Zb=(a,i,r)=>{if(a.length-i===0)return r.classGroupId;const d=a[i],f=r.nextPart.get(d);if(f){const x=Zb(a,i+1,f);if(x)return x}const h=r.validators;if(h===null)return;const g=i===0?a.join(fc):a.slice(i).join(fc),p=h.length;for(let x=0;x<p;x++){const b=h[x];if(b.validator(g))return b.classGroupId}},$w=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=a.slice(1,-1),r=i.indexOf(":"),o=i.slice(0,r);return o?Zw+o:void 0})(),Ww=a=>{const{theme:i,classGroups:r}=a;return ek(r,i)},ek=(a,i)=>{const r=Xb();for(const o in a){const d=a[o];kh(d,r,o,i)}return r},kh=(a,i,r,o)=>{const d=a.length;for(let f=0;f<d;f++){const h=a[f];tk(h,i,r,o)}},tk=(a,i,r,o)=>{if(typeof a=="string"){nk(a,i,r);return}if(typeof a=="function"){ak(a,i,r,o);return}lk(a,i,r,o)},nk=(a,i,r)=>{const o=a===""?i:Jb(i,a);o.classGroupId=r},ak=(a,i,r,o)=>{if(sk(a)){kh(a(o),i,r,o);return}i.validators===null&&(i.validators=[]),i.validators.push(Xw(r,a))},lk=(a,i,r,o)=>{const d=Object.entries(a),f=d.length;for(let h=0;h<f;h++){const[g,p]=d[h];kh(p,Jb(i,g),r,o)}},Jb=(a,i)=>{let r=a;const o=i.split(fc),d=o.length;for(let f=0;f<d;f++){const h=o[f];let g=r.nextPart.get(h);g||(g=Xb(),r.nextPart.set(h,g)),r=g}return r},sk=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,ik=a=>{if(a<1)return{get:()=>{},set:()=>{}};let i=0,r=Object.create(null),o=Object.create(null);const d=(f,h)=>{r[f]=h,i++,i>a&&(i=0,o=r,r=Object.create(null))};return{get(f){let h=r[f];if(h!==void 0)return h;if((h=o[f])!==void 0)return d(f,h),h},set(f,h){f in r?r[f]=h:d(f,h)}}},lh="!",gy=":",rk=[],xy=(a,i,r,o,d)=>({modifiers:a,hasImportantModifier:i,baseClassName:r,maybePostfixModifierPosition:o,isExternal:d}),ok=a=>{const{prefix:i,experimentalParseClassName:r}=a;let o=d=>{const f=[];let h=0,g=0,p=0,x;const b=d.length;for(let N=0;N<b;N++){const j=d[N];if(h===0&&g===0){if(j===gy){f.push(d.slice(p,N)),p=N+1;continue}if(j==="/"){x=N;continue}}j==="["?h++:j==="]"?h--:j==="("?g++:j===")"&&g--}const y=f.length===0?d:d.slice(p);let k=y,E=!1;y.endsWith(lh)?(k=y.slice(0,-1),E=!0):y.startsWith(lh)&&(k=y.slice(1),E=!0);const _=x&&x>p?x-p:void 0;return xy(f,E,k,_)};if(i){const d=i+gy,f=o;o=h=>h.startsWith(d)?f(h.slice(d.length)):xy(rk,!1,h,void 0,!0)}if(r){const d=o;o=f=>r({className:f,parseClassName:d})}return o},ck=a=>{const i=new Map;return a.orderSensitiveModifiers.forEach((r,o)=>{i.set(r,1e6+o)}),r=>{const o=[];let d=[];for(let f=0;f<r.length;f++){const h=r[f],g=h[0]==="[",p=i.has(h);g||p?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(h)):d.push(h)}return d.length>0&&(d.sort(),o.push(...d)),o}},uk=a=>({cache:ik(a.cacheSize),parseClassName:ok(a),sortModifiers:ck(a),postfixLookupClassGroupIds:dk(a),...Jw(a)}),dk=a=>{const i=Object.create(null),r=a.postfixLookupClassGroups;if(r)for(let o=0;o<r.length;o++)i[r[o]]=!0;return i},fk=/\s+/,hk=(a,i)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:h}=i,g=[],p=a.trim().split(fk);let x="";for(let b=p.length-1;b>=0;b-=1){const y=p[b],{isExternal:k,modifiers:E,hasImportantModifier:_,baseClassName:N,maybePostfixModifierPosition:j}=r(y);if(k){x=y+(x.length>0?" "+x:x);continue}let T=!!j,D;if(T){const M=N.substring(0,j);D=o(M);const A=D&&h[D]?o(N):void 0;A&&A!==D&&(D=A,T=!1)}else D=o(N);if(!D){if(!T){x=y+(x.length>0?" "+x:x);continue}if(D=o(N),!D){x=y+(x.length>0?" "+x:x);continue}T=!1}const Z=E.length===0?"":E.length===1?E[0]:f(E).join(":"),ne=_?Z+lh:Z,pe=ne+D;if(g.indexOf(pe)>-1)continue;g.push(pe);const I=d(D,T);for(let M=0;M<I.length;++M){const A=I[M];g.push(ne+A)}x=y+(x.length>0?" "+x:x)}return x},mk=(...a)=>{let i=0,r,o,d="";for(;i<a.length;)(r=a[i++])&&(o=$b(r))&&(d&&(d+=" "),d+=o);return d},$b=a=>{if(typeof a=="string")return a;let i,r="";for(let o=0;o<a.length;o++)a[o]&&(i=$b(a[o]))&&(r&&(r+=" "),r+=i);return r},pk=(a,...i)=>{let r,o,d,f;const h=p=>{const x=i.reduce((b,y)=>y(b),a());return r=uk(x),o=r.cache.get,d=r.cache.set,f=g,g(p)},g=p=>{const x=o(p);if(x)return x;const b=hk(p,r);return d(p,b),b};return f=h,(...p)=>f(mk(...p))},gk=[],Ut=a=>{const i=r=>r[a]||gk;return i.isThemeGetter=!0,i.themeKey=a,i},Wb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ev=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xk=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Sk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cl=a=>xk.test(a),Ke=a=>!!a&&!Number.isNaN(Number(a)),ca=a=>!!a&&Number.isInteger(Number(a)),xf=a=>a.endsWith("%")&&Ke(a.slice(0,-1)),za=a=>yk.test(a),tv=()=>!0,kk=a=>bk.test(a)&&!vk.test(a),jh=()=>!1,jk=a=>Sk.test(a),Nk=a=>wk.test(a),Ck=a=>!Ne(a)&&!Ee(a),Ek=a=>a.startsWith("@container")&&(a[10]==="/"&&a[11]!==void 0||a[11]==="s"&&a[16]!==void 0&&a.startsWith("-size/",10)||a[11]==="n"&&a[18]!==void 0&&a.startsWith("-normal/",10)),_k=a=>pl(a,lv,jh),Ne=a=>Wb.test(a),Vl=a=>pl(a,sv,kk),yy=a=>pl(a,Lk,Ke),Ak=a=>pl(a,rv,tv),Tk=a=>pl(a,iv,jh),by=a=>pl(a,nv,jh),zk=a=>pl(a,av,Nk),Ko=a=>pl(a,ov,jk),Ee=a=>ev.test(a),Wi=a=>Ql(a,sv),Mk=a=>Ql(a,iv),vy=a=>Ql(a,nv),Rk=a=>Ql(a,lv),Dk=a=>Ql(a,av),Fo=a=>Ql(a,ov,!0),Ok=a=>Ql(a,rv,!0),pl=(a,i,r)=>{const o=Wb.exec(a);return o?o[1]?i(o[1]):r(o[2]):!1},Ql=(a,i,r=!1)=>{const o=ev.exec(a);return o?o[1]?i(o[1]):r:!1},nv=a=>a==="position"||a==="percentage",av=a=>a==="image"||a==="url",lv=a=>a==="length"||a==="size"||a==="bg-size",sv=a=>a==="length",Lk=a=>a==="number",iv=a=>a==="family-name",rv=a=>a==="number"||a==="weight",ov=a=>a==="shadow",Uk=()=>{const a=Ut("color"),i=Ut("font"),r=Ut("text"),o=Ut("font-weight"),d=Ut("tracking"),f=Ut("leading"),h=Ut("breakpoint"),g=Ut("container"),p=Ut("spacing"),x=Ut("radius"),b=Ut("shadow"),y=Ut("inset-shadow"),k=Ut("text-shadow"),E=Ut("drop-shadow"),_=Ut("blur"),N=Ut("perspective"),j=Ut("aspect"),T=Ut("ease"),D=Ut("animate"),Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ne=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],pe=()=>[...ne(),Ee,Ne],I=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],A=()=>[Ee,Ne,p],P=()=>[cl,"full","auto",...A()],G=()=>[ca,"none","subgrid",Ee,Ne],q=()=>["auto",{span:["full",ca,Ee,Ne]},ca,Ee,Ne],W=()=>[ca,"auto",Ee,Ne],ie=()=>["auto","min","max","fr",Ee,Ne],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...A()],le=()=>[cl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],he=()=>[g,cl,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ve=()=>[cl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],K=()=>[a,Ee,Ne],X=()=>[...ne(),vy,by,{position:[Ee,Ne]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ke=()=>["auto","cover","contain",Rk,_k,{size:[Ee,Ne]}],w=()=>[xf,Wi,Vl],z=()=>["","none","full",x,Ee,Ne],de=()=>["",Ke,Wi,Vl],ue=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Ke,xf,vy,by],te=()=>["","none",_,Ee,Ne],U=()=>["none",Ke,Ee,Ne],fe=()=>["none",Ke,Ee,Ne],Te=()=>[Ke,Ee,Ne],De=()=>[cl,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[za],breakpoint:[za],color:[tv],container:[za],"drop-shadow":[za],ease:["in","out","in-out"],font:[Ck],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[za],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[za],shadow:[za],spacing:["px",Ke],text:[za],"text-shadow":[za],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cl,Ne,Ee,j]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,Ne]}],"container-named":[Ek],columns:[{columns:[Ke,"auto",Ne,Ee,g]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:pe()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[ca,"auto",Ee,Ne]}],basis:[{basis:[cl,"full","auto",g,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,cl,"auto","initial","none",Ne]}],grow:[{grow:["",Ke,Ee,Ne]}],shrink:[{shrink:["",Ke,Ee,Ne]}],order:[{order:[ca,"first","last","none",Ee,Ne]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],"inline-size":[{inline:["auto",...he()]}],"min-inline-size":[{"min-inline":["auto",...he()]}],"max-inline-size":[{"max-inline":["none",...he()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[g,"screen",...le()]}],"min-w":[{"min-w":[g,"screen","none",...le()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[h]},...le()]}],h:[{h:["screen","lh",...le()]}],"min-h":[{"min-h":["screen","lh","none",...le()]}],"max-h":[{"max-h":["screen","lh","none",...le()]}],"font-size":[{text:["base",r,Wi,Vl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ok,Ak]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xf,Ne]}],"font-family":[{font:[Mk,Tk,i]}],"font-features":[{"font-features":[Ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,Ee,Ne]}],"line-clamp":[{"line-clamp":[Ke,"none",Ee,yy]}],leading:[{leading:["none",f,...A()]}],"list-image":[{"list-image":["none",Ee,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ee,Vl]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ee,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[ca,Ee,Ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:xe()}],"bg-size":[{bg:ke()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ca,Ee,Ne],radial:["",Ee,Ne],conic:["",ca,Ee,Ne]},Dk,zk]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:w()}],"gradient-via-pos":[{via:w()}],"gradient-to-pos":[{to:w()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-bs":[{"border-bs":K()}],"border-color-be":[{"border-be":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ee,Ne]}],"outline-w":[{outline:["",Ke,Wi,Vl]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","inner","none",b,Fo,Ko]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",y,Fo,Ko]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Ke,Vl]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",k,Fo,Ko]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Ke,Ee,Ne]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[Ee,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":ne()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:xe()}],"mask-size":[{mask:ke()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ne]}],filter:[{filter:["","none",Ee,Ne]}],blur:[{blur:te()}],brightness:[{brightness:[Ke,Ee,Ne]}],contrast:[{contrast:[Ke,Ee,Ne]}],"drop-shadow":[{"drop-shadow":["","none",E,Fo,Ko]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Ke,Ee,Ne]}],"hue-rotate":[{"hue-rotate":[Ke,Ee,Ne]}],invert:[{invert:["",Ke,Ee,Ne]}],saturate:[{saturate:[Ke,Ee,Ne]}],sepia:[{sepia:["",Ke,Ee,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ne]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ee,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ee,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ee,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ee,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ee,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ee,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ee,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ee,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ee,Ne]}],ease:[{ease:["linear","initial",T,Ee,Ne]}],delay:[{delay:[Ke,Ee,Ne]}],animate:[{animate:["none",D,Ee,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Ee,Ne]}],"perspective-origin":[{"perspective-origin":pe()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[Ee,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:pe()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],zoom:[{zoom:[ca,Ee,Ne]}],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":K()}],"scrollbar-track-color":[{"scrollbar-track":K()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ne]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Ke,Wi,Vl,yy]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Bk=pk(Uk);function Fe(...a){return Bk(Fw(a))}const Hk={ok:"border-ok/30 bg-ok/10 text-ok",warn:"border-warn/30 bg-warn/10 text-warn",danger:"border-danger/30 bg-danger/10 text-danger",info:"border-info/30 bg-info/10 text-info",neutral:"border-line bg-panel-raised text-muted"};function vt({tone:a="neutral",className:i,children:r,...o}){return s.jsx("span",{className:Fe("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-bold",Hk[a],i),...o,children:r})}function hc({dot:a=!1,pulse:i=!1,children:r,...o}){return s.jsxs(vt,{...o,children:[a&&s.jsx("span",{className:Fe("size-2 shrink-0 rounded-full bg-current",i&&"pulse-dot")}),r]})}const Ys={base:"inline-flex shrink-0 items-center justify-center gap-2 font-bold transition-colors select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:cursor-not-allowed disabled:opacity-50",variant:{primary:"bg-brand-blue text-white shadow-md shadow-brand-blue/20 hover:bg-brand-blue-deep",secondary:"border border-line bg-panel-raised text-text-main hover:bg-panel-hover",ghost:"text-muted hover:bg-panel-hover hover:text-text-main",danger:"bg-danger text-white shadow-md shadow-danger/20 hover:bg-danger/90"},size:{sm:"h-10 min-h-10 rounded-lg px-3 text-xs",md:"h-11 min-h-11 rounded-xl px-4 text-sm",lg:"h-12 min-h-12 rounded-xl px-5 text-sm"},icon:{sm:"size-10 min-h-10 min-w-10 rounded-lg p-0",md:"size-11 min-h-11 min-w-11 rounded-xl p-0",lg:"size-12 min-h-12 min-w-12 rounded-xl p-0"}},ge=v.forwardRef(function({variant:i="secondary",size:r="md",loading:o=!1,icon:d,className:f,type:h="button",disabled:g,children:p,...x},b){return s.jsxs("button",{ref:b,type:h,disabled:g||o,"aria-busy":o||void 0,className:Fe(Ys.base,Ys.variant[i],Ys.size[r],f),...x,children:[o?s.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 rounded-full border-2 border-current border-t-transparent animate-spin"}):d&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:d}),p]})}),Le=v.forwardRef(function({label:i,icon:r,children:o,variant:d="secondary",size:f="sm",loading:h=!1,pressed:g,className:p,type:x="button",disabled:b,...y},k){const E=r??o;return s.jsx("button",{ref:k,type:x,title:i,"aria-label":i,...g===void 0?{}:{"aria-pressed":g},disabled:b||h,"aria-busy":h||void 0,className:Fe(Ys.base,Ys.variant[d],Ys.icon[f],g&&"border-brand-blue/40 bg-brand-blue/15 text-brand-blue",p),...y,children:h?s.jsx("span",{"aria-hidden":!0,className:"size-4 rounded-full border-2 border-current border-t-transparent animate-spin"}):s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:E})})}),at=v.forwardRef(function({className:i,padded:r=!0,...o},d){return s.jsx("div",{ref:d,className:Fe("rounded-2xl border border-line bg-panel shadow-sm",r&&"p-4 md:p-5",i),...o})});function fa({title:a,description:i,actions:r,icon:o,className:d}){return s.jsxs("div",{className:Fe("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",d),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o&&s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-brand-cyan/10 text-brand-cyan",children:o}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h2",{className:"truncate text-base font-bold text-text-main md:text-lg",children:a}),i&&s.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i})]})]}),r&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r})]})}function Ws({className:a,...i}){return s.jsx(at,{className:a,children:s.jsx(fa,{...i})})}const wc="w-full min-h-10 rounded-xl border border-line bg-panel-raised px-3 text-sm text-text-main placeholder:text-faint focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:cursor-not-allowed disabled:opacity-50";function dl({children:a,htmlFor:i}){return s.jsx("label",{htmlFor:i,className:"mb-1 block text-xs font-bold text-text-main",children:a})}function it({label:a,description:i,error:r,htmlFor:o,children:d,className:f}){return s.jsxs("div",{className:Fe("flex flex-col gap-1.5",f),children:[a&&s.jsx(dl,{htmlFor:o,children:a}),d,r?s.jsx("p",{className:"text-xs text-danger",children:r}):i&&s.jsx("p",{className:"text-xs text-muted",children:i})]})}const Be=v.forwardRef(function({className:i,...r},o){return s.jsx("input",{ref:o,className:Fe(wc,i),...r})}),mc=v.forwardRef(function({className:i,...r},o){return s.jsx("textarea",{ref:o,className:Fe(wc,"h-auto min-h-24 resize-y py-3 leading-relaxed",i),...r})}),Ht=v.forwardRef(function({className:i,...r},o){return s.jsx("select",{ref:o,className:Fe(wc,"pe-8",i),...r})}),pc=v.forwardRef(function({label:i,description:r,className:o,id:d,...f},h){const g=v.useId(),p=d??g;return s.jsxs("label",{htmlFor:p,className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{ref:h,id:p,type:"checkbox",className:Fe("size-4 shrink-0 accent-brand-blue",o),...f}),(i||r)&&s.jsxs("span",{className:"min-w-0",children:[i&&s.jsx("span",{className:"block text-sm text-text-main",children:i}),r&&s.jsx("span",{className:"block text-xs text-muted",children:r})]})]})});function or({label:a,name:i,value:r,onChange:o,options:d,orientation:f="vertical",className:h}){return s.jsxs("div",{role:"radiogroup","aria-label":a,className:Fe("flex gap-1",f==="horizontal"?"flex-row flex-wrap":"flex-col",h),children:[a&&s.jsx("p",{className:"mb-1 w-full text-xs font-bold text-text-main",children:a}),d.map(g=>s.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{type:"radio",name:i,value:g.value,checked:r===g.value,onChange:()=>o(g.value),className:"size-4 shrink-0 accent-brand-blue"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-sm text-text-main",children:g.label}),g.description&&s.jsx("span",{className:"block text-xs text-muted",children:g.description})]})]},g.value))]})}const Zn=v.forwardRef(function({checked:i,onChange:r,disabled:o,id:d,label:f,description:h,className:g,...p},x){const b=v.useId(),y=d||b,k=!!(f||h);return s.jsxs("div",{className:Fe(k?"flex items-center justify-between gap-4":"inline-flex",g),children:[k&&s.jsxs("div",{className:"min-w-0 flex-1",children:[f&&s.jsx("label",{htmlFor:y,className:"block cursor-pointer text-sm font-semibold text-text-main",children:f}),h&&s.jsx("p",{className:"mt-0.5 text-xs text-muted",children:h})]}),s.jsx("button",{ref:x,type:"button",role:"switch","aria-checked":i,id:y,...p,disabled:o,onClick:()=>r(!i),className:Fe("relative inline-flex h-10 w-16 shrink-0 items-center rounded-full border transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50","disabled:cursor-not-allowed disabled:opacity-50",i?"border-brand-blue bg-brand-blue":"border-line bg-panel-hover"),children:s.jsx("span",{"aria-hidden":!0,className:Fe("pointer-events-none absolute top-1 size-7 rounded-full bg-white shadow transition-[inset-inline-start] duration-200",i?"start-8":"start-1")})})]})});function kc({children:a,removeLabel:i,onRemove:r,dir:o="auto",className:d,disabled:f}){return s.jsxs("span",{className:Fe("inline-flex max-w-full items-center gap-0.5 rounded-full border border-line bg-panel-raised py-0.5 ps-2.5 text-xs font-semibold text-text-main",r?"pe-0.5":"pe-2.5",d),children:[s.jsx("span",{dir:o,className:"min-w-0 truncate",children:a}),r&&i&&s.jsx(Le,{variant:"ghost",label:i,icon:s.jsx(Da,{size:14}),disabled:f,onMouseDown:h=>h.preventDefault(),onClick:r})]})}function qk(a){return a.split(/[,،\n\r]+/)}const Pk=v.forwardRef(function({value:i,onChange:r,max:o,maxLength:d,prepare:f,onReject:h,removeLabel:g,countLabel:p,chipDir:x="auto",className:b,disabled:y,id:k,placeholder:E,"aria-label":_,"aria-invalid":N,"aria-describedby":j,...T},D){const Z=v.useId(),ne=k??Z,[pe,I]=v.useState(""),M=(P,G)=>{const q=P.trim();if(!q)return{next:G,reason:null};let W=q;if(f){const ie=f(q);if("error"in ie)return{next:G,reason:ie.error};if(W=ie.value,!W)return{next:G,reason:"empty"}}else if(d!==void 0&&W.length>d)return{next:G,reason:"long"};return G.includes(W)?{next:G,reason:"duplicate"}:o!==void 0&&G.length>=o?{next:G,reason:"max"}:{next:[...G,W],reason:null}},A=P=>{const G=qk(P);let q=i,W=null,ie=!1;for(const ae of G){if(!ae.trim())continue;ie=!0;const Q=M(ae,q);q=Q.next,Q.reason&&(W=Q.reason)}!ie&&P.trim()&&(W="empty"),q!==i&&r(q),h==null||h(W),I("")};return s.jsxs("div",{className:Fe("flex flex-col gap-1.5",b),children:[s.jsxs("div",{className:Fe(wc,"flex h-auto flex-wrap items-center gap-1.5 py-1.5 focus-within:ring-2 focus-within:ring-brand-blue/50"),children:[i.map(P=>s.jsx(kc,{dir:x,disabled:y,removeLabel:g(P),onRemove:y?void 0:()=>{r(i.filter(G=>G!==P)),h==null||h(null)},children:P},P)),s.jsx(Be,{...T,ref:D,id:ne,value:pe,disabled:y,placeholder:i.length===0?E:void 0,"aria-label":_,"aria-invalid":N,"aria-describedby":j,className:"min-h-10 min-w-24 flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0",onChange:P=>{const G=P.target.value;if(/[,،\n\r]/.test(G)){A(G);return}I(G)},onKeyDown:P=>{if(!P.nativeEvent.isComposing){if(P.key==="Enter"||P.key===","||P.key==="،"){P.preventDefault(),A(pe);return}P.key==="Backspace"&&pe.length===0&&i.length>0&&(P.preventDefault(),r(i.slice(0,-1)),h==null||h(null))}},onPaste:P=>{const G=P.clipboardData.getData("text");/[,،\n\r]/.test(G)&&(P.preventDefault(),A(`${pe}${G}`))},onBlur:()=>{pe.trim()&&A(pe)}})]}),p&&s.jsx("p",{className:"text-xs text-muted tabular-nums",children:p})]})});var cv=f0();const Gk='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Vk(a){return[...a.querySelectorAll(Gk)].filter(i=>!(i.tabIndex<0||i.closest("[aria-hidden='true']")))}function uv(a,i,r){const o=v.useRef(r);o.current=r,v.useLayoutEffect(()=>{if(!i)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,f=a.current;f&&(!(document.activeElement instanceof Node)||!f.contains(document.activeElement))&&f.focus();const h=p=>{var _;if(p.key==="Escape"){if(p.defaultPrevented)return;const N=a.current;if(N){const j=document.querySelectorAll("[data-overlay]"),T=j.item(j.length-1);if(T&&T!==N)return}p.preventDefault(),p.stopImmediatePropagation(),(_=o.current)==null||_.call(o);return}if(p.key!=="Tab"||!a.current)return;const x=document.activeElement;if(x instanceof Element&&x.closest("[data-overlay='popover']"))return;if(a.current.dataset.overlay==="dialog"&&x instanceof Element){const N=x.closest("[data-overlay]");if(N&&N!==a.current)return}const b=Vk(a.current);if(b.length===0){p.preventDefault(),a.current.focus();return}const y=b[0],k=b[b.length-1],E=x instanceof Node&&a.current.contains(x);p.shiftKey&&(!E||x===y)?(p.preventDefault(),k==null||k.focus()):!p.shiftKey&&(!E||x===k)&&(p.preventDefault(),y==null||y.focus())};document.addEventListener("keydown",h);const g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var p;document.removeEventListener("keydown",h),document.body.style.overflow=g,(p=d==null?void 0:d.focus)==null||p.call(d)}},[i,a])}function en({isOpen:a,onClose:i,title:r,children:o,footer:d,maxWidth:f,description:h,className:g}){const{t:p}=Ze(),x=v.useRef(null),b=v.useId(),y=v.useId();if(uv(x,a,i),!a)return null;const k={paddingBottom:"max(1rem, env(safe-area-inset-bottom))"};return cv.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",style:k,children:[s.jsx("button",{type:"button",className:"fixed inset-0 cursor-default border-0 bg-black/65 p-0 backdrop-blur-sm",onClick:i,"aria-label":p("close")}),s.jsxs("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":b,"aria-describedby":h?y:void 0,tabIndex:-1,"data-overlay":"dialog",className:Fe("relative z-10 my-auto flex w-full flex-col overflow-hidden rounded-2xl border border-line bg-panel shadow-2xl outline-none",g),style:{maxWidth:f||"32.5rem",maxHeight:"calc(100dvh - 1rem - max(1rem, env(safe-area-inset-bottom)))",animation:"modal-enter 150ms ease-out"},children:[s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-line p-4 md:p-5",children:[s.jsx("h2",{id:b,className:"min-w-0 text-base font-bold text-text-main md:text-lg",children:r}),s.jsx(Le,{label:p("close"),icon:s.jsx(Da,{size:18}),onClick:i})]}),s.jsxs("div",{className:Fe("min-h-0 overflow-y-auto p-4 md:p-5",!d&&"pb-[max(1rem,env(safe-area-inset-bottom))]"),style:d?void 0:k,children:[h&&s.jsx("p",{id:y,className:"mb-3 text-sm text-muted",children:h}),o]}),d&&s.jsx("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-line bg-panel-raised/50 p-4 pb-[max(1rem,env(safe-area-inset-bottom))]",style:k,children:d})]})]}),document.body)}function dv({isOpen:a,onClose:i,onConfirm:r,title:o,description:d,confirmLabel:f,cancelLabel:h,variant:g="danger",loading:p=!1,children:x,maxWidth:b}){return s.jsx(en,{isOpen:a,onClose:i,title:o,description:d,maxWidth:b,footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:i,disabled:p,children:h}),s.jsx(ge,{variant:g==="danger"?"danger":"primary",onClick:r,loading:p,children:f})]}),children:x})}function Oa({className:a,label:i}){return s.jsxs("span",{role:i?"status":void 0,className:Fe("inline-flex items-center gap-2",i&&"text-muted"),children:[s.jsx("span",{"aria-hidden":!0,className:Fe("size-4 shrink-0 rounded-full border-2 border-brand-blue border-t-transparent animate-spin",a)}),i&&s.jsx("span",{className:"text-xs",children:i})]})}function Kl({text:a}){return s.jsx("div",{className:"flex flex-col items-center justify-center gap-2 py-16",children:s.jsx(Oa,{className:"size-6",label:a})})}function Is({className:a}){return s.jsx("div",{"aria-hidden":!0,className:Fe("animate-pulse rounded-lg bg-panel-hover",a)})}function Sn({icon:a,title:i,text:r,description:o,action:d,className:f}){return s.jsxs("div",{className:Fe("flex flex-col items-center justify-center gap-2 px-4 py-16 text-center",f),children:[a&&s.jsx("div",{className:"text-muted",children:a}),i&&s.jsx("p",{className:"text-sm font-bold text-text-main",children:i}),(r||o)&&s.jsx("p",{className:"max-w-md text-xs text-muted sm:text-sm",children:o??r}),d]})}const Sy="(max-width: 639px)";function Yk(){const[a,i]=v.useState(()=>typeof window<"u"?window.matchMedia(Sy).matches:!1);return v.useEffect(()=>{const r=window.matchMedia(Sy),o=()=>i(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),a}function Ik(a,i,r,o){const h=window.innerWidth,g=window.innerHeight;let p=a.bottom+6;p+i.height>g-8&&a.top-i.height-6>=8&&(p=a.top-i.height-6),p=Math.max(8,Math.min(p,g-8-i.height));const x=r==="center"?a.left+a.width/2-i.width/2:r==="start"?o==="rtl"?a.right-i.width:a.left:o==="rtl"?a.left:a.right-i.width,b=Math.max(8,Math.min(x,h-8-i.width));return{top:p,left:b}}function fv({open:a,defaultOpen:i=!1,onOpenChange:r,trigger:o,children:d,align:f="end",label:h,haspopup:g="dialog",className:p,badge:x}){const{t:b}=Ze(),[y,k]=v.useState(i),E=a??y,_=v.useCallback(G=>{a===void 0&&k(G),r==null||r(G)},[r,a]),N=Yk(),j=v.useRef(null),T=v.useRef(null),D=v.useId(),[Z,ne]=v.useState(null),pe=v.useRef(_);pe.current=_;const I=v.useCallback(()=>{const G=j.current,q=T.current;if(!G||!q)return;const W=document.documentElement.dir==="rtl"?"rtl":"ltr";ne(Ik(G.getBoundingClientRect(),q.getBoundingClientRect(),f,W))},[f]);v.useLayoutEffect(()=>{if(!E||N)return;I();const G=T.current,q=G?new ResizeObserver(()=>I()):null;return G&&q&&q.observe(G),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{q==null||q.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[E,N,I]),v.useEffect(()=>{if(!E)return;const G=W=>{var ae,Q;const ie=W.target;ie instanceof Node&&((ae=j.current)!=null&&ae.contains(ie)||(Q=T.current)!=null&&Q.contains(ie)||pe.current(!1))},q=W=>{W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),pe.current(!1))};return document.addEventListener("pointerdown",G,!0),document.addEventListener("keydown",q,!0),()=>{document.removeEventListener("pointerdown",G,!0),document.removeEventListener("keydown",q,!0)}},[E]),uv(T,E&&N,()=>_(!1));const M=v.isValidElement(o)?o.props:{},A=v.isValidElement(o)?v.cloneElement(o,{onClick:G=>{var q;(q=M.onClick)==null||q.call(M,G),G.defaultPrevented||_(!E)},"aria-expanded":E,"aria-haspopup":g,"aria-controls":D}):o,P=s.jsxs("div",{ref:T,id:D,role:g==="menu"?"presentation":"dialog",...g==="menu"||!h?{}:{"aria-label":h},tabIndex:-1,"data-overlay":"popover",className:Fe("z-[70] border border-line bg-panel-solid text-text-main shadow-2xl outline-none",p,N?"relative max-h-[85dvh] w-full max-w-none overflow-y-auto rounded-t-2xl p-4 pb-[max(1rem,env(safe-area-inset-bottom))]":"fixed max-h-[min(24rem,calc(100dvh-1rem))] overflow-y-auto rounded-2xl"),style:N?{animation:"modal-enter 150ms ease-out",paddingBottom:"max(1rem, env(safe-area-inset-bottom))"}:{top:(Z==null?void 0:Z.top)??0,left:(Z==null?void 0:Z.left)??0,visibility:Z?"visible":"hidden",animation:"modal-enter 150ms ease-out"},children:[N&&s.jsxs("div",{className:"relative mb-3 flex h-10 items-center justify-center",children:[s.jsx("span",{className:"h-1 w-10 rounded-full bg-line"}),s.jsx(Le,{label:b("close"),icon:s.jsx(Da,{size:16}),variant:"ghost",className:"absolute end-0",onClick:()=>_(!1)})]}),d]});return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:j,className:"relative inline-flex",children:[A,x]}),E&&cv.createPortal(N?s.jsxs("div",{className:"fixed inset-0 z-[70] flex items-end",children:[s.jsx("button",{type:"button",className:"absolute inset-0 cursor-default border-0 bg-black/60 p-0","aria-label":b("close"),onClick:()=>_(!1)}),P]}):P,document.body)]})}function jc({label:a,resetLabel:i,activeCount:r=0,onReset:o,children:d}){const[f,h]=v.useState(!1),g=r>0?`${a} (${r})`:a;return s.jsxs(fv,{open:f,onOpenChange:h,align:"end",label:a,haspopup:"dialog",className:"w-[min(20rem,calc(100vw-1rem))] p-3",badge:r>0?s.jsx(vt,{tone:"info",className:"pointer-events-none absolute -top-1 -end-1 z-10 h-5 min-w-5 justify-center px-1 tabular-nums",children:r}):null,trigger:s.jsx(Le,{label:g,icon:s.jsx(jw,{size:18}),pressed:r>0}),children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm font-bold text-text-main",children:a}),o&&s.jsx(ge,{variant:"ghost",size:"sm",onClick:o,disabled:r===0,children:i})]}),s.jsx("div",{className:"flex flex-col gap-3",children:d})]})}const Nh=v.createContext(()=>{});function Ch({trigger:a,label:i,align:r="end",children:o}){const[d,f]=v.useState(!1);return s.jsx(Nh.Provider,{value:()=>f(!1),children:s.jsx(fv,{open:d,onOpenChange:f,trigger:a,label:i,align:r,haspopup:"menu",className:"min-w-52 p-1",children:s.jsx(Kk,{label:i,children:o})})})}function Kk({label:a,children:i}){const r=v.useRef(null),o=v.useContext(Nh);v.useEffect(()=>{var f,h;(h=(f=r.current)==null?void 0:f.querySelector("[role='menuitem']:not([disabled])"))==null||h.focus()},[]);const d=f=>{var x,b,y;const h=[...((x=r.current)==null?void 0:x.querySelectorAll("[role='menuitem']:not([disabled])"))??[]];if(h.length===0)return;const g=h.indexOf(document.activeElement),p=k=>{var E;f.preventDefault(),(E=h[(k+h.length)%h.length])==null||E.focus()};f.key==="ArrowDown"?p(g+1):f.key==="ArrowUp"?p(g<=0?h.length-1:g-1):f.key==="Home"?(f.preventDefault(),(b=h[0])==null||b.focus()):f.key==="End"?(f.preventDefault(),(y=h[h.length-1])==null||y.focus()):f.key==="Escape"&&(f.preventDefault(),o())};return s.jsx("div",{ref:r,role:"menu","aria-label":a,"aria-orientation":"vertical",onKeyDown:d,className:"flex flex-col gap-0.5",children:i})}function ot({icon:a,danger:i=!1,checked:r=!1,onSelect:o,className:d,type:f="button",children:h,onClick:g,...p}){const x=v.useContext(Nh);return s.jsxs("button",{type:f,role:"menuitem",className:Fe("flex min-h-10 w-full items-center gap-2 rounded-lg px-3 py-2 text-start text-sm font-medium","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50","disabled:cursor-not-allowed disabled:opacity-40",i?"text-danger hover:bg-danger/10":"text-text-main hover:bg-panel-hover",d),onClick:b=>{g==null||g(b),!b.defaultPrevented&&(o==null||o(),f!=="submit"&&x())},...p,children:[a&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:a}),s.jsx("span",{className:"min-w-0 flex-1",children:h}),r&&s.jsx(vc,{size:16,className:"shrink-0 text-brand-cyan"})]})}function cr(){return s.jsx("hr",{className:"my-1 border-0 border-t border-line"})}function Fk({children:a}){return s.jsx("div",{className:"px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-faint",children:a})}function La({label:a,align:i="end",id:r,children:o}){return s.jsx(Ch,{label:a,align:i,trigger:s.jsx(Le,{id:r,label:a,icon:s.jsx(Sw,{size:18})}),children:o})}const Qo=new Set;let er=null;function Qk(a){return Qo.add(a),er===null&&(er=window.setInterval(()=>{for(const i of Qo)i()},3e4)),()=>{Qo.delete(a),Qo.size===0&&er!==null&&(window.clearInterval(er),er=null)}}function hv(a){return a==="ar"?"ar":"en"}function Xk(a){const i=a instanceof Date?a.getTime():typeof a=="number"?a:Date.parse(a);return Number.isFinite(i)?i:null}const yf=[{unit:"year",ms:1e3*60*60*24*365},{unit:"month",ms:1e3*60*60*24*30},{unit:"week",ms:1e3*60*60*24*7},{unit:"day",ms:1e3*60*60*24},{unit:"hour",ms:1e3*60*60},{unit:"minute",ms:1e3*60},{unit:"second",ms:1e3}];function Zk(a,i,r){const o=a-i,d=Math.abs(o),f=new Intl.RelativeTimeFormat(hv(r),{numeric:"auto"}),h=yf.find(p=>d>=p.ms)??yf[yf.length-1],g=Math.round(o/h.ms);return f.format(g,h.unit)}function mv({value:a,className:i}){const{language:r}=Ze(),[o,d]=v.useState(()=>Date.now());v.useEffect(()=>Qk(()=>d(Date.now())),[]);const f=Xk(a);if(f===null)return null;const h=hv(r),g=new Intl.DateTimeFormat(h,{dateStyle:"medium",timeStyle:"short"}).format(f);return s.jsx("time",{dateTime:new Date(f).toISOString(),title:g,className:Fe("whitespace-nowrap",i),children:Zk(f,o,r)})}const Jk=1500;function pv(a){return a instanceof Error&&a.message?a.message:typeof a=="string"&&a?a:""}function gc(a,i){if(Object.is(a,i))return!0;if(typeof a!="object"||typeof i!="object"||a===null||i===null)return!1;const r=a,o=i,d=Object.keys(r);return d.length!==Object.keys(o).length?!1:d.every(f=>Object.is(r[f],o[f]))}function gv(a,i){v.useEffect(()=>{if(a!=="saved")return;const r=window.setTimeout(()=>{i(o=>o==="saved"?"idle":o)},Jk);return()=>window.clearTimeout(r)},[a,i])}function Tn(a){const[i,r]=v.useState(a),[o,d]=v.useState("idle"),[f,h]=v.useState(null),g=v.useRef(a);v.useEffect(()=>{o!=="saving"&&(gc(a,g.current)||(g.current=a,r(a)))},[a,o]),gv(o,d);const p=!gc(i,a),x=v.useCallback(async y=>{if(!(!p||o==="saving")){d("saving"),h(null);try{await y(i),d("saved")}catch(k){d("idle"),h(pv(k)||null)}}},[p,o,i]),b=v.useCallback(()=>{r(a),h(null),d("idle")},[a]);return{value:i,setValue:r,dirty:p,status:o,error:f,save:x,revert:b}}function sh(a){const[i,r]=v.useState(a),[o,d]=v.useState("idle"),[f,h]=v.useState(null),g=v.useRef(a);v.useEffect(()=>{o!=="saving"&&(gc(a,g.current)||(g.current=a,r(a)))},[a,o]),gv(o,d);const p=!gc(i,a),x=v.useCallback((k,E)=>{r(_=>({..._,[k]:E}))},[]),b=v.useCallback(async k=>{if(!(!p||o==="saving")){d("saving"),h(null);try{await k(i),d("saved")}catch(E){d("idle"),h(pv(E)||null)}}},[p,o,i]),y=v.useCallback(()=>{r(a),h(null),d("idle")},[a]);return{draft:i,setDraft:r,setField:x,dirty:p,status:o,error:f,save:b,revert:y}}function zn({label:a,description:i,error:r,htmlFor:o,className:d,dirty:f,saving:h,justSaved:g,onSave:p,onRevert:x,saveLabel:b,savedLabel:y,actions:k,children:E}){const _=j=>{var D;const T=(D=j.target)==null?void 0:D.tagName;j.key==="Enter"&&T==="INPUT"&&!j.nativeEvent.isComposing&&(j.preventDefault(),f&&!h&&p()),j.key==="Escape"&&(j.preventDefault(),x())},N=v.isValidElement(E)?v.cloneElement(E,{onKeyDown:j=>{var T,D;(D=(T=E.props).onKeyDown)==null||D.call(T,j),_(j)}}):E;return s.jsx(it,{label:a,description:i,error:r,htmlFor:o,className:d,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:N}),k,s.jsx(Le,{type:"button",label:g?y??b:b,icon:g?s.jsx(vc,{size:16}):s.jsx(Xs,{size:16}),loading:h,disabled:!f&&!g||h,onClick:()=>{f&&!h&&p()},className:g?"text-ok":void 0})]})})}function ih({dirty:a,saving:i,justSaved:r,error:o,onDiscard:d,saveLabel:f,discardLabel:h,unsavedLabel:g,savedLabel:p,className:x}){return s.jsxs("div",{className:Fe("flex flex-wrap items-center gap-2",x),children:[s.jsx("div",{className:"min-w-0 flex-1",children:o?s.jsx("p",{role:"alert",className:"text-xs text-danger",children:o}):a?s.jsx("p",{className:"text-xs text-warn",children:g}):r&&p?s.jsx("p",{className:"text-xs text-ok",children:p}):null}),s.jsx(ge,{type:"button",variant:"ghost",disabled:!a||i,onClick:d,children:h}),s.jsx(ge,{type:"submit",variant:"primary",icon:s.jsx(Xs,{size:16}),disabled:!a,loading:i,children:f})]})}function xv({label:a,value:i,options:r,onChange:o}){var f;const d=(f=r.find(h=>h.value===i))==null?void 0:f.label;return s.jsx(Ch,{label:a,trigger:s.jsx(Le,{label:d?`${a}: ${d}`:a,icon:s.jsx(fw,{size:18})}),children:r.map(h=>s.jsx(ot,{checked:h.value===i,onSelect:()=>o(h.value),children:h.label},h.value))})}function Il({value:a,onChange:i,options:r,"aria-label":o,className:d}){return s.jsx("div",{role:"tablist","aria-label":o,className:Fe("inline-flex rounded-xl border border-line bg-panel-raised p-1",d),children:r.map(f=>{const h=f.value===a;return s.jsxs("button",{type:"button",role:"tab","aria-selected":h,onClick:()=>i(f.value),className:Fe("inline-flex min-h-10 items-center justify-center gap-1.5 rounded-lg px-3 text-xs font-semibold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",h?"bg-brand-blue text-white":"text-muted hover:text-text-main"),children:[f.icon,f.label]},f.value)})})}function Nc({value:a,onChange:i,options:r,"aria-label":o,className:d}){return s.jsx("div",{role:"tablist","aria-label":o,className:Fe("flex items-center gap-2",d),children:r.map(f=>{const h=f.value===a;return s.jsxs("button",{type:"button",role:"tab","aria-selected":h,onClick:()=>i(f.value),className:Fe("inline-flex min-h-10 items-center justify-center gap-1.5 whitespace-nowrap rounded-xl px-4 text-sm font-bold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",h?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:bg-panel-hover hover:text-text-main"),children:[f.icon,f.label]},f.value)})})}const Cc=v.forwardRef(function({className:i,...r},o){return s.jsx("div",{ref:o,className:Fe("flex flex-wrap items-center gap-2",i),...r})}),$k={1:"line-clamp-1",2:"line-clamp-2",3:"line-clamp-3"},Fl=v.forwardRef(function({as:i="span",lines:r,title:o,className:d,children:f,dir:h,...g},p){const x={...g,dir:h??"auto",title:o??(r!==void 0&&typeof f=="string"?f:void 0),className:Fe("min-w-0 whitespace-normal break-words",r!==void 0&&$k[r],d),children:f};return i==="p"?s.jsx("p",{ref:p,...x}):i==="bdi"?s.jsx("bdi",{ref:p,...x}):i==="strong"?s.jsx("strong",{ref:p,...x}):i==="em"?s.jsx("em",{ref:p,...x}):s.jsx("span",{ref:p,...x})}),Wk=({onToggleMobileMenu:a,title:i,status:r})=>{const{language:o,setLanguage:d,t:f}=Ze(),[h,g]=v.useState(()=>{const x=localStorage.getItem("levix_theme");return x?(document.documentElement.setAttribute("data-theme",x),x):document.documentElement.getAttribute("data-theme")||"dark"}),p=()=>{const x=h==="dark"?"light":"dark";g(x),document.documentElement.setAttribute("data-theme",x),localStorage.setItem("levix_theme",x)};return s.jsxs("header",{className:"sticky top-0 z-30 flex h-16 items-center justify-between border-b border-line bg-panel/85 px-4 backdrop-blur-md md:px-6",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(Le,{id:"mobile-menu-btn",className:"md:hidden",label:f("openNavigation"),icon:s.jsx(zw,{size:20}),onClick:a}),s.jsx("h1",{className:"truncate text-lg font-bold tracking-tight text-text-main md:text-xl",title:i,children:i})]}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[s.jsxs(Ch,{label:f("chooseLanguage"),trigger:s.jsx(Le,{id:"btn-header-lang",label:f("chooseLanguage"),icon:s.jsx(uc,{size:18,className:"text-brand-cyan"})}),children:[s.jsx(Fk,{children:f("chooseLanguage")}),s.jsx(ot,{checked:o==="ar",onSelect:()=>d("ar"),children:"العربية"}),s.jsx(ot,{checked:o==="en",onSelect:()=>d("en"),children:"English"})]}),s.jsx(Le,{id:"btn-header-theme",label:f(h==="dark"?"lightMode":"darkMode"),icon:h==="dark"?s.jsx(Pw,{size:18,className:"text-brand-cyan"}):s.jsx(Dw,{size:18,className:"text-brand-cyan"}),onClick:p})]})]})},ej=({currentView:a,onSelectView:i,isOpenMobile:r,onCloseMobile:o})=>{var p;const{t:d}=Ze(),f=typeof((p=window.LevixHost)==null?void 0:p.closePanel)=="function",h=window.__BRAND__||{name:"Levix",tagline:"Private control room",version:"",developer:"Abdelrhman Diab",studio:"Leviro",developerSite:"https://github.com/Abdodiab2005",studioSite:"https://leviro.net"},g=[{id:"overview",label:d("overview"),icon:Ew},{id:"connection",label:d("connection"),icon:hr},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:Zs},{id:"ai",label:d("ai"),icon:yh},{id:"groups",label:d("groups"),icon:Vs},{id:"autodelete",label:d("autoDelete"),icon:nh},{id:"schedules",label:d("schedules"),icon:eh},{id:"stickers",label:d("stickers"),icon:wh},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:Hw},{id:"logs",label:d("logs"),icon:ec}];return s.jsxs(s.Fragment,{children:[r&&s.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default border-0 bg-black/60 p-0 backdrop-blur-sm md:hidden",onClick:o,"aria-label":d("closeNavigation")}),s.jsxs("aside",{className:Fe("fixed start-0 top-0 bottom-0 z-50 flex w-72 flex-col border-e border-line bg-panel transition-transform duration-200 ease-out md:static md:z-auto md:w-64",r?"translate-x-0":"max-md:-translate-x-full rtl:max-md:translate-x-full"),"aria-label":"Main Navigation",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-line p-4",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-brand-blue via-brand-blue to-brand-cyan text-white shadow-md shadow-brand-blue/20",children:s.jsx(Iw,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-base font-extrabold leading-tight tracking-tight text-text-main",children:h.name}),s.jsx("div",{className:"mt-0.5 truncate text-xs leading-none text-muted",children:h.tagline})]})]}),s.jsx(Le,{className:"md:hidden",label:d("closeNavigation"),icon:s.jsx(Da,{size:18}),onClick:o})]}),s.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-3",children:g.map(x=>{if(x.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:x.labelCategory},`cat-${x.labelCategory}`);if(!x.icon||!x.id)return null;const b=x.icon,y=a===x.id;return s.jsx(ge,{variant:y?"primary":"ghost",className:"w-full justify-start",icon:s.jsx(b,{size:20}),onClick:()=>{i(x.id),o()},children:s.jsx("span",{className:"truncate",children:x.label})},x.id)})}),s.jsxs("div",{className:"flex flex-col gap-1 border-t border-line p-3",children:[f&&s.jsx(ge,{variant:"ghost",className:"w-full justify-start",icon:s.jsx(dw,{size:20,className:"rtl:-scale-x-100"}),onClick:()=>window.LevixHost.closePanel(),children:s.jsx("span",{className:"truncate",children:d("backToApp")})}),s.jsx("form",{action:"/logout",method:"POST",className:"m-0",children:s.jsx(ge,{type:"submit",variant:"ghost",className:"w-full justify-start text-danger hover:bg-danger/10 hover:text-danger",icon:s.jsx(Tw,{size:20,className:"rtl:-scale-x-100"}),children:s.jsx("span",{className:"truncate",children:d("logout")})})})]}),s.jsxs("div",{className:"flex flex-col gap-2.5 border-t border-line p-4 text-xs text-faint",children:[s.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted",children:[s.jsx("span",{className:"font-mono",children:h.version?`v${h.version}`:""}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(vh,{size:14,className:"text-brand-cyan"})," Local-first"]})]}),s.jsxs("div",{className:"truncate text-[11px] text-muted",children:["© ",h.copyrightYear||2026," ",s.jsx("a",{href:h.developerSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:h.developer})," ","(",s.jsx("a",{href:h.studioSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:h.studio}),")"]})]})]})]})},yv=v.createContext(null),tj=({children:a})=>{const{t:i}=Ze(),[r,o]=v.useState([]),d=v.useCallback(h=>{o(g=>g.filter(p=>p.id!==h))},[]),f=v.useCallback((h,g="info",p=4e3)=>{const x=Math.random().toString(36).slice(2,9);o(b=>[...b,{id:x,message:h,type:g,duration:p}]),setTimeout(()=>d(x),p)},[d]);return s.jsxs(yv.Provider,{value:{toast:f},children:[a,s.jsx("div",{className:"fixed bottom-5 end-5 z-50 flex flex-col gap-2.5 max-w-sm w-full px-4 pointer-events-none","aria-live":"polite",children:r.map(h=>s.jsxs("div",{className:`pointer-events-auto flex items-center gap-3 rounded-xl border bg-panel-raised/95 px-4 py-3 text-xs text-text-main shadow-xl backdrop-blur-md md:text-sm ${h.type==="success"?"border-ok/35":h.type==="error"?"border-danger/35":h.type==="warning"?"border-warn/35":"border-line"}`,children:[h.type==="success"&&s.jsx(Ks,{size:18,className:"shrink-0 text-ok"}),h.type==="error"&&s.jsx(xw,{size:18,className:"shrink-0 text-danger"}),h.type==="warning"&&s.jsx(dc,{size:18,className:"shrink-0 text-warn"}),h.type==="info"&&s.jsx(Cw,{size:18,className:"shrink-0 text-info"}),s.jsx("span",{className:"flex-1 font-medium",children:h.message}),s.jsx(Le,{variant:"ghost",label:i("dismiss"),icon:s.jsx(Da,{size:16}),onClick:()=>d(h.id)})]},h.id))})]})},qt=()=>{const a=v.useContext(yv);if(!a)throw new Error("useToast must be used within a ToastProvider");return a},pa=Object.create(null);pa.open="0";pa.close="1";pa.ping="2";pa.pong="3";pa.message="4";pa.upgrade="5";pa.noop="6";const nc=Object.create(null);Object.keys(pa).forEach(a=>{nc[pa[a]]=a});const rh={type:"error",data:"parser error"},bv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",vv=typeof ArrayBuffer=="function",Sv=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,Eh=({type:a,data:i},r,o)=>bv&&i instanceof Blob?r?o(i):wy(i,o):vv&&(i instanceof ArrayBuffer||Sv(i))?r?o(i):wy(new Blob([i]),o):o(pa[a]+(i||"")),wy=(a,i)=>{const r=new FileReader;return r.onload=function(){const o=r.result.split(",")[1];i("b"+(o||""))},r.readAsDataURL(a)};function ky(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let bf;function nj(a,i){if(bv&&a.data instanceof Blob)return a.data.arrayBuffer().then(ky).then(i);if(vv&&(a.data instanceof ArrayBuffer||Sv(a.data)))return i(ky(a.data));Eh(a,!1,r=>{bf||(bf=new TextEncoder),i(bf.encode(r))})}const jy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<jy.length;a++)sr[jy.charCodeAt(a)]=a;const aj=a=>{let i=a.length*.75,r=a.length,o,d=0,f,h,g,p;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const x=new ArrayBuffer(i),b=new Uint8Array(x);for(o=0;o<r;o+=4)f=sr[a.charCodeAt(o)],h=sr[a.charCodeAt(o+1)],g=sr[a.charCodeAt(o+2)],p=sr[a.charCodeAt(o+3)],b[d++]=f<<2|h>>4,b[d++]=(h&15)<<4|g>>2,b[d++]=(g&3)<<6|p&63;return x},lj=typeof ArrayBuffer=="function",_h=(a,i)=>{if(typeof a!="string")return{type:"message",data:wv(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:sj(a.substring(1),i)}:nc[r]?a.length>1?{type:nc[r],data:a.substring(1)}:{type:nc[r]}:rh},sj=(a,i)=>{if(lj){const r=aj(a);return wv(r,i)}else return{base64:!0,data:a}},wv=(a,i)=>{switch(i){case"blob":return a instanceof Blob?a:new Blob([a]);case"arraybuffer":default:return a instanceof ArrayBuffer?a:a.buffer}},kv="",ij=(a,i)=>{const r=a.length,o=new Array(r);let d=0;a.forEach((f,h)=>{Eh(f,!1,g=>{o[h]=g,++d===r&&i(o.join(kv))})})},rj=(a,i)=>{const r=a.split(kv),o=[];for(let d=0;d<r.length;d++){const f=_h(r[d],i);if(o.push(f),f.type==="error")break}return o};function oj(){return new TransformStream({transform(a,i){nj(a,r=>{const o=r.length;let d;if(o<126)d=new Uint8Array(1),new DataView(d.buffer).setUint8(0,o);else if(o<65536){d=new Uint8Array(3);const f=new DataView(d.buffer);f.setUint8(0,126),f.setUint16(1,o)}else{d=new Uint8Array(9);const f=new DataView(d.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(o))}a.data&&typeof a.data!="string"&&(d[0]|=128),i.enqueue(d),i.enqueue(r)})}})}let vf;function Xo(a){return a.reduce((i,r)=>i+r.length,0)}function Zo(a,i){if(a[0].length===i)return a.shift();const r=new Uint8Array(i);let o=0;for(let d=0;d<i;d++)r[d]=a[0][o++],o===a[0].length&&(a.shift(),o=0);return a.length&&o<a[0].length&&(a[0]=a[0].slice(o)),r}function cj(a,i){vf||(vf=new TextDecoder);const r=[];let o=0,d=-1,f=!1;return new TransformStream({transform(h,g){for(r.push(h);;){if(o===0){if(Xo(r)<1)break;const p=Zo(r,1);f=(p[0]&128)===128,d=p[0]&127,d<126?o=3:d===126?o=1:o=2}else if(o===1){if(Xo(r)<2)break;const p=Zo(r,2);d=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),o=3}else if(o===2){if(Xo(r)<8)break;const p=Zo(r,8),x=new DataView(p.buffer,p.byteOffset,p.length),b=x.getUint32(0);if(b>Math.pow(2,21)-1){g.enqueue(rh);break}d=b*Math.pow(2,32)+x.getUint32(4),o=3}else{if(Xo(r)<d)break;const p=Zo(r,d);g.enqueue(_h(f?p:vf.decode(p),i)),o=0}if(d===0||d>a){g.enqueue(rh);break}}}})}const jv=4;function Dt(a){if(a)return uj(a)}function uj(a){for(var i in Dt.prototype)a[i]=Dt.prototype[i];return a}Dt.prototype.on=Dt.prototype.addEventListener=function(a,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(i),this};Dt.prototype.once=function(a,i){function r(){this.off(a,r),i.apply(this,arguments)}return r.fn=i,this.on(a,r),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(a,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+a];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var o,d=0;d<r.length;d++)if(o=r[d],o===i||o.fn===i){r.splice(d,1);break}return r.length===0&&delete this._callbacks["$"+a],this};Dt.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+a],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(r){r=r.slice(0);for(var o=0,d=r.length;o<d;++o)r[o].apply(this,i)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};Dt.prototype.hasListeners=function(a){return!!this.listeners(a).length};const Ec=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),Pn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),dj="arraybuffer";function Nv(a,...i){return i.reduce((r,o)=>(a.hasOwnProperty(o)&&(r[o]=a[o]),r),{})}const fj=Pn.setTimeout,hj=Pn.clearTimeout;function _c(a,i){i.useNativeTimers?(a.setTimeoutFn=fj.bind(Pn),a.clearTimeoutFn=hj.bind(Pn)):(a.setTimeoutFn=Pn.setTimeout.bind(Pn),a.clearTimeoutFn=Pn.clearTimeout.bind(Pn))}const mj=1.33;function pj(a){return typeof a=="string"?gj(a):Math.ceil((a.byteLength||a.size)*mj)}function gj(a){let i=0,r=0;for(let o=0,d=a.length;o<d;o++)i=a.charCodeAt(o),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(o++,r+=4);return r}function Cv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xj(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function yj(a){let i={},r=a.split("&");for(let o=0,d=r.length;o<d;o++){let f=r[o].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class bj extends Error{constructor(i,r,o){super(i),this.description=r,this.context=o,this.type="TransportError"}}class Ah extends Dt{constructor(i){super(),this.writable=!1,_c(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,o){return super.emitReserved("error",new bj(i,r,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=_h(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=xj(i);return r.length?"?"+r:""}}class vj extends Ah{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||r()})),this.writable||(o++,this.once("drain",function(){--o||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};rj(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,ij(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Cv()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let Ev=!1;try{Ev=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Sj=Ev;function wj(){}class kj extends vj{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||o!==i.port}}doWrite(i,r){const o=this.request({method:"POST",data:i});o.on("success",r),o.on("error",(d,f)=>{this.onError("xhr post error",d,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,o)=>{this.onError("xhr poll error",r,o)}),this.pollXhr=i}}class ma extends Dt{constructor(i,r,o){super(),this.createRequest=i,_c(this,o),this._opts=o,this._method=o.method||"GET",this._uri=r,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var i;const r=Nv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(r);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let d in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(d)&&o.setRequestHeader(d,this._opts.extraHeaders[d])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var d;o.readyState===3&&((d=this._opts.cookieJar)===null||d===void 0||d.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(d){this.setTimeoutFn(()=>{this._onError(d)},0);return}typeof document<"u"&&(this._index=ma.requestsCount++,ma.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=wj,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ma.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ma.requestsCount=0;ma.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ny);else if(typeof addEventListener=="function"){const a="onpagehide"in Pn?"pagehide":"unload";addEventListener(a,Ny,!1)}}function Ny(){for(let a in ma.requests)ma.requests.hasOwnProperty(a)&&ma.requests[a].abort()}const jj=(function(){const a=_v({xdomain:!1});return a&&a.responseType!==null})();class Nj extends kj{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=jj&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new ma(_v,this.uri(),i)}}function _v(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||Sj))return new XMLHttpRequest}catch{}if(!i)try{return new Pn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Av=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Cj extends Ah{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,o=Av?{}:Nv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,o)}catch(d){return this.emitReserved("error",d)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const o=i[r],d=r===i.length-1;Eh(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Ec(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Cv()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Sf=Pn.WebSocket||Pn.MozWebSocket;class Ej extends Cj{createSocket(i,r,o){return Av?new Sf(i,r,o):r?new Sf(i,r):new Sf(i)}doWrite(i,r){this.ws.send(r)}}class _j extends Ah{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=cj(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(r).getReader(),d=oj();d.readable.pipeTo(i.writable),this._writer=d.writable.getWriter();const f=()=>{o.read().then(({done:g,value:p})=>{g||(this.onPacket(p),f())}).catch(g=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const o=i[r],d=r===i.length-1;this._writer.write(o).then(()=>{d&&Ec(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const Aj={websocket:Ej,webtransport:_j,polling:Nj},Tj=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zj=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function oh(a){if(a.length>8e3)throw"URI too long";const i=a,r=a.indexOf("["),o=a.indexOf("]");r!=-1&&o!=-1&&(a=a.substring(0,r)+a.substring(r,o).replace(/:/g,";")+a.substring(o,a.length));let d=Tj.exec(a||""),f={},h=14;for(;h--;)f[zj[h]]=d[h]||"";return r!=-1&&o!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=Mj(f,f.path),f.queryKey=Rj(f,f.query),f}function Mj(a,i){const r=/\/{2,9}/g,o=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Rj(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(r[d]=f)}),r}const ch=typeof addEventListener=="function"&&typeof removeEventListener=="function",ac=[];ch&&addEventListener("offline",()=>{ac.forEach(a=>a())},!1);class fl extends Dt{constructor(i,r){if(super(),this.binaryType=dj,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const o=oh(i);r.hostname=o.host,r.secure=o.protocol==="https"||o.protocol==="wss",r.port=o.port,o.query&&(r.query=o.query)}else r.host&&(r.hostname=oh(r.host).host);_c(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(o=>{const d=o.prototype.name;this.transports.push(d),this._transportsByName[d]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yj(this.opts.query)),ch&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ac.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=jv,r.transport=i,this.id&&(r.sid=this.id);const o=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&fl.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",fl.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let o=0;o<this.writeBuffer.length;o++){const d=this.writeBuffer[o].data;if(d&&(r+=pj(d)),o>0&&r>this._maxPayload)return this.writeBuffer.slice(0,o);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,Ec(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,o){return this._sendPacket("message",i,r,o),this}send(i,r,o){return this._sendPacket("message",i,r,o),this}_sendPacket(i,r,o,d){if(typeof r=="function"&&(d=r,r=void 0),typeof o=="function"&&(d=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const f={type:i,data:r,options:o};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),d&&this.once("flush",d),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},o=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():i()}):this.upgrading?o():i()),this}_onError(i){if(fl.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ch&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=ac.indexOf(this._offlineEventListener);o!==-1&&ac.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}fl.protocol=jv;class Dj extends fl{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),o=!1;fl.priorWebsocketSuccess=!1;const d=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",y=>{if(!o)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;fl.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(b(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const k=new Error("probe error");k.transport=r.name,this.emitReserved("upgradeError",k)}}))};function f(){o||(o=!0,b(),r.close(),r=null)}const h=y=>{const k=new Error("probe error: "+y);k.transport=r.name,f(),this.emitReserved("upgradeError",k)};function g(){h("transport closed")}function p(){h("socket closed")}function x(y){r&&y.name!==r.name&&f()}const b=()=>{r.removeListener("open",d),r.removeListener("error",h),r.removeListener("close",g),this.off("close",p),this.off("upgrading",x)};r.once("open",d),r.once("error",h),r.once("close",g),this.once("close",p),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let o=0;o<i.length;o++)~this.transports.indexOf(i[o])&&r.push(i[o]);return r}}let Oj=class extends Dj{constructor(i,r={}){const o=typeof i=="object",d=o?{...i}:{...r};(!d.transports||d.transports&&typeof d.transports[0]=="string")&&(d.transports=(d.transports||["polling","websocket","webtransport"]).map(f=>Aj[f]).filter(f=>!!f)),super(o?d:i,d)}};function Lj(a,i="",r){let o=a;r=r||typeof location<"u"&&location,a==null&&(a=r.protocol+"//"+r.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=r.protocol+a:a=r.host+a),/^(https?|wss?):\/\//.test(a)||(typeof r<"u"?a=r.protocol+"//"+a:a="https://"+a),o=oh(a)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const f=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+f+":"+o.port+i,o.href=o.protocol+"://"+f+(r&&r.port===o.port?"":":"+o.port),o}const Uj=typeof ArrayBuffer=="function",Bj=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,Tv=Object.prototype.toString,Hj=typeof Blob=="function"||typeof Blob<"u"&&Tv.call(Blob)==="[object BlobConstructor]",qj=typeof File=="function"||typeof File<"u"&&Tv.call(File)==="[object FileConstructor]";function Th(a){return Uj&&(a instanceof ArrayBuffer||Bj(a))||Hj&&a instanceof Blob||qj&&a instanceof File}function lc(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,o=a.length;r<o;r++)if(lc(a[r]))return!0;return!1}if(Th(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return lc(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&lc(a[r]))return!0;return!1}function Pj(a){const i=[],r=a.data,o=a;return o.data=sc(r,i),o.attachments=i.length,{packet:o,buffers:i}}function sc(a,i,r){if(!a)return a;if(Th(a)){const o={_placeholder:!0,num:i.length};return i.push(a),o}else if(Array.isArray(a)){const o=new Array(a.length);for(let d=0;d<a.length;d++)o[d]=sc(a[d],i);return o}else if(typeof a=="object"&&!(a instanceof Date)){if(a.toJSON&&typeof a.toJSON=="function"&&!r)return sc(a.toJSON(),i,!0);const o={};for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=sc(a[d],i));return o}return a}function Gj(a,i){return a.data=uh(a.data,i),delete a.attachments,a}function uh(a,i){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<i.length)return i[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let r=0;r<a.length;r++)a[r]=uh(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=uh(a[r],i));return a}const Vj=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var tt;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(tt||(tt={}));class Yj{constructor(i){this.replacer=i}encode(i){return(i.type===tt.EVENT||i.type===tt.ACK)&&lc(i)?this.encodeAsBinary({type:i.type===tt.EVENT?tt.BINARY_EVENT:tt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===tt.BINARY_EVENT||i.type===tt.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=Pj(i),o=this.encodeAsString(r.packet),d=r.buffers;return d.unshift(o),d}}class zh extends Dt{constructor(i){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof i=="function"?{reviver:i}:i)}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const o=r.type===tt.BINARY_EVENT;o||r.type===tt.BINARY_ACK?(r.type=o?tt.EVENT:tt.ACK,this.reconstructor=new Ij(r)):super.emitReserved("decoded",r)}else if(Th(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const o={type:Number(i.charAt(0))};if(tt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===tt.BINARY_EVENT||o.type===tt.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const h=i.substring(f,r);if(h!=Number(h)||i.charAt(r)!=="-")throw new Error("Illegal attachments");const g=Number(h);if(!Kj(g)||g<1)throw new Error("Illegal attachments");if(g>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=g}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););o.nsp=i.substring(f,r)}else o.nsp="/";const d=i.charAt(r+1);if(d!==""&&Number(d)==d){const f=r+1;for(;++r;){const h=i.charAt(r);if(h==null||Number(h)!=h){--r;break}if(r===i.length)break}o.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(zh.isPayloadValid(o.type,f))o.data=f;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.opts.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case tt.CONNECT:return Cy(r);case tt.DISCONNECT:return r===void 0;case tt.CONNECT_ERROR:return typeof r=="string"||Cy(r);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Vj.indexOf(r[0])===-1);case tt.ACK:case tt.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ij{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=Gj(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Kj=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a};function Cy(a){return Object.prototype.toString.call(a)==="[object Object]"}const Fj=Object.freeze(Object.defineProperty({__proto__:null,Decoder:zh,Encoder:Yj,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function Xn(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const Qj=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class zv extends Dt{constructor(i,r,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Xn(i,"open",this.onopen.bind(this)),Xn(i,"packet",this.onpacket.bind(this)),Xn(i,"error",this.onerror.bind(this)),Xn(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var o,d,f;if(Qj.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const h={type:tt.EVENT,data:r};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const b=this.ids++,y=r.pop();this._registerAckCallback(b,y),h.id=b}const g=(d=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||d===void 0?void 0:d.writable,p=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!g||(p?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,r){var o;const d=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(d===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let g=0;g<this.sendBuffer.length;g++)this.sendBuffer[g].id===i&&this.sendBuffer.splice(g,1);r.call(this,new Error("operation has timed out"))},d),h=(...g)=>{this.io.clearTimeoutFn(f),r.apply(this,g)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...r){return new Promise((o,d)=>{const f=(h,g)=>h?d(h):o(g);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((d,...f)=>(this._queue[0],d!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(d)):(this._queue.shift(),r&&r(null,...f)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:tt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(o=>String(o.id)===i)){const o=this.acks[i];delete this.acks[i],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case tt.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tt.EVENT:case tt.BINARY_EVENT:this.onevent(i);break;case tt.ACK:case tt.BINARY_ACK:this.onack(i);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const o=new Error(i.data.message);o.data=i.data.data,this.emitReserved("connect_error",o);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const o of r)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let o=!1;return function(...d){o||(o=!0,r.packet({type:tt.ACK,id:i,data:d}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let o=0;o<r.length;o++)if(i===r[o])return r.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let o=0;o<r.length;o++)if(i===r[o])return r.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const o of r)o.apply(this,i.data)}}}function ei(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}ei.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*a);a=(Math.floor(i*10)&1)==0?a-r:a+r}return Math.min(a,this.max)|0};ei.prototype.reset=function(){this.attempts=0};ei.prototype.setMin=function(a){this.ms=a};ei.prototype.setMax=function(a){this.max=a};ei.prototype.setJitter=function(a){this.jitter=a};class dh extends Dt{constructor(i,r){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,_c(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((o=r.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new ei({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const d=r.parser||Fj;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Oj(this.uri,this.opts);const r=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const d=Xn(r,"open",function(){o.onopen(),i&&i()}),f=g=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",g),i?i(g):this.maybeReconnectOnOpen()},h=Xn(r,"error",f);if(this._timeout!==!1){const g=this._timeout,p=this.setTimeoutFn(()=>{d(),f(new Error("timeout")),r.close()},g);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(d),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Xn(i,"ping",this.onping.bind(this)),Xn(i,"data",this.ondata.bind(this)),Xn(i,"error",this.onerror.bind(this)),Xn(i,"close",this.onclose.bind(this)),Xn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){Ec(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new zv(this,i,r),this.nsps[i]=o),o}_destroy(i){const r=Object.keys(this.nsps);for(const o of r)if(this.nsps[o].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let o=0;o<r.length;o++)this.engine.write(r[o],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(d=>{d?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",d)):i.onreconnect()}))},r);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const tr={};function ic(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=Lj(a,i.path||"/socket.io"),o=r.source,d=r.id,f=r.path,h=tr[d]&&f in tr[d].nsps,g=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let p;return g?p=new dh(o,i):(tr[d]||(tr[d]=new dh(o,i)),p=tr[d]),r.query&&!i.query&&(i.query=r.queryKey),p.socket(r.path,i)}Object.assign(ic,{Manager:dh,Socket:zv,io:ic,connect:ic});let wf=null;function Ey(){return wf||(wf=ic(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),wf}function Xj(a){const[i,r]=v.useState(!1),[o,d]=v.useState(null);return v.useEffect(()=>{const f=Ey(),h=()=>r(!0),g=()=>r(!1),p=j=>{d(T=>({...T,...j,state:(j==null?void 0:j.state)||(T==null?void 0:T.state)||"idle"})),a==null||a("session",j)},x=j=>{d(T=>({...T,state:(j==null?void 0:j.state)||(T==null?void 0:T.state)||"idle",status:(j==null?void 0:j.status)||(T==null?void 0:T.status)})),a==null||a("status_update",j)},b=j=>{d(T=>({...T,...j})),a==null||a("status",j)},y=j=>{d(T=>({...T,state:"waiting_for_qr",qr:j})),a==null||a("qr",j)},k=j=>{const T=typeof j=="object"&&j&&"code"in j?String(j.code):String(j||"");d(D=>({...D,state:"waiting_for_qr",pairingCode:T})),a==null||a("pairing_code",T)},E=()=>{d(j=>j?{...j,qr:null}:null),a==null||a("qr_cleared",{})},_=()=>{d(j=>j?{...j,pairingCode:null}:null),a==null||a("pairing_code_cleared",{})},N=(j,...T)=>{a==null||a(j,T[0])};return f.on("connect",h),f.on("disconnect",g),f.on("session",p),f.on("status_update",x),f.on("status",b),f.on("qr",y),f.on("pairing_code",k),f.on("pairing-code",k),f.on("qr_cleared",E),f.on("pairing_code_cleared",_),f.onAny(N),r(f.connected),()=>{f.off("connect",h),f.off("disconnect",g),f.off("session",p),f.off("status_update",x),f.off("status",b),f.off("qr",y),f.off("pairing_code",k),f.off("pairing-code",k),f.off("qr_cleared",E),f.off("pairing_code_cleared",_),f.offAny(N)}},[a]),{isConnected:i,sessionStatus:o,socket:Ey()}}const Yl=[{id:"gemini",name:"Google Gemini",descKey:"providerGeminiDesc",provider:"gemini",defaultModel:"gemini-3.7-flash",defaultBaseUrl:"",keySetting:"gemini_api_key",modelSetting:"gemini_model",baseUrlSetting:"gemini_base_url"},{id:"groq",name:"Groq Cloud",descKey:"providerGroqDesc",provider:"openai",defaultModel:"llama-3.3-70b-versatile",defaultBaseUrl:"https://api.groq.com/openai/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"openai",name:"OpenAI",descKey:"providerOpenAIDesc",provider:"openai",defaultModel:"gpt-4o-mini",defaultBaseUrl:"https://api.openai.com/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"ollama",name:"Ollama (Local)",descKey:"providerOllamaDesc",provider:"openai",defaultModel:"llama3.2",defaultBaseUrl:"http://localhost:11434/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"anthropic",name:"Anthropic Claude",descKey:"providerAnthropicDesc",provider:"anthropic",defaultModel:"claude-sonnet-4-5",defaultBaseUrl:"https://api.anthropic.com",keySetting:"anthropic_api_key",modelSetting:"anthropic_model",baseUrlSetting:"anthropic_base_url"}];function Zj(a){const i=a.ai_provider||"gemini";return Yl.find(r=>{var o,d;return r.provider!==i?!1:!!(r.id==="gemini"||r.id==="anthropic"||r.id==="groq"&&((o=a.openai_base_url)!=null&&o.includes("groq.com"))||r.id==="ollama"&&((d=a.openai_base_url)!=null&&d.includes("11434"))||r.id==="openai"&&(!a.openai_base_url||a.openai_base_url.includes("api.openai.com")))})||Yl[0]}const Jj=()=>{var ti,ni,gl,yr,ai;const{t:a,language:i}=Ze(),{toast:r}=qt(),[o,d]=v.useState({}),[f,h]=v.useState({}),[g,p]=v.useState(!0),[x,b]=v.useState({}),[y,k]=v.useState(!1),[E,_]=v.useState(!1),[N,j]=v.useState(!1),[T,D]=v.useState(""),[Z,ne]=v.useState([]),[pe,I]=v.useState(null),[M,A]=v.useState(""),[P,G]=v.useState(!1),[q,W]=v.useState(!1),[ie,ae]=v.useState([]),[Q,V]=v.useState(null),[le,he]=v.useState(null),[ve,K]=v.useState(!1),X=Zj(o),xe=sh({presetId:X.id,apiKey:"",baseUrl:X.baseUrlSetting?String(o[X.baseUrlSetting]||X.defaultBaseUrl):"",model:String(o[X.modelSetting]||X.defaultModel)}),ke=Tn(String(o.ai_stt_provider||"auto")),w=Tn(String(o.bot_language||"auto")),z=Yl.find(se=>se.id===xe.draft.presetId)||X,de=async()=>{try{const se=await $.getSettings();if(se!=null&&se.settings){const ze={},Ye={};se.settings.forEach(lt=>{ze[lt.key]=lt.value,lt.type==="secret"&&(Ye[lt.key]=!!lt.configured,ze[lt.key]="")}),d(ze),h(Ye)}}catch(se){r(se.message,"error")}finally{p(!1)}};v.useEffect(()=>{de()},[]);const ue=async(se,ze,Ye=!1)=>{d(lt=>({...lt,[se]:ze}));try{await $.updateSetting(se,ze),Ye||r(a("savedSuccessfully"),"success")}catch(lt){r(lt.message,"error")}},ee=async(se,ze)=>{await $.updateSetting(se,ze),se.endsWith("_api_key")?(d(Ye=>({...Ye,[se]:""})),h(Ye=>({...Ye,[se]:!!ze}))):d(Ye=>({...Ye,[se]:ze}))},me=se=>{const ze=Yl.find(lt=>lt.id===se);if(!ze)return;const Ye=Yl.find(lt=>lt.id===xe.draft.presetId)||X;xe.setDraft({presetId:ze.id,apiKey:ze.keySetting===Ye.keySetting?xe.draft.apiKey:"",baseUrl:ze.defaultBaseUrl,model:ze.defaultModel})},te=async(se=!1,ze=!1)=>{k(!0);const Ye=String(xe.draft.apiKey||"").trim(),lt=!!f[z.keySetting];try{const mn={provider:z.provider,refresh:se,cacheOnly:ze};Ye&&(mn.apiKey=Ye),z.baseUrlSetting&&xe.draft.baseUrl&&(mn.baseUrl=xe.draft.baseUrl);const et=await $.fetchAiModels(mn);et&&(et.success||et.fallback)?(b(li=>{var xl;return{...li,[z.id]:{live:!!et.live,requiresApiKey:!!et.requiresApiKey,fallback:!!et.fallback,models:et.models||[],cached:!!et.cached,error:et.success||(xl=et.error)==null?void 0:xl.message}}}),!et.live&&et.requiresApiKey&&se?r(a("connectKeyFirstPrompt"),"info"):!et.success&&et.error&&r(et.error.message||"Failed to discover models","error")):et&&!et.success&&et.error&&(b(li=>{var xl;return{...li,[z.id]:{live:!1,requiresApiKey:!(lt||Ye),fallback:!0,models:et.models||[],error:(xl=et.error)==null?void 0:xl.message}}}),r(et.error.message||"Failed to discover models","error"))}catch(mn){ze||r(mn.message||"Failed to fetch models","error")}finally{k(!1)}};v.useEffect(()=>{g||te(!1,!0)},[z.id,g]);const U=((ti=x[z.id])==null?void 0:ti.models)||[],fe=!!((ni=x[z.id])!=null&&ni.live),Te=!!(((gl=x[z.id])==null?void 0:gl.requiresApiKey)??!f[z.keySetting]),De=o[X.modelSetting]||X.defaultModel,Ge=xe.draft.model||z.defaultModel,Pe=se=>U.find(ze=>ze.id.toLowerCase()===se.toLowerCase())||{id:se,displayName:se,provider:z.provider,recommended:!1,capabilities:{textInput:!0,textOutput:!0,vision:!1,audioInput:!1,stt:!1,videoInput:!1,pdfInput:!1},capabilitySource:"unknown"},Ae=Pe(Ge),Ve=Pe(De),Ct=!!Ae.capabilities.vision,ln=!!Ae.capabilities.stt,Et=!!Ve.capabilities.vision,sn=!!Ve.capabilities.stt,rn=Ae.capabilitySource==="provider"||Ae.capabilitySource==="seed",ye=Ve.capabilitySource==="provider"||Ve.capabilitySource==="seed",Ce=o.ai_auto_detect_capabilities!==!1,We=ye&&Ce&&!Et,pt=ye&&Ce&&!sn;v.useEffect(()=>{g||(We&&o.ai_vision_enabled&&ue("ai_vision_enabled",!1,!0),pt&&o.ai_stt_enabled&&ue("ai_stt_enabled",!1,!0))},[De,We,pt,g]);const tn=async()=>{try{const se=await $.getPersona(),ze=se==null?void 0:se.persona;D(typeof ze=="string"?ze:(ze==null?void 0:ze.body)||""),j(!0)}catch(se){r(se.message,"error")}},_t=async()=>{try{await $.updatePersona(T),r(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),j(!1)}catch(se){r(se.message,"error")}},re=async()=>{try{const se=await $.getMemoryFiles(),ze=((se==null?void 0:se.scopes)||[]).map(Ye=>({scope:Ye.scope,label:Ye.label,entries:Ye.entries??0}));ne(ze.some(Ye=>Ye.scope==="global")?ze:[{scope:"global",label:"Global memory",entries:0},...ze])}catch(se){ne([{scope:"global",label:"Global memory",entries:0}]),r(se.message,"error")}},O=async se=>{I(se),A(""),G(!0);try{const ze=await $.getMemoryFile(se);A((ze==null?void 0:ze.content)||"")}catch(ze){r(ze.message,"error")}finally{G(!1)}},we=async()=>{I("global"),G(!0),await re();try{const se=await $.getMemoryFile("global");A((se==null?void 0:se.content)||"")}catch(se){r(se.message,"error")}finally{G(!1)}},Me=async()=>{if(pe)try{await $.updateMemoryFile(pe,M),r(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),re(),I(null)}catch(se){r(se.message,"error")}},yt=async()=>{W(!0),V(null),he(null),K(!0);try{const se=await $.getAiConversations();ae((se==null?void 0:se.conversations)||[])}catch(se){r(se.message,"error")}finally{K(!1)}},It=async se=>{V(se),he(null),K(!0);try{const ze=await $.getAiConversation(se);he(ze||null)}catch(ze){r(ze.message,"error")}finally{K(!1)}},on=se=>se?new Date(se).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—",hn={saveLabel:a("save"),savedLabel:a("saved")},Kt={saveLabel:a("save"),discardLabel:a("discard"),unsavedLabel:a("unsavedChanges"),savedLabel:a("saved")},Ot=[{icon:ha,label:a("capVision"),on:Ct},{icon:hy,label:a("capStt"),on:ln},{icon:Yw,label:a("capAudio"),on:!!Ae.capabilities.audioInput},{icon:ec,label:a("capText"),on:!!(Ae.capabilities.textInput&&Ae.capabilities.textOutput)},{icon:ec,label:a("capPdf"),on:!!Ae.capabilities.pdfInput},{icon:ha,label:a("capVideo"),on:!!Ae.capabilities.videoInput}];if(g)return s.jsx(Kl,{text:a("starting")});const Jn=!!o.ai_agent;return s.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[s.jsx(Ws,{icon:s.jsx(yh,{size:20}),title:a("aiTitle"),description:a("aiSubtitle")}),s.jsx(at,{children:s.jsxs("div",{className:"flex min-h-10 items-center justify-between gap-4",children:[s.jsx("span",{className:"text-sm font-semibold text-text-main",children:a("aiAgentEnabled")}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-bold text-muted",children:a(Jn?"toggleOn":"toggleOff")}),s.jsx(Zn,{checked:Jn,onChange:se=>ue("ai_agent",se),"aria-label":a("aiAgentEnabled")})]})]})}),s.jsxs(at,{className:"flex flex-col gap-3",children:[s.jsx(fa,{icon:s.jsx(Tb,{size:18}),title:a("aiProvider")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ht,{"aria-label":a("aiProvider"),className:"min-w-0 flex-1 sm:max-w-xs",value:xe.draft.presetId,onChange:se=>me(se.target.value),children:Yl.map(se=>s.jsx("option",{value:se.id,children:se.name},se.id))}),s.jsx("span",{className:"font-mono text-xs text-muted",children:Ge})]}),Te&&s.jsx("p",{className:"text-xs text-warn",children:a("connectKeyFirstPrompt")}),((yr=x[z.id])==null?void 0:yr.error)&&s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs font-semibold text-danger",children:[s.jsx(ir,{size:16,className:"shrink-0"}),s.jsx("span",{className:"min-w-0",children:(ai=x[z.id])==null?void 0:ai.error})]}),s.jsx(Le,{variant:"ghost",label:a("refreshModels"),icon:s.jsx(Qs,{size:16}),onClick:()=>te(!0),loading:y})]}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:se=>{se.preventDefault(),xe.save(async ze=>{const Ye=Yl.find(lt=>lt.id===ze.presetId)||z;await ee("ai_provider",Ye.provider),Ye.baseUrlSetting&&await ee(Ye.baseUrlSetting,ze.baseUrl),await ee(Ye.modelSetting,ze.model),ze.apiKey.trim()&&await ee(Ye.keySetting,ze.apiKey.trim()),xe.setDraft({...ze,apiKey:""})})},onKeyDown:se=>{se.key==="Escape"&&xe.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[s.jsx(it,{className:"min-w-0",htmlFor:"input-api-key",label:s.jsxs("span",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("span",{children:a("apiKey")}),f[z.keySetting]&&s.jsxs(vt,{tone:"ok",children:[s.jsx(Ks,{size:11}),a("saved")]})]}),children:s.jsx(Be,{id:"input-api-key",type:"password",className:"font-mono",value:xe.draft.apiKey,onChange:se=>xe.setField("apiKey",se.target.value),placeholder:f[z.keySetting]?"••••••••••••":a("enterApiKey")})}),z.baseUrlSetting&&s.jsx(it,{className:"min-w-0",label:a("baseUrl"),htmlFor:"input-base-url",children:s.jsx(Be,{id:"input-base-url",type:"text",className:"font-mono",value:xe.draft.baseUrl,onChange:se=>xe.setField("baseUrl",se.target.value),placeholder:z.defaultBaseUrl})}),s.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("label",{htmlFor:"input-model-name",className:"text-xs font-bold text-text-main",children:a("modelName")}),s.jsx(vt,{tone:fe?"ok":"info",children:a(fe?"sourceLive":"sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ge,{type:"button",variant:"ghost",size:"sm",onClick:()=>_(!E),children:a(E?"modelListToggle":"modelCustomToggle")}),s.jsx(Le,{type:"button",variant:"ghost",label:a("refreshModels"),icon:s.jsx(Qs,{size:16}),onClick:()=>te(!0),loading:y})]})]}),E?s.jsx(Be,{id:"input-model-name",type:"text",className:"font-mono",value:xe.draft.model,onChange:se=>xe.setField("model",se.target.value),placeholder:z.defaultModel}):s.jsxs(Ht,{id:"input-model-name",className:"font-mono",value:Ge,onChange:se=>xe.setField("model",se.target.value),children:[s.jsx("optgroup",{label:a(fe?"modelsAvailableLive":"modelsRecommendedSeed"),children:U.map(se=>s.jsxs("option",{value:se.id,children:[se.displayName&&se.displayName!==se.id?`${se.displayName} (${se.id})`:se.id,se.recommended?" ★":""]},se.id))}),!U.some(se=>se.id.toLowerCase()===Ge.toLowerCase())&&s.jsxs("option",{value:Ge,children:[Ge," (current)"]})]})]})]}),s.jsx(ih,{dirty:xe.dirty,saving:xe.status==="saving",justSaved:xe.status==="saved",error:xe.error,onDiscard:xe.revert,...Kt})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[Ot.map(({icon:se,label:ze,on:Ye})=>s.jsxs(vt,{tone:rn&&Ye?"ok":"neutral",children:[s.jsx(se,{size:12}),ze,rn?Ye?` · ${a("supported")}`:` · ${a("unsupported")}`:""]},ze)),s.jsx(vt,{tone:Ae.capabilitySource==="provider"?"ok":Ae.capabilitySource==="seed"?"info":"neutral",children:Ae.capabilitySource==="provider"?a("sourceLive"):Ae.capabilitySource==="seed"?a("sourceSeed"):a("sourceUnknown")})]})]}),s.jsxs(at,{className:"flex flex-col gap-3",children:[s.jsx(fa,{title:a("capabilities")}),s.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.jsxs("div",{className:"py-2",children:[s.jsx(Zn,{checked:We?!1:!!o.ai_vision_enabled,disabled:We,onChange:se=>{We||ue("ai_vision_enabled",se)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(ha,{size:17,className:We?"shrink-0 text-muted":"shrink-0 text-brand-cyan"}),a("aiVision")]}),description:a("aiVisionDesc")}),We&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(dc,{size:13,className:"shrink-0"}),s.jsx("span",{children:a("visionUnsupportedNotice")})]})]}),s.jsxs("div",{className:"py-2",children:[s.jsx(Zn,{checked:pt?!1:!!(o.ai_stt_enabled??!0),disabled:pt,onChange:se=>{pt||ue("ai_stt_enabled",se)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(hy,{size:17,className:pt?"shrink-0 text-muted":"shrink-0 text-brand-purple"}),a("aiSttEnabled")]}),description:a("aiSttEnabledDesc")}),pt&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(dc,{size:13,className:"shrink-0"}),s.jsx("span",{children:a("sttUnsupportedNotice")})]})]}),s.jsx("div",{className:"py-2",children:s.jsx(zn,{label:a("aiStt"),description:a("sttDesc"),htmlFor:"ai-stt-provider",dirty:ke.dirty,saving:ke.status==="saving",justSaved:ke.status==="saved",error:ke.error,onSave:()=>ke.save(se=>ee("ai_stt_provider",se)),onRevert:ke.revert,...hn,children:s.jsxs(Ht,{id:"ai-stt-provider","aria-label":a("aiStt"),value:ke.value,disabled:pt,onChange:se=>ke.setValue(se.target.value),children:[s.jsx("option",{value:"auto",children:a("sttAuto")}),s.jsx("option",{value:"gemini",children:a("sttGemini")}),s.jsx("option",{value:"openai",children:a("sttOpenAI")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(zn,{label:a("botLanguage"),description:a("botLanguageDesc"),htmlFor:"ai-bot-language",dirty:w.dirty,saving:w.status==="saving",justSaved:w.status==="saved",error:w.error,onSave:()=>w.save(se=>ee("bot_language",se)),onRevert:w.revert,...hn,children:s.jsxs(Ht,{id:"ai-bot-language","aria-label":a("botLanguage"),value:w.value,onChange:se=>w.setValue(se.target.value),children:[s.jsx("option",{value:"auto",children:a("langAuto")}),s.jsx("option",{value:"ar",children:a("langAr")}),s.jsx("option",{value:"en",children:a("langEn")})]})})})]})]}),s.jsxs(at,{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{variant:"secondary",icon:s.jsx(ec,{size:16}),onClick:tn,title:a("personaDesc"),children:a("editPersona")}),s.jsx(ge,{variant:"secondary",icon:s.jsx(vw,{size:16}),onClick:we,title:a("memoryDesc"),children:a("manageMemory")}),s.jsx(ge,{variant:"secondary",icon:s.jsx(Bw,{size:16}),onClick:yt,title:a("aiInspectorDesc"),children:a("openInspector")})]}),s.jsx(en,{isOpen:N,onClose:()=>j(!1),title:a("personaPrompt"),maxWidth:"750px",footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:()=>j(!1),children:a("cancel")}),s.jsx(ge,{variant:"primary",icon:s.jsx(Xs,{size:16}),onClick:_t,children:a("save")})]}),children:s.jsx(mc,{className:"font-mono",rows:12,value:T,onChange:se=>D(se.target.value)})}),s.jsx(en,{isOpen:!!pe,onClose:()=>I(null),title:a("memoryFiles"),maxWidth:"900px",footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:()=>I(null),children:a("cancel")}),s.jsx(ge,{variant:"primary",icon:s.jsx(Xs,{size:16}),onClick:Me,disabled:P,children:a("save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row",children:[s.jsx("div",{className:"flex shrink-0 flex-col gap-1.5 md:max-h-[420px] md:w-60 md:overflow-y-auto",children:Z.map(se=>{const ze=se.scope==="global",Ye=pe===se.scope;return s.jsxs(ge,{variant:Ye?"primary":"secondary","aria-pressed":Ye,onClick:()=>O(se.scope),className:"h-auto w-full flex-col items-stretch gap-1 px-2.5 py-2.5",children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-xs font-bold",children:[ze?s.jsx(uc,{size:14,className:"shrink-0"}):s.jsx(tc,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:ze?a("memoryGlobalScope"):se.scope})]}),s.jsxs("span",{className:"block text-start text-[10px] opacity-80",children:[a(ze?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",a("memoryEntriesCount").replace("{n}",String(se.entries))]})]},se.scope)})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] leading-relaxed text-muted",children:a("memoryProseHint")}),P?s.jsx("div",{className:"flex min-h-[340px] items-center justify-center",children:s.jsx(Oa,{className:"size-6",label:a("starting")})}):s.jsx(mc,{className:"min-h-[340px] flex-1 font-mono",rows:12,value:M,onChange:se=>A(se.target.value),placeholder:a("memoryEditorPlaceholder")})]})]})}),s.jsx(en,{isOpen:q,onClose:()=>W(!1),title:a("aiInspector"),maxWidth:"750px",footer:s.jsx(ge,{variant:"secondary",onClick:()=>W(!1),children:a("cancel")}),children:ve?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(Oa,{className:"size-6",label:a("starting")})}):Q?s.jsxs("div",{className:"flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(ge,{variant:"ghost",size:"sm",icon:s.jsx(N0,{size:16,className:"rtl:rotate-180"}),onClick:()=>V(null),children:a("backToList")}),s.jsx("span",{className:"truncate font-mono text-[10px] text-muted",children:Q})]}),(le==null?void 0:le.truncated)&&s.jsx("p",{className:"text-[11px] font-semibold text-warn",children:a("convTruncated")}),s.jsxs("div",{className:"flex max-h-[420px] flex-col gap-1.5 overflow-y-auto",children:[(le==null?void 0:le.messages.length)===0&&s.jsx(Sn,{text:a("noConversations"),className:"py-6"}),le==null?void 0:le.messages.map((se,ze)=>s.jsxs("div",{className:`rounded-xl border p-2.5 text-xs ${se.kind==="tool"||se.kind==="toolResult"?"border-line bg-panel font-mono text-muted":se.role==="model"?"border-brand-blue/25 bg-brand-blue/10 text-text-main":"border-line bg-panel-raised text-text-main"}`,children:[se.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:se.text}),se.kind==="media"&&s.jsxs("span",{children:["📎 ",se.mimeType||a("convMedia")]}),se.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",se.name]}),se.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",se.name]})]},ze))]})]}):ie.length===0?s.jsx(Sn,{icon:s.jsx(tc,{size:20}),text:a("noConversations"),className:"py-8"}):s.jsx("div",{className:"flex flex-col gap-1.5",children:ie.map(se=>s.jsxs(ge,{variant:"secondary",onClick:()=>It(se.chatId),className:"h-auto w-full flex-col items-stretch gap-1 px-3 py-3",children:[s.jsxs("span",{className:"flex items-center gap-2 text-xs font-bold",children:[s.jsx(tc,{size:14,className:"shrink-0 text-brand-blue"}),s.jsx("span",{className:"truncate font-mono",children:se.chatId})]}),s.jsxs("span",{className:"block text-start text-[10px] text-muted",children:[a("convTurns").replace("{n}",String(se.turns))," ·"," ",on(se.updatedAt)]})]},se.chatId))})})]})},Gn={rules:100,keywords:50,keywordChars:100,nameChars:60,senders:200,phoneMin:8,phoneMax:15},$j=/[\u064B-\u065F\u0670\u0640]/g,Wj=/[\u0622\u0623\u0625\u0671]/g,eN=/\u0649/g,_y={enabled:"any",chatScope:"any",senders:"any"};function fh(a){let i=String(a??"");return i=i.normalize("NFKC"),i=i.replace($j,""),i=i.replace(Wj,"ا"),i=i.replace(eN,"ي"),i=i.toLowerCase(),i=i.replace(/\s+/g," ").trim(),i}function tN(a){const i=String(a??"").normalize("NFC").replace(/\s+/g," ").trim();return i?i.length>Gn.keywordChars?{error:"long"}:fh(i)?{value:i}:{error:"empty"}:{error:"empty"}}class Gs extends Error{constructor(i){super(i),this.reason=i,this.name="SenderInputError"}}function nN(a){var d;const i=String(a??"").trim();if(!i)throw new Gs("invalid");const r=i.toLowerCase();if(r.endsWith("@g.us")||r.endsWith("@broadcast")||r.endsWith("@newsletter"))throw new Gs("group");if(i.includes("@")){if(r.includes("@lid")){const f=(d=i.split("@")[0])==null?void 0:d.split(":")[0];if(!f)throw new Gs("invalid");return`${f}@lid`}if(i.includes(":")){const f=i.split(":")[0],h=i.split("@")[1];if(!f||!h)throw new Gs("invalid");return`${f}@${h}`}return i}const o=i.replace(/\D/g,"");if(o.length>=Gn.phoneMin&&o.length<=Gn.phoneMax)return`${o}@s.whatsapp.net`;throw new Gs("invalid")}function Js(a){var r;const i=(r=a.name)==null?void 0:r.trim();return i||a.keywords[0]||""}function xc(a,i){if(!a)return"";const r=i==null?void 0:i.get(a);if(r)return r;const o=/^(\d+)@s\.whatsapp\.net$/i.exec(a);return o?`+${o[1]}`:a}function hh(a,i){return a&&(i!=null&&i.has(a))?"auto":"ltr"}function aN(a){const i={};return a.name.trim().length>Gn.nameChars&&(i.name="long"),a.keywords.length<1?i.keywords="required":a.keywords.length>Gn.keywords&&(i.keywords="max"),a.sendersMode==="selected"&&(a.senders.length<1?i.senders="required":a.senders.length>Gn.senders&&(i.senders="max")),i}function lN(a,i){return{name:a.name.trim()||null,keywords:a.keywords,match:a.match,chatScope:a.chatScope,senders:{mode:a.sendersMode,list:a.sendersMode==="everyone"?[]:a.senders},includeOwn:a.includeOwn,forEveryone:a.forEveryone,keepCopy:a.keepCopy,...i===void 0?{}:{enabled:i}}}function sN(a,i,r){const o=fh(i);return!(o&&!fh(`${a.name??""} ${a.keywords.join(" ")}`).includes(o)||r.enabled==="on"&&!a.enabled||r.enabled==="off"&&a.enabled||r.chatScope!=="any"&&a.chatScope!==r.chatScope||r.senders!=="any"&&a.senders.mode!==r.senders)}function iN(a,i,r){const o=[...a],d=(f,h)=>Js(f).localeCompare(Js(h),r,{sensitivity:"base"});return i==="name"?o.sort(d):i==="deleted"?o.sort((f,h)=>h.deletedCount-f.deletedCount||d(f,h)):i==="last"?o.sort((f,h)=>(h.lastDeletedAt??-1)-(f.lastDeletedAt??-1)||d(f,h)):o.sort((f,h)=>h.createdAt-f.createdAt||h.id-f.id),o}function rN(a){return[a.enabled,a.chatScope,a.senders].filter(i=>i!=="any").length}function an(a,i){return a.replace(/\{([A-Za-z0-9_]+)\}/g,(r,o)=>Object.hasOwn(i,o)?String(i[o]):r)}const Jo=50;function kf(a,i){return a instanceof Rt&&a.message?a.message:i}const oN=({rules:a,names:i,ruleId:r,onRuleIdChange:o})=>{const{t:d}=Ze(),{toast:f}=qt(),[h,g]=v.useState([]),[p,x]=v.useState(!0),[b,y]=v.useState(!1),[k,E]=v.useState(!1),[_,N]=v.useState(null),[j,T]=v.useState(0),[D,Z]=v.useState(null),[ne,pe]=v.useState(!1),I=v.useRef(0);v.useEffect(()=>{const q=++I.current;x(!0),N(null),$.listAutoDeleteLog({ruleId:r||void 0,limit:Jo,offset:0}).then(W=>{I.current===q&&(g(W.log),E(W.log.length===Jo))}).catch(W=>{if(I.current!==q)return;const ie=kf(W,d("copiesLoadFailed"));N(ie),f(ie,"error")}).finally(()=>{I.current===q&&x(!1)})},[r,j,d,f]);const M=async()=>{const q=I.current;y(!0);try{const W=await $.listAutoDeleteLog({ruleId:r||void 0,limit:Jo,offset:h.length});if(I.current!==q)return;g(ie=>[...ie,...W.log]),E(W.log.length===Jo)}catch(W){if(I.current!==q)return;f(kf(W,d("copiesLoadFailed")),"error")}finally{I.current===q&&y(!1)}},A=async()=>{pe(!0);try{await $.clearAutoDeleteLog(D==="rule"?r:void 0),f(d("copiesCleared"),"success"),Z(null),T(q=>q+1)}catch(q){f(kf(q,d("copiesLoadFailed")),"error")}finally{pe(!1)}},P=v.useCallback(q=>{if(!q)return d("mediaText");const ie={image:"mediaImage",video:"mediaVideo",audio:"mediaAudio",sticker:"mediaSticker",document:"mediaDocument"}[q];return ie?d(ie):q},[d]),G=a.find(q=>String(q.id)===r);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(Cc,{children:[s.jsx(jc,{label:d("filter"),resetLabel:d("reset"),activeCount:r?1:0,onReset:()=>o(""),children:s.jsx(it,{label:d("filterByRule"),children:s.jsxs(Ht,{"aria-label":d("filterByRule"),value:r,onChange:q=>o(q.target.value),children:[s.jsx("option",{value:"",children:d("allRules")}),a.map(q=>s.jsx("option",{value:String(q.id),children:Js(q)},q.id))]})})}),s.jsx("span",{className:"ms-auto",children:s.jsxs(La,{label:d("more"),children:[r&&s.jsx(ot,{danger:!0,icon:s.jsx(hl,{size:16}),onSelect:()=>Z("rule"),children:d("clearCopiesForRule")}),s.jsx(ot,{danger:!0,icon:s.jsx(hl,{size:16}),onSelect:()=>Z("all"),children:d("clearCopies")})]})})]}),p&&s.jsx("div",{className:"flex flex-col gap-3","aria-busy":"true",children:["s1","s2","s3"].map(q=>s.jsxs(at,{className:"flex flex-col gap-3",children:[s.jsx(Is,{className:"h-4 w-40"}),s.jsx(Is,{className:"h-12 w-full"}),s.jsx(Is,{className:"h-5 w-24"})]},q))}),!p&&_&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-10",children:[s.jsx("p",{role:"alert",className:"text-sm text-danger",children:_}),s.jsx(ge,{onClick:()=>T(q=>q+1),children:d("retryLoad")})]}),!p&&!_&&h.length===0&&s.jsx(Sn,{title:d(r?"noCopiesForRule":"noCopiesTitle"),description:d("noCopiesBody")}),!p&&!_&&h.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[h.map(q=>{const W=xc(q.chatJid,i)||"—",ie=xc(q.sender,i)||"—",ae=q.mode==="revoke"?d("modeRevoke"):q.mode==="deleteForMe"?d("modeForMe"):q.mode;return s.jsxs(at,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[11px] font-bold text-faint",children:d("copyChat")}),s.jsx("p",{dir:hh(q.chatJid,i),className:"truncate text-sm font-semibold",children:W})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[11px] font-bold text-faint",children:d("copySender")}),s.jsx("p",{dir:hh(q.sender,i),className:"truncate text-sm",children:ie})]}),s.jsx(mv,{value:q.createdAt,className:"ms-auto text-xs text-muted"})]}),s.jsx("p",{dir:"auto",className:"whitespace-pre-wrap break-words text-sm text-text-main",children:q.text||"—"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(vt,{children:P(q.mediaType)}),s.jsx(vt,{tone:q.mode==="revoke"?"info":"neutral",children:ae})]})]},q.id)}),k&&s.jsx(ge,{variant:"secondary",className:"self-center",loading:b,onClick:()=>void M(),children:d("loadMore")})]}),s.jsx(dv,{isOpen:D!==null,onClose:()=>Z(null),onConfirm:()=>void A(),title:d("clearCopiesTitle"),description:D==="rule"?an(d("clearCopiesRuleBody"),{name:G?Js(G):""}):d("clearCopiesBody"),confirmLabel:d("clearCopies"),cancelLabel:d("cancel"),loading:ne})]})},cN={NO_MEDIA:"stickerErr_NO_MEDIA",UNSUPPORTED_TYPE:"stickerErr_UNSUPPORTED_TYPE",TOO_LARGE:"stickerErr_TOO_LARGE",DIMENSIONS_TOO_LARGE:"stickerErr_DIMENSIONS_TOO_LARGE",VIDEO_TOO_LONG:"stickerErr_VIDEO_TOO_LONG",CORRUPT:"stickerErr_CORRUPT",CONVERSION_FAILED:"stickerErr_CONVERSION_FAILED",OUTPUT_TOO_LARGE:"stickerErr_OUTPUT_TOO_LARGE",ENCODER_MISSING:"stickerErr_ENCODER_MISSING",TIMEOUT:"stickerErr_TIMEOUT",BUSY:"stickerErr_BUSY",NOT_FOUND:"stickerErr_NOT_FOUND",PACK_NOT_FOUND:"stickerErr_PACK_NOT_FOUND",PACK_EXISTS:"stickerErr_PACK_EXISTS",INVALID_NAME:"stickerErr_INVALID_NAME",INVALID_OPTIONS:"stickerErr_INVALID_OPTIONS",LIBRARY_FULL:"stickerErr_LIBRARY_FULL",PACK_LIMIT:"stickerErr_PACK_LIMIT",IN_USE:"stickerErr_IN_USE",STORAGE_UNAVAILABLE:"stickerErr_STORAGE_UNAVAILABLE",NOT_CONNECTED:"stickerErr_NOT_CONNECTED",CANCELLED:"stickerErr_CANCELLED",INTERNAL:"stickerErr_INTERNAL"};function Mv(a){return a?cN[a]??null:null}function Mh(a,i){const r=Mv(i);return a(r||"stickerErr_INTERNAL")}function bt(a,i){return i instanceof Rt?Mh(a,i.code):a("stickerErr_INTERNAL")}function uN(a,i){const o=i?{probing:"jobStage_probing",decoding:"jobStage_decoding",encoding:"jobStage_encoding",optimizing:"jobStage_optimizing",queued:"jobQueued"}[i]:null;return a(o||"jobQueued")}const Rh=({open:a,busy:i=!1,onClose:r,onPick:o,title:d,includeGroups:f=!0,selectedIds:h,emptyText:g})=>{const{t:p}=Ze(),[x,b]=v.useState([]),[y,k]=v.useState(""),[E,_]=v.useState(!1),[N,j]=v.useState(null);v.useEffect(()=>{if(!a)return;let D=!1;return _(!0),j(null),$.getRecipients().then(Z=>{D||b(Z.recipients)}).catch(Z=>{D||(Z instanceof Rt&&!Mv(Z.code)?j(Z.message||p("recipientsLoadFailed")):j(bt(p,Z)))}).finally(()=>{D||_(!1)}),()=>{D=!0}},[a,p]);const T=v.useMemo(()=>{const D=f?x:x.filter(ne=>ne.type==="contact"),Z=y.trim().toLowerCase();return Z?D.filter(ne=>ne.name.toLowerCase().includes(Z)||(ne.phone||"").toLowerCase().includes(Z)):D},[f,x,y]);return s.jsx(en,{isOpen:a,onClose:r,title:d??p("sendViaWhatsapp"),footer:s.jsx(ge,{onClick:r,disabled:i,children:p("cancel")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(bh,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Be,{type:"search",value:y,onChange:D=>k(D.target.value),placeholder:p("searchRecipients"),"aria-label":p("searchRecipients"),className:"ps-9"})]}),E&&s.jsx(Kl,{text:p("loading")}),N&&s.jsx("p",{className:"text-sm text-danger",role:"alert",children:N}),!E&&!N&&T.length===0&&s.jsx("p",{className:"text-sm text-muted",children:g??p("noRecipients")}),s.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto",children:T.map(D=>{const Z=(h==null?void 0:h.includes(D.id))??!1;return s.jsxs(ge,{variant:"secondary",disabled:i||Z,onClick:()=>o(D.id),className:"h-auto w-full flex-col items-start px-3 py-2.5",children:[s.jsxs("span",{className:"flex w-full items-center gap-2",children:[s.jsx("span",{dir:"auto",className:"block min-w-0 flex-1 truncate text-sm font-semibold",children:D.name}),Z&&s.jsx(vt,{tone:"info",children:p("contactAdded")})]}),s.jsxs("span",{className:"block w-full text-[11px] font-medium text-muted",children:[D.type==="group"?p("recipientGroup"):p("recipientContact"),D.phone?s.jsx("span",{dir:"ltr",className:"ms-2",children:D.phone}):null]})]},D.id)})}),i&&s.jsx("p",{className:"text-xs text-muted",children:p("sending")})]})})},dN=["contains","word","exact"],fN=["all","groups","private"],hN=({open:a,rule:i,names:r,onClose:o,onSaved:d})=>{const{t:f}=Ze(),h=v.useRef(i);h.current=i;const g=(i==null?void 0:i.id)??null,[p,x]=v.useState(""),[b,y]=v.useState([]),[k,E]=v.useState("contains"),[_,N]=v.useState("all"),[j,T]=v.useState("everyone"),[D,Z]=v.useState([]),[ne,pe]=v.useState(!1),[I,M]=v.useState(!0),[A,P]=v.useState(!1),[G,q]=v.useState(""),[W,ie]=v.useState(!1),[ae,Q]=v.useState(!1),[V,le]=v.useState(null),[he,ve]=v.useState(null),[K,X]=v.useState(null),[xe,ke]=v.useState(null);v.useEffect(()=>{if(!a)return;const ee=h.current;((ee==null?void 0:ee.id)??null)===g&&(x((ee==null?void 0:ee.name)??""),y((ee==null?void 0:ee.keywords)??[]),E((ee==null?void 0:ee.match)??"contains"),N((ee==null?void 0:ee.chatScope)??"all"),T((ee==null?void 0:ee.senders.mode)??"everyone"),Z((ee==null?void 0:ee.senders.list)??[]),pe((ee==null?void 0:ee.includeOwn)??!1),M((ee==null?void 0:ee.forEveryone)??!0),P((ee==null?void 0:ee.keepCopy)??!1),q(""),ie(!1),Q(!1),le(null),ve(null),X(null),ke(null))},[a,g]);const w=f(k==="word"?"matchWordHint":k==="exact"?"matchExactHint":"matchContainsHint"),z=ee=>{X(ee==="long"?f("keywordTooLong"):ee==="max"?f("keywordsMax"):ee==="empty"?f("keywordEmpty"):ee==="duplicate"?f("keywordDuplicate"):null)},de=ee=>{try{const me=nN(ee);if(D.includes(me)){q(""),ke(null);return}if(D.length>=Gn.senders){ke(f("tooManySenders"));return}Z(te=>te.includes(me)?te:[...te,me]),q(""),ke(null)}catch(me){ke(me instanceof Gs&&me.reason==="group"?f("groupSenderRejected"):f("invalidPhone"))}},ue=async ee=>{var U;ee.preventDefault();const me={name:p,keywords:b,match:k,chatScope:_,sendersMode:j,senders:D,includeOwn:ne,forEveryone:I,keepCopy:A},te=aN(me);if(ve(te.name?f("nameTooLong"):null),X(te.keywords==="required"?f("keywordsRequired"):te.keywords==="max"?f("keywordsMax"):null),ke(te.senders==="required"?f("sendersRequired"):te.senders==="max"?f("tooManySenders"):null),!(te.name||te.keywords||te.senders)){Q(!0),le(null);try{const fe=lN(me,(U=h.current)==null?void 0:U.enabled),Te=h.current?await $.updateAutoDeleteRule(h.current.id,fe):await $.createAutoDeleteRule(fe);d(Te.rule)}catch(fe){const Te=fe instanceof Rt&&fe.message?fe.message:f("ruleSaveFailed");le(Te)}finally{Q(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsx(en,{isOpen:a,onClose:o,title:f(i?"editRule":"newRule"),maxWidth:"40rem",footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:o,disabled:ae,children:f("cancel")}),s.jsx(ge,{variant:"primary",type:"submit",form:"auto-delete-rule-form",loading:ae,children:f("saveRule")})]}),children:s.jsxs("form",{id:"auto-delete-rule-form",className:"flex flex-col gap-4",onSubmit:ee=>void ue(ee),children:[V&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:V}),s.jsx(it,{label:f("ruleName"),htmlFor:"ad-rule-name",error:he,children:s.jsx(Be,{id:"ad-rule-name",name:"rule-name",dir:"auto",value:p,"aria-invalid":he?!0:void 0,placeholder:f("ruleNamePlaceholder"),onChange:ee=>{x(ee.target.value),he&&ee.target.value.trim().length<=Gn.nameChars&&ve(null)},onBlur:()=>{p.trim().length>Gn.nameChars&&ve(f("nameTooLong"))}})}),s.jsx(it,{label:f("keywordsLabel"),error:K,children:s.jsx(Pk,{id:"ad-keywords",value:b,onChange:y,max:Gn.keywords,prepare:tN,onReject:z,removeLabel:ee=>an(f("removeKeyword"),{word:ee}),countLabel:an(f("keywordCount"),{n:b.length,max:Gn.keywords}),placeholder:f("keywordsPlaceholder"),"aria-label":f("keywordsLabel"),"aria-invalid":K?!0:void 0,disabled:ae})}),s.jsx(it,{label:f("matchMode"),description:w,children:s.jsx(Il,{"aria-label":f("matchMode"),className:"flex w-full flex-wrap",value:k,onChange:E,options:dN.map(ee=>({value:ee,label:f(ee==="contains"?"matchContains":ee==="word"?"matchWord":"matchExact")}))})}),s.jsx(it,{label:f("chatScopeLabel"),children:s.jsx(Il,{"aria-label":f("chatScopeLabel"),className:"flex w-full flex-wrap",value:_,onChange:N,options:fN.map(ee=>({value:ee,label:f(ee==="all"?"chatsAll":ee==="groups"?"chatsGroups":"chatsPrivate")}))})}),s.jsxs(it,{label:f("filterSender"),error:j==="selected"?xe:null,children:[s.jsx(Il,{"aria-label":f("filterSender"),className:"flex w-full flex-wrap",value:j,onChange:T,options:[{value:"everyone",label:f("sendersEveryone")},{value:"selected",label:f("sendersSelected")}]}),j==="selected"&&s.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:f("sendersHelp")}),D.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:D.map(ee=>s.jsx(kc,{dir:hh(ee,r),removeLabel:an(f("removeContact"),{name:xc(ee,r)}),onRemove:()=>Z(me=>me.filter(te=>te!==ee)),children:xc(ee,r)},ee))}),s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[s.jsx(Be,{type:"tel",inputMode:"tel",name:"phone",autoComplete:"tel",dir:"ltr",value:G,placeholder:f("phonePlaceholder"),"aria-label":f("phonePlaceholder"),className:"min-w-0 flex-1",onChange:ee=>q(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),de(G))}}),s.jsx(ge,{type:"button",variant:"secondary",onClick:()=>de(G),children:f("addPhone")})]}),s.jsx(ge,{type:"button",variant:"secondary",onClick:()=>ie(!0),children:f("selectContacts")})]})]}),s.jsx(Zn,{checked:ne,onChange:pe,label:f("includeOwn"),description:f("includeOwnHint")}),s.jsx(Zn,{checked:I,onChange:M,label:f("forEveryone"),description:f("forEveryoneHint")}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Zn,{checked:A,onChange:P,label:f("keepCopy"),description:f("keepCopyHint")}),s.jsx("p",{className:"text-xs text-faint",children:f("keepCopyPrivacy")})]})]})}),s.jsx(Rh,{open:W,onClose:()=>ie(!1),title:f("selectContacts"),includeGroups:!1,selectedIds:D,emptyText:f("noContacts"),onPick:ee=>de(ee)})]})},Ay=4,mN={contains:"matchContains",word:"matchWord",exact:"matchExact"};function nr(a,i){return a instanceof Rt&&a.message?a.message:i}const pN=()=>{const{t:a,language:i}=Ze(),{toast:r}=qt(),[o,d]=v.useState("rules"),[f,h]=v.useState([]),[g,p]=v.useState(()=>new Map),[x,b]=v.useState(!0),[y,k]=v.useState(null),[E,_]=v.useState(0),[N,j]=v.useState(""),[T,D]=v.useState("newest"),[Z,ne]=v.useState(_y),[pe,I]=v.useState(!1),[M,A]=v.useState(null),[P,G]=v.useState(null),[q,W]=v.useState(!1),[ie,ae]=v.useState(""),Q=v.useRef(new Set),V=v.useRef(new Map),le=v.useRef(0),he=v.useRef(!0),ve=v.useRef(0),K=v.useMemo(()=>new Intl.NumberFormat(i),[i]),X=v.useCallback(U=>{h(fe=>U.map(Te=>{if(!Q.current.has(Te.id))return Te;const De=fe.find(Ge=>Ge.id===Te.id);return De?{...Te,enabled:De.enabled}:Te}))},[]);v.useEffect(()=>{const U=++le.current;return b(!0),$.listAutoDeleteRules().then(fe=>{!he.current||le.current!==U||(X(fe.rules),k(null))}).catch(fe=>{if(!he.current||le.current!==U)return;const Te=nr(fe,a("rulesLoadFailed"));k(Te),r(Te,"error")}).finally(()=>{he.current&&le.current===U&&b(!1)}),()=>{le.current+=1}},[E,a,r,X]),v.useEffect(()=>(he.current=!0,()=>{he.current=!1}),[]);const xe=v.useCallback(async()=>{const U=++le.current,fe=ve.current;try{const Te=await $.listAutoDeleteRules();if(!he.current||le.current!==U||ve.current!==fe)return;X(Te.rules),k(null)}catch{}},[X]);v.useEffect(()=>{if(x)return;const U=()=>{document.visibilityState!=="hidden"&&xe()};window.addEventListener("focus",U),document.addEventListener("visibilitychange",U);const fe=window.setInterval(U,3e4);return()=>{window.removeEventListener("focus",U),document.removeEventListener("visibilitychange",U),window.clearInterval(fe)}},[x,xe]),v.useEffect(()=>{let U=!1;return $.getRecipients().then(fe=>{if(U)return;const Te=new Map;for(const De of fe.recipients)De.name&&Te.set(De.id,De.name);p(Te)}).catch(fe=>{U||r(nr(fe,a("recipientsLoadFailed")),"error")}),()=>{U=!0}},[a,r]);const ke=v.useMemo(()=>iN(f.filter(U=>sN(U,N,Z)),T,i),[f,N,Z,T,i]),w=M?f.find(U=>U.id===M.id)??M:null,z=()=>{if(f.length>=Gn.rules){r(a("rulesLimit"),"warning");return}A(null),I(!0)},de=async(U,fe)=>{ve.current+=1;const Te=U.enabled,De=(V.current.get(U.id)??0)+1;V.current.set(U.id,De),Q.current.add(U.id),h(Ge=>Ge.map(Pe=>Pe.id===U.id?{...Pe,enabled:fe}:Pe));try{const Ge=await $.updateAutoDeleteRule(U.id,{enabled:fe});if(V.current.get(U.id)!==De)return;h(Pe=>Pe.map(Ae=>Ae.id===U.id?Ge.rule:Ae))}catch(Ge){V.current.get(U.id)===De&&(h(Pe=>Pe.map(Ae=>Ae.id===U.id?{...Ae,enabled:Te}:Ae)),r(nr(Ge,a("toggleFailed")),"error"))}finally{ve.current+=1,V.current.get(U.id)===De&&Q.current.delete(U.id)}},ue=async U=>{ve.current+=1;try{const fe=await $.resetAutoDeleteRule(U.id);h(Te=>Te.map(De=>De.id===U.id?fe.rule:De)),r(a("counterReset"),"success")}catch(fe){r(nr(fe,a("toggleFailed")),"error")}finally{ve.current+=1}},ee=async()=>{if(P){ve.current+=1,W(!0);try{await $.deleteAutoDeleteRule(P.id),h(U=>U.filter(fe=>fe.id!==P.id)),ie===String(P.id)&&ae(""),r(a("ruleDeleted"),"success"),G(null)}catch(U){r(nr(U,a("toggleFailed")),"error")}finally{ve.current+=1,W(!1)}}},me=U=>U.chatScope==="groups"?a("chatsGroups"):U.chatScope==="private"?a("chatsPrivate"):a("chatsAll"),te=U=>U.senders.mode==="everyone"?a("sendersEveryone"):U.senders.list.length===1?a("oneContact"):an(a("sendersCount"),{n:U.senders.list.length});return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Ws,{icon:s.jsx(nh,{size:24}),title:a("autoDelete"),description:a("autoDeleteSubtitle"),actions:s.jsx(ge,{variant:"primary",icon:s.jsx(Fs,{size:16}),onClick:z,children:a("newRule")})}),s.jsx(Nc,{"aria-label":a("autoDelete"),className:"overflow-x-auto",value:o,onChange:d,options:[{value:"rules",label:a("rulesTab")},{value:"copies",label:a("copiesTab")}]}),o==="rules"&&s.jsxs("div",{className:"flex flex-col gap-3",children:[!x&&f.length>0&&s.jsxs(Cc,{children:[s.jsx(Be,{type:"search",name:"q",autoComplete:"off",value:N,onChange:U=>j(U.target.value),placeholder:a("searchRules"),"aria-label":a("searchRules"),className:"min-w-48 flex-1"}),s.jsx(xv,{label:a("sort"),value:T,onChange:D,options:[{value:"newest",label:a("sortNewest")},{value:"name",label:a("sortByName")},{value:"deleted",label:a("sortMostDeleted")},{value:"last",label:a("sortLastDeleted")}]}),s.jsxs(jc,{label:a("filter"),resetLabel:a("reset"),activeCount:rN(Z),onReset:()=>ne(_y),children:[s.jsx(or,{label:a("filterStatus"),name:"ad-status",value:Z.enabled,onChange:U=>ne(fe=>({...fe,enabled:U})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(or,{label:a("filterChat"),name:"ad-scope",value:Z.chatScope,onChange:U=>ne(fe=>({...fe,chatScope:U})),options:[{value:"any",label:a("statusAny")},{value:"all",label:a("chatsAll")},{value:"groups",label:a("chatsGroups")},{value:"private",label:a("chatsPrivate")}]}),s.jsx(or,{label:a("filterSender"),name:"ad-senders",value:Z.senders,onChange:U=>ne(fe=>({...fe,senders:U})),options:[{value:"any",label:a("statusAny")},{value:"everyone",label:a("sendersEveryone")},{value:"selected",label:a("sendersSelected")}]})]})]}),x&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(U=>s.jsxs(at,{className:"flex flex-col gap-3",children:[s.jsx(Is,{className:"h-5 w-40"}),s.jsx(Is,{className:"h-6 w-full"}),s.jsx(Is,{className:"h-8 w-24"})]},U))}),!x&&y&&f.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-10",children:[s.jsx("p",{role:"alert",className:"text-sm text-danger",children:y}),s.jsx(ge,{onClick:()=>_(U=>U+1),children:a("retryLoad")})]}),!x&&!y&&f.length===0&&s.jsx(Sn,{icon:s.jsx(nh,{size:28}),title:a("noRulesTitle"),description:a("noRulesBody"),action:s.jsx(ge,{variant:"primary",icon:s.jsx(Fs,{size:16}),onClick:z,children:a("newRule")})}),!x&&f.length>0&&ke.length===0&&s.jsx(Sn,{title:a("noRulesMatch")}),!x&&ke.length>0&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:ke.map(U=>{const fe=Js(U),Te=Math.max(0,U.keywords.length-Ay);return s.jsxs(at,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("h3",{dir:"auto",className:"min-w-0 flex-1 truncate text-sm font-bold",children:fe||"—"}),s.jsx(Zn,{checked:U.enabled,"aria-label":a("ruleEnabled"),onChange:De=>void de(U,De)}),s.jsxs(La,{label:a("more"),children:[s.jsx(ot,{icon:s.jsx(cb,{size:16}),onSelect:()=>{A(U),I(!0)},children:a("edit")}),s.jsx(ot,{icon:s.jsx(yb,{size:16}),onSelect:()=>void ue(U),children:a("resetCounter")}),U.keepCopy&&s.jsx(ot,{icon:s.jsx(ha,{size:16}),onSelect:()=>{ae(String(U.id)),d("copies")},children:a("viewCopies")}),s.jsx(ot,{danger:!0,icon:s.jsx(hl,{size:16}),onSelect:()=>G(U),children:a("delete")})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[U.keywords.slice(0,Ay).map(De=>s.jsx(kc,{children:De},De)),Te>0&&s.jsx(vt,{children:an(a("moreKeywords"),{n:Te})})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(vt,{children:a(mN[U.match])}),s.jsx(vt,{children:me(U)}),s.jsx(vt,{children:te(U)})]}),s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[s.jsx("span",{className:"text-2xl font-bold tabular-nums text-text-main",children:K.format(U.deletedCount)}),s.jsx("span",{className:"text-xs text-muted",children:a("deletedLabel")}),s.jsx("span",{className:"ms-auto text-xs text-muted",children:U.lastDeletedAt?s.jsxs(s.Fragment,{children:[a("lastDeleted")," ",s.jsx(mv,{value:U.lastDeletedAt})]}):a("neverDeleted")})]})]},U.id)})})]}),o==="copies"&&s.jsx(oN,{rules:f,names:g,ruleId:ie,onRuleIdChange:ae}),s.jsx(hN,{open:pe,rule:w,names:g,onClose:()=>I(!1),onSaved:U=>{ve.current+=1,h(fe=>{const Te=fe.findIndex(Ge=>Ge.id===U.id);if(Te===-1)return[U,...fe];const De=fe.slice();return De[Te]=U,De}),r(a("ruleSaved"),"success"),I(!1)}}),s.jsx(dv,{isOpen:P!==null,onClose:()=>G(null),onConfirm:()=>void ee(),title:a("deleteRuleTitle"),description:s.jsx("span",{dir:"auto",children:an(a("deleteRuleBody"),{name:P?Js(P):""})}),confirmLabel:a("delete"),cancelLabel:a("cancel"),loading:q})]})},gN=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],Ty=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,xN=()=>{const{t:a,language:i}=Ze(),{toast:r}=qt(),[o,d]=v.useState([]),[f,h]=v.useState(gN),[g,p]=v.useState("!"),[x,b]=v.useState(!1),[y,k]=v.useState("!"),[E,_]=v.useState(""),[N,j]=v.useState(!0),[T,D]=v.useState(null),[Z,ne]=v.useState([]),[pe,I]=v.useState(""),[M,A]=v.useState(!1),P=async()=>{try{const w=await $.getCommands();w!=null&&w.commands&&d(w.commands),w!=null&&w.prefix&&(p(w.prefix),k(w.prefix)),Array.isArray(w==null?void 0:w.levels)&&w.levels.length&&h(w.levels)}catch(w){r(w.message,"error")}finally{j(!1)}};v.useEffect(()=>{P()},[]);const G=async()=>{const w=y.trim();if(!w||w.length>3){r(a("prefixValidation"),"error");return}try{await $.updatePrefix(w),p(w),b(!1),r(`${a("prefixUpdated")} (${w})`,"success")}catch(z){r(z.message,"error")}},q=async(w,z)=>{d(de=>de.map(ue=>ue.name===w.name?{...ue,enabled:z,overridden:!0}:ue));try{await $.updateCommand(w.name,{enabled:z}),r(a(z?"commandEnabled":"commandDisabled").replace("{name}",w.name),"success")}catch(de){r(de.message,"error"),P()}},W=async(w,z)=>{await $.updateCommand(w.name,{permission:z}),d(de=>de.map(ue=>ue.name===w.name?{...ue,permission:z,overridden:!0}:ue))},ie=w=>{D(w),ne(Array.isArray(w.aliases)?[...w.aliases]:[]),I("")},ae=()=>{const w=pe.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(w){if(Z.includes(w)){r(a("aliasAlreadyAdded"),"warning");return}ne([...Z,w]),I("")}},Q=w=>{ne(Z.filter(z=>z!==w))},V=async()=>{if(T){A(!0);try{await $.updateCommand(T.name,{aliases:Z}),d(w=>w.map(z=>z.name===T.name?{...z,aliases:Z}:z)),r(a("savedSuccessfully"),"success"),D(null)}catch(w){r(w.message,"error")}finally{A(!1)}}},le=w=>{var z;return((z=w.descriptions)==null?void 0:z[i])||w.description||""},he=w=>{var z;return((z=w.usages)==null?void 0:z[i])||w.usage||""},ve=w=>he(w).split(`
|
|
505
|
-
`).map(z=>z.trim()).filter(Boolean).map(z=>`${g}${z}`),K=w=>({MEMBERS:a("permMembers"),ALL:a("permMembers"),ADMINS_ONLY:a("permAdminsOnly"),ADMINS_OWNER:a("permAdminsOwner"),OWNER_ONLY:a("permOwnerOnly")})[w]||w,X=w=>({all:a("scopeAll"),group:a("scopeGroup"),private:a("scopePrivate")})[w]||w,xe=E.trim().toLowerCase(),ke=xe?o.filter(w=>{var z,de;return[w.name,...w.aliases||[],le(w),w.description,he(w),(z=w.usages)==null?void 0:z.en,(de=w.usages)==null?void 0:de.ar].filter(Boolean).join(" ").toLowerCase().includes(xe)}):o;return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs(at,{className:"flex flex-col justify-between gap-4 md:flex-row md:items-center",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:a("commands")}),s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-xl border border-line bg-panel-raised",children:[s.jsxs("span",{className:"text-xs text-muted font-semibold",children:[a("activePrefix"),":"]}),x?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Be,{type:"text",maxLength:3,value:y,onChange:w=>k(w.target.value),className:"w-14 text-center font-mono",onKeyDown:w=>{w.key==="Enter"&&G(),w.key==="Escape"&&b(!1)}}),s.jsx(ge,{variant:"primary",size:"sm",onClick:G,children:a("save")}),s.jsx(ge,{variant:"secondary",size:"sm",onClick:()=>b(!1),children:a("cancel")})]}):s.jsx(ge,{variant:"ghost",size:"sm",title:a("editPrefixHint"),onClick:()=>{k(g),b(!0)},children:g})]})]}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-1",children:a("commandsSub")})]}),s.jsxs("div",{className:"relative w-full md:w-72 shrink-0",children:[s.jsx(bh,{size:18,className:"pointer-events-none absolute start-3.5 top-3 text-muted"}),s.jsx(Be,{type:"text",className:"ps-10",placeholder:a("searchPlaceholder"),value:E,onChange:w=>_(w.target.value)})]})]}),s.jsx(at,{padded:!1,className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[760px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3.5 text-start",children:a("thCommand")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:a("thAliases")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:a("thDescription")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:a("thScope")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:a("thRequiredRole")}),s.jsx("th",{className:"px-4 py-3.5 text-center",children:a("thStatus")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:N?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"py-12 text-center",children:s.jsx(Oa,{className:"size-6",label:a("loading")})})}):ke.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(Sn,{text:a("noMatchingCommands")})})}):ke.map(w=>{var z;return s.jsxs("tr",{className:"hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-4 py-3.5 font-mono font-bold text-brand-cyan",children:s.jsxs("bdi",{children:[g,w.name]})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[(z=w.aliases)!=null&&z.length?w.aliases.map(de=>{const ue=Ty.test(de),ee=ue!==(i==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] px-2 py-0.5 rounded-md bg-panel-raised border border-line text-muted",title:ee?a(ue?"aliasScriptArabic":"aliasScriptLatin"):void 0,children:[s.jsxs("bdi",{children:[g,de]}),ee&&s.jsx("span",{className:"font-sans font-bold text-[9px] uppercase tracking-wide text-brand-cyan/80",children:ue?"AR":"EN"})]},de)}):s.jsx("span",{className:"text-xs text-faint",children:"—"}),s.jsx(Le,{label:a("editAliases"),icon:s.jsx(Ow,{size:16}),size:"sm",onClick:()=>ie(w)})]})}),s.jsxs("td",{className:"px-4 py-3.5 max-w-xs text-text-main text-xs md:text-sm",children:[le(w),ve(w).length>0&&s.jsx("ul",{className:"mt-1.5 flex flex-col gap-0.5 list-none","aria-label":a("usage"),title:a("usageHint"),children:ve(w).map(de=>s.jsx("li",{children:s.jsx("code",{className:"font-mono text-[11px] text-muted bg-panel-raised border border-line rounded px-1.5 py-0.5 w-fit max-w-full overflow-x-auto",children:s.jsx("bdi",{children:de})})},de))})]}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx(vt,{tone:"info",children:X(w.chat)})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx(yN,{command:w,levels:f,permissionLabel:K,ariaLabel:a("thRequiredRole"),saveLabel:a("save"),savedLabel:a("saved"),onSave:W})}),s.jsx("td",{className:"px-4 py-3.5 text-center",children:s.jsx(Zn,{checked:w.enabled,onChange:de=>q(w,de)})})]},w.name)})})]})}),s.jsx(en,{isOpen:!!T,onClose:()=>D(null),title:`${a("aliasesFor")} ${g}${(T==null?void 0:T.name)||""}`,footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:()=>D(null),children:a("cancel")}),s.jsx(ge,{variant:"primary",onClick:V,loading:M,children:a(M?"saving":"save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted",children:a("aliasesHelp")}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"text-xs font-bold text-muted block",children:a("thAliases")}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap min-h-[42px] p-2 rounded-xl border border-line bg-panel-raised",children:Z.length>0?Z.map(w=>{const z=Ty.test(w),de=z!==(i==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-panel border border-line text-xs font-mono font-bold text-text-main",title:de?a(z?"aliasScriptArabic":"aliasScriptLatin"):void 0,children:[s.jsxs("bdi",{children:[g,w]}),de&&s.jsx("span",{className:"font-sans font-bold text-[9px] uppercase tracking-wide text-brand-cyan/80",children:z?"AR":"EN"}),s.jsx(Le,{variant:"ghost",size:"sm",label:a("delete"),icon:s.jsx(Da,{size:16}),onClick:()=>Q(w)})]},w)}):s.jsx("span",{className:"text-xs text-faint px-1",children:a("noAliases")})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-alias-input",className:"text-xs font-bold text-muted block",children:a("addAlias")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Gw,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Be,{id:"new-alias-input",type:"text",value:pe,onChange:w=>I(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),ae())},placeholder:a("newAliasPlaceholder"),className:"ps-10"})]}),s.jsx(ge,{variant:"secondary",icon:s.jsx(Fs,{size:16}),onClick:ae,className:"shrink-0",children:a("add")})]})]})]})})]})};function yN({command:a,levels:i,permissionLabel:r,ariaLabel:o,saveLabel:d,savedLabel:f,onSave:h}){const g=Tn(a.permission);return s.jsx(zn,{dirty:g.dirty,saving:g.status==="saving",justSaved:g.status==="saved",error:g.error,onSave:()=>g.save(p=>h(a,p)),onRevert:g.revert,saveLabel:d,savedLabel:f,children:s.jsx(Ht,{"aria-label":o,value:g.value,onChange:p=>g.setValue(p.target.value),children:i.map(p=>s.jsx("option",{value:p,children:r(p)},p))})})}var Ps={},jf,zy;function bN(){return zy||(zy=1,jf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),jf}var Nf={},ul={},My;function Xl(){if(My)return ul;My=1;let a;const i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ul.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},ul.getSymbolTotalCodewords=function(o){return i[o]},ul.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},ul.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');a=o},ul.isKanjiModeEnabled=function(){return typeof a<"u"},ul.toSJIS=function(o){return a(o)},ul}var Cf={},Ry;function Dh(){return Ry||(Ry=1,(function(a){a.L={bit:1},a.M={bit:0},a.Q={bit:3},a.H={bit:2};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return a.L;case"m":case"medium":return a.M;case"q":case"quartile":return a.Q;case"h":case"high":return a.H;default:throw new Error("Unknown EC Level: "+r)}}a.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},a.from=function(o,d){if(a.isValid(o))return o;try{return i(o)}catch{return d}}})(Cf)),Cf}var Ef,Dy;function vN(){if(Dy)return Ef;Dy=1;function a(){this.buffer=[],this.length=0}return a.prototype={get:function(i){const r=Math.floor(i/8);return(this.buffer[r]>>>7-i%8&1)===1},put:function(i,r){for(let o=0;o<r;o++)this.putBit((i>>>r-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),i&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Ef=a,Ef}var _f,Oy;function SN(){if(Oy)return _f;Oy=1;function a(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}return a.prototype.set=function(i,r,o,d){const f=i*this.size+r;this.data[f]=o,d&&(this.reservedBit[f]=!0)},a.prototype.get=function(i,r){return this.data[i*this.size+r]},a.prototype.xor=function(i,r,o){this.data[i*this.size+r]^=o},a.prototype.isReserved=function(i,r){return this.reservedBit[i*this.size+r]},_f=a,_f}var Af={},Ly;function wN(){return Ly||(Ly=1,(function(a){const i=Xl().getSymbolSize;a.getRowColCoords=function(o){if(o===1)return[];const d=Math.floor(o/7)+2,f=i(o),h=f===145?26:Math.ceil((f-13)/(2*d-2))*2,g=[f-7];for(let p=1;p<d-1;p++)g[p]=g[p-1]-h;return g.push(6),g.reverse()},a.getPositions=function(o){const d=[],f=a.getRowColCoords(o),h=f.length;for(let g=0;g<h;g++)for(let p=0;p<h;p++)g===0&&p===0||g===0&&p===h-1||g===h-1&&p===0||d.push([f[g],f[p]]);return d}})(Af)),Af}var Tf={},Uy;function kN(){if(Uy)return Tf;Uy=1;const a=Xl().getSymbolSize,i=7;return Tf.getPositions=function(o){const d=a(o);return[[0,0],[d-i,0],[0,d-i]]},Tf}var zf={},By;function jN(){return By||(By=1,(function(a){a.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};a.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},a.from=function(d){return a.isValid(d)?parseInt(d,10):void 0},a.getPenaltyN1=function(d){const f=d.size;let h=0,g=0,p=0,x=null,b=null;for(let y=0;y<f;y++){g=p=0,x=b=null;for(let k=0;k<f;k++){let E=d.get(y,k);E===x?g++:(g>=5&&(h+=i.N1+(g-5)),x=E,g=1),E=d.get(k,y),E===b?p++:(p>=5&&(h+=i.N1+(p-5)),b=E,p=1)}g>=5&&(h+=i.N1+(g-5)),p>=5&&(h+=i.N1+(p-5))}return h},a.getPenaltyN2=function(d){const f=d.size;let h=0;for(let g=0;g<f-1;g++)for(let p=0;p<f-1;p++){const x=d.get(g,p)+d.get(g,p+1)+d.get(g+1,p)+d.get(g+1,p+1);(x===4||x===0)&&h++}return h*i.N2},a.getPenaltyN3=function(d){const f=d.size;let h=0,g=0,p=0;for(let x=0;x<f;x++){g=p=0;for(let b=0;b<f;b++)g=g<<1&2047|d.get(x,b),b>=10&&(g===1488||g===93)&&h++,p=p<<1&2047|d.get(b,x),b>=10&&(p===1488||p===93)&&h++}return h*i.N3},a.getPenaltyN4=function(d){let f=0;const h=d.data.length;for(let p=0;p<h;p++)f+=d.data[p];return Math.abs(Math.ceil(f*100/h/5)-10)*i.N4};function r(o,d,f){switch(o){case a.Patterns.PATTERN000:return(d+f)%2===0;case a.Patterns.PATTERN001:return d%2===0;case a.Patterns.PATTERN010:return f%3===0;case a.Patterns.PATTERN011:return(d+f)%3===0;case a.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case a.Patterns.PATTERN101:return d*f%2+d*f%3===0;case a.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case a.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}a.applyMask=function(d,f){const h=f.size;for(let g=0;g<h;g++)for(let p=0;p<h;p++)f.isReserved(p,g)||f.xor(p,g,r(d,p,g))},a.getBestMask=function(d,f){const h=Object.keys(a.Patterns).length;let g=0,p=1/0;for(let x=0;x<h;x++){f(x),a.applyMask(x,d);const b=a.getPenaltyN1(d)+a.getPenaltyN2(d)+a.getPenaltyN3(d)+a.getPenaltyN4(d);a.applyMask(x,d),b<p&&(p=b,g=x)}return g}})(zf)),zf}var $o={},Hy;function Rv(){if(Hy)return $o;Hy=1;const a=Dh(),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return $o.getBlocksCount=function(d,f){switch(f){case a.L:return i[(d-1)*4+0];case a.M:return i[(d-1)*4+1];case a.Q:return i[(d-1)*4+2];case a.H:return i[(d-1)*4+3];default:return}},$o.getTotalCodewordsCount=function(d,f){switch(f){case a.L:return r[(d-1)*4+0];case a.M:return r[(d-1)*4+1];case a.Q:return r[(d-1)*4+2];case a.H:return r[(d-1)*4+3];default:return}},$o}var Mf={},ar={},qy;function NN(){if(qy)return ar;qy=1;const a=new Uint8Array(512),i=new Uint8Array(256);return(function(){let o=1;for(let d=0;d<255;d++)a[d]=o,i[o]=d,o<<=1,o&256&&(o^=285);for(let d=255;d<512;d++)a[d]=a[d-255]})(),ar.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},ar.exp=function(o){return a[o]},ar.mul=function(o,d){return o===0||d===0?0:a[i[o]+i[d]]},ar}var Py;function CN(){return Py||(Py=1,(function(a){const i=NN();a.mul=function(o,d){const f=new Uint8Array(o.length+d.length-1);for(let h=0;h<o.length;h++)for(let g=0;g<d.length;g++)f[h+g]^=i.mul(o[h],d[g]);return f},a.mod=function(o,d){let f=new Uint8Array(o);for(;f.length-d.length>=0;){const h=f[0];for(let p=0;p<d.length;p++)f[p]^=i.mul(d[p],h);let g=0;for(;g<f.length&&f[g]===0;)g++;f=f.slice(g)}return f},a.generateECPolynomial=function(o){let d=new Uint8Array([1]);for(let f=0;f<o;f++)d=a.mul(d,new Uint8Array([1,i.exp(f)]));return d}})(Mf)),Mf}var Rf,Gy;function EN(){if(Gy)return Rf;Gy=1;const a=CN();function i(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(o){this.degree=o,this.genPoly=a.generateECPolynomial(this.degree)},i.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(o.length+this.degree);d.set(o);const f=a.mod(d,this.genPoly),h=this.degree-f.length;if(h>0){const g=new Uint8Array(this.degree);return g.set(f,h),g}return f},Rf=i,Rf}var Df={},Of={},Lf={},Vy;function Dv(){return Vy||(Vy=1,Lf.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),Lf}var ua={},Yy;function Ov(){if(Yy)return ua;Yy=1;const a="[0-9]+",i="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
|
506
|
-
]))+`;ua.KANJI=new RegExp(r,"g"),ua.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ua.BYTE=new RegExp(o,"g"),ua.NUMERIC=new RegExp(a,"g"),ua.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+r+"$"),f=new RegExp("^"+a+"$"),h=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ua.testKanji=function(p){return d.test(p)},ua.testNumeric=function(p){return f.test(p)},ua.testAlphanumeric=function(p){return h.test(p)},ua}var Iy;function Zl(){return Iy||(Iy=1,(function(a){const i=Dv(),r=Ov();a.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},a.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},a.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},a.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},a.MIXED={bit:-1},a.getCharCountIndicator=function(f,h){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!i.isValid(h))throw new Error("Invalid version: "+h);return h>=1&&h<10?f.ccBits[0]:h<27?f.ccBits[1]:f.ccBits[2]},a.getBestModeForData=function(f){return r.testNumeric(f)?a.NUMERIC:r.testAlphanumeric(f)?a.ALPHANUMERIC:r.testKanji(f)?a.KANJI:a.BYTE},a.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},a.isValid=function(f){return f&&f.bit&&f.ccBits};function o(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return a.NUMERIC;case"alphanumeric":return a.ALPHANUMERIC;case"kanji":return a.KANJI;case"byte":return a.BYTE;default:throw new Error("Unknown mode: "+d)}}a.from=function(f,h){if(a.isValid(f))return f;try{return o(f)}catch{return h}}})(Of)),Of}var Ky;function _N(){return Ky||(Ky=1,(function(a){const i=Xl(),r=Rv(),o=Dh(),d=Zl(),f=Dv(),h=7973,g=i.getBCHDigit(h);function p(k,E,_){for(let N=1;N<=40;N++)if(E<=a.getCapacity(N,_,k))return N}function x(k,E){return d.getCharCountIndicator(k,E)+4}function b(k,E){let _=0;return k.forEach(function(N){const j=x(N.mode,E);_+=j+N.getBitsLength()}),_}function y(k,E){for(let _=1;_<=40;_++)if(b(k,_)<=a.getCapacity(_,E,d.MIXED))return _}a.from=function(E,_){return f.isValid(E)?parseInt(E,10):_},a.getCapacity=function(E,_,N){if(!f.isValid(E))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=d.BYTE);const j=i.getSymbolTotalCodewords(E),T=r.getTotalCodewordsCount(E,_),D=(j-T)*8;if(N===d.MIXED)return D;const Z=D-x(N,E);switch(N){case d.NUMERIC:return Math.floor(Z/10*3);case d.ALPHANUMERIC:return Math.floor(Z/11*2);case d.KANJI:return Math.floor(Z/13);case d.BYTE:default:return Math.floor(Z/8)}},a.getBestVersionForData=function(E,_){let N;const j=o.from(_,o.M);if(Array.isArray(E)){if(E.length>1)return y(E,j);if(E.length===0)return 1;N=E[0]}else N=E;return p(N.mode,N.getLength(),j)},a.getEncodedBits=function(E){if(!f.isValid(E)||E<7)throw new Error("Invalid QR Code version");let _=E<<12;for(;i.getBCHDigit(_)-g>=0;)_^=h<<i.getBCHDigit(_)-g;return E<<12|_}})(Df)),Df}var Uf={},Fy;function AN(){if(Fy)return Uf;Fy=1;const a=Xl(),i=1335,r=21522,o=a.getBCHDigit(i);return Uf.getEncodedBits=function(f,h){const g=f.bit<<3|h;let p=g<<10;for(;a.getBCHDigit(p)-o>=0;)p^=i<<a.getBCHDigit(p)-o;return(g<<10|p)^r},Uf}var Bf={},Hf,Qy;function TN(){if(Qy)return Hf;Qy=1;const a=Zl();function i(r){this.mode=a.NUMERIC,this.data=r.toString()}return i.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let d,f,h;for(d=0;d+3<=this.data.length;d+=3)f=this.data.substr(d,3),h=parseInt(f,10),o.put(h,10);const g=this.data.length-d;g>0&&(f=this.data.substr(d),h=parseInt(f,10),o.put(h,g*3+1))},Hf=i,Hf}var qf,Xy;function zN(){if(Xy)return qf;Xy=1;const a=Zl(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(o){this.mode=a.ALPHANUMERIC,this.data=o}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let f;for(f=0;f+2<=this.data.length;f+=2){let h=i.indexOf(this.data[f])*45;h+=i.indexOf(this.data[f+1]),d.put(h,11)}this.data.length%2&&d.put(i.indexOf(this.data[f]),6)},qf=r,qf}var Pf,Zy;function MN(){if(Zy)return Pf;Zy=1;const a=Zl();function i(r){this.mode=a.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return i.getBitsLength=function(o){return o*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){for(let o=0,d=this.data.length;o<d;o++)r.put(this.data[o],8)},Pf=i,Pf}var Gf,Jy;function RN(){if(Jy)return Gf;Jy=1;const a=Zl(),i=Xl();function r(o){this.mode=a.KANJI,this.data=o}return r.getBitsLength=function(d){return d*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let d;for(d=0;d<this.data.length;d++){let f=i.toSJIS(this.data[d]);if(f>=33088&&f<=40956)f-=33088;else if(f>=57408&&f<=60351)f-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+`
|
|
507
|
-
Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},Gf=r,Gf}var Vf={exports:{}},$y;function DN(){return $y||($y=1,(function(a){var i={single_source_shortest_paths:function(r,o,d){var f={},h={};h[o]=0;var g=i.PriorityQueue.make();g.push(o,0);for(var p,x,b,y,k,E,_,N,j;!g.empty();){p=g.pop(),x=p.value,y=p.cost,k=r[x]||{};for(b in k)k.hasOwnProperty(b)&&(E=k[b],_=y+E,N=h[b],j=typeof h[b]>"u",(j||N>_)&&(h[b]=_,g.push(b,_),f[b]=x))}if(typeof d<"u"&&typeof h[d]>"u"){var T=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(T)}return f},extract_shortest_path_from_predecessor_list:function(r,o){for(var d=[],f=o;f;)d.push(f),r[f],f=r[f];return d.reverse(),d},find_path:function(r,o,d){var f=i.single_source_shortest_paths(r,o,d);return i.extract_shortest_path_from_predecessor_list(f,d)},PriorityQueue:{make:function(r){var o=i.PriorityQueue,d={},f;r=r||{};for(f in o)o.hasOwnProperty(f)&&(d[f]=o[f]);return d.queue=[],d.sorter=r.sorter||o.default_sorter,d},default_sorter:function(r,o){return r.cost-o.cost},push:function(r,o){var d={value:r,cost:o};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};a.exports=i})(Vf)),Vf.exports}var Wy;function ON(){return Wy||(Wy=1,(function(a){const i=Zl(),r=TN(),o=zN(),d=MN(),f=RN(),h=Ov(),g=Xl(),p=DN();function x(T){return unescape(encodeURIComponent(T)).length}function b(T,D,Z){const ne=[];let pe;for(;(pe=T.exec(Z))!==null;)ne.push({data:pe[0],index:pe.index,mode:D,length:pe[0].length});return ne}function y(T){const D=b(h.NUMERIC,i.NUMERIC,T),Z=b(h.ALPHANUMERIC,i.ALPHANUMERIC,T);let ne,pe;return g.isKanjiModeEnabled()?(ne=b(h.BYTE,i.BYTE,T),pe=b(h.KANJI,i.KANJI,T)):(ne=b(h.BYTE_KANJI,i.BYTE,T),pe=[]),D.concat(Z,ne,pe).sort(function(M,A){return M.index-A.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function k(T,D){switch(D){case i.NUMERIC:return r.getBitsLength(T);case i.ALPHANUMERIC:return o.getBitsLength(T);case i.KANJI:return f.getBitsLength(T);case i.BYTE:return d.getBitsLength(T)}}function E(T){return T.reduce(function(D,Z){const ne=D.length-1>=0?D[D.length-1]:null;return ne&&ne.mode===Z.mode?(D[D.length-1].data+=Z.data,D):(D.push(Z),D)},[])}function _(T){const D=[];for(let Z=0;Z<T.length;Z++){const ne=T[Z];switch(ne.mode){case i.NUMERIC:D.push([ne,{data:ne.data,mode:i.ALPHANUMERIC,length:ne.length},{data:ne.data,mode:i.BYTE,length:ne.length}]);break;case i.ALPHANUMERIC:D.push([ne,{data:ne.data,mode:i.BYTE,length:ne.length}]);break;case i.KANJI:D.push([ne,{data:ne.data,mode:i.BYTE,length:x(ne.data)}]);break;case i.BYTE:D.push([{data:ne.data,mode:i.BYTE,length:x(ne.data)}])}}return D}function N(T,D){const Z={},ne={start:{}};let pe=["start"];for(let I=0;I<T.length;I++){const M=T[I],A=[];for(let P=0;P<M.length;P++){const G=M[P],q=""+I+P;A.push(q),Z[q]={node:G,lastCount:0},ne[q]={};for(let W=0;W<pe.length;W++){const ie=pe[W];Z[ie]&&Z[ie].node.mode===G.mode?(ne[ie][q]=k(Z[ie].lastCount+G.length,G.mode)-k(Z[ie].lastCount,G.mode),Z[ie].lastCount+=G.length):(Z[ie]&&(Z[ie].lastCount=G.length),ne[ie][q]=k(G.length,G.mode)+4+i.getCharCountIndicator(G.mode,D))}}pe=A}for(let I=0;I<pe.length;I++)ne[pe[I]].end=0;return{map:ne,table:Z}}function j(T,D){let Z;const ne=i.getBestModeForData(T);if(Z=i.from(D,ne),Z!==i.BYTE&&Z.bit<ne.bit)throw new Error('"'+T+'" cannot be encoded with mode '+i.toString(Z)+`.
|
|
508
|
-
Suggested mode is: `+i.toString(ne));switch(Z===i.KANJI&&!g.isKanjiModeEnabled()&&(Z=i.BYTE),Z){case i.NUMERIC:return new r(T);case i.ALPHANUMERIC:return new o(T);case i.KANJI:return new f(T);case i.BYTE:return new d(T)}}a.fromArray=function(D){return D.reduce(function(Z,ne){return typeof ne=="string"?Z.push(j(ne,null)):ne.data&&Z.push(j(ne.data,ne.mode)),Z},[])},a.fromString=function(D,Z){const ne=y(D,g.isKanjiModeEnabled()),pe=_(ne),I=N(pe,Z),M=p.find_path(I.map,"start","end"),A=[];for(let P=1;P<M.length-1;P++)A.push(I.table[M[P]].node);return a.fromArray(E(A))},a.rawSplit=function(D){return a.fromArray(y(D,g.isKanjiModeEnabled()))}})(Bf)),Bf}var e0;function LN(){if(e0)return Nf;e0=1;const a=Xl(),i=Dh(),r=vN(),o=SN(),d=wN(),f=kN(),h=jN(),g=Rv(),p=EN(),x=_N(),b=AN(),y=Zl(),k=ON();function E(I,M){const A=I.size,P=f.getPositions(M);for(let G=0;G<P.length;G++){const q=P[G][0],W=P[G][1];for(let ie=-1;ie<=7;ie++)if(!(q+ie<=-1||A<=q+ie))for(let ae=-1;ae<=7;ae++)W+ae<=-1||A<=W+ae||(ie>=0&&ie<=6&&(ae===0||ae===6)||ae>=0&&ae<=6&&(ie===0||ie===6)||ie>=2&&ie<=4&&ae>=2&&ae<=4?I.set(q+ie,W+ae,!0,!0):I.set(q+ie,W+ae,!1,!0))}}function _(I){const M=I.size;for(let A=8;A<M-8;A++){const P=A%2===0;I.set(A,6,P,!0),I.set(6,A,P,!0)}}function N(I,M){const A=d.getPositions(M);for(let P=0;P<A.length;P++){const G=A[P][0],q=A[P][1];for(let W=-2;W<=2;W++)for(let ie=-2;ie<=2;ie++)W===-2||W===2||ie===-2||ie===2||W===0&&ie===0?I.set(G+W,q+ie,!0,!0):I.set(G+W,q+ie,!1,!0)}}function j(I,M){const A=I.size,P=x.getEncodedBits(M);let G,q,W;for(let ie=0;ie<18;ie++)G=Math.floor(ie/3),q=ie%3+A-8-3,W=(P>>ie&1)===1,I.set(G,q,W,!0),I.set(q,G,W,!0)}function T(I,M,A){const P=I.size,G=b.getEncodedBits(M,A);let q,W;for(q=0;q<15;q++)W=(G>>q&1)===1,q<6?I.set(q,8,W,!0):q<8?I.set(q+1,8,W,!0):I.set(P-15+q,8,W,!0),q<8?I.set(8,P-q-1,W,!0):q<9?I.set(8,15-q-1+1,W,!0):I.set(8,15-q-1,W,!0);I.set(P-8,8,1,!0)}function D(I,M){const A=I.size;let P=-1,G=A-1,q=7,W=0;for(let ie=A-1;ie>0;ie-=2)for(ie===6&&ie--;;){for(let ae=0;ae<2;ae++)if(!I.isReserved(G,ie-ae)){let Q=!1;W<M.length&&(Q=(M[W]>>>q&1)===1),I.set(G,ie-ae,Q),q--,q===-1&&(W++,q=7)}if(G+=P,G<0||A<=G){G-=P,P=-P;break}}}function Z(I,M,A){const P=new r;A.forEach(function(ae){P.put(ae.mode.bit,4),P.put(ae.getLength(),y.getCharCountIndicator(ae.mode,I)),ae.write(P)});const G=a.getSymbolTotalCodewords(I),q=g.getTotalCodewordsCount(I,M),W=(G-q)*8;for(P.getLengthInBits()+4<=W&&P.put(0,4);P.getLengthInBits()%8!==0;)P.putBit(0);const ie=(W-P.getLengthInBits())/8;for(let ae=0;ae<ie;ae++)P.put(ae%2?17:236,8);return ne(P,I,M)}function ne(I,M,A){const P=a.getSymbolTotalCodewords(M),G=g.getTotalCodewordsCount(M,A),q=P-G,W=g.getBlocksCount(M,A),ie=P%W,ae=W-ie,Q=Math.floor(P/W),V=Math.floor(q/W),le=V+1,he=Q-V,ve=new p(he);let K=0;const X=new Array(W),xe=new Array(W);let ke=0;const w=new Uint8Array(I.buffer);for(let me=0;me<W;me++){const te=me<ae?V:le;X[me]=w.slice(K,K+te),xe[me]=ve.encode(X[me]),K+=te,ke=Math.max(ke,te)}const z=new Uint8Array(P);let de=0,ue,ee;for(ue=0;ue<ke;ue++)for(ee=0;ee<W;ee++)ue<X[ee].length&&(z[de++]=X[ee][ue]);for(ue=0;ue<he;ue++)for(ee=0;ee<W;ee++)z[de++]=xe[ee][ue];return z}function pe(I,M,A,P){let G;if(Array.isArray(I))G=k.fromArray(I);else if(typeof I=="string"){let Q=M;if(!Q){const V=k.rawSplit(I);Q=x.getBestVersionForData(V,A)}G=k.fromString(I,Q||40)}else throw new Error("Invalid data");const q=x.getBestVersionForData(G,A);if(!q)throw new Error("The amount of data is too big to be stored in a QR Code");if(!M)M=q;else if(M<q)throw new Error(`
|
|
509
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
510
|
-
Minimum version required to store current data is: `+q+`.
|
|
511
|
-
`);const W=Z(M,A,G),ie=a.getSymbolSize(M),ae=new o(ie);return E(ae,M),_(ae),N(ae,M),T(ae,A,0),M>=7&&j(ae,M),D(ae,W),isNaN(P)&&(P=h.getBestMask(ae,T.bind(null,ae,A))),h.applyMask(P,ae),T(ae,A,P),{modules:ae,version:M,errorCorrectionLevel:A,maskPattern:P,segments:G}}return Nf.create=function(M,A){if(typeof M>"u"||M==="")throw new Error("No input text");let P=i.M,G,q;return typeof A<"u"&&(P=i.from(A.errorCorrectionLevel,i.M),G=x.from(A.version),q=h.from(A.maskPattern),A.toSJISFunc&&a.setToSJISFunction(A.toSJISFunc)),pe(M,G,P,q)},Nf}var Yf={},If={},t0;function Lv(){return t0||(t0=1,(function(a){function i(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(f){return[f,f]}))),o.length===6&&o.push("F","F");const d=parseInt(o.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+o.slice(0,6).join("")}}a.getOptions=function(o){o||(o={}),o.color||(o.color={});const d=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,f=o.width&&o.width>=21?o.width:void 0,h=o.scale||4;return{width:f,scale:f?4:h,margin:d,color:{dark:i(o.color.dark||"#000000ff"),light:i(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},a.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},a.getImageWidth=function(o,d){const f=a.getScale(o,d);return Math.floor((o+d.margin*2)*f)},a.qrToImageData=function(o,d,f){const h=d.modules.size,g=d.modules.data,p=a.getScale(h,f),x=Math.floor((h+f.margin*2)*p),b=f.margin*p,y=[f.color.light,f.color.dark];for(let k=0;k<x;k++)for(let E=0;E<x;E++){let _=(k*x+E)*4,N=f.color.light;if(k>=b&&E>=b&&k<x-b&&E<x-b){const j=Math.floor((k-b)/p),T=Math.floor((E-b)/p);N=y[g[j*h+T]?1:0]}o[_++]=N.r,o[_++]=N.g,o[_++]=N.b,o[_]=N.a}}})(If)),If}var n0;function UN(){return n0||(n0=1,(function(a){const i=Lv();function r(d,f,h){d.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=h,f.width=h,f.style.height=h+"px",f.style.width=h+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}a.render=function(f,h,g){let p=g,x=h;typeof p>"u"&&(!h||!h.getContext)&&(p=h,h=void 0),h||(x=o()),p=i.getOptions(p);const b=i.getImageWidth(f.modules.size,p),y=x.getContext("2d"),k=y.createImageData(b,b);return i.qrToImageData(k.data,f,p),r(y,x,b),y.putImageData(k,0,0),x},a.renderToDataURL=function(f,h,g){let p=g;typeof p>"u"&&(!h||!h.getContext)&&(p=h,h=void 0),p||(p={});const x=a.render(f,h,p),b=p.type||"image/png",y=p.rendererOpts||{};return x.toDataURL(b,y.quality)}})(Yf)),Yf}var Kf={},a0;function BN(){if(a0)return Kf;a0=1;const a=Lv();function i(d,f){const h=d.a/255,g=f+'="'+d.hex+'"';return h<1?g+" "+f+'-opacity="'+h.toFixed(2).slice(1)+'"':g}function r(d,f,h){let g=d+f;return typeof h<"u"&&(g+=" "+h),g}function o(d,f,h){let g="",p=0,x=!1,b=0;for(let y=0;y<d.length;y++){const k=Math.floor(y%f),E=Math.floor(y/f);!k&&!x&&(x=!0),d[y]?(b++,y>0&&k>0&&d[y-1]||(g+=x?r("M",k+h,.5+E+h):r("m",p,0),p=0,x=!1),k+1<f&&d[y+1]||(g+=r("h",b),b=0)):p++}return g}return Kf.render=function(f,h,g){const p=a.getOptions(h),x=f.modules.size,b=f.modules.data,y=x+p.margin*2,k=p.color.light.a?"<path "+i(p.color.light,"fill")+' d="M0 0h'+y+"v"+y+'H0z"/>':"",E="<path "+i(p.color.dark,"stroke")+' d="'+o(b,x,p.margin)+'"/>',_='viewBox="0 0 '+y+" "+y+'"',j='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+_+' shape-rendering="crispEdges">'+k+E+`</svg>
|
|
512
|
-
`;return typeof g=="function"&&g(null,j),j},Kf}var l0;function HN(){if(l0)return Ps;l0=1;const a=bN(),i=LN(),r=UN(),o=BN();function d(f,h,g,p,x){const b=[].slice.call(arguments,1),y=b.length,k=typeof b[y-1]=="function";if(!k&&!a())throw new Error("Callback required as last argument");if(k){if(y<2)throw new Error("Too few arguments provided");y===2?(x=g,g=h,h=p=void 0):y===3&&(h.getContext&&typeof x>"u"?(x=p,p=void 0):(x=p,p=g,g=h,h=void 0))}else{if(y<1)throw new Error("Too few arguments provided");return y===1?(g=h,h=p=void 0):y===2&&!h.getContext&&(p=g,g=h,h=void 0),new Promise(function(E,_){try{const N=i.create(g,p);E(f(N,h,p))}catch(N){_(N)}})}try{const E=i.create(g,p);x(null,f(E,h,p))}catch(E){x(E)}}return Ps.create=i.create,Ps.toCanvas=d.bind(null,r.render),Ps.toDataURL=d.bind(null,r.renderToDataURL),Ps.toString=d.bind(null,function(f,h,g){return o.render(f,g)}),Ps}var Uv=HN();const Ff=gh(Uv);function qN(){return typeof window<"u"&&!!window.LevixHost}const PN=({status:a,onRefresh:i,onStatusUpdate:r})=>{var ee;const{t:o,language:d}=Ze(),{toast:f}=qt(),[h,g]=v.useState(!1),[p,x]=v.useState(!1),[b,y]=v.useState(null),[k,E]=v.useState("pairing"),[_,N]=v.useState(""),[j,T]=v.useState(!1),D=(a==null?void 0:a.state)||"idle",Z=D==="connected",ne=D==="waiting_for_qr",pe=D==="starting"||D==="linking",I=D==="reconnecting",M=D==="paused",A=D==="logged_out",P=!!(a!=null&&a.linked)&&!A,G=!P,q=!!(a!=null&&a.canUnlink),W=(a==null?void 0:a.isOnline)!==!1,ie=M||D==="disconnected"||D==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";v.useEffect(()=>{if(a!=null&&a.qr){const me=Uv.toDataURL||(Ff==null?void 0:Ff.toDataURL);if(typeof me=="function"){const te=getComputedStyle(document.documentElement),U=document.documentElement.getAttribute("data-theme")==="light",fe=(U?te.getPropertyValue("--text"):te.getPropertyValue("--bg")).trim(),Te=(U?te.getPropertyValue("--panel"):te.getPropertyValue("--text")).trim();me(a.qr,{width:280,margin:2,color:{dark:fe,light:Te}}).then(De=>y(De)).catch(()=>y(null))}}else y(null)},[a==null?void 0:a.qr]),v.useEffect(()=>{if(ne&&!(a!=null&&a.qr)&&!(a!=null&&a.pairingCode)){const me=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(me)}},[ne,a==null?void 0:a.qr,a==null?void 0:a.pairingCode,i]);const ae=async(me,te)=>{x(!0);try{const U=await me();U&&typeof U=="object"&&"session"in U&&(r==null||r(U.session)),f(te,"success"),await(i==null?void 0:i())}catch(U){f(U instanceof Error?U.message:String(U),"error")}finally{x(!1)}},Q=async me=>{me&&me.preventDefault();const te=_.replace(/\D/g,"");if(!te){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(te.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await ae(()=>$.startSession({method:"pairing",phone:te}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},V=async()=>{await ae(()=>$.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},le=async()=>{await ae($.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),E("pairing")},he=()=>{a!=null&&a.pairingCode&&(navigator.clipboard.writeText(a.pairingCode.replace(/\s+/g,"")),T(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>T(!1),2500))},ve=async()=>{g(!1),await ae($.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},K=(ee=a==null?void 0:a.user)!=null&&ee.id?a.user.id.split("@")[0].split(":")[0]:null,X=qN(),xe={key:"unlink",label:o("unlink"),icon:s.jsx(Vw,{size:16}),danger:!0,onSelect:()=>g(!0)},ke={key:"restart",label:o("restart"),icon:s.jsx(yb,{size:16}),onSelect:()=>ae($.restartBot,o("restart"))},w={key:"reconnect",label:o("reconnect"),icon:s.jsx(Qs,{size:16}),onSelect:()=>ae($.reconnectSession,o("reconnecting"))},z=me=>X?me:[...me,ke],de=z(q?[xe]:[]),ue=me=>{if(me.length===0)return null;if(me.length===1){const te=me[0];return s.jsx(Le,{label:te.label,icon:te.icon,onClick:te.onSelect,disabled:p})}return s.jsx(La,{label:o("moreActions"),children:me.map(te=>s.jsx(ot,{danger:te.danger,icon:te.icon,disabled:p,onSelect:te.onSelect,children:te.label},te.key))})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs(at,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 border ${Z?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":ne?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":pe||I?"bg-brand-blue/15 text-brand-blue border-brand-blue/30 shadow-sm shadow-brand-blue/20":"bg-info/15 text-info border-info/30 shadow-sm shadow-info/20"}`,children:s.jsx(hr,{size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg sm:text-xl font-extrabold text-text-main",children:o("connection")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:Z?o("sessionActive"):M?o("paused"):P?d==="ar"?"جلسة محفوظة — يمكن استئنافها":"Saved session — ready to resume":o("sessionOffline")})]})]}),s.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto",children:s.jsxs("span",{className:`inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-bold border ${Z?"bg-ok/15 text-ok border-ok/30":ne?"bg-warn/15 text-warn border-warn/30":pe||I?"bg-brand-blue/15 text-brand-blue border-brand-blue/30 animate-pulse":"bg-brand-cyan/15 text-brand-cyan border-brand-cyan/30"}`,children:[s.jsx("span",{className:"pulse-dot"}),s.jsx("span",{children:o(D,D)})]})})]}),a!=null&&a.retryInSeconds?s.jsxs("div",{className:"rounded-xl border border-warn/30 bg-warn/10 p-3.5 flex items-center gap-3 text-warn",children:[s.jsx(ir,{size:20,className:"shrink-0"}),s.jsxs("div",{className:"text-xs sm:text-sm",children:[s.jsx("span",{className:"font-bold",children:d==="ar"?"إعادة الاتصال قريباً":"Reconnecting soon"})," ","•"," ",s.jsx("span",{children:d==="ar"?`المحاولة التالية خلال ${a.retryInSeconds} ثانية`:`Next attempt in ${a.retryInSeconds}s`})]})]}):null,Z&&K&&s.jsxs("div",{className:"rounded-xl border border-ok/30 bg-ok/10 p-3.5 sm:p-4 flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-ok/20 text-ok flex items-center justify-center shrink-0",children:s.jsx(Ks,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-xs text-muted font-medium",children:o("connectedNumber")}),s.jsxs("div",{className:"text-sm sm:text-base font-mono font-bold text-text-main",dir:"ltr",children:["+",K]})]})]}),s.jsx(hc,{tone:"ok",className:"shrink-0",children:d==="ar"?"متصل":"Online"})]}),s.jsxs("div",{children:[Z&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(ge,{variant:"danger",icon:s.jsx(ah,{size:16}),onClick:()=>ae($.stopSession,o("stop")),disabled:p,className:"flex-1 sm:flex-none",children:o("stop")}),ue(z([w,xe]))]}),(pe||ne||I)&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(ge,{variant:"danger",icon:s.jsx(ah,{size:16}),onClick:()=>ae($.stopSession,o("stop")),disabled:p,className:"flex-1 sm:flex-none",children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"}),ue(z([]))]}),!Z&&!pe&&!ne&&!I&&P&&s.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xl",children:[M&&s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:W?d==="ar"?"الجلسة محفوظة. اضغط استئناف لإعادة استخدام نفس حساب واتساب.":"This WhatsApp session is saved. Resume to reconnect with the same account.":d==="ar"?"الاتصال متوقف بسبب انقطاع الإنترنت. سيُستأنف تلقائياً عند عودة الشبكة، أو اضغط استئناف.":"Paused while the device is offline. It will resume when the network returns, or tap Resume."}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(ge,{variant:"primary",icon:s.jsx(hr,{size:16}),onClick:()=>ae($.startSession,ie),disabled:p,className:"flex-1 sm:flex-none",children:ie}),ue(de)]})]}),!Z&&!pe&&!ne&&!I&&G&&s.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[s.jsx(Il,{"aria-label":o("connection"),value:k,onChange:E,className:"w-full sm:w-fit",options:[{value:"pairing",label:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)",icon:s.jsx(rr,{size:16})},{value:"qr",label:d==="ar"?"مسح رمز QR":"QR Code Scan",icon:s.jsx(mf,{size:16})}]}),k==="pairing"&&s.jsxs("form",{onSubmit:Q,className:"flex w-full max-w-xl flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Lw,{size:17,className:"absolute top-1/2 -translate-y-1/2 start-3.5 text-muted pointer-events-none"}),s.jsx(Be,{type:"tel",value:_,onChange:me=>N(me.target.value),placeholder:d==="ar"?"201012345678 (مع كود الدولة)":"e.g. 201012345678",dir:"ltr",className:"ps-10"})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(ge,{type:"submit",variant:"primary",icon:s.jsx(th,{size:16}),disabled:p,className:"flex-1 whitespace-nowrap sm:flex-none",children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"}),ue(de)]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:d==="ar"?"💡 أدخل رقم هاتفك مسبوقاً بكود الدولة وبدون 0 في البداية (مثال: 2010... وليس 010...). سيظهر لك كود لإدخاله في واتساب فوراً.":"💡 Enter your number with country code, no leading zeros (e.g. 2010... not 010...). A code will appear to enter into WhatsApp."})]}),k==="qr"&&s.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(ge,{variant:"primary",icon:s.jsx(mf,{size:18}),onClick:V,disabled:p,className:"flex-1 whitespace-nowrap sm:flex-none",children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"}),ue(de)]}),s.jsx("p",{className:"text-xs text-muted",children:d==="ar"?"سيتم إنشاء رمز QR لمسحه من هاتف آخر أو من شاشة الحاسوب عبر كاميرا واتساب.":"Generates a QR code to be scanned using WhatsApp camera on another device or screen."})]})]})]})]}),pe&&s.jsxs(at,{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-blue/15 text-brand-blue flex items-center justify-center mb-4 border border-brand-blue/30",children:s.jsx(Qs,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children:D==="linking"?d==="ar"?"جارٍ إتمام الربط مع الهاتف...":"Finishing link handshake...":d==="ar"?"جارٍ بدء تشغيل الجلسة...":"Initializing WhatsApp session..."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md",children:d==="ar"?"يتم الآن إنشاء مقبس الاتصال، ستظهر بيانات الربط خلال ثوانٍ معدودة.":"Creating connection socket. Pairing details will appear in just a few seconds."})]}),ne&&s.jsx(at,{className:"mx-auto flex w-full max-w-2xl flex-col items-center text-center",children:a!=null&&a.pairingCode?s.jsxs("div",{className:"flex flex-col items-center w-full animate-in fade-in zoom-in-95 duration-300",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(rr,{size:26})}),s.jsx("h3",{className:"text-lg sm:text-xl font-bold text-text-main mb-1.5",children:d==="ar"?"كود الربط الرقمي مع واتساب":"WhatsApp Pairing Code"}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"أدخل هذا الكود في تطبيق واتساب على هاتفك لتأكيد الربط مباشرة.":"Enter this code into WhatsApp on your phone to complete pairing."}),s.jsxs("div",{className:"rounded-2xl border-2 border-brand-cyan/40 bg-brand-cyan/10 p-5 sm:p-6 w-full max-w-md flex flex-col items-center gap-4 shadow-lg shadow-brand-cyan/10",children:[s.jsx("div",{className:"text-xs font-bold text-brand-cyan uppercase tracking-wider",children:d==="ar"?"كود الربط المكون من 8 خانات":"8-Digit Pairing Code"}),s.jsx("div",{className:"text-3xl sm:text-4xl font-mono font-extrabold tracking-widest text-brand-cyan select-all",dir:"ltr",children:a.pairingCode.length===8?`${a.pairingCode.slice(0,4)} - ${a.pairingCode.slice(4)}`:a.pairingCode}),s.jsx(ge,{variant:"primary",icon:j?s.jsx(vc,{size:18}):s.jsx(bw,{size:18}),onClick:he,children:j?d==="ar"?"تم النسخ بنجاح!":"Copied!":d==="ar"?"نسخ كود الربط":"Copy Code"})]}),s.jsxs("div",{className:"mt-6 p-4 rounded-xl border border-line bg-panel-raised text-start w-full max-w-md",children:[s.jsx("div",{className:"text-xs font-bold text-text-main mb-3",children:d==="ar"?"خطوات الإدخال في واتساب:":"Steps to enter in WhatsApp:"}),s.jsxs("ol",{className:"text-xs text-muted space-y-2 list-decimal list-inside leading-relaxed",children:[s.jsx("li",{children:d==="ar"?"افتح تطبيق واتساب على هاتفك.":"Open WhatsApp on your phone."}),s.jsx("li",{children:d==="ar"?"اذهب إلى الإعدادات > الأجهزة المرتبطة > ربط جهاز.":"Go to Settings > Linked Devices > Link a Device."}),s.jsx("li",{children:s.jsx("strong",{className:"text-text-main",children:d==="ar"?"اضغط على «الربط باستخدام رقم الهاتف بدلاً من ذلك» أسفل الشاشة.":"Tap 'Link with phone number instead' at bottom of screen."})}),s.jsx("li",{children:d==="ar"?"اكتب هذا الكود وسيتم ربط البوت مباشرة!":"Enter the code above to connect immediately!"})]})]})]}):b?s.jsxs("div",{className:"flex flex-col items-center w-full",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(mf,{size:26})}),s.jsx("h3",{className:"text-lg font-bold text-text-main mb-1.5",children:o("waiting_for_qr")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"افتح واتساب على هاتفك، اذهب إلى الأجهزة المرتبطة، ثم امسح هذا الرمز للربط.":"Open WhatsApp on your phone, go to Linked Devices, and scan this code to link."}),s.jsx("div",{className:"p-3 sm:p-4 bg-panel rounded-2xl shadow-xl border border-line animate-in fade-in zoom-in-95 duration-300",children:s.jsx("img",{src:b,alt:"WhatsApp QR Code",className:"w-56 h-56 sm:w-64 sm:h-64 block rounded-lg"})}),s.jsxs("div",{className:"mt-6 pt-5 border-t border-line w-full max-w-md flex flex-col items-center gap-2.5",children:[s.jsx("p",{className:"text-xs text-muted text-center",children:d==="ar"?"هل تستخدم التطبيق من نفس الهاتف ولا تستطيع مسح الرمز؟":"Using the app on the same phone and can't scan?"}),s.jsx(ge,{variant:"secondary",icon:s.jsx(rr,{size:16}),onClick:le,disabled:p,className:"w-full",children:d==="ar"?"الربط برقم الهاتف (كود الربط الرقمي) بدلاً من QR":"Link with Phone Pairing Code Instead"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[s.jsx(Oa,{className:"size-8"}),s.jsx("span",{className:"text-xs sm:text-sm font-semibold text-muted animate-pulse",children:d==="ar"?"جارٍ تجهيز بيانات الربط من واتساب...":"Preparing pairing details from WhatsApp..."})]})}),s.jsxs(en,{isOpen:h,onClose:()=>g(!1),title:o("unlink"),footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:()=>g(!1),children:o("cancel")}),s.jsx(ge,{variant:"danger",onClick:ve,children:o("unlink")})]}),children:[s.jsx("p",{className:"text-xs sm:text-sm text-text-main leading-relaxed",children:d==="ar"?"هل أنت متأكد من رغبتك في إلغاء ربط جلسة واتساب الحالية؟ ستحتاج إلى مسح رمز QR جديد أو إدخال كود ربط لإعادة ربط الحساب.":"Are you sure you want to unlink this WhatsApp session? You will need to scan a new QR code or enter a pairing code to reconnect."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed mt-2",children:o("unlinkStickersWarning")})]})]})},GN=()=>{const{t:a}=Ze(),{toast:i}=qt(),[r,o]=v.useState([]),[d,f]=v.useState(!0),h=b=>{var E,_;const y=b.jid||b.id||"",k=typeof b.antilink=="boolean"?b.antilink:!!(b.antilinkEnabled??((E=b.antilink)==null?void 0:E.enabled));return{...b,jid:y,subject:b.subject||"",memberCount:b.memberCount??b.participants??0,antilink:k,antilinkEnabled:k,welcomeEnabled:!!(b.welcomeEnabled??((_=b.welcome_system)==null?void 0:_.enabled)),mediaRestriction:b.mediaRestriction||"none"}},g=async()=>{try{const b=await $.getGroups();b!=null&&b.groups&&o(b.groups.map(h))}catch(b){i(b.message,"error")}finally{f(!1)}};v.useEffect(()=>{g()},[]);const p=async(b,y)=>{o(k=>k.map(E=>E.jid===b?{...E,...y}:E));try{await $.updateGroup(b,y),i(a("savedSuccessfully"),"success")}catch(k){i(k.message,"error"),g()}},x=async(b,y)=>{await $.updateGroup(b,{mediaRestriction:y}),o(k=>k.map(E=>E.jid===b?{...E,mediaRestriction:y}:E))};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Ws,{icon:s.jsx(Vs,{size:24}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[a("groups"),s.jsx(vt,{tone:"info",children:an(a("groupsCount"),{n:r.length})})]}),description:a("groupsSubtitle")}),s.jsx(at,{padded:!1,className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[640px] border-collapse text-start text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-line bg-panel-raised text-xs font-bold uppercase tracking-wider text-muted",children:[s.jsx("th",{className:"px-5 py-4 text-start",children:a("thGroupName")}),s.jsx("th",{className:"px-5 py-4 text-start",children:a("thGroupJid")}),s.jsx("th",{className:"px-5 py-4 text-start",children:a("thMembers")}),s.jsx("th",{className:"px-5 py-4 text-center",children:a("thAntiLink")}),s.jsx("th",{className:"px-5 py-4 text-start",children:a("thMedia")}),s.jsx("th",{className:"px-5 py-4 text-center",children:a("thWelcome")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:d?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"py-16 text-center",children:s.jsx(Oa,{className:"size-6",label:a("loading")})})}):r.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(Sn,{icon:s.jsx(qw,{size:28}),title:a("noGroupsTitle"),description:a("noGroupsBody")})})}):r.map(b=>{var y;return s.jsxs("tr",{className:"transition-colors hover:bg-panel-hover/50",children:[s.jsx("td",{className:"px-5 py-4 font-bold text-text-main",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-brand-blue/10 text-sm font-bold text-brand-cyan",children:(b.subject||"G").charAt(0).toUpperCase()}),s.jsx("span",{className:"line-clamp-1",children:b.subject||a("unnamedGroup")})]})}),s.jsx("td",{className:"px-5 py-4 font-mono text-xs text-muted",children:s.jsx("bdi",{className:"select-all rounded border border-line bg-panel-raised px-2 py-1",children:((y=b.jid)==null?void 0:y.split("@")[0])||b.jid})}),s.jsx("td",{className:"px-5 py-4",children:s.jsx(vt,{tone:"neutral",children:b.memberCount||"—"})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsx(Zn,{checked:!!b.antilink,onChange:k=>p(b.jid,{antilink:k})})}),s.jsx("td",{className:"px-5 py-4",children:s.jsx(VN,{jid:b.jid,value:b.mediaRestriction||"none",noneLabel:a("mediaNone"),blockLabel:a("mediaBlockAll"),ariaLabel:a("thMedia"),saveLabel:a("save"),savedLabel:a("saved"),onSave:x})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsx(Zn,{checked:!!b.welcomeEnabled,onChange:k=>p(b.jid,{welcomeEnabled:k})})})]},b.jid)})})]})})]})};function VN({jid:a,value:i,noneLabel:r,blockLabel:o,ariaLabel:d,saveLabel:f,savedLabel:h,onSave:g}){const p=Tn(i);return s.jsx(zn,{dirty:p.dirty,saving:p.status==="saving",justSaved:p.status==="saved",error:p.error,onSave:()=>p.save(x=>g(a,x)),onRevert:p.revert,saveLabel:f,savedLabel:h,children:s.jsxs(Ht,{"aria-label":d,value:p.value,onChange:x=>p.setValue(x.target.value),children:[s.jsx("option",{value:"none",children:r}),s.jsx("option",{value:"block_all",children:o})]})})}var d0;const Qf=typeof((d0=window.LevixHost)==null?void 0:d0.hostLog)=="function",YN=({socket:a})=>{const{t:i}=Ze(),[r,o]=v.useState([]),[d,f]=v.useState("all"),[h,g]=v.useState(!0),p=v.useRef(null),[x,b]=v.useState("bot"),[y,k]=v.useState([]);v.useEffect(()=>{x==="bot"&&$.getLogs().then(T=>{T!=null&&T.logs&&o(T.logs)}).catch(()=>{})},[x]),v.useEffect(()=>{if(x!=="bot"||!a)return;const T=D=>{o(Z=>[...Z.slice(-400),D])};return a.on("log",T),()=>{a.off("log",T)}},[a,x]);const E=v.useCallback(()=>{var T;try{const D=((T=window.LevixHost)==null?void 0:T.hostLog(500))??"";k(D?D.split(`
|
|
513
|
-
`).filter(Boolean):[])}catch{k([])}},[]);v.useEffect(()=>{if(x!=="host"||!Qf)return;E();const T=setInterval(E,3e3);return()=>clearInterval(T)},[x,E]),v.useEffect(()=>{h&&p.current&&p.current.scrollIntoView({behavior:"smooth"})},[r,y,h]);const _=r.filter(T=>d==="all"?!0:T.level===d),N=x==="bot"?_.length:y.length,j=T=>T==="error"?"border-danger/30 bg-danger/10 text-danger":T==="warn"?"border-warn/30 bg-warn/10 text-warn":"border-info/30 bg-info/10 text-info";return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ws,{icon:s.jsx(Zs,{size:20}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[i("liveServerLogs"),s.jsx(vt,{tone:"neutral",className:"font-mono",children:N})]}),description:i("logsSubtitle"),actions:s.jsxs(Cc,{children:[Qf&&s.jsx(Il,{"aria-label":i("logs"),value:x,onChange:b,options:[{value:"bot",label:i("logSourceBot")},{value:"host",label:i("logSourceHost"),icon:s.jsx(rr,{size:14})}]}),x==="bot"&&s.jsx(jc,{label:i("filter"),resetLabel:i("reset"),activeCount:d==="all"?0:1,onReset:()=>f("all"),children:s.jsx(or,{name:"log-level",label:i("allLogs"),value:d,onChange:f,options:[{value:"all",label:i("allLogs")},{value:"info",label:"INFO"},{value:"warn",label:"WARN"},{value:"error",label:"ERROR"}]})}),x==="host"&&Qf&&s.jsx(Le,{label:i("shareLogs"),icon:s.jsx(pr,{size:18}),onClick:()=>{var T;try{(T=window.LevixHost)==null||T.shareHostLogs()}catch{}}}),s.jsx(Le,{label:i("autoScroll"),pressed:h,icon:s.jsx(uw,{size:18,className:h?"animate-bounce":""}),onClick:()=>g(T=>!T)}),s.jsx(Le,{label:i("clearLogs"),variant:"ghost",icon:s.jsx(hl,{size:18}),onClick:()=>{x==="bot"?o([]):k([])}})]})}),s.jsxs(at,{padded:!1,className:"h-[65vh] overflow-y-auto bg-bg p-4 font-mono text-xs leading-relaxed text-muted shadow-2xl md:p-5",dir:"ltr",children:[x==="bot"?_.length===0?s.jsx(Sn,{icon:s.jsx(Zs,{size:24}),text:i("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:_.map((T,D)=>s.jsxs("div",{className:"flex items-baseline gap-2.5 rounded px-1 py-0.5 hover:bg-panel-hover/40",children:[s.jsx("span",{className:"shrink-0 select-none text-[11px] text-faint",children:T.time||new Date().toLocaleTimeString()}),s.jsx("span",{className:`inline-flex shrink-0 items-center rounded border px-1.5 font-mono text-[10px] font-bold ${j(T.level||"info")}`,children:(T.level||"info").toUpperCase()}),s.jsx("span",{className:"break-all font-mono text-text-main",children:T.msg})]},D))}):y.length===0?s.jsx(Sn,{icon:s.jsx(rr,{size:24}),text:i("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:y.map((T,D)=>s.jsx("div",{className:"rounded px-1 py-0.5 hover:bg-panel-hover/40",children:s.jsx("span",{className:"break-all font-mono text-text-main",children:T})},D))}),s.jsx("div",{ref:p})]})]})},IN=a=>{if(!a)return null;const i=a.split("@")[0].split(":")[0].replace(/\D/g,"");return i?i.length===12?`+${i.slice(0,2)} ${i.slice(2,5)} ${i.slice(5,8)} ${i.slice(8)}`:i.length===11?`+${i.slice(0,1)} ${i.slice(1,4)} ${i.slice(4,7)} ${i.slice(7)}`:`+${i}`:null},KN=({status:a,onNavigate:i})=>{var N;const{t:r}=Ze(),{toast:o}=qt(),[d,f]=v.useState(null),[h,g]=v.useState(!0);v.useEffect(()=>{let j=!0;return $.getStats().then(T=>{j&&(T!=null&&T.stats)&&f(T.stats)}).catch(T=>{o(T.message,"error")}).finally(()=>{j&&g(!1)}),()=>{j=!1}},[o]);const p=j=>{const T=Math.floor(j/86400),D=Math.floor(j%86400/3600),Z=Math.floor(j%3600/60);return T?`${T} ${r("uptimeDayUnit")} ${D} ${r("uptimeHourUnit")}`:D?`${D} ${r("uptimeHourUnit")} ${Z} ${r("uptimeMinuteUnit")}`:`${Z} ${r("uptimeMinuteUnit")}`},x=(a==null?void 0:a.state)==="connected",b=IN((N=a==null?void 0:a.user)==null?void 0:N.id),y=async()=>{try{await $.startSession(),o(r("starting"),"info")}catch(j){o(j.message,"error")}},k=async()=>{try{await $.stopSession(),o(r("stop"),"info")}catch(j){o(j.message,"error")}},E=[{id:"connection",title:r("connection"),desc:x?r("connected"):r(a==null?void 0:a.state,"disconnected"),icon:hr,color:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{id:"ai",title:r("ai"),desc:r("aiAssistantDesc")||"Autonomous tool-calling AI agent",icon:yh,color:"border-brand-purple/20 bg-brand-purple/10 text-brand-purple"},{id:"commands",title:r("commands"),desc:r("quickCommandsDesc").replace("{n}",String((d==null?void 0:d.commandCount)??0)),icon:Zs,color:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{id:"settings",title:r("settings"),desc:r("settingsSub")||"Prefix, ports, delays, security & storage",icon:Eb,color:"border-ok/20 bg-ok/10 text-ok"}],_=[{label:r("totalGroups"),value:(d==null?void 0:d.totalGroups)??0,icon:Vs,tone:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{label:r("commandCount"),value:(d==null?void 0:d.commandCount)??0,icon:Zs,tone:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{label:r("uptime"),value:p((d==null?void 0:d.uptime)||0),icon:yw,tone:"border-ok/20 bg-ok/10 text-ok"},{label:r("activeSchedules"),value:(d==null?void 0:d.activeSchedules)??0,icon:tc,tone:"border-brand-purple/20 bg-brand-purple/10 text-brand-purple"}];return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(at,{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:`flex size-11 shrink-0 items-center justify-center rounded-xl border ${x?"border-ok/30 bg-ok/10 text-ok":"border-warn/30 bg-warn/10 text-warn"}`,children:s.jsx(cw,{size:22})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx("h2",{className:"text-base font-extrabold tracking-tight text-text-main sm:text-lg",children:x?r("connected"):r(a==null?void 0:a.state,"disconnected")}),s.jsx(hc,{tone:x?"ok":"warn",dot:!0,pulse:!0,children:r(x?"online":"offline")})]}),s.jsx("p",{className:"text-sm text-muted",children:x?b?s.jsx("bdi",{dir:"ltr",children:b}):r("activeListening"):r("pausedOrLinking")})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[x?s.jsx(ge,{variant:"danger",icon:s.jsx(ah,{size:16}),onClick:k,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("stop")}):s.jsx(ge,{variant:"primary",icon:s.jsx(Uw,{size:16}),onClick:y,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("start")}),s.jsx(ge,{variant:"secondary",icon:s.jsx(hr,{size:16}),onClick:()=>i("connection"),className:"flex-1 whitespace-nowrap sm:flex-none",children:r("connection")})]})]}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-5 lg:grid-cols-4",children:_.map(j=>{const T=j.icon;return s.jsxs(at,{children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:"line-clamp-2 text-[11px] font-bold uppercase tracking-wider text-muted sm:text-xs",children:j.label}),s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${j.tone}`,children:s.jsx(T,{size:18})})]}),s.jsx("div",{className:"mt-2 font-mono text-2xl font-extrabold tracking-tight text-text-main sm:text-3xl",children:h?"—":j.value})]},j.label)})}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4",children:E.map(j=>{const T=j.icon;return s.jsx(at,{padded:!1,className:"h-full transition-colors hover:border-brand-blue/30",children:s.jsxs(ge,{variant:"ghost",onClick:()=>i(j.id),className:"h-full w-full flex-col items-stretch justify-between gap-3 rounded-2xl p-4 text-start sm:gap-4 sm:p-5",children:[s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${j.color}`,children:s.jsx(T,{size:18})}),s.jsx(pw,{size:16,className:"shrink-0 text-faint rtl:-scale-x-100","aria-hidden":!0})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-bold text-text-main sm:text-sm",children:j.title}),s.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted sm:text-xs",children:j.desc})]})]})},j.id)})}),s.jsxs(at,{className:"flex items-center gap-3.5",children:[s.jsx(kw,{size:20,className:"shrink-0 text-faint"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-xs font-semibold text-muted",children:r("dataDir")}),s.jsx("div",{className:"truncate text-start font-mono text-xs text-text-main",dir:"ltr",children:(d==null?void 0:d.dataDir)||"..."})]})]})]})},$s=()=>window.LevixHost,ur=new Map;let s0=!1;function FN(){s0||(s0=!0,window.__levixHostDone=(a,i)=>{const r=ur.get(a);ur.delete(a),r==null||r(i)})}function gr(a,i,r){const o=$s(),d=o==null?void 0:o[a];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});FN();const f=crypto.randomUUID();return new Promise(h=>{var p,x,b,y,k;const g=E=>{h(E)};ur.set(f,g);try{const E=a==="pickStickerSource"?(p=o.pickStickerSource)==null?void 0:p.call(o,f):a==="pickFile"?(x=o.pickFile)==null?void 0:x.call(o,f):a==="uploadSource"?(b=o.uploadSource)==null?void 0:b.call(o,f,i[0],i[1],i[2]):a==="uploadForm"?(y=o.uploadForm)==null?void 0:y.call(o,f,i[0],i[1],i[2],i[3]):(k=o.exportFile)==null?void 0:k.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),_=JSON.parse(E||"");_.ok||(ur.delete(f),g(_))}catch{ur.delete(f),g({ok:!1,code:"UNAVAILABLE"})}})}function rc(){var a;return typeof((a=$s())==null?void 0:a.pickStickerSource)=="function"}function Ac(){var a;return typeof((a=$s())==null?void 0:a.exportFile)=="function"}async function QN(){const a=await gr("pickStickerSource",[]);if(!a.ok&&!a.cancelled)throw xr(a);return a.ok&&a.token&&a.url?a:null}function XN(){try{const a=$s(),i=a!=null&&a.takePendingSticker?JSON.parse(a.takePendingSticker()):null;return i!=null&&i.ok&&i.token&&i.url&&["create","save"].includes(i.intent)?i:null}catch{return null}}function xr(a){a.status===401&&(window.location.href="/login");const i=a.body,r=i?(()=>{try{return JSON.parse(i)}catch{return null}})():null,o=a.cancelled?"CANCELLED":a.code==="UNAVAILABLE"?"STORAGE_UNAVAILABLE":a.code;return new Rt(a.status||0,(r==null?void 0:r.error)||a.error||o||"Sticker operation failed",r||{code:o})}async function Bv(a,i,r,o){const d=await gr("uploadSource",[a,i,r]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw xr(d);try{return JSON.parse(d.body||"")}catch{throw new Rt(d.status,"Invalid upload response",{code:"INTERNAL"})}}function yc(){var a,i;return typeof((a=$s())==null?void 0:a.uploadForm)=="function"&&typeof((i=$s())==null?void 0:i.pickFile)=="function"}async function Hv(){const a=await gr("pickFile",[]);if(!a.ok&&!a.cancelled)throw xr(a);return a.ok&&a.token&&a.url?a:null}async function qv(a,i,r,o,d){const f=await gr("uploadForm",[a,JSON.stringify(i),r,o]);if(!f.ok||!f.status||f.status<200||f.status>=300)throw xr(f);try{return f.body?JSON.parse(f.body):{}}catch{throw new Rt(f.status||0,"Invalid upload response",{code:"INTERNAL"})}}async function ZN(a,i,r,o,d,f){const h=await gr("exportFile",[a,i,r,o,d,f]);if(!h.ok)throw xr(h);return h}const JN=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],$N=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],WN=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],Pv=[1,2,3,4,6,8,12];function eC(){const a=window.LevixHost;return!!(a&&typeof a.pickContact=="function")}function tC(a){let i=String(a||"").replace(/\D/g,"");return i.startsWith("00")&&(i=i.slice(2)),i.length<8||i.length>15?null:`${i}@s.whatsapp.net`}function Ra(a){const i=String(a||"").trim();return!i||i.includes("@")||/^\d{8,}$/.test(i)?null:i}function nC(a,i){return Ra(a.savedName)||Ra(a.pushName)||Ra(a.name)||Ra(a.targetLabel)||a.phone||i}function mh(a){return String(a).padStart(2,"0")}function aC(a,i){const r=a.map(o=>i?WN[o]:$N[o]);return i?r.join(" و"):r.length===1?r[0]:r.length===2?`${r[0]} and ${r[1]}`:`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`}function lC(a){return a===1?"كل ساعة":a===2?"كل ساعتين":a>=3&&a<=10?`كل ${a} ساعات`:`كل ${a} ساعة`}function sC(a,i){return i==="image"?a("mediaKindImage"):i==="video"?a("mediaKindVideo"):i==="audio"?a("mediaKindAudio"):i==="document"?a("mediaKindDocument"):i}const Ma=({label:a,children:i})=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[s.jsx("span",{className:"sm:w-32 shrink-0 font-bold text-muted",children:a}),s.jsx("span",{className:"min-w-0",children:i})]});function iC(a,i,r,o,d,f,h,g){const p=/^\d{1,2}:\d{2}$/.test(i),x=h||"UTC";if(a==="hourly")return!Number.isInteger(d)||!Pv.includes(d)||!Number.isInteger(f)||f<0||f>59?null:g?`${`${lC(d)} عند الدقيقة ${f}`} (${x})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${x})`;if(!p)return null;const[b,y]=i.split(":").map(Number);if(b>23||y>59)return null;const k=`${mh(b)}:${mh(y)}`;if(a==="daily")return g?`يومياً الساعة ${k} (${x})`:`Daily at ${k} (${x})`;if(a==="weekly"){const E=[...new Set(r.filter(N=>N>=0&&N<=6))].sort((N,j)=>N-j);if(!E.length)return null;const _=aC(E,g);return g?`كل يوم ${_} الساعة ${k} (${x})`:`Every ${_} at ${k} (${x})`}return a==="monthly"?!Number.isInteger(o)||o<1||o>31?null:g?`كل شهر في اليوم ${o} الساعة ${k} (${x})`:`Every month on day ${o} at ${k} (${x})`:null}const rC=({isConnected:a=!1,onNavigate:i})=>{const{t:r,language:o}=Ze(),{toast:d}=qt(),[f,h]=v.useState([]),[g,p]=v.useState("UTC"),[x,b]=v.useState(!0),[y,k]=v.useState([]),[E,_]=v.useState(!1),[N,j]=v.useState(null),[T,D]=v.useState(""),[Z,ne]=v.useState(!1),[pe,I]=v.useState(""),[M,A]=v.useState("recurring"),[P,G]=v.useState("daily"),[q,W]=v.useState("09:00"),[ie,ae]=v.useState([1]),[Q,V]=v.useState(1),[le,he]=v.useState(1),[ve,K]=v.useState(0),[X,xe]=v.useState(""),[ke,w]=v.useState(!1),[z,de]=v.useState(null),[ue,ee]=v.useState(null),me=v.useRef(null),[te,U]=v.useState(null),fe=3,Te=20*1024*1024,De=20,Ge=f.length>=fe,Pe=o==="ar",Ae=v.useMemo(()=>iC(P,q,ie,Q,le,ve,g,Pe),[P,q,ie,Q,le,ve,g,Pe]),Ve=async()=>{try{const O=await $.getSchedules();O!=null&&O.schedules&&(h(O.schedules),O.timezone&&p(O.timezone))}catch(O){d(O.message,"error")}finally{b(!1)}},Ct=async()=>{_(!0);try{const O=await $.getRecipients();O!=null&&O.recipients&&k(O.recipients)}catch{}finally{_(!1)}};v.useEffect(()=>{Ve(),a&&Ct()},[a]);const ln=async O=>{try{await $.deleteSchedule(O),d(r("savedSuccessfully"),"success"),h(we=>we.filter(Me=>Me.id!==O))}catch(we){d(we.message,"error")}},Et=async O=>{if(!a){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await $.retrySchedule(O),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),Ve()}catch(we){d(we.message,"error")}},sn=async()=>{const O=window.LevixHost;if(!(O!=null&&O.pickContact)){d(o==="ar"?"دليل الهاتف متاح من تطبيق أندرويد فقط":"Phone book is available in the Android app","info");return}const we=await new Promise(on=>{var Kt;const hn=Ot=>{window.removeEventListener("levix-contact",hn);const Jn=Ot.detail;if(!(Jn!=null&&Jn.phone)){on(null);return}on({name:String(Jn.name||""),phone:String(Jn.phone)})};window.addEventListener("levix-contact",hn);try{(Kt=O.pickContact)==null||Kt.call(O)}catch{window.removeEventListener("levix-contact",hn),on(null)}});if(!we)return;const Me=tC(we.phone);if(!Me){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const yt=`+${Me.split("@")[0]}`,It=Ra(we.name);j({id:Me,name:It||yt,savedName:It,pushName:null,phone:yt,type:"contact"})},rn=()=>{j(null),D(""),I(""),A("recurring"),G("daily"),W("09:00"),ae([1]),V(1),he(1),K(0),xe(""),de(null),ee(null)},ye=()=>{de(null),ee(null)},Ce=async()=>{try{const O=await Hv();if(!O)return;if(O.size>Te){d(r("feedbackFileTooLarge").replace("{max}",String(De)),"error");return}ee(O)}catch(O){d((O==null?void 0:O.message)||"Could not attach the file","error")}},We=()=>{if(!a){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(Ge){d(r("maxSchedulesReached"),"warning");return}rn(),ne(!0),y.length||Ct()},pt=O=>{ae(we=>we.includes(O)?we.filter(Me=>Me!==O):[...we,O].sort((Me,yt)=>Me-yt))},tn=async()=>{if(!N){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!pe.trim()&&!z&&!ue){d(o==="ar"?"يرجى كتابة نص الرسالة أو إرفاق ملف":"Please write the message text or attach a file","warning");return}if(M==="once"&&(!X||new Date(X).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if(M==="recurring"&&P==="weekly"&&ie.length===0){d(r("weekdayRequired"),"warning");return}w(!0);const O={targetJid:N.id,message:pe.trim(),type:M};if(N.type==="contact"){const we=Ra(N.savedName)||Ra(N.name);we&&we!==N.phone&&(O.targetName=we)}if(M==="recurring"){const we={kind:P};P==="hourly"?(we.everyHours=le,we.time=`00:${mh(ve)}`):(we.time=q,P==="weekly"&&(we.weekdays=ie),P==="monthly"&&(we.dayOfMonth=Q)),O.recurrence=we}else O.scheduledTime=new Date(X).getTime();try{const we={};for(const[Me,yt]of Object.entries(O))we[Me]=Me==="recurrence"?JSON.stringify(yt):String(yt);ue?await qv("/dashboard/api/schedules",we,ue.token,Te+1024*1024):z?await $.postMultipart("/schedules",we,z):await $.createSchedule(O),d(r("savedSuccessfully"),"success"),ne(!1),rn(),Ve()}catch(we){d(we.message,"error")}finally{w(!1)}},_t=y.filter(O=>{var Me,yt,It;const we=T.toLowerCase().trim();return we?O.name.toLowerCase().includes(we)||!!((Me=O.savedName)!=null&&Me.toLowerCase().includes(we))||!!((yt=O.pushName)!=null&&yt.toLowerCase().includes(we))||!!((It=O.phone)!=null&&It.toLowerCase().includes(we)):!0}),re=(O,we,Me=!0)=>{var Kt;if(O.type==="group"||O.targetKind==="group"||!!((Kt=O.targetJid)!=null&&Kt.includes("@g.us"))){const Ot=Ra(O.name)||(Ra(O.targetLabel)&&O.targetLabel!=="Group"?O.targetLabel:null)||r("groupFallback");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-brand-cyan min-w-0",children:[Me&&s.jsx(Vs,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${we} truncate`,children:Ot})]})}const It=O.phone||O.targetPhone||null,on=nC(O,r("contactFallback")),hn=!!(It&&on!==It);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[Me&&s.jsx(pf,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${we} truncate block`,children:on}),hn&&s.jsx("span",{className:"block text-[11px] text-muted font-mono",dir:"ltr",children:It})]})]})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[!a&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 sm:p-5 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-warn/20 text-warn flex items-center justify-center shrink-0",children:s.jsx(ir,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm sm:text-base font-bold text-warn",children:o==="ar"?"واتساب غير متصل حالياً":"WhatsApp is Disconnected"}),s.jsx("p",{className:"text-xs sm:text-sm text-text-main/80 mt-0.5",children:o==="ar"?"يلزم وجود اتصال نشط بواتساب لجدولة الرسائل وإرسالها واختيار جهات الاتصال.":"An active WhatsApp connection is required to schedule messages, fetch chats, and deliver automated jobs."})]})]}),s.jsx(ge,{variant:"primary",className:"shrink-0",onClick:()=>i==null?void 0:i("connection"),children:o==="ar"?"الذهاب للاتصال":"Go to Connection"})]}),s.jsx(Ws,{icon:s.jsx(eh,{size:24}),title:s.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:[r("schedules"),s.jsxs(vt,{tone:Ge?"warn":"info",children:[f.length," / ",fe," ",r("scheduledCount")]})]}),description:s.jsxs(s.Fragment,{children:[r("timezoneLabel"),":"," ",s.jsx("code",{className:"rounded border border-line bg-bg-soft px-1.5 py-0.5 font-mono font-semibold text-brand-cyan",children:g})," ","· ",r("headerSubtitle")]}),actions:s.jsx(ge,{variant:"primary",size:"lg",className:"w-full sm:w-auto",icon:s.jsx(Fs,{size:18}),onClick:We,disabled:Ge||!a,children:a?r(Ge?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"})}),s.jsx(at,{padded:!1,className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[680px] border-collapse text-start text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-5 py-4 text-start",children:r("thTarget")}),s.jsx("th",{className:"px-5 py-4 text-start",children:r("thMessage")}),s.jsx("th",{className:"px-5 py-4 text-start",children:r("thSchedule")}),s.jsx("th",{className:"px-5 py-4 text-start",children:r("thType")}),s.jsx("th",{className:"px-5 py-4 text-start",children:r("thDelivery")}),s.jsx("th",{className:"px-5 py-4 text-center",children:r("thActions")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:x?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"py-16 text-center",children:s.jsx(Oa,{className:"size-6",label:r("loading")})})}):f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(Sn,{icon:s.jsx(eh,{size:28}),text:r("noSchedules")})})}):f.map(O=>{var we;return s.jsxs("tr",{onClick:()=>U(O),className:"cursor-pointer hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-5 py-4 text-xs text-text-main",children:s.jsx("bdi",{children:re({targetJid:O.targetJid,targetKind:O.targetKind,targetLabel:O.targetLabel,targetPhone:O.targetPhone,savedName:O.savedName,pushName:O.pushName,phone:O.phone},"font-semibold max-w-[12rem]")})}),s.jsxs("td",{className:"px-5 py-4 max-w-xs text-text-main truncate text-xs sm:text-sm",children:[O.media&&s.jsx(lr,{size:12,className:"inline me-1 text-brand-cyan"}),O.message||((we=O.media)!=null&&we.fileName?O.media.fileName:"—")]}),s.jsx("td",{className:"px-5 py-4 text-xs text-muted",children:Pe?O.whenAr||O.when:O.when||O.cronString||"—"}),s.jsx("td",{className:"px-5 py-4",children:s.jsx(vt,{tone:O.type==="recurring"?"info":"neutral",children:O.type==="recurring"?r("typeRecurring"):r("typeOnce")})}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs(hc,{tone:O.lastDeliveryStatus==="failed"?"danger":O.status==="active"?"ok":"neutral",children:[O.lastDeliveryStatus==="failed"?s.jsx(ir,{size:13}):s.jsx(Ks,{size:13}),s.jsx("span",{children:O.lastDeliveryStatus==="failed"?r("deliveryFailed"):O.status==="active"?r("deliveryActive"):O.status})]})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-2",onClick:Me=>Me.stopPropagation(),children:[O.lastDeliveryStatus==="failed"&&s.jsx(Le,{label:r("retryDelivery"),icon:s.jsx(Qs,{size:16}),onClick:()=>{Et(O.id)}}),s.jsx(La,{label:r("moreActions"),children:s.jsx(ot,{danger:!0,icon:s.jsx(hl,{size:16}),onSelect:()=>{ln(O.id)},children:r("delete")})})]})})]},O.id)})})]})}),s.jsx(en,{isOpen:Z,onClose:()=>ne(!1),title:r("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:()=>ne(!1),children:r("cancel")}),s.jsx(ge,{variant:"primary",loading:ke,onClick:tn,disabled:ke||!N||!pe.trim()&&!z&&!ue,children:r(ke?"saving":"scheduleAction")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"block text-xs font-bold text-text-main",children:[r("selectRecipient")," ",s.jsx("span",{className:"text-danger",children:"*"})]}),N?s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-brand-blue/40 bg-brand-blue/10",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-blue/20 text-brand-cyan flex items-center justify-center shrink-0",children:N.type==="group"?s.jsx(Vs,{size:16}):s.jsx(pf,{size:16})}),s.jsx("div",{className:"min-w-0",children:re(N,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx(Le,{label:r("changeChat"),variant:"ghost",icon:s.jsx(Da,{size:16}),onClick:()=>j(null)})]}):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative min-w-0 flex-1",children:[s.jsx(bh,{size:16,className:"pointer-events-none absolute start-3 top-1/2 -translate-y-1/2 text-muted"}),s.jsx(Be,{type:"search",value:T,onChange:O=>D(O.target.value),placeholder:r("searchRecipients"),"aria-label":r("searchRecipients"),className:"ps-9"})]}),eC()&&s.jsx(ge,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(hw,{size:15}),onClick:sn,title:r("pickPhoneContactHint"),children:s.jsx("span",{className:"hidden sm:inline",children:r("pickPhoneContact")})})]}),s.jsx("div",{className:"max-h-48 overflow-y-auto rounded-xl border border-line bg-panel-raised divide-y divide-line/40",children:E?s.jsx("div",{className:"flex justify-center p-4",children:s.jsx(Oa,{label:r("loading")})}):_t.length===0?s.jsx(Sn,{className:"px-4 py-4",text:r("noRecipientsFound")}):_t.map(O=>s.jsxs(ge,{variant:"ghost",onClick:()=>j(O),className:"h-auto w-full justify-between gap-2 rounded-none px-2.5 py-2.5 text-start",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-panel border border-line flex items-center justify-center shrink-0 text-muted",children:O.type==="group"?s.jsx(Vs,{size:14}):s.jsx(pf,{size:14})}),s.jsx("div",{className:"min-w-0",children:re(O,"text-xs font-bold text-text-main",!1)})]}),s.jsx(vt,{tone:"neutral",className:"shrink-0",children:O.type==="group"?r("groupFallback"):r("contactFallback")})]},O.id))})]})]}),s.jsx(it,{label:r("scheduleType"),htmlFor:"schedule-type",children:s.jsxs(Ht,{id:"schedule-type",value:M,onChange:O=>A(O.target.value),children:[s.jsx("option",{value:"recurring",children:r("scheduleRecurring")}),s.jsx("option",{value:"once",children:r("scheduleOnce")})]})}),M==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsx(it,{label:r("repeat"),htmlFor:"repeat-kind",children:s.jsxs(Ht,{id:"repeat-kind",value:P,onChange:O=>G(O.target.value),children:[s.jsx("option",{value:"daily",children:r("repeatDaily")}),s.jsx("option",{value:"weekly",children:r("repeatWeekly")}),s.jsx("option",{value:"monthly",children:r("repeatMonthly")}),s.jsx("option",{value:"hourly",children:r("repeatHourly")})]})}),P==="weekly"&&s.jsxs("fieldset",{className:"space-y-1.5",children:[s.jsx("legend",{className:"block text-xs font-bold text-text-main",children:r("weekdays")}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:JN.map((O,we)=>{const Me=ie.includes(we);return s.jsx(ge,{size:"sm",variant:Me?"primary":"secondary","aria-pressed":Me,onClick:()=>pt(we),children:r(O)},O)})})]}),P==="monthly"&&s.jsx(it,{label:r("dayOfMonth"),htmlFor:"day-of-month",description:r("monthDayHint"),children:s.jsx(Be,{id:"day-of-month",type:"number",min:1,max:31,inputMode:"numeric",value:Q,onChange:O=>V(Number(O.target.value))})}),P==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(it,{label:r("everyHours"),htmlFor:"every-hours",children:s.jsx(Ht,{id:"every-hours",value:le,onChange:O=>he(Number(O.target.value)),children:Pv.map(O=>s.jsx("option",{value:O,children:O},O))})}),s.jsx(it,{label:r("atMinute"),htmlFor:"hourly-minute",children:s.jsx(Be,{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",value:ve,onChange:O=>K(Number(O.target.value)),dir:"ltr"})})]}):s.jsx(it,{label:s.jsxs(s.Fragment,{children:[r("sendTime"),s.jsxs("span",{className:"ms-1.5 font-semibold text-muted",children:["(",g,")"]})]}),htmlFor:"send-time",children:s.jsx(Be,{id:"send-time",type:"time",value:q,onChange:O=>W(O.target.value),dir:"ltr"})}),s.jsxs("p",{className:"text-xs text-text-main/90 bg-bg-soft border border-line rounded-lg px-3 py-2",children:[s.jsxs("span",{className:"font-bold text-muted",children:[r("recurrencePreview"),": "]}),s.jsx("span",{dir:"auto",children:Ae||"—"})]})]}):s.jsx(it,{label:r("deliveryDateTime"),htmlFor:"one-off-time",children:s.jsx(Be,{id:"one-off-time",type:"datetime-local",value:X,onChange:O=>xe(O.target.value),dir:"ltr"})}),s.jsx(it,{label:s.jsxs(s.Fragment,{children:[r("messageText")," ",!z&&!ue&&s.jsx("span",{className:"text-danger",children:"*"})]}),htmlFor:"schedule-message",children:s.jsx(mc,{id:"schedule-message",rows:3,placeholder:r("messagePlaceholder"),value:pe,onChange:O=>I(O.target.value)})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"block text-xs font-bold text-text-main",children:r("scheduleAttachMedia")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ue||z?s.jsxs("span",{className:"inline-flex max-w-full items-center gap-2 rounded-xl border border-brand-blue/40 bg-brand-blue/10 ps-3 pe-1 text-xs text-text-main sm:text-sm",children:[s.jsx(lr,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"max-w-[220px] truncate",children:(ue==null?void 0:ue.name)??(z==null?void 0:z.name)}),s.jsx(Le,{label:r("scheduleRemoveMedia"),variant:"ghost",icon:s.jsx(Da,{size:14}),onClick:ye})]}):s.jsx(ge,{variant:"secondary",size:"sm",icon:s.jsx(lr,{size:14,className:"text-brand-cyan"}),onClick:()=>{var O;return yc()?void Ce():(O=me.current)==null?void 0:O.click()},children:r("scheduleAttachMedia")}),s.jsx("span",{className:"text-[11px] text-muted",children:r("scheduleMediaHint").replace("{max}",String(De))})]}),!yc()&&s.jsx("input",{ref:me,type:"file",className:"sr-only",onChange:O=>{var Me;const we=((Me=O.target.files)==null?void 0:Me[0])??null;if(O.target.value="",!!we){if(we.size>Te){d(r("feedbackFileTooLarge").replace("{max}",String(De)),"error");return}de(we)}}})]})]})}),s.jsx(en,{isOpen:!!te,onClose:()=>U(null),title:r("scheduleDetails"),maxWidth:"560px",footer:s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[(te==null?void 0:te.lastDeliveryStatus)==="failed"?s.jsx(Le,{label:r("retryDelivery"),icon:s.jsx(Qs,{size:16}),onClick:()=>{const O=te.id;U(null),Et(O)}}):s.jsx("span",{}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ge,{variant:"secondary",onClick:()=>U(null),children:r("close")}),s.jsx(La,{label:r("moreActions"),children:s.jsx(ot,{danger:!0,icon:s.jsx(hl,{size:16}),onSelect:()=>{const O=te==null?void 0:te.id;U(null),O&&ln(O)},children:r("delete")})})]})]}),children:te&&s.jsxs("div",{className:"flex flex-col gap-3.5 py-1 text-xs sm:text-sm",children:[s.jsx(Ma,{label:r("thTarget"),children:s.jsx("bdi",{children:re({targetJid:te.targetJid,targetKind:te.targetKind,targetLabel:te.targetLabel,targetPhone:te.targetPhone,savedName:te.savedName,pushName:te.pushName,phone:te.phone},"font-semibold",!1)})}),s.jsx(Ma,{label:r("thMessage"),children:te.message?s.jsx("span",{className:"whitespace-pre-wrap break-words",children:te.message}):s.jsx("span",{className:"text-muted",children:"—"})}),te.media&&s.jsx(Ma,{label:r("detailMedia"),children:s.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[s.jsx(lr,{size:13,className:"text-brand-cyan shrink-0"}),s.jsxs("span",{className:"truncate",children:[sC(r,te.media.kind),te.media.fileName?` · ${te.media.fileName}`:""]})]})}),s.jsx(Ma,{label:r("thSchedule"),children:s.jsx("span",{dir:"auto",children:Pe&&te.whenAr||te.when})}),s.jsx(Ma,{label:r("thType"),children:te.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsx(Ma,{label:r("thDelivery"),children:s.jsxs(hc,{tone:te.lastDeliveryStatus==="failed"?"danger":te.status==="active"?"ok":"neutral",children:[te.lastDeliveryStatus==="failed"?s.jsx(ir,{size:13}):s.jsx(Ks,{size:13}),s.jsx("span",{children:te.lastDeliveryStatus==="failed"?r("deliveryFailed"):te.status==="active"?r("deliveryActive"):te.status})]})}),te.lastRunAt&&s.jsx(Ma,{label:r("detailLastRun"),children:new Date(te.lastRunAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")}),te.lastError&&s.jsx(Ma,{label:r("detailError"),children:s.jsx("span",{className:"text-danger break-words",dir:"auto",children:te.lastError})}),te.createdAt&&s.jsx(Ma,{label:r("detailCreated"),children:new Date(te.createdAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")})]})})]})},Xf={messageMin:10,messageMax:2e3,attachmentMax:20*1024*1024},Zf={bug:{icon:mw,labelKey:"feedbackTopicBug"},idea:{icon:_w,labelKey:"feedbackTopicIdea"},question:{icon:Tb,labelKey:"feedbackTopicQuestion"},praise:{icon:Nw,labelKey:"feedbackTopicPraise"},other:{icon:mr,labelKey:"feedbackTopicOther"}},oC=["bug","idea","question","praise","other"],cC=()=>{var K;const{t:a}=Ze(),{toast:i}=qt(),[r,o]=v.useState(null),[d,f]=v.useState("bug"),[h,g]=v.useState(""),[p,x]=v.useState(0),[b,y]=v.useState(""),[k,E]=v.useState(null),[_,N]=v.useState(null),[j,T]=v.useState(null),[D,Z]=v.useState(!1),[ne,pe]=v.useState(!1),I=v.useRef(null);v.useEffect(()=>{$.getFeedbackMeta().then(o).catch(()=>{})},[]);const M=(r==null?void 0:r.messageMin)??Xf.messageMin,A=(r==null?void 0:r.messageMax)??Xf.messageMax,P=(r==null?void 0:r.attachmentMax)??Xf.attachmentMax,G=Math.round(P/(1024*1024)),q=h.trim(),W=Math.max(0,M-q.length),ie=X=>X>=1024*1024?a("fileSizeMb").replace("{size}",(X/(1024*1024)).toFixed(1)):a("fileSizeKb").replace("{size}",String(Math.max(1,Math.round(X/1024)))),ae=((K=r==null?void 0:r.topics)!=null&&K.length?r.topics:oC).filter(X=>X in Zf),Q=()=>i(a("feedbackFileTooLarge").replace("{max}",String(G)),"error"),V=async()=>{try{const X=await Hv();if(!X)return;if(X.size>P){Q();return}N(X)}catch(X){i((X==null?void 0:X.message)||"Could not attach the file","error")}},le=async X=>{if(X.preventDefault(),W>0||D)return;Z(!0),T(_?0:null);const xe={message:q,topic:d,rating:p||null,contact:b.trim()||null};try{_?await qv("/dashboard/api/feedback",{message:xe.message,topic:xe.topic,...xe.rating?{rating:String(xe.rating)}:{},...xe.contact?{contact:xe.contact}:{}},_.token,P+1024*1024):k?await $.sendFeedbackMultipart(xe,k,ke=>T(ke)):await $.sendFeedback(xe),pe(!0),i(a("feedbackSent"),"success")}catch(ke){i(ke==null?void 0:ke.message,"error")}finally{Z(!1),T(null)}},he=()=>{g(""),y(""),x(0),f("bug"),E(null),N(null),pe(!1)},ve=()=>{E(null),N(null)};return ne?s.jsxs(at,{className:"border-ok/30 text-center",children:[s.jsx("div",{className:"mx-auto flex size-12 items-center justify-center rounded-full bg-ok/10 text-ok",children:s.jsx(Ks,{size:26})}),s.jsx("h3",{className:"mt-4 text-lg font-bold text-text-main",children:a("feedbackSent")}),s.jsx("p",{className:"mx-auto mt-2 max-w-md text-xs leading-relaxed text-muted sm:text-sm",children:a("feedbackSentDesc")}),s.jsx(ge,{className:"mt-6",onClick:he,children:a("feedbackSendAnother")})]}):s.jsx("div",{className:"flex flex-col gap-5",children:s.jsx(at,{children:s.jsxs("form",{onSubmit:le,className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-10 h-10 sm:w-11 sm:h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(mr,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:a("feedbackTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:a("feedbackDesc")})]})]}),s.jsx(it,{label:a("feedbackTopicLabel"),children:s.jsx(Nc,{"aria-label":a("feedbackTopicLabel"),value:d,onChange:f,className:"flex-wrap gap-1.5 sm:gap-2",options:ae.map(X=>{const xe=Zf[X].icon;return{value:X,label:a(Zf[X].labelKey),icon:s.jsx(xe,{size:16})}})})}),s.jsxs(it,{label:a("feedbackMessageLabel"),htmlFor:"feedback-message",children:[s.jsx(mc,{id:"feedback-message",rows:6,required:!0,maxLength:A,value:h,onChange:X=>g(X.target.value),placeholder:a("feedbackMessagePlaceholder")}),s.jsx("span",{className:"self-end text-[11px] tabular-nums text-muted",children:W>0?`${W} ${a("feedbackCharsNeeded")}`:`${h.length} / ${A}`})]}),s.jsxs(it,{label:a("feedbackAttach"),description:a("feedbackAttachmentHint").replace("{max}",String(G)),children:[_||k?s.jsx("span",{className:"flex",children:s.jsx(kc,{onRemove:ve,removeLabel:a("feedbackRemoveAttachment"),className:"max-w-full",children:`${(_==null?void 0:_.name)??(k==null?void 0:k.name)} · ${ie((_==null?void 0:_.size)??(k==null?void 0:k.size)??0)}`})}):s.jsx(ge,{type:"button",variant:"secondary",icon:s.jsx(lr,{size:16,className:"text-brand-cyan"}),className:"w-full justify-center border-dashed",onClick:()=>{var X;return yc()?void V():(X=I.current)==null?void 0:X.click()},children:a("feedbackAttach")}),!yc()&&s.jsx("input",{ref:I,type:"file",className:"sr-only",onChange:X=>{var ke;const xe=((ke=X.target.files)==null?void 0:ke[0])??null;if(X.target.value="",!!xe){if(xe.size>P){Q();return}E(xe)}}})]}),s.jsxs("fieldset",{className:"flex flex-col gap-2",children:[s.jsx("legend",{className:"text-xs sm:text-sm font-bold text-text-main mb-1",children:a("feedbackRatingLabel")}),s.jsx("div",{className:"flex items-center justify-center gap-1",children:[1,2,3,4,5].map(X=>s.jsx(Le,{label:`${X} / 5`,variant:"ghost","aria-pressed":p===X,onClick:()=>x(p===X?0:X),icon:s.jsx(Sh,{size:22,className:X<=p?"fill-brand-cyan text-brand-cyan":"text-muted"})},X))})]}),s.jsx(it,{label:a("feedbackContactLabel"),htmlFor:"feedback-contact",children:s.jsx(Be,{id:"feedback-contact",type:"text",maxLength:200,value:b,onChange:X=>y(X.target.value),placeholder:a("feedbackContactPlaceholder")})}),D&&(_||k)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:_?s.jsx("div",{className:"h-full w-1/3 rounded-full bg-brand-blue animate-pulse"}):s.jsx("div",{className:"h-full rounded-full bg-brand-blue transition-[width]",style:{width:`${Math.max(4,Math.round((j??0)*100))}%`}})}),s.jsxs("span",{className:"text-[11px] text-muted tabular-nums",children:[a("feedbackSending"),!_&&j!==null&&j>0?` ${Math.round(j*100)}%`:"…"]})]}),s.jsxs("div",{className:"flex flex-col gap-3 border-t border-line pt-4",children:[s.jsxs("div",{className:"flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-between",children:[r!=null&&r.runtime?s.jsxs("span",{className:"text-[11px] text-muted",children:[a("feedbackRuntimeLabel"),": v",r.runtime.version," · ",r.runtime.platform]}):s.jsx("span",{}),s.jsx(ge,{type:"submit",variant:"primary",disabled:W>0,loading:D,icon:s.jsx(mr,{size:16}),className:"w-full sm:w-auto",children:a(D?"feedbackSending":"feedbackSendBtn")})]}),s.jsxs("details",{className:"group rounded-xl border border-line bg-panel-raised",children:[s.jsxs("summary",{className:"flex min-h-10 cursor-pointer list-none items-center gap-2 px-3 py-2 text-xs font-semibold text-muted select-none hover:text-text-main [&::-webkit-details-marker]:hidden",children:[s.jsx(vh,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"flex-1",children:a("feedbackWhatIsSent")}),s.jsx(k0,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsx("p",{className:"px-3 pb-3 text-xs leading-relaxed text-muted",children:a("feedbackWhatIsSentDesc")})]}),s.jsxs("p",{className:"text-xs leading-relaxed text-muted",children:[a("feedbackGithubHint")," ",s.jsxs("a",{href:"https://github.com/Abdodiab2005/levix/issues",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-semibold text-brand-cyan hover:underline",children:[a("feedbackOpenGithub"),s.jsx(ww,{size:13,"aria-hidden":!0,className:"shrink-0"})]})]})]})]})})})},uC=["!","/",".","#","$","?"],dC="levix-settings";function fC(a){const i=new TextEncoder().encode(a);let r="";for(const o of i)r+=String.fromCharCode(o);return btoa(r)}const hC=()=>{var We,pt,tn,_t;const{t:a,language:i,setLanguage:r}=Ze(),{toast:o}=qt(),[d,f]=v.useState("general"),[h,g]=v.useState({}),[p,x]=v.useState({}),[b,y]=v.useState(!0),[k,E]=v.useState("!"),[_,N]=v.useState("!"),[j,T]=v.useState(!1),[D,Z]=v.useState(""),[ne,pe]=v.useState(""),[I,M]=v.useState(""),[A,P]=v.useState(!1),[G,q]=v.useState(!1),[W,ie]=v.useState(!1),[ae,Q]=v.useState(!1),[V,le]=v.useState(!1),[he,ve]=v.useState(!1),[K,X]=v.useState(!1),[xe,ke]=v.useState(null),w=v.useRef(null),z=async(re,O)=>{await $.updateSetting(re,O),re.endsWith("_api_key")||re==="whatsapp_proxy_password"?(g(Me=>({...Me,[re]:""})),x(Me=>({...Me,[re]:!!String(O||"").trim()}))):g(Me=>({...Me,[re]:O}))},de=async(re,O)=>{g(we=>({...we,[re]:O}));try{await $.updateSetting(re,O),o(a("savedSuccessfully"),"success")}catch(we){o(we.message,"error"),await Et()}},ue=Tn(i),ee=Tn(String(h.bot_language||"auto")),me=Tn(String(h.bot_timezone||"Africa/Cairo")),te=Tn(String(h.openweathermap_api_key||"")),U=Tn(String(h.youtube_api_key||"")),fe=Tn(Number(h.forward_score_ttl_days||30)),Te=Tn(Number(h.max_fetch_bytes||524288)),De=Tn(Number(h.sticker_library_limit||1e3)),Ge=Tn(Number(h.auto_delete_keep_days||30)),Pe=sh({min:Number(h.bot_min_delay_ms??400),max:Number(h.bot_max_delay_ms??900)}),Ae=sh({protocol:String(h.whatsapp_proxy_protocol||"http"),host:String(h.whatsapp_proxy_host||""),port:Number(h.whatsapp_proxy_port||0),username:String(h.whatsapp_proxy_username||""),password:String(h.whatsapp_proxy_password||"")}),Ve=async()=>{var re;ve(!0);try{const O=await $.exportSettings(),we=JSON.stringify(O,null,2),Me=`levix-settings-${((re=O.exportedAt)==null?void 0:re.slice(0,10))||"export"}.json`,yt=window.LevixHost;if(yt&&typeof yt.saveExportFile=="function"){const Kt=JSON.parse(yt.saveExportFile(Me,fC(we)));if(!(Kt!=null&&Kt.ok))throw new Error((Kt==null?void 0:Kt.error)||a("exportSettingsError"));o(`${a("exportSettingsSuccess")} — ${a("exportSavedTo")} ${Kt.dir}`,"success");return}const It=new Blob([we],{type:"application/json"}),on=URL.createObjectURL(It),hn=document.createElement("a");hn.href=on,hn.download=Me,hn.click(),URL.revokeObjectURL(on),o(a("exportSettingsSuccess"),"success")}catch(O){o(O.message||a("exportSettingsError"),"error")}finally{ve(!1)}},Ct=async re=>{var Me;const O=(Me=re.target.files)==null?void 0:Me[0];if(re.target.value="",!O)return;let we;try{we=JSON.parse(await O.text())}catch{o(a("importSettingsError"),"error");return}if((we==null?void 0:we.format)!==dC){o(a("importSettingsError"),"error");return}ke(we)},ln=async()=>{var re,O,we;if(xe){X(!0);try{const Me=await $.importSettings(xe),yt=[`${((re=Me.applied)==null?void 0:re.length)||0} ${a("importSettingsCount")}`];(O=Me.skipped)!=null&&O.length&&yt.push(`${a("importSkipped")}: ${Me.skipped.length}`),(we=Me.restartNeeded)!=null&&we.length&&yt.push(`${a("importRestartNeeded")}: ${Me.restartNeeded.join(", ")}`),o(`${a("importSuccess")} — ${yt.join(" · ")}`,"success"),ke(null),await Et()}catch(Me){o(Me.message,"error")}finally{X(!1)}}},Et=async()=>{try{const re=await $.getSettings();if(re!=null&&re.settings){const O={},we={};re.settings.forEach(Me=>{Me.type==="secret"?(we[Me.key]=!!Me.configured,O[Me.key]=""):O[Me.key]=Me.value}),g(O),x(we)}re!=null&&re.prefix&&(E(re.prefix),N(re.prefix))}catch(re){o(re.message,"error")}finally{y(!1)}};v.useEffect(()=>{Et()},[]);const sn=async re=>{const O=(re!==void 0?re:_).trim();if(!O||O.length>3){o(a("prefixValidation"),"error");return}T(!0);try{await $.updatePrefix(O),E(O),N(O),o(`${a("prefixUpdated")} (${O})`,"success")}catch(we){o(we.message,"error")}finally{T(!1)}},rn=async re=>{if(re.preventDefault(),ne!==I){o(a("passwordMatchError"),"error");return}if(ne.length<8){o(a("passwordMinLength"),"error");return}P(!0);try{await $.changePassword(D,ne),o(a("passwordChangedSuccess"),"success"),Z(""),pe(""),M("")}catch(O){o(O.message,"error")}finally{P(!1)}},ye={saveLabel:a("save"),savedLabel:a("saved")},Ce={saveLabel:a("save"),discardLabel:a("discard"),unsavedLabel:a("unsavedChanges"),savedLabel:a("saved")};return b?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(Oa,{className:"size-6",label:a("loading")})}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(Nc,{value:d,onChange:f,"aria-label":a("settings"),className:"overflow-x-auto",options:[{value:"general",label:a("tabGeneral"),icon:s.jsx(Eb,{size:17})},{value:"integrations",label:a("tabIntegrations"),icon:s.jsx(th,{size:17})},{value:"proxy",label:a("tabProxy"),icon:s.jsx(uc,{size:17})},{value:"security",label:a("tabSecurity"),icon:s.jsx(vh,{size:17})},{value:"storage",label:a("tabStorage"),icon:s.jsx(fy,{size:17})},{value:"feedback",label:a("tabFeedback"),icon:s.jsx(Rw,{size:17})}]}),d==="general"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs(at,{className:"flex flex-col gap-4 sm:gap-5",children:[s.jsx(fa,{icon:s.jsx(Zs,{size:22}),title:a("prefixTitle"),description:a("prefixDesc"),actions:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted",children:[a("activePrefix"),":"]}),s.jsx(vt,{tone:"info",className:"font-mono",children:k})]})}),s.jsxs("div",{className:"flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-semibold text-muted",children:a("prefixPresets")}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:uC.map(re=>{const O=k===re;return s.jsx(Le,{label:re,size:"md",variant:O?"primary":"secondary",className:"font-mono",onClick:()=>{N(re),sn(re)},children:re},re)})})]}),s.jsx(it,{label:a("changePrefix"),className:"min-w-[200px] flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{type:"text",className:"h-11 w-20 text-center font-mono sm:w-24",maxLength:3,placeholder:a("prefixPlaceholder"),value:_,onChange:re=>N(re.target.value),onKeyDown:re=>{re.key==="Enter"&&sn()}}),s.jsx(ge,{variant:"primary",icon:s.jsx(Xs,{size:16}),onClick:()=>sn(),disabled:j||_.trim()===k,loading:j,children:a(j?"saving":"prefixSaveBtn")})]})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-xs font-semibold text-muted sm:text-sm",children:a("prefixPreview")}),s.jsx(vt,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[_||k,"help"]})}),s.jsx(vt,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[_||k,"lang ar"]})}),s.jsx(vt,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[_||k,"sticker"]})})]})]}),s.jsxs(at,{className:"flex flex-col gap-4",children:[s.jsx(fa,{title:i==="ar"?"سلوك النظام والردود":"System Behavior & Delays"}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(zn,{label:a("interfaceLanguage"),description:a("interfaceLanguageDesc"),htmlFor:"panel-language",dirty:ue.dirty,saving:ue.status==="saving",justSaved:ue.status==="saved",error:ue.error,onSave:()=>ue.save(async re=>r(re)),onRevert:ue.revert,...ye,children:s.jsxs(Ht,{id:"panel-language",value:ue.value,onChange:re=>{const O=re.target.value;(O==="ar"||O==="en")&&ue.setValue(O)},children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]})}),s.jsx(zn,{label:a("botLanguage"),description:a("botLanguageDesc"),htmlFor:"bot-language",dirty:ee.dirty,saving:ee.status==="saving",justSaved:ee.status==="saved",error:ee.error,onSave:()=>ee.save(re=>z("bot_language",re)),onRevert:ee.revert,...ye,children:s.jsxs(Ht,{id:"bot-language",value:ee.value,onChange:re=>ee.setValue(re.target.value),children:[s.jsx("option",{value:"auto",children:a("langAuto")}),s.jsx("option",{value:"ar",children:a("langAr")}),s.jsx("option",{value:"en",children:a("langEn")})]})}),s.jsx(zn,{label:a("botTimezone"),description:a("botTimezoneDesc"),htmlFor:"bot-timezone",dirty:me.dirty,saving:me.status==="saving",justSaved:me.status==="saved",error:me.error,onSave:()=>me.save(re=>z("bot_timezone",re)),onRevert:me.revert,...ye,children:s.jsx(Be,{id:"bot-timezone",type:"text",className:"font-mono",placeholder:"Africa/Cairo",value:me.value,onChange:re=>me.setValue(re.target.value)})})]}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:re=>{re.preventDefault(),Pe.save(async O=>{if(O.min>O.max)throw new Error(a("delayRangeError"));await z("bot_min_delay_ms",O.min),await z("bot_max_delay_ms",O.max)})},onKeyDown:re=>{re.key==="Escape"&&Pe.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(it,{label:a("botMinDelay"),description:a("delaysDesc"),htmlFor:"bot-min-delay",children:s.jsx(Be,{id:"bot-min-delay",type:"number",value:Pe.draft.min,onChange:re=>Pe.setField("min",Number(re.target.value))})}),s.jsx(it,{label:a("botMaxDelay"),htmlFor:"bot-max-delay",children:s.jsx(Be,{id:"bot-max-delay",type:"number",value:Pe.draft.max,onChange:re=>Pe.setField("max",Number(re.target.value))})})]}),s.jsx(ih,{dirty:Pe.dirty,saving:Pe.status==="saving",justSaved:Pe.status==="saved",error:Pe.error,onDiscard:Pe.revert,...Ce})]})]}),s.jsxs(at,{className:"flex flex-col gap-4",children:[s.jsx(fa,{icon:s.jsx(pr,{size:20}),title:a("shareSettingsTitle"),description:a("shareSettingsDesc")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ge,{variant:"secondary",icon:s.jsx(Pb,{size:16}),onClick:Ve,loading:he,children:a("exportAction")}),s.jsx(ge,{variant:"secondary",icon:s.jsx(Sc,{size:16}),onClick:()=>{var re;return(re=w.current)==null?void 0:re.click()},children:a("importSettings")})]}),s.jsx("input",{ref:w,type:"file",accept:"application/json,.json",className:"hidden",onChange:Ct})]})]}),d==="integrations"&&s.jsxs(at,{className:"flex flex-col gap-5",children:[s.jsx(fa,{icon:s.jsx(th,{size:22}),title:a("tabIntegrations"),description:a("integrationsDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[s.jsx(zn,{label:a("weatherApiKey"),description:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command",htmlFor:"weather-api-key",dirty:te.dirty,saving:te.status==="saving",justSaved:te.status==="saved",error:te.error,onSave:()=>te.save(async re=>{await z("openweathermap_api_key",re),te.setValue("")}),onRevert:te.revert,...ye,actions:s.jsx(Le,{variant:"ghost",label:a(ae?"hideSecret":"showSecret"),icon:ae?s.jsx(qs,{size:16}):s.jsx(ha,{size:16}),onClick:()=>Q(!ae)}),children:s.jsx(Be,{id:"weather-api-key",type:ae?"text":"password",className:"font-mono",placeholder:p.openweathermap_api_key?"••••••••••••":"OpenWeatherMap API Key",value:te.value,onChange:re=>te.setValue(re.target.value)})}),s.jsx(zn,{label:a("youtubeApiKey"),description:i==="ar"?"مطلوب لأدوات البحث ومعلومات الفيديوهات من يوتيوب":"Required for YouTube search and video tools",htmlFor:"youtube-api-key",dirty:U.dirty,saving:U.status==="saving",justSaved:U.status==="saved",error:U.error,onSave:()=>U.save(async re=>{await z("youtube_api_key",re),U.setValue("")}),onRevert:U.revert,...ye,actions:s.jsx(Le,{variant:"ghost",label:a(V?"hideSecret":"showSecret"),icon:V?s.jsx(qs,{size:16}):s.jsx(ha,{size:16}),onClick:()=>le(!V)}),children:s.jsx(Be,{id:"youtube-api-key",type:V?"text":"password",className:"font-mono",placeholder:p.youtube_api_key?"••••••••••••":"YouTube Data API Key",value:U.value,onChange:re=>U.setValue(re.target.value)})})]})]}),d==="proxy"&&s.jsxs(at,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(fa,{className:"min-w-0 flex-1",icon:s.jsx(uc,{size:22}),title:a("proxyTitle"),description:a("proxyDesc")}),s.jsx(Zn,{className:"shrink-0",checked:!!h.whatsapp_proxy_enabled,onChange:re=>de("whatsapp_proxy_enabled",re)})]}),s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:re=>{re.preventDefault(),Ae.save(async O=>{await z("whatsapp_proxy_protocol",O.protocol),await z("whatsapp_proxy_host",O.host),await z("whatsapp_proxy_port",O.port),await z("whatsapp_proxy_username",O.username),O.password.trim()&&await z("whatsapp_proxy_password",O.password),Ae.setDraft({...O,password:""})})},onKeyDown:re=>{re.key==="Escape"&&Ae.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(it,{label:a("proxyProtocol"),htmlFor:"proxy-protocol",children:s.jsxs(Ht,{id:"proxy-protocol",value:Ae.draft.protocol,onChange:re=>Ae.setField("protocol",re.target.value),children:[s.jsx("option",{value:"http",children:"HTTP"}),s.jsx("option",{value:"https",children:"HTTPS"}),s.jsx("option",{value:"socks5",children:"SOCKS5"})]})}),s.jsx(it,{label:a("proxyHost"),htmlFor:"proxy-host",children:s.jsx(Be,{id:"proxy-host",type:"text",className:"font-mono",placeholder:"proxy.example.com",value:Ae.draft.host,onChange:re=>Ae.setField("host",re.target.value)})}),s.jsx(it,{label:a("proxyPort"),htmlFor:"proxy-port",children:s.jsx(Be,{id:"proxy-port",type:"number",placeholder:"1080",value:Ae.draft.port,onChange:re=>Ae.setField("port",Number(re.target.value))})}),s.jsx(it,{label:a("proxyUsername"),htmlFor:"proxy-username",children:s.jsx(Be,{id:"proxy-username",type:"text",className:"font-mono",value:Ae.draft.username,onChange:re=>Ae.setField("username",re.target.value)})}),s.jsx(it,{label:a("proxyPassword"),htmlFor:"proxy-password",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{id:"proxy-password",type:G?"text":"password",className:"min-w-0 flex-1",placeholder:p.whatsapp_proxy_password?"••••••••••••":void 0,value:Ae.draft.password,onChange:re=>Ae.setField("password",re.target.value)}),s.jsx(Le,{variant:"ghost",label:a(G?"hideSecret":"showSecret"),icon:G?s.jsx(qs,{size:16}):s.jsx(ha,{size:16}),onClick:()=>q(!G)})]})})]}),s.jsx(ih,{dirty:Ae.dirty,saving:Ae.status==="saving",justSaved:Ae.status==="saved",error:Ae.error,onDiscard:Ae.revert,...Ce})]})]}),d==="security"&&s.jsx("div",{className:"flex flex-col gap-5",children:s.jsxs(at,{className:"flex max-w-xl flex-col gap-4",children:[s.jsx(fa,{icon:s.jsx(Aw,{size:20}),title:a("changePassword")}),s.jsxs("form",{onSubmit:rn,className:"flex flex-col gap-3.5",children:[s.jsx(it,{label:a("currentPassword"),children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{type:W?"text":"password",className:"min-w-0 flex-1",required:!0,value:D,onChange:re=>Z(re.target.value)}),s.jsx(Le,{variant:"ghost",label:a(W?"hideSecret":"showSecret"),icon:W?s.jsx(qs,{size:16}):s.jsx(ha,{size:16}),onClick:()=>ie(!W)})]})}),s.jsx(it,{label:a("newPassword"),description:a("passwordMinLength"),children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{type:W?"text":"password",className:"min-w-0 flex-1",required:!0,minLength:8,value:ne,onChange:re=>pe(re.target.value)}),s.jsx(Le,{variant:"ghost",label:a(W?"hideSecret":"showSecret"),icon:W?s.jsx(qs,{size:16}):s.jsx(ha,{size:16}),onClick:()=>ie(!W)})]})}),s.jsx(it,{label:a("confirmPassword"),children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{type:W?"text":"password",className:"min-w-0 flex-1",required:!0,minLength:8,value:I,onChange:re=>M(re.target.value)}),s.jsx(Le,{variant:"ghost",label:a(W?"hideSecret":"showSecret"),icon:W?s.jsx(qs,{size:16}):s.jsx(ha,{size:16}),onClick:()=>ie(!W)})]})}),s.jsx(ge,{type:"submit",variant:"primary",className:"mt-2 w-full self-start sm:w-auto",icon:s.jsx(Xs,{size:16}),disabled:A,loading:A,children:a(A?"saving":"save")})]})]})}),d==="storage"&&s.jsxs(at,{className:"flex flex-col gap-5",children:[s.jsx(fa,{icon:s.jsx(fy,{size:22}),title:a("storageTitle"),description:a("storageDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(zn,{label:a("forwardTtl"),description:a("forwardTtlDesc"),htmlFor:"forward-ttl",dirty:fe.dirty,saving:fe.status==="saving",justSaved:fe.status==="saved",error:fe.error,onSave:()=>fe.save(re=>z("forward_score_ttl_days",re)),onRevert:fe.revert,...ye,children:s.jsx(Be,{id:"forward-ttl",type:"number",value:fe.value,onChange:re=>fe.setValue(Number(re.target.value))})}),s.jsx(zn,{label:a("maxFetchBytes"),description:a("maxFetchBytesDesc"),htmlFor:"max-fetch-bytes",dirty:Te.dirty,saving:Te.status==="saving",justSaved:Te.status==="saved",error:Te.error,onSave:()=>Te.save(re=>z("max_fetch_bytes",re)),onRevert:Te.revert,...ye,children:s.jsx(Be,{id:"max-fetch-bytes",type:"number",value:Te.value,onChange:re=>Te.setValue(Number(re.target.value))})}),s.jsx(zn,{label:a("stickerLibraryLimit"),htmlFor:"sticker-library-limit",description:a("stickerLibraryLimitDesc"),dirty:De.dirty,saving:De.status==="saving",justSaved:De.status==="saved",error:De.error,onSave:()=>De.save(re=>z("sticker_library_limit",re)),onRevert:De.revert,...ye,children:s.jsx(Be,{id:"sticker-library-limit",type:"number",min:1,max:1e5,value:De.value,onChange:re=>De.setValue(Number(re.target.value))})}),s.jsx(zn,{label:a("autoDeleteKeepDays"),htmlFor:"auto-delete-keep-days",description:a("autoDeleteKeepDaysDesc"),dirty:Ge.dirty,saving:Ge.status==="saving",justSaved:Ge.status==="saved",error:Ge.error,onSave:()=>Ge.save(re=>z("auto_delete_keep_days",re)),onRevert:Ge.revert,...ye,children:s.jsx(Be,{id:"auto-delete-keep-days",type:"number",min:1,max:365,value:Ge.value,onChange:re=>Ge.setValue(Number(re.target.value))})})]})]}),d==="feedback"&&s.jsx(cC,{}),s.jsx(en,{isOpen:!!xe,onClose:()=>ke(null),title:a("importTitle"),footer:s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"secondary",onClick:()=>ke(null),children:a("cancel")}),s.jsx(ge,{variant:"primary",onClick:ln,disabled:K,loading:K,children:a("importApply")})]}),children:xe&&s.jsxs("div",{className:"flex flex-col gap-3 text-xs text-text-main sm:text-sm",children:[s.jsx("p",{className:"text-muted",children:a("importSummary")}),s.jsxs("ul",{className:"flex flex-col gap-1.5 rounded-xl border border-line bg-panel-raised p-4",children:[s.jsxs("li",{children:[a("importPrefix"),":"," ",s.jsx("span",{className:"font-mono font-bold",children:(We=xe.commands)==null?void 0:We.prefix})]}),s.jsxs("li",{children:[Object.keys(xe.settings||{}).length," ",a("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((pt=xe.commands)==null?void 0:pt.permissions)||{}).length," ",a("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((tn=xe.commands)==null?void 0:tn.aliases)||{}).length," ",a("importAliasesCount")]}),s.jsxs("li",{children:[(((_t=xe.commands)==null?void 0:_t.disabled)||[]).length," ",a("importDisabledCount")]})]})]})})]})};function bc(a,i){return`${[...(a||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function Gv(a,i){const r=URL.createObjectURL(a),o=document.createElement("a");o.href=r,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(r),1500)}async function Vv(a,i){return Gv(a,i),{ok:!0,via:"browser"}}async function Yv(a,i,r){const o=new File([a],i,{type:r});if(typeof navigator.share=="function"&&typeof navigator.canShare=="function"&&navigator.canShare({files:[o]}))try{return await navigator.share({files:[o]}),{ok:!0,via:"share"}}catch(f){if(f instanceof DOMException&&f.name==="AbortError")return{ok:!1,cancelled:!0}}return Gv(a,i),{ok:!0,via:"browser"}}async function Tc(a,i,r,o,d,f){const h=await ZN(a,i,r,o,d,f);return a==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:h.name||d,dir:h.dir||"Downloads/Levix"}}const ml={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function zc(a,i,r,o){return{name:a||i,mime:r.type||o,blob:r}}async function dr(a,i){if(Ac())return Tc("save",`/dashboard/api/stickers/${encodeURIComponent(a.id)}/export?format=${i}`,"GET","",bc(a.name,i),ml[i]);const r=await $.exportSticker(a.id,i),o=zc(r.fileName,bc(a.name,i),r.blob,ml[i]);return Vv(o.blob,o.name)}async function Iv(a,i){if(Ac())return Tc("share",`/dashboard/api/stickers/${encodeURIComponent(a.id)}/export?format=${i}`,"GET","",bc(a.name,i),ml[i]);const r=await $.exportSticker(a.id,i),o=zc(r.fileName,bc(a.name,i),r.blob,ml[i]);return Yv(o.blob,o.name,o.mime)}async function mC(a,i){if(Ac())return Tc("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:a,format:i}),`stickers-${i}.zip`,ml.zip);const r=await $.exportStickers(a,i),o=zc(r.fileName,`stickers-${i}.zip`,r.blob,ml.zip);return Vv(o.blob,o.name)}async function pC(a,i){if(Ac())return Tc("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:a,format:i}),`stickers-${i}.zip`,ml.zip);const r=await $.exportStickers(a,i),o=zc(r.fileName,`stickers-${i}.zip`,r.blob,ml.zip);return Yv(o.blob,o.name,o.mime)}async function ph(a){if(a.length)try{await $.bulkStickers({action:"touch",ids:a})}catch{}}const gC=16*1024*1024,i0=200,xC=10,Kv=40,Mc=60,yC=60,bC=[['"','"'],["'","'"],["“","”"],["«","»"],["„","‟"],["‹","›"]],r0=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter("en",{granularity:"grapheme"}):null;function vC(a){const i=a.trim();if(i.length<2)return i;for(const[r,o]of bC)if(i.startsWith(r)&&i.endsWith(o)&&i.length>r.length+o.length-1)return i.slice(r.length,i.length-o.length).trim();return i}function SC(a){if(!r0)return[...a].length;let i=0;for(const r of r0.segment(a))i+=1;return i}function fr(a){const i=vC(a).normalize("NFC").replace(/\s+/g," ").trim(),r=SC(i);return r<1?"empty":r>Kv?"long":null}function wC(a){return a.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(a.name)}function kC(a){return new Promise(i=>{const r=URL.createObjectURL(a),o=new Image;o.onload=()=>{URL.revokeObjectURL(r),i({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(r),i(null)},o.src=r})}function jC(a){return new Promise(i=>{const r=URL.createObjectURL(a),o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{const d={width:o.videoWidth,height:o.videoHeight,duration:o.duration};URL.revokeObjectURL(r),o.src="",i(d)},o.onerror=()=>{URL.revokeObjectURL(r),i(null)},o.src=r})}async function NC(a,i){if(a.size<=0)return"stickerErr_NO_MEDIA";if(a.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(wC(a)){const o=await jC(a);return o?o.width>i.maxSide||o.height>i.maxSide?"stickerErr_DIMENSIONS_TOO_LARGE":Number.isFinite(o.duration)&&o.duration>i.videoSeconds+.05?"stickerErr_VIDEO_TOO_LONG":null:null}const r=await kC(a);return r&&(r.width>i.maxSide||r.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}function CC(a){return!a||a==="transparent"?"transparent":a==="#ffffff"?"white":a==="#000000"?"black":"custom"}const EC=({options:a,onChange:i,canRemoveBackground:r,name:o,onName:d,packId:f,onPack:h,packs:g})=>{var k,E,_;const{t:p}=Ze(),x=CC(a.background),b=((k=a.removeBackground)==null?void 0:k.tolerance)??.15,y=a.rotate??0;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{children:[s.jsx(dl,{htmlFor:"sticker-fit",children:p("fit")}),s.jsxs(Ht,{id:"sticker-fit",value:a.fit||"contain",onChange:N=>i({fit:N.target.value==="cover"?"cover":"contain"}),children:[s.jsx("option",{value:"contain",children:p("contain")}),s.jsx("option",{value:"cover",children:p("cover")})]})]}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-zoom",children:[p("zoom")," (",(a.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:a.zoom??1,onChange:N=>i({zoom:Number(N.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-x",children:[p("panX")," (",(a.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:a.panX??0,onChange:N=>i({panX:Number(N.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-y",children:[p("panY")," (",(a.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:a.panY??0,onChange:N=>i({panY:Number(N.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{onClick:()=>i({panX:0,panY:0,zoom:1}),children:p("resetPan")}),s.jsxs(ge,{onClick:()=>{const N=(y+90)%360;i({rotate:N})},children:[p("rotateQuarter")," (",y,"°)"]})]}),s.jsx(Il,{"aria-label":p("background"),className:"max-w-full flex-wrap",value:x,onChange:N=>{i(N==="transparent"?{background:"transparent"}:N==="white"?{background:"#ffffff"}:N==="black"?{background:"#000000"}:{background:"#3366ff"})},options:[{value:"transparent",label:p("transparent")},{value:"white",label:p("white")},{value:"black",label:p("black")},{value:"custom",label:p("customColor")}]}),x==="custom"&&s.jsx("input",{type:"color","aria-label":p("customColor"),value:/^#[0-9a-f]{6}$/i.test(a.background||"")?a.background:"#3366ff",onChange:N=>i({background:N.target.value.toLowerCase()}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),r&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(pc,{checked:((E=a.removeBackground)==null?void 0:E.mode)==="plain",onChange:N=>i({removeBackground:N.target.checked?{mode:"plain",tolerance:.15}:null}),label:p("removePlainBackground"),description:p("stickerRemoveHint")}),((_=a.removeBackground)==null?void 0:_.mode)==="plain"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-tolerance",children:[p("tolerance")," (",b.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:b,onChange:N=>i({removeBackground:{mode:"plain",tolerance:Number(N.target.value)}}),className:"w-full accent-brand-blue"})]})]}),s.jsxs("div",{children:[s.jsx(dl,{htmlFor:"sticker-name",children:p("stickerName")}),s.jsx(Be,{id:"sticker-name",value:o,maxLength:Mc,dir:"auto",onChange:N=>d(N.target.value),placeholder:p("stickerNamePlaceholder")})]}),s.jsxs("div",{children:[s.jsx(dl,{htmlFor:"sticker-pack",children:p("targetPack")}),s.jsxs(Ht,{id:"sticker-pack",value:f,onChange:N=>h(N.target.value),children:[s.jsx("option",{value:"",children:p("noPack")}),g.map(N=>s.jsx("option",{value:N.id,children:N.name},N.id))]})]})]})},_C=({options:a,onChange:i,kind:r,durationMs:o,limits:d,animatedOk:f})=>{const{t:h}=Ze();if(!(r==="video"||r==="gif"))return null;const p=o>0?o/1e3:d.videoSeconds,x=Math.min(d.videoSeconds,Math.max(0,p)),b=(y,k)=>{const E=Math.min(x,Math.max(0,y)),_=Math.min(d.stickerSeconds,Math.max(.5,k));i({trim:{start:E,duration:_}})};return s.jsxs(at,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx(pc,{checked:!!a.trim,onChange:y=>{y.target.checked?b(0,Math.min(d.stickerSeconds,Math.max(.5,p))):i({trim:null})},label:s.jsx("span",{className:"font-bold",children:h("trim")})}),a.trim&&s.jsxs("span",{className:"font-mono text-xs text-muted",dir:"ltr",children:[a.trim.start.toFixed(1),"s →"," ",(a.trim.start+a.trim.duration).toFixed(1),"s"]})]}),!f&&s.jsx("p",{className:"text-xs text-warn",children:h("animatedUnavailable")}),s.jsx("p",{className:"text-xs text-muted",children:h(r==="gif"?"gifTrimNote":"trimApplied")}),a.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[h("trimStart")," (",a.trim.start.toFixed(1)," ",h("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:x,step:.1,value:a.trim.start,onChange:y=>{var k;return b(Number(y.target.value),((k=a.trim)==null?void 0:k.duration)??.5)},className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-duration",children:[h("trimDuration")," (",a.trim.duration.toFixed(1)," ",h("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:a.trim.duration,onChange:y=>{var k;return b(((k=a.trim)==null?void 0:k.start)??0,Number(y.target.value))},className:"w-full accent-brand-blue"})]})]})},Bt=512;function AC(a,i,r){const o=r.fit||"contain",d=r.zoom??1,f=r.panX??0,h=r.panY??0,g=r.rotate??0,p=g===90||g===270,x=p?i:a,b=p?a:i,k=(o==="cover"?Bt/Math.min(x,b):Bt/Math.max(x,b))*d,E=Math.max(1,Math.round(x*k)),_=Math.max(1,Math.round(b*k)),N=Math.round((Bt-E)/2+f*Math.abs(Bt-E)/2),j=Math.round((Bt-_)/2+h*Math.abs(Bt-_)/2);return{width:E,height:_,x:N,y:j}}const TC='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function zC(a){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(a)}function MC(a){const i=/^#([0-9a-f]{6})$/i.exec(a.trim());if(!i)return"#000000";const r=Number.parseInt(i[1],16),o=r>>16&255,d=r>>8&255,f=r&255;return(.2126*o+.7152*d+.0722*f)/255>.6?"#000000":"#ffffff"}function RC(a,i,r,o,d,f){const h=Math.max(0,Math.min(f,o/2,d/2));a.beginPath(),a.moveTo(i+h,r),a.arcTo(i+o,r,i+o,r+d,h),a.arcTo(i+o,r+d,i,r+d,h),a.arcTo(i,r+d,i,r,h),a.arcTo(i,r,i+o,r,h),a.closePath(),a.fill()}function DC(a,i,r,o){const d=a==="center"?"center":a==="start"?i==="rtl"?"right":"left":i==="rtl"?"left":"right";return d==="center"?-r/2-o:d==="right"?-r-o:-o}function Fv(a,i,r){const o=[];for(const d of i){if(!d.text)continue;const f=zC(d.text)?"rtl":"ltr";a.save(),a.translate(d.x,d.y),a.rotate(d.rotate*Math.PI/180),a.direction=f,a.font=`${d.fontSize}px ${TC}`,a.textAlign=d.align,a.textBaseline="middle";const h=a.measureText(d.text).width,g=d.background?d.fontSize*.4:8,p=d.background?d.fontSize*.22:6,x=h+g*2,b=d.fontSize*1.25+p*2,y=DC(d.align,f,h,g),k=-b/2;d.background&&(a.fillStyle="rgba(0, 0, 0, 0.55)",RC(a,y,k,x,b,b/2)),r===d.id&&(a.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue("--color-brand-cyan").trim(),a.lineWidth=2,a.strokeRect(y-3,k-3,x+6,b+6)),d.outline&&(a.lineJoin="round",a.miterLimit=2,a.lineWidth=Math.max(2,d.fontSize/10),a.strokeStyle=MC(d.color),a.strokeText(d.text,0,0)),a.fillStyle=d.color,a.fillText(d.text,0,0),a.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:y,top:k,right:y+x,bottom:k+b})}return o}function OC(a,i,r){for(let o=a.length-1;o>=0;o--){const d=a[o],f=i-d.cx,h=r-d.cy,g=-d.rotate*Math.PI/180,p=f*Math.cos(g)-h*Math.sin(g),x=f*Math.sin(g)+h*Math.cos(g);if(p>=d.left&&p<=d.right&&x>=d.top&&x<=d.bottom)return d.id}return null}function LC(a){const i=a.filter(d=>d.text.trim().length>0);if(!i.length)return;const r=document.createElement("canvas");r.width=512,r.height=512;const o=r.getContext("2d");if(o)return Fv(o,i,null),r.toDataURL("image/png")}const UC=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function Wo(a,i,r){return Math.min(r,Math.max(i,a))}const BC=({mediaUrl:a,kind:i,width:r,height:o,options:d,layers:f,selectedId:h,onPan:g,onSelect:p,onMoveLayer:x,label:b})=>{const y=v.useRef(null),k=v.useRef(null),E=v.useRef([]),_=v.useRef(null),N=v.useRef(null),j=v.useRef(1),T=d.rotate??0,D=r>0&&o>0?AC(r,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:T}):null,Z=T===90||T===270,ne=D?Z?D.height:D.width:0,pe=D?Z?D.width:D.height:0,I=D?D.x+(D.width-ne)/2:0,M=D?D.y+(D.height-pe)/2:0,A=d.background&&d.background!=="transparent"?d.background:null;v.useEffect(()=>{const ae=y.current;if(!ae)return;const Q=()=>{const le=Math.min(ae.clientWidth,512);j.current=le>0?le/Bt:1,ae.style.setProperty("--stage-scale",String(j.current))};Q();const V=new ResizeObserver(Q);return V.observe(ae),()=>V.disconnect()},[]),v.useEffect(()=>{const ae=k.current;if(!ae)return;const Q=window.devicePixelRatio||1;ae.width=Bt*Q,ae.height=Bt*Q;const V=ae.getContext("2d");V&&(V.setTransform(Q,0,0,Q,0,0),V.clearRect(0,0,Bt,Bt),E.current=Fv(V,f,h))},[f,h]),v.useEffect(()=>{const ae=N.current,Q=d.trim;if(!ae||!Q||i!=="video"||!a)return;const V=Q.start,le=Q.start+Q.duration,he=()=>{(ae.currentTime<V-.05||ae.currentTime>=le-.02)&&(ae.currentTime=V)};return ae.addEventListener("timeupdate",he),ae.addEventListener("ended",he),ae.currentTime=V,()=>{ae.removeEventListener("timeupdate",he),ae.removeEventListener("ended",he)}},[d.trim,i,a]);const P=ae=>{const Q=ae.currentTarget.getBoundingClientRect();return{x:(ae.clientX-Q.left)/Q.width*Bt,y:(ae.clientY-Q.top)/Q.height*Bt}},G=ae=>{if(ae.button!==0)return;ae.currentTarget.setPointerCapture(ae.pointerId);const Q=P(ae),V=OC(E.current,Q.x,Q.y);if(V){const le=f.find(he=>he.id===V);if(!le)return;p(V),_.current={kind:"layer",id:V,x:Q.x,y:Q.y,originX:le.x,originY:le.y};return}p(null),D&&(_.current={kind:"pan",x:Q.x,y:Q.y,panX:d.panX??0,panY:d.panY??0,placeW:D.width,placeH:D.height})},q=ae=>{const Q=_.current;if(!Q)return;const V=P(ae);if(Q.kind==="layer"){x(Q.id,Wo(Q.originX+(V.x-Q.x),0,Bt),Wo(Q.originY+(V.y-Q.y),0,Bt));return}const le=Math.abs(Bt-Q.placeW),he=Math.abs(Bt-Q.placeH),ve=le<1?Q.panX:Wo(Q.panX+(V.x-Q.x)*2/le,-1,1),K=he<1?Q.panY:Wo(Q.panY+(V.y-Q.y)*2/he,-1,1);g(ve,K)},W=()=>{_.current=null},ie={position:"absolute",left:I,top:M,width:ne,height:pe,transform:`rotate(${T}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:y,className:"w-full",children:s.jsx("div",{className:"relative mx-auto overflow-hidden rounded-2xl border border-line",style:{width:"calc(512px * var(--stage-scale, 1))",height:"calc(512px * var(--stage-scale, 1))"},children:s.jsxs("div",{role:"img","aria-label":b,className:"absolute top-0 start-0 origin-top-left bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:32px_32px]",style:{width:Bt,height:Bt,transform:"scale(var(--stage-scale, 1))"},children:[A&&s.jsx("div",{className:"absolute inset-0",style:{background:A}}),D&&i==="video"?s.jsx("video",{ref:N,src:a,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:ie}):D&&s.jsx("img",{src:a,alt:"",draggable:!1,style:ie}),s.jsx("canvas",{ref:k,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:G,onPointerMove:q,onPointerUp:W,onPointerCancel:W})]})})})},HC=({layers:a,selectedId:i,onSelect:r,onChange:o,onDelete:d,onAddText:f,onAddEmoji:h})=>{const{t:g}=Ze(),p=a.find(x=>x.id===i)||null;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{onClick:f,children:g("addText")}),s.jsx(ge,{onClick:()=>h("😀"),children:g("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(dl,{children:g("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:UC.map(x=>s.jsx(Le,{label:x,variant:"secondary",onClick:()=>h(x),children:s.jsx("span",{className:"text-lg leading-none",children:x})},x))}),s.jsx(dl,{htmlFor:"emoji-free",children:g("customEmoji")}),s.jsx(Be,{id:"emoji-free",className:"mt-1",placeholder:g("emojiInputLabel"),onKeyDown:x=>{if(x.key==="Enter"){const b=x.currentTarget.value.trim();b&&(h(b),x.currentTarget.value="")}}})]}),a.length===0&&s.jsx("p",{className:"text-xs text-muted",children:g("noLayers")}),a.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:a.map(x=>{const b=x.id===i;return s.jsx(ge,{variant:b?"secondary":"ghost","aria-pressed":b,onClick:()=>r(x.id),className:Fe("h-auto w-full justify-start",b&&"border-brand-blue bg-brand-blue/10"),children:s.jsx("span",{className:"truncate",children:x.text||g("textPlaceholder")})},x.id)})}),p&&s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-line p-3",children:[s.jsx("p",{className:"text-xs font-bold",children:g("layerSelected")}),s.jsx(dl,{htmlFor:"layer-text",children:g("textContent")}),s.jsx(Be,{id:"layer-text",value:p.text,onChange:x=>o(p.id,{text:x.target.value})}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-size",children:g("textSize")}),s.jsx("input",{id:"layer-size",type:"range",min:16,max:200,value:p.fontSize,onChange:x=>o(p.id,{fontSize:Number(x.target.value)}),className:"w-full accent-brand-blue"}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-color",children:g("textColor")}),s.jsx("input",{id:"layer-color",type:"color",value:/^#[0-9a-f]{6}$/i.test(p.color)?p.color:"#ffffff",onChange:x=>o(p.id,{color:x.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx(Il,{"aria-label":g("textAlignment"),value:p.align,onChange:x=>o(p.id,{align:x}),options:[{value:"start",label:g("stickerAlignmentStart")},{value:"center",label:g("stickerAlignmentCenter")},{value:"end",label:g("stickerAlignmentEnd")}]}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-rotate",children:g("layerRotation")}),s.jsx("input",{id:"layer-rotate",type:"range",min:-180,max:180,value:p.rotate,onChange:x=>o(p.id,{rotate:Number(x.target.value)}),className:"w-full accent-brand-blue"}),s.jsx(pc,{checked:p.outline,onChange:x=>o(p.id,{outline:x.target.checked}),label:g("textOutline")}),s.jsx(pc,{checked:p.background,onChange:x=>o(p.id,{background:x.target.checked}),label:g("textBackground")}),s.jsx(ge,{variant:"danger",onClick:()=>d(p.id),icon:s.jsx(hl,{size:16}),children:g("deleteLayer")})]})]})},Qv=({open:a,title:i,packs:r,onClose:o,onPick:d,onCreated:f})=>{const{t:h}=Ze(),{toast:g}=qt(),[p,x]=v.useState(""),[b,y]=v.useState(null),[k,E]=v.useState(!1);v.useEffect(()=>{a||(x(""),y(null))},[a]);const _=async()=>{if(fr(p)){y(h("packNameLength"));return}E(!0),y(null);try{const j=await $.createPack(p.trim());x(""),f(j),d(j.id),g(h("packCreated"),"success")}catch(j){g(bt(h,j),"error")}finally{E(!1)}};return s.jsx(en,{isOpen:a,onClose:o,title:i,footer:s.jsx(ge,{onClick:o,children:h("close")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[r.length===0?s.jsx("p",{className:"text-sm text-muted",children:h("noPacks")}):s.jsx("div",{className:"flex max-h-64 flex-col gap-1.5 overflow-y-auto",children:r.map(N=>s.jsxs(ge,{variant:"ghost",onClick:()=>d(N.id),className:"h-auto w-full min-w-0 justify-start px-3 py-2.5",children:[s.jsx(Fl,{className:"flex-1 text-start",children:N.name}),s.jsx("span",{className:"ms-2 shrink-0 font-medium text-muted",children:N.count})]},N.id))}),s.jsxs("div",{className:"flex flex-col gap-1.5 border-t border-line pt-3",children:[s.jsx(dl,{htmlFor:"new-pack-name",children:h("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Be,{id:"new-pack-name",value:p,onChange:N=>{const j=N.target.value;x(j),b&&y(fr(j)?h("packNameLength"):null)},placeholder:h("newPackPlaceholder"),maxLength:80,dir:"auto"}),s.jsx(ge,{variant:"primary",onClick:_,disabled:k,children:h("createPack")})]}),b&&s.jsx("p",{className:"text-xs text-danger",children:b})]})]})})},qC=600;function PC(){const[a,i]=v.useState(null),[r,o]=v.useState(!1),[d,f]=v.useState(null),h=v.useRef(0);return v.useEffect(()=>()=>{h.current+=1},[]),{job:a,running:r,submitError:d,start:async x=>{const b=++h.current;f(null),i(null),o(!0);try{const{jobId:y}=await $.createStickerJob(x);for(;h.current===b;){const k=await $.getStickerJob(y);if(h.current!==b)return;if(i(k),k.state==="done"||k.state==="failed")break;await new Promise(E=>setTimeout(E,qC))}}catch(y){h.current===b&&f(y)}finally{h.current===b&&o(!1)}},reset:()=>{h.current+=1,i(null),f(null),o(!1)}}}const Jf={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function GC(a,i){return a(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const VC=({capabilities:a,capsError:i,onRetryCaps:r,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:h,onCreated:g})=>{var fe,Te,De,Ge,Pe,Ae,Ve,Ct,ln,Et,sn,rn;const{t:p}=Ze(),{toast:x}=qt(),b=PC(),[y,k]=v.useState(null),[E,_]=v.useState(null),[N,j]=v.useState("PANEL_UPLOAD"),[T,D]=v.useState(!1),[Z,ne]=v.useState(!1),[pe,I]=v.useState(Jf),[M,A]=v.useState([]),[P,G]=v.useState(null),[q,W]=v.useState(""),[ie,ae]=v.useState(""),[Q,V]=v.useState([]),[le,he]=v.useState(!1),[ve,K]=v.useState(!1),X=v.useRef(null),xe=v.useRef(null),ke=v.useRef(async()=>{});v.useEffect(()=>($.getPacks().then(ye=>V(ye.packs)).catch(()=>{}),()=>{X.current&&URL.revokeObjectURL(X.current)}),[]);const w=ye=>{X.current&&URL.revokeObjectURL(X.current);const Ce=URL.createObjectURL(ye);X.current=Ce,_(Ce)},z=async(ye,Ce,We,pt,tn)=>{if(!(a!=null&&a.webp))return;const _t=ye instanceof File?ye:new File([ye],Ce,{type:ye.type}),re=await NC(_t,a.limits);if(re){x(p(re),"error");return}D(!0),j(We);try{const O=pt?await Bv(pt,Ce,a.limits.uploadBytes):tn?await $.uploadExistingStickerSource(tn):await $.uploadStickerSource(_t,Ce);w(_t),k(O),I(Jf),x(p("uploadReady"),"success")}catch(O){x(bt(p,O),"error")}finally{D(!1)}};ke.current=z,v.useEffect(()=>{!o||!a||o===xe.current||(xe.current=o,d(),Promise.resolve(o.blob).then(ye=>ke.current(ye,o.name,o.source,o.token,o.existingId)).catch(ye=>x(bt(p,ye),"error")))},[o,a,d]);const de=()=>{b.reset(),k(null),W(""),ae(""),A([]),G(null),I(Jf),j("PANEL_UPLOAD"),X.current&&URL.revokeObjectURL(X.current),X.current=null,_(null),xe.current=null},ue=()=>{if(!y)return null;const ye=q.trim();if([...ye].length>Mc)return x(p("stickerNameTooLong"),"warning"),null;const Ce=LC(M);return{uploadId:y.uploadId,options:pe,...Ce?{overlay:Ce}:{},...ye?{name:ye}:{},...ie?{packId:ie}:{},source:N}},ee=()=>{const ye=ue();ye&&b.start(ye)},me=async(ye,Ce)=>{ye.ok&&(ye.via==="host"?x(an(p("stickerShareSaved"),{dir:ye.dir}),"success"):ye.via==="share"?x(p("shareDone"),"success"):x(p("downloaded"),"success"),await ph([Ce.id]),g())};if(i)return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:i}),s.jsx(ge,{onClick:r,children:p("retryLoad")})]});if(!a)return s.jsx(Kl,{text:p("loading")});if(!a.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:p("stickerErr_ENCODER_MISSING")});const te=((fe=b.job)==null?void 0:fe.state)==="done"?b.job.sticker:null;if(te)return s.jsxs("div",{className:"flex flex-col gap-4 max-w-md mx-auto",children:[s.jsx("div",{className:"aspect-square overflow-hidden rounded-2xl border border-line bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",children:s.jsx("img",{src:te.url,alt:te.name||p("stickerPreview"),className:"w-full h-full object-contain"})}),((Te=b.job)==null?void 0:Te.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:p("alreadyInLibrary")}),((De=b.job)==null?void 0:De.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:p("qualityReduced")}),((Ge=b.job)==null?void 0:Ge.created)!==!1&&s.jsx("p",{className:"text-sm text-ok",children:p("stickerCreated")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Le,{label:p("downloadWebp"),icon:s.jsx(Sc,{size:18}),onClick:()=>{dr(te,"webp").then(ye=>me(ye,te)).catch(ye=>x(bt(p,ye),"error"))}}),s.jsx(Le,{label:p("shareSticker"),icon:s.jsx(pr,{size:18}),onClick:()=>{Iv(te,"webp").then(ye=>me(ye,te)).catch(ye=>x(bt(p,ye),"error"))}}),s.jsx(ge,{disabled:!f,title:f?void 0:p("notConnectedHint"),onClick:()=>he(!0),children:p("sendViaWhatsapp")}),s.jsx(ge,{onClick:()=>K(!0),children:p("addToPack")}),s.jsx(ge,{variant:"primary",onClick:de,children:p("createAnother")}),s.jsx(ge,{onClick:h,children:p("goToLibrary")}),s.jsxs(La,{label:p("moreActions"),children:[s.jsx(ot,{onSelect:()=>{te.animated&&x(p("firstFrameHint"),"info"),dr(te,"png").then(ye=>me(ye,te)).catch(ye=>x(bt(p,ye),"error"))},children:p("downloadPng")}),te.animated&&s.jsx(ot,{disabled:!a.gif,title:p("gifOnlyAnimated"),onSelect:()=>{dr(te,"gif").then(ye=>me(ye,te)).catch(ye=>x(bt(p,ye),"error"))},children:p("downloadGif")})]})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:p("notConnectedHint")}),s.jsx(Rh,{open:le,busy:!1,onClose:()=>he(!1),onPick:ye=>{$.sendStickers({ids:[te.id],jid:ye}).then(Ce=>{Ce.sent>0?(x(p("stickerSent"),"success"),he(!1),g()):x(p("stickerErr_NOT_CONNECTED"),"error")}).catch(Ce=>x(bt(p,Ce),"error"))}}),s.jsx(Qv,{open:ve,title:p("addToPack"),packs:Q,onClose:()=>K(!1),onCreated:ye=>V(Ce=>[...Ce,ye]),onPick:ye=>{$.bulkStickers({action:"addToPack",ids:[te.id],packId:ye}).then(()=>{x(p("addedToPack"),"success"),K(!1),g()}).catch(Ce=>x(bt(p,Ce),"error"))}})]});const U=b.submitError||((Pe=b.job)==null?void 0:Pe.state)==="failed";return s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_320px] gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3",children:[!y&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${Z?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:ye=>{rc()&&(ye.preventDefault(),QN().then(async Ce=>{if(!Ce)return;const We=await fetch(Ce.url);if(!We.ok)throw new Error("source unavailable");await z(await We.blob(),Ce.name,"PANEL_UPLOAD",Ce.token)}).catch(Ce=>x(bt(p,Ce),"error")))},onDragOver:ye=>{ye.preventDefault(),ne(!0)},onDragLeave:()=>ne(!1),onDrop:ye=>{if(ye.preventDefault(),ne(!1),rc())return;const Ce=ye.dataTransfer.files[0];Ce&&z(Ce,Ce.name,"PANEL_UPLOAD")},children:[s.jsx(Pb,{size:28,className:"text-muted"}),s.jsx("span",{className:"text-sm font-bold text-text-main",children:p("stickerDrag")}),s.jsx("span",{className:"text-xs text-muted",children:p("uploadHint")}),s.jsx("input",{type:"file",accept:"image/*,video/*,.webp,.gif",className:"sr-only",disabled:rc(),onChange:ye=>{var We;const Ce=(We=ye.target.files)==null?void 0:We[0];ye.target.value="",Ce&&z(Ce,Ce.name,"PANEL_UPLOAD")}})]}),T&&s.jsx(Kl,{text:p("loading")}),y&&E&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:an(p("stickerUploadInfo"),{kind:GC(p,y.kind),size:Math.max(1,Math.round(y.size/1024))})}),s.jsx(BC,{mediaUrl:E,kind:y.kind,width:y.width,height:y.height,options:pe,layers:M,selectedId:P,label:p("previewStage"),onPan:(ye,Ce)=>I(We=>({...We,panX:ye,panY:Ce})),onSelect:G,onMoveLayer:(ye,Ce,We)=>A(pt=>pt.map(tn=>tn.id===ye?{...tn,x:Ce,y:We}:tn))}),s.jsx(_C,{options:pe,onChange:ye=>I(Ce=>({...Ce,...ye})),kind:y.kind,durationMs:y.durationMs,limits:a.limits,animatedOk:a.animated})]}),(b.running||((Ae=b.job)==null?void 0:Ae.state)==="queued"||((Ve=b.job)==null?void 0:Ve.state)==="running")&&s.jsxs("div",{children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:s.jsx("div",{className:"h-full bg-brand-blue",style:{width:`${Math.round((((Ct=b.job)==null?void 0:Ct.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:uN(p,((ln=b.job)==null?void 0:ln.state)==="queued"?"queued":(Et=b.job)==null?void 0:Et.stage)})]}),U&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:b.submitError?bt(p,b.submitError):Mh(p,(rn=(sn=b.job)==null?void 0:sn.error)==null?void 0:rn.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ge,{variant:"primary",onClick:ee,children:p("tryAgain")}),s.jsx(ge,{onClick:de,children:p("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[y&&s.jsx(EC,{options:pe,onChange:ye=>I(Ce=>({...Ce,...ye})),canRemoveBackground:a.backgroundRemoval.includes("plain"),name:q,onName:W,packId:ie,onPack:ae,packs:Q}),y&&s.jsx(HC,{layers:M,selectedId:P,onSelect:G,onChange:(ye,Ce)=>A(We=>We.map(pt=>pt.id===ye?{...pt,...Ce}:pt)),onDelete:ye=>{A(Ce=>Ce.filter(We=>We.id!==ye)),G(Ce=>Ce===ye?null:Ce)},onAddText:()=>{const ye=crypto.randomUUID();A(Ce=>[...Ce,{id:ye,text:p("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),G(ye)},onAddEmoji:ye=>{const Ce=crypto.randomUUID();A(We=>[...We,{id:Ce,text:ye,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),G(Ce)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{variant:"primary",disabled:!y||b.running||T,onClick:ee,icon:s.jsx(Fs,{size:16}),children:p("createBtn")}),y&&s.jsx(ge,{onClick:de,disabled:b.running,children:p("clearLbl")})]})]})]})};let oc=null,cc=!1,da=null;function o0(a){da=a}async function YC(a,i){var r;try{const o=await Bv(a,i,gC),{jobId:d}=await $.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await $.getStickerJob(d);if(f.state==="done"){da==null||da({type:"saved",created:f.created!==!1,qualityReduced:f.qualityReduced===!0});return}if(f.state==="failed"){da==null||da({type:"error",code:(r=f.error)==null?void 0:r.code});return}await new Promise(h=>setTimeout(h,600))}}catch(o){da==null||da({type:"error",code:o instanceof Rt?o.code:void 0})}finally{cc=!1}}function IC(){if(cc)return oc;const a=XN();return(a==null?void 0:a.intent)==="create"?oc={blob:fetch(a.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:a.name||"sticker",source:"MEDIA_HUB",token:a.token}:(a==null?void 0:a.intent)==="save"&&!cc&&(cc=!0,YC(a.token,a.name||"sticker")),oc}function KC(){oc=null}const Xv=({count:a,animatedSelected:i,canRemove:r,sendReason:o,exportReason:d,onSelectAll:f,onClear:h,onFavorite:g,onUnfavorite:p,onAdd:x,onMove:b,onRemove:y,onDownload:k,onConvert:E,onShare:_,onSend:N,onDelete:j})=>{const{t:T}=Ze();return a===0?null:s.jsxs(at,{className:"border-brand-blue/30 bg-brand-blue/10",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"me-auto text-sm font-bold text-text-main",children:an(T("nSelected"),{n:a})}),s.jsx(Le,{label:a>1?T("downloadZip"):T("download"),icon:s.jsx(Sc,{size:16}),onClick:k,disabled:!!d}),s.jsx(Le,{label:T("sendViaWhatsapp"),icon:s.jsx(mr,{size:16,className:"rtl:-scale-x-100"}),onClick:N,disabled:!!o}),s.jsx(Le,{label:T("shareSticker"),icon:s.jsx(pr,{size:16}),onClick:_}),s.jsxs(La,{label:T("moreActions"),children:[s.jsx(ot,{onSelect:f,children:T("selectVisible")}),s.jsx(ot,{onSelect:h,children:T("clearSelection")}),s.jsx(cr,{}),s.jsx(ot,{onSelect:g,children:T("favorite")}),s.jsx(ot,{onSelect:p,children:T("unfavorite")}),s.jsx(cr,{}),s.jsx(ot,{onSelect:x,children:T("addToPack")}),s.jsx(ot,{onSelect:b,children:T("moveToPack")}),r&&s.jsx(ot,{onSelect:y,children:T("removeFromPack")}),s.jsx(ot,{onSelect:E,disabled:!!d,children:T("convertToImage")}),s.jsx(cr,{}),s.jsx(ot,{danger:!0,onSelect:j,children:T("delete")})]})]}),o&&s.jsx("p",{className:"mt-2 text-xs text-muted",children:o}),d&&s.jsx("p",{className:"mt-2 text-xs text-muted",children:d}),i&&s.jsx("p",{className:"mt-2 text-xs text-muted",children:T("firstFrameHint")})]})},FC=({open:a,busy:i,count:r,inUse:o,packs:d,onClose:f,onConfirm:h,onConfirmEverywhere:g})=>{const{t:p}=Ze();return s.jsx(en,{isOpen:a,onClose:f,title:p("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[s.jsx(ge,{onClick:f,disabled:i,children:p("cancel")}),o?s.jsx(ge,{variant:"danger",onClick:g,disabled:i,children:p("deleteEverywhere")}):s.jsx(ge,{variant:"danger",onClick:h,disabled:i,children:p("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2 text-sm text-text-main",children:[s.jsx("p",{children:an(p("nSelected"),{n:r})}),o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:p(r===1?"inUseBody":"inUseBulkBody")}),d.length>0&&s.jsxs("p",{children:[p("inUsePacksLabel"),":"," ",d.map((x,b)=>s.jsxs(v.Fragment,{children:[b>0&&", ",s.jsx(Fl,{as:"bdi",children:x.name})]},x.id))]}),s.jsx("p",{className:"text-xs text-muted",children:p("deleteEverywhereHint")})]}):s.jsx("p",{children:p("deleteConfirm")})]})})},QC="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",XC=({sticker:a,packs:i,isConnected:r,gifEnabled:o,onClose:d,onRename:f,onFavorite:h,onAddToPack:g,onRemoveFromPack:p,onDownload:x,onShare:b,onSend:y,onDelete:k,onOpenInCreate:E})=>{const{t:_}=Ze(),[N,j]=v.useState(""),[T,D]=v.useState("");if(v.useEffect(()=>{j((a==null?void 0:a.name)||""),D("")},[a]),!a)return null;const Z=i.filter(I=>a.packIds.includes(I.id)),ne=i.filter(I=>!a.packIds.includes(I.id)),pe=a.animated&&o?"gif":"webp";return s.jsx(en,{isOpen:!!a,onClose:d,title:s.jsx(Fl,{children:a.name||_("stickerPreview")}),maxWidth:"42.5rem",footer:s.jsx("div",{className:"flex w-full justify-end gap-2",children:s.jsx(ge,{onClick:d,children:_("close")})}),children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:`relative mx-auto aspect-square w-full max-w-[280px] overflow-hidden rounded-2xl border border-line ${QC}`,children:[s.jsx("img",{src:a.url,alt:a.name||_("stickerPreview"),className:"h-full w-full object-contain"}),s.jsxs("div",{className:"absolute top-2 end-2 flex flex-col gap-1.5",children:[s.jsx(Le,{label:_(pe==="gif"?"downloadGif":"downloadWebp"),icon:s.jsx(Sc,{size:16}),onClick:()=>x(pe)}),s.jsx(Le,{label:_("shareSticker"),icon:s.jsx(pr,{size:16}),onClick:b})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ge,{variant:"primary",onClick:y,disabled:!r,title:r?void 0:_("notConnectedHint"),icon:s.jsx(mr,{size:16,className:"rtl:-scale-x-100"}),children:_("sendViaWhatsapp")}),s.jsx(Le,{label:a.favorite?_("unfavorite"):_("favorite"),"aria-pressed":a.favorite,onClick:()=>h(!a.favorite),icon:s.jsx(Sh,{size:16,className:a.favorite?"fill-warn text-warn":void 0})}),s.jsx("span",{className:"ms-auto",children:s.jsxs(La,{label:_("moreActions"),align:"end",children:[s.jsx(ot,{onSelect:()=>x("webp"),children:_("downloadWebp")}),s.jsx(ot,{title:a.animated?_("firstFrameHint"):void 0,onSelect:()=>x("png"),children:_("downloadPng")}),a.animated&&s.jsx(ot,{disabled:!o,title:_("gifOnlyAnimated"),onSelect:()=>x("gif"),children:_("downloadGif")}),s.jsx(ot,{onSelect:E,children:_("openInCreate")}),s.jsx(cr,{}),s.jsx(ot,{danger:!0,onSelect:k,children:_("delete")})]})})]}),a.animated&&s.jsx("p",{className:"text-xs text-muted",children:_("firstFrameHint")}),!r&&s.jsx("p",{className:"text-xs text-muted",children:_("notConnectedHint")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Be,{value:N,onChange:I=>j(I.target.value),maxLength:Mc,dir:"auto","aria-label":_("stickerName"),placeholder:_("stickerNamePlaceholder")}),s.jsx(ge,{variant:"primary",onClick:()=>f(N.trim()),children:_("rename")})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-bold text-text-main",children:_("inUsePacksLabel")}),Z.length===0?s.jsx("p",{className:"text-xs text-muted",children:_("notInPack")}):s.jsx("ul",{className:"flex flex-col gap-1.5",children:Z.map(I=>s.jsxs("li",{className:"flex items-center justify-between gap-2",children:[s.jsx(Fl,{className:"flex-1 text-sm",children:I.name}),s.jsx(Le,{label:_("removeFromPack"),variant:"ghost",icon:s.jsx(Da,{size:16}),onClick:()=>p(I.id)})]},I.id))}),ne.length>0&&s.jsxs("div",{className:"mt-2 flex gap-2",children:[s.jsxs(Ht,{value:T,onChange:I=>D(I.target.value),"aria-label":_("addToPack"),children:[s.jsx("option",{value:"",children:_("selectPack")}),ne.map(I=>s.jsx("option",{value:I.id,children:I.name},I.id))]}),s.jsx(ge,{variant:"primary",disabled:!T,onClick:()=>T&&g(T),children:_("addToPack")})]})]})]})})};function ZC(a){const{t:i}=Ze(),{toast:r}=qt(),[o,d]=v.useState(null),[f,h]=v.useState(!1);return{phase:o,busy:f,requestDelete:b=>{b.length&&d({kind:"ask",ids:b})},run:async(b,y)=>{var k;h(!0);try{if(b.length===1&&!y){try{await $.deleteSticker(b[0],!1),r(i("deleted"),"success"),d(null),a()}catch(j){if(j instanceof Rt&&j.code==="IN_USE"){const T=Array.isArray((k=j.data)==null?void 0:k.packs)?j.data.packs:[];d({kind:"inUse",ids:b,packs:T,otherSkipped:0})}else r(bt(i,j),"error")}return}const E=await $.bulkStickers({action:"delete",ids:b,confirm:y}),_=E.skipped.filter(j=>j.code==="IN_USE").map(j=>j.id),N=E.skipped.length-_.length;if(!y&&_.length>0){d({kind:"inUse",ids:_,packs:[],otherSkipped:N});return}N>0?r(i("skippedOther"),"warning"):r(i("deleted"),"success"),d(null),a()}catch(E){r(bt(i,E),"error")}finally{h(!1)}},close:()=>{f||d(null)}}}function JC(a,i,r){const o=new Map(r.map(f=>[f.id,f.name])),d=new Map;for(const f of a){const h=i.find(g=>g.id===f);for(const g of(h==null?void 0:h.packIds)??[])d.set(g,o.get(g)||g)}return[...d].map(([f,h])=>({id:f,name:h}))}function Zv({items:a,packs:i,selectedIds:r,clearSelection:o,reload:d,fromPackId:f,isConnected:h,gifEnabled:g,onOpenInCreate:p,onPackCreated:x}){var he,ve,K;const{t:b}=Ze(),{toast:y}=qt(),k=v.useRef(!1),[E,_]=v.useState(null),[N,j]=v.useState(null),[T,D]=v.useState([]),[Z,ne]=v.useState([]),[pe,I]=v.useState(!1),M=ZC(()=>{_(null),o(),d()}),A=a.find(X=>X.id===E)||null,P=r.length>i0?b("stickerExportLimit"):null,G=h?r.length>xC?b("stickerSendLimit"):null:b("notConnectedHint"),q=((he=M.phase)==null?void 0:he.kind)==="inUse"?M.phase.packs.length?M.phase.packs:JC(M.phase.ids,a,i):[],W=X=>{X.ok&&(X.via==="host"?y(an(b("stickerShareSaved"),{dir:X.dir}),"success"):X.via==="share"?y(b("shareDone"),"success"):y(b("downloaded"),"success"))},ie=async X=>{if(!k.current){k.current=!0;try{await X()}catch(xe){y(bt(b,xe),"error")}finally{k.current=!1}}},ae=X=>a.find(xe=>xe.id===X),Q=(X,xe,ke)=>ie(async()=>{if(!X.length||X.length>i0)return;const w=X.length===1?ae(X[0]):null;if(X.length===1&&!w)return;const z=X.some(ue=>{var ee;return(ee=ae(ue))==null?void 0:ee.animated});xe==="png"&&z&&y(b("firstFrameHint"),"info");const de=X.length===1&&w?await(ke?Iv(w,xe):dr(w,xe)):await(ke?pC(X,xe):mC(X,xe));W(de),de.ok&&(await ph(X),d())}),V=(X,xe)=>ie(async()=>{if(!X.length)return;const ke=await $.bulkStickers({action:xe?"favorite":"unfavorite",ids:X});y(ke.skipped.length?b("skippedOther"):b("saved"),ke.skipped.length?"warning":"success"),d()}),le=(X,xe,ke)=>ie(async()=>{if(!ke.length)return;const w=await $.bulkStickers({action:X,ids:ke,packId:xe,...X==="moveToPack"&&f?{fromPackId:f}:{}}),z=b(X==="addToPack"?"addedToPack":"movedToPack");y(w.skipped.length?b("skippedOther"):z,w.skipped.length?"warning":"success"),j(null),d()});return{exportReason:P,sendReason:G,openDetail:X=>_(X.id),toggleFavorite:X=>void V([X.id],!X.favorite),favorite:()=>void V(r,!0),unfavorite:()=>void V(r,!1),askAdd:()=>{D(r),j("add")},askMove:()=>{D(r),j("move")},remove:()=>{!f||!r.length||ie(async()=>{const X=await $.bulkStickers({action:"removeFromPack",ids:r,packId:f});y(X.skipped.length?b("skippedOther"):b("removedFromPack"),X.skipped.length?"warning":"success"),o(),d()})},download:()=>void Q(r,"webp",!1),convert:()=>void Q(r,"png",!1),share:()=>void Q(r,"webp",!0),askSend:()=>{G||!r.length||ne(r)},askDelete:()=>M.requestDelete(r),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(Qv,{open:N!==null,title:b(N==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>j(null),onCreated:x,onPick:X=>void le(N==="move"?"moveToPack":"addToPack",X,T)}),s.jsx(Rh,{open:Z.length>0,busy:pe,onClose:()=>ne([]),onPick:X=>{ie(async()=>{I(!0);try{(await $.sendStickers({ids:Z,jid:X})).sent>0?(y(Z.length>1?b("stickersSent"):b("stickerSent"),"success"),ne([]),d()):y(b("stickerErr_NOT_CONNECTED"),"error")}finally{I(!1)}})}}),s.jsx(FC,{open:M.phase!==null,busy:M.busy,count:((ve=M.phase)==null?void 0:ve.ids.length)??0,inUse:((K=M.phase)==null?void 0:K.kind)==="inUse",packs:q,onClose:M.close,onConfirm:()=>{M.phase&&M.run(M.phase.ids,!1)},onConfirmEverywhere:()=>{M.phase&&M.run(M.phase.ids,!0)}}),s.jsx(XC,{sticker:A,packs:i,isConnected:h,gifEnabled:g,onClose:()=>_(null),onRename:X=>{if(A){if([...X.trim()].length>Mc){y(b("stickerNameTooLong"),"warning");return}ie(async()=>{await $.updateSticker(A.id,{name:X.trim()}),y(b("renamed"),"success"),d()})}},onFavorite:X=>{A&&ie(async()=>{await $.updateSticker(A.id,{favorite:X}),y(b("saved"),"success"),d()})},onAddToPack:X=>{A&&le("addToPack",X,[A.id])},onRemoveFromPack:X=>{A&&ie(async()=>{await $.bulkStickers({action:"removeFromPack",ids:[A.id],packId:X}),y(b("removedFromPack"),"success"),d()})},onDownload:X=>{if(A){if(X==="gif"){ie(async()=>{const xe=await dr(A,"gif");W(xe),xe.ok&&(await ph([A.id]),d())});return}Q([A.id],X,!1)}},onShare:()=>{A&&Q([A.id],"webp",!0)},onSend:()=>{A&&h&&ne([A.id])},onDelete:()=>{A&&M.requestDelete([A.id])},onOpenInCreate:()=>{A&&(_(null),p(A))}})]})}}const $C="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:16px_16px]",Jv=({sticker:a,selected:i,onToggle:r,onOpen:o,onFavorite:d})=>{const{t:f}=Ze(),h=a.name||f("stickerPreview");return s.jsxs("div",{className:Fe("relative aspect-square overflow-hidden rounded-xl border bg-panel",i?"border-brand-blue ring-2 ring-brand-blue/50":"border-line"),children:[s.jsx(ge,{variant:"ghost",onClick:()=>o(),"aria-label":f("stickerOpen"),className:"absolute inset-0 h-auto min-h-0 w-full rounded-none p-0 hover:bg-transparent",children:s.jsx("img",{src:a.thumbUrl,alt:"",loading:"lazy",draggable:!1,className:Fe("h-full w-full object-contain",$C)})}),s.jsx(Le,{label:f("stickerSelect"),variant:i?"primary":"secondary","aria-pressed":i,className:"absolute top-1 start-1 z-10",onClick:g=>r(g.shiftKey),icon:s.jsx(vc,{size:16,strokeWidth:3,className:i?void 0:"opacity-40"})}),a.animated&&s.jsx(vt,{tone:"neutral",className:"pointer-events-none absolute bottom-1 start-1 z-10",children:f("gifBadge")}),s.jsx(Le,{label:a.favorite?f("unfavorite"):f("favorite"),"aria-pressed":a.favorite,variant:"secondary",className:"absolute top-1 end-1 z-10",onClick:d,icon:s.jsx(Sh,{size:16,className:a.favorite?"fill-warn text-warn":"text-muted"})}),s.jsx("span",{className:"sr-only",children:h})]})},WC=({items:a,total:i,loading:r,loadingMore:o,error:d,hasMore:f,emptyText:h,selected:g,onToggle:p,onOpen:x,onFavorite:b,onLoadMore:y,onRetry:k})=>{const{t:E}=Ze();return r&&a.length===0?s.jsx(Kl,{text:E("loading")}):d&&a.length===0?s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:d}),s.jsx(ge,{onClick:k,children:E("retryLoad")})]}):a.length===0?s.jsx(Sn,{icon:s.jsx(wh,{size:28,className:"text-muted"}),text:h}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:an(E("showingCount"),{shown:a.length,total:i})}),s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8 gap-2 sm:gap-3",children:a.map((_,N)=>s.jsx(Jv,{sticker:_,selected:g.has(_.id),onToggle:j=>p(N,j),onOpen:()=>x(_),onFavorite:()=>b(_)},_.id))}),f&&s.jsx(ge,{onClick:y,disabled:o,className:"self-center",children:E(o?"loading":"loadMore")})]})};function $v(a){const[i,r]=v.useState(new Set),o=v.useRef(null),d=a.join(`
|
|
514
|
-
`);return v.useEffect(()=>{const p=new Set(d?d.split(`
|
|
515
|
-
`):[]);r(x=>{let b=!1;const y=new Set;for(const k of x)p.has(k)?y.add(k):b=!0;return b?y:x})},[d]),{selected:i,toggle:(p,x)=>{const b=a[p];b&&r(y=>{const k=new Set(y);if(x&&o.current!=null){const E=Math.min(o.current,p),_=Math.max(o.current,p);for(let N=E;N<=_;N++){const j=a[N];j&&k.add(j)}return k}return k.has(b)?k.delete(b):k.add(b),o.current=p,k})},selectAll:()=>r(new Set(a)),clear:()=>{o.current=null,r(new Set)}}}function eE(a){const{t:i}=Ze(),{toast:r}=qt(),[o,d]=v.useState(""),[f,h]=v.useState(""),[g,p]=v.useState(a==="recent"?"recent":"newest"),[x,b]=v.useState(a),[y,k]=v.useState(""),[E,_]=v.useState([]),[N,j]=v.useState(0),[T,D]=v.useState([]),[Z,ne]=v.useState(!0),[pe,I]=v.useState(!1),[M,A]=v.useState(null),P=v.useRef(0);v.useEffect(()=>{const ae=setTimeout(()=>h(o),300);return()=>clearTimeout(ae)},[o]);const G=v.useCallback(()=>{$.getPacks().then(ae=>D(ae.packs)).catch(()=>{})},[]);v.useEffect(()=>{G()},[G]);const q=v.useCallback(async(ae,Q)=>{const V=++P.current;Q?I(!0):ne(!0),A(null);try{const le=await $.getStickers({q:f||void 0,sort:g,filter:x,pack:y||void 0,offset:ae,limit:yC});if(V!==P.current)return;_(he=>Q?[...he,...le.items]:le.items),j(le.total)}catch(le){if(V!==P.current)return;const he=bt(i,le);A(he),r(he,"error")}finally{V===P.current&&(ne(!1),I(!1))}},[f,g,x,y,i,r]);v.useEffect(()=>{q(0,!1)},[q]);const W=v.useCallback(()=>{G(),q(0,!1)},[q,G]),ie=v.useCallback(()=>{pe||E.length>=N||q(E.length,!0)},[E.length,q,pe,N]);return{q:o,setQ:d,sort:g,setSort:p,filter:x,setFilter:b,pack:y,setPack:k,items:E,total:N,packs:T,loading:Z,loadingMore:pe,error:M,hasMore:E.length<N,reload:W,loadMore:ie,loadPacks:G,lockedFilter:a!=="all"}}const $f=({preset:a,isConnected:i,gifEnabled:r,refreshKey:o,onOpenInCreate:d})=>{const{t:f}=Ze(),h=eE(a),g=h.items.map(j=>j.id),p=$v(g),x=[...p.selected],b=h.pack&&h.pack!=="none"?h.pack:void 0,y=v.useRef(h.reload);y.current=h.reload,v.useEffect(()=>{o!==0&&y.current()},[o]);const k=Zv({items:h.items,packs:h.packs,selectedIds:x,clearSelection:p.clear,reload:h.reload,fromPackId:b,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:h.loadPacks}),E=h.q||h.pack||!h.lockedFilter&&h.filter!=="all"?f("noResults"):f(a==="favorites"?"favoritesEmpty":a==="recent"?"recentEmpty":"emptyLibrary"),_=h.items.some(j=>p.selected.has(j.id)&&j.animated),N=(h.lockedFilter||h.filter==="all"?0:1)+(h.pack?1:0);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(Cc,{children:[s.jsx(Be,{type:"search",value:h.q,onChange:j=>h.setQ(j.target.value),placeholder:f("searchStickers"),"aria-label":f("searchStickers"),className:"min-w-48 flex-1"}),s.jsxs(jc,{label:f("filter"),resetLabel:f("reset"),activeCount:N,onReset:()=>{h.lockedFilter||h.setFilter("all"),h.setPack("")},children:[!h.lockedFilter&&s.jsxs(Ht,{"aria-label":f("filterBy"),value:h.filter,onChange:j=>h.setFilter(j.target.value),children:[s.jsx("option",{value:"all",children:f("allStickers")}),s.jsx("option",{value:"favorites",children:f("favorites")}),s.jsx("option",{value:"recent",children:f("recent")}),s.jsx("option",{value:"animated",children:f("animated")}),s.jsx("option",{value:"static",children:f("static")})]}),s.jsxs(Ht,{"aria-label":f("packFilter"),value:h.pack,onChange:j=>h.setPack(j.target.value),children:[s.jsx("option",{value:"",children:f("anyPack")}),s.jsx("option",{value:"none",children:f("noPack")}),h.packs.map(j=>s.jsx("option",{value:j.id,children:j.name},j.id))]})]}),s.jsx(xv,{label:f("sort"),value:h.sort,onChange:j=>h.setSort(j),options:[{value:"newest",label:f("sortNewest")},{value:"oldest",label:f("sortOldest")},{value:"name",label:f("sortName")},{value:"recent",label:f("sortRecent")}]})]}),h.items.length>0&&x.length===0&&s.jsx("div",{children:s.jsx(ge,{variant:"ghost",size:"sm",onClick:p.selectAll,children:f("selectAll")})}),s.jsx(Xv,{count:x.length,animatedSelected:_,canRemove:!!b,sendReason:x.length?k.sendReason:null,exportReason:x.length?k.exportReason:null,onSelectAll:p.selectAll,onClear:p.clear,onFavorite:k.favorite,onUnfavorite:k.unfavorite,onAdd:k.askAdd,onMove:k.askMove,onRemove:k.remove,onDownload:k.download,onConvert:k.convert,onShare:k.share,onSend:k.askSend,onDelete:k.askDelete}),s.jsx(WC,{items:h.items,total:h.total,loading:h.loading,loadingMore:h.loadingMore,error:h.error,hasMore:h.hasMore,emptyText:E,selected:p.selected,onToggle:p.toggle,onOpen:k.openDetail,onFavorite:k.toggleFavorite,onLoadMore:h.loadMore,onRetry:h.reload}),k.dialogs]})},tE=({packId:a,isConnected:i,gifEnabled:r,onBack:o,onOpenInCreate:d})=>{const{t:f}=Ze(),{toast:h}=qt(),[g,p]=v.useState(null),[x,b]=v.useState([]),[y,k]=v.useState([]),[E,_]=v.useState(!0),[N,j]=v.useState(null),[T,D]=v.useState(0),[Z,ne]=v.useState(!1),pe=v.useRef(""),I=x.map(Q=>Q.id),M=$v(I),A=[...M.selected];v.useEffect(()=>{if(T<0)return;let Q=!0;return j(null),Promise.all([$.getPack(a),$.getPacks()]).then(([V,le])=>{Q&&(p(V.pack),b(V.items),k(le.packs))}).catch(V=>{Q&&j(bt(f,V))}).finally(()=>{Q&&_(!1)}),()=>{Q=!1}},[a,T,f]);const P=()=>{_(x.length===0),D(Q=>Q+1)},G=Zv({items:x,packs:y,selectedIds:A,clearSelection:M.clear,reload:P,fromPackId:a,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:P}),q=async Q=>{const V=x;b(Q),ne(!0);try{await $.reorderPack(a,Q.map(le=>le.id))}catch(le){b(V),h(bt(f,le),"error")}finally{ne(!1)}},W=(Q,V)=>{const le=Q+V;if(Z||le<0||le>=x.length)return;const he=x.slice(),[ve]=he.splice(Q,1);ve&&(he.splice(le,0,ve),q(he))},ie=Q=>{const V=x.findIndex(K=>K.id===pe.current),le=x.findIndex(K=>K.id===Q);if(pe.current="",Z||V<0||le<0||V===le)return;const he=x.slice(),[ve]=he.splice(V,1);ve&&(he.splice(le,0,ve),q(he))},ae=x.some(Q=>M.selected.has(Q.id)&&Q.animated);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(ge,{onClick:o,children:[s.jsx(N0,{size:16,className:"rtl:-scale-x-100"}),f("backToPacks")]}),g&&s.jsxs("div",{className:"min-w-0 max-w-full",children:[s.jsx("h3",{className:"text-base font-bold text-text-main",children:s.jsx(Fl,{children:g.name})}),s.jsx("p",{className:"text-xs text-muted",children:an(f("stickerCount"),{n:g.count})})]})]}),E&&x.length===0&&s.jsx(Kl,{text:f("loading")}),N&&x.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:N}),s.jsx(ge,{onClick:P,children:f("retryLoad")})]}),!E&&!N&&x.length===0&&s.jsx(Sn,{icon:s.jsx(dy,{size:28,className:"text-muted"}),text:f("packEmpty")}),x.length>0&&s.jsxs(s.Fragment,{children:[A.length===0&&s.jsx("div",{children:s.jsx(ge,{variant:"ghost",size:"sm",onClick:M.selectAll,children:f("selectAll")})}),s.jsx(Xv,{count:A.length,animatedSelected:ae,canRemove:!0,sendReason:A.length?G.sendReason:null,exportReason:A.length?G.exportReason:null,onSelectAll:M.selectAll,onClear:M.clear,onFavorite:G.favorite,onUnfavorite:G.unfavorite,onAdd:G.askAdd,onMove:G.askMove,onRemove:G.remove,onDownload:G.download,onConvert:G.convert,onShare:G.share,onSend:G.askSend,onDelete:G.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:x.map((Q,V)=>s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:le=>le.preventDefault(),onDrop:le=>{le.preventDefault(),ie(Q.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(Jv,{sticker:Q,selected:M.selected.has(Q.id),onToggle:le=>M.toggle(V,le),onOpen:()=>G.openDetail(Q),onFavorite:()=>G.toggleFavorite(Q)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold",children:s.jsx(Fl,{children:Q.name||f("stickerPreview")})}),s.jsx(Le,{label:f("reorderUp"),disabled:Z||V===0,onClick:()=>W(V,-1),children:s.jsx(gw,{size:14})}),s.jsx(Le,{label:f("reorderDown"),disabled:Z||V===x.length-1,onClick:()=>W(V,1),children:s.jsx(k0,{size:14})}),s.jsx(Le,{label:f("reorderDragHint"),variant:"ghost",className:"cursor-grab",draggable:!Z,onDragStart:le=>{pe.current=Q.id,le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",Q.id)},icon:s.jsx(dy,{size:16})})]},Q.id))})]}),G.dialogs]})},nE=({isConnected:a,gifEnabled:i,onOpenInCreate:r})=>{const{t:o}=Ze(),{toast:d}=qt(),[f,h]=v.useState([]),[g,p]=v.useState(!0),[x,b]=v.useState(null),[y,k]=v.useState(""),[E,_]=v.useState(null),[N,j]=v.useState(!1),[T,D]=v.useState(null),[Z,ne]=v.useState(null),[pe,I]=v.useState(""),[M,A]=v.useState(null),[P,G]=v.useState(!1),[q,W]=v.useState(null),[ie,ae]=v.useState(""),Q=v.useCallback(()=>{b(null),$.getPacks().then(K=>h(K.packs)).catch(K=>b(bt(o,K))).finally(()=>p(!1))},[o]);v.useEffect(()=>{Q()},[Q]);const V=async()=>{if(fr(y)){_(o("packNameLength"));return}j(!0),_(null);try{await $.createPack(y.trim()),k(""),d(o("packCreated"),"success"),Q()}catch(K){d(bt(o,K),"error")}finally{j(!1)}},le=async()=>{if(Z){if(fr(pe)){d(o("packNameLength"),"warning");return}j(!0);try{await $.updatePack(Z.id,pe.trim()),d(o("packRenamed"),"success"),ne(null),Q()}catch(K){d(bt(o,K),"error")}finally{j(!1)}}},he=async()=>{if(M){j(!0);try{await $.deletePack(M.id,P),d(o("packDeleted"),"success"),A(null),G(!1),Q()}catch(K){d(bt(o,K),"error")}finally{j(!1)}}},ve=async()=>{if(q){if(!ie){d(o("noDestinationPack"),"warning");return}j(!0);try{await $.mergePack(q.id,ie),d(o("packsMerged"),"success"),W(null),ae(""),Q()}catch(K){d(bt(o,K),"error")}finally{j(!1)}}};return T?s.jsx(tE,{packId:T,isConnected:a,gifEnabled:i,onOpenInCreate:r,onBack:()=>{D(null),Q()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{value:y,onChange:K=>{const X=K.target.value;k(X),E&&_(fr(X)?o("packNameLength"):null)},onKeyDown:K=>{K.key==="Enter"&&(K.preventDefault(),V())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),dir:"auto",maxLength:Kv+20,className:"min-w-0 flex-1"}),s.jsxs(ge,{variant:"primary",onClick:()=>void V(),disabled:N,icon:s.jsx(Fs,{size:16}),className:"shrink-0 whitespace-nowrap",children:[s.jsx("span",{className:"sm:hidden",children:o("create")}),s.jsx("span",{className:"hidden sm:inline",children:o("createPack")})]})]}),E&&s.jsx("p",{className:"text-xs text-danger",children:E}),g&&s.jsx(Kl,{text:o("loading")}),x&&!g&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-10",children:[s.jsx("p",{className:"text-sm text-danger",children:x}),s.jsx(ge,{onClick:Q,children:o("retryLoad")})]}),!g&&!x&&f.length===0&&s.jsx(Sn,{icon:s.jsx(my,{size:28,className:"text-muted"}),text:o("noPacks")}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f.map(K=>s.jsxs(at,{className:"flex items-center gap-3",children:[s.jsxs(ge,{variant:"ghost",onClick:()=>D(K.id),className:"h-auto min-h-11 min-w-0 flex-1 justify-start gap-3 px-1","aria-label":o("openPack"),children:[K.coverUrl?s.jsx("img",{src:K.coverUrl,alt:"",loading:"lazy",className:"w-14 h-14 rounded-xl object-cover bg-panel-hover shrink-0"}):s.jsx("span",{className:"w-14 h-14 rounded-xl bg-panel-hover text-muted flex items-center justify-center shrink-0",children:s.jsx(my,{size:20})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(Fl,{lines:2,className:"font-bold text-text-main text-start",children:K.name}),s.jsx("span",{className:"block text-xs text-muted",children:an(o("stickerCount"),{n:K.count})})]})]}),s.jsxs(La,{label:o("moreActions"),children:[s.jsx(ot,{icon:s.jsx(cb,{size:16}),onSelect:()=>{ne(K),I(K.name)},children:o("renamePack")}),s.jsx(ot,{icon:s.jsx(Mw,{size:16}),onSelect:()=>{W(K),ae("")},children:o("merge")}),s.jsx(cr,{}),s.jsx(ot,{danger:!0,icon:s.jsx(hl,{size:16}),onSelect:()=>{A(K),G(!1)},children:o("deletePack")})]})]},K.id))}),s.jsx(en,{isOpen:Z!==null,onClose:()=>ne(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(ge,{onClick:()=>ne(null),children:o("cancel")}),s.jsx(ge,{variant:"primary",onClick:()=>void le(),disabled:N,children:o("save")})]}),children:s.jsx(Be,{value:pe,onChange:K=>I(K.target.value),"aria-label":o("packName"),dir:"auto"})}),s.jsx(en,{isOpen:M!==null,onClose:()=>A(null),title:o("deletePackTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(ge,{onClick:()=>A(null),children:o("cancel")}),s.jsx(ge,{variant:"danger",onClick:()=>void he(),disabled:N,children:o("delete")})]}),children:s.jsx(or,{name:"delete-pack-mode",value:P?"stickers":"keep",onChange:K=>G(K==="stickers"),options:[{value:"keep",label:o("deleteKeepStickers")},{value:"stickers",label:o("deletePackAndStickers")}]})}),s.jsx(en,{isOpen:q!==null,onClose:()=>W(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(ge,{onClick:()=>W(null),children:o("cancel")}),s.jsx(ge,{variant:"primary",onClick:()=>void ve(),disabled:N||!ie,children:o("confirmMerge")})]}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-sm text-text-main",children:o("mergeConfirmBody")}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"merge-into",children:o("mergeInto")}),s.jsxs(Ht,{id:"merge-into",value:ie,onChange:K=>ae(K.target.value),children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(K=>K.id!==(q==null?void 0:q.id)).map(K=>s.jsx("option",{value:K.id,children:K.name},K.id))]})]})})]})},aE=["library","packs","favorites","create","recent"];function c0(){const a=window.location.hash.replace(/^#/,"");if(a.startsWith("stickers/")){const i=a.slice(9);if(aE.includes(i))return i}return"library"}const lE=({isConnected:a})=>{const{t:i}=Ze(),{toast:r}=qt(),[o,d]=v.useState(c0),[f,h]=v.useState(o==="create"),[g,p]=v.useState(null),[x,b]=v.useState(null),[y,k]=v.useState(0),[E,_]=v.useState(null),[N,j]=v.useState(0),T=v.useCallback(()=>{let M=!0;return b(null),$.getStickerCapabilities().then(A=>{M&&p(A)}).catch(A=>{M&&b(bt(i,A))}),()=>{M=!1}},[i]);v.useEffect(()=>{if(!(y<0))return T()},[T,y]);const D=v.useCallback(M=>{d(M),M==="create"&&h(!0);const A=`stickers/${M}`;window.location.hash.replace(/^#/,"")!==A&&(window.location.hash=A)},[]);v.useEffect(()=>{const M=()=>d(c0());return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),v.useEffect(()=>{o==="create"&&h(!0)},[o]),v.useEffect(()=>(o0(M=>{if(M.type==="saved"){r(M.created?i("stickerCreated"):i("alreadyInLibrary"),M.created?"success":"info"),M.qualityReduced&&r(i("qualityReduced"),"info"),j(A=>A+1);return}r(Mh(i,M.code),"error")}),()=>o0(null)),[i,r]),v.useEffect(()=>{const M=()=>{const P=IC();P&&(_(P),h(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};M();const A=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},[]);const Z=v.useCallback(()=>{KC(),_(null)},[]),ne=v.useCallback(async M=>{try{const A=await fetch(M.url,{credentials:"same-origin"});if(!A.ok)throw new Error(String(A.status));const P=await A.blob(),G=M.name.trim(),q=G?G.toLowerCase().endsWith(".webp")?G:`${G}.webp`:"sticker.webp";_({blob:P,name:q,source:"PANEL_UPLOAD",...rc()?{existingId:M.id}:{}}),D("create")}catch(A){r(bt(i,A),"error")}},[D,i,r]),pe=g!==null&&!g.webp,I=[{id:"library",label:i("library")},{id:"packs",label:i("packs")},{id:"favorites",label:i("favorites")},{id:"create",label:i("create")},{id:"recent",label:i("recent")}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(Ws,{icon:s.jsx(wh,{size:24}),title:i("stickers"),description:i("stickersDesc")}),pe&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(dc,{size:20,className:"text-warn shrink-0"}),s.jsx("span",{className:"text-sm text-warn font-medium",children:i("stickerErr_ENCODER_MISSING")})]}),s.jsx("div",{className:"-mx-4 overflow-x-auto px-4 sm:mx-0 sm:px-0",children:s.jsx(Nc,{"aria-label":i("stickers"),className:"min-w-max",value:o,onChange:D,options:I.map(M=>({value:M.id,label:M.label}))})}),o==="library"&&s.jsx($f,{preset:"all",isConnected:a,gifEnabled:(g==null?void 0:g.gif)===!0,refreshKey:N,onOpenInCreate:M=>void ne(M)}),o==="favorites"&&s.jsx($f,{preset:"favorites",isConnected:a,gifEnabled:(g==null?void 0:g.gif)===!0,refreshKey:N,onOpenInCreate:M=>void ne(M)}),o==="recent"&&s.jsx($f,{preset:"recent",isConnected:a,gifEnabled:(g==null?void 0:g.gif)===!0,refreshKey:N,onOpenInCreate:M=>void ne(M)}),o==="packs"&&s.jsx(nE,{isConnected:a,gifEnabled:(g==null?void 0:g.gif)===!0,onOpenInCreate:M=>void ne(M)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(VC,{capabilities:g,capsError:x,onRetryCaps:()=>k(M=>M+1),incoming:E,onConsumedIncoming:Z,isConnected:a,onGoLibrary:()=>D("library"),onCreated:()=>j(M=>M+1)})})]})},Wv=["overview","connection","commands","ai","groups","autodelete","schedules","settings","logs","stickers"];function sE(){const a=window.location.hash.replace(/^#/,"").split("/")[0];return Wv.includes(a)?a:"overview"}const iE=()=>{const{t:a}=Ze(),{toast:i}=qt(),[r,o]=v.useState(sE),[d,f]=v.useState(!1),{sessionStatus:h,socket:g}=Xj((N,j)=>{if(N==="status"){const T=j==null?void 0:j.state;i(`Connection state: ${T}`,"info")}}),[p,x]=v.useState(null),b=v.useCallback(async()=>{try{const N=await $.getSession();N!=null&&N.session?x({...N.session,qr:N.qr??null,pairingCode:N.pairingCode??null}):N!=null&&N.status&&x(N.status)}catch{}},[]);v.useEffect(()=>{b()},[b]);const y=p||h?{state:(h==null?void 0:h.state)||(p==null?void 0:p.state)||"idle",...p||{},...h||{}}:null,k=(y==null?void 0:y.connected)===!0||(y==null?void 0:y.state)==="connected";v.useEffect(()=>{const N=y==null?void 0:y.state,T=N==="starting"||N==="linking"||N==="reconnecting"||N==="waiting_for_qr"&&!(y!=null&&y.qr)&&!(y!=null&&y.pairingCode)?2e3:15e3,D=setInterval(()=>{b()},T);return()=>clearInterval(D)},[y==null?void 0:y.state,y==null?void 0:y.qr,y==null?void 0:y.pairingCode,b]);const E=N=>{o(N),window.location.hash=N};v.useEffect(()=>{const N=()=>{const j=window.location.hash.replace(/^#/,"").split("/")[0];Wv.includes(j)&&o(j)};return window.addEventListener("hashchange",N),()=>window.removeEventListener("hashchange",N)},[]);const _={overview:a("overview"),connection:a("connection"),commands:a("commands"),ai:a("ai"),groups:a("groups"),autodelete:a("autoDelete"),schedules:a("schedules"),settings:a("settings"),logs:a("logs"),stickers:a("stickers")};return s.jsxs("div",{className:"min-h-screen min-h-[100dvh] flex bg-bg text-text-main bg-ambient-glow overflow-x-clip relative",children:[s.jsx(ej,{currentView:r,onSelectView:E,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(Wk,{onToggleMobileMenu:()=>f(N=>!N),title:_[r]||"Dashboard",status:y}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[r==="overview"&&s.jsx(KN,{status:y,onNavigate:E}),r==="connection"&&s.jsx(PN,{status:y,onRefresh:b,onStatusUpdate:N=>x(j=>({...j||{},...N}))}),r==="ai"&&s.jsx(Jj,{}),r==="commands"&&s.jsx(xN,{}),r==="schedules"&&s.jsx(rC,{isConnected:k,onNavigate:E}),r==="groups"&&s.jsx(GN,{}),r==="autodelete"&&s.jsx(pN,{}),r==="settings"&&s.jsx(hC,{}),r==="stickers"&&s.jsx(lE,{isConnected:k}),r==="logs"&&s.jsx(YN,{socket:g})]})]})]})},rE=()=>s.jsx(Kw,{children:s.jsx(tj,{children:s.jsx(iE,{})})}),u0=document.getElementById("root");u0&&JS.createRoot(u0).render(s.jsx(YS.StrictMode,{children:s.jsx(rE,{})}));
|