levix-bot 4.8.0 → 4.9.2
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 +9 -5
- package/SETUP.md +21 -2
- package/app.cjs +69 -23
- package/package.json +3 -2
- package/public/dashboard/assets/index-4xhK_Tpl.js +561 -0
- package/public/dashboard/assets/index-CK8osB4o.css +2 -0
- package/public/dashboard/index.html +2 -2
- package/public/dashboard.css +21 -0
- package/public/dashboard.js +25 -2
- package/public/gateway-i18n.js +26 -0
- package/src/bootstrap/core.js +4 -0
- package/src/bootstrap/session-startup-policy.js +6 -6
- package/src/commands/group/antilink.cjs +82 -59
- package/src/commands/group/antispam.cjs +112 -0
- package/src/commands/group/clearwarns.cjs +6 -6
- package/src/commands/group/demote.cjs +11 -13
- package/src/commands/group/flagged.cjs +52 -0
- package/src/commands/group/kick.cjs +25 -15
- package/src/commands/group/media.cjs +65 -29
- package/src/commands/group/policy.cjs +215 -0
- package/src/commands/group/promote.cjs +11 -12
- package/src/commands/group/rules.cjs +9 -6
- package/src/commands/group/setwarn.cjs +17 -27
- package/src/commands/group/warn.cjs +13 -63
- package/src/commands/group.cjs +5 -2
- package/src/commands/mod.cjs +101 -26
- package/src/commands/translate.cjs +585 -0
- package/src/config/ai-identity.cjs +53 -1
- package/src/config/ai-persona.md +32 -73
- package/src/config/baileys.config.js +15 -2
- package/src/config/defaults.cjs +2 -0
- package/src/config/secrets.cjs +71 -3
- package/src/config/settings.cjs +39 -1
- package/src/core/connection.js +40 -1
- package/src/core/session.js +11 -2
- package/src/core/socket.js +4 -5
- package/src/db/db.cjs +66 -0
- package/src/db/store.cjs +264 -16
- package/src/diagnostics/baileysLog.cjs +87 -0
- package/src/diagnostics/crashReports.cjs +35 -9
- package/src/diagnostics/debugLog.cjs +405 -0
- package/src/diagnostics/nodeRuntime.cjs +131 -0
- package/src/handlers/command.handler.js +1 -0
- package/src/handlers/group.handler.js +32 -1
- package/src/handlers/message.handler.js +53 -17
- package/src/middleware/antispam.middleware.js +95 -48
- package/src/panel/feedback.cjs +32 -5
- package/src/panel/one-time-code.cjs +156 -0
- package/src/panel/password-reset.cjs +187 -91
- package/src/panel/recovery-email.cjs +333 -0
- package/src/routes/dashboard.api.esm.js +267 -20
- package/src/services/aiAgent.cjs +25 -3
- package/src/services/moderationPolicy.cjs +895 -0
- package/src/services/settingsTransfer.cjs +4 -2
- package/src/utils/linkedCreds.cjs +22 -0
- package/src/utils/logger.cjs +11 -0
- package/src/utils/moderationAction.cjs +637 -0
- package/src/utils/moderationSummary.cjs +225 -0
- package/src/utils/permissions.cjs +70 -0
- package/src/utils/permissions.esm.js +48 -8
- package/src/utils/storage.cjs +8 -0
- package/src/utils/storage.esm.js +4 -0
- package/views/login.ejs +100 -28
- package/public/dashboard/assets/index-B8E5IYlB.js +0 -540
- package/public/dashboard/assets/index-C5D4wzm4.css +0 -2
- package/src/commands/group/antiSpam.cjs +0 -97
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
var nk=Object.defineProperty;var ak=(n,i,r)=>i in n?nk(n,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[i]=r;var Uy=(n,i,r)=>ak(n,typeof i!="symbol"?i+"":i,r);(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 m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).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 $m(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mf={exports:{}},yr={};/**
|
|
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 Hy;function sk(){if(Hy)return yr;Hy=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(o,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:n,type:o,key:m,ref:d!==void 0?d:null,props:f}}return yr.Fragment=i,yr.jsx=r,yr.jsxs=r,yr}var Py;function lk(){return Py||(Py=1,Mf.exports=sk()),Mf.exports}var s=lk(),Rf={exports:{}},Qe={};/**
|
|
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 qy;function ik(){if(qy)return Qe;qy=1;var n=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"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),A=Symbol.iterator;function k(C){return C===null||typeof C!="object"?null:(C=A&&C[A]||C["@@iterator"],typeof C=="function"?C:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,L={};function _(C,Y,K){this.props=C,this.context=Y,this.refs=L,this.updater=K||N}_.prototype.isReactComponent={},_.prototype.setState=function(C,Y){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,Y,"setState")},_.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function F(){}F.prototype=_.prototype;function R(C,Y,K){this.props=C,this.context=Y,this.refs=L,this.updater=K||N}var ne=R.prototype=new F;ne.constructor=R,j(ne,_.prototype),ne.isPureReactComponent=!0;var B=Array.isArray;function M(){}var T={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function O(C,Y,K){var me=K.ref;return{$$typeof:n,type:C,key:Y,ref:me!==void 0?me:null,props:K}}function W(C,Y){return O(C.type,Y,C.props)}function Z(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function se(C){var Y={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(K){return Y[K]})}var E=/\/+/g;function z(C,Y){return typeof C=="object"&&C!==null&&C.key!=null?se(""+C.key):Y.toString(36)}function q(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(M,M):(C.status="pending",C.then(function(Y){C.status==="pending"&&(C.status="fulfilled",C.value=Y)},function(Y){C.status==="pending"&&(C.status="rejected",C.reason=Y)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function le(C,Y,K,me,te){var oe=typeof C;(oe==="undefined"||oe==="boolean")&&(C=null);var ye=!1;if(C===null)ye=!0;else switch(oe){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(C.$$typeof){case n:case i:ye=!0;break;case x:return ye=C._init,le(ye(C._payload),Y,K,me,te)}}if(ye)return te=te(C),ye=me===""?"."+z(C,0):me,B(te)?(K="",ye!=null&&(K=ye.replace(E,"$&/")+"/"),le(te,Y,K,"",function(rt){return rt})):te!=null&&(Z(te)&&(te=W(te,K+(te.key==null||C&&C.key===te.key?"":(""+te.key).replace(E,"$&/")+"/")+ye)),Y.push(te)),1;ye=0;var ve=me===""?".":me+":";if(B(C))for(var be=0;be<C.length;be++)me=C[be],oe=ve+z(me,be),ye+=le(me,Y,K,oe,te);else if(be=k(C),typeof be=="function")for(C=be.call(C),be=0;!(me=C.next()).done;)me=me.value,oe=ve+z(me,be++),ye+=le(me,Y,K,oe,te);else if(oe==="object"){if(typeof C.then=="function")return le(q(C),Y,K,me,te);throw Y=String(C),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ye}function pe(C,Y,K){if(C==null)return C;var me=[],te=0;return le(C,me,"","",function(oe){return Y.call(K,oe,te++)}),me}function fe(C){if(C._status===-1){var Y=C._result,K=Y();K.then(function(me){(C._status===0||C._status===-1)&&(C._status=1,C._result=me,K.status===void 0&&(K.status="fulfilled",K.value=me))},function(me){(C._status===0||C._status===-1)&&(C._status=2,C._result=me,K.status===void 0&&(K.status="rejected",K.reason=me))}),C._status===-1&&(C._status=0,C._result=K)}if(C._status===1)return C._result.default;throw C._result}var G=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)};function ce(C){var Y=T.T,K={};K.types=Y!==null?Y.types:null,T.T=K;try{var me=C(),te=T.S;te!==null&&te(K,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(M,G)}catch(oe){G(oe)}finally{Y!==null&&K.types!==null&&(Y.types=K.types),T.T=Y}}function ie(C){var Y=T.T;if(Y!==null){var K=Y.types;K===null?Y.types=[C]:K.indexOf(C)===-1&&K.push(C)}else ce(ie.bind(null,C))}var de={map:pe,forEach:function(C,Y,K){pe(C,function(){Y.apply(this,arguments)},K)},count:function(C){var Y=0;return pe(C,function(){Y++}),Y},toArray:function(C){return pe(C,function(Y){return Y})||[]},only:function(C){if(!Z(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Qe.Activity=b,Qe.Children=de,Qe.Component=_,Qe.Fragment=r,Qe.Profiler=d,Qe.PureComponent=R,Qe.StrictMode=o,Qe.Suspense=h,Qe.ViewTransition=S,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(C){return T.H.useMemoCache(C)}},Qe.addTransitionType=ie,Qe.cache=function(C){return function(){return C.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(C,Y,K){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var me=j({},C.props),te=C.key;if(Y!=null)for(oe in Y.key!==void 0&&(te=""+Y.key),Y)!H.call(Y,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&Y.ref===void 0||(me[oe]=Y[oe]);var oe=arguments.length-2;if(oe===1)me.children=K;else if(1<oe){for(var ye=Array(oe),ve=0;ve<oe;ve++)ye[ve]=arguments[ve+2];me.children=ye}return O(C.type,te,me)},Qe.createContext=function(C){return C={$$typeof:m,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:f,_context:C},C},Qe.createElement=function(C,Y,K){var me,te={},oe=null;if(Y!=null)for(me in Y.key!==void 0&&(oe=""+Y.key),Y)H.call(Y,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(te[me]=Y[me]);var ye=arguments.length-2;if(ye===1)te.children=K;else if(1<ye){for(var ve=Array(ye),be=0;be<ye;be++)ve[be]=arguments[be+2];te.children=ve}if(C&&C.defaultProps)for(me in ye=C.defaultProps,ye)te[me]===void 0&&(te[me]=ye[me]);return O(C,oe,te)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(C){return{$$typeof:p,render:C}},Qe.isValidElement=Z,Qe.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:fe}},Qe.memo=function(C,Y){return{$$typeof:v,type:C,compare:Y===void 0?null:Y}},Qe.startTransition=ce,Qe.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Qe.use=function(C){return T.H.use(C)},Qe.useActionState=function(C,Y,K){return T.H.useActionState(C,Y,K)},Qe.useCallback=function(C,Y){return T.H.useCallback(C,Y)},Qe.useContext=function(C){return T.H.useContext(C)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(C,Y){return T.H.useDeferredValue(C,Y)},Qe.useEffect=function(C,Y){return T.H.useEffect(C,Y)},Qe.useEffectEvent=function(C){return T.H.useEffectEvent(C)},Qe.useId=function(){return T.H.useId()},Qe.useImperativeHandle=function(C,Y,K){return T.H.useImperativeHandle(C,Y,K)},Qe.useInsertionEffect=function(C,Y){return T.H.useInsertionEffect(C,Y)},Qe.useLayoutEffect=function(C,Y){return T.H.useLayoutEffect(C,Y)},Qe.useMemo=function(C,Y){return T.H.useMemo(C,Y)},Qe.useOptimistic=function(C,Y){return T.H.useOptimistic(C,Y)},Qe.useReducer=function(C,Y,K){return T.H.useReducer(C,Y,K)},Qe.useRef=function(C){return T.H.useRef(C)},Qe.useState=function(C){return T.H.useState(C)},Qe.useSyncExternalStore=function(C,Y,K){return T.H.useSyncExternalStore(C,Y,K)},Qe.useTransition=function(){return T.H.useTransition()},Qe.version="19.3.0",Qe}var Fy;function Wm(){return Fy||(Fy=1,Rf.exports=ik()),Rf.exports}var y=Wm();const rk=$m(y);var zf={exports:{}},vr={},Lf={exports:{}},Of={};/**
|
|
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 Gy;function ok(){return Gy||(Gy=1,(function(n){function i(q,le){var pe=q.length;q.push(le);e:for(;0<pe;){var fe=pe-1>>>1,G=q[fe];if(0<d(G,le))q[fe]=le,q[pe]=G,pe=fe;else break e}}function r(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var le=q[0],pe=q.pop();if(pe!==le){q[0]=pe;e:for(var fe=0,G=q.length,ce=G>>>1;fe<ce;){var ie=2*(fe+1)-1,de=q[ie],C=ie+1,Y=q[C];if(0>d(de,pe))C<G&&0>d(Y,de)?(q[fe]=Y,q[C]=pe,fe=C):(q[fe]=de,q[ie]=pe,fe=ie);else if(C<G&&0>d(Y,pe))q[fe]=Y,q[C]=pe,fe=C;else break e}}return le}function d(q,le){var pe=q.sortIndex-le.sortIndex;return pe!==0?pe:q.id-le.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();n.unstable_now=function(){return m.now()-p}}var h=[],v=[],x=1,b=null,S=3,A=!1,k=!1,N=!1,j=!1,L=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function R(q){for(var le=r(v);le!==null;){if(le.callback===null)o(v);else if(le.startTime<=q)o(v),le.sortIndex=le.expirationTime,i(h,le);else break;le=r(v)}}function ne(q){if(N=!1,R(q),!k)if(r(h)!==null)k=!0,B||(B=!0,Z());else{var le=r(v);le!==null&&z(ne,le.startTime-q)}}var B=!1,M=-1,T=5,H=-1;function O(){return j?!0:!(n.unstable_now()-H<T)}function W(){if(j=!1,B){var q=n.unstable_now();H=q;var le=!0;try{e:{k=!1,N&&(N=!1,_(M),M=-1),A=!0;var pe=S;try{t:{for(R(q),b=r(h);b!==null&&!(b.expirationTime>q&&O());){var fe=b.callback;if(typeof fe=="function"){b.callback=null,S=b.priorityLevel;var G=fe(b.expirationTime<=q);if(q=n.unstable_now(),typeof G=="function"){b.callback=G,R(q),le=!0;break t}b===r(h)&&o(h),R(q)}else o(h);b=r(h)}if(b!==null)le=!0;else{var ce=r(v);ce!==null&&z(ne,ce.startTime-q),le=!1}}break e}finally{b=null,S=pe,A=!1}le=void 0}}finally{le?Z():B=!1}}}var Z;if(typeof F=="function")Z=function(){F(W)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,E=se.port2;se.port1.onmessage=W,Z=function(){E.postMessage(null)}}else Z=function(){L(W,0)};function z(q,le){M=L(function(){q(n.unstable_now())},le)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(q){q.callback=null},n.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<q?Math.floor(1e3/q):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(q){switch(S){case 1:case 2:case 3:var le=3;break;default:le=S}var pe=S;S=le;try{return q()}finally{S=pe}},n.unstable_requestPaint=function(){j=!0},n.unstable_runWithPriority=function(q,le){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var pe=S;S=q;try{return le()}finally{S=pe}},n.unstable_scheduleCallback=function(q,le,pe){var fe=n.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?fe+pe:fe):pe=fe,q){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=pe+G,q={id:x++,callback:le,priorityLevel:q,startTime:pe,expirationTime:G,sortIndex:-1},pe>fe?(q.sortIndex=pe,i(v,q),r(h)===null&&q===r(v)&&(N?(_(M),M=-1):N=!0,z(ne,pe-fe))):(q.sortIndex=G,i(h,q),k||A||(k=!0,B||(B=!0,Z()))),q},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(q){var le=S;return function(){var pe=S;S=le;try{return q.apply(this,arguments)}finally{S=pe}}}})(Of)),Of}var Iy;function ck(){return Iy||(Iy=1,Lf.exports=ok()),Lf.exports}var Bf={exports:{}},nn={};/**
|
|
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 Vy;function uk(){if(Vy)return nn;Vy=1;var n=Wm();function i(x){var b="https://react.dev/errors/"+x;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)b+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+x+"; visit "+b+" 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"),m=Symbol.for("react.optimistic_key");function p(x,b,S){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:A==null?null:A===m?m:""+A,children:x,containerInfo:b,implementation:S}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(x,b){if(x==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,nn.browser=function(x){return{$$typeof:f,_reason:x}},nn.createPortal=function(x,b){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(i(299));return p(x,b,null,S)},nn.flushSync=function(x){var b=h.T,S=o.p;try{if(h.T=null,o.p=2,x)return x()}finally{h.T=b,o.p=S,o.d.f()}},nn.preconnect=function(x,b){typeof x=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,o.d.C(x,b))},nn.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},nn.preinit=function(x,b){if(typeof x=="string"&&b&&typeof b.as=="string"){var S=b.as,A=v(S,b.crossOrigin),k=typeof b.integrity=="string"?b.integrity:void 0,N=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;S==="style"?o.d.S(x,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:A,integrity:k,fetchPriority:N}):S==="script"&&o.d.X(x,{crossOrigin:A,integrity:k,fetchPriority:N,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},nn.preinitModule=function(x,b){if(typeof x=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var S=v(b.as,b.crossOrigin);o.d.M(x,{crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&o.d.M(x)},nn.preload=function(x,b){if(typeof x=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var S=b.as,A=v(S,b.crossOrigin);o.d.L(x,S,{crossOrigin:A,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},nn.preloadModule=function(x,b){if(typeof x=="string")if(b){var S=v(b.as,b.crossOrigin);o.d.m(x,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else o.d.m(x)},nn.requestFormReset=function(x){o.d.r(x)},nn.unstable_batchedUpdates=function(x,b){return x(b)},nn.useFormState=function(x,b,S){return h.H.useFormState(x,b,S)},nn.useFormStatus=function(){return h.H.useHostTransitionStatus()},nn.version="19.3.0",nn}var Ky;function ub(){if(Ky)return Bf.exports;Ky=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Bf.exports=uk(),Bf.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 Yy;function dk(){if(Yy)return vr;Yy=1;var n=ck(),i=Wm(),r=ub();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(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 p(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 h(e){if(f(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var u=c.alternate;if(u===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===a)return h(c),e;if(u===l)return h(c),t;u=u.sibling}throw Error(o(188))}if(a.return!==l.return)a=c,l=u;else{for(var g=!1,w=c.child;w;){if(w===a){g=!0,a=c,l=u;break}if(w===l){g=!0,l=c,a=u;break}w=w.sibling}if(!g){for(w=u.child;w;){if(w===a){g=!0,a=u,l=c;break}if(w===l){g=!0,l=u,a=c;break}w=w.sibling}if(!g)throw Error(o(189))}}if(a.alternate!==l)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}function b(e,t,a,l,c,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,l,c,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&b(e.child,t,a,l,c,u))return!0;e=e.sibling}return!1}function S(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 A(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 k(e){var t=[null,null],a=S(e);return a===null||N(t,e,a.child,{foundSelf:!1}),t}function N(e,t,a,l){for(;a!==null;){if(a===t)l.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(l.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&N(e,t,a.child,l))return!0;a=a.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 L=null,_=null;function F(e,t,a){return e===a?!0:e===t?(L=e,!0):!1}function R(e,t,a){return e===a?(_=e,!1):e===t?(_!==null&&(L=e),!0):!1}function ne(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 B(e,t,a){for(var l=0,c=e;c;c=a(c))l++;c=0;for(var u=t;u;u=a(u))c++;for(;0<l-c;)e=a(e),l--;for(;0<c-l;)t=a(t),c--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var M=Object.assign,T=Symbol.for("react.element"),H=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),z=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ie=Symbol.for("react.legacy_hidden"),de=Symbol.for("react.memo_cache_sentinel"),C=Symbol.for("react.view_transition"),Y=Symbol.for("react.recoverable"),K=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case se:return"Profiler";case Z:return"StrictMode";case le:return"Suspense";case pe:return"SuspenseList";case ce:return"Activity";case C:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case z:return e.displayName||"Context";case E:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case G:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var ye=Array.isArray,ve=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,rt={pending:!1,data:null,method:null,action:null},xt=[],Ee=-1;function Ie(e){return{current:e}}function He(e){0>Ee||(e.current=xt[Ee],xt[Ee]=null,Ee--)}function he(e,t){Ee++,xt[Ee]=e.current,e.current=t}var Ae=Ie(null),Ne=Ie(null),Ke=Ie(null),yt=Ie(null);function Nt(e,t){switch(he(Ke,t),he(Ne,e),he(Ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yx(t),e=Qx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}He(Ae),he(Ae,e)}function we(){He(Ae),He(Ne),He(Ke)}function I(e){var t=e.memoizedState;t!==null&&(ui._currentValue=t.memoizedState,he(yt,e)),t=Ae.current;var a=Qx(t,e.type);t!==a&&(he(Ne,e),he(Ae,a))}function ke(e){Ne.current===e&&(He(Ae),He(Ne)),yt.current===e&&(He(yt),ui._currentValue=rt)}var Ye,Ge;function kt(e){if(Ye===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ye=t&&t[1]||"",Ge=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ye+e+Ge}var hn=!1;function rn(e,t){if(!e||hn)return"";hn=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(je){var V=je}Reflect.construct(e,[],xe)}else{try{xe.call()}catch(je){V=je}xe=!1;try{var ee=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),xe=!0,new e}finally{xe&&(ee!==void 0?Object.defineProperty(e.prototype,"props",ee):delete e.prototype.props)}}}else{try{throw Error()}catch(je){V=je}(xe=e())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(je){if(je&&V&&typeof je.stack=="string")return[je.stack,V.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(),g=u[0],w=u[1];if(g&&w){var D=g.split(`
|
|
44
|
+
`),X=w.split(`
|
|
45
|
+
`);for(c=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;c<X.length&&!X[c].includes("DetermineComponentFrameRoot");)c++;if(l===D.length||c===X.length)for(l=D.length-1,c=X.length-1;1<=l&&0<=c&&D[l]!==X[c];)c--;for(;1<=l&&0<=c;l--,c--)if(D[l]!==X[c]){if(l!==1||c!==1)do if(l--,c--,0>c||D[l]!==X[c]){var ae=`
|
|
46
|
+
`+D[l].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=l&&0<=c);break}}}finally{hn=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?kt(a):""}function ka(e,t){switch(e.tag){case 26:case 27:case 5:return kt(e.type);case 16:return kt("Lazy");case 13:return e.child!==t&&t!==null?kt("Suspense Fallback"):kt("Suspense");case 19:return kt("SuspenseList");case 0:case 15:return rn(e.type,!1);case 11:return rn(e.type.render,!1);case 1:return rn(e.type,!0);case 31:return kt("Activity");case 30:return kt("ViewTransition");default:return""}}function pn(e){try{var t="",a=null;do t+=ka(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var Ka=Object.prototype.hasOwnProperty,Rs=n.unstable_scheduleCallback,zs=n.unstable_cancelCallback,Ni=n.unstable_shouldYield,Ya=n.unstable_requestPaint,Ht=n.unstable_now,Qa=n.unstable_getCurrentPriorityLevel,Ls=n.unstable_ImmediatePriority,Xa=n.unstable_UserBlockingPriority,ja=n.unstable_NormalPriority,Sl=n.unstable_LowPriority,Za=n.unstable_IdlePriority,kl=n.log,re=n.unstable_setDisableYieldValue,ze=null,Pe=null;function P(e){if(typeof kl=="function"&&re(e),Pe&&typeof Pe.setStrictMode=="function")try{Pe.setStrictMode(ze,e)}catch{}}var Ce=Math.clz32?Math.clz32:Xt,Ve=Math.log,Qt=Math.LN2;function Xt(e){return e>>>=0,e===0?32:31-(Ve(e)/Qt|0)|0}var Qn=256,aa=262144,sa=4194304;function Xn(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 la(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,u=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var w=l&134217727;return w!==0?(l=w&~u,l!==0?c=Xn(l):(g&=w,g!==0?c=Xn(g):a||(a=w&~e,a!==0&&(c=Xn(a))))):(w=l&~u,w!==0?c=Xn(w):g!==0?c=Xn(g):a||(a=l&~e,a!==0&&(c=Xn(a)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:c}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vh(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-Ce(a),c=1<<l;t|=e[l],a&=~c}return t}function gw(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 bh(){var e=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),e}function su(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xw(e,t,a,l,c,u){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var w=e.entanglements,D=e.expirationTimes,X=e.hiddenUpdates;for(a=g&~a;0<a;){var ae=31-Ce(a),xe=1<<ae;w[ae]=0,D[ae]=-1;var V=X[ae];if(V!==null)for(X[ae]=null,ae=0;ae<V.length;ae++){var ee=V[ae];ee!==null&&(ee.lane&=-536870913)}a&=~xe}l!==0&&wh(e,l,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(g&~t))}function wh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Ce(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Sh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Ce(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}function kh(e,t){var a=t&-t;return a=(a&42)!==0?1:lu(a),(a&(e.suspendedLanes|t))!==0?0:a}function lu(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 iu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jh(){var e=be.p;return e!==0?e:(e=window.event,e===void 0?32:Dy(e.type))}function Nh(e,t){var a=be.p;try{return be.p=e,t()}finally{be.p=a}}var Na=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Na,gn="__reactProps$"+Na,jl="__reactContainer$"+Na,Ch="__reactEvents$"+Na,yw="__reactListeners$"+Na,vw="__reactHandles$"+Na,Eh="__reactResources$"+Na,Ai="__reactMarker$"+Na,Ir="__reactLoad$"+Na;function Vr(e){delete e[Zt],delete e[gn],delete e[yw],delete e[vw]}function Os(e){var t;if(t=e[Zt])return t;for(var a=e.parentNode;a;){if(t=a[jl]||a[Zt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=dy(e);e!==null;){if(a=e[Zt])return a;e=dy(e)}return t}e=a,a=e.parentNode}return null}function Nl(e){if(e=e[Zt]||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 Ti(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Cl(e){var t=e[Eh];return t||(t=e[Eh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function It(e){e[Ai]=!0}function Ah(e){e[Ir]=void 0}var Th=new Set,_h={};function Bs(e,t){El(e,t),El(e+"Capture",t)}function El(e,t){for(_h[e]=t,e=0;e<t.length;e++)Th.add(t[e])}var bw=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]*$"),Dh={},Mh={};function ww(e){return Ka.call(Mh,e)?!0:Ka.call(Dh,e)?!1:bw.test(e)?Mh[e]=!0:(Dh[e]=!0,!1)}var ct=!1;function Rh(){var e=ct;return ct=!1,e}function Kr(e,t,a){if(ww(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){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,a)}}function Yr(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,a)}}function Ca(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,l)}}function jn(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 Sw(e,t,a){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(g){a=""+g,u.call(this,g)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ru(e){if(!e._valueTracker){var t=zh(e)?"checked":"value";e._valueTracker=Sw(e,t,""+e[t])}}function Lh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=zh(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}var kw=/[\n"\\]/g;function zn(e){return e.replace(kw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ou(e,t,a,l,c,u,g,w){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jn(t)):e.value!==""+jn(t)&&(e.value=""+jn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?g==="number"&&e.value==t?cu(e,jn(e.value)):cu(e,jn(t)):a!=null?cu(e,jn(a)):l!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+jn(w):e.removeAttribute("name")}function Oh(e,t,a,l,c,u,g,w){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){ru(e);return}a=a!=null?""+jn(a):"",t=t!=null?""+jn(t):a,w||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=w?e.checked:!!l,e.defaultChecked=!!l,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),ru(e)}function cu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Al(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+jn(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Bh(e,t,a){if(t!=null&&(t=""+jn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+jn(a):""}function Uh(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(o(92));if(ye(l)){if(1<l.length)throw Error(o(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=jn(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),ru(e)}function Tl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var jw=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 Hh(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||jw.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ph(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",ct=!0);for(var c in t)l=t[c],t.hasOwnProperty(c)&&a[c]!==l&&(Hh(e,c,l),ct=!0)}else for(var u in t)t.hasOwnProperty(u)&&Hh(e,u,t[u])}function uu(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 Nw=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"]]),Cw=/^[\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 Qr(e){return Cw.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ia(){}var du=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _l=null,Dl=null;function qh(e){var t=Nl(e);if(t&&(e=t.stateNode)){var a=e[gn]||null;e:switch(e=t.stateNode,t.type){case"input":if(ou(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+zn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=l[gn]||null;if(!c)throw Error(o(90));ou(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Lh(l)}break e;case"textarea":Bh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Al(e,!!a.multiple,t,!1)}}}var mu=!1;function Fh(e,t,a){if(mu)return e(t,a);mu=!0;try{var l=e(t);return l}finally{if(mu=!1,(_l!==null||Dl!==null)&&(Xo(),_l&&(t=_l,e=Dl,Dl=_l=null,qh(t),e)))for(t=0;t<e.length;t++)qh(e[t])}}function _i(e,t){var a=e.stateNode;if(a===null)return null;var l=a[gn]||null;if(l===null)return null;a=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(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hu=!1;if(Ea)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){hu=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{hu=!1}var $a=null,pu=null,Xr=null;function Gh(){if(Xr)return Xr;var e,t=pu,a=t.length,l,c="value"in $a?$a.value:$a.textContent,u=c.length;for(e=0;e<a&&t[e]===c[e];e++);var g=a-e;for(l=1;l<=g&&t[a-l]===c[u-l];l++);return Xr=c.slice(e,1<l?1-l:void 0)}function Zr(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 $r(){return!0}function Ih(){return!1}function on(e){function t(a,l,c,u,g){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(a=e[w],this[w]=a?a(u):u[w]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?$r:Ih,this.isPropagationStopped=Ih,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=$r)},persist:function(){},isPersistent:$r}),t}var Wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wr=on(Wa),Mi=M({},Wa,{view:0,detail:0}),Ew=on(Mi),gu,xu,Ri,Jr=M({},Mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,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!==Ri&&(Ri&&e.type==="mousemove"?(gu=e.screenX-Ri.screenX,xu=e.screenY-Ri.screenY):xu=gu=0,Ri=e),gu)},movementY:function(e){return"movementY"in e?e.movementY:xu}}),Vh=on(Jr),Aw=M({},Jr,{dataTransfer:0}),Tw=on(Aw),_w=M({},Mi,{relatedTarget:0}),yu=on(_w),Dw=M({},Wa,{animationName:0,elapsedTime:0,pseudoElement:0}),Mw=on(Dw),Rw=M({},Wa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zw=on(Rw),Lw=M({},Wa,{data:0}),Kh=on(Lw),Ow={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bw={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"},Uw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Uw[e])?!!t[e]:!1}function vu(){return Hw}var Pw=M({},Mi,{key:function(e){if(e.key){var t=Ow[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?Zr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qw=on(Pw),Fw=M({},Jr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yh=on(Fw),Gw=M({},Wa,{submitter:0}),Iw=on(Gw),Vw=M({},Mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),Kw=on(Vw),Yw=M({},Wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qw=on(Yw),Xw=M({},Jr,{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}),Zw=on(Xw),$w=M({},Wa,{newState:0,oldState:0,source:0}),Ww=on($w),Jw=[9,13,27,32],bu=Ea&&"CompositionEvent"in window,zi=null;Ea&&"documentMode"in document&&(zi=document.documentMode);var eS=Ea&&"TextEvent"in window&&!zi,Qh=Ea&&(!bu||zi&&8<zi&&11>=zi),Xh=" ",Zh=!1;function $h(e,t){switch(e){case"keyup":return Jw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ml=!1;function tS(e,t){switch(e){case"compositionend":return Wh(t);case"keypress":return t.which!==32?null:(Zh=!0,Xh);case"textInput":return e=t.data,e===Xh&&Zh?null:e;default:return null}}function nS(e,t){if(Ml)return e==="compositionend"||!bu&&$h(e,t)?(e=Gh(),Xr=pu=$a=null,Ml=!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 Qh&&t.locale!=="ko"?null:t.data;default:return null}}var aS={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 Jh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!aS[e.type]:t==="textarea"}function ep(e,t,a,l){_l?Dl?Dl.push(l):Dl=[l]:_l=l,t=tc(t,"onChange"),0<t.length&&(a=new Wr("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Li=null,Oi=null;function sS(e){qx(e,0)}function eo(e){var t=Ti(e);if(Lh(t))return e}function tp(e,t){if(e==="change")return t}var np=!1;if(Ea){var wu;if(Ea){var Su="oninput"in document;if(!Su){var ap=document.createElement("div");ap.setAttribute("oninput","return;"),Su=typeof ap.oninput=="function"}wu=Su}else wu=!1;np=wu&&(!document.documentMode||9<document.documentMode)}function sp(){Li&&(Li.detachEvent("onpropertychange",lp),Oi=Li=null)}function lp(e){if(e.propertyName==="value"&&eo(Oi)){var t=[];ep(t,Oi,e,fu(e)),Fh(sS,t)}}function lS(e,t,a){e==="focusin"?(sp(),Li=t,Oi=a,Li.attachEvent("onpropertychange",lp)):e==="focusout"&&sp()}function iS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return eo(Oi)}function rS(e,t){if(e==="click")return eo(t)}function oS(e,t){if(e==="input"||e==="change")return eo(t)}function cS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nn=typeof Object.is=="function"?Object.is:cS;function Bi(e,t){if(Nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!Ka.call(t,c)||!Nn(e[c],t[c]))return!1}return!0}function ku(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 ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rp(e,t){var a=ip(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ip(a)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ku(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ku(e.document)}return t}function ju(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 uS=Ea&&"documentMode"in document&&11>=document.documentMode,Rl=null,Nu=null,Ui=null,Cu=!1;function up(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Cu||Rl==null||Rl!==ku(l)||(l=Rl,"selectionStart"in l&&ju(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}),Ui&&Bi(Ui,l)||(Ui=l,l=tc(Nu,"onSelect"),0<l.length&&(t=new Wr("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Rl)))}function Us(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zl={animationend:Us("Animation","AnimationEnd"),animationiteration:Us("Animation","AnimationIteration"),animationstart:Us("Animation","AnimationStart"),transitionrun:Us("Transition","TransitionRun"),transitionstart:Us("Transition","TransitionStart"),transitioncancel:Us("Transition","TransitionCancel"),transitionend:Us("Transition","TransitionEnd")},Eu={},dp={};Ea&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Hs(e){if(Eu[e])return Eu[e];if(!zl[e])return e;var t=zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in dp)return Eu[e]=t[a];return e}var fp=Hs("animationend"),mp=Hs("animationiteration"),hp=Hs("animationstart"),dS=Hs("transitionrun"),fS=Hs("transitionstart"),mS=Hs("transitioncancel"),pp=Hs("transitionend"),gp=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 Zn(e,t){gp.set(e,t),Bs(t,[e])}var hS=0;function Aa(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ea.identifierPrefix;var a=hS++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function xp(e){if(e==null||typeof e=="string")return e;var t=null,a=ei;if(a!==null)for(var l=0;l<a.length;l++){var c=e[a[l]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function Ta(e,t){return e=xp(e),t=xp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var to=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)},Ln=[],Ll=0,Tu=0;function no(){for(var e=Ll,t=Tu=Ll=0;t<e;){var a=Ln[t];Ln[t++]=null;var l=Ln[t];Ln[t++]=null;var c=Ln[t];Ln[t++]=null;var u=Ln[t];if(Ln[t++]=null,l!==null&&c!==null){var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}u!==0&&yp(a,c,u)}}function ao(e,t,a,l){Ln[Ll++]=e,Ln[Ll++]=t,Ln[Ll++]=a,Ln[Ll++]=l,Tu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function _u(e,t,a,l){return ao(e,t,a,l),so(e)}function Ps(e,t){return ao(e,null,null,t),so(e)}function yp(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var c=!1,u=e.return;u!==null;)u.childLanes|=a,l=u.alternate,l!==null&&(l.childLanes|=a),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-Ce(a),e=u.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=a|536870912),u):null}function so(e){if(50<ir)throw ir=0,Qo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ol={};function pS(e,t,a,l){this.tag=e,this.key=a,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 xn(e,t,a,l){return new pS(e,t,a,l)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _a(e,t){var a=e.alternate;return a===null?(a=xn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&1206910976,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function vp(e,t){e.flags&=1206910978;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lo(e,t,a,l,c,u){var g=0;if(l=e,typeof l=="function")Du(l)&&(g=1);else if(typeof l=="string")g=G2(e,a,Ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ce:return e=xn(31,a,t,c),e.elementType=ce,e.lanes=u,e;case W:return qs(a.children,c,u,t);case Z:g=8,c|=24;break;case se:return e=xn(12,a,t,c|2),e.elementType=se,e.lanes=u,e;case le:return e=xn(13,a,t,c),e.elementType=le,e.lanes=u,e;case pe:return e=xn(19,a,t,c),e.elementType=pe,e.lanes=u,e;case ie:case C:return e=c|32,e=xn(30,a,t,e),e.elementType=C,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 z:g=10;break e;case E:g=9;break e;case q:g=11;break e;case fe:g=14;break e;case G:g=16,l=null;break e}g=29,a=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=xn(g,a,t,c),t.elementType=e,t.type=l,t.lanes=u,t}function qs(e,t,a,l){return e=xn(7,e,l,t),e.lanes=a,e}function Mu(e,t,a){return e=xn(6,e,null,t),e.lanes=a,e}function bp(e){var t=xn(18,null,null,0);return t.stateNode=e,t}function Ru(e,t,a){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wp=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var a=wp.get(e);return a!==void 0?a:(t={value:e,source:t,stack:pn(t)},wp.set(e,t),t)}return{value:e,source:t,stack:pn(t)}}var Bl=[],Ul=0,io=null,Hi=0,Bn=[],Un=0,Ja=null,ra=1,oa="";function Da(e,t){Bl[Ul++]=Hi,Bl[Ul++]=io,io=e,Hi=t}function Sp(e,t,a){Bn[Un++]=ra,Bn[Un++]=oa,Bn[Un++]=Ja,Ja=e;var l=ra;e=oa;var c=32-Ce(l)-1;l&=~(1<<c),a+=1;var u=32-Ce(t)+c;if(30<u){var g=c-c%5;u=(l&(1<<g)-1).toString(32),l>>=g,c-=g,ra=1<<32-Ce(t)+c|a<<c|l,oa=u+e}else ra=1<<u|a<<c|l,oa=e}function ro(e){e.return!==null&&(Da(e,1),Sp(e,1,0))}function zu(e){for(;e===io;)io=Bl[--Ul],Bl[Ul]=null,Hi=Bl[--Ul],Bl[Ul]=null;for(;e===Ja;)Ja=Bn[--Un],Bn[Un]=null,oa=Bn[--Un],Bn[Un]=null,ra=Bn[--Un],Bn[Un]=null}function kp(e,t){Bn[Un++]=ra,Bn[Un++]=oa,Bn[Un++]=Ja,ra=t.id,oa=t.overflow,Ja=e}var Vt=null,wt=null,We=!1,es=null,Hn=!1,Lu=Error(o(519));function ts(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pi(On(t,e)),Lu}function jp(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[Zt]=e,t[gn]=l,a){case"dialog":nt("cancel",t),nt("close",t);break;case"iframe":case"object":case"embed":nt("load",t);break;case"video":case"audio":for(a=0;a<or.length;a++)nt(or[a],t);break;case"source":nt("error",t);break;case"img":case"image":case"link":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"input":nt("invalid",t),Oh(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",t);break;case"textarea":nt("invalid",t),Uh(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Vx(t.textContent,a)?(l.popover!=null&&(nt("beforetoggle",t),nt("toggle",t)),l.onScroll!=null&&nt("scroll",t),l.onScrollEnd!=null&&nt("scrollend",t),l.onClick!=null&&(t.onclick=ia),t=!0):t=!1,t||ts(e,!0)}function oo(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Hn=!1;return;case 27:case 3:Hn=!0;return;default:Vt=Vt.return}}function Hl(e){if(e!==Vt)return!1;if(!We)return oo(e),We=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||ff(e.type,e.memoizedProps)),a=!a),a&&wt&&ts(e),oo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=uy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=uy(e)}else t===27?(t=wt,xs(e.type)?(e=wf,wf=null,wt=e):wt=t):wt=Vt?qn(e.stateNode.nextSibling):null;return!0}function Fs(){wt=Vt=null,We=!1}function Ou(){var e=es;return e!==null&&(bn===null?bn=e:bn.push.apply(bn,e),es=null),e}function Pi(e){es===null?es=[e]:es.push(e)}var Bu=Ie(null),Gs=null,Ma=null;function ns(e,t,a){he(Bu,t._currentValue),t._currentValue=a}function Ra(e){e._currentValue=Bu.current,He(Bu)}function co(e,t,a){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===a)break;e=e.return}}function Uu(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var g=c.child;u=u.firstContext;e:for(;u!==null;){var w=u;u=c;for(var D=0;D<t.length;D++)if(w.context===t[D]){u.lanes|=a,w=u.alternate,w!==null&&(w.lanes|=a),co(u.return,a,e),l||(g=null);break e}u=w.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(o(341));g.lanes|=a,u=g.alternate,u!==null&&(u.lanes|=a),co(g,a,e),g=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=a,g=c.alternate,g!==null&&(g.lanes|=a),co(c.return,a,e),g=c.child,g=g!==null?g.sibling:null):g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===e){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function Is(e,t,a,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 g=c.alternate;if(g===null)throw Error(o(387));if(g=g.memoizedProps,g!==null){var w=c.type;Nn(c.pendingProps.value,g.value)||(e!==null?e.push(w):e=[w])}}else if(c===yt.current){if(g=c.alternate,g===null)throw Error(o(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ui):e=[ui])}c=c.return}return e!==null&&Uu(t,e,a,l),t.flags|=262144,e!==null}function uo(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vs(e){Gs=e,Ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return Np(Gs,e)}function fo(e,t){return Gs===null&&Vs(e),Np(e,t)}function Np(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ma===null){if(e===null)throw Error(o(308));Ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ma=Ma.next=t;return a}var gS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},xS=n.unstable_scheduleCallback,yS=n.unstable_NormalPriority,Rt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hu(){return{controller:new gS,data:new Map,refCount:0}}function qi(e){e.refCount--,e.refCount===0&&xS(yS,function(){e.controller.abort()})}function Cp(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];a.indexOf(l)===-1&&a.push(l)}}}var Fi=null;function vS(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Gi=null,Pu=0,Ks=0,Pl=null;function bS(e,t){if(Gi===null){var a=Gi=[];Pu=0,Ks=nf(),Pl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Pu++,t.then(Ep,Ep),t}function Ep(){if(--Pu===0&&(Fi=null,Gi!==null)){Pl!==null&&(Pl.status="fulfilled");var e=Gi;Gi=null,Ks=0,Pl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wS(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),l}var Ap=ve.S;ve.S=function(e,t){if(bx=Ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&bS(e,t),Fi!==null)for(var a=si;a!==null;)Cp(a,Fi),a=a.next;if(a=e.types,a!==null){for(var l=si;l!==null;)Cp(l,a),l=l.next;if(Ks!==0){l=Fi,l===null&&(l=Fi=[]);for(var c=0;c<a.length;c++){var u=a[c];l.indexOf(u)===-1&&l.push(u)}}}Ap!==null&&Ap(e,t)};var Ys=Ie(null);function qu(){var e=Ys.current;return e!==null?e:bt.pooledCache}function mo(e,t){t===null?he(Ys,Ys.current):he(Ys,t.pool)}function Tp(){var e=qu();return e===null?null:{parent:Rt._currentValue,pool:e}}var ql=Error(o(460)),Fu=Error(o(474)),ho=Error(o(542)),po={then:function(){}};function _p(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Dp(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ia,ia),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(ia,ia);else{if(e=bt,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,Rp(e),e}throw Xs=t,ql}}function Qs(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Xs=a,ql):a}}var Xs=null;function Mp(){if(Xs===null)throw Error(o(459));var e=Xs;return Xs=null,e}function Rp(e){if(e===ql||e===ho)throw Error(o(483))}var Fl=null,Ii=0;function go(e){var t=Ii;return Ii+=1,Fl===null&&(Fl=[]),Dp(Fl,e,t)}function as(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xo(e,t){throw t.$$typeof===T?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function zp(e){function t(Q,U){if(e){var J=Q.deletions;J===null?(Q.deletions=[U],Q.flags|=16):J.push(U)}}function a(Q,U){if(!e)return null;for(;U!==null;)t(Q,U),U=U.sibling;return null}function l(Q){for(var U=new Map;Q!==null;)Q.key===null?U.set(Q.index,Q):U.set(Q.key,Q),Q=Q.sibling;return U}function c(Q,U){return Q=_a(Q,U),Q.index=0,Q.sibling=null,Q}function u(Q,U,J){return Q.index=J,e?(J=Q.alternate,J!==null?(J=J.index,J<U?(Q.flags|=2,U):J):(Q.flags|=134217730,U)):(Q.flags|=1048576,U)}function g(Q){return e&&Q.alternate===null&&(Q.flags|=134217730),Q}function w(Q,U,J,ge){return U===null||U.tag!==6?(U=Mu(J,Q.mode,ge),U.return=Q,U):(U=c(U,J),U.return=Q,U)}function D(Q,U,J,ge){var Te=J.type;return Te===W?(Q=ae(Q,U,J.props.children,ge,J.key),as(Q,J),Q):U!==null&&(U.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===G&&Qs(Te)===U.type)?(U=c(U,J.props),as(U,J),U.return=Q,U):(U=lo(J.type,J.key,J.props,null,Q.mode,ge),as(U,J),U.return=Q,U)}function X(Q,U,J,ge){return U===null||U.tag!==4||U.stateNode.containerInfo!==J.containerInfo||U.stateNode.implementation!==J.implementation?(U=Ru(J,Q.mode,ge),U.return=Q,U):(U=c(U,J.children||[]),U.return=Q,U)}function ae(Q,U,J,ge,Te){return U===null||U.tag!==7?(U=qs(J,Q.mode,ge,Te),U.return=Q,U):(U=c(U,J),U.return=Q,U)}function xe(Q,U,J){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Mu(""+U,Q.mode,J),U.return=Q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case H:return J=lo(U.type,U.key,U.props,null,Q.mode,J),as(J,U),J.return=Q,J;case O:return U=Ru(U,Q.mode,J),U.return=Q,U;case G:return U=Qs(U),xe(Q,U,J)}if(ye(U)||me(U))return U=qs(U,Q.mode,J,null),U.return=Q,U;if(typeof U.then=="function")return xe(Q,go(U),J);if(U.$$typeof===z)return xe(Q,fo(Q,U),J);xo(Q,U)}return null}function V(Q,U,J,ge){var Te=U!==null?U.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Te!==null?null:w(Q,U,""+J,ge);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case H:return J.key===Te?D(Q,U,J,ge):null;case O:return J.key===Te?X(Q,U,J,ge):null;case G:return J=Qs(J),V(Q,U,J,ge)}if(ye(J)||me(J))return Te!==null?null:ae(Q,U,J,ge,null);if(typeof J.then=="function")return V(Q,U,go(J),ge);if(J.$$typeof===z)return V(Q,U,fo(Q,J),ge);xo(Q,J)}return null}function ee(Q,U,J,ge,Te){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return Q=Q.get(J)||null,w(U,Q,""+ge,Te);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case H:return Q=Q.get(ge.key===null?J:ge.key)||null,D(U,Q,ge,Te);case O:return Q=Q.get(ge.key===null?J:ge.key)||null,X(U,Q,ge,Te);case G:return ge=Qs(ge),ee(Q,U,J,ge,Te)}if(ye(ge)||me(ge))return Q=Q.get(J)||null,ae(U,Q,ge,Te,null);if(typeof ge.then=="function")return ee(Q,U,J,go(ge),Te);if(ge.$$typeof===z)return ee(Q,U,J,fo(U,ge),Te);xo(U,ge)}return null}function je(Q,U,J,ge){for(var Te=null,st=null,Le=U,Fe=U=0,Ot=null;Le!==null&&Fe<J.length;Fe++){Le.index>Fe?(Ot=Le,Le=null):Ot=Le.sibling;var ot=V(Q,Le,J[Fe],ge);if(ot===null){Le===null&&(Le=Ot);break}e&&Le&&ot.alternate===null&&t(Q,Le),U=u(ot,U,Fe),st===null?Te=ot:st.sibling=ot,st=ot,Le=Ot}if(Fe===J.length)return a(Q,Le),We&&Da(Q,Fe),Te;if(Le===null){for(;Fe<J.length;Fe++)Le=xe(Q,J[Fe],ge),Le!==null&&(U=u(Le,U,Fe),st===null?Te=Le:st.sibling=Le,st=Le);return We&&Da(Q,Fe),Te}for(Le=l(Le);Fe<J.length;Fe++)Ot=ee(Le,Q,Fe,J[Fe],ge),Ot!==null&&(e&&(ot=Ot.alternate,ot!==null&&Le.delete(ot.key===null?Fe:ot.key)),U=u(Ot,U,Fe),st===null?Te=Ot:st.sibling=Ot,st=Ot);return e&&Le.forEach(function(Ss){return t(Q,Ss)}),We&&Da(Q,Fe),Te}function Re(Q,U,J,ge){if(J==null)throw Error(o(151));for(var Te=null,st=null,Le=U,Fe=U=0,Ot=null,ot=J.next();Le!==null&&!ot.done;Fe++,ot=J.next()){Le.index>Fe?(Ot=Le,Le=null):Ot=Le.sibling;var Ss=V(Q,Le,ot.value,ge);if(Ss===null){Le===null&&(Le=Ot);break}e&&Le&&Ss.alternate===null&&t(Q,Le),U=u(Ss,U,Fe),st===null?Te=Ss:st.sibling=Ss,st=Ss,Le=Ot}if(ot.done)return a(Q,Le),We&&Da(Q,Fe),Te;if(Le===null){for(;!ot.done;Fe++,ot=J.next())ot=xe(Q,ot.value,ge),ot!==null&&(U=u(ot,U,Fe),st===null?Te=ot:st.sibling=ot,st=ot);return We&&Da(Q,Fe),Te}for(Le=l(Le);!ot.done;Fe++,ot=J.next())ot=ee(Le,Q,Fe,ot.value,ge),ot!==null&&(e&&(Ot=ot.alternate,Ot!==null&&Le.delete(Ot.key===null?Fe:Ot.key)),U=u(ot,U,Fe),st===null?Te=ot:st.sibling=ot,st=ot);return e&&Le.forEach(function(tk){return t(Q,tk)}),We&&Da(Q,Fe),Te}function Ze(Q,U,J,ge){if(typeof J=="object"&&J!==null&&J.type===W&&J.key===null&&J.props.ref===void 0&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case H:e:{for(var Te=J.key;U!==null;){if(U.key===Te){if(Te=J.type,Te===W){if(U.tag===7){a(Q,U.sibling),ge=c(U,J.props.children),as(ge,J),ge.return=Q,Q=ge;break e}}else if(U.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===G&&Qs(Te)===U.type){a(Q,U.sibling),ge=c(U,J.props),as(ge,J),ge.return=Q,Q=ge;break e}a(Q,U);break}else t(Q,U);U=U.sibling}J.type===W?(ge=qs(J.props.children,Q.mode,ge,J.key),as(ge,J),ge.return=Q,Q=ge):(ge=lo(J.type,J.key,J.props,null,Q.mode,ge),as(ge,J),ge.return=Q,Q=ge)}return g(Q);case O:e:{for(Te=J.key;U!==null;){if(U.key===Te)if(U.tag===4&&U.stateNode.containerInfo===J.containerInfo&&U.stateNode.implementation===J.implementation){a(Q,U.sibling),ge=c(U,J.children||[]),ge.return=Q,Q=ge;break e}else{a(Q,U);break}else t(Q,U);U=U.sibling}ge=Ru(J,Q.mode,ge),ge.return=Q,Q=ge}return g(Q);case G:return J=Qs(J),Ze(Q,U,J,ge)}if(ye(J))return je(Q,U,J,ge);if(me(J)){if(Te=me(J),typeof Te!="function")throw Error(o(150));return J=Te.call(J),Re(Q,U,J,ge)}if(typeof J.then=="function")return Ze(Q,U,go(J),ge);if(J.$$typeof===z)return Ze(Q,U,fo(Q,J),ge);xo(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,U!==null&&U.tag===6?(a(Q,U.sibling),ge=c(U,J),ge.return=Q,Q=ge):(a(Q,U),ge=Mu(J,Q.mode,ge),ge.return=Q,Q=ge),g(Q)):a(Q,U)}return function(Q,U,J,ge){try{Ii=0;var Te=Ze(Q,U,J,ge);return Fl=null,Te}catch(Le){if(Le===ql||Le===ho)throw Le;var st=xn(29,Le,null,Q.mode);return st.lanes=ge,st.return=Q,st}finally{}}}var Zs=zp(!0),Lp=zp(!1),ss=!1;function Gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Iu(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 ls(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function is(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(ut&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=so(e),yp(e,null,a),t}return ao(e,l,t,a),so(e)}function Vi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Sh(e,a)}}function Vu(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?c=u=g:u=u.next=g,a=a.next}while(a!==null);u===null?c=u=t:u=u.next=t}else c=u=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ku=!1;function Ki(){if(Ku){var e=Pl;if(e!==null)throw e}}function Yi(e,t,a,l){Ku=!1;var c=e.updateQueue;ss=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var D=w,X=D.next;D.next=null,g===null?u=X:g.next=X,g=D;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,w=ae.lastBaseUpdate,w!==g&&(w===null?ae.firstBaseUpdate=X:w.next=X,ae.lastBaseUpdate=D))}if(u!==null){var xe=c.baseState;g=0,ae=X=D=null,w=u;do{var V=w.lane&-536870913,ee=V!==w.lane;if(ee?(at&V)===V:(l&V)===V){V!==0&&V===Ks&&(Ku=!0),ae!==null&&(ae=ae.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var je=e,Re=w;V=t;var Ze=a;switch(Re.tag){case 1:if(je=Re.payload,typeof je=="function"){xe=je.call(Ze,xe,V);break e}xe=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Re.payload,V=typeof je=="function"?je.call(Ze,xe,V):je,V==null)break e;xe=M({},xe,V);break e;case 2:ss=!0}}V=w.callback,V!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=c.callbacks,ee===null?c.callbacks=[V]:ee.push(V))}else ee={lane:V,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ae===null?(X=ae=ee,D=xe):ae=ae.next=ee,g|=V;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;ee=w,w=ee.next,ee.next=null,c.lastBaseUpdate=ee,c.shared.pending=null}}while(!0);ae===null&&(D=xe),c.baseState=D,c.firstBaseUpdate=X,c.lastBaseUpdate=ae,u===null&&(c.shared.lanes=0),ms|=g,e.lanes=g,e.memoizedState=xe}}function Op(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Bp(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Op(a[e],t)}var rs=Ie(null),yo=Ie(0);function Up(e,t){e=Ua,he(yo,e),he(rs,t),Ua=e|t.baseLanes}function Yu(){he(yo,Ua),he(rs,rs.current)}function Qu(){Ua=yo.current,He(rs),He(yo)}var Wt=Ie(null),sn=null;function os(e){var t=e.alternate;he(Jt,Jt.current&1),he(Wt,e),sn===null&&(t===null||rs.current!==null||t.memoizedState!==null)&&(sn=e)}function Xu(e){he(Jt,Jt.current),he(Wt,e),sn===null&&(sn=e)}function Hp(e){e.tag===22?(he(Jt,Jt.current),he(Wt,e),sn===null&&(sn=e)):cs()}function cs(){he(Jt,Jt.current),he(Wt,Wt.current)}function Cn(e){He(Wt),sn===e&&(sn=null),He(Jt)}var Jt=Ie(0);function Qi(e,t){he(Wt,Wt.current),he(Jt,t)}function Zu(e){He(Jt),He(Wt),sn===e&&(sn=null)}function vo(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||vf(a)||bf(a)))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 za=0,Xe=null,vt=null,zt=null,bo=!1,Gl=!1,$s=!1,wo=0,Xi=0,Il=null,SS=0;function Tt(){throw Error(o(321))}function $u(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Nn(e[a],t[a]))return!1;return!0}function Wu(e,t,a,l,c,u){return za=u,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ve.H=e===null||e.memoizedState===null?Sg:kg,$s=!1,u=a(l,c),$s=!1,Gl&&(u=qp(t,a,l,c)),Pp(e),u}function Pp(e){ve.H=Ao;var t=vt!==null&&vt.next!==null;if(za=0,zt=vt=Xe=null,bo=!1,Xi=0,Il=null,t)throw Error(o(300));e===null||Lt||(e=e.dependencies,e!==null&&uo(e)&&(Lt=!0))}function qp(e,t,a,l){Xe=e;var c=0;do{if(Gl&&(Il=null),Xi=0,Gl=!1,25<=c)throw Error(o(301));if(c+=1,zt=vt=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}ve.H=_S,u=t(a,l)}while(Gl);return u}function kS(){var e=ve.H,t=e.useState()[0];return t=typeof t.then=="function"?Zi(t):t,e=e.useState()[0],(vt!==null?vt.memoizedState:null)!==e&&(Xe.flags|=1024),t}function Ju(){var e=wo!==0;return wo=0,e}function ed(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function td(e){if(bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bo=!1}za=0,zt=vt=Xe=null,Gl=!1,Xi=wo=0,Il=null}function cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Xe.memoizedState=zt=e:zt=zt.next=e,zt}function Dt(){if(vt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var t=zt===null?Xe.memoizedState:zt.next;if(t!==null)zt=t,vt=e;else{if(e===null)throw Xe.alternate===null?Error(o(467)):Error(o(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},zt===null?Xe.memoizedState=zt=e:zt=zt.next=e}return zt}function So(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zi(e){var t=Xi;return Xi+=1,Il===null&&(Il=[]),e=Dp(Il,e,t),t=Xe,(zt===null?t.memoizedState:zt.next)===null&&(t=t.alternate,ve.H=t===null||t.memoizedState===null?Sg:kg),e}function ko(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zi(e);if(e.$$typeof===Y)return;if(e.$$typeof===z)return $t(e)}throw Error(o(438,String(e)))}function nd(e){var t=null,a=Xe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=Xe.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}),a===null&&(a=So(),Xe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=de;return t.index++,a}function La(e,t){return typeof t=="function"?t(e):t}function jo(e){var t=Dt();return ad(t,vt,e)}function ad(e,t,a){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=a;var c=e.baseQueue,u=l.pending;if(u!==null){if(c!==null){var g=c.next;c.next=u.next,u.next=g}t.baseQueue=c=u,l.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var w=g=null,D=null,X=t,ae=!1;do{var xe=X.lane&-536870913;if(xe!==X.lane?(at&xe)===xe:(za&xe)===xe){var V=X.revertLane;if(V===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),xe===Ks&&(ae=!0);else if((za&V)===V){X=X.next,V===Ks&&(ae=!0);continue}else xe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},D===null?(w=D=xe,g=u):D=D.next=xe,Xe.lanes|=V,ms|=V;xe=X.action,$s&&a(u,xe),u=X.hasEagerState?X.eagerState:a(u,xe)}else V={lane:xe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},D===null?(w=D=V,g=u):D=D.next=V,Xe.lanes|=xe,ms|=xe;X=X.next}while(X!==null&&X!==t);if(D===null?g=u:D.next=w,!Nn(u,e.memoizedState)&&(Lt=!0,ae&&(a=Pl,a!==null)))throw a;e.memoizedState=u,e.baseState=g,e.baseQueue=D,l.lastRenderedState=u}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function sd(e){var t=Dt(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,u=t.memoizedState;if(c!==null){a.pending=null;var g=c=c.next;do u=e(u,g.action),g=g.next;while(g!==c);Nn(u,t.memoizedState)||(Lt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,l]}function Fp(e,t,a){var l=Xe,c=Dt(),u=We;if(u){if(a===void 0)throw Error(o(407));a=a()}else a=t();var g=!Nn((vt||c).memoizedState,a);if(g&&(c.memoizedState=a,Lt=!0),c=c.queue,rd(Vp.bind(null,l,c,e),[e]),e=c.getSnapshot!==t||g||zt!==null&&(zt.memoizedState.tag&1)!==0,Vl(e?9:8,{destroy:void 0},Ip.bind(null,l,c,a,t),null),e){if(l.flags|=2048,bt===null)throw Error(o(349));u||(za&127)!==0||Gp(l,t,a)}return a}function Gp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Xe.updateQueue,t===null?(t=So(),Xe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ip(e,t,a,l){t.value=a,t.getSnapshot=l,Kp(t)&&Yp(e)}function Vp(e,t,a){return a(function(){Kp(t)&&Yp(e)})}function Kp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Nn(e,a)}catch{return!0}}function Yp(e){var t=Ps(e,2);t!==null&&wn(t,e,2)}function ld(e){var t=cn();if(typeof e=="function"){var a=e;if(e=a(),$s){P(!0);try{a()}finally{P(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:e},t}function Qp(e,t,a,l){return e.baseState=a,ad(e,vt,typeof l=="function"?l:La)}function jS(e,t,a,l,c){if(Eo(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(g){u.listeners.push(g)}};ve.T!==null?a(!0):u.isTransition=!1,l(u),a=t.pending,a===null?(u.next=t.pending=u,Xp(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Xp(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var u=ve.T,g={};g.types=u!==null?u.types:null,ve.T=g;try{var w=a(c,l),D=ve.S;D!==null&&D(g,w),Zp(e,t,w)}catch(X){id(e,t,X)}finally{u!==null&&g.types!==null&&(u.types=g.types),ve.T=u}}else try{u=a(c,l),Zp(e,t,u)}catch(X){id(e,t,X)}}function Zp(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){$p(e,t,l)},function(l){return id(e,t,l)}):$p(e,t,a)}function $p(e,t,a){t.status="fulfilled",t.value=a,Wp(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Xp(e,a)))}function id(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,Wp(t),t=t.next;while(t!==l)}e.action=null}function Wp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jp(e,t){return t}function eg(e,t){if(We){var a=bt.formState;if(a!==null){e:{var l=Xe;if(We){if(wt){t:{for(var c=wt,u=Hn;c.nodeType!==8;){if(!u){c=null;break t}if(c=qn(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){wt=qn(c.nextSibling),l=c.data==="F!";break e}}ts(l)}l=!1}l&&(t=a[0])}}return a=cn(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jp,lastRenderedState:t},a.queue=l,a=vg.bind(null,Xe,l),l.dispatch=a,l=ld(!1),u=fd.bind(null,Xe,!1,l.queue),l=cn(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=jS.bind(null,Xe,c,u,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function tg(e){var t=Dt();return ng(t,vt,e)}function ng(e,t,a){if(t=ad(e,t,Jp)[0],e=jo(La)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Zi(t)}catch(g){throw g===ql?ho:g}else l=t;t=Dt();var c=t.queue,u=c.dispatch;return a!==t.memoizedState&&(Xe.flags|=2048,Vl(9,{destroy:void 0},NS.bind(null,c,a),null)),[l,u,e]}function NS(e,t){e.action=t}function ag(e){var t=Dt(),a=vt;if(a!==null)return ng(t,a,e);Dt(),t=t.memoizedState,a=Dt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Vl(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=Xe.updateQueue,t===null&&(t=So(),Xe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function sg(){return Dt().memoizedState}function No(e,t,a,l){var c=cn();Xe.flags|=e,c.memoizedState=Vl(1|t,{destroy:void 0},a,l===void 0?null:l)}function Co(e,t,a,l){var c=Dt();l=l===void 0?null:l;var u=c.memoizedState.inst;vt!==null&&l!==null&&$u(l,vt.memoizedState.deps)?c.memoizedState=Vl(t,u,a,l):(Xe.flags|=e,c.memoizedState=Vl(1|t,u,a,l))}function lg(e,t){No(8390656,8,e,t)}function rd(e,t){Co(2048,8,e,t)}function CS(e){Xe.flags|=4;var t=Xe.updateQueue;if(t===null)t=So(),Xe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function ig(e){var t=Dt().memoizedState;return CS({ref:t,nextImpl:e}),function(){if((ut&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function rg(e,t){return Co(4,2,e,t)}function og(e,t){return Co(4,4,e,t)}function cg(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ug(e,t,a){a=a!=null?a.concat([e]):null,Co(4,4,cg.bind(null,t,e),a)}function od(){}function dg(e,t){var a=Dt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&$u(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function fg(e,t){var a=Dt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&$u(t,l[1]))return l[0];if(l=e(),$s){P(!0);try{e()}finally{P(!1)}}return a.memoizedState=[l,t],l}function cd(e,t,a){return a===void 0||(za&1073741824)!==0&&(at&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Sx(),Xe.lanes|=e,ms|=e,a)}function mg(e,t,a,l){return Nn(a,t)?a:rs.current!==null?(e=cd(e,a,l),Nn(e,t)||(Lt=!0),e):(za&106)===0||(za&1073741824)!==0&&(at&261930)===0?(Lt=!0,e.memoizedState=a):(e=Sx(),Xe.lanes|=e,ms|=e,t)}function hg(e,t,a,l,c){var u=be.p;be.p=u!==0&&8>u?u:8;var g=ve.T,w={};w.types=g!==null?g.types:null,ve.T=w,fd(e,!1,t,a);try{var D=c(),X=ve.S;if(X!==null&&X(w,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ae=wS(D,l);$i(e,t,ae,_n(e))}else $i(e,t,l,_n(e))}catch(xe){$i(e,t,{then:function(){},status:"rejected",reason:xe},_n())}finally{be.p=u,g!==null&&w.types!==null&&(g.types=w.types),ve.T=g}}function ES(){}function ud(e,t,a,l){if(e.tag!==5)throw Error(o(476));var c=pg(e).queue;hg(e,c,t,rt,a===null?ES:function(){return gg(e),a(l)})}function pg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:rt,baseState:rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:rt},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gg(e){var t=pg(e);t.next===null&&(t=e.alternate.memoizedState),$i(e,t.next.queue,{},_n())}function dd(){return $t(ui)}function xg(){return Dt().memoizedState}function yg(){return Dt().memoizedState}function AS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=_n();e=ls(a);var l=is(t,e,a);l!==null&&(wn(l,t,a),Vi(l,t,a)),t={cache:Hu()},e.payload=t;return}t=t.return}}function TS(e,t,a){var l=_n();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Eo(e)?bg(t,a):(a=_u(e,t,a,l),a!==null&&(wn(a,e,l),wg(a,t,l)))}function vg(e,t,a){var l=_n();$i(e,t,a,l)}function $i(e,t,a,l){var c={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Eo(e))bg(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var g=t.lastRenderedState,w=u(g,a);if(c.hasEagerState=!0,c.eagerState=w,Nn(w,g))return ao(e,t,c,0),bt===null&&no(),!1}catch{}finally{}if(a=_u(e,t,c,l),a!==null)return wn(a,e,l),wg(a,t,l),!0}return!1}function fd(e,t,a,l){if(l={lane:2,revertLane:nf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Eo(e)){if(t)throw Error(o(479))}else t=_u(e,a,l,2),t!==null&&wn(t,e,2)}function Eo(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function bg(e,t){Gl=bo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function wg(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Sh(e,a)}}var Ao={readContext:$t,use:ko,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt,useEffectEvent:Tt},Sg={readContext:$t,use:ko,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:lg,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,No(4194308,4,cg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return No(4194308,4,e,t)},useInsertionEffect:function(e,t){No(4,2,e,t)},useMemo:function(e,t){var a=cn();t=t===void 0?null:t;var l=e();if($s){P(!0);try{e()}finally{P(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=cn();if(a!==void 0){var c=a(t);if($s){P(!0);try{a(t)}finally{P(!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=TS.bind(null,Xe,e),[l.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:function(e){e=ld(e);var t=e.queue,a=vg.bind(null,Xe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:od,useDeferredValue:function(e,t){var a=cn();return cd(a,e,t)},useTransition:function(){var e=ld(!1);return e=hg.bind(null,Xe,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=Xe,c=cn();if(We){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),bt===null)throw Error(o(349));(at&127)!==0||Gp(l,t,a)}c.memoizedState=a;var u={value:a,getSnapshot:t};return c.queue=u,lg(Vp.bind(null,l,u,e),[e]),l.flags|=2048,Vl(9,{destroy:void 0},Ip.bind(null,l,u,a,t),null),a},useId:function(){var e=cn(),t=bt.identifierPrefix;if(We){var a=oa,l=ra;a=(l&~(1<<32-Ce(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=wo++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=SS++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dd,useFormState:eg,useActionState:eg,useOptimistic:function(e){var t=cn();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=fd.bind(null,Xe,!0,a),a.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return cn().memoizedState=AS.bind(null,Xe)},useEffectEvent:function(e){var t=cn(),a={impl:e};return t.memoizedState=a,function(){if((ut&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},kg={readContext:$t,use:ko,useCallback:dg,useContext:$t,useEffect:rd,useImperativeHandle:ug,useInsertionEffect:rg,useLayoutEffect:og,useMemo:fg,useReducer:jo,useRef:sg,useState:function(){return jo(La)},useDebugValue:od,useDeferredValue:function(e,t){var a=Dt();return mg(a,vt.memoizedState,e,t)},useTransition:function(){var e=jo(La)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Zi(e),t]},useSyncExternalStore:Fp,useId:xg,useHostTransitionStatus:dd,useFormState:tg,useActionState:tg,useOptimistic:function(e,t){var a=Dt();return Qp(a,vt,e,t)},useMemoCache:nd,useCacheRefresh:yg,useEffectEvent:ig},_S={readContext:$t,use:ko,useCallback:dg,useContext:$t,useEffect:rd,useImperativeHandle:ug,useInsertionEffect:rg,useLayoutEffect:og,useMemo:fg,useReducer:sd,useRef:sg,useState:function(){return sd(La)},useDebugValue:od,useDeferredValue:function(e,t){var a=Dt();return vt===null?cd(a,e,t):mg(a,vt.memoizedState,e,t)},useTransition:function(){var e=sd(La)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Zi(e),t]},useSyncExternalStore:Fp,useId:xg,useHostTransitionStatus:dd,useFormState:ag,useActionState:ag,useOptimistic:function(e,t){var a=Dt();return vt!==null?Qp(a,vt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:nd,useCacheRefresh:yg,useEffectEvent:ig};function md(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:M({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var hd={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=_n(),c=ls(l);c.payload=t,a!=null&&(c.callback=a),t=is(e,c,l),t!==null&&(wn(t,e,l),Vi(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=_n(),c=ls(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=is(e,c,l),t!==null&&(wn(t,e,l),Vi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=_n(),l=ls(a);l.tag=2,t!=null&&(l.callback=t),t=is(e,l,a),t!==null&&(wn(t,e,a),Vi(t,e,a))}};function jg(e,t,a,l,c,u,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,g):t.prototype&&t.prototype.isPureReactComponent?!Bi(a,l)||!Bi(c,u):!0}function Ng(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&hd.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=M({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Cg(e){to(e)}function Eg(e){console.error(e)}function Ag(e){to(e)}function To(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Tg(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function pd(e,t,a){return a=ls(a),a.tag=3,a.payload={element:null},a.callback=function(){To(e,t)},a}function _g(e){return e=ls(e),e.tag=3,e}function Dg(e,t,a,l){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var u=l.value;e.payload=function(){return c(u)},e.callback=function(){Tg(t,a,l)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Tg(t,a,l),typeof c!="function"&&(hs===null?hs=new Set([this]):hs.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function DS(e,t,a,l,c){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Is(t,a,c,!0),a=Wt.current,a!==null){switch(a.tag){case 31:case 13:case 19:return sn===null?Zo():a.alternate===null&&_t===0&&(_t=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===po?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Jd(e,l,c)),!1;case 22:return a.flags|=65536,l===po?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Jd(e,l,c)),!1}throw Error(o(435,a.tag))}return Jd(e,l,c),Zo(),!1}if(We)return t=Wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Lu&&(e=Error(o(422),{cause:l}),Pi(On(e,a)))):(l!==Lu&&(t=Error(o(423),{cause:l}),Pi(On(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=On(l,a),c=pd(e.stateNode,l,c),Vu(e,c),_t!==4&&(_t=2)),!1;var u=Error(o(520),{cause:l});if(u=On(u,a),lr===null?lr=[u]:lr.push(u),_t!==4&&(_t=2),t===null)return!0;l=On(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=pd(a.stateNode,l,e),Vu(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(hs===null||!hs.has(u))))return a.flags|=65536,c&=-c,a.lanes|=c,c=_g(c),Dg(c,e,a,l),Vu(a,c),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var gd=Error(o(461)),Lt=!1;function Pt(e,t,a,l){t.child=e===null?Lp(t,null,a,l):Zs(t,e.child,a,l)}function Mg(e,t,a,l,c){a=a.render;var u=t.ref;if("ref"in l){var g={};for(var w in l)w!=="ref"&&(g[w]=l[w])}else g=l;return Vs(t),l=Wu(e,t,a,g,u,c),w=Ju(),e!==null&&!Lt?(ed(e,t,c),Oa(e,t,c)):(We&&w&&ro(t),t.flags|=1,Pt(e,t,l,c),t.child)}function Rg(e,t,a,l,c){if(e===null){var u=a.type;return typeof u=="function"&&!Du(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,zg(e,t,u,l,c)):(e=lo(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!jd(e,c)){var g=u.memoizedProps;if(a=a.compare,a=a!==null?a:Bi,a(g,l)&&e.ref===t.ref)return Oa(e,t,c)}return t.flags|=1,e=_a(u,l),e.ref=t.ref,e.return=t,t.child=e}function zg(e,t,a,l,c){if(e!==null){var u=e.memoizedProps;if(Bi(u,l)&&e.ref===t.ref)if(Lt=!1,t.pendingProps=l=u,jd(e,c))(e.flags&131072)!==0&&(Lt=!0);else return t.lanes=e.lanes,Oa(e,t,c)}return xd(e,t,a,l,c)}function Lg(e,t,a,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|a:a,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 Og(e,t,u,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mo(t,u!==null?u.cachePool:null),u!==null?Up(t,u):Yu(),Hp(t);else return l=t.lanes=536870912,Og(e,t,u!==null?u.baseLanes|a:a,a,l)}else u!==null?(mo(t,u.cachePool),Up(t,u),cs(),t.memoizedState=null):(e!==null&&mo(t,null),Yu(),cs());return Pt(e,t,c,a),t.child}function Wi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Og(e,t,a,l,c){var u=qu();return u=u===null?null:{parent:Rt._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&mo(t,null),Yu(),Hp(t),e!==null&&Is(e,t,l,!0),t.childLanes=c,null}function _o(e,t){return t=Do({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bg(e,t,a){return Zs(t,e.child,null,a),e=_o(t,t.pendingProps),e.flags|=2,Cn(t),t.memoizedState=null,e}function MS(e,t,a){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(l.mode==="hidden")return e=_o(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Wi(null,e);if(Xu(t),(e=wt)?(e=cy(e,Hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ja!==null?{id:ra,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},a=bp(e),a.return=t,t.child=a,Vt=t,wt=null)):e=null,e===null)throw ts(t);return t.lanes=536870912,null}return _o(t,l)}var u=e.memoizedState;if(u!==null){var g=u.dehydrated;if(Xu(t),c)if(t.flags&256)t.flags&=-257,t=Bg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Lt||Is(e,t,a,!1),c=(a&e.childLanes)!==0,Lt||c){if(rs.current===null){if(l=bt,l!==null&&(g=kh(l,a),g!==0&&g!==u.retryLane))throw u.retryLane=g,Ps(e,g),wn(l,e,g),gd;Zo()}t=Bg(e,t,a)}else e=u.treeContext,wt=qn(g.nextSibling),Vt=t,We=!0,es=null,Hn=!1,e!==null&&kp(t,e),t=_o(t,l),t.flags|=134221824;return t}return e=_a(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function xd(e,t,a,l,c){return Vs(t),a=Wu(e,t,a,l,void 0,c),l=Ju(),e!==null&&!Lt?(ed(e,t,c),Oa(e,t,c)):(We&&l&&ro(t),t.flags|=1,Pt(e,t,a,c),t.child)}function Ug(e,t,a,l,c,u){return Vs(t),t.updateQueue=null,a=qp(t,l,a,c),Pp(e),l=Ju(),e!==null&&!Lt?(ed(e,t,u),Oa(e,t,u)):(We&&l&&ro(t),t.flags|=1,Pt(e,t,a,u),t.child)}function Hg(e,t,a,l,c){if(Vs(t),t.stateNode===null){var u=Ol,g=a.contextType;typeof g=="object"&&g!==null&&(u=$t(g)),u=new a(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=hd,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},Gu(t),g=a.contextType,u.context=typeof g=="object"&&g!==null?$t(g):Ol,u.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(md(t,a,g,l),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&hd.enqueueReplaceState(u,u.state,null),Yi(t,l,u,c),Ki(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var w=t.memoizedProps,D=Ws(a,w);u.props=D;var X=u.context,ae=a.contextType;g=Ol,typeof ae=="object"&&ae!==null&&(g=$t(ae));var xe=a.getDerivedStateFromProps;ae=typeof xe=="function"||typeof u.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ae||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(w||X!==g)&&Ng(t,u,l,g),ss=!1;var V=t.memoizedState;u.state=V,Yi(t,l,u,c),Ki(),X=t.memoizedState,w||V!==X||ss?(typeof xe=="function"&&(md(t,a,xe,l),X=t.memoizedState),(D=ss||jg(t,a,D,l,V,X,g))?(ae||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=X),u.props=l,u.state=X,u.context=g,l=D):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,Iu(e,t),g=t.memoizedProps,ae=Ws(a,g),u.props=ae,xe=t.pendingProps,V=u.context,X=a.contextType,D=Ol,typeof X=="object"&&X!==null&&(D=$t(X)),w=a.getDerivedStateFromProps,(X=typeof w=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==xe||V!==D)&&Ng(t,u,l,D),ss=!1,V=t.memoizedState,u.state=V,Yi(t,l,u,c),Ki();var ee=t.memoizedState;g!==xe||V!==ee||ss||e!==null&&e.dependencies!==null&&uo(e.dependencies)?(typeof w=="function"&&(md(t,a,w,l),ee=t.memoizedState),(ae=ss||jg(t,a,ae,l,V,ee,D)||e!==null&&e.dependencies!==null&&uo(e.dependencies))?(X||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,ee,D),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,ee,D)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ee),u.props=l,u.state=ee,u.context=D,l=ae):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Kl(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Zs(t,e.child,null,c),t.child=Zs(t,null,a,c)):Pt(e,t,a,c),t.memoizedState=u.state,e=t.child):e=Oa(e,t,c),e}function Pg(e,t,a,l){return Fs(),t.flags|=256,Pt(e,t,a,l),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vd(e){return{baseLanes:e,cachePool:Tp()}}function bd(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Tn),e}function qg(e,t,a){var l=t.pendingProps,c=!1,u=(t.flags&128)!==0,g;if((g=u)||(g=e!==null&&e.memoizedState===null?!1:(Jt.current&2)!==0),g&&(c=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(c?os(t):cs(),(e=wt)?(e=cy(e,Hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ja!==null?{id:ra,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},a=bp(e),a.return=t,t.child=a,Vt=t,wt=null)):e=null,e===null)throw ts(t);return bf(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,c?(cs(),c=t.mode,u=Do({mode:"hidden",children:u},c),l=qs(l,c,a,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=vd(a),l.childLanes=bd(e,g,a),t.memoizedState=yd,Wi(null,l)):(os(t),wd(t,u))}var w=e.memoizedState;if(w!==null){var D=w.dehydrated;if(D!==null)return RS(e,t,u,g,l,D,w,a)}return c?(cs(),c=l.fallback,u=t.mode,w=e.child,D=w.sibling,l=_a(w,{mode:"hidden",children:l.children}),l.subtreeFlags=w.subtreeFlags&1206910976,D!==null?c=_a(D,c):(c=qs(c,u,a,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,Wi(null,l),l=t.child,c=e.child.memoizedState,c===null?c=vd(a):(u=c.cachePool,u!==null?(w=Rt._currentValue,u=u.parent!==w?{parent:w,pool:w}:u):u=Tp(),c={baseLanes:c.baseLanes|a,cachePool:u}),l.memoizedState=c,l.childLanes=bd(e,g,a),t.memoizedState=yd,Wi(e.child,l)):(os(t),a=e.child,e=a.sibling,a=_a(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function wd(e,t){return t=Do({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Do(e,t){return e=xn(22,e,null,t),e.lanes=0,e}function Mo(e,t,a){return Zs(t,e.child,null,a),e=wd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function RS(e,t,a,l,c,u,g,w){if(a)return t.flags&256?(os(t),t.flags&=-257,Mo(e,t,w)):t.memoizedState!==null?(cs(),t.child=e.child,t.flags|=128,null):(cs(),u=c.fallback,g=t.mode,c=Do({mode:"visible",children:c.children},g),u=qs(u,g,w,null),u.flags|=2,c.return=t,u.return=t,c.sibling=u,t.child=c,Zs(t,e.child,null,w),c=t.child,c.memoizedState=vd(w),c.childLanes=bd(e,l,w),t.memoizedState=yd,Wi(null,c));if(os(t),bf(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var D=l.dgst;return l=D,l!==""&&(c=Error(o(419)),c.stack="",c.digest=l,Pi({value:c,source:null,stack:null})),Mo(e,t,w)}if(Lt||Is(e,t,w,!1),l=(w&e.childLanes)!==0,Lt||l){if(rs.current!==null)return Mo(e,t,w);if(l=bt,l!==null&&(c=kh(l,w),c!==0&&c!==g.retryLane))throw g.retryLane=c,Ps(e,c),wn(l,e,c),gd;return vf(u)||Zo(),Mo(e,t,w)}return vf(u)?(t.flags|=192,t.child=e.child,null):(e=g.treeContext,wt=qn(u.nextSibling),Vt=t,We=!0,es=null,Hn=!1,e!==null&&kp(t,e),t=wd(t,c.children),t.flags|=134221824,t)}function Fg(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),co(e.return,t,a)}function Gg(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&vo(a)===null&&(t=e),e=e.sibling}return t}function Ro(e,t,a,l,c,u){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c,treeForkCount:u}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=a,g.tailMode=c,g.treeForkCount=u)}function Sd(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function kd(e,t,a){var l=t.pendingProps,c=l.revealOrder,u=l.tail;l=l.children;var g=Jt.current;if(t.flags&128)return Qi(t,g),null;var w=(g&2)!==0;if(w?(g=g&1|2,t.flags|=128):g&=1,Qi(t,g),c==="backwards"&&e!==null?(Sd(e),Pt(e,t,l,a),Sd(e)):Pt(e,t,l,a),l=We?Hi:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fg(e,a,t);else if(e.tag===19)Fg(e,a,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":a=Gg(t.child),a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null,Sd(t)),Ro(t,!0,c,null,u,l);break;case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&vo(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Ro(t,!0,a,null,u,l);break;case"together":Ro(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:a=Gg(t.child),a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Ro(t,!1,c,a,u,l)}return t.child}function Ig(e,t,a){var l=t.pendingProps;return ns(t,t.type,l.value),Pt(e,t,l.children,a),t.child}function Oa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ms|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Is(e,t,a,!1),(a&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,a=_a(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=_a(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function jd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&uo(e)))}function zS(e,t,a){switch(t.tag){case 3:Nt(t,t.stateNode.containerInfo),ns(t,Rt,e.memoizedState.cache),Fs();break;case 27:case 5:I(t);break;case 4:Nt(t,t.stateNode.containerInfo);break;case 10:ns(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xu(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return os(t),t.flags|=128,null;l=Is(e,t,a,!1);var c=t.child.childLanes;return l||(a&c)!==0?qg(e,t,a):(os(t),e=Oa(e,t,a),e!==null?e.sibling:null)}os(t);break;case 19:if(t.flags&128)return kd(e,t,a);if(c=(e.flags&128)!==0,l=(a&t.childLanes)!==0,l||(Is(e,t,a,!1),l=(a&t.childLanes)!==0),c){if(l)return kd(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Qi(t,Jt.current),l)break;return null;case 22:return t.lanes=0,Lg(e,t,a,t.pendingProps);case 24:ns(t,Rt,e.memoizedState.cache)}return Oa(e,t,a)}function Vg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Lt=!0;else{if(!jd(e,a)&&(t.flags&128)===0)return Lt=!1,zS(e,t,a);Lt=(e.flags&131072)!==0}else Lt=!1,We&&(t.flags&1048576)!==0&&Sp(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Qs(t.elementType),t.type=e,typeof e=="function")Du(e)?(l=Ws(e,l),t.tag=1,t=Hg(null,t,e,l,a)):(t.tag=0,t=xd(null,t,e,l,a));else{if(e!=null){var c=e.$$typeof;if(c===q){t.tag=11,t=Mg(null,t,e,l,a);break e}else if(c===fe){t.tag=14,t=Rg(null,t,e,l,a);break e}else if(c===z){t.tag=10,t.type=e,t=Ig(null,t,a);break e}}throw t=oe(e)||e,Error(o(306,t,""))}}return t;case 0:return xd(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=Ws(l,t.pendingProps),Hg(e,t,l,c,a);case 3:e:{if(Nt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var u=t.memoizedState;c=u.element,Iu(e,t),Yi(t,l,null,a);var g=t.memoizedState;if(l=g.cache,ns(t,Rt,l),l!==u.cache&&Uu(t,[Rt],a,!0),Ki(),l=g.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Pg(e,t,l,a);break e}else if(l!==c){c=On(Error(o(424)),t),Pi(c),t=Pg(e,t,l,a);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(wt=qn(e.firstChild),Vt=t,We=!0,es=null,Hn=!0,a=Lp(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(Fs(),l===c){t=Oa(e,t,a);break e}Pt(e,t,l,a)}t=t.child}return t;case 26:return Kl(e,t),e===null?(a=gy(t.type,null,t.pendingProps,null))?t.memoizedState=a:We||(t.stateNode=Xx(t.type,t.pendingProps,Ke.current,t)):t.memoizedState=gy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return I(t),e===null&&We&&(l=t.stateNode=fy(t.type,t.pendingProps,Ke.current),Vt=t,Hn=!0,c=wt,xs(t.type)?(wf=c,wt=qn(l.firstChild)):wt=c),Pt(e,t,t.pendingProps.children,a),Kl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((c=l=wt)&&(l=A2(l,t.type,t.pendingProps,Hn),l!==null?(t.stateNode=l,Vt=t,wt=qn(l.firstChild),Hn=!1,c=!0):c=!1),c||ts(t)),I(t),c=t.type,u=t.pendingProps,g=e!==null?e.memoizedProps:null,l=u.children,ff(c,u)?l=null:g!==null&&ff(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Wu(e,t,kS,null,null,a),ui._currentValue=c),Kl(e,t),Pt(e,t,l,a),t.child;case 6:return e===null&&We&&((e=a=wt)&&(a=T2(a,t.pendingProps,Hn),a!==null?(t.stateNode=a,Vt=t,wt=null,e=!0):e=!1),e||ts(t)),null;case 13:return qg(e,t,a);case 4:return Nt(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Zs(t,null,l,a):Pt(e,t,l,a),t.child;case 11:return Mg(e,t,t.type,t.pendingProps,a);case 7:return l=t.pendingProps,Kl(e,t),Pt(e,t,l,a),t.child;case 8:return Pt(e,t,t.pendingProps.children,a),t.child;case 12:return Pt(e,t,t.pendingProps.children,a),t.child;case 10:return Ig(e,t,a);case 9:return c=t.type._context,l=t.pendingProps.children,Vs(t),c=$t(c),l=l(c),t.flags|=1,Pt(e,t,l,a),t.child;case 14:return Rg(e,t,t.type,t.pendingProps,a);case 15:return zg(e,t,t.type,t.pendingProps,a);case 19:return kd(e,t,a);case 31:return MS(e,t,a);case 22:return Lg(e,t,a,t.pendingProps);case 24:return Vs(t),l=$t(Rt),e===null?(c=qu(),c===null&&(c=bt,u=Hu(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=a),c=u),t.memoizedState={parent:l,cache:c},Gu(t),ns(t,Rt,c)):((e.lanes&a)!==0&&(Iu(e,t),Yi(t,null,null,a),Ki()),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),ns(t,Rt,l)):(l=u.cache,ns(t,Rt,l),l!==c.cache&&Uu(t,[Rt],a,!0))),Pt(e,t,t.pendingProps.children,a),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:We&&ro(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Kl(e,t),Pt(e,t,l.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Ba(e){e.flags|=4}function Nd(e,t,a,l,c){var u;if((u=(e.mode&32)!==0)&&(u=a===null?by(t,l):by(t,l)&&(l.src!==a.src||l.srcSet!==a.srcSet)),u){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Cx())e.flags|=8192;else throw Xs=po,Fu}else e.flags&=-16777217}function Kg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wy(t))if(Cx())e.flags|=8192;else throw Xs=po,Fu}function zo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bh():536870912,e.lanes|=t,$l|=t)}function Ji(e,t){if(!We)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=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;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function LS(e,t,a){var l=t.pendingProps;switch(zu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ra(Rt),we(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?Ba(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ou())),St(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Ba(t),u!==null?(St(t),Kg(t,u)):(St(t),Nd(t,c,null,l,a))):u?u!==e.memoizedState?(Ba(t),St(t),Kg(t,u)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ba(t),St(t),Nd(t,c,e,l,a)),null;case 27:if(ke(t),a=Ke.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ba(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return St(t),t.subtreeFlags&=-33554433,null}e=Ae.current,Hl(t)?jp(t):(e=fy(c,l,a),t.stateNode=e,Ba(t))}return St(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ba(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return St(t),t.subtreeFlags&=-33554433,null}if(u=Ae.current,Hl(t))jp(t);else{var g=ur(Ke.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?g.createElement("select",{is:l.is}):g.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?g.createElement(c,{is:l.is}):g.createElement(c)}}u[Zt]=t,u[gn]=l;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=u;e:switch(tn(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&&Ba(t)}}return St(t),t.subtreeFlags&=-33554433,Nd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ba(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Ke.current,Hl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,c=Vt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Zt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Vx(e.nodeValue,a)),e||ts(t,!0)}else e=ur(e).createTextNode(l),e[Zt]=t,t.stateNode=e}return St(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hl(t),a!==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[Zt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else a=Ou(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Cn(t),t):(Cn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return St(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hl(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[Zt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),c=!1}else c=Ou(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Cn(t),t):(Cn(t),null)}return Cn(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(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)),a!==e&&a&&(t.child.flags|=8192),zo(t,t.updateQueue),St(t),null);case 4:return we(),e===null&&rf(t.stateNode.containerInfo),t.flags|=67108864,St(t),null;case 10:return Ra(t.type),St(t),null;case 19:if(Zu(t),l=t.memoizedState,l===null)return St(t),null;if(c=(t.flags&128)!==0,u=l.rendering,u===null)if(c)Ji(l,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=vo(e),u!==null){for(t.flags|=128,Ji(l,!1),e=u.updateQueue,t.updateQueue=e,zo(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)vp(a,e),a=a.sibling;return Qi(t,Jt.current&1|2),We&&Da(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ht()>Ko&&(t.flags|=128,c=!0,Ji(l,!1),t.lanes=4194304)}else{if(!c)if(e=vo(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,zo(t,e),Ji(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!We)return St(t),null}else 2*Ht()-l.renderingStartTime>Ko&&a!==536870912&&(t.flags|=128,c=!0,Ji(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(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ht(),e.sibling=null,u=Jt.current,u=c?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!a||We?Qi(t,u):(a=u,he(Wt,t),he(Jt,a),sn===null&&(sn=t)),We&&Da(t,l.treeForkCount),e}return St(t),null;case 22:case 23:return Cn(t),Qu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),a=t.updateQueue,a!==null&&zo(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&He(Ys),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ra(Rt),St(t),null;case 25:return null;case 30:return t.flags|=33554432,St(t),null}throw Error(o(156,t.tag))}function OS(e,t){switch(zu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ra(Rt),we(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Cn(t),t.alternate===null)throw Error(o(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Cn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Zu(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 we(),null;case 10:return Ra(t.type),null;case 22:case 23:return Cn(t),Qu(),e!==null&&He(Ys),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ra(Rt),null;case 25:return null;default:return null}}function Yg(e,t){switch(zu(t),t.tag){case 3:Ra(Rt),we();break;case 26:case 27:case 5:ke(t);break;case 4:we();break;case 31:t.memoizedState!==null&&Cn(t);break;case 13:Cn(t);break;case 19:Zu(t);break;case 10:Ra(t.type);break;case 22:case 23:Cn(t),Qu(),e!==null&&He(Ys);break;case 24:Ra(Rt)}}function er(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&e)===e){l=void 0;var u=a.create,g=a.inst;l=u(),g.destroy=l}a=a.next}while(a!==c)}}catch(w){pt(t,t.return,w)}}function us(e,t,a){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 g=l.inst,w=g.destroy;if(w!==void 0){g.destroy=void 0,c=t;var D=a,X=w;try{X()}catch(ae){pt(c,D,ae)}}}l=l.next}while(l!==u)}}catch(ae){pt(t,t.return,ae)}}function Qg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Bp(t,a)}catch(l){pt(e,e.return,l)}}}function Xg(e,t,a){a.props=Ws(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){pt(e,t,l)}}function ca(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var c=e.stateNode,u=Aa(e.memoizedProps,c);(c.ref===null||c.ref.name!==u)&&(c.ref=ny(u)),l=c.ref;break;case 7:if(e.stateNode===null){var g=new Dn(e);b(e.child,!1,C2,g,void 0,void 0),e.stateNode=g}l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(w){pt(e,t,w)}}function en(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(c){pt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){pt(e,t,c)}else a.current=null}function Lo(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)oy(e.stateNode,t[a])}function Zg(e){for(var t=e.return;t!==null&&(Ed(t)&&oy(e.stateNode,t.stateNode),!Cd(t));)t=t.return}function tr(e){for(var t=e.return;t!==null&&(Ed(t)&&E2(e.stateNode,t.stateNode),!Cd(t));)t=t.return}function Cd(e){return e.tag===5||e.tag===3||e.tag===27}function Ed(e){return e&&e.tag===7&&e.stateNode!==null}function Ad(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(c){pt(e,e.return,c)}}function Td(e,t,a){try{var l=e.stateNode;o2(l,e.type,a,t),l[gn]=t}catch(c){pt(e,e.return,c)}}function $g(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xs(e.type)||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$g(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&&xs(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 Dd(e,t,a,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(c,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(c),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ia)),Lo(e,l),ct=!0;else if(c!==4&&(c===27&&(Lo(e,l),l=null,xs(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(Dd(e,t,a,l),e=e.sibling;e!==null;)Dd(e,t,a,l),e=e.sibling}function Oo(e,t,a,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?a.insertBefore(c,t):a.appendChild(c),Lo(e,l),ct=!0;else if(c!==4&&(c===27&&(Lo(e,l),l=null,xs(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(Oo(e,t,a,l),e=e.sibling;e!==null;)Oo(e,t,a,l),e=e.sibling}function Wg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);tn(t,l,a),t[Zt]=e,t[gn]=a}catch(u){pt(e,e.return,u)}}var Bo=!1,En=null;function Jg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Bo=!0)}var ua=null;function ex(){var e=ua;return ua=null,e}var yn=0;function Yl(e,t,a,l,c){return yn=0,tx(e.child,t,a,l,c)}function tx(e,t,a,l,c){for(var u=!1;e!==null;){if(e.tag===5){var g=e.stateNode;if(l!==null){var w=pf(g);l.push(w),w.view&&(u=!0)}else u||pf(g).view&&(u=!0);Bo=!0,ey(g,yn===0?t:t+"_"+yn,a),yn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||tx(e.child,t,a,l,c)&&(u=!0));e=e.sibling}return u}function da(e,t){for(;e!==null;)e.tag===5?ty(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||da(e.child,t)),e=e.sibling}function Uo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Uo(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 a=t.name;t=Ta(t.default,t.share),t!=="none"&&(Yl(e,a,t,null,!1)||da(e.child,!1))}e=e.sibling}}function Md(e,t){if(e.tag===30){var a=e.stateNode,l=e.memoizedProps,c=Aa(l,a),u=Ta(l.default,a.paired?l.share:l.enter);u!=="none"?Yl(e,c,u,null,!1)?(Uo(e),a.paired||t||ti(e,l.onEnter)):da(e.child,!1):Uo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Md(e,t),e=e.sibling;else Uo(e)}function Rd(e){if(En!==null&&En.size!==0){var t=En;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 a=e.memoizedProps,l=a.name;if(l!=null&&l!=="auto"){var c=t.get(l);if(c!==void 0){var u=Ta(a.default,a.share);if(u!=="none"&&(Yl(e,l,u,null,!1)?(u=e.stateNode,c.paired=u,u.paired=c,ti(e,a.onShare)):da(e.child,!1)),t.delete(l),t.size===0)break}}}Rd(e)}e=e.sibling}}}function zd(e){if(e.tag===30){var t=e.memoizedProps,a=Aa(t,e.stateNode),l=En!==null?En.get(a):void 0,c=Ta(t.default,l!==void 0?t.share:t.exit);c!=="none"&&(Yl(e,a,c,null,!1)?l!==void 0?(c=e.stateNode,l.paired=c,c.paired=l,En.delete(a),ti(e,t.onShare)):ti(e,t.onExit):da(e.child,!1)),En!==null&&Rd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)zd(e),e=e.sibling;else En!==null&&Rd(e)}function nx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=Aa(t,e.stateNode);t=Ta(t.default,t.update),e.flags&=-5,t!=="none"&&Yl(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&nx(e);e=e.sibling}}function Ld(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,da(e.child,!1))}Ld(e)}e=e.sibling}}function Ho(e){if(e.tag===30)e.stateNode.paired=null,da(e.child,!1),Ld(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ho(e),e=e.sibling;else Ld(e)}function ax(e){for(e=e.child;e!==null;)e.tag===30?da(e.child,!1):(e.subtreeFlags&33554432)!==0&&ax(e),e=e.sibling}function Od(e,t,a,l,c,u,g){for(var w=!1;t!==null;){if(t.tag===5){var D=t.stateNode;if(u!==null&&yn<u.length){var X=u[yn],ae=pf(D);(X.view||ae.view)&&(w=!0);var xe;if(xe=(e.flags&4)===0)if(ae.clip)xe=!0;else{xe=X.rect;var V=ae.rect;xe=xe.y!==V.y||xe.x!==V.x||xe.height!==V.height||xe.width!==V.width}xe&&(e.flags|=4),ae.abs?ae=!X.abs:(X=X.rect,ae=ae.rect,ae=X.height!==ae.height||X.width!==ae.width),ae&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&ey(D,yn===0?a:a+"_"+yn,c),w&&(e.flags&4)!==0||(ua===null&&(ua=[]),ua.push(D,yn===0?l:l+"_"+yn,t.memoizedProps)),yn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&g?e.flags|=t.flags&32:Od(e,t.child,a,l,c,u,g)&&(w=!0));t=t.sibling}return w}function sx(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,l=e.stateNode,c=Aa(a,l),u=Ta(a.default,a.update),g;g=e.memoizedState,e.memoizedState=null,l=e;var w=e.child;yn=0,c=Od(l,w,c,c,u,g,!1),(e.flags&4)!==0&&c&&ti(e,a.onUpdate)}else(e.subtreeFlags&33554432)!==0&&sx(e);e=e.sibling}}var Kt=!1,ft=!1,fa=!1,Bd=!1,lx=typeof WeakSet=="function"?WeakSet:Set,Yt=null,ma=!1,nr=!1,Po=!1,Ud=!1;function BS(e,t,a){if(e=e.containerInfo,uf=di,e=cp(e),ju(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,g=c.focusNode;c=c.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var w=0,D=-1,X=-1,ae=0,xe=0,V=e,ee=null;t:for(;;){for(var je;V!==l||u!==0&&V.nodeType!==3||(D=w+u),V!==g||c!==0&&V.nodeType!==3||(X=w+c),V.nodeType===3&&(w+=V.nodeValue.length),(je=V.firstChild)!==null;)ee=V,V=je;for(;;){if(V===e)break t;if(ee===l&&++ae===u&&(D=w),ee===g&&++xe===c&&(X=w),(je=V.nextSibling)!==null)break;V=ee,ee=V.parentNode}V=je}l=D===-1||X===-1?null:{start:D,end:X}}else l=null}l=l||{start:0,end:0}}else l=null;for(df={focusedElem:e,selectionRange:l},di=!1,a=(a&335544064)===a,Yt=t,t=a?9270:1024;Yt!==null;){if(e=Yt,a&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)a&&zd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)a&&Jg(e),qo(a);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&a&&zd(l),qo(a);continue}else if(l!==null&&l.memoizedState!==null){a&&Jg(e),qo(a);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Yt=l):(a&&nx(e),qo(a))}}En=null}function qo(e){for(;Yt!==null;){var t=Yt,a=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){a=void 0,c=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var g=Ws(t.type,c);a=u.getSnapshotBeforeUpdate(g,l),u.__reactInternalSnapshotBeforeUpdate=a}catch(w){pt(t,t.return,w)}}break;case 3:if((c&1024)!==0){if(l=t.stateNode.containerInfo,a=l.nodeType,a===9)yf(l);else if(a===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":yf(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&l!==null&&(a=Aa(l.memoizedProps,l.stateNode),c=t.memoizedProps,c=Ta(c.default,c.update),c!=="none"&&Yl(l,a,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 ix(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ha(e,a),l&4&&er(5,a);break;case 1:if(ha(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(g){pt(a,a.return,g)}else{var c=Ws(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){pt(a,a.return,g)}}l&64&&Qg(a),l&512&&ca(a,a.return);break;case 3:if(ha(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Bp(e,t)}catch(g){pt(a,a.return,g)}}break;case 27:t===null&&l&4&&Wg(a);case 26:case 5:ha(e,a),t===null&&l&4&&Ad(a),l&512&&ca(a,a.return);break;case 12:ha(e,a);break;case 31:ha(e,a),l&4&&ux(e,a);break;case 13:ha(e,a),l&4&&dx(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=XS.bind(null,a),_2(e,a))));break;case 22:if(l=a.memoizedState!==null||Kt,!l){var u=t!==null&&t.memoizedState!==null||ft;t=Kt,c=ft,Kt=l,(ft=u)&&!c?(l=2,(a.subtreeFlags&8772)!==0&&(l|=1),Jn(e,a,l)):ha(e,a),Kt=t,ft=c}break;case 30:ha(e,a),l&512&&ca(a,a.return);break;case 7:l&512&&ca(a,a.return);default:ha(e,a)}}function Hd(e,t){for(e=e.child;e!==null;)rx(e,t),e=e.sibling}function rx(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var l=a.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var c=e.stateNode,u=e.memoizedProps.style,g=u!=null&&u.hasOwnProperty("display")?u.display:null;c.style.display=g==null||typeof g=="boolean"?"":(""+g).trim()}}catch(D){pt(e,e.return,D)}Pd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,ct=!0}catch(D){pt(e,e.return,D)}break;case 18:try{var w=e.stateNode;t?Jx(w,!0):Jx(e.stateNode,!1)}catch(D){pt(e,e.return,D)}break;case 22:case 23:e.memoizedState===null&&Hd(e,t);break;default:Hd(e,t)}}function Pd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,l=t;switch(a.tag){case 4:rx(a,l);break e;case 22:a.memoizedState===null&&Pd(a,l);break e;default:Pd(a,l)}}e=e.sibling}}function ox(e){var t=e.alternate;t!==null&&(e.alternate=null,ox(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vr(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 Ct=null,vn=!1;function $n(e,t,a){for(a=a.child;a!==null;)cx(e,t,a),a=a.sibling}function cx(e,t,a){if(Pe&&typeof Pe.onCommitFiberUnmount=="function")try{Pe.onCommitFiberUnmount(ze,a)}catch{}switch(a.tag){case 26:ft||en(a,t),$n(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!ft&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ft||en(a,t),tr(a);var l=Ct,c=vn;xs(a.type)&&(Ct=a.stateNode,vn=!1),$n(e,t,a),my(a.stateNode,a.type,a.memoizedProps),Ct=l,vn=c;break;case 5:ft||en(a,t),tr(a);case 6:if(a.tag===6&&tr(a),l=Ct,c=vn,Ct=null,$n(e,t,a),Ct=l,vn=c,Ct!==null)if(vn)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(a.stateNode),ct=!0}catch(u){pt(a,t,u)}else try{Ct.removeChild(a.stateNode),ct=!0}catch(u){pt(a,t,u)}break;case 18:Ct!==null&&(vn?(e=Ct,Wx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),fi(e)):Wx(Ct,a.stateNode));break;case 4:l=Ct,c=vn,Ct=a.stateNode.containerInfo,vn=!0,$n(e,t,a),Ct=l,vn=c;break;case 0:case 11:case 14:case 15:us(2,a,t),ft||us(4,a,t),$n(e,t,a);break;case 1:ft||(en(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Xg(a,t,l)),$n(e,t,a);break;case 21:$n(e,t,a);break;case 22:ft=(l=ft)||a.memoizedState!==null,$n(e,t,a),ft=l;break;case 30:en(a,t),$n(e,t,a);break;case 7:ft||en(a,t),$n(e,t,a);break;default:$n(e,t,a)}}function ux(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(a){pt(t,t.return,a)}}}function dx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(a){pt(t,t.return,a)}}function US(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lx),t;default:throw Error(o(435,e.tag))}}function Fo(e,t){var a=US(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var c=ZS.bind(null,e,l);l.then(c,c)}})}function un(e,t,a){var l=t.deletions;if(l!==null)for(var c=0;c<l.length;c++){var u=l[c],g=e,w=t,D=w;e:for(;D!==null;){switch(D.tag){case 27:if(xs(D.type)){Ct=D.stateNode,vn=!1;break e}break;case 5:Ct=D.stateNode,vn=!1;break e;case 3:case 4:Ct=D.stateNode.containerInfo,vn=!0;break e}D=D.return}if(Ct===null)throw Error(o(160));cx(g,w,u),Ct=null,vn=!1,g=u.alternate,g!==null&&(g.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fx(t,e,a),t=t.sibling}var Wn=null;function fx(e,t,a){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 g=l[u];g.ref.impl=g.nextImpl}un(t,e,a),dn(e),c&4&&(us(3,e,e.return),er(3,e),us(5,e,e.return));break;case 1:un(t,e,a),dn(e),c&512&&(ft||l===null||en(l,l.return)),c&64&&Kt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(u=Wn,un(t,e,a),dn(e),c&512&&(ft||l===null||en(l,l.return)),c&4)if(c=l!==null?l.memoizedState:null,a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null)if(Kt)e.stateNode=Xx(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,c=u.ownerDocument||u;t:switch(t){case"title":l=c.getElementsByTagName("title")[0],(!l||l[Ai]||l[Zt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=c.createElement(t),c.head.insertBefore(l,c.querySelector("head > title"))),tn(l,t,a),l[Zt]=e,It(l),t=l;break e;case"link":if(u=vy("link","href",c).get(t+(a.href||""))){for(g=0;g<u.length;g++)if(l=u[g],l.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&l.getAttribute("rel")===(a.rel==null?null:a.rel)&&l.getAttribute("title")===(a.title==null?null:a.title)&&l.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){u.splice(g,1);break t}}l=c.createElement(t),tn(l,t,a),c.head.appendChild(l);break;case"meta":if(u=vy("meta","content",c).get(t+(a.content||""))){for(g=0;g<u.length;g++)if(l=u[g],l.getAttribute("content")===(a.content==null?null:""+a.content)&&l.getAttribute("name")===(a.name==null?null:a.name)&&l.getAttribute("property")===(a.property==null?null:a.property)&&l.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&l.getAttribute("charset")===(a.charSet==null?null:a.charSet)){u.splice(g,1);break t}}l=c.createElement(t),tn(l,t,a),c.head.appendChild(l);break;default:throw Error(o(468,t))}l[Zt]=e,It(l),t=l}e.stateNode=t}else Kt||Nf(u,e.type,e.stateNode);else e.stateNode=yy(u,a,e.memoizedProps);else c!==a?(c===null?(t=l.stateNode,t===null||ft||t.parentNode.removeChild(t)):c.count--,a===null?Kt||Nf(u,e.type,e.stateNode):yy(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Td(e,e.memoizedProps,l.memoizedProps);break;case 27:un(t,e,a),dn(e),c&512&&(ft||l===null||en(l,l.return)),l!==null&&c&4&&Td(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=fa,fa=!1,un(t,e,a),fa=u,dn(e),c&512&&(ft||l===null||en(l,l.return)),e.flags&32){t=e.stateNode;try{Tl(t,""),ct=!0}catch(ae){pt(e,e.return,ae)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,Td(e,t,l!==null?l.memoizedProps:t)),c&1024&&(Bd=!0);break;case 6:if(un(t,e,a),dn(e),c&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,ct=!0}catch(ae){pt(e,e.return,ae)}}break;case 3:if(ct=!1,ac=null,u=Wn,Wn=dr(t.containerInfo),un(t,e,a),Wn=u,dn(e),c&4&&l!==null&&l.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(ae){pt(e,e.return,ae)}Bd&&(Bd=!1,mx(e)),ct=!1;break;case 4:c=fa,fa=Kt,l=Rh(),u=Wn,Wn=dr(e.stateNode.containerInfo),un(t,e,a),dn(e),Wn=u,ct&&nr&&(Po=!0),ct=l,fa=c;break;case 12:un(t,e,a),dn(e);break;case 31:un(t,e,a),dn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fo(e,t)));break;case 13:un(t,e,a),dn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vo=Ht()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fo(e,t)));break;case 22:u=e.memoizedState!==null,g=l!==null&&l.memoizedState!==null;var w=Kt,D=ft,X=fa;Kt=w||u,fa=X||u,ft=D||g,un(t,e,a),ft=D,fa=X,Kt=w,dn(e),c&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||g||Kt||ft||(t=g||ft,a=Kt,l=ft,Kt=u||Kt,ft=t,ds(e,2),Kt=a,ft=l),!u&&fa||Hd(e,u)),c&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,Fo(e,a))));break;case 19:un(t,e,a),dn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fo(e,t)));break;case 30:c&512&&(ft||l===null||en(l,l.return)),c=Rh(),u=nr,g=(a&335544064)===a,w=e.memoizedProps,nr=g&&Ta(w.default,w.update)!=="none",un(t,e,a),dn(e),g&&l!==null&&ct&&(e.flags|=4),nr=u,ct=c;break;case 21:break;case 7:c&512&&(ft||l===null||en(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:un(t,e,a),dn(e)}}function dn(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if($g(l)){a=l;break}l=l.return}l=null;for(var c=e.return;c!==null;){if(Ed(c)){var u=c.stateNode;l===null?l=[u]:l.push(u)}if(Cd(c))break;c=c.return}var g=l;if(a==null)throw Error(o(160));switch(a.tag){case 27:var w=a.stateNode,D=_d(e);Oo(e,D,w,g);break;case 5:var X=a.stateNode;a.flags&32&&(Tl(X,""),a.flags&=-33);var ae=_d(e);Oo(e,ae,X,g);break;case 3:case 4:var xe=a.stateNode.containerInfo,V=_d(e);Dd(e,V,xe,g);break;default:throw Error(o(161))}}catch(ee){pt(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mx(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,di=!0,t.reset(),di=!1),e=e.sibling}}function Ql(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)hx(t,e),t=t.sibling;else sx(t)}function hx(e,t){var a=e.alternate;if(a===null)Md(e,!1);else switch(e.tag){case 3:if(Ud=ma=!1,ex(),Ql(t,e),!ma&&!Po){if(e=ua,e!==null)for(var l=0;l<e.length;l+=3){a=e[l];var c=e[l+1];ty(a,e[l+2]),a=a.ownerDocument.documentElement,a!==null&&a.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"})),Ud=!0}ua=null;break;case 5:Ql(t,e);break;case 4:l=ma,ma=!1,Ql(t,e),ma&&(Po=!0),ma=l;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?Md(e,!1):Ql(t,e));break;case 30:l=ma,c=ex(),ma=!1,Ql(t,e),ma&&(e.flags|=4);var u=e.memoizedProps,g=e.stateNode;t=Aa(u,g),g=Aa(a.memoizedProps,g);var w=Ta(u.default,u.update);w==="none"?t=!1:(u=a.memoizedState,a.memoizedState=null,a=e.child,yn=0,t=Od(e,a,t,g,w,u,!0),yn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ti(e,e.memoizedProps.onUpdate),ua=c):c!==null&&(c.push.apply(c,ua),ua=c),ma=(e.flags&32)!==0?!0:l;break;default:Ql(t,e)}}function ha(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ix(e,t.alternate,t),t=t.sibling}function ds(e,t){for(e=e.child;e!==null;){var a=e,l=t;switch(a.tag){case 0:case 11:case 14:case 15:us(4,a,a.return),ds(a,l);break;case 1:en(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&Xg(a,a.return,c),ds(a,l);break;case 27:(l&2)!==0&&my(a.stateNode,a.type,a.memoizedProps);case 5:en(a,a.return),a.tag!==5&&a.tag!==27||tr(a),ds(a,l);break;case 6:tr(a);break;case 26:en(a,a.return),c=a.stateNode,a.memoizedState!==null||c===null||ft||c.parentNode.removeChild(c),ds(a,l);break;case 22:a.memoizedState===null&&ds(a,l);break;case 30:en(a,a.return),ds(a,l);break;case 7:en(a,a.return);default:ds(a,l)}e=e.sibling}}function Jn(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var l=t.alternate,c=e,u=t,g=u.flags,w=(a&1)!==0;switch(u.tag){case 0:case 11:case 15:Jn(c,u,a),er(4,u);break;case 1:if(Jn(c,u,a),l=u,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(ae){pt(l,l.return,ae)}if(l=u,c=l.updateQueue,c!==null){var D=l.stateNode;try{var X=c.shared.hiddenCallbacks;if(X!==null)for(c.shared.hiddenCallbacks=null,c=0;c<X.length;c++)Op(X[c],D)}catch(ae){pt(l,l.return,ae)}}w&&g&64&&Qg(u),ca(u,u.return);break;case 27:(a&2)!==0&&Wg(u);case 5:u.tag!==5&&u.tag!==27||Zg(u),Jn(c,u,a),w&&l===null&&g&4&&Ad(u),ca(u,u.return);break;case 6:Zg(u);break;case 26:D=u.stateNode,u.memoizedState!==null||D===null||Kt||Nf(dr(D.ownerDocument),u.type,D),Jn(c,u,a),w&&l===null&&g&4&&Ad(u),ca(u,u.return);break;case 12:Jn(c,u,a);break;case 31:Jn(c,u,a),w&&g&4&&ux(c,u);break;case 13:Jn(c,u,a),w&&g&4&&dx(c,u);break;case 22:u.memoizedState===null&&Jn(c,u,a),ca(u,u.return);break;case 30:Jn(c,u,a),ca(u,u.return);break;case 7:ca(u,u.return);default:Jn(c,u,a)}t=t.sibling}}function qd(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&qi(a))}function Fd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qi(e))}function Pn(e,t,a,l){var c=(a&335544064)===a;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)px(e,t,a,l),t=t.sibling;else c&&ax(t)}function px(e,t,a,l){var c=(a&335544064)===a;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ho(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:Pn(e,t,a,l),u&2048&&er(9,t);break;case 1:Pn(e,t,a,l);break;case 3:Pn(e,t,a,l),c&&Ud&&(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&&qi(u)));break;case 12:if(u&2048){Pn(e,t,a,l),u=t.stateNode;try{var g=t.memoizedProps,w=g.id,D=g.onPostCommit;typeof D=="function"&&D(w,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(X){pt(t,t.return,X)}}else Pn(e,t,a,l);break;case 31:Pn(e,t,a,l);break;case 13:Pn(e,t,a,l);break;case 23:break;case 22:g=t.stateNode,w=t.alternate,t.memoizedState!==null?(c&&w!==null&&w.memoizedState===null&&Ho(w),g._visibility&2?Pn(e,t,a,l):ar(e,t)):(c&&w!==null&&w.memoizedState!==null&&Ho(t),g._visibility&2?Pn(e,t,a,l):(g._visibility|=2,Xl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&qd(w,t);break;case 24:Pn(e,t,a,l),u&2048&&Fd(t.alternate,t);break;case 30:c&&(u=t.alternate,u!==null&&(da(u.child,!0),da(t.child,!0))),Pn(e,t,a,l);break;default:Pn(e,t,a,l)}}function Xl(e,t,a,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,g=t,w=a,D=l,X=g.flags;switch(g.tag){case 0:case 11:case 15:Xl(u,g,w,D,c),er(8,g);break;case 23:break;case 22:var ae=g.stateNode;g.memoizedState!==null?ae._visibility&2?Xl(u,g,w,D,c):ar(u,g):(ae._visibility|=2,Xl(u,g,w,D,c)),c&&X&2048&&qd(g.alternate,g);break;case 24:Xl(u,g,w,D,c),c&&X&2048&&Fd(g.alternate,g);break;default:Xl(u,g,w,D,c)}t=t.sibling}}function ar(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,c=l.flags;switch(l.tag){case 22:ar(a,l),c&2048&&qd(l.alternate,l);break;case 24:ar(a,l),c&2048&&Fd(l.alternate,l);break;default:ar(a,l)}t=t.sibling}}var Js=8192;function el(e,t,a){if(e.subtreeFlags&Js)for(e=e.child;e!==null;)gx(e,t,a),e=e.sibling}function gx(e,t,a){switch(e.tag){case 26:el(e,t,a),e.flags&Js&&(e.memoizedState!==null?I2(a,Wn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&ky(a,e)));break;case 5:el(e,t,a),e.flags&Js&&(e=e.stateNode,(t&335544128)===t&&ky(a,e));break;case 3:case 4:var l=Wn;Wn=dr(e.stateNode.containerInfo),el(e,t,a),Wn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Js,Js=16777216,el(e,t,a),Js=l):el(e,t,a));break;case 30:if((e.flags&Js)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var c=e.stateNode;c.paired=null,En===null&&(En=new Map),En.set(l,c)}el(e,t,a);break;default:el(e,t,a)}}function xx(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 sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Yt=l,vx(l,e)}xx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yx(e),e=e.sibling}function yx(e){switch(e.tag){case 0:case 11:case 15:sr(e),e.flags&2048&&us(9,e,e.return);break;case 3:sr(e);break;case 12:sr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Go(e)):sr(e);break;default:sr(e)}}function Go(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Yt=l,vx(l,e)}xx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:us(8,t,t.return),Go(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Go(t));break;default:Go(t)}e=e.sibling}}function vx(e,t){for(;Yt!==null;){var a=Yt;switch(a.tag){case 0:case 11:case 15:us(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:qi(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Yt=l;else e:for(a=e;Yt!==null;){l=Yt;var c=l.sibling,u=l.return;if(ox(l),l===a){Yt=null;break e}if(c!==null){c.return=u,Yt=c;break e}Yt=u}}}var HS={getCacheForType:function(e){var t=$t(Rt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return $t(Rt).controller.signal}},PS=typeof WeakMap=="function"?WeakMap:Map,ut=0,bt=null,tt=null,at=0,ht=0,An=null,fs=!1,Zl=!1,Gd=!1,Ua=0,_t=0,ms=0,tl=0,Io=0,Tn=0,$l=0,lr=null,bn=null,Id=!1,Vo=0,bx=0,Ko=1/0,Yo=null,hs=null,At=0,ea=null,nl=null,pa=0,Vd=0,Kd=null,wx=null,Wl=null,Jl=null,ei=null,ir=0,Qo=null;function _n(){return(ut&2)!==0&&at!==0?at&-at:ve.T!==null?nf():jh()}function Sx(){if(Tn===0)if((at&536870912)===0||We){var e=aa;aa<<=1,(aa&3932160)===0&&(aa=262144),Tn=e}else Tn=536870912;return e=Wt.current,e!==null&&(e.flags|=32),Tn}function ti(e,t){if(t!=null){var a=e.stateNode,l=a.ref;l===null&&(l=a.ref=ny(Aa(e.memoizedProps,a))),Jl===null&&(Jl=[]),Jl.push(t.bind(null,l))}}function wn(e,t,a){(e===bt&&(ht===2||ht===9)||e.cancelPendingCommit!==null)&&(ni(e,0),ps(e,at,Tn,!1)),Ei(e,a),((ut&2)===0||e!==bt)&&(e===bt&&((ut&2)===0&&(tl|=a),_t===4&&ps(e,at,Tn,!1)),ga(e))}function kx(e,t,a){if((ut&6)!==0)throw Error(o(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ci(e,t),c=l?GS(e,t):Qd(e,t,!0),u=l;do{if(c===0){Zl&&!l&&ps(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!qS(a)){c=Qd(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var w=e;c=lr;var D=w.current.memoizedState.isDehydrated;if(D&&(ni(w,g).flags|=256),g=Qd(w,g,!1),g!==2&&g!==6){if(Gd&&!D){w.errorRecoveryDisabledLanes|=u,tl|=u,c=4;break e}u=bn,bn=c,u!==null&&(bn===null?bn=u:bn.push.apply(bn,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){ni(e,0),ps(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:ps(l,t,Tn,!fs);break e;case 2:bn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Vo+300-Ht(),10<c)){if(ps(l,t,Tn,!fs),la(l,0,!0)!==0)break e;pa=t,l.timeoutHandle=hf(jx.bind(null,l,a,bn,Yo,Id,t,Tn,tl,$l,fs,u,"Throttled",-0,0),c);break e}jx(l,a,bn,Yo,Id,t,Tn,tl,$l,fs,u,null,-0,0)}}break}while(!0);ga(e)}function jx(e,t,a,l,c,u,g,w,D,X,ae,xe,V,ee){e.timeoutHandle=-1;var je=t.subtreeFlags,Re=(u&335544064)===u;if(xe=null,(Re||je&8192||(je&16785408)===16785408)&&(xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},En=null,gx(t,u,xe),Re&&(je=xe,Re=e.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(je.count++,je.waitingForViewTransition=!0,je=hr.bind(je),Re.finished.then(je,je))),je=(u&62914560)===u?Vo-Ht():(u&4194048)===u?bx-Ht():0,je=V2(xe,je),je!==null)){pa=u,e.cancelPendingCommit=je(Mx.bind(null,e,t,u,a,l,c,g,w,D,X,ae,xe,null,V,ee)),ps(e,u,g,!X);return}Mx(e,t,u,a,l,c,g,w,D,X,ae,xe)}function qS(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var c=a[l],u=c.getSnapshot;c=c.value;try{if(!Nn(u(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 ps(e,t,a,l){t=vh(e,t),t&=~Io,t&=~tl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var u=31-Ce(c),g=1<<u;l[u]=-1,c&=~g}a!==0&&wh(e,a,t)}function Xo(){return(ut&6)===0?(rr(0),!1):!0}function Yd(){if(tt!==null){if(ht===0)var e=tt.return;else e=tt,Ma=Gs=null,td(e),Fl=null,Ii=0,e=tt;for(;e!==null;)Yg(e.alternate,e),e=e.return;tt=null}}function ni(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,d2(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),pa=0,Yd(),bt=e,tt=a=_a(e.current,null),at=t,ht=0,An=null,fs=!1,Zl=Ci(e,t),Gd=!1,$l=Tn=Io=tl=ms=_t=0,bn=lr=null,Id=!1,Ua=vh(e,t),no(),a}function Nx(e,t){Xe=null,ve.H=Ao,t===ql||t===ho?(t=Mp(),ht=3):t===Fu?(t=Mp(),ht=4):ht=t===gd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,An=t,tt===null&&(_t=1,To(e,On(t,e.current)))}function Cx(){var e=Wt.current;return e===null?!0:(at&4194048)===at?sn===null:(at&62914560)===at||(at&536870912)!==0?e===sn:!1}function Ex(){var e=ve.H;return ve.H=Ao,e===null?Ao:e}function Ax(){var e=ve.A;return ve.A=HS,e}function Zo(){_t=4,fs||(at&4194048)!==at&&Wt.current!==null||(Zl=!0),(ms&134217727)===0&&(tl&134217727)===0||bt===null||ps(bt,at,Tn,!1)}function Qd(e,t,a){var l=ut;ut|=2;var c=Ex(),u=Ax();(bt!==e||at!==t)&&(Yo=null,ni(e,t)),t=!1;var g=_t;e:do try{if(ht!==0&&tt!==null){var w=tt,D=An;switch(ht){case 8:Yd(),g=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(t=!0);var X=ht;if(ht=0,An=null,ai(e,w,D,X),a&&Zl){g=0;break e}break;default:X=ht,ht=0,An=null,ai(e,w,D,X)}}FS(),g=_t;break}catch(ae){Nx(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Ma=Gs=null,ut=l,ve.H=c,ve.A=u,tt===null&&(bt=null,at=0,no()),g}function FS(){for(;tt!==null;)Tx(tt)}function GS(e,t){var a=ut;ut|=2;var l=Ex(),c=Ax();bt!==e||at!==t?(Yo=null,Ko=Ht()+500,ni(e,t)):Zl=Ci(e,t);e:do try{if(ht!==0&&tt!==null){t=tt;var u=An;t:switch(ht){case 1:ht=0,An=null,ai(e,t,u,1);break;case 2:case 9:if(_p(u)){ht=0,An=null,_x(t);break}t=function(){ht!==2&&ht!==9||bt!==e||(ht=7),ga(e)},u.then(t,t);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:_p(u)?(ht=0,An=null,_x(t)):(ht=0,An=null,ai(e,t,u,7));break;case 5:var g=null;switch(tt.tag){case 26:g=tt.memoizedState;case 5:case 27:var w=tt;if(g?wy(g):w.stateNode.complete){ht=0,An=null;var D=w.sibling;if(D!==null)tt=D;else{var X=w.return;X!==null?(tt=X,$o(X)):tt=null}break t}}ht=0,An=null,ai(e,t,u,5);break;case 6:ht=0,An=null,ai(e,t,u,6);break;case 8:Yd(),_t=6;break e;default:throw Error(o(462))}}IS();break}catch(ae){Nx(e,ae)}while(!0);return Ma=Gs=null,ve.H=l,ve.A=c,ut=a,tt!==null?0:(bt=null,at=0,no(),_t)}function IS(){for(;tt!==null&&!Ni();)Tx(tt)}function Tx(e){var t=Vg(e.alternate,e,Ua);e.memoizedProps=e.pendingProps,t===null?$o(e):tt=t}function _x(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Ug(a,t,t.pendingProps,t.type,void 0,at);break;case 11:t=Ug(a,t,t.pendingProps,t.type.render,t.ref,at);break;case 5:td(t);var l=t;l===Vt&&(We?(oo(l),l.tag===5&&l.stateNode!=null&&(wt=l.stateNode)):(oo(l),We=!0));default:Yg(a,t),t=tt=vp(t,Ua),t=Vg(a,t,Ua)}e.memoizedProps=e.pendingProps,t===null?$o(e):tt=t}function ai(e,t,a,l){Ma=Gs=null,td(t),Fl=null,Ii=0;var c=t.return;try{if(DS(e,c,t,a,at)){_t=1,To(e,On(a,e.current)),tt=null;return}}catch(u){if(c!==null)throw tt=c,u;_t=1,To(e,On(a,e.current)),tt=null;return}t.flags&32768?(We||l===1?e=!0:Zl||(at&536870912)!==0?e=!1:(fs=e=!0,(l===2||l===9||l===3||l===6)&&(l=Wt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Dx(t,e)):$o(t)}function $o(e){var t=e;do{if((t.flags&32768)!==0){Dx(t,fs);return}e=t.return;var a=LS(t.alternate,t,Ua);if(a!==null){tt=a;return}if(t=t.sibling,t!==null){tt=t;return}tt=t=e}while(t!==null);_t===0&&(_t=5)}function Dx(e,t){do{var a=OS(e.alternate,e);if(a!==null){a.flags&=32767,tt=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){tt=e;return}tt=e=a}while(e!==null);_t=6,tt=null}function Mx(e,t,a,l,c,u,g,w,D,X,ae,xe){e.cancelPendingCommit=null;do Wo();while(At!==0);if((ut&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===bt&&(tt=bt=null,at=0),nl=t,ea=e,pa=a,Kd=c,wx=l,VS(e,t,a,g,w,D,xe)}}function VS(e,t,a,l,c,u,g){var w=t.lanes|t.childLanes;if(Vd=w,w|=Tu,xw(e,a,w,l,c,u),Jl=null,(a&335544064)===a?(ei=vS(e),l=10262):(ei=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,$S(ja,function(){return Wd(),null})):(e.callbackNode=null,e.callbackPriority=0),Bo=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=ve.T,ve.T=null,c=be.p,be.p=2,u=ut,ut|=4;try{BS(e,t,a)}finally{ut=u,be.p=c,ve.T=l}}At=1,Bo?Wl=x2(g,e.containerInfo,ei,Xd,Zd,YS,$d,Wd,KS):(Xd(),Zd(),$d())}function KS(e){if(At!==0){var t=ea.onRecoverableError;t(e,{componentStack:null})}}function YS(){At===3&&(At=0,hx(nl,ea),At=4)}function Xd(){if(At===1){At=0;var e=ea,t=nl,a=pa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=ve.T,ve.T=null;var c=be.p;be.p=2;var u=ut;ut|=4;try{nr=Po=!1,fx(t,e,a),a=df;var g=cp(e.containerInfo),w=a.focusedElem,D=a.selectionRange;if(g!==w&&w&&w.ownerDocument&&op(w.ownerDocument.documentElement,w)){if(D!==null&&ju(w)){var X=D.start,ae=D.end;if(ae===void 0&&(ae=X),"selectionStart"in w)w.selectionStart=X,w.selectionEnd=Math.min(ae,w.value.length);else{var xe=w.ownerDocument||document,V=xe&&xe.defaultView||window;if(V.getSelection){var ee=V.getSelection(),je=w.textContent.length,Re=Math.min(D.start,je),Ze=D.end===void 0?Re:Math.min(D.end,je);!ee.extend&&Re>Ze&&(g=Ze,Ze=Re,Re=g);var Q=rp(w,Re),U=rp(w,Ze);if(Q&&U&&(ee.rangeCount!==1||ee.anchorNode!==Q.node||ee.anchorOffset!==Q.offset||ee.focusNode!==U.node||ee.focusOffset!==U.offset)){var J=xe.createRange();J.setStart(Q.node,Q.offset),ee.removeAllRanges(),Re>Ze?(ee.addRange(J),ee.extend(U.node,U.offset)):(J.setEnd(U.node,U.offset),ee.addRange(J))}}}}for(xe=[],ee=w;ee=ee.parentNode;)ee.nodeType===1&&xe.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<xe.length;w++){var ge=xe[w];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}di=!!uf,df=uf=null}finally{ut=u,be.p=c,ve.T=l}}e.current=t,At=2}}function Zd(){if(At===2){At=0;var e=ea,t=nl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ve.T,ve.T=null;var l=be.p;be.p=2;var c=ut;ut|=4;try{ix(e,t.alternate,t)}finally{ut=c,be.p=l,ve.T=a}}At=3}}function $d(){if(At===4||At===3){At=0;var e=Wl;Wl=null,Ya();var t=ea,a=nl,l=pa,c=wx,u=(l&335544064)===l?10262:10256;if((a.subtreeFlags&u)!==0||(a.flags&u)!==0?At=5:(At=0,nl=ea=null,Rx(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(hs=null),iu(l),a=a.stateNode,Pe&&typeof Pe.onCommitFiberRoot=="function")try{Pe.onCommitFiberRoot(ze,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=ve.T,u=be.p,be.p=2,ve.T=null;try{for(var g=t.onRecoverableError,w=0;w<c.length;w++){var D=c[w];g(D.value,{componentStack:D.stack})}}finally{ve.T=a,be.p=u}}if(c=Jl,g=ei,ei=null,c!==null&&(Jl=null,g===null&&(g=[]),e!==null))for(D=0;D<c.length;D++)a=(0,c[D])(g),a!==void 0&&e.finished.finally(a);(pa&3)!==0&&Wo(),ga(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Qo?ir++:(ir=0,Qo=t):(ir=0,Qo=null),rr(0)}}function Rx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qi(t)))}function Wo(){return Wl!==null&&(Wl.skipTransition(),Wl=null),Xd(),Zd(),$d(),Wd()}function Wd(){if(At!==5)return!1;var e=ea,t=Vd;Vd=0;var a=iu(pa),l=ve.T,c=be.p;try{be.p=32>a?32:a,ve.T=null,a=Kd,Kd=null;var u=ea,g=pa;if(At=0,nl=ea=null,pa=0,(ut&6)!==0)throw Error(o(331));var w=ut;if(ut|=4,yx(u.current),px(u,u.current,g,a),ut=w,rr(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot=="function")try{Pe.onPostCommitFiberRoot(ze,u)}catch{}return!0}finally{be.p=c,ve.T=l,Rx(e,t)}}function zx(e,t,a){t=On(a,t),t=pd(e.stateNode,t,2),e=is(e,t,2),e!==null&&(Ei(e,2),ga(e))}function pt(e,t,a){if(e.tag===3)zx(e,e,a);else for(;t!==null;){if(t.tag===3){zx(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(hs===null||!hs.has(l))){e=On(a,e),a=_g(2),l=is(t,a,2),l!==null&&(Dg(a,l,t,e),Ei(l,2),ga(l));break}}t=t.return}}function Jd(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new PS;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(a)||(Gd=!0,c.add(a),e=QS.bind(null,e,t,a),t.then(e,e))}function QS(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,bt===e&&(at&a)===a&&((_t===4||_t===3&&(at&62914560)===at&&300>Ht()-Vo)&&(ut&2)===0?ni(e,0):Io|=a,$l===at&&($l=0)),ga(e)}function Lx(e,t){t===0&&(t=bh()),e=Ps(e,t),e!==null&&(Ei(e,t),ga(e))}function XS(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Lx(e,a)}function ZS(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=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),Lx(e,a)}function $S(e,t){return Rs(e,t)}var si=null,li=null,ef=!1,Jo=!1,tf=!1,gs=0;function ga(e){e!==li&&e.next===null&&(li===null?si=li=e:li=li.next=e),Jo=!0,ef||(ef=!0,JS())}function rr(e,t){if(!tf&&Jo){tf=!0;do for(var a=!1,l=si;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var u=0;else{var g=l.suspendedLanes,w=l.pingedLanes;u=(1<<31-Ce(42|e)+1)-1,u&=c&~(g&~w),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Hx(l,u))}else u=at,u=la(l,l===bt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Ci(l,u)||(a=!0,Hx(l,u));l=l.next}while(a);tf=!1}}function WS(){Ox()}function Ox(){Jo=ef=!1;var e=0;gs!==0&&u2()&&(e=gs);for(var t=Ht(),a=null,l=si;l!==null;){var c=l.next,u=Bx(l,t);u===0?(l.next=null,a===null?si=c:a.next=c,c===null&&(li=a)):(a=l,(e!==0||(u&3)!==0)&&(Jo=!0)),l=c}At!==0&&At!==5||rr(e),gs!==0&&(gs=0)}function Bx(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var g=31-Ce(u),w=1<<g,D=c[g];D===-1?((w&a)===0||(w&l)!==0)&&(c[g]=gw(w,t)):D<=t&&(e.expiredLanes|=w),u&=~w}if(t=bt,a=at,a=la(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(ht===2||ht===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&zs(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ci(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&zs(l),iu(a)){case 2:case 8:a=Xa;break;case 32:a=ja;break;case 268435456:a=Za;break;default:a=ja}return l=Ux.bind(null,e),a=Rs(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&zs(l),e.callbackPriority=2,e.callbackNode=null,2}function Ux(e,t){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Wo()&&e.callbackNode!==a)return null;var l=at;return l=la(e,e===bt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(kx(e,l,t),Bx(e,Ht()),e.callbackNode!=null&&e.callbackNode===a?Ux.bind(null,e):null)}function Hx(e,t){if(Wo())return null;kx(e,t,!0)}function JS(){f2(function(){(ut&6)!==0?Rs(Ls,WS):Ox()})}function nf(){if(gs===0){var e=Ks;e===0&&(e=Qn,Qn<<=1,(Qn&261888)===0&&(Qn=256)),gs=e}return gs}function Px(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qr(e)}function e2(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var u=Px((c[gn]||null).action),g=l.submitter;g&&(t=(t=g[gn]||null)?Px(t.formAction):g.getAttribute("formAction"),t!==null&&(u=t,g=null));var w=new Wr("action","action",null,l,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(gs!==0){var D=new FormData(c,g);ud(a,{pending:!0,data:D,method:c.method,action:u},null,D)}}else typeof u=="function"&&(w.preventDefault(),D=new FormData(c,g),ud(a,{pending:!0,data:D,method:c.method,action:u},u,D))},currentTarget:c}]})}}for(var af=0;af<Au.length;af++){var sf=Au[af],t2=sf.toLowerCase(),n2=sf[0].toUpperCase()+sf.slice(1);Zn(t2,"on"+n2)}Zn(fp,"onAnimationEnd"),Zn(mp,"onAnimationIteration"),Zn(hp,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(dS,"onTransitionRun"),Zn(fS,"onTransitionStart"),Zn(mS,"onTransitionCancel"),Zn(pp,"onTransitionEnd"),El("onMouseEnter",["mouseout","mouseover"]),El("onMouseLeave",["mouseout","mouseover"]),El("onPointerEnter",["pointerout","pointerover"]),El("onPointerLeave",["pointerout","pointerover"]),Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var or="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(" "),a2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(or));function qx(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var g=l.length-1;0<=g;g--){var w=l[g],D=w.instance,X=w.currentTarget;if(w=w.listener,D!==u&&c.isPropagationStopped())break e;u=w,c.currentTarget=X;try{u(c)}catch(ae){to(ae)}c.currentTarget=null,u=D}else for(g=0;g<l.length;g++){if(w=l[g],D=w.instance,X=w.currentTarget,w=w.listener,D!==u&&c.isPropagationStopped())break e;u=w,c.currentTarget=X;try{u(c)}catch(ae){to(ae)}c.currentTarget=null,u=D}}}}function nt(e,t){var a=t[Ch];a===void 0&&(a=t[Ch]=new Set);var l=e+"__bubble";a.has(l)||(Fx(t,e,2,!1),a.add(l))}function lf(e,t,a){var l=0;t&&(l|=4),Fx(a,e,l,t)}var ec="_reactListening"+Math.random().toString(36).slice(2);function rf(e){if(!e[ec]){e[ec]=!0,Th.forEach(function(a){a!=="selectionchange"&&(a2.has(a)||lf(a,!1,e),lf(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ec]||(t[ec]=!0,lf("selectionchange",!1,t))}}function Fx(e,t,a,l){switch(Dy(t)){case 2:var c=X2;break;case 8:c=Z2;break;default:c=Ef}a=c.bind(null,t,a,e),c=void 0,!hu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function of(e,t,a,l,c){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var g=l.tag;if(g===3||g===4){var w=l.stateNode.containerInfo;if(w===c)break;if(g===4)for(g=l.return;g!==null;){var D=g.tag;if((D===3||D===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;w!==null;){if(g=Os(w),g===null)return;if(D=g.tag,D===5||D===6||D===26||D===27){l=u=g;continue e}w=w.parentNode}}l=l.return}Fh(function(){var X=u,ae=fu(a),xe=[];e:{var V=gp.get(e);if(V!==void 0){var ee=Wr,je=e;switch(e){case"keypress":if(Zr(a)===0)break e;case"keydown":case"keyup":ee=qw;break;case"focusin":je="focus",ee=yu;break;case"focusout":je="blur",ee=yu;break;case"beforeblur":case"afterblur":ee=yu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Vh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Tw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Kw;break;case fp:case mp:case hp:ee=Mw;break;case pp:ee=Qw;break;case"scroll":case"scrollend":ee=Ew;break;case"wheel":ee=Zw;break;case"copy":case"cut":case"paste":ee=zw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Yh;break;case"submit":ee=Iw;break;case"toggle":case"beforetoggle":ee=Ww}var Re=(t&4)!==0,Ze=!Re&&(e==="scroll"||e==="scrollend"),Q=Re?V!==null?V+"Capture":null:V;Re=[];for(var U=X,J;U!==null;){var ge=U;if(J=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||J===null||Q===null||(ge=_i(U,Q),ge!=null&&Re.push(cr(U,ge,J))),Ze)break;U=U.return}0<Re.length&&(V=new ee(V,je,null,a,ae),xe.push({event:V,listeners:Re}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",ee&&a!==du&&(je=a.relatedTarget||a.fromElement)&&(Os(je)||je[jl]))break e;(V||ee)&&(je=ae.window===ae?ae:(ee=ae.ownerDocument)?ee.defaultView||ee.parentWindow:window,V?(ee=a.relatedTarget||a.toElement,V=X,ee=ee?Os(ee):null,ee!==null&&(Ze=f(ee),Re=ee.tag,ee!==Ze||Re!==5&&Re!==27&&Re!==6)&&(ee=null)):(V=null,ee=X),V!==ee&&(Re=Vh,ge="onMouseLeave",Q="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(Re=Yh,ge="onPointerLeave",Q="onPointerEnter",U="pointer"),Ze=V==null?je:Ti(V),J=ee==null?je:Ti(ee),je=new Re(ge,U+"leave",V,a,ae),je.target=Ze,je.relatedTarget=J,ge=null,Os(ae)===X&&(Re=new Re(Q,U+"enter",ee,a,ae),Re.target=J,Re.relatedTarget=Ze,ge=Re),Ze=ge,Re=V&&ee?B(V,ee,s2):null,V!==null&&Gx(xe,je,V,Re,!1),ee!==null&&Ze!==null&&Gx(xe,Ze,ee,Re,!0)))}e:{if(V=X?Ti(X):window,ee=V.nodeName&&V.nodeName.toLowerCase(),ee==="select"||ee==="input"&&V.type==="file")var Te=tp;else if(Jh(V))if(np)Te=oS;else{Te=iS;var st=lS}else ee=V.nodeName,!ee||ee.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?X&&uu(X.elementType)&&(Te=tp):Te=rS;if(Te&&(Te=Te(e,X))){ep(xe,Te,a,ae);break e}st&&st(e,V,X)}switch(st=X?Ti(X):window,e){case"focusin":(Jh(st)||st.contentEditable==="true")&&(Rl=st,Nu=X,Ui=null);break;case"focusout":Ui=Nu=Rl=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,up(xe,a,ae);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":up(xe,a,ae)}var Le;if(bu)e:{switch(e){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else Ml?$h(e,a)&&(Fe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Fe="onCompositionStart");Fe&&(Qh&&a.locale!=="ko"&&(Ml||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&Ml&&(Le=Gh()):($a=ae,pu="value"in $a?$a.value:$a.textContent,Ml=!0)),st=tc(X,Fe),0<st.length&&(Fe=new Kh(Fe,e,null,a,ae),xe.push({event:Fe,listeners:st}),Le?Fe.data=Le:(Le=Wh(a),Le!==null&&(Fe.data=Le)))),(Le=eS?tS(e,a):nS(e,a))&&(Fe=tc(X,"onBeforeInput"),0<Fe.length&&(st=new Kh("onBeforeInput","beforeinput",null,a,ae),xe.push({event:st,listeners:Fe}),st.data=Le)),e2(xe,e,X,a,ae)}qx(xe,t)})}function cr(e,t,a){return{instance:e,listener:t,currentTarget:a}}function tc(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=_i(e,a),c!=null&&l.unshift(cr(e,c,u)),c=_i(e,t),c!=null&&l.push(cr(e,c,u))),e.tag===3)return l;e=e.return}return[]}function s2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gx(e,t,a,l,c){for(var u=t._reactName,g=[];a!==null&&a!==l;){var w=a,D=w.alternate,X=w.stateNode;if(w=w.tag,D!==null&&D===l)break;w!==5&&w!==26&&w!==27||X===null||(D=X,c?(X=_i(a,u),X!=null&&g.unshift(cr(a,X,D))):c||(X=_i(a,u),X!=null&&g.push(cr(a,X,D)))),a=a.return}g.length!==0&&e.push({event:t,listeners:g})}var l2=/\r\n?/g,i2=/\u0000|\uFFFD/g;function Ix(e){return(typeof e=="string"?e:""+e).replace(l2,`
|
|
49
|
+
`).replace(i2,"")}function Vx(e,t){return t=Ix(t),Ix(e)===t}function gt(e,t,a,l,c,u){switch(a){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Tl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Tl(e,""+l);else return;break;case"className":Yr(e,"class",l);break;case"tabIndex":Yr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yr(e,a,l);break;case"style":Ph(e,l,u);return;case"data":if(t!=="object"){Yr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Qr(l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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"&&(a==="formAction"?(t!=="input"&>(e,t,"name",c.name,c,null),gt(e,t,"formEncType",c.formEncType,c,null),gt(e,t,"formMethod",c.formMethod,c,null),gt(e,t,"formTarget",c.formTarget,c,null)):(gt(e,t,"encType",c.encType,c,null),gt(e,t,"method",c.method,c,null),gt(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Qr(l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=ia);return;case"onScroll":l!=null&&nt("scroll",e);return;case"onScrollEnd":l!=null&&nt("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==a&&(e.innerHTML=a)}}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}a=Qr(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,l):e.removeAttribute(a);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(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":nt("beforetoggle",e),nt("toggle",e),Kr(e,"popover",l);break;case"xlinkActuate":Ca(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ca(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ca(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ca(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ca(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ca(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Kr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=Nw.get(a)||a,Kr(e,a,l);else return}ct=!0}function cf(e,t,a,l,c,u){switch(a){case"style":Ph(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==a&&(e.innerHTML=a)}}break;case"children":if(typeof l=="string")Tl(e,l);else if(typeof l=="number"||typeof l=="bigint")Tl(e,""+l);else return;break;case"onScroll":l!=null&&nt("scroll",e);return;case"onScrollEnd":l!=null&&nt("scrollend",e);return;case"onClick":l!=null&&(e.onclick=ia);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!_h.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),u=a.slice(2,c?a.length-7:void 0),t=e[gn]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(u,t,c),typeof l=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(u,l,c);break e}ct=!0,a in e?e[a]=l:l===!0?e.setAttribute(a,""):Kr(e,a,l)}return}ct=!0}function tn(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",e),nt("load",e);var l=!1,c=!1,u;for(u in a)if(a.hasOwnProperty(u)){var g=a[u];if(g!=null)switch(u){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:gt(e,t,u,g,a,null)}}c&>(e,t,"srcSet",a.srcSet,a,null),l&>(e,t,"src",a.src,a,null);return;case"input":nt("invalid",e);var w=u=g=c=null,D=null,X=null;for(l in a)if(a.hasOwnProperty(l)){var ae=a[l];if(ae!=null)switch(l){case"name":c=ae;break;case"type":g=ae;break;case"checked":D=ae;break;case"defaultChecked":X=ae;break;case"value":u=ae;break;case"defaultValue":w=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:gt(e,t,l,ae,a,null)}}Oh(e,u,w,D,X,g,c,!1);return;case"select":nt("invalid",e),l=g=u=null;for(c in a)if(a.hasOwnProperty(c)&&(w=a[c],w!=null))switch(c){case"value":u=w;break;case"defaultValue":g=w;break;case"multiple":l=w;default:gt(e,t,c,w,a,null)}t=u,a=g,e.multiple=!!l,t!=null?Al(e,!!l,t,!1):a!=null&&Al(e,!!l,a,!0);return;case"textarea":nt("invalid",e),u=c=l=null;for(g in a)if(a.hasOwnProperty(g)&&(w=a[g],w!=null))switch(g){case"value":l=w;break;case"defaultValue":c=w;break;case"children":u=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:gt(e,t,g,w,a,null)}Uh(e,l,c,u);return;case"option":for(D in a)if(a.hasOwnProperty(D)&&(l=a[D],l!=null))switch(D){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:gt(e,t,D,l,a,null)}return;case"dialog":nt("beforetoggle",e),nt("toggle",e),nt("cancel",e),nt("close",e);break;case"iframe":case"object":nt("load",e);break;case"video":case"audio":for(l=0;l<or.length;l++)nt(or[l],e);break;case"image":nt("error",e),nt("load",e);break;case"details":nt("toggle",e);break;case"embed":case"source":case"link":nt("error",e),nt("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(X in a)if(a.hasOwnProperty(X)&&(l=a[X],l!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:gt(e,t,X,l,a,null)}return;default:if(uu(t)){for(ae in a)a.hasOwnProperty(ae)&&(l=a[ae],l!==void 0&&cf(e,t,ae,l,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null&>(e,t,w,l,a,null))}var r2={};function o2(e,t,a,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,g=null,w=null,D=null,X=null,ae=null;for(ee in a){var xe=a[ee];if(a.hasOwnProperty(ee)&&xe!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":D=xe;default:l.hasOwnProperty(ee)||gt(e,t,ee,null,l,xe)}}for(var V in l){var ee=l[V];if(xe=a[V],l.hasOwnProperty(V)&&(ee!=null||xe!=null))switch(V){case"type":ee!==xe&&(ct=!0),u=ee;break;case"name":ee!==xe&&(ct=!0),c=ee;break;case"checked":ee!==xe&&(ct=!0),X=ee;break;case"defaultChecked":ee!==xe&&(ct=!0),ae=ee;break;case"value":ee!==xe&&(ct=!0),g=ee;break;case"defaultValue":ee!==xe&&(ct=!0),w=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,t));break;default:ee!==xe&>(e,t,V,ee,l,xe)}}ou(e,g,w,D,X,ae,u,c);return;case"select":ee=g=w=V=null;for(u in a)if(D=a[u],a.hasOwnProperty(u)&&D!=null)switch(u){case"value":break;case"multiple":ee=D;default:l.hasOwnProperty(u)||gt(e,t,u,null,l,D)}for(c in l)if(u=l[c],D=a[c],l.hasOwnProperty(c)&&(u!=null||D!=null))switch(c){case"value":u!==D&&(ct=!0),V=u;break;case"defaultValue":u!==D&&(ct=!0),w=u;break;case"multiple":u!==D&&(ct=!0),g=u;default:u!==D&>(e,t,c,u,l,D)}t=w,a=g,l=ee,V!=null?Al(e,!!a,V,!1):!!l!=!!a&&(t!=null?Al(e,!!a,t,!0):Al(e,!!a,a?[]:"",!1));return;case"textarea":ee=V=null;for(w in a)if(c=a[w],a.hasOwnProperty(w)&&c!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:gt(e,t,w,null,l,c)}for(g in l)if(c=l[g],u=a[g],l.hasOwnProperty(g)&&(c!=null||u!=null))switch(g){case"value":c!==u&&(ct=!0),V=c;break;case"defaultValue":c!==u&&(ct=!0),ee=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==u&>(e,t,g,c,l,u)}Bh(e,V,ee);return;case"option":for(var je in a)if(V=a[je],a.hasOwnProperty(je)&&V!=null&&!l.hasOwnProperty(je))switch(je){case"selected":e.selected=!1;break;default:gt(e,t,je,null,l,V)}for(D in l)if(V=l[D],ee=a[D],l.hasOwnProperty(D)&&V!==ee&&(V!=null||ee!=null))switch(D){case"selected":V!==ee&&(ct=!0),e.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:gt(e,t,D,V,l,ee)}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 Re in a)V=a[Re],a.hasOwnProperty(Re)&&V!=null&&!l.hasOwnProperty(Re)&>(e,t,Re,null,l,V);for(X in l)if(V=l[X],ee=a[X],l.hasOwnProperty(X)&&V!==ee&&(V!=null||ee!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:gt(e,t,X,V,l,ee)}return;default:if(uu(t)){for(var Ze in a)V=a[Ze],a.hasOwnProperty(Ze)&&V!==void 0&&!l.hasOwnProperty(Ze)&&cf(e,t,Ze,void 0,l,V);for(ae in l)V=l[ae],ee=a[ae],!l.hasOwnProperty(ae)||V===ee||V===void 0&&ee===void 0||cf(e,t,ae,V,l,ee);return}}for(var Q in a)V=a[Q],a.hasOwnProperty(Q)&&V!=null&&!l.hasOwnProperty(Q)&>(e,t,Q,null,l,V);for(xe in l)V=l[xe],ee=a[xe],!l.hasOwnProperty(xe)||V===ee||V==null&&ee==null||gt(e,t,xe,V,l,ee)}function Kx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var c=a[l],u=c.transferSize,g=c.initiatorType,w=c.duration;if(u&&w&&Kx(g)){for(g=0,w=c.responseEnd,l+=1;l<a.length;l++){var D=a[l],X=D.startTime;if(X>w)break;var ae=D.transferSize,xe=D.initiatorType;ae&&Kx(xe)&&(D=D.responseEnd,g+=ae*(D<w?1:(w-X)/(D-X)))}if(--l,t+=8*(u+g)/(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 uf=null,df=null;function ur(e){return e.nodeType===9?e:e.ownerDocument}function Yx(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 Qx(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 Xx(e,t,a,l){return a=ur(a).createElement(e),a[Zt]=l,a[gn]=t,tn(a,e,t),It(a),a}function ff(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 mf=null;function u2(){var e=window.event;return e&&e.type==="popstate"?e===mf?!1:(mf=e,!0):(mf=null,!1)}var hf=typeof setTimeout=="function"?setTimeout:void 0,d2=typeof clearTimeout=="function"?clearTimeout:void 0,Zx=typeof Promise=="function"?Promise:void 0,$x=typeof requestAnimationFrame=="function"?requestAnimationFrame:hf,f2=typeof queueMicrotask=="function"?queueMicrotask:typeof Zx<"u"?function(e){return Zx.resolve(null).then(e).catch(m2)}:hf;function m2(e){setTimeout(function(){throw e})}function xs(e){return e==="head"}function Wx(e,t){var a=t,l=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(c),fi(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Sf(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Sf(a);for(var u=a.firstChild;u;){var g=u.nextSibling,w=u.nodeName;u[Ai]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=g}}else a==="body"&&Sf(e.ownerDocument.body);a=c}while(a);fi(t)}function Jx(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function ey(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.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="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function ty(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function h2(e,t,a){return a=a.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<=a.innerHeight&&e.left<=a.innerWidth}}function pf(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return h2(t,a,e)}function p2(e){return e.documentElement.clientHeight}function g2(e){this.addEventListener("load",e),this.addEventListener("error",e)}function x2(e,t,a,l,c,u,g,w,D){var X=t.nodeType===9?t:t.ownerDocument;try{var ae=X.startViewTransition({update:function(){var V=X.defaultView,ee=V.navigation&&V.navigation.transition,je=X.fonts.status;l();var Re=[];if(je==="loaded"&&(p2(X),X.fonts.status==="loading"&&Re.push(X.fonts.ready)),je=Re.length,e!==null)for(var Ze=e.suspenseyImages,Q=0,U=0;U<Ze.length;U++){var J=Ze[U];if(!J.complete){var ge=J.getBoundingClientRect();if(0<ge.bottom&&0<ge.right&&ge.top<V.innerHeight&&ge.left<V.innerWidth){if(Q+=Sy(J),Q>sc){Re.length=je;break}J=new Promise(g2.bind(J)),Re.push(J)}}}if(0<Re.length)return V=Promise.race([Promise.all(Re),new Promise(function(Te){return setTimeout(Te,500)})]).then(c,c),(ee?Promise.allSettled([ee.finished,V]):V).then(u,u);if(c(),ee)return ee.finished.then(u,u);u()},types:a});X.__reactViewTransition=ae;var xe=[];return ae.ready.then(function(){for(var V=X.documentElement.getAnimations({subtree:!0}),ee=0;ee<V.length;ee++){var je=V[ee],Re=je.effect,Ze=Re.pseudoElement;if(Ze!=null&&Ze.startsWith("::view-transition")){xe.push(je),je=Re.getKeyframes();for(var Q=Ze=void 0,U=!0,J=0;J<je.length;J++){var ge=je[J],Te=ge.width;if(Ze===void 0)Ze=Te;else if(Ze!==Te){U=!1;break}if(Te=ge.height,Q===void 0)Q=Te;else if(Q!==Te){U=!1;break}delete ge.width,delete ge.height,ge.transform==="none"&&delete ge.transform}U&&Ze!==void 0&&Q!==void 0&&(Re.setKeyframes(je),U=getComputedStyle(Re.target,Re.pseudoElement),U.width!==Ze||U.height!==Q)&&(U=je[0],U.width=Ze,U.height=Q,U=je[je.length-1],U.width=Ze,U.height=Q,Re.setKeyframes(je))}}g()},function(V){X.__reactViewTransition===ae&&(X.__reactViewTransition=null);try{if(typeof V=="object"&&V!==null)switch(V.name){case"InvalidStateError":(V.message==="View transition was skipped because document visibility state is hidden."||V.message==="Skipping view transition because document visibility state has become hidden."||V.message==="Skipping view transition because viewport size changed."||V.message==="Transition was aborted because of invalid state")&&(V=null)}V!==null&&D(V)}finally{l(),c(),g()}}),ae.finished.finally(function(){for(var V=0;V<xe.length;V++)xe[V].cancel();X.__reactViewTransition===ae&&(X.__reactViewTransition=null),w()}),ae}catch{return l(),c(),g(),null}}function al(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}al.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:M({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},al.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),l=[],c=0;c<a.length;c++){var u=a[c].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(a[c])}return l},al.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ny(e){return{name:e,group:new al("group",e),imagePair:new al("image-pair",e),old:new al("old",e),new:new al("new",e)}}function Dn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Dn.prototype.addEventListener=function(e,t,a){var l=null,c=null;if(!(a!=null&&typeof a!="boolean"&&(l=a.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(sy(u,e,t,a)===-1){var g=this,w=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(w=function(D){g.removeEventListener(e,t,a),typeof t=="function"?t.call(this,D):t.handleEvent(D)}),l!==null&&(c=g.removeEventListener.bind(g,e,t,a),l.addEventListener("abort",c,{once:!0}),c=l.removeEventListener.bind(l,"abort",c)),l=ii(a),u.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:w,cleanup:c}),b(this._fragmentFiber.child,!1,y2,e,w,l)}this._eventListeners=u}};function y2(e,t,a,l){return j(e).addEventListener(t,a,l),!1}Dn.prototype.removeEventListener=function(e,t,a){var l=this._eventListeners;if(l!==null&&(t=sy(l,e,t,a),t!==-1)){var c=l[t];a=c.attachedListener;var u=c.cleanup;c=ii(c.optionsOrUseCapture),b(this._fragmentFiber.child,!1,v2,e,a,c),l.splice(t,1),u!==null&&u()}};function v2(e,t,a,l){return j(e).removeEventListener(t,a,l),!1}function ii(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ay(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function sy(e,t,a,l){if(e.length===0)return-1;l=ay(l);for(var c=0;c<e.length;c++){var u=e[c];if(u.type===t&&u.listener===a&&ay(u.optionsOrUseCapture)===l)return c}return-1}Dn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=j(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var c=0;c<a.length;c++){var u=a[c];l.addEventListener(u.type,u.attachedListener,ii(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),a)for(c=0;c<a.length;c++)u=a[c],l.removeEventListener(u.type,u.attachedListener,ii(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Dn.prototype.focus=function(e){b(this._fragmentFiber.child,!0,ly,e,void 0,void 0)};function ly(e,t){return e.tag===6?!1:(e=j(e),D2(e,t))}Dn.prototype.focusLast=function(e){var t=[];b(this._fragmentFiber.child,!0,gf,t,void 0,void 0);for(var a=t.length-1;0<=a&&!ly(t[a],e);a--);};function gf(e,t){return t.push(e),!1}Dn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=j(e),e=ur(e).activeElement,e!==null&&b(this._fragmentFiber.child,!1,b2,e,void 0,void 0))};function b2(e,t){return e.tag===6?!1:(e=j(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Dn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),b(this._fragmentFiber.child,!1,w2,e,void 0,void 0)};function w2(e,t){return e.tag===6||(e=j(e),t.observe(e)),!1}Dn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),b(this._fragmentFiber.child,!1,S2,e,void 0,void 0);for(var a=t=0;a<ta.length;a++){var l=ta[a];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):ta[t++]=l}ta.length=t}};function S2(e,t){return e.tag===6||(e=j(e),t.unobserve(e)),!1}var ta=[],xf=!1;function k2(e,t,a){ta.push({fragmentInstance:e,observer:t,instance:a}),xf||(xf=!0,M2(function(){xf=!1;var l=ta;ta=[];for(var c=0;c<l.length;c++){var u=l[c];u.observer.unobserve(u.instance)}}))}Dn.prototype.getClientRects=function(){var e=[];return b(this._fragmentFiber.child,!1,j2,e,void 0,void 0),e};function j2(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=j(e),t.push.apply(t,e.getClientRects());return!1}Dn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:j(t).getRootNode(e)},Dn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];b(this._fragmentFiber.child,!1,gf,a,void 0,void 0);var l=j(t);if(a.length===0){if(a=l,A(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&&(a=t)}t=this._fragmentFiber;var c=l=a.compareDocumentPosition(e);return a===e?c=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=k(t)[1],a===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=j(a).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(a[0]),c=j(a[a.length-1]);var u=A(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 g=t.compareDocumentPosition(e),w=c.compareDocumentPosition(e),D=g&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=l&&u&&g&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&c===e||D||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!u&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:g,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||N2(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function N2(e,t,a,l,c){var u=Os(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){a=!0;break e}u=u.return}a=!1}return a}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=S(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===a)&&(t=B(a,u,ne),t===null?t=!1:(b(t,!0,F,u,a),u=L,L=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=B(l,u,ne),t===null?t=!1:(b(t,!0,R,u,l),u=L,_=L=null,t=u!==null)),t):!1}function iy(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Dn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];b(this._fragmentFiber.child,!1,gf,t,void 0,void 0);var a=e!==!1;if(t.length===0){var l=k(this._fragmentFiber);if(l=a?l[1]||l[0]||S(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=j(l),iy(e,a);return}if(l=j(l),l.nodeType!==9){if(l.nodeType===11){a="host"in l?l.host:null,a!==null&&a.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=a?t.length-1:0;l!==(a?-1:t.length);){var c=t[l];c.tag===6?(c=j(c),iy(c,a)):j(c).scrollIntoView(e),l+=a?-1:1}};function C2(e,t){return e=j(e),ry(e,t),!1}function ry(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function oy(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l];e.addEventListener(c.type,c.attachedListener,ii(c.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(u){for(var g=0,w=0;w<ta.length;w++){var D=ta[w];(D.fragmentInstance!==t||D.observer!==u||D.instance!==e)&&(ta[g++]=D)}ta.length=g,u.observe(e)}),ry(e,t))}function E2(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l];e.removeEventListener(c.type,c.attachedListener,ii(c.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(u){typeof u.rootMargin=="string"?k2(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function yf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":yf(a),Vr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function A2(e,t,a,l){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ai])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=qn(e.nextSibling),e===null)break}return null}function T2(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=qn(e.nextSibling),e===null))return null;return e}function cy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function vf(e){return e.data==="$?"||e.data==="$~"}function bf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _2(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function qn(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 wf=null;function uy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return qn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function dy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function D2(e,t){function a(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return l}function M2(e){$x(function(){$x(function(t){return e(t)})})}function fy(e,t,a){switch(t=ur(a),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 my(e,t,a){for(var l in a){var c=a[l];a.hasOwnProperty(l)&&c!=null&>(e,t,l,null,r2,c)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ia&&(e.onclick=null),Vr(e)}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vr(e)}var Fn=new Map,hy=new Set;function dr(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 Ha=be.d;be.d={f:R2,r:z2,D:L2,C:O2,L:B2,m:U2,X:P2,S:H2,M:q2};function R2(){var e=Ha.f(),t=Xo();return e||t}function z2(e){var t=Nl(e);t!==null&&t.tag===5&&t.type==="form"?gg(t):Ha.r(e)}var ri=typeof document>"u"?null:document;function py(e,t,a){var l=ri;if(l&&typeof t=="string"&&t){var c=zn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),hy.has(c)||(hy.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),tn(t,"link",e),It(t),l.head.appendChild(t)))}}function L2(e){Ha.D(e),py("dns-prefetch",e,null)}function O2(e,t){Ha.C(e,t),py("preconnect",e,t)}function B2(e,t,a){Ha.L(e,t,a);var l=ri;if(l&&e&&t){var c='link[rel="preload"][as="'+zn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+zn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+zn(a.imageSizes)+'"]')):c+='[href="'+zn(e)+'"]';var u=c;switch(t){case"style":u=oi(e);break;case"script":u=ci(e)}if(!(Fn.has(u)||(e=M({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Fn.set(u,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(fr(u))||t==="script"&&l.querySelector(mr(u))))){var g=l.createElement("link");tn(g,"link",e),t==="style"&&(g[Ir]=!0,g.onload=g.onerror=function(){Ah(g)}),It(g),l.head.appendChild(g)}}}function U2(e,t){Ha.m(e,t);var a=ri;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+zn(l)+'"][href="'+zn(e)+'"]',u=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ci(e)}if(!Fn.has(u)&&(e=M({rel:"modulepreload",href:e},t),Fn.set(u,e),a.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mr(u)))return}l=a.createElement("link"),tn(l,"link",e),It(l),a.head.appendChild(l)}}}function H2(e,t,a){Ha.S(e,t,a);var l=ri;if(l&&e){var c=Cl(l).hoistableStyles,u=oi(e);t=t||"default";var g=c.get(u);if(!g){var w={loading:0,preload:null};if(g=l.querySelector(fr(u)))w.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Fn.get(u))&&kf(e,a);var D=g=l.createElement("link");It(D),tn(D,"link",e),D._p=new Promise(function(X,ae){D.onload=X,D.onerror=ae}),D.addEventListener("load",function(){w.loading|=1}),D.addEventListener("error",function(){w.loading|=2}),w.loading|=4,nc(g,t,l)}g={type:"stylesheet",instance:g,count:1,state:w},c.set(u,g)}}}function P2(e,t){Ha.X(e,t);var a=ri;if(a&&e){var l=Cl(a).hoistableScripts,c=ci(e),u=l.get(c);u||(u=a.querySelector(mr(c)),u||(e=M({src:e,async:!0},t),(t=Fn.get(c))&&jf(e,t),u=a.createElement("script"),It(u),tn(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function q2(e,t){Ha.M(e,t);var a=ri;if(a&&e){var l=Cl(a).hoistableScripts,c=ci(e),u=l.get(c);u||(u=a.querySelector(mr(c)),u||(e=M({src:e,async:!0,type:"module"},t),(t=Fn.get(c))&&jf(e,t),u=a.createElement("script"),It(u),tn(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function gy(e,t,a,l){var c=(c=Ke.current)?dr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=oi(a.href),t=Cl(c).hoistableStyles,l=t.get(a),l||(l={type:"style",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=oi(a.href);var u=Cl(c).hoistableStyles,g=u.get(e);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,g),(u=c.querySelector(fr(e)))?u._p||(g.instance=u,g.state.loading=5):(u=Fn.get(e),u||(u={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Fn.set(e,u)),F2(c,e,u,g.state))),t&&l===null)throw Error(o(528,""));return g}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(a=ci(a),t=Cl(c).hoistableScripts,l=t.get(a),l||(l={type:"script",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function oi(e){return'href="'+zn(e)+'"'}function fr(e){return'link[rel="stylesheet"]['+e+"]"}function xy(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function F2(e,t,a,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ir]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Ir]=!0,t.onload=t.onerror=Ah.bind(null,t),tn(t,"link",a),It(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 ci(e){return'[src="'+zn(e)+'"]'}function mr(e){return"script[async]"+e}function yy(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+zn(a.href)+'"]');if(l)return t.instance=l,It(l),l;var c=M({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),It(l),tn(l,"style",c),nc(l,a.precedence,e),t.instance=l;case"stylesheet":c=oi(a.href);var u=e.querySelector(fr(c));if(u)return t.state.loading|=4,t.instance=u,It(u),u;l=xy(a),(c=Fn.get(c))&&kf(l,c),u=(e.ownerDocument||e).createElement("link"),It(u);var g=u;return g._p=new Promise(function(w,D){g.onload=w,g.onerror=D}),tn(u,"link",l),t.state.loading|=4,nc(u,a.precedence,e),t.instance=u;case"script":return u=ci(a.src),(c=e.querySelector(mr(u)))?(t.instance=c,It(c),c):(l=a,(c=Fn.get(u))&&(l=M({},a),jf(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),It(c),tn(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,nc(l,a.precedence,e));return t.instance}function nc(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,u=c,g=0;g<l.length;g++){var w=l[g];if(w.dataset.precedence===t)u=w;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function kf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ac=null;function vy(e,t,a){if(ac===null){var l=new Map,c=ac=new Map;c.set(a,l)}else c=ac,l=c.get(a),l||(l=new Map,c.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var u=a[c];if(!(u[Ai]||u[Zt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(t)||"";g=e+g;var w=l.get(g);w?w.push(u):l.set(g,[u])}}return l}function Nf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function G2(e,t,a){if(a===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 by(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function wy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Sy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function ky(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Sy(t),e.suspenseyImages.push(t)),e=K2.bind(e),t.decode().then(e,e))}function I2(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=oi(l.href),u=t.querySelector(fr(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,It(u);return}u=t.ownerDocument||t,l=xy(l),(c=Fn.get(c))&&kf(l,c),u=u.createElement("link"),It(u);var g=u;g._p=new Promise(function(w,D){g.onload=w,g.onerror=D}),tn(u,"link",l),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=hr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var sc=0;function V2(e,t){return e.stylesheets&&e.count===0&&ic(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&ic(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&sc===0&&(sc=62500*c2());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ic(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>sc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function jy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ic(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function hr(){this.count--,jy(this)}function K2(){this.imgCount--,jy(this)}var lc=null;function ic(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lc=new Map,t.forEach(Y2,e),lc=null,hr.call(e))}function Y2(e,t){if(!(t.state.loading&4)){var a=lc.get(e);if(a)var l=a.get(null);else{a=new Map,lc.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var g=c[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),l=g)}l&&a.set(null,l)}c=t.instance,g=c.getAttribute("data-precedence"),u=a.get(g)||l,u===l&&a.set(null,c),a.set(g,c),this.count++,l=hr.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 ui={$$typeof:z,Provider:null,Consumer:null,_currentValue:rt,_currentValue2:rt,_threadCount:0};function Q2(e,t,a,l,c,u,g,w,D){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=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.transitionTypes=null,this.incompleteTransitions=new Map}function Ny(e,t,a,l,c,u,g,w,D,X,ae,xe){return e=new Q2(e,t,a,g,D,X,ae,xe,w),t=1,u===!0&&(t|=24),u=xn(3,null,null,t),e.current=u,u.stateNode=e,t=Hu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:a,cache:t},Gu(u),e}function Cy(e){return e?(e=Ol,e):Ol}function Ey(e,t,a,l,c,u){c=Cy(c),l.context===null?l.context=c:l.pendingContext=c,l=ls(t),l.payload={element:a},u=u===void 0?null:u,u!==null&&(l.callback=u),a=is(e,l,t),a!==null&&(wn(a,e,t),Vi(a,e,t))}function Ay(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Cf(e,t){Ay(e,t),(e=e.alternate)&&Ay(e,t)}function Ty(e){if(e.tag===13||e.tag===31){var t=Ps(e,67108864);t!==null&&wn(t,e,67108864),Cf(e,67108864)}}function _y(e){if(e.tag===13||e.tag===31){var t=_n();t=lu(t);var a=Ps(e,t);a!==null&&wn(a,e,t),Cf(e,t)}}var di=!0;function X2(e,t,a,l){var c=ve.T;ve.T=null;var u=be.p;try{be.p=2,Ef(e,t,a,l)}finally{be.p=u,ve.T=c}}function Z2(e,t,a,l){var c=ve.T;ve.T=null;var u=be.p;try{be.p=8,Ef(e,t,a,l)}finally{be.p=u,ve.T=c}}function Ef(e,t,a,l){if(di){var c=Af(l);if(c===null)of(e,t,l,rc,a),My(e,l);else if(W2(c,e,t,a,l))l.stopPropagation();else if(My(e,l),t&4&&-1<$2.indexOf(e)){for(;c!==null;){var u=Nl(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=Xn(u.pendingLanes);if(g!==0){var w=u;for(w.pendingLanes|=2,w.entangledLanes|=2;g;){var D=1<<31-Ce(g);w.entanglements[1]|=D,g&=~D}ga(u),(ut&6)===0&&(Ko=Ht()+500,rr(0))}}break;case 31:case 13:w=Ps(u,2),w!==null&&wn(w,u,2),Xo(),Cf(u,2)}if(u=Af(l),u===null&&of(e,t,l,rc,a),u===c)break;c=u}c!==null&&l.stopPropagation()}else of(e,t,l,null,a)}}function Af(e){return e=fu(e),Tf(e)}var rc=null;function Tf(e){if(rc=null,e=Os(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return rc=e,null}function Dy(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(Qa()){case Ls:return 2;case Xa:return 8;case ja:case Sl:return 32;case Za:return 268435456;default:return 32}default:return 32}}var _f=!1,ys=null,vs=null,bs=null,pr=new Map,gr=new Map,ws=[],$2="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 My(e,t){switch(e){case"focusin":case"focusout":ys=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gr.delete(t.pointerId)}}function xr(e,t,a,l,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:u,targetContainers:[c]},t!==null&&(t=Nl(t),t!==null&&Ty(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function W2(e,t,a,l,c){switch(t){case"focusin":return ys=xr(ys,e,t,a,l,c),!0;case"dragenter":return vs=xr(vs,e,t,a,l,c),!0;case"mouseover":return bs=xr(bs,e,t,a,l,c),!0;case"pointerover":var u=c.pointerId;return pr.set(u,xr(pr.get(u)||null,e,t,a,l,c)),!0;case"gotpointercapture":return u=c.pointerId,gr.set(u,xr(gr.get(u)||null,e,t,a,l,c)),!0}return!1}function Ry(e){var t=Os(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Nh(e.priority,function(){_y(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,Nh(e.priority,function(){_y(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function oc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Af(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);du=l,a.target.dispatchEvent(l),du=null}else return t=Nl(a),t!==null&&Ty(t),e.blockedOn=a,!1;t.shift()}return!0}function zy(e,t,a){oc(e)&&a.delete(t)}function J2(){_f=!1,ys!==null&&oc(ys)&&(ys=null),vs!==null&&oc(vs)&&(vs=null),bs!==null&&oc(bs)&&(bs=null),pr.forEach(zy),gr.forEach(zy)}function cc(e,t){e.blockedOn===t&&(e.blockedOn=null,_f||(_f=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,J2)))}var uc=null;function Ly(e){uc!==e&&(uc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){uc===e&&(uc=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(Tf(l||a)===null)continue;break}var u=Nl(a);u!==null&&(e.splice(t,3),t-=3,ud(u,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function fi(e){function t(D){return cc(D,e)}ys!==null&&cc(ys,e),vs!==null&&cc(vs,e),bs!==null&&cc(bs,e),pr.forEach(t),gr.forEach(t);for(var a=0;a<ws.length;a++){var l=ws[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ws.length&&(a=ws[0],a.blockedOn===null);)Ry(a),a.blockedOn===null&&ws.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var c=a[l],u=a[l+1],g=c[gn]||null;if(typeof u=="function")g||Ly(a);else if(g){var w=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[gn]||null)w=g.formAction;else if(Tf(c)!==null)continue}else w=g.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),Ly(a)}}}function Oy(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(a,20)}function a(){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(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Df(e){this._internalRoot=e}dc.prototype.render=Df.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,l=_n();Ey(a,l,e,t,null,null)},dc.prototype.unmount=Df.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ey(e.current,2,null,e,null,null),Xo(),t[jl]=null}};function dc(e){this._internalRoot=e}dc.prototype.unstable_scheduleHydration=function(e){if(e){var t=jh();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ws.length&&t!==0&&t<ws[a].priority;a++);ws.splice(a,0,e),a===0&&Ry(e)}};var By=i.version;if(By!=="19.3.0")throw Error(o(527,By,"19.3.0"));be.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=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var ek={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ve,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{ze=fc.inject(ek),Pe=fc}catch{}}return vr.createRoot=function(e,t){if(!d(e))throw Error(o(299));var a=!1,l="",c=Cg,u=Eg,g=Ag;return t!=null&&(t.unstable_strictMode===!0&&(a=!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&&(g=t.onRecoverableError)),t=Ny(e,1,!1,null,null,a,l,null,c,u,g,Oy),e[jl]=t.current,rf(e),new Df(t)},vr.hydrateRoot=function(e,t,a){if(!d(e))throw Error(o(299));var l=!1,c="",u=Cg,g=Eg,w=Ag,D=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(D=a.formState)),t=Ny(e,1,!0,t,a??null,l,c,D,u,g,w,Oy),t.context=Cy(null),a=t.current,l=_n(),l=lu(l),c=ls(l),c.callback=null,is(a,c,l),a=l,t.current.lanes=a,Ei(t,a),ga(t),e[jl]=t.current,rf(e),new dc(t)},vr.version="19.3.0",vr}var Qy;function fk(){if(Qy)return zf.exports;Qy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),zf.exports=dk(),zf.exports}var mk=fk();const hk=$m(mk);class Mt 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 Cs(n,i={}){const r=n.startsWith("/dashboard/api")?n:`/dashboard/api${n.startsWith("/")?n:`/${n}`}`,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 Mt(401,"Session expired, redirecting to login...");const f=await d.json().catch(()=>null);if(!d.ok)throw new Mt(d.status,(f==null?void 0:f.error)||(f==null?void 0:f.message)||`HTTP ${d.status}: Request failed`,f);return f}function pk(n){if(!n)return null;const i=/filename\*=UTF-8''([^;]+)/i.exec(n);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}const r=/filename="([^"]*)"/.exec(n);return(r==null?void 0:r[1])||null}async function mc(n,i="GET",r){const o=new AbortController,d=setTimeout(()=>o.abort(),2e4);try{return await Cs(n,{method:i,body:r?JSON.stringify(r):void 0,signal:o.signal})}finally{clearTimeout(d)}}async function Xy(n,i={}){const r=await fetch(`/dashboard/api${n}`,i);if(r.status===401)throw window.location.href="/login",new Mt(401,"Session expired");if(!r.ok){const o=await r.json().catch(()=>null);throw new Mt(r.status,(o==null?void 0:o.error)||"Sticker operation failed",o)}return{blob:await r.blob(),fileName:pk(r.headers.get("Content-Disposition")),animated:r.headers.get("X-Levix-Animated")==="1"}}const $={get:n=>Cs(n,{method:"GET"}),post:(n,i)=>Cs(n,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(n,i)=>Cs(n,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(n,i)=>Cs(n,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:n=>Cs(n,{method:"DELETE"}),getStats:()=>$.get("/stats"),getSession:()=>$.get("/bot/session"),startSession:n=>$.post("/bot/session/start",n),reconnectSession:()=>$.post("/bot/session/reconnect"),stopSession:()=>$.post("/bot/session/stop"),unlinkSession:()=>$.post("/bot/logout"),restartBot:()=>$.post("/bot/restart"),getSettings:()=>$.get("/settings"),updateSetting:(n,i)=>$.patch("/settings",{key:n,value:i}),updatePrefix:n=>$.patch("/settings",{key:"prefix",value:n}),exportSettings:()=>$.get("/settings/export"),importSettings:n=>$.post("/settings/import",n),getCommands:()=>$.get("/commands"),updateCommand:(n,i)=>$.patch(`/commands/${encodeURIComponent(n)}`,i),postMultipart:(n,i,r)=>new Promise((o,d)=>{const f=new FormData;for(const[p,h]of Object.entries(i))h!=null&&h!==""&&f.set(p,h);f.set("file",r);const m=new XMLHttpRequest;m.open("POST",`/dashboard/api${n}`),m.responseType="json",m.onload=()=>{const p=m.response&&typeof m.response=="object"?m.response:null;if(m.status===401){window.location.href="/login",d(new Mt(401,"Session expired"));return}m.status>=200&&m.status<300?o(p):d(new Mt(m.status,(p==null?void 0:p.error)||(p==null?void 0:p.message)||`HTTP ${m.status}: Request failed`,p))},m.onerror=()=>d(new Mt(0,"Network error")),m.send(f)}),getSchedules:()=>$.get("/schedules"),createSchedule:n=>$.post("/schedules",n),deleteSchedule:n=>$.delete(`/schedules/${encodeURIComponent(n)}`),retrySchedule:n=>$.post(`/schedules/${encodeURIComponent(n)}/retry`),getGroups:()=>$.get("/groups"),updateGroup:(n,i)=>$.patch(`/groups/${encodeURIComponent(n)}`,i),previewModeration:n=>$.post("/groups/moderation-preview",n),kickFlagged:(n,i)=>$.post(`/groups/${encodeURIComponent(n)}/flagged/kick`,{user_id:i}),clearFlagged:(n,i)=>$.post(`/groups/${encodeURIComponent(n)}/flagged/clear`,{user_id:i}),dismissFlagged:(n,i)=>$.post(`/groups/${encodeURIComponent(n)}/flagged/dismiss`,{user_id:i}),getPersona:()=>$.get("/ai/persona"),updatePersona:n=>$.put("/ai/persona",{body:n}),getMemoryFiles:()=>$.get("/ai/memory"),getMemoryFile:n=>$.get(`/ai/memory/${encodeURIComponent(n)}`),updateMemoryFile:(n,i)=>$.put(`/ai/memory/${encodeURIComponent(n)}`,{content:i}),deleteMemoryFile:n=>$.delete(`/ai/memory/${encodeURIComponent(n)}`),getAiConversations:()=>$.get("/ai/conversations"),getAiConversation:n=>$.get(`/ai/conversations/${encodeURIComponent(n)}`),getRecipients:()=>$.get("/recipients"),fetchAiModels:n=>$.post("/ai/models",n||{}),changePassword:(n,i)=>$.post("/security/password",{current:n,next:i}),getRecoveryEmail:()=>mc("/recovery-email"),startRecoveryEmail:(n,i,r)=>mc("/recovery-email/start","POST",{email:n,current:i,lang:r}),verifyRecoveryEmail:n=>mc("/recovery-email/verify","POST",{code:n}),deleteRecoveryEmail:()=>mc("/recovery-email","DELETE"),getFeedbackMeta:()=>$.get("/feedback/meta"),getFeedbackDiagnosticsPreview:n=>$.post("/feedback/diagnostics-preview",{client:n}),sendFeedback:n=>$.post("/feedback",n),sendFeedbackMultipart:(n,i,r)=>new Promise((o,d)=>{const f=new FormData;f.set("message",n.message),f.set("topic",n.topic),n.rating&&f.set("rating",String(n.rating)),n.contact&&f.set("contact",n.contact),n.diagnostics&&f.set("diagnostics",JSON.stringify(n.diagnostics)),n.debugLogId&&f.set("debugLogId",n.debugLogId),f.set("file",i,i.name);const m=new XMLHttpRequest;m.open("POST","/dashboard/api/feedback"),m.responseType="json",m.upload.onprogress=p=>{p.lengthComputable&&r&&r(p.loaded/p.total)},m.onload=()=>{const p=m.response&&typeof m.response=="object"?m.response:null;if(m.status===401){window.location.href="/login",d(new Mt(401,"Session expired"));return}m.status>=200&&m.status<300?o(p??{success:!0}):d(new Mt(m.status,(p==null?void 0:p.error)||(p==null?void 0:p.message)||`HTTP ${m.status}: Request failed`,p))},m.onerror=()=>d(new Mt(0,"Network error")),m.send(f)}),getCrashReports:()=>$.get("/crash-reports"),submitCrashReport:n=>$.post("/crash-reports",n),sendCrashReport:(n,i)=>$.post(`/crash-reports/${encodeURIComponent(n)}/send`,{...i?{debugLogId:i}:{}}),deleteCrashReport:n=>$.delete(`/crash-reports/${encodeURIComponent(n)}`),deleteAllCrashReports:()=>$.delete("/crash-reports"),clearLogs:()=>$.delete("/logs"),getLogs:()=>$.get("/logs"),getStickerCapabilities:()=>$.get("/stickers/capabilities"),getStickers:n=>{const i=new URLSearchParams;return n.q&&i.set("q",n.q),n.sort&&i.set("sort",n.sort),n.filter&&i.set("filter",n.filter),n.pack&&i.set("pack",n.pack),n.offset!==void 0&&i.set("offset",n.offset.toString()),n.limit!==void 0&&i.set("limit",n.limit.toString()),$.get(`/stickers?${i.toString()}`)},uploadStickerSource:(n,i)=>{const r={};return i&&(r["X-Filename"]=encodeURIComponent(i)),Cs("/stickers/uploads",{method:"POST",body:n,headers:r})},uploadExistingStickerSource:n=>Cs(`/stickers/${encodeURIComponent(n)}/uploads`,{method:"POST"}),createStickerJob:n=>$.post("/stickers/jobs",n),getStickerJob:n=>$.get(`/stickers/jobs/${encodeURIComponent(n)}`),exportSticker:(n,i)=>Xy(`/stickers/${encodeURIComponent(n)}/export?format=${i}`),exportStickers:(n,i)=>Xy("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:n,format:i})}),updateSticker:(n,i)=>$.patch(`/stickers/${encodeURIComponent(n)}`,i),deleteSticker:(n,i)=>$.delete(`/stickers/${encodeURIComponent(n)}${i?"?confirm=1":""}`),bulkStickers:n=>$.post("/stickers/bulk",n),sendStickers:n=>$.post("/stickers/send",n),getPacks:()=>$.get("/sticker-packs"),createPack:n=>$.post("/sticker-packs",{name:n}),getPack:n=>$.get(`/sticker-packs/${encodeURIComponent(n)}`),updatePack:(n,i)=>$.patch(`/sticker-packs/${encodeURIComponent(n)}`,{name:i}),deletePack:(n,i)=>$.delete(`/sticker-packs/${encodeURIComponent(n)}${i?"?deleteStickers=1":""}`),reorderPack:(n,i)=>$.put(`/sticker-packs/${encodeURIComponent(n)}/order`,{ids:i}),mergePack:(n,i)=>$.post(`/sticker-packs/${encodeURIComponent(n)}/merge`,{intoPackId:i}),listAutoDeleteRules:()=>$.get("/auto-delete/rules"),createAutoDeleteRule:n=>$.post("/auto-delete/rules",n),updateAutoDeleteRule:(n,i)=>$.patch(`/auto-delete/rules/${n}`,i),deleteAutoDeleteRule:n=>$.delete(`/auto-delete/rules/${n}`),resetAutoDeleteRule:n=>$.post(`/auto-delete/rules/${n}/reset`),listAutoDeleteLog:(n={})=>{const i=new URLSearchParams;n.ruleId&&i.set("ruleId",n.ruleId),n.limit!==void 0&&i.set("limit",String(n.limit)),n.offset!==void 0&&i.set("offset",String(n.offset));const r=i.toString();return $.get(`/auto-delete/log${r?`?${r}`:""}`)},clearAutoDeleteLog:n=>$.delete(n?`/auto-delete/log?ruleId=${encodeURIComponent(n)}`:"/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 gk=n=>n==null?void 0:n.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 xk(n,i,r=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:gk(n),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 yk=n=>{let i="",r=!1;for(const o of n){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 vk=n=>{const i=yk(n);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 Dm=(...n)=>n.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 sl={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 Uf(n){return n!=null}function bk(n,i={}){var S,A;const r=i.attributeNames??{},o=k=>r[k]??k,d=n.size??n.width??sl.width,f=n.size??n.height??sl.height,m=((S=n.aliases)==null?void 0:S.filter(k=>typeof k=="string"&&k.trim()!=="").map(k=>`lucide-${k}`))??[],p=[...n.name?[`lucide-${n.name}`]:[],...m],h=((A=i.className)==null?void 0:A.split(" ").filter(Boolean))??[],v=i.includeDefaultClasses===!1?Dm(...h):Dm("lucide",...p,...h),x=i.absoluteStrokeWidth?Number(i.strokeWidth??sl["stroke-width"])*Number(n.size??n.width??sl.width)/Number(i.size??i.width??sl.width):i.strokeWidth??sl["stroke-width"];return["svg",{...Object.entries(sl).reduce((k,[N,j])=>(k[o(N)]=j,k),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&Uf(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&Uf(i.width)&&{[o("width")]:i.width},..."height"in i&&Uf(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:x,...v&&{[o("class")]:v},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},n.node.map(k=>{const[N,j,L]=k,_=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...j}:j;return L?[N,_,L]:[N,_]})]}/**
|
|
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 wk(n,i={}){return bk(n,{...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 Sk=n=>{for(const i in n)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},kk=y.createContext({}),jk=()=>y.useContext(kk),Nk=y.forwardRef(({color:n,size:i,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:m,className:p="",children:h,iconNode:v=[],icon:x={node:v,aliases:[],size:24},...b},S)=>{const{size:A=24,strokeWidth:k=2,absoluteStrokeWidth:N=!1,nonScalingStroke:j=!1,color:L="currentColor",className:_=""}=jk()??{},F=!!h||Sk(b),[R,ne,B=[]]=wk(x,{color:n??L,width:r??i??A,height:o??i??A,strokeWidth:d??k,absoluteStrokeWidth:f??N,nonScalingStroke:m??j,className:Dm(_,p),hasA11yProp:F,attributes:b});return y.createElement(R,{ref:S,...ne},[...B.map(([M,T])=>y.createElement(M,T)),...Array.isArray(h)?h:[h]])});/**
|
|
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 Se(n,i=[],r=[]){const o=typeof n=="string"?xk(n,i,r):n,d=y.forwardRef(({className:f,...m},p)=>y.createElement(Nk,{ref:p,icon:o,className:f,...m}));return o.name&&(d.displayName=vk(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 db={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};db.node;const Ck=Se(db);/**
|
|
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 fb={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};fb.node;const Ek=Se(fb);/**
|
|
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 mb={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"}]]};mb.node;const Ak=Se(mb);/**
|
|
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 hb={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"}]]};hb.node;const Tk=Se(hb);/**
|
|
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 pb={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"}]]};pb.node;const Jm=Se(pb);/**
|
|
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 gb={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"}]]};gb.node;const _k=Se(gb);/**
|
|
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 xb={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"}]]};xb.node;const Mm=Se(xb);/**
|
|
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 yb={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};yb.node;const gi=Se(yb);/**
|
|
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 vb={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};vb.node;const ul=Se(vb);/**
|
|
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 bb={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};bb.node;const Lr=Se(bb);/**
|
|
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 wb={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};wb.node;const Oc=Se(wb);/**
|
|
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 Sb={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};Sb.node;const Dk=Se(Sb);/**
|
|
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 kb={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"]};kb.node;const il=Se(kb);/**
|
|
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 jb={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"]};jb.node;const Es=Se(jb);/**
|
|
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 Nb={name:"circle-play",size:24,node:[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["play-circle"]};Nb.node;const Mk=Se(Nb);/**
|
|
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 Cb={name:"circle-plus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-circle"]};Cb.node;const Rk=Se(Cb);/**
|
|
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 Eb={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};Eb.node;const zk=Se(Eb);/**
|
|
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 Ab={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"]};Ab.node;const Lk=Se(Ab);/**
|
|
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 Tb={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};Tb.node;const _b=Se(Tb);/**
|
|
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 Db={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};Db.node;const Ok=Se(Db);/**
|
|
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 Mb={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"}]]};Mb.node;const Rb=Se(Mb);/**
|
|
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 zb={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"}]]};zb.node;const Bk=Se(zb);/**
|
|
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 Lb={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"}]]};Lb.node;const Vc=Se(Lb);/**
|
|
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 Ob={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"]};Ob.node;const Uk=Se(Ob);/**
|
|
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 Bb={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};Bb.node;const Hk=Se(Bb);/**
|
|
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 Ub={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"}]]};Ub.node;const Pk=Se(Ub);/**
|
|
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 Hb={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"}]]};Hb.node;const Pb=Se(Hb);/**
|
|
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 qb={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"}]]};qb.node;const Si=Se(qb);/**
|
|
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 Fb={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"}]]};Fb.node;const Ur=Se(Fb);/**
|
|
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 Gb={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"]};Gb.node;const qk=Se(Gb);/**
|
|
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 Ib={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"}]]};Ib.node;const Bc=Se(Ib);/**
|
|
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 Vb={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"}]]};Vb.node;const Zy=Se(Vb);/**
|
|
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 Kb={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"}]]};Kb.node;const $y=Se(Kb);/**
|
|
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 Yb={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"}]]};Yb.node;const Fk=Se(Yb);/**
|
|
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 Qb={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};Qb.node;const Gk=Se(Qb);/**
|
|
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 Xb={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"}]]};Xb.node;const Ik=Se(Xb);/**
|
|
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 Zb={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"}]]};Zb.node;const Rm=Se(Zb);/**
|
|
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 $b={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"}]]};$b.node;const Vk=Se($b);/**
|
|
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 Wb={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"}]]};Wb.node;const Kk=Se(Wb);/**
|
|
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 Jb={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"}]]};Jb.node;const e0=Se(Jb);/**
|
|
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 t0={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"}]]};t0.node;const Yk=Se(t0);/**
|
|
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 n0={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};n0.node;const Qk=Se(n0);/**
|
|
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 a0={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};a0.node;const Xk=Se(a0);/**
|
|
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 s0={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"}]]};s0.node;const Zk=Se(s0);/**
|
|
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 l0={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"}]]};l0.node;const $k=Se(l0);/**
|
|
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 i0={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"}]]};i0.node;const kc=Se(i0);/**
|
|
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 r0={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"}]]};r0.node;const jc=Se(r0);/**
|
|
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 o0={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"}]]};o0.node;const c0=Se(o0);/**
|
|
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 u0={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"}]]};u0.node;const Wk=Se(u0);/**
|
|
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 d0={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"}]]};d0.node;const zm=Se(d0);/**
|
|
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 f0={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"}]]};f0.node;const Er=Se(f0);/**
|
|
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 m0={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"]};m0.node;const Jk=Se(m0);/**
|
|
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 h0={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"}]]};h0.node;const p0=Se(h0);/**
|
|
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 g0={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"}]]};g0.node;const ej=Se(g0);/**
|
|
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 x0={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"}]]};x0.node;const tj=Se(x0);/**
|
|
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 y0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};y0.node;const dl=Se(y0);/**
|
|
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 v0={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"}]]};v0.node;const Hf=Se(v0);/**
|
|
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 b0={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"}]]};b0.node;const Or=Se(b0);/**
|
|
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 w0={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"}]]};w0.node;const Ia=Se(w0);/**
|
|
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 S0={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"]};S0.node;const nj=Se(S0);/**
|
|
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 k0={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"}]]};k0.node;const fl=Se(k0);/**
|
|
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 j0={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"}]]};j0.node;const xi=Se(j0);/**
|
|
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 N0={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};N0.node;const eh=Se(N0);/**
|
|
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 C0={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"}]]};C0.node;const yi=Se(C0);/**
|
|
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 E0={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"}]]};E0.node;const aj=Se(E0);/**
|
|
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 A0={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"}]]};A0.node;const Hr=Se(A0);/**
|
|
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 T0={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"}]]};T0.node;const Wy=Se(T0);/**
|
|
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 _0={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"}]]};_0.node;const th=Se(_0);/**
|
|
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 D0={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"]};D0.node;const M0=Se(D0);/**
|
|
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 R0={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"}]]};R0.node;const _r=Se(R0);/**
|
|
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 z0={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"]};z0.node;const L0=Se(z0);/**
|
|
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 O0={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};O0.node;const Lm=Se(O0);/**
|
|
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 B0={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"}]]};B0.node;const Kc=Se(B0);/**
|
|
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 U0={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"}]]};U0.node;const nh=Se(U0);/**
|
|
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 H0={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"}]]};H0.node;const sj=Se(H0);/**
|
|
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 P0={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"}]]};P0.node;const lj=Se(P0);/**
|
|
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 q0={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};q0.node;const ml=Se(q0);/**
|
|
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 F0={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"]};F0.node;const Mn=Se(F0);/**
|
|
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 G0={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"]};G0.node;const hl=Se(G0);/**
|
|
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 I0={name:"type",size:24,node:[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]};I0.node;const ij=Se(I0);/**
|
|
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 V0={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"}]]};V0.node;const rj=Se(V0);/**
|
|
505
|
+
* @license lucide-react v1.46.0 - ISC
|
|
506
|
+
*
|
|
507
|
+
* This source code is licensed under the ISC license.
|
|
508
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
509
|
+
*/const K0={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"}]]};K0.node;const Y0=Se(K0);/**
|
|
510
|
+
* @license lucide-react v1.46.0 - ISC
|
|
511
|
+
*
|
|
512
|
+
* This source code is licensed under the ISC license.
|
|
513
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
+
*/const Q0={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};Q0.node;const oj=Se(Q0);/**
|
|
515
|
+
* @license lucide-react v1.46.0 - ISC
|
|
516
|
+
*
|
|
517
|
+
* This source code is licensed under the ISC license.
|
|
518
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
519
|
+
*/const X0={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"}]]};X0.node;const hc=Se(X0);/**
|
|
520
|
+
* @license lucide-react v1.46.0 - ISC
|
|
521
|
+
*
|
|
522
|
+
* This source code is licensed under the ISC license.
|
|
523
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
524
|
+
*/const Z0={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"}]]};Z0.node;const ol=Se(Z0);/**
|
|
525
|
+
* @license lucide-react v1.46.0 - ISC
|
|
526
|
+
*
|
|
527
|
+
* This source code is licensed under the ISC license.
|
|
528
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
529
|
+
*/const $0={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};$0.node;const cj=Se($0);/**
|
|
530
|
+
* @license lucide-react v1.46.0 - ISC
|
|
531
|
+
*
|
|
532
|
+
* This source code is licensed under the ISC license.
|
|
533
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
534
|
+
*/const W0={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"}]]};W0.node;const uj=Se(W0);/**
|
|
535
|
+
* @license lucide-react v1.46.0 - ISC
|
|
536
|
+
*
|
|
537
|
+
* This source code is licensed under the ISC license.
|
|
538
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
539
|
+
*/const J0={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};J0.node;const e1=Se(J0);/**
|
|
540
|
+
* @license lucide-react v1.46.0 - ISC
|
|
541
|
+
*
|
|
542
|
+
* This source code is licensed under the ISC license.
|
|
543
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
544
|
+
*/const t1={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};t1.node;const Rn=Se(t1),Pf={ar:{unknownContact:"جهة اتصال غير معروفة",showNumber:"إظهار رقم الهاتف",hideNumber:"إخفاء رقم الهاتف",clearLogsConfirm:"مسح السجلات المحفوظة؟",clearLogsBody:"سيتم مسح السجلات المحفوظة للمصدر المحدد. ستستمر الأحداث الجديدة في التسجيل.",logsCleared:"تم مسح السجلات المحفوظة",logsLoadFailed:"تعذر تحميل السجلات. جارٍ إعادة المحاولة…",logsClearFailed:"تعذر مسح السجلات المحفوظة. حاول مرة أخرى.",botAdminHint:"إجراءات الإشراف على واتساب تتطلب أن يكون البوت مشرفًا بالمجموعة. تظل صلاحيات الأوامر سارية.",antiSpam:"مكافحة الإزعاج",autoApprove:"قبول طلبات الانضمام تلقائيًا",blockImages:"حظر الصور",blockVideos:"حظر الفيديو",blockAudio:"حظر الصوت",blockStickers:"حظر الملصقات",groupModeration:"إعدادات الإشراف",linkMode:"سياسة الروابط",linkAll:"حظر جميع الروابط",linkWhitelist:"السماح بالنطاقات المدرجة فقط",linkBlacklist:"حظر النطاقات المدرجة فقط",allowedDomains:"النطاقات، كل نطاق في سطر",spamWindow:"مدة رصد الإزعاج (بالثواني)",spamLimit:"عدد الرسائل قبل الإجراء",spamAction:"إجراء مكافحة الإزعاج",actionWarn:"إنذار العضو",actionKick:"طرد العضو",actionNone:"إبقاء العضو",actionFlag:"إبلاغ المشرفين للمراجعة",actionDelete:"حذف الرسالة فقط",actionDeleteWarn:"حذف وإنذار",actionDeleteKick:"حذف وطرد فورًا",linkAction:"إجراء منع الروابط",mediaAction:"إجراء الوسائط",wordsAction:"إجراء الكلمات الممنوعة",forbiddenWords:"الكلمات الممنوعة",flaggedMembers:"أعضاء بانتظار المراجعة",flaggedEmpty:"لا يوجد أعضاء معلَّمون للمراجعة.",kickFlagged:"طرد",clearWarnings:"مسح الإنذارات",dismissFlag:"إلغاء التعليم",policyPreset:"نمط جاهز",presetRelaxed:"مرن",presetStandard:"قياسي",presetStrict:"صارم",presetCustom:"مخصص",policyMode:"كيف تُحسب الإنذارات",policyModeSimple:"نقطة واحدة لكل مخالفة",policyModeSeverity:"حسب شدة المخالفة",policyFlagAt:"عدد النقاط قبل إبلاغ المشرفين",policyKickAt:"عدد النقاط قبل طرد العضو",policyHitMerge:"إذا خالفت رسالة واحدة عدة قوانين",policyHitMergeMax:"احسب أقوى قانون فقط",policyHitMergeSum:"اجمع النقاط كلها",policyActionDefault:"افتراضي (كالإنذار)",policyLinkLabel:"عندما يرسل أحد رابطًا",policyMediaLabel:"عندما يرسل أحد وسائط",policyForbiddenLabel:"عندما يستخدم أحد الكلمات الممنوعة",policySpamLabel:"عندما يُغرق أحد المجموعة برسائل",policyDecay:"انتهاء الإنذارات",policyDecayOff:"لا تنتهي",policyDecayExpire:"إسقاط الإنذار كاملًا بعد",policyDecayStep:"فقدان نقطة واحدة كل",policyDecayDays:"عدد الأيام",policyMembership:"إذا ترك عضو المجموعة وعاد",policyMembershipKeep:"الاحتفاظ بإنذاراته",policyMembershipClear:"مسح إنذاراته",policyBlockTitle:"أسلوب الإشراف على المخالفات",policyFlagNotify:"إرسال إشعار في المجموعة",policyNotifyGroup:"نعم، إرساله",policyNotifySilent:"بدون إشعار",policyMentionAdmins:"الإشارة إلى المشرفين",policyCooldown:"دقائق الانتظار قبل إرسال الإشعار مرة أخرى",policyCooldownHint:"اجعلها 0 لإرساله في كل مرة.",policyWhileFlagged:"بينما لم يراجعهم المشرفون بعد",policyWhileFlaggedRecord:"متابعة العد",policyWhileFlaggedHold:"إيقاف العد مؤقتًا",policyWhileFlaggedEscalate:"طرده بعد إنذارات أكثر",policyEscalateAfter:"إنذارات إضافية قبل الطرد",policyWeightLink:"نقاط الرابط",policyWeightMedia:"نقاط الوسائط",policyWeightForbidden:"نقاط الكلمات الممنوعة",policyWeightSpam:"نقاط الإزعاج",policyWeightManual:"نقاط إنذار المشرف اليدوي",warningLimit:"الحد الأقصى للإنذارات",warningAction:"عند بلوغ حد الإنذارات",groupRules:"قوانين المجموعة",rulesAndModeration:"القوانين والإشراف",moderationPreview:"معاينة الإشراف المفعّل",moderationPreviewHint:"هذا النص يظهر تحت القوانين وفي رسالة الترحيب.",welcomeMessages:"رسائل الترحيب، كل رسالة في سطر",groupCommands:"أوامر المجموعة وصلاحياتها",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:"إغلاق القائمة",pagination:"التنقل بين الصفحات",previousPage:"الصفحة السابقة",nextPage:"الصفحة التالية",pageOf:"صفحة {page} من {count}",resultCount:"{n} نتيجة",emptyRecords:"لا توجد سجلات بعد",emptyMatches:"لا توجد نتائج مطابقة",loadError:"تعذر تحميل البيانات",clearFilters:"مسح عوامل التصفية",searchGroups:"ابحث باسم المجموعة",searchSchedules:"ابحث في الرسائل والوجهات",sortByMembers:"عدد الأعضاء",mediaCustom:"وسائط مخصصة",mediaWith:"تحتوي وسائط",mediaWithout:"بدون وسائط",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:"الوضع الداكن",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:"تعديل توجيه الشخصية",translateEngine:"محرك الترجمة",translateEngineDesc:"المحرك الافتراضي لأمر !translate. يمكن تغييره في كل استدعاء بـ ai أو google.",translateEngineAi:"الذكاء الاصطناعي (المزود النشط)",translateEngineGoogle:"Google Translate",googleTranslateApiKey:"مفتاح Google Translate API",googleTranslateApiKeyDesc:"اختياري لواجهة Cloud Translation v2. بدون المفتاح يستخدم الأمر نقطة الترجمة العامة.",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:"غير معروف",retry:"إعادة المحاولة",noModelsFound:"لم يتم العثور على نماذج لهذا المزود",noMemoryFiles:"لا توجد ملفات ذاكرة محفوظة",capSupportedDesc:"النموذج يدعم هذه الميزة",capUnsupportedDesc:"النموذج لا يدعم هذه الميزة",capUnknownDesc:"حالة الدعم غير محددة لهذا النموذج",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:"تم تغيير كلمة مرور لوحة التحكم بنجاح!",recoveryEmailTitle:"بريد الاسترداد",recoveryEmailTokenPolicy:"إعادة التحقق من هذا البريد توقف استرداد البريد على أي تثبيت آخر يستخدمه. يلزم التحقق مجدداً بعد 365 يوماً دون طلب استرداد مقبول.",recoveryEmailReverify:"يحتاج البريد المحفوظ إلى التحقق مجدداً. أدخل عنوانك وكلمة مرور اللوحة أدناه. يظل الاسترداد عبر واتساب أو الأمر levix reset-password متاحاً.",recoveryEmailDesc:"إذا نسيت كلمة مرور اللوحة، يرسل Levix كوداً لمرة واحدة إلى هذا العنوان. لا يُعتمد العنوان إلا بعد التحقق.",recoveryEmailLabel:"عنوان البريد",recoveryEmailSendCode:"أرسل الكود",recoveryEmailCode:"كود التحقق",recoveryEmailCodeSent:"أدخل الكود المكوّن من 6 أرقام. يصلح لمدة 10 دقائق.",recoveryEmailVerify:"تحقّق",recoveryEmailCurrent:"العنوان المُحقَّق",recoveryEmailChange:"تغيير",recoveryEmailRemove:"إزالة بريد الاسترداد",recoveryEmailRemoveTitle:"إزالة بريد الاسترداد؟",recoveryEmailRemoveDesc:"لن يستطيع «نسيت كلمة المرور» إرسال كود إلى بريدك بعد ذلك.",recoveryEmailRemoved:"تمت إزالة بريد الاسترداد",recoveryEmailVerified:"تم التحقق من بريد الاسترداد",recoveryEmailStays:"يبقى العنوان الحالي فعالاً إلى أن يتم التحقق من العنوان الجديد.",recoveryEmailPasswordHint:"يستطيع بريد الاسترداد إعادة تعيين كلمة المرور، لذلك يلزم إدخالها لإضافته.",recoveryErrInvalidEmail:"أدخل عنوان بريد صالحاً.",recoveryErrWrongPassword:"كلمة المرور الحالية غير صحيحة.",recoveryErrThrottled:"طلبات كثيرة جداً. حاول مرة أخرى خلال {n} ثانية.",recoveryErrRateLimited:"خدمة البريد مشغولة. حاول مرة أخرى بعد قليل.",recoveryErrUnavailable:"تعذّر الوصول إلى خدمة البريد. تحقق من الاتصال وحاول مرة أخرى.",recoveryErrInvalid:"رفضت خدمة البريد هذا العنوان.",recoveryErrWrongCode:"كود غير صحيح.",recoveryErrAttemptsLeft:"{n} محاولات متبقية.",recoveryErrExpired:"هذا الكود لم يعد صالحاً. أرسل كوداً جديداً.",recoveryErrFailed:"تعذر تحديث بريد الاسترداد. حاول مرة أخرى.",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:"مالك البوت فقط",details:"التفاصيل",hideDetails:"إخفاء التفاصيل",copyCommand:"نسخ الأمر",copyFailed:"تعذّر النسخ",overridden:"معدّل",defaultLabel:"الافتراضي",locked:"مقفل",permissionLockedReason:"ثابتة لأن هذا الأمر ينفّذ إجراءً إدارياً في واتساب",overriddenOnly:"المعدّلة فقط",lockedOnly:"المقفلة فقط",filterScope:"النطاق",filterPermission:"الرتبة",scopeAllChats:"كل المحادثات",scopeGroupsOnly:"المجموعات فقط",scopePrivateOnly:"الخاص فقط",scopeGroupSub:"أوامر المجموعات الفرعية",scopeGeneral:"الأوامر العامة",sortStatus:"الحالة",resultCountOf:"{n} من {total}",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} م.ب",feedbackAttachDiagnostics:"إرفاق بيانات تشخيص الجهاز والبيئة التقنية وسجل التصحيح التقني",feedbackDiagnosticsPreview:"عرض ما سيتم إرساله بالضبط",feedbackDiagnosticsLoading:"جارٍ تحميل معاينة التشخيص...",feedbackDiagnosticsError:"تعذّر تحميل معاينة التشخيص",feedbackDiagnosticsEmpty:"لا توجد بيانات تشخيص متاحة",debugLogSectionLabel:"سجل التصحيح التقني (منقّح)",debugLogHint:"سجل تقني منقّح من آخر 14 يوماً. لا يحتوي كلمات مرور أو مفاتيح أو أرقام هواتف أو محتوى رسائل.",tabDiagnostics:"التشخيص والأعطال",connectionLogLevel:"سجل تشخيص الاتصال",connectionLogLevelDesc:"كمية ما يكتبه Baileys وطبقة الشبكة في Node في سجل التشخيص المنقّح، الذي لا يغادر الجهاز إلا إذا أرفقته بتقرير عطل أو ملاحظات. يُطبَّق عند بدء الجلسة التالية. مستوى Trace يسجل كل إطار ويملأ الحد اليومي 5 ميجابايت بسرعة.",connectionLogOff:"إيقاف",connectionLogError:"الأخطاء",connectionLogWarn:"التحذيرات",connectionLogInfo:"معلومات",connectionLogDebug:"Debug (مفصّل)",connectionLogTrace:"Trace (كل إطار)",diagnosticsTitle:"تقارير الأعطال والتشخيص",diagnosticsDesc:"راجع تقارير الأعطال المحلية قبل إرسالها لمساعدتنا في تحسين النظام وحل المشاكل.",pendingReports:"التقارير المعلقة",sentReports:"التقارير المرسلة",noPendingReports:"لا توجد تقارير أعطال معلقة",noSentReports:"لم يتم إرسال أي تقارير بعد",sendReport:"إرسال",sendingReport:"جارٍ الإرسال...",deleteReport:"حذف التقرير",deleteAllReports:"حذف الكل",confirmDeleteReport:"حذف هذا التقرير؟",confirmDeleteReportDesc:"سيتم حذف تقرير العطل هذا نهائياً من جهازك.",confirmDeleteAllReports:"حذف جميع التقارير؟",confirmDeleteAllDesc:"سيتم حذف جميع تقارير الأعطال المعلقة نهائياً من هذا الجهاز.",reportSentSuccess:"تم إرسال تقرير العطل بنجاح",reportDeleteSuccess:"تم حذف التقرير",allReportsDeleted:"تم حذف جميع التقارير بنجاح",crashReportPreview:"معاينة ما سيتم إرساله (JSON)",reportCategory:"الفئة",reportErrorType:"نوع الخطأ",reportTime:"الوقت",reportId:"المعرّف",reportStatus:"الحالة",reportLastError:"فشل الإرسال الأخير",errorBoundaryTitle:"حدث خطأ غير متوقع",errorBoundaryDesc:"واجهت لوحة التحكم خطأً أثناء العرض. تم تسجيل تفاصيل الخطأ محلياً لمساعدتك في تشخيصه.",errorBoundaryReload:"إعادة التحميل",errorBoundaryGoDiagnostics:"تقارير الأعطال",crashBannerTitle:"توقف ليفيكس بشكل غير متوقع",crashBannerDesc:"تم تسجيل تقرير عطل محلياً. يمكنك مراجعته وإرساله للمساعدة في حل المشكلة.",crashBannerReview:"مراجعة وإرسال",crashBannerNotNow:"ليس الآن",crashBannerDelete:"حذف التقارير",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:"تحديد الملصق",deselectSticker:"إلغاء تحديد الملصق",selectCurrentPage:"تحديد الصفحة الحالية",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:"تعذر تحميل المحادثات.",tourBack:"رجوع",tourNext:"التالي",tourDone:"تم",tourSkip:"تخطي الجولة",tourStepOf:"خطوة {n} من {total}",tourScreenHelp:"دليل هذه الشاشة",tourReplayTitle:"جولة إرشادية",tourReplayDesc:"إعادة عرض شرح اللوحة خطوة بخطوة فوق العناصر الحقيقية.",tourReplayAction:"إعادة العرض",tourSidebarTitle:"هذه غرفة التحكم الخاصة بك",tourSidebarBody:"القائمة الجانبية تفتح كل شاشات البوت: نظرة عامة، الاتصال، الأوامر، الذكاء الاصطناعي، المجموعات والمزيد. اضغط أي عنصر للانتقال إليه.",tourConnectionStartTitle:"ربط واتساب",tourConnectionStartBody:"اضغط هذا الزر لربط حساب واتساب أو استئناف جلستك المحفوظة. البوت يرد من هذا الحساب.",tourConnectionPairingTitle:"خطوات الربط",tourConnectionPairingBody:"اختر ما يناسبك: كود رقمي تدخله في واتساب، أو مسح رمز QR. الطريقتان تؤديان إلى النتيجة نفسها، والربط لا يتجاوز دقيقة.",tourOverviewStatsTitle:"بوتك في نظرة واحدة",tourOverviewStatsBody:"هذه البطاقات تعرض أرقاماً حية: مجموعات واتساب لديك، عدد الأوامر، مدة تشغيل البوت، ورسائله المجدولة.",tourCommandsTitle:"كتالوج الأوامر",tourCommandsBody:"كل أمر يستجيب له البوت. افتح أي صف لتشغيله أو إيقافه، أو تغيير من يمكن استخدامه، أو إدارة اختصاراته. استخدم البحث والتصفية في الأعلى للوصول بسرعة.",tourAiAgentTitle:"تشغيل المساعد الذكي",tourAiAgentBody:"هذا المفتاح يشغّل المساعد الذكي. عندما يعمل، يستطيع الأشخاص سؤاله بأمر !ai داخل محادثاتك.",tourAiProviderTitle:"اختر عقل الذكاء الاصطناعي",tourAiProviderBody:"اختر المزوّد — Google Gemini أو خادم متوافق مع OpenAI أو Anthropic — ثم الصق مفتاح API الخاص به واسم الموديل. مفتاحك يبقى على هذا الجهاز.",tourAiMemoryTitle:"علّمه بطريقتك",tourAiMemoryBody:"اكتب شخصية المساعد في «الشخصية» واحفظ الحقائق التي يجب أن يتذكرها في «الذاكرة» — يقرأ الاثنين عند كل رد.",tourGroupsTitle:"إشراف المجموعات",tourGroupsBody:"كل مجموعة أنت فيها معروضة هنا. افتح أي مجموعة لضبط منع الروابط، ورسالة الترحيب، وقيود الوسائط والقوانين — وتُطبَّق فوراً.",tourStickersTitle:"استوديو الملصقات",tourStickersBody:"أنشئ ملصقات من الصور والفيديوهات، واحفظها هنا، واجمعها في حزم. كل ما يرسله البوت أو ترفعه من اللوحة يذهب إلى مكتبة واحدة مشتركة.",tourSchedulesTitle:"الرسائل المجدولة",tourSchedulesBody:"جدولة رسالة مرة واحدة في وقت محدد، أو تكرارها بشكل دوري. تحفظ القائمة كل الوظائف، وتُوسم الرسائل التي فشل إرسالها للمراجعة.",tourLogsTitle:"السجلات المباشرة",tourLogsBody:"كل ما يفعله البوت يظهر هنا مباشرة، لتتابع الردود وتكتشف الأخطاء فور حدوثها.",tourSettingsTitle:"أول محطة في الإعدادات",tourSettingsBody:"اضبط بادئة الأوامر ولغة الواجهة ولغة البوت والمنطقة الزمنية من هنا. تبويب «عام» يُصدِّر إعداداتك أيضاً لربطها بجهاز آخر.",tourSettingsPasswordTitle:"احمِ لوحة التحكم",tourSettingsPasswordBody:"من هذا التبويب تغيّر كلمة السر التي تفتح اللوحة. كلمة سر طويلة هنا تحمي جلسة واتساب وإعداداتك.",tourSettingsFeedbackTitle:"أخبر المطوّر",tourSettingsFeedbackBody:"اللوحة تعمل على بيانتك فقط. إن أعجبك شيء أو واجهتك مشكلة، استخدم هذا التبويب لإرسال ملاحظة — لا شيء يخرج من جهازك إلا بضغطتك.",tourSettingsDiagnosticsTitle:"تقارير الأعطال",tourSettingsDiagnosticsBody:"إذا تعطّل التطبيق أو اللوحة، يُجمع هنا تقرير مختصّ لا يحمل أي بيانات تعريفية. تعاينه كاملاً وترسله عند تقرر ذلك."},en:{unknownContact:"Unknown contact",showNumber:"Show phone number",hideNumber:"Hide phone number",clearLogsConfirm:"Delete stored logs?",clearLogsBody:"This deletes the stored logs for the selected source. New events will still be recorded.",logsCleared:"Stored logs cleared",logsLoadFailed:"Could not load logs. Retrying…",logsClearFailed:"Could not clear stored logs. Please try again.",botAdminHint:"WhatsApp moderation actions require the bot to be a group admin. Command permissions still apply.",antiSpam:"Anti-spam",autoApprove:"Approve join requests automatically",blockImages:"Block photos",blockVideos:"Block videos",blockAudio:"Block audio",blockStickers:"Block stickers",groupModeration:"Moderation settings",linkMode:"Link policy",linkAll:"Block all links",linkWhitelist:"Allow listed domains only",linkBlacklist:"Block listed domains only",allowedDomains:"Domains, one per line",spamWindow:"Spam window (seconds)",spamLimit:"Messages before action",spamAction:"Spam action",actionWarn:"Warn member",actionKick:"Remove member",actionNone:"Keep member",actionFlag:"Flag for admin review",actionDelete:"Delete the message only",actionDeleteWarn:"Delete and warn",actionDeleteKick:"Delete and remove now",linkAction:"Anti-link action",mediaAction:"Media action",wordsAction:"Forbidden-words action",forbiddenWords:"Forbidden words",flaggedMembers:"Members waiting for review",flaggedEmpty:"No members are flagged for review.",kickFlagged:"Kick",clearWarnings:"Clear warnings",dismissFlag:"Dismiss flag",policyPreset:"Preset",presetRelaxed:"Relaxed",presetStandard:"Standard",presetStrict:"Strict",presetCustom:"Custom",policyMode:"How warnings add up",policyModeSimple:"One point per violation",policyModeSeverity:"By severity",policyFlagAt:"Points before asking admins to review",policyKickAt:"Points before removing the member",policyHitMerge:"If one message breaks several rules",policyHitMergeMax:"Count the strongest rule only",policyHitMergeSum:"Add the points together",policyActionDefault:"Default (same as warn)",policyLinkLabel:"When someone sends a link",policyMediaLabel:"When someone sends media",policyForbiddenLabel:"When someone uses forbidden words",policySpamLabel:"When someone floods the group",policyDecay:"Warnings fade",policyDecayOff:"They don't",policyDecayExpire:"Drop the whole warning after",policyDecayStep:"Lose one point every",policyDecayDays:"Days",policyMembership:"If a member leaves and comes back",policyMembershipKeep:"Keep their warnings",policyMembershipClear:"Clear their warnings",policyBlockTitle:"Enforcement",policyFlagNotify:"Post a notice in the group",policyNotifyGroup:"Yes, post it",policyNotifySilent:"Don't post it",policyMentionAdmins:"Mention the admins",policyCooldown:"Minutes to wait before posting that notice again",policyCooldownHint:"Set 0 to post it every time.",policyWhileFlagged:"While admins have not reviewed them",policyWhileFlaggedRecord:"Keep counting",policyWhileFlaggedHold:"Pause counting",policyWhileFlaggedEscalate:"Remove them after more warnings",policyEscalateAfter:"Extra warnings before removal",policyWeightLink:"Points for a link",policyWeightMedia:"Points for media",policyWeightForbidden:"Points for forbidden words",policyWeightSpam:"Points for spam",policyWeightManual:"Points for a manual warning",warningLimit:"Warning limit",warningAction:"At the warning limit",groupRules:"Group rules",rulesAndModeration:"Rules & moderation",moderationPreview:"Active moderation preview",moderationPreviewHint:"Members see this block under the rules and in the welcome message.",welcomeMessages:"Welcome messages, one per line",groupCommands:"Group commands & permissions",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",pagination:"Pagination",previousPage:"Previous page",nextPage:"Next page",pageOf:"Page {page} of {count}",resultCount:"{n} results",emptyRecords:"No records yet",emptyMatches:"No matching results",loadError:"Could not load data",clearFilters:"Clear filters",searchGroups:"Search by group name",searchSchedules:"Search messages and targets",sortByMembers:"Members",mediaCustom:"Custom media",mediaWith:"With media",mediaWithout:"Without media",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",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",translateEngine:"Translate engine",translateEngineDesc:"Default engine for !translate. Override a call with !translate ai or !translate google.",translateEngineAi:"AI (active provider)",translateEngineGoogle:"Google Translate",googleTranslateApiKey:"Google Translate API key",googleTranslateApiKeyDesc:"Optional Cloud Translation API v2 key. Without it, !translate google uses the public endpoint.",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",retry:"Retry",noModelsFound:"No models found for this provider",noMemoryFiles:"No memory files found",capSupportedDesc:"Supported by this model",capUnsupportedDesc:"Not supported by this model",capUnknownDesc:"Support status unknown for this model",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!",recoveryEmailTitle:"Recovery email",recoveryEmailTokenPolicy:"Verifying this address again disables email recovery on other installations using it. Verification is also required after 365 days without an accepted reset request.",recoveryEmailReverify:"Your saved email needs verification again. Enter your address and panel password below. WhatsApp and levix reset-password remain available.",recoveryEmailDesc:"If you forget the panel password, Levix sends a one-time code to this address. The address is only used after you verify it.",recoveryEmailLabel:"Email address",recoveryEmailSendCode:"Send code",recoveryEmailCode:"Verification code",recoveryEmailCodeSent:"Enter the 6-digit code. It works for 10 minutes.",recoveryEmailVerify:"Verify",recoveryEmailCurrent:"Verified address",recoveryEmailChange:"Change",recoveryEmailRemove:"Remove recovery email",recoveryEmailRemoveTitle:"Remove the recovery email?",recoveryEmailRemoveDesc:"Forgot password will no longer be able to email you a code.",recoveryEmailRemoved:"Recovery email removed",recoveryEmailVerified:"Recovery email verified",recoveryEmailStays:"The current address stays active until the new one is verified.",recoveryEmailPasswordHint:"A recovery email can reset the password, so adding one asks for it.",recoveryErrInvalidEmail:"Enter a valid email address.",recoveryErrWrongPassword:"The current password is wrong.",recoveryErrThrottled:"Too many requests. Try again in {n} seconds.",recoveryErrRateLimited:"The mail service is busy. Try again in a little while.",recoveryErrUnavailable:"Couldn't reach the mail service. Check the connection and try again.",recoveryErrInvalid:"The mail service rejected this address.",recoveryErrWrongCode:"Wrong code.",recoveryErrAttemptsLeft:"{n} attempts left.",recoveryErrExpired:"This code is no longer valid. Send a new one.",recoveryErrFailed:"Couldn't update the recovery email. Try again.",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",details:"Details",hideDetails:"Hide details",copyCommand:"Copy command",copyFailed:"Could not copy",overridden:"Overridden",defaultLabel:"Default",locked:"Locked",permissionLockedReason:"Fixed because this command performs a WhatsApp group-admin action",overriddenOnly:"Overridden only",lockedOnly:"Locked only",filterScope:"Scope",filterPermission:"Permission",scopeAllChats:"All chats",scopeGroupsOnly:"Groups only",scopePrivateOnly:"Private only",scopeGroupSub:"Group sub-commands",scopeGeneral:"General commands",sortStatus:"Status",resultCountOf:"{n} of {total}",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",feedbackAttachDiagnostics:"Attach device & technical diagnostics and the technical debug log",feedbackDiagnosticsPreview:"See exactly what is sent",feedbackDiagnosticsLoading:"Loading diagnostics preview...",feedbackDiagnosticsError:"Could not load diagnostics preview",feedbackDiagnosticsEmpty:"No diagnostics available",debugLogSectionLabel:"Technical debug log (sanitized)",debugLogHint:"Sanitized technical log from the last 14 days. No passwords, keys, phone numbers or message content.",tabDiagnostics:"Diagnostics",connectionLogLevel:"Connection debug logging",connectionLogLevelDesc:"How much Baileys and Node's network layer write to the sanitized debug log, which leaves the device only when you attach it to a crash report or feedback. Applies on the next session start. Trace records every protocol frame and fills the 5 MB daily cap fast.",connectionLogOff:"Off",connectionLogError:"Errors",connectionLogWarn:"Warnings",connectionLogInfo:"Info",connectionLogDebug:"Debug (detailed)",connectionLogTrace:"Trace (every frame)",diagnosticsTitle:"Crash Reports & Diagnostics",diagnosticsDesc:"Review local crash reports before sending them to help diagnose and fix issues.",pendingReports:"Pending reports",sentReports:"Sent reports",noPendingReports:"No pending crash reports",noSentReports:"No sent reports yet",sendReport:"Send",sendingReport:"Sending...",deleteReport:"Delete report",deleteAllReports:"Delete all",confirmDeleteReport:"Delete this report?",confirmDeleteReportDesc:"This crash report will be permanently deleted from this device.",confirmDeleteAllReports:"Delete all crash reports?",confirmDeleteAllDesc:"This will permanently delete all pending crash reports from this device.",reportSentSuccess:"Crash report sent successfully",reportDeleteSuccess:"Report deleted",allReportsDeleted:"All crash reports deleted",crashReportPreview:"Upload preview (JSON)",reportCategory:"Category",reportErrorType:"Error type",reportTime:"Time",reportId:"Report ID",reportStatus:"Status",reportLastError:"Last send failure",errorBoundaryTitle:"Something went wrong",errorBoundaryDesc:"The panel encountered an unexpected error while rendering. A local crash report was captured.",errorBoundaryReload:"Reload",errorBoundaryGoDiagnostics:"Diagnostics",crashBannerTitle:"Levix stopped unexpectedly",crashBannerDesc:"Pending crash reports were saved locally. You can review and send them to help fix the issue.",crashBannerReview:"Review & send",crashBannerNotNow:"Not now",crashBannerDelete:"Delete",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",deselectSticker:"Deselect sticker",selectCurrentPage:"Select current page",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.",tourBack:"Back",tourNext:"Next",tourDone:"Done",tourSkip:"Skip tour",tourStepOf:"Step {n} of {total}",tourScreenHelp:"Guide for this screen",tourReplayTitle:"Guided tour",tourReplayDesc:"Replay a step-by-step walkthrough of the panel, highlighted on the real controls.",tourReplayAction:"Replay guide",tourSidebarTitle:"This is your control room",tourSidebarBody:"The menu on the side opens every screen of your bot: overview, connection, commands, AI, groups and more. Tap any item to jump there.",tourConnectionStartTitle:"Connecting WhatsApp",tourConnectionStartBody:"Tap this button to link a WhatsApp account or to resume your saved session. The bot replies from this account.",tourConnectionPairingTitle:"Pairing steps",tourConnectionPairingBody:"Choose whatever suits you: a numeric code you type into WhatsApp, or scanning a QR code. Both reach the same result, and pairing takes under a minute.",tourOverviewStatsTitle:"Your bot at a glance",tourOverviewStatsBody:"These cards show live numbers: your WhatsApp groups, the number of commands, how long the bot has been running, and its scheduled messages.",tourCommandsTitle:"The command catalog",tourCommandsBody:"Every command the bot answers to. Open a row to turn it on or off, change who may use it, or manage its aliases. Use search and filters above to find a command fast.",tourAiAgentTitle:"Turn the assistant on",tourAiAgentBody:"This switch arms the AI assistant. When it is on, people can ask it questions with the !ai command inside your chats.",tourAiProviderTitle:"Choose the AI brain",tourAiProviderBody:"Pick a provider — Google Gemini, an OpenAI-compatible server or Anthropic — then paste its API key and model name. Your key stays on this device.",tourAiMemoryTitle:"Teach it your way",tourAiMemoryBody:"Write the assistant's personality in the persona, and save facts it should remember in memory — it reads both before every reply.",tourGroupsTitle:"Group moderation",tourGroupsBody:"Every group you are in is listed here. Open a group to set its anti-link, welcome message, media limits and rules — all applied live.",tourStickersTitle:"Sticker Studio",tourStickersBody:"Create stickers from photos and videos, keep them here, and collect them into packs. Everything the bot sends or you upload in the panel lands in one shared library.",tourSchedulesTitle:"Scheduled messages",tourSchedulesBody:"Schedule a message once at a chosen time, or repeat it on a schedule. The list keeps every job, and failed deliveries stay marked for review.",tourLogsTitle:"Live logs",tourLogsBody:"Everything the bot does streams here as it happens, so you can follow replies and spot errors early.",tourSettingsTitle:"First stop in Settings",tourSettingsBody:"Set the command prefix, the interface and bot languages, and the timezone from here. The General tab also exports your settings so another Levix can import them.",tourSettingsPasswordTitle:"Protect your panel",tourSettingsPasswordBody:"This tab is where you change the password that opens this panel. A strong password here protects the WhatsApp session and your settings.",tourSettingsFeedbackTitle:"Tell the developer",tourSettingsFeedbackBody:"The panel works on your device only. If you like something or something breaks, use this tab to send a note — nothing leaves your device unless you tap Send.",tourSettingsDiagnosticsTitle:"Crash reports",tourSettingsDiagnosticsBody:"If the app or the panel crashes, a stripped-down report collects here with no identifying data. You preview it in full and send it only when you decide to."}},ah=y.createContext(null),dj=({children:n})=>{const[i,r]=y.useState(()=>document.documentElement.lang==="ar"?"ar":"en"),[o,d]=y.useState(()=>document.documentElement.getAttribute("data-theme")==="light"?"light":"dark"),f=i==="ar"?"rtl":"ltr";y.useEffect(()=>{const x=b=>{const S=b.detail;((S==null?void 0:S.language)==="ar"||(S==null?void 0:S.language)==="en")&&r(S.language),((S==null?void 0:S.theme)==="light"||(S==null?void 0:S.theme)==="dark")&&d(S.theme)};return window.addEventListener("levix-ui-prefs",x),()=>window.removeEventListener("levix-ui-prefs",x)},[]);const m=(x,b,S)=>{var k;const A=window.LevixHost;(k=A==null?void 0:A.setUiPrefs)==null||k.call(A,x,b,S)},p=x=>{x!==i&&(r(x),document.documentElement.lang=x,document.documentElement.dir=x==="ar"?"rtl":"ltr",localStorage.setItem("levix_lang",x),m(x,o,"language"))},h=x=>{x!==o&&(d(x),document.documentElement.setAttribute("data-theme",x),localStorage.setItem("levix_theme",x),m(i,x,"theme"))},v=y.useMemo(()=>(x,b)=>(Pf[i]||Pf.en)[x]??Pf.en[x]??b??String(x),[i]);return s.jsx(ah.Provider,{value:{language:i,theme:o,direction:f,setLanguage:p,setTheme:h,t:v},children:n})},Ue=()=>{const n=y.useContext(ah);if(!n)throw new Error("useI18n must be used within an I18nProvider");return n};function fj({src:n,name:i}){var d;const[r,o]=y.useState(!1);return s.jsxs("span",{className:"relative inline-flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-brand-blue/10 text-lg font-bold text-brand-cyan",children:[s.jsx("span",{"aria-hidden":!0,children:(d=Array.from(i)[0])==null?void 0:d.toUpperCase()}),!r&&s.jsx("img",{src:n,alt:"",loading:"lazy",onError:()=>o(!0),className:"absolute inset-0 size-full object-cover"})]})}function n1(n){var i,r,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(i=0;i<d;i++)n[i]&&(r=n1(n[i]))&&(o&&(o+=" "),o+=r)}else for(r in n)n[r]&&(o&&(o+=" "),o+=r);return o}function mj(){for(var n,i,r=0,o="",d=arguments.length;r<d;r++)(n=arguments[r])&&(i=n1(n))&&(o&&(o+=" "),o+=i);return o}const hj=(n,i)=>{const r=new Array(n.length+i.length);for(let o=0;o<n.length;o++)r[o]=n[o];for(let o=0;o<i.length;o++)r[n.length+o]=i[o];return r},pj=(n,i)=>({classGroupId:n,validator:i}),a1=(n=new Map,i=null,r)=>({nextPart:n,validators:i,classGroupId:r}),Uc="-",Jy=[],gj="arbitrary..",xj=n=>{const i=vj(n),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return yj(m);const p=m.split(Uc),h=p[0]===""&&p.length>1?1:0;return s1(p,h,i)},getConflictingClassGroupIds:(m,p)=>{if(p){const h=o[m],v=r[m];return h?v?hj(v,h):h:v||Jy}return r[m]||Jy}}},s1=(n,i,r)=>{if(n.length-i===0)return r.classGroupId;const d=n[i],f=r.nextPart.get(d);if(f){const v=s1(n,i+1,f);if(v)return v}const m=r.validators;if(m===null)return;const p=i===0?n.join(Uc):n.slice(i).join(Uc),h=m.length;for(let v=0;v<h;v++){const x=m[v];if(x.validator(p))return x.classGroupId}},yj=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=n.slice(1,-1),r=i.indexOf(":"),o=i.slice(0,r);return o?gj+o:void 0})(),vj=n=>{const{theme:i,classGroups:r}=n;return bj(r,i)},bj=(n,i)=>{const r=a1();for(const o in n){const d=n[o];sh(d,r,o,i)}return r},sh=(n,i,r,o)=>{const d=n.length;for(let f=0;f<d;f++){const m=n[f];wj(m,i,r,o)}},wj=(n,i,r,o)=>{if(typeof n=="string"){Sj(n,i,r);return}if(typeof n=="function"){kj(n,i,r,o);return}jj(n,i,r,o)},Sj=(n,i,r)=>{const o=n===""?i:l1(i,n);o.classGroupId=r},kj=(n,i,r,o)=>{if(Nj(n)){sh(n(o),i,r,o);return}i.validators===null&&(i.validators=[]),i.validators.push(pj(r,n))},jj=(n,i,r,o)=>{const d=Object.entries(n),f=d.length;for(let m=0;m<f;m++){const[p,h]=d[m];sh(h,l1(i,p),r,o)}},l1=(n,i)=>{let r=n;const o=i.split(Uc),d=o.length;for(let f=0;f<d;f++){const m=o[f];let p=r.nextPart.get(m);p||(p=a1(),r.nextPart.set(m,p)),r=p}return r},Nj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Cj=n=>{if(n<1)return{get:()=>{},set:()=>{}};let i=0,r=Object.create(null),o=Object.create(null);const d=(f,m)=>{r[f]=m,i++,i>n&&(i=0,o=r,r=Object.create(null))};return{get(f){let m=r[f];if(m!==void 0)return m;if((m=o[f])!==void 0)return d(f,m),m},set(f,m){f in r?r[f]=m:d(f,m)}}},Om="!",ev=":",Ej=[],tv=(n,i,r,o,d)=>({modifiers:n,hasImportantModifier:i,baseClassName:r,maybePostfixModifierPosition:o,isExternal:d}),Aj=n=>{const{prefix:i,experimentalParseClassName:r}=n;let o=d=>{const f=[];let m=0,p=0,h=0,v;const x=d.length;for(let N=0;N<x;N++){const j=d[N];if(m===0&&p===0){if(j===ev){f.push(d.slice(h,N)),h=N+1;continue}if(j==="/"){v=N;continue}}j==="["?m++:j==="]"?m--:j==="("?p++:j===")"&&p--}const b=f.length===0?d:d.slice(h);let S=b,A=!1;b.endsWith(Om)?(S=b.slice(0,-1),A=!0):b.startsWith(Om)&&(S=b.slice(1),A=!0);const k=v&&v>h?v-h:void 0;return tv(f,A,S,k)};if(i){const d=i+ev,f=o;o=m=>m.startsWith(d)?f(m.slice(d.length)):tv(Ej,!1,m,void 0,!0)}if(r){const d=o;o=f=>r({className:f,parseClassName:d})}return o},Tj=n=>{const i=new Map;return n.orderSensitiveModifiers.forEach((r,o)=>{i.set(r,1e6+o)}),r=>{const o=[];let d=[];for(let f=0;f<r.length;f++){const m=r[f],p=m[0]==="[",h=i.has(m);p||h?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(m)):d.push(m)}return d.length>0&&(d.sort(),o.push(...d)),o}},_j=n=>({cache:Cj(n.cacheSize),parseClassName:Aj(n),sortModifiers:Tj(n),postfixLookupClassGroupIds:Dj(n),...xj(n)}),Dj=n=>{const i=Object.create(null),r=n.postfixLookupClassGroups;if(r)for(let o=0;o<r.length;o++)i[r[o]]=!0;return i},Mj=/\s+/,Rj=(n,i)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:m}=i,p=[],h=n.trim().split(Mj);let v="";for(let x=h.length-1;x>=0;x-=1){const b=h[x],{isExternal:S,modifiers:A,hasImportantModifier:k,baseClassName:N,maybePostfixModifierPosition:j}=r(b);if(S){v=b+(v.length>0?" "+v:v);continue}let L=!!j,_;if(L){const M=N.substring(0,j);_=o(M);const T=_&&m[_]?o(N):void 0;T&&T!==_&&(_=T,L=!1)}else _=o(N);if(!_){if(!L){v=b+(v.length>0?" "+v:v);continue}if(_=o(N),!_){v=b+(v.length>0?" "+v:v);continue}L=!1}const F=A.length===0?"":A.length===1?A[0]:f(A).join(":"),R=k?F+Om:F,ne=R+_;if(p.indexOf(ne)>-1)continue;p.push(ne);const B=d(_,L);for(let M=0;M<B.length;++M){const T=B[M];p.push(R+T)}v=b+(v.length>0?" "+v:v)}return v},zj=(...n)=>{let i=0,r,o,d="";for(;i<n.length;)(r=n[i++])&&(o=i1(r))&&(d&&(d+=" "),d+=o);return d},i1=n=>{if(typeof n=="string")return n;let i,r="";for(let o=0;o<n.length;o++)n[o]&&(i=i1(n[o]))&&(r&&(r+=" "),r+=i);return r},Lj=(n,...i)=>{let r,o,d,f;const m=h=>{const v=i.reduce((x,b)=>b(x),n());return r=_j(v),o=r.cache.get,d=r.cache.set,f=p,p(h)},p=h=>{const v=o(h);if(v)return v;const x=Rj(h,r);return d(h,x),x};return f=m,(...h)=>f(zj(...h))},Oj=[],qt=n=>{const i=r=>r[n]||Oj;return i.isThemeGetter=!0,i.themeKey=n,i},r1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,o1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Uj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hj=/\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$/,Pj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,qj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ks=n=>Bj.test(n),Je=n=>!!n&&!Number.isNaN(Number(n)),xa=n=>!!n&&Number.isInteger(Number(n)),qf=n=>n.endsWith("%")&&Je(n.slice(0,-1)),Pa=n=>Uj.test(n),c1=()=>!0,Gj=n=>Hj.test(n)&&!Pj.test(n),lh=()=>!1,Ij=n=>qj.test(n),Vj=n=>Fj.test(n),Kj=n=>!_e(n)&&!De(n),Yj=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),Qj=n=>Ms(n,f1,lh),_e=n=>r1.test(n),ll=n=>Ms(n,m1,Gj),nv=n=>Ms(n,nN,Je),Xj=n=>Ms(n,p1,c1),Zj=n=>Ms(n,h1,lh),av=n=>Ms(n,u1,lh),$j=n=>Ms(n,d1,Vj),pc=n=>Ms(n,g1,Ij),De=n=>o1.test(n),br=n=>gl(n,m1),Wj=n=>gl(n,h1),sv=n=>gl(n,u1),Jj=n=>gl(n,f1),eN=n=>gl(n,d1),gc=n=>gl(n,g1,!0),tN=n=>gl(n,p1,!0),Ms=(n,i,r)=>{const o=r1.exec(n);return o?o[1]?i(o[1]):r(o[2]):!1},gl=(n,i,r=!1)=>{const o=o1.exec(n);return o?o[1]?i(o[1]):r:!1},u1=n=>n==="position"||n==="percentage",d1=n=>n==="image"||n==="url",f1=n=>n==="length"||n==="size"||n==="bg-size",m1=n=>n==="length",nN=n=>n==="number",h1=n=>n==="family-name",p1=n=>n==="number"||n==="weight",g1=n=>n==="shadow",aN=()=>{const n=qt("color"),i=qt("font"),r=qt("text"),o=qt("font-weight"),d=qt("tracking"),f=qt("leading"),m=qt("breakpoint"),p=qt("container"),h=qt("spacing"),v=qt("radius"),x=qt("shadow"),b=qt("inset-shadow"),S=qt("text-shadow"),A=qt("drop-shadow"),k=qt("blur"),N=qt("perspective"),j=qt("aspect"),L=qt("ease"),_=qt("animate"),F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ne=()=>[...R(),De,_e],B=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],T=()=>[De,_e,h],H=()=>[ks,"full","auto",...T()],O=()=>[xa,"none","subgrid",De,_e],W=()=>["auto",{span:["full",xa,De,_e]},xa,De,_e],Z=()=>[xa,"auto",De,_e],se=()=>["auto","min","max","fr",De,_e],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...T()],le=()=>[ks,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],pe=()=>[p,ks,"screen","full","dvw","lvw","svw","min","max","fit",...T()],fe=()=>[ks,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],G=()=>[n,De,_e],ce=()=>[...R(),sv,av,{position:[De,_e]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",Jj,Qj,{size:[De,_e]}],C=()=>[qf,br,ll],Y=()=>["","none","full",v,De,_e],K=()=>["",Je,br,ll],me=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[Je,qf,sv,av],ye=()=>["","none",k,De,_e],ve=()=>["none",Je,De,_e],be=()=>["none",Je,De,_e],rt=()=>[Je,De,_e],xt=()=>[ks,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pa],breakpoint:[Pa],color:[c1],container:[Pa],"drop-shadow":[Pa],ease:["in","out","in-out"],font:[Kj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pa],shadow:[Pa],spacing:["px",Je],text:[Pa],"text-shadow":[Pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ks,_e,De,j]}],container:["container"],"container-type":[{"@container":["","normal","size",De,_e]}],"container-named":[Yj],columns:[{columns:[Je,"auto",_e,De,p]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:ne()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",De,_e]}],basis:[{basis:[ks,"full","auto",p,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,ks,"auto","initial","none",_e]}],grow:[{grow:["",Je,De,_e]}],shrink:[{shrink:["",Je,De,_e]}],order:[{order:[xa,"first","last","none",De,_e]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...fe()]}],"min-block-size":[{"min-block":["auto",...fe()]}],"max-block-size":[{"max-block":["none",...fe()]}],w:[{w:[p,"screen",...le()]}],"min-w":[{"min-w":[p,"screen","none",...le()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...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,br,ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,tN,Xj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qf,_e]}],"font-family":[{font:[Wj,Zj,i]}],"font-features":[{"font-features":[_e]}],"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,De,_e]}],"line-clamp":[{"line-clamp":[Je,"none",De,nv]}],leading:[{leading:["none",f,...T()]}],"list-image":[{"list-image":["none",De,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",De,ll]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[Je,"auto",De,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"tab-size":[{tab:[xa,De,_e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,_e]}],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",De,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,De,_e],radial:["",De,_e],conic:["",xa,De,_e]},eN,$j]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:C()}],"gradient-via-pos":[{via:C()}],"gradient-to-pos":[{to:C()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-bs":[{"border-bs":G()}],"border-color-be":[{"border-be":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,De,_e]}],"outline-w":[{outline:["",Je,br,ll]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","inner","none",x,gc,pc]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",b,gc,pc]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[Je,ll]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",S,gc,pc]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[Je,De,_e]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[De,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,_e]}],filter:[{filter:["","none",De,_e]}],blur:[{blur:ye()}],brightness:[{brightness:[Je,De,_e]}],contrast:[{contrast:[Je,De,_e]}],"drop-shadow":[{"drop-shadow":["","none",A,gc,pc]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",Je,De,_e]}],"hue-rotate":[{"hue-rotate":[Je,De,_e]}],invert:[{invert:["",Je,De,_e]}],saturate:[{saturate:[Je,De,_e]}],sepia:[{sepia:["",Je,De,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",De,_e]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Je,De,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Je,De,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,De,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,De,_e]}],"backdrop-invert":[{"backdrop-invert":["",Je,De,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Je,De,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Je,De,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,De,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",De,_e]}],ease:[{ease:["linear","initial",L,De,_e]}],delay:[{delay:[Je,De,_e]}],animate:[{animate:["none",_,De,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,De,_e]}],"perspective-origin":[{"perspective-origin":ne()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:rt()}],"skew-x":[{"skew-x":rt()}],"skew-y":[{"skew-y":rt()}],transform:[{transform:[De,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:ne()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xt()}],"translate-x":[{"translate-x":xt()}],"translate-y":[{"translate-y":xt()}],"translate-z":[{"translate-z":xt()}],"translate-none":["translate-none"],zoom:[{zoom:[xa,De,_e]}],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",De,_e]}],"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":G()}],"scrollbar-track-color":[{"scrollbar-track":G()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",De,_e]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[Je,br,ll,nv]}],stroke:[{stroke:["none",...G()]}],"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"]}},sN=Lj(aN);function qe(...n){return sN(mj(n))}const lN={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 et({tone:n="neutral",className:i,children:r,...o}){return s.jsx("span",{className:qe("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-bold",lN[n],i),...o,children:r})}function Nc({dot:n=!1,pulse:i=!1,children:r,...o}){return s.jsxs(et,{...o,children:[n&&s.jsx("span",{className:qe("size-2 shrink-0 rounded-full bg-current",i&&"pulse-dot")}),r]})}function iN({tone:n="neutral",label:i}){return s.jsxs("span",{role:"status",className:qe("inline-flex size-4 items-center justify-center",{ok:"text-ok",warn:"text-warn",danger:"text-danger",info:"text-info",neutral:"text-muted"}[n]),children:[s.jsx("span",{"aria-hidden":!0,className:"size-2.5 rounded-full bg-current"}),s.jsx("span",{className:"sr-only",children:i})]})}const pi={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"}},ue=y.forwardRef(function({variant:i="secondary",size:r="md",loading:o=!1,icon:d,className:f,type:m="button",disabled:p,children:h,...v},x){return s.jsxs("button",{ref:x,type:m,disabled:p||o,"aria-busy":o||void 0,className:qe(pi.base,pi.variant[i],pi.size[r],f),...v,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}),h]})}),Oe=y.forwardRef(function({label:i,icon:r,children:o,variant:d="secondary",size:f="sm",loading:m=!1,pressed:p,className:h,type:v="button",disabled:x,...b},S){const A=r??o;return s.jsx("button",{ref:S,type:v,title:i,"aria-label":i,...p===void 0?{}:{"aria-pressed":p},disabled:x||m,"aria-busy":m||void 0,className:qe(pi.base,pi.variant[d],pi.icon[f],p&&"border-brand-blue/40 bg-brand-blue/15 text-brand-blue",h),...b,children:m?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:A})})}),$e=y.forwardRef(function({className:i,padded:r=!0,...o},d){return s.jsx("div",{ref:d,className:qe("rounded-2xl border border-line bg-panel shadow-sm",r&&"p-4 md:p-5",i),...o})}),x1=$e;function Sn({title:n,description:i,actions:r,icon:o,className:d}){return s.jsxs("div",{className:qe("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:n}),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 xl({className:n,...i}){return s.jsx($e,{className:n,children:s.jsx(Sn,{...i})})}function lv({title:n,description:i,actions:r,children:o,className:d}){return s.jsxs("section",{className:qe("flex flex-col gap-3",d),children:[n&&s.jsx(Sn,{title:n,description:i,actions:r}),o]})}const Yc="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 As({children:n,htmlFor:i}){return s.jsx("label",{htmlFor:i,className:"mb-1 block text-xs font-bold text-text-main",children:n})}function Me({label:n,description:i,error:r,htmlFor:o,children:d,className:f}){return s.jsxs("div",{className:qe("flex flex-col gap-1.5",f),children:[n&&s.jsx(As,{htmlFor:o,children:n}),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=y.forwardRef(function({className:i,technical:r=!1,dir:o,...d},f){return s.jsx("input",{ref:f,dir:o??(r?"ltr":void 0),className:qe(Yc,r&&"text-start",i),...d})}),cl=y.forwardRef(function({className:i,...r},o){return s.jsx("textarea",{ref:o,className:qe(Yc,"h-auto min-h-24 resize-y py-3 leading-relaxed",i),...r})}),dt=y.forwardRef(function({className:i,...r},o){return s.jsx("select",{ref:o,className:qe(Yc,"pe-8",i),...r})}),vi=y.forwardRef(function({label:i,description:r,className:o,id:d,...f},m){const p=y.useId(),h=d??p;return s.jsxs("label",{htmlFor:h,className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{ref:m,id:h,type:"checkbox",className:qe("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 kn({label:n,name:i,value:r,onChange:o,options:d,orientation:f="vertical",className:m}){return s.jsxs("div",{role:"radiogroup","aria-label":n,className:qe("flex gap-1",f==="horizontal"?"flex-row flex-wrap":"flex-col",m),children:[n&&s.jsx("p",{className:"mb-1 w-full text-xs font-bold text-text-main",children:n}),d.map(p=>s.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{type:"radio",name:i,value:p.value,checked:r===p.value,onChange:()=>o(p.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:p.label}),p.description&&s.jsx("span",{className:"block text-xs text-muted",children:p.description})]})]},p.value))]})}const Kn=y.forwardRef(function({checked:i,onChange:r,disabled:o,id:d,label:f,description:m,className:p,...h},v){const x=y.useId(),b=d||x,S=`${b}-label`,A=`${b}-description`,k=!!(f||m);return s.jsxs("div",{className:qe(k?"flex items-center justify-between gap-4":"inline-flex",p),children:[k&&s.jsxs("div",{className:"min-w-0 flex-1",children:[f&&s.jsx("label",{id:S,htmlFor:b,className:"block cursor-pointer text-sm font-semibold text-text-main",children:f}),m&&s.jsx("p",{id:A,className:"mt-0.5 text-xs text-muted",children:m})]}),s.jsx("button",{ref:v,type:"button",...h,role:"switch","aria-checked":i,"aria-labelledby":h["aria-labelledby"]??(f&&!h["aria-label"]?S:void 0),"aria-describedby":[h["aria-describedby"],m?A:void 0].filter(Boolean).join(" ")||void 0,id:b,disabled:o,onClick:()=>r(!i),className:qe("relative inline-flex size-11 shrink-0 items-center rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50","disabled:cursor-not-allowed disabled:opacity-50","before:absolute before:inset-x-0 before:top-[9px] before:h-[26px] before:rounded-full before:border before:transition-colors",i?"before:border-brand-blue before:bg-brand-blue":"before:border-faint/70 before:bg-panel-hover"),children:s.jsx("span",{"aria-hidden":!0,className:qe("pointer-events-none absolute top-3 size-5 rounded-full bg-white shadow transition-[inset-inline-start] duration-200 motion-reduce:transition-none",i?"start-[21px]":"start-[3px]")})})]})});function Qc({children:n,removeLabel:i,onRemove:r,dir:o="auto",className:d,disabled:f}){return s.jsxs("span",{className:qe("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:n}),r&&i&&s.jsx(Oe,{variant:"ghost",label:i,icon:s.jsx(Rn,{size:14}),disabled:f,onMouseDown:m=>m.preventDefault(),onClick:r})]})}function rN(n){return n.split(/[,،\n\r]+/)}const oN=y.forwardRef(function({value:i,onChange:r,max:o,maxLength:d,prepare:f,onReject:m,removeLabel:p,countLabel:h,chipDir:v="auto",className:x,disabled:b,id:S,placeholder:A,"aria-label":k,"aria-invalid":N,"aria-describedby":j,...L},_){const F=y.useId(),R=S??F,[ne,B]=y.useState(""),M=(H,O)=>{const W=H.trim();if(!W)return{next:O,reason:null};let Z=W;if(f){const se=f(W);if("error"in se)return{next:O,reason:se.error};if(Z=se.value,!Z)return{next:O,reason:"empty"}}else if(d!==void 0&&Z.length>d)return{next:O,reason:"long"};return O.includes(Z)?{next:O,reason:"duplicate"}:o!==void 0&&O.length>=o?{next:O,reason:"max"}:{next:[...O,Z],reason:null}},T=H=>{const O=rN(H);let W=i,Z=null,se=!1;for(const E of O){if(!E.trim())continue;se=!0;const z=M(E,W);W=z.next,z.reason&&(Z=z.reason)}!se&&H.trim()&&(Z="empty"),W!==i&&r(W),m==null||m(Z),B("")};return s.jsxs("div",{className:qe("flex flex-col gap-1.5",x),children:[s.jsxs("div",{className:qe(Yc,"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(H=>s.jsx(Qc,{dir:v,disabled:b,removeLabel:p(H),onRemove:b?void 0:()=>{r(i.filter(O=>O!==H)),m==null||m(null)},children:H},H)),s.jsx(Be,{...L,ref:_,id:R,value:ne,disabled:b,placeholder:i.length===0?A:void 0,"aria-label":k,"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:H=>{const O=H.target.value;if(/[,،\n\r]/.test(O)){T(O);return}B(O)},onKeyDown:H=>{if(!H.nativeEvent.isComposing){if(H.key==="Enter"||H.key===","||H.key==="،"){H.preventDefault(),T(ne);return}H.key==="Backspace"&&ne.length===0&&i.length>0&&(H.preventDefault(),r(i.slice(0,-1)),m==null||m(null))}},onPaste:H=>{const O=H.clipboardData.getData("text");/[,،\n\r]/.test(O)&&(H.preventDefault(),T(`${ne}${O}`))},onBlur:()=>{ne.trim()&&T(ne)}})]}),h&&s.jsx("p",{className:"text-xs text-muted tabular-nums",children:h})]})});var Xc=ub();const cN='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function uN(n){return[...n.querySelectorAll(cN)].filter(i=>!(i.tabIndex<0||i.closest("[aria-hidden='true']")))}function ih(n,i,r){const o=y.useRef(r);o.current=r,y.useLayoutEffect(()=>{if(!i)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,f=n.current;f&&(!(document.activeElement instanceof Node)||!f.contains(document.activeElement))&&f.focus();const m=h=>{var k;if(h.key==="Escape"){if(h.defaultPrevented)return;const N=n.current;if(N){const j=document.querySelectorAll("[data-overlay]"),L=j.item(j.length-1);if(L&&L!==N)return}h.preventDefault(),h.stopImmediatePropagation(),(k=o.current)==null||k.call(o);return}if(h.key!=="Tab"||!n.current)return;const v=document.activeElement;if(v instanceof Element&&v.closest("[data-overlay='popover']"))return;if(n.current.dataset.overlay==="dialog"&&v instanceof Element){const N=v.closest("[data-overlay]");if(N&&N!==n.current)return}const x=uN(n.current);if(x.length===0){h.preventDefault(),n.current.focus();return}const b=x[0],S=x[x.length-1],A=v instanceof Node&&n.current.contains(v);h.shiftKey&&(!A||v===b)?(h.preventDefault(),S==null||S.focus()):!h.shiftKey&&(!A||v===S)&&(h.preventDefault(),b==null||b.focus())};document.addEventListener("keydown",m);const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var h;document.removeEventListener("keydown",m),document.body.style.overflow=p,(h=d==null?void 0:d.focus)==null||h.call(d)}},[i,n])}function an({isOpen:n,onClose:i,title:r,children:o,footer:d,maxWidth:f,description:m,className:p}){const{t:h}=Ue(),v=y.useRef(null),x=y.useId(),b=y.useId();if(ih(v,n,i),!n)return null;const S={paddingBottom:"max(1rem, env(safe-area-inset-bottom))"};return Xc.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",style:S,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":h("close")}),s.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-labelledby":x,"aria-describedby":m?b:void 0,tabIndex:-1,"data-overlay":"dialog",className:qe("relative z-10 my-auto flex w-full flex-col overflow-hidden rounded-2xl border border-line bg-panel shadow-2xl outline-none",p),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:x,className:"min-w-0 text-base font-bold text-text-main md:text-lg",children:r}),s.jsx(Oe,{label:h("close"),icon:s.jsx(Rn,{size:18}),onClick:i})]}),s.jsxs("div",{className:qe("min-h-0 overflow-y-auto p-4 md:p-5",!d&&"pb-[max(1rem,env(safe-area-inset-bottom))]"),style:d?void 0:S,children:[m&&s.jsx("p",{id:b,className:"mb-3 text-sm text-muted",children:m}),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:S,children:d})]})]}),document.body)}function pl({isOpen:n,onClose:i,onConfirm:r,title:o,description:d,confirmLabel:f,cancelLabel:m,variant:p="danger",loading:h=!1,children:v,maxWidth:x}){return s.jsx(an,{isOpen:n,onClose:i,title:o,description:d,maxWidth:x,footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:i,disabled:h,children:m}),s.jsx(ue,{variant:p==="danger"?"danger":"primary",onClick:r,loading:h,children:f})]}),children:v})}function rh({summary:n,children:i}){const[r,o]=y.useState(!1),d=y.useId();return s.jsxs($e,{padded:!1,className:"min-w-0 self-start overflow-hidden",children:[s.jsxs(ue,{variant:"ghost",className:"h-auto w-full justify-between gap-3 p-4 text-start","aria-expanded":r,"aria-controls":d,id:`${d}-trigger`,onClick:()=>o(f=>!f),children:[s.jsx("span",{className:"min-w-0 flex-1",children:n}),s.jsx(ul,{size:18,"aria-hidden":!0,className:`shrink-0 transition-transform motion-reduce:transition-none ${r?"rotate-180":""}`})]}),s.jsx("section",{id:d,"aria-labelledby":`${d}-trigger`,"aria-hidden":!r,inert:!r,className:`grid transition-[grid-template-rows] duration-200 motion-reduce:transition-none ${r?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:s.jsx("div",{className:"min-h-0 overflow-hidden",children:s.jsx("div",{className:"border-t border-line p-4",children:i})})})]})}function ba({className:n,label:i}){return s.jsxs("span",{role:i?"status":void 0,className:qe("inline-flex items-center gap-2",i&&"text-muted"),children:[s.jsx("span",{"aria-hidden":!0,className:qe("size-4 shrink-0 rounded-full border-2 border-brand-blue border-t-transparent animate-spin",n)}),i&&s.jsx("span",{className:"text-xs",children:i})]})}function _s({text:n}){return s.jsx("div",{className:"flex flex-col items-center justify-center gap-2 py-16",children:s.jsx(ba,{className:"size-6",label:n})})}function Gt({className:n}){return s.jsx("div",{"aria-hidden":!0,className:qe("animate-pulse rounded-lg bg-panel-hover",n)})}function mt({kind:n,icon:i,title:r,text:o,description:d,action:f,className:m}){const{t:p}=Ue(),h=n==="empty"?p("emptyRecords"):n==="no-results"?p("emptyMatches"):n==="error"?p("loadError"):null;return s.jsxs("div",{role:n==="error"?"alert":void 0,className:qe("flex flex-col items-center justify-center gap-2 px-4 py-12 text-center sm:py-16",m),children:[i&&s.jsx("div",{className:"text-muted",children:i}),(r||h)&&s.jsx("p",{className:"text-base font-bold text-text-main",children:r??h}),(o||d)&&s.jsx("p",{className:"max-w-md text-sm text-muted",children:d??o}),f]})}const iv="(max-width: 639px)";function dN(){const[n,i]=y.useState(()=>typeof window<"u"?window.matchMedia(iv).matches:!1);return y.useEffect(()=>{const r=window.matchMedia(iv),o=()=>i(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),n}function fN(n,i,r,o){const m=window.innerWidth,p=window.innerHeight;let h=n.bottom+6;h+i.height>p-8&&n.top-i.height-6>=8&&(h=n.top-i.height-6),h=Math.max(8,Math.min(h,p-8-i.height));const v=r==="center"?n.left+n.width/2-i.width/2:r==="start"?o==="rtl"?n.right-i.width:n.left:o==="rtl"?n.left:n.right-i.width,x=Math.max(8,Math.min(v,m-8-i.width));return{top:h,left:x}}function y1({open:n,defaultOpen:i=!1,onOpenChange:r,trigger:o,children:d,align:f="end",label:m,haspopup:p="dialog",className:h,badge:v}){const{t:x}=Ue(),[b,S]=y.useState(i),A=n??b,k=y.useCallback(O=>{n===void 0&&S(O),r==null||r(O)},[r,n]),N=dN(),j=y.useRef(null),L=y.useRef(null),_=y.useId(),[F,R]=y.useState(null),ne=y.useRef(k);ne.current=k;const B=y.useCallback(()=>{const O=j.current,W=L.current;if(!O||!W)return;const Z=document.documentElement.dir==="rtl"?"rtl":"ltr";R(fN(O.getBoundingClientRect(),W.getBoundingClientRect(),f,Z))},[f]);y.useLayoutEffect(()=>{if(!A||N)return;B();const O=L.current,W=O?new ResizeObserver(()=>B()):null;return O&&W&&W.observe(O),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{W==null||W.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[A,N,B]),y.useEffect(()=>{if(!A)return;const O=Z=>{var E,z;const se=Z.target;se instanceof Node&&((E=j.current)!=null&&E.contains(se)||(z=L.current)!=null&&z.contains(se)||ne.current(!1))},W=Z=>{Z.key==="Escape"&&(Z.preventDefault(),Z.stopPropagation(),ne.current(!1))};return document.addEventListener("pointerdown",O,!0),document.addEventListener("keydown",W,!0),()=>{document.removeEventListener("pointerdown",O,!0),document.removeEventListener("keydown",W,!0)}},[A]),ih(L,A&&N,()=>k(!1));const M=y.isValidElement(o)?o.props:{},T=y.isValidElement(o)?y.cloneElement(o,{onClick:O=>{var W;(W=M.onClick)==null||W.call(M,O),O.defaultPrevented||k(!A)},"aria-expanded":A,"aria-haspopup":p,"aria-controls":_}):o,H=s.jsxs("div",{ref:L,id:_,role:p==="menu"?"presentation":"dialog",...p==="menu"||!m?{}:{"aria-label":m},tabIndex:-1,"data-overlay":"popover",className:qe("z-[70] border border-line bg-panel-solid text-text-main shadow-2xl outline-none",h,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:(F==null?void 0:F.top)??0,left:(F==null?void 0:F.left)??0,visibility:F?"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(Oe,{label:x("close"),icon:s.jsx(Rn,{size:16}),variant:"ghost",className:"absolute end-0",onClick:()=>k(!1)})]}),d]});return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:j,className:"relative inline-flex",children:[T,v]}),A&&Xc.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":x("close"),onClick:()=>k(!1)}),H]}):H,document.body)]})}function yl({label:n,resetLabel:i,activeCount:r=0,onReset:o,children:d}){const[f,m]=y.useState(!1),p=r>0?`${n} (${r})`:n;return s.jsxs(y1,{open:f,onOpenChange:m,align:"end",label:n,haspopup:"dialog",className:"w-[min(20rem,calc(100vw-1rem))] p-3",badge:r>0?s.jsx(et,{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(Oe,{label:p,icon:s.jsx(qk,{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:n}),o&&s.jsx(ue,{variant:"ghost",size:"sm",onClick:o,disabled:r===0,children:i})]}),s.jsx("div",{className:"flex flex-col gap-3",children:d})]})}function mN({label:n,content:i,children:r,className:o}){const[d,f]=y.useState(!1),[m,p]=y.useState(null),h=y.useRef(null),v=y.useRef(null),x=y.useRef(!1),b=y.useId();return y.useLayoutEffect(()=>{if(!d)return;const S=()=>{var F,R;const A=(F=h.current)==null?void 0:F.getBoundingClientRect(),k=(R=v.current)==null?void 0:R.getBoundingClientRect();if(!A||!k)return;const N=8,j=Math.max(N,Math.min(A.left+A.width/2-k.width/2,window.innerWidth-N-k.width)),L=A.top>=k.height+N+6?A.top-k.height-6:A.bottom+6,_=Math.max(N,Math.min(L,window.innerHeight-N-k.height));p({top:_,left:j})};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}},[d]),y.useEffect(()=>{if(!d)return;const S=k=>{var N,j;k.target instanceof Node&&!((N=h.current)!=null&&N.contains(k.target))&&!((j=v.current)!=null&&j.contains(k.target))&&f(!1)},A=k=>{k.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",S),document.addEventListener("keydown",A),()=>{document.removeEventListener("pointerdown",S),document.removeEventListener("keydown",A)}},[d]),s.jsxs(s.Fragment,{children:[s.jsx(Oe,{ref:h,label:n,title:"",icon:r,variant:"ghost",className:o,"aria-describedby":d?b:void 0,onPointerDown:S=>{x.current=S.pointerType==="touch"},onPointerEnter:S=>{S.pointerType==="mouse"&&f(!0)},onPointerLeave:S=>{S.pointerType==="mouse"&&document.activeElement!==h.current&&f(!1)},onFocus:()=>{x.current||f(!0)},onBlur:()=>{x.current=!1,f(!1)},onClick:()=>{x.current&&f(S=>!S)}}),d&&Xc.createPortal(s.jsx("div",{ref:v,id:b,role:"tooltip",className:"fixed z-[80] max-h-[calc(100dvh-1rem)] w-max max-w-[calc(100vw-1rem)] overflow-y-auto rounded-lg border border-line bg-panel-solid px-3 py-2 text-xs leading-relaxed text-text-main shadow-lg",style:{top:(m==null?void 0:m.top)??0,left:(m==null?void 0:m.left)??0,visibility:m?"visible":"hidden"},children:i}),document.body)]})}const oh=y.createContext(()=>{});function ch({trigger:n,label:i,align:r="end",children:o}){const[d,f]=y.useState(!1);return s.jsx(oh.Provider,{value:()=>f(!1),children:s.jsx(y1,{open:d,onOpenChange:f,trigger:n,label:i,align:r,haspopup:"menu",className:"min-w-52 p-1",children:s.jsx(hN,{label:i,children:o})})})}function hN({label:n,children:i}){const r=y.useRef(null),o=y.useContext(oh);y.useEffect(()=>{var f,m;(m=(f=r.current)==null?void 0:f.querySelector("[role='menuitem']:not([disabled])"))==null||m.focus()},[]);const d=f=>{var v,x,b;const m=[...((v=r.current)==null?void 0:v.querySelectorAll("[role='menuitem']:not([disabled])"))??[]];if(m.length===0)return;const p=m.indexOf(document.activeElement),h=S=>{var A;f.preventDefault(),(A=m[(S+m.length)%m.length])==null||A.focus()};f.key==="ArrowDown"?h(p+1):f.key==="ArrowUp"?h(p<=0?m.length-1:p-1):f.key==="Home"?(f.preventDefault(),(x=m[0])==null||x.focus()):f.key==="End"?(f.preventDefault(),(b=m[m.length-1])==null||b.focus()):f.key==="Escape"&&(f.preventDefault(),o())};return s.jsx("div",{ref:r,role:"menu","aria-label":n,"aria-orientation":"vertical",onKeyDown:d,className:"flex flex-col gap-0.5",children:i})}function it({icon:n,danger:i=!1,checked:r=!1,onSelect:o,className:d,type:f="button",children:m,onClick:p,...h}){const v=y.useContext(oh);return s.jsxs("button",{type:f,role:"menuitem",className:qe("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:x=>{p==null||p(x),!x.defaultPrevented&&(o==null||o(),f!=="submit"&&v())},...h,children:[n&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:n}),s.jsx("span",{className:"min-w-0 flex-1",children:m}),r&&s.jsx(gi,{size:16,className:"shrink-0 text-brand-cyan"})]})}function Dr(){return s.jsx("hr",{className:"my-1 border-0 border-t border-line"})}function pN({children:n}){return s.jsx("div",{className:"px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-faint",children:n})}function Yn({label:n,align:i="end",id:r,children:o}){return s.jsx(ch,{label:n,align:i,trigger:s.jsx(Oe,{id:r,label:n,icon:s.jsx(Uk,{size:18})}),children:o})}function ki({page:n,pageCount:i,total:r,onPageChange:o,label:d,className:f}){const{t:m,direction:p}=Ue(),h=Math.max(1,i),v=Math.min(Math.max(1,n),h),x=p==="rtl"?s.jsx(Oc,{size:18}):s.jsx(Lr,{size:18}),b=p==="rtl"?s.jsx(Lr,{size:18}):s.jsx(Oc,{size:18});return s.jsxs("nav",{"aria-label":d??m("pagination"),className:qe("flex min-w-0 flex-wrap items-center justify-between gap-2 text-sm",f),children:[s.jsx("span",{className:"text-muted tabular-nums",children:m("resultCount").replace("{n}",String(r))}),i>1&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Oe,{label:m("previousPage"),icon:x,disabled:v<=1,onClick:()=>o(v-1)}),s.jsx("span",{className:"min-w-0 px-1 text-center text-xs font-medium text-text-main tabular-nums sm:text-sm",children:m("pageOf").replace("{page}",String(v)).replace("{count}",String(h))}),s.jsx(Oe,{label:m("nextPage"),icon:b,disabled:v>=h,onClick:()=>o(v+1)})]})]})}function Zc(n,i=20,r){const o=Math.max(1,Math.floor(i)||20),d=n.length,f=Math.max(1,Math.ceil(d/o)),[m,p]=y.useState({page:1,resetKey:r}),h=Object.is(m.resetKey,r)?Math.min(m.page,f):1;y.useEffect(()=>{(!Object.is(m.resetKey,r)||m.page!==h)&&p({page:h,resetKey:r})},[h,r,m]);const v=x=>{p({page:Math.min(Math.max(1,Math.floor(x)||1),f),resetKey:r})};return{page:h,pageCount:f,pageItems:n.slice((h-1)*o,h*o),setPage:v,total:d}}const Fa=y.forwardRef(function({className:i,dir:r="ltr",spellCheck:o=!1,autoCapitalize:d="off",autoCorrect:f="off",disabled:m,...p},h){const{t:v}=Ue(),[x,b]=y.useState(!1),S=y.useRef(null),A=y.useRef(null);return y.useLayoutEffect(()=>{const k=A.current,N=S.current;!k||!N||(N.focus({preventScroll:!0}),N.setSelectionRange(k.start,k.end),A.current=null)}),s.jsxs("span",{dir:r,className:"grid w-full min-w-0 items-center",children:[s.jsx(Be,{...p,ref:k=>{S.current=k,typeof h=="function"?h(k):h&&(h.current=k)},type:x?"text":"password",dir:r,spellCheck:o,autoCapitalize:d,autoCorrect:f,disabled:m,className:qe("col-start-1 row-start-1 pe-12 text-start",i)}),s.jsx(Oe,{label:v(x?"hideSecret":"showSecret"),icon:x?s.jsx(Pb,{size:18}):s.jsx(Si,{size:18}),pressed:x,variant:"ghost",disabled:m,className:"col-start-1 row-start-1 me-0.5 justify-self-end",onMouseDown:k=>k.preventDefault(),onClick:()=>{const k=S.current;k&&(A.current={start:k.selectionStart??k.value.length,end:k.selectionEnd??k.value.length}),b(N=>!N)}})]})}),xc=new Set;let wr=null;function gN(n){return xc.add(n),wr===null&&(wr=window.setInterval(()=>{for(const i of xc)i()},3e4)),()=>{xc.delete(n),xc.size===0&&wr!==null&&(window.clearInterval(wr),wr=null)}}function v1(n){return n==="ar"?"ar":"en"}function xN(n){const i=n instanceof Date?n.getTime():typeof n=="number"?n:Date.parse(n);return Number.isFinite(i)?i:null}const Ff=[{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 yN(n,i,r){const o=n-i,d=Math.abs(o),f=new Intl.RelativeTimeFormat(v1(r),{numeric:"auto"}),m=Ff.find(h=>d>=h.ms)??Ff[Ff.length-1],p=Math.round(o/m.ms);return f.format(p,m.unit)}function Br({value:n,className:i}){const{language:r}=Ue(),[o,d]=y.useState(()=>Date.now());y.useEffect(()=>gN(()=>d(Date.now())),[]);const f=xN(n);if(f===null)return null;const m=v1(r),p=new Intl.DateTimeFormat(m,{dateStyle:"medium",timeStyle:"short"}).format(f);return s.jsx("time",{dateTime:new Date(f).toISOString(),title:p,className:qe("whitespace-nowrap",i),children:yN(f,o,r)})}const vN=1500;function b1(n){return n instanceof Error&&n.message?n.message:typeof n=="string"&&n?n:""}function Hc(n,i){if(Object.is(n,i))return!0;if(typeof n!="object"||typeof i!="object"||n===null||i===null)return!1;const r=n,o=i,d=Object.keys(r);return d.length!==Object.keys(o).length?!1:d.every(f=>Object.is(r[f],o[f]))}function w1(n,i){y.useEffect(()=>{if(n!=="saved")return;const r=window.setTimeout(()=>{i(o=>o==="saved"?"idle":o)},vN);return()=>window.clearTimeout(r)},[n,i])}function fn(n){const[i,r]=y.useState(n),[o,d]=y.useState("idle"),[f,m]=y.useState(null),p=y.useRef(n);y.useEffect(()=>{o!=="saving"&&(Hc(n,p.current)||(p.current=n,r(n)))},[n,o]),w1(o,d);const h=!Hc(i,n),v=y.useCallback(async b=>{if(!(!h||o==="saving")){d("saving"),m(null);try{await b(i),d("saved")}catch(S){d("idle"),m(b1(S)||null)}}},[h,o,i]),x=y.useCallback(()=>{r(n),m(null),d("idle")},[n]);return{value:i,setValue:r,dirty:h,status:o,error:f,save:v,revert:x}}function Pc(n){const[i,r]=y.useState(n),[o,d]=y.useState("idle"),[f,m]=y.useState(null),p=y.useRef(n);y.useEffect(()=>{o!=="saving"&&(Hc(n,p.current)||(p.current=n,r(n)))},[n,o]),w1(o,d);const h=!Hc(i,n),v=y.useCallback((S,A)=>{r(k=>({...k,[S]:A}))},[]),x=y.useCallback(async S=>{if(!(!h||o==="saving")){d("saving"),m(null);try{await S(i),d("saved")}catch(A){d("idle"),m(b1(A)||null)}}},[h,o,i]),b=y.useCallback(()=>{r(n),m(null),d("idle")},[n]);return{draft:i,setDraft:r,setField:v,dirty:h,status:o,error:f,save:x,revert:b}}function mn({label:n,description:i,error:r,htmlFor:o,className:d,dirty:f,saving:m,justSaved:p,onSave:h,onRevert:v,saveLabel:x,savedLabel:b,actions:S,children:A}){const k=j=>{var _;const L=(_=j.target)==null?void 0:_.tagName;j.key==="Enter"&&L==="INPUT"&&!j.nativeEvent.isComposing&&(j.preventDefault(),f&&!m&&h()),j.key==="Escape"&&(j.preventDefault(),v())},N=y.isValidElement(A)?y.cloneElement(A,{onKeyDown:j=>{var L,_;(_=(L=A.props).onKeyDown)==null||_.call(L,j),k(j)}}):A;return s.jsx(Me,{label:n,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}),S,s.jsx(Oe,{type:"button",label:p?b??x:x,icon:p?s.jsx(gi,{size:16}):s.jsx(xi,{size:16}),loading:m,disabled:!f&&!p||m,onClick:()=>{f&&!m&&h()},className:p?"text-ok":void 0})]})})}function qc({dirty:n,saving:i,justSaved:r,error:o,onDiscard:d,saveLabel:f,discardLabel:m,unsavedLabel:p,savedLabel:h,className:v}){return s.jsxs("div",{className:qe("flex flex-wrap items-center gap-2",v),children:[s.jsx("div",{className:"min-w-0 flex-1",children:o?s.jsx("p",{role:"alert",className:"text-xs text-danger",children:o}):n?s.jsx("p",{className:"text-xs text-warn",children:p}):r&&h?s.jsx("p",{className:"text-xs text-ok",children:h}):null}),s.jsx(ue,{type:"button",variant:"ghost",disabled:!n||i,onClick:d,children:m}),s.jsx(ue,{type:"submit",variant:"primary",icon:s.jsx(xi,{size:16}),disabled:!n,loading:i,children:f})]})}function Pr({label:n,value:i,options:r,onChange:o}){var f;const d=(f=r.find(m=>m.value===i))==null?void 0:f.label;return s.jsx(ch,{label:n,trigger:s.jsx(Oe,{label:d?`${n}: ${d}`:n,icon:s.jsx(Ak,{size:18})}),children:r.map(m=>s.jsx(it,{checked:m.value===i,onSelect:()=>o(m.value),children:m.label},m.value))})}function S1(n){var f,m;if(!(n.target instanceof HTMLButtonElement))return;const i=Array.from(n.currentTarget.querySelectorAll('[role="tab"]')),r=i.indexOf(n.target);if(r<0)return;const o=getComputedStyle(n.currentTarget).direction==="rtl";let d;switch(n.key){case"ArrowRight":d=(r+(o?-1:1)+i.length)%i.length;break;case"ArrowLeft":d=(r+(o?1:-1)+i.length)%i.length;break;case"Home":d=0;break;case"End":d=i.length-1;break;default:return}n.preventDefault(),i[d].focus({preventScroll:!0}),(m=(f=i[d]).scrollIntoView)==null||m.call(f,{block:"nearest",inline:"nearest"}),i[d].click()}function k1(n){const i=y.useRef(null);return y.useEffect(()=>{var r,o;(o=(r=i.current)==null?void 0:r.scrollIntoView)==null||o.call(r,{block:"nearest",inline:"nearest"})},[n]),i}function Va({value:n,onChange:i,options:r,"aria-label":o,className:d}){var p;const f=k1(n),m=r.some(h=>h.value===n)?n:(p=r[0])==null?void 0:p.value;return s.jsx("div",{role:"tablist","aria-label":o,onKeyDown:S1,className:qe("inline-flex max-w-full flex-nowrap overflow-x-auto no-scrollbar rounded-xl border border-line bg-panel-raised p-1",d),children:r.map(h=>{const v=h.value===n;return s.jsxs("button",{ref:v?f:void 0,type:"button",role:"tab","aria-selected":v,tabIndex:h.value===m?0:-1,onClick:()=>i(h.value),className:qe("inline-flex min-h-10 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3 text-xs font-semibold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",v?"bg-brand-blue text-white":"text-muted hover:text-text-main"),children:[h.icon,h.label]},h.value)})})}function $c({value:n,onChange:i,options:r,"aria-label":o,className:d}){var p;const f=k1(n),m=r.some(h=>h.value===n)?n:(p=r[0])==null?void 0:p.value;return s.jsx("div",{role:"tablist","aria-label":o,onKeyDown:S1,className:qe("flex items-center gap-1 sm:gap-2",d),children:r.map(h=>{const v=h.value===n,x=!!h.icon&&!v;return s.jsxs("button",{ref:v?f:void 0,type:"button",role:"tab","aria-selected":v,tabIndex:h.value===m?0:-1,title:x&&typeof h.label=="string"?h.label:void 0,onClick:()=>i(h.value),className:qe("inline-flex min-h-10 min-w-10 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-xl text-sm font-bold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",x?"px-2.5 sm:px-4":"px-4",v?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:bg-panel-hover hover:text-text-main"),children:[h.icon,s.jsx("span",{className:qe(x&&"sr-only sm:not-sr-only"),children:h.label})]},h.value)})})}const vl=y.forwardRef(function({className:i,...r},o){return s.jsx("div",{ref:o,className:qe("flex flex-wrap items-center gap-2",i),...r})}),bN=1500,rv=120,j1=8,js=12,wN=320,ov=640,cv="color-mix(in srgb, var(--panel-solid) 62%, transparent)",SN="0 0 0 1px color-mix(in srgb, var(--brand-cyan) 55%, transparent)",kN="0 0 20px 3px color-mix(in srgb, var(--brand-cyan) 30%, transparent)",yc=(n,i,r)=>Math.min(Math.max(n,i),r);function jN({rect:n,pad:i=j1}){if(!n||n.width<=0&&n.height<=0)return s.jsx("div",{className:"absolute inset-0",style:{backgroundColor:cv}});const r={top:n.top-i,left:n.left-i,width:n.width+i*2,height:n.height+i*2};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"absolute rounded-2xl transition-[top,left,width,height] duration-150 ease-out",style:{...r,boxShadow:`0 0 0 9999px ${cv}`}}),s.jsx("div",{className:"tour-glow absolute rounded-2xl",style:{...r,boxShadow:`${SN}, ${kN}`}})]})}function NN({open:n,steps:i,index:r,onAdvance:o,onBack:d,onClose:f,labels:m}){const{direction:p}=Ue(),h=y.useId(),v=i[r],[x,b]=y.useState(null),[S,A]=y.useState(null),[k,N]=y.useState(0),[j,L]=y.useState(()=>window.innerWidth<ov),_=y.useRef(null),F=y.useRef(null),R=y.useRef(o);if(R.current=o,y.useEffect(()=>{const H=()=>L(window.innerWidth<ov);return window.addEventListener("resize",H),window.addEventListener("orientationchange",H),()=>{window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H)}},[]),y.useEffect(()=>{if(!n||(b(null),A(null),!v))return;const H=`[data-tour="${v.target}"]`;let O=0;const W=window.setInterval(()=>{const Z=document.querySelector(H),se=Z==null?void 0:Z.getBoundingClientRect();if(Z&&se&&(se.width>0||se.height>0)){window.clearInterval(W),Z.scrollIntoView({block:"center",inline:"nearest"}),b(Z);return}O+=rv,O>=bN&&(window.clearInterval(W),R.current())},rv);return()=>window.clearInterval(W)},[n,v]),y.useEffect(()=>{if(!n||!x)return;let H=0,O=null;const W=()=>{const Z=_.current;if(Z){const q=Z.offsetHeight;N(le=>Math.abs(le-q)>1?q:le)}const se=x.getBoundingClientRect(),E={top:se.top,left:se.left,width:se.width,height:se.height,bottom:se.bottom,right:se.right};(!O||Math.abs(E.top-O.top)>.5||Math.abs(E.left-O.left)>.5||Math.abs(E.width-O.width)>.5||Math.abs(E.height-O.height)>.5)&&(O=E,A(E)),H=window.requestAnimationFrame(W)};return H=window.requestAnimationFrame(W),()=>window.cancelAnimationFrame(H)},[n,x]),y.useEffect(()=>{var E;const H=_.current;if(!n||!x||!j||!H)return;const O=(((E=document.querySelector("header"))==null?void 0:E.getBoundingClientRect().bottom)??0)+js,W=window.innerHeight-H.offsetHeight-js-O,Z=x.getBoundingClientRect(),se=Z.height>=W?O:O+(W-Z.height)/2;window.scrollBy({top:Z.top-se})},[n,x,j]),ih(_,n&&!!x,f),y.useEffect(()=>{var H;n&&x&&((H=F.current)==null||H.focus({preventScroll:!0}))},[n,x]),!n||!v)return null;const ne=r===i.length-1,B=H=>{const O=p==="rtl"?"ArrowLeft":"ArrowRight",W=p==="rtl"?"ArrowRight":"ArrowLeft";H.key===O?(H.preventDefault(),o()):H.key===W&&(H.preventDefault(),d())};let M,T;if(j)T="fixed inset-x-0 bottom-0 rounded-t-2xl border-t p-4",M={paddingBottom:"max(1rem, env(safe-area-inset-bottom))",animation:"modal-enter 150ms ease-out"};else if(S){const H=window.innerWidth,O=window.innerHeight,W=Math.min(wN,H-24),Z=k||170,se=H-S.left-S.width,E=S.left,z=W+js+j1;let q,le;se>=E&&se>=z?(q=yc(S.top+S.height/2-Z/2,8,Math.max(8,O-Z-8)),le=S.left+S.width+js):E>=z?(q=yc(S.top+S.height/2-Z/2,8,Math.max(8,O-Z-8)),le=S.left-js-W):S.bottom+js+Z<=O-8?(q=S.bottom+js,le=yc(S.left+S.width/2-W/2,8,H-W-8)):(q=Math.max(8,S.top-js-Z),le=yc(S.left+S.width/2-W/2,8,H-W-8)),T="fixed rounded-2xl border p-4",M={top:q,left:le,width:W,maxHeight:`calc(100dvh - ${q}px - 8px)`,overflowY:"auto",animation:"modal-enter 150ms ease-out"}}else T="fixed inset-x-0 bottom-0 rounded-t-2xl border-t p-4",M={paddingBottom:"max(1rem, env(safe-area-inset-bottom))",animation:"modal-enter 150ms ease-out"};return Xc.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 z-50"}),s.jsx("div",{"aria-hidden":"true",className:"pointer-events-none fixed inset-0 z-50",children:s.jsx(jN,{rect:S})}),s.jsxs("div",{ref:_,role:"dialog","aria-modal":"true","aria-labelledby":h,tabIndex:-1,"data-overlay":"dialog",className:qe("z-50 flex w-full flex-col gap-2 border-line bg-panel shadow-2xl outline-none",T),style:M,onKeyDown:B,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-faint",children:m.stepOf}),s.jsx("span",{className:"ms-auto"}),s.jsx(Oe,{size:"sm",variant:"ghost",label:m.skip,icon:s.jsx(Rn,{size:16}),onClick:f})]}),s.jsx("h2",{id:h,className:"text-base font-bold text-text-main",children:v.title}),s.jsx("p",{className:"text-sm leading-relaxed text-muted",children:v.body}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ue,{variant:"secondary",size:"md",disabled:r===0,icon:s.jsx(Lr,{size:16,className:"rtl:-scale-x-100"}),onClick:d,children:m.back}),s.jsx(ue,{ref:F,variant:"primary",size:"md",className:"ms-auto",icon:ne?void 0:s.jsx(Oc,{size:16,className:"rtl:-scale-x-100"}),onClick:o,children:ne?m.done:m.next})]})]})]}),document.body)}const CN={1:"line-clamp-1",2:"line-clamp-2",3:"line-clamp-3"},ln=y.forwardRef(function({as:i="span",lines:r,title:o,className:d,children:f,dir:m,...p},h){const v={...p,dir:m??"auto",title:o??(r!==void 0&&typeof f=="string"?f:void 0),className:qe("min-w-0 whitespace-normal break-words",r!==void 0&&CN[r],d),children:f};return i==="p"?s.jsx("p",{ref:h,...v}):i==="bdi"?s.jsx("bdi",{ref:h,...v}):i==="strong"?s.jsx("strong",{ref:h,...v}):i==="em"?s.jsx("em",{ref:h,...v}):s.jsx("span",{ref:h,...v})}),N1=y.createContext(null),EN=({children:n})=>{const{t:i}=Ue(),[r,o]=y.useState([]),d=y.useCallback(m=>{o(p=>p.filter(h=>h.id!==m))},[]),f=y.useCallback((m,p="info",h=4e3)=>{const v=Math.random().toString(36).slice(2,9);o(x=>[...x,{id:v,message:m,type:p,duration:h}]),setTimeout(()=>d(v),h)},[d]);return s.jsxs(N1.Provider,{value:{toast:f},children:[n,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(m=>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 ${m.type==="success"?"border-ok/35":m.type==="error"?"border-danger/35":m.type==="warning"?"border-warn/35":"border-line"}`,children:[m.type==="success"&&s.jsx(Es,{size:18,className:"shrink-0 text-ok"}),m.type==="error"&&s.jsx(Lk,{size:18,className:"shrink-0 text-danger"}),m.type==="warning"&&s.jsx(hl,{size:18,className:"shrink-0 text-warn"}),m.type==="info"&&s.jsx(Ik,{size:18,className:"shrink-0 text-info"}),s.jsx("span",{className:"flex-1 font-medium",children:m.message}),s.jsx(Oe,{variant:"ghost",label:i("dismiss"),icon:s.jsx(Rn,{size:16}),onClick:()=>d(m.id)})]},m.id))})]})},Et=()=>{const n=y.useContext(N1);if(!n)throw new Error("useToast must be used within a ToastProvider");return n};let uv=!1;const AN=()=>{const{t:n}=Ue(),{toast:i}=Et(),[r,o]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1);if(y.useEffect(()=>{typeof window>"u"||window.LevixHost||uv||(uv=!0,$.getCrashReports().then(x=>{x!=null&&x.reports&&x.reports.length>0&&o(!0)}).catch(()=>{}))},[]),!r)return null;const h=()=>{o(!1),window.location.hash="settings/diagnostics"},v=async()=>{p(!0);try{await $.deleteAllCrashReports(),i(n("allReportsDeleted"),"success"),o(!1)}catch(x){i((x==null?void 0:x.message)||"Delete failed","error")}finally{p(!1),f(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-4",children:s.jsx($e,{className:"border-warn/30 bg-warn/5 p-4",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-warn/15 text-warn",children:s.jsx(hl,{size:18})}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("h4",{className:"text-sm font-bold text-text-main",children:n("crashBannerTitle")}),s.jsx("p",{className:"text-xs leading-relaxed text-muted",children:n("crashBannerDesc")})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 self-end sm:self-auto shrink-0",children:[s.jsx(ue,{variant:"primary",size:"sm",onClick:h,icon:s.jsx(e1,{size:14}),children:n("crashBannerReview")}),s.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:n("crashBannerNotNow")}),s.jsx(ue,{variant:"danger",size:"sm",onClick:()=>f(!0),icon:s.jsx(Mn,{size:14}),children:n("crashBannerDelete")})]})]})})}),s.jsx(pl,{isOpen:d,onClose:()=>f(!1),onConfirm:v,loading:m,title:n("confirmDeleteAllReports"),description:n("confirmDeleteAllDesc"),confirmLabel:n("deleteAllReports"),cancelLabel:n("cancel"),variant:"danger"})]})};function Bm(n,i){const r=n||(document.documentElement.lang==="en"?"en":"ar"),o=i||(document.documentElement.getAttribute("data-theme")==="light"?"light":"dark"),d=`${window.innerWidth}x${window.innerHeight}@${Number(window.devicePixelRatio||1).toFixed(2)}`,f={screen:d.length>24?d.slice(0,24):d,language:r,theme:o},m=window.LevixHost;if(m&&typeof m.getDiagnostics=="function")try{const p=m.getDiagnostics();if(p){const h=JSON.parse(p);if(h&&typeof h=="object"){const v=["nativeApp","android","device","abi","webview","connectivity","memory","storage"];for(const x of v)typeof h[x]=="string"&&(f[x]=h[x])}}}catch{}return f}const TN=3,_N=20;let dv=0;const fv=new Set;let Um=!1;const Cc=[];function Hm(){try{const n=window.location.hash.replace(/^#\/?/,"").split("/")[0];return(n?n.trim():"overview").slice(0,40)||"overview"}catch{return"overview"}}function mv(n){try{const i=(n||"overview").slice(0,60);Cc.push({at:new Date().toISOString(),kind:"nav",name:i}),Cc.length>_N&&Cc.shift()}catch{}}if(typeof window<"u")try{window.addEventListener("beforeunload",()=>{Um=!0}),window.addEventListener("pagehide",()=>{Um=!0}),mv(Hm()),window.addEventListener("hashchange",()=>{mv(Hm())})}catch{}function Pm(n,i,r){try{if(Um||dv>=TN)return;let o=r||"Error",d="Unknown error",f=[];if(i instanceof Error)o=r||i.name||"Error",d=i.message||"Unknown error",i.stack&&(f=i.stack.split(`
|
|
545
|
+
`).map(h=>h.trim().slice(0,200)).filter(Boolean).slice(0,20));else if(typeof i=="string")d=i;else if(i&&typeof i=="object"){const h=i;typeof h.message=="string"&&(d=h.message),typeof h.name=="string"&&(o=r||h.name),typeof h.stack=="string"&&(f=h.stack.split(`
|
|
546
|
+
`).map(v=>v.trim().slice(0,200)).filter(Boolean).slice(0,20))}o=o.slice(0,120),d=d.slice(0,300);const m=`${o}|${d}`;if(fv.has(m))return;fv.add(m),dv++;const p={category:n,error:{type:o,message:d,stack:f},screen:Hm(),breadcrumbs:[...Cc],device:Bm()};$.submitCrashReport(p).catch(()=>{})}catch{}}function DN(){if(typeof window>"u")return()=>{};const n=r=>{try{Pm("web-error",r.error||r.message)}catch{}},i=r=>{try{Pm("web-rejection",r.reason)}catch{}};return window.addEventListener("error",n),window.addEventListener("unhandledrejection",i),()=>{window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",i)}}class C1 extends y.Component{constructor(i){super(i),this.state={hasError:!1,error:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,r){try{Pm("react-render",i)}catch{}}render(){var i,r;if(this.state.hasError){const o=((i=this.context)==null?void 0:i.t)||(d=>d);return s.jsx("div",{className:"flex min-h-[50vh] items-center justify-center p-4",children:s.jsxs($e,{className:"max-w-md w-full text-center border-danger/30",children:[s.jsx("div",{className:"mx-auto flex size-12 items-center justify-center rounded-full bg-danger/10 text-danger",children:s.jsx(hl,{size:24})}),s.jsx("h2",{className:"mt-4 text-lg font-bold text-text-main",children:o("errorBoundaryTitle")}),s.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted sm:text-sm",children:o("errorBoundaryDesc")}),((r=this.state.error)==null?void 0:r.message)&&s.jsx("pre",{dir:"ltr",className:"mt-3 overflow-x-auto rounded-lg bg-panel p-2 font-mono text-[11px] leading-relaxed text-danger border border-line text-start",children:this.state.error.message}),s.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row items-center justify-center gap-3",children:[s.jsx(ue,{variant:"primary",onClick:()=>window.location.reload(),icon:s.jsx(Ia,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryReload")}),s.jsx(ue,{variant:"secondary",onClick:()=>{window.location.hash="settings/diagnostics",this.setState({hasError:!1,error:null})},icon:s.jsx(e1,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryGoDiagnostics")})]})]})})}return this.props.children}}Uy(C1,"contextType",ah);function Ut(n,i){return n.replace(/\{([A-Za-z0-9_]+)\}/g,(r,o)=>Object.hasOwn(i,o)?String(i[o]):r)}const Gf=[{id:"sidebar",target:"sidebar-nav",screen:"sidebar",desktopOnly:!0,titleKey:"tourSidebarTitle",bodyKey:"tourSidebarBody"},{id:"connection-start",target:"connection-start",screen:"connection",hash:"connection",titleKey:"tourConnectionStartTitle",bodyKey:"tourConnectionStartBody"},{id:"connection-pairing",target:"connection-pairing",screen:"connection",hash:"connection",titleKey:"tourConnectionPairingTitle",bodyKey:"tourConnectionPairingBody"},{id:"overview-stats",target:"overview-stats",screen:"overview",hash:"overview",titleKey:"tourOverviewStatsTitle",bodyKey:"tourOverviewStatsBody"},{id:"commands-list",target:"commands-list",screen:"commands",hash:"commands",titleKey:"tourCommandsTitle",bodyKey:"tourCommandsBody"},{id:"ai-agent",target:"ai-agent",screen:"ai",hash:"ai",inMainTour:!1,titleKey:"tourAiAgentTitle",bodyKey:"tourAiAgentBody"},{id:"ai-provider",target:"ai-provider",screen:"ai",hash:"ai",titleKey:"tourAiProviderTitle",bodyKey:"tourAiProviderBody"},{id:"ai-memory",target:"ai-memory",screen:"ai",hash:"ai",titleKey:"tourAiMemoryTitle",bodyKey:"tourAiMemoryBody"},{id:"groups-list",target:"groups-list",screen:"groups",hash:"groups",titleKey:"tourGroupsTitle",bodyKey:"tourGroupsBody"},{id:"stickers-tabs",target:"stickers-tabs",screen:"stickers",hash:"stickers",titleKey:"tourStickersTitle",bodyKey:"tourStickersBody"},{id:"schedules-list",target:"schedules-list",screen:"schedules",hash:"schedules",titleKey:"tourSchedulesTitle",bodyKey:"tourSchedulesBody"},{id:"logs-stream",target:"logs-stream",screen:"logs",hash:"logs",titleKey:"tourLogsTitle",bodyKey:"tourLogsBody"},{id:"settings-general",target:"settings-general",screen:"settings",hash:"settings",titleKey:"tourSettingsTitle",bodyKey:"tourSettingsBody"},{id:"settings-password",target:"settings-password",screen:"settings",hash:"settings/security",inMainTour:!1,titleKey:"tourSettingsPasswordTitle",bodyKey:"tourSettingsPasswordBody"},{id:"settings-feedback",target:"settings-feedback",screen:"settings",hash:"settings/feedback",inMainTour:!1,titleKey:"tourSettingsFeedbackTitle",bodyKey:"tourSettingsFeedbackBody"},{id:"settings-diagnostics",target:"settings-diagnostics",screen:"settings",hash:"settings/diagnostics",inMainTour:!1,titleKey:"tourSettingsDiagnosticsTitle",bodyKey:"tourSettingsDiagnosticsBody"}],E1="levix_tour_v1_done",MN=768,RN=()=>{try{return window.localStorage.getItem(E1)==="1"}catch{return!1}},zN=()=>{try{window.localStorage.setItem(E1,"1")}catch{}},A1=y.createContext(null),T1=()=>y.useContext(A1),If=()=>!!document.querySelector('[role="dialog"]'),Vf=()=>window.innerWidth>=MN,LN=({children:n})=>{const{t:i}=Ue(),[r,o]=y.useState(null),[d,f]=y.useState(0),m=y.useRef(r);m.current=r;const p=y.useRef(d);p.current=d;const h=y.useCallback(_=>{o(_),f(0)},[]),v=y.useCallback(()=>{If()||m.current||h(Gf.filter(_=>_.inMainTour!==!1&&(!_.desktopOnly||Vf())))},[h]),x=y.useCallback(_=>{if(If()||m.current)return;const F=Gf.filter(R=>R.screen===_&&(!R.desktopOnly||Vf()));F.length!==0&&h(F)},[h]),b=y.useCallback(_=>Gf.some(F=>F.screen===_&&(!F.desktopOnly||Vf())),[]),S=y.useCallback(()=>{zN(),o(null),f(0)},[]),A=y.useCallback(()=>{const _=m.current;if(!_)return;const F=p.current+1;F>=_.length?S():f(F)},[S]),k=y.useCallback(()=>{p.current>0&&f(p.current-1)},[]);y.useEffect(()=>{if(!r)return;const _=r[d];_!=null&&_.hash&&window.location.hash!==`#${_.hash}`&&(window.location.hash=_.hash)},[r,d]),y.useEffect(()=>{let _=0,F;const R=()=>{if(_+=1,!m.current&&!RN()){if(If()){_<5&&(F=window.setTimeout(R,600));return}v()}};return F=window.setTimeout(R,1200),()=>window.clearTimeout(F)},[v]);const N=y.useMemo(()=>(r??[]).map(_=>({target:_.target,title:i(_.titleKey),body:i(_.bodyKey)})),[r,i]),j=y.useMemo(()=>({back:i("tourBack"),next:i("tourNext"),done:i("tourDone"),skip:i("tourSkip"),stepOf:r?Ut(i("tourStepOf"),{n:d+1,total:r.length}):""}),[i,r,d]),L=y.useMemo(()=>({startMainTour:v,startScreenTour:x,hasScreenSteps:b}),[v,x,b]);return s.jsxs(A1.Provider,{value:L,children:[n,s.jsx(NN,{open:!!r,steps:N,index:d,onAdvance:A,onBack:k,onClose:S,labels:j})]})},ON=({onToggleMobileMenu:n,title:i,view:r,status:o})=>{const{language:d,setLanguage:f,theme:m,setTheme:p,t:h}=Ue(),v=T1(),x=()=>{p(m==="dark"?"light":"dark")};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(Oe,{id:"mobile-menu-btn",className:"md:hidden",label:h("openNavigation"),icon:s.jsx(Xk,{size:20}),onClick:n}),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:[(v==null?void 0:v.hasScreenSteps(r))&&s.jsx(Oe,{id:"btn-header-guide",label:h("tourScreenHelp"),icon:s.jsx(zk,{size:18,className:"text-brand-cyan"}),onClick:()=>v.startScreenTour(r)}),s.jsxs(ch,{label:h("chooseLanguage"),trigger:s.jsx(Oe,{id:"btn-header-lang",label:h("chooseLanguage"),icon:s.jsx(Bc,{size:18,className:"text-brand-cyan"})}),children:[s.jsx(pN,{children:h("chooseLanguage")}),s.jsx(it,{checked:d==="ar",onSelect:()=>f("ar"),children:"العربية"}),s.jsx(it,{checked:d==="en",onSelect:()=>f("en"),children:"English"})]}),s.jsx(Oe,{id:"btn-header-theme",label:h(m==="dark"?"lightMode":"darkMode"),icon:m==="dark"?s.jsx(sj,{size:18,className:"text-brand-cyan"}):s.jsx(Wk,{size:18,className:"text-brand-cyan"}),onClick:x})]})]})},BN=({currentView:n,onSelectView:i,isOpenMobile:r,onCloseMobile:o})=>{var h;const{t:d}=Ue(),f=typeof((h=window.LevixHost)==null?void 0:h.closePanel)=="function",m=window.__BRAND__||{name:"Levix",tagline:"Private control room",version:"",developer:"Abdelrhman Diab",studio:"Leviro",developerSite:"https://github.com/Abdodiab2005",studioSite:"https://leviro.net"},p=[{id:"overview",label:d("overview"),icon:Vk},{id:"connection",label:d("connection"),icon:Or},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:ml},{id:"ai",label:d("ai"),icon:Jm},{id:"groups",label:d("groups"),icon:ol},{id:"autodelete",label:d("autoDelete"),icon:jc},{id:"schedules",label:d("schedules"),icon:Mm},{id:"stickers",label:d("stickers"),icon:nh},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:aj},{id:"logs",label:d("logs"),icon:Ur}];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:qe("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 border border-line bg-panel-raised shadow-md",children:s.jsx("img",{src:"/brand/mark.svg",alt:m.name,className:"size-6"})}),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:m.name}),s.jsx("div",{className:"mt-0.5 truncate text-xs leading-none text-muted",children:m.tagline})]})]}),s.jsx(Oe,{className:"md:hidden",label:d("closeNavigation"),icon:s.jsx(Rn,{size:18}),onClick:o})]}),s.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-3","data-tour":"sidebar-nav",children:p.map(v=>{if(v.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:v.labelCategory},`cat-${v.labelCategory}`);if(!v.icon||!v.id)return null;const x=v.icon,b=n===v.id;return s.jsx(ue,{variant:b?"primary":"ghost",className:"w-full justify-start",icon:s.jsx(x,{size:20}),onClick:()=>{i(v.id),o()},children:s.jsx("span",{className:"truncate",children:v.label})},v.id)})}),s.jsxs("div",{className:"flex flex-col gap-1 border-t border-line p-3",children:[f&&s.jsx(ue,{variant:"ghost",className:"w-full justify-start",icon:s.jsx(Ek,{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(ue,{type:"submit",variant:"ghost",className:"w-full justify-start text-danger hover:bg-danger/10 hover:text-danger",icon:s.jsx(Yk,{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:m.version?`v${m.version}`:""}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(th,{size:14,className:"text-brand-cyan"})," Local-first"]})]}),s.jsxs("div",{className:"truncate text-[11px] text-muted",children:["© ",m.copyrightYear||2026," ",s.jsx("a",{href:m.developerSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:m.developer})," ","(",s.jsx("a",{href:m.studioSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:m.studio}),")"]})]})]})]})},Sa=Object.create(null);Sa.open="0";Sa.close="1";Sa.ping="2";Sa.pong="3";Sa.message="4";Sa.upgrade="5";Sa.noop="6";const Ec=Object.create(null);Object.keys(Sa).forEach(n=>{Ec[Sa[n]]=n});const qm={type:"error",data:"parser error"},_1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",D1=typeof ArrayBuffer=="function",M1=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,uh=({type:n,data:i},r,o)=>_1&&i instanceof Blob?r?o(i):hv(i,o):D1&&(i instanceof ArrayBuffer||M1(i))?r?o(i):hv(new Blob([i]),o):o(Sa[n]+(i||"")),hv=(n,i)=>{const r=new FileReader;return r.onload=function(){const o=r.result.split(",")[1];i("b"+(o||""))},r.readAsDataURL(n)};function pv(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Kf;function UN(n,i){if(_1&&n.data instanceof Blob)return n.data.arrayBuffer().then(pv).then(i);if(D1&&(n.data instanceof ArrayBuffer||M1(n.data)))return i(pv(n.data));uh(n,!1,r=>{Kf||(Kf=new TextEncoder),i(Kf.encode(r))})}const gv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ar=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<gv.length;n++)Ar[gv.charCodeAt(n)]=n;const HN=n=>{let i=n.length*.75,r=n.length,o,d=0,f,m,p,h;n[n.length-1]==="="&&(i--,n[n.length-2]==="="&&i--);const v=new ArrayBuffer(i),x=new Uint8Array(v);for(o=0;o<r;o+=4)f=Ar[n.charCodeAt(o)],m=Ar[n.charCodeAt(o+1)],p=Ar[n.charCodeAt(o+2)],h=Ar[n.charCodeAt(o+3)],x[d++]=f<<2|m>>4,x[d++]=(m&15)<<4|p>>2,x[d++]=(p&3)<<6|h&63;return v},PN=typeof ArrayBuffer=="function",dh=(n,i)=>{if(typeof n!="string")return{type:"message",data:R1(n,i)};const r=n.charAt(0);return r==="b"?{type:"message",data:qN(n.substring(1),i)}:Ec[r]?n.length>1?{type:Ec[r],data:n.substring(1)}:{type:Ec[r]}:qm},qN=(n,i)=>{if(PN){const r=HN(n);return R1(r,i)}else return{base64:!0,data:n}},R1=(n,i)=>{switch(i){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},z1="",FN=(n,i)=>{const r=n.length,o=new Array(r);let d=0;n.forEach((f,m)=>{uh(f,!1,p=>{o[m]=p,++d===r&&i(o.join(z1))})})},GN=(n,i)=>{const r=n.split(z1),o=[];for(let d=0;d<r.length;d++){const f=dh(r[d],i);if(o.push(f),f.type==="error")break}return o};function IN(){return new TransformStream({transform(n,i){UN(n,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))}n.data&&typeof n.data!="string"&&(d[0]|=128),i.enqueue(d),i.enqueue(r)})}})}let Yf;function vc(n){return n.reduce((i,r)=>i+r.length,0)}function bc(n,i){if(n[0].length===i)return n.shift();const r=new Uint8Array(i);let o=0;for(let d=0;d<i;d++)r[d]=n[0][o++],o===n[0].length&&(n.shift(),o=0);return n.length&&o<n[0].length&&(n[0]=n[0].slice(o)),r}function VN(n,i){Yf||(Yf=new TextDecoder);const r=[];let o=0,d=-1,f=!1;return new TransformStream({transform(m,p){for(r.push(m);;){if(o===0){if(vc(r)<1)break;const h=bc(r,1);f=(h[0]&128)===128,d=h[0]&127,d<126?o=3:d===126?o=1:o=2}else if(o===1){if(vc(r)<2)break;const h=bc(r,2);d=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),o=3}else if(o===2){if(vc(r)<8)break;const h=bc(r,8),v=new DataView(h.buffer,h.byteOffset,h.length),x=v.getUint32(0);if(x>Math.pow(2,21)-1){p.enqueue(qm);break}d=x*Math.pow(2,32)+v.getUint32(4),o=3}else{if(vc(r)<d)break;const h=bc(r,d);p.enqueue(dh(f?h:Yf.decode(h),i)),o=0}if(d===0||d>n){p.enqueue(qm);break}}}})}const L1=4;function Bt(n){if(n)return KN(n)}function KN(n){for(var i in Bt.prototype)n[i]=Bt.prototype[i];return n}Bt.prototype.on=Bt.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Bt.prototype.once=function(n,i){function r(){this.off(n,r),i.apply(this,arguments)}return r.fn=i,this.on(n,r),this};Bt.prototype.off=Bt.prototype.removeListener=Bt.prototype.removeAllListeners=Bt.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+n];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+n],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["$"+n],this};Bt.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+n],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};Bt.prototype.emitReserved=Bt.prototype.emit;Bt.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Bt.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Wc=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),Gn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),YN="arraybuffer";function O1(n,...i){return i.reduce((r,o)=>(n.hasOwnProperty(o)&&(r[o]=n[o]),r),{})}const QN=Gn.setTimeout,XN=Gn.clearTimeout;function Jc(n,i){i.useNativeTimers?(n.setTimeoutFn=QN.bind(Gn),n.clearTimeoutFn=XN.bind(Gn)):(n.setTimeoutFn=Gn.setTimeout.bind(Gn),n.clearTimeoutFn=Gn.clearTimeout.bind(Gn))}const ZN=1.33;function $N(n){return typeof n=="string"?WN(n):Math.ceil((n.byteLength||n.size)*ZN)}function WN(n){let i=0,r=0;for(let o=0,d=n.length;o<d;o++)i=n.charCodeAt(o),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(o++,r+=4);return r}function B1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function JN(n){let i="";for(let r in n)n.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(n[r]));return i}function eC(n){let i={},r=n.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 tC extends Error{constructor(i,r,o){super(i),this.description=r,this.context=o,this.type="TransportError"}}class fh extends Bt{constructor(i){super(),this.writable=!1,Jc(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 tC(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=dh(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=JN(i);return r.length?"?"+r:""}}class nC extends fh{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)};GN(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,FN(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]=B1()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let U1=!1;try{U1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const aC=U1;function sC(){}class lC extends nC{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 wa extends Bt{constructor(i,r,o){super(),this.createRequest=i,Jc(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=O1(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=wa.requestsCount++,wa.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=sC,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete wa.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()}}wa.requestsCount=0;wa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xv);else if(typeof addEventListener=="function"){const n="onpagehide"in Gn?"pagehide":"unload";addEventListener(n,xv,!1)}}function xv(){for(let n in wa.requests)wa.requests.hasOwnProperty(n)&&wa.requests[n].abort()}const iC=(function(){const n=H1({xdomain:!1});return n&&n.responseType!==null})();class rC extends lC{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=iC&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new wa(H1,this.uri(),i)}}function H1(n){const i=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||aC))return new XMLHttpRequest}catch{}if(!i)try{return new Gn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const P1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class oC extends fh{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,o=P1?{}:O1(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;uh(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Wc(()=>{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]=B1()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Qf=Gn.WebSocket||Gn.MozWebSocket;class cC extends oC{createSocket(i,r,o){return P1?new Qf(i,r,o):r?new Qf(i,r):new Qf(i)}doWrite(i,r){this.ws.send(r)}}class uC extends fh{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=VN(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(r).getReader(),d=IN();d.readable.pipeTo(i.writable),this._writer=d.writable.getWriter();const f=()=>{o.read().then(({done:p,value:h})=>{p||(this.onPacket(h),f())}).catch(p=>{})};f();const m={type:"open"};this.query.sid&&(m.data=`{"sid":"${this.query.sid}"}`),this._writer.write(m).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&&Wc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const dC={websocket:cC,webtransport:uC,polling:rC},fC=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mC=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Fm(n){if(n.length>8e3)throw"URI too long";const i=n,r=n.indexOf("["),o=n.indexOf("]");r!=-1&&o!=-1&&(n=n.substring(0,r)+n.substring(r,o).replace(/:/g,";")+n.substring(o,n.length));let d=fC.exec(n||""),f={},m=14;for(;m--;)f[mC[m]]=d[m]||"";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=hC(f,f.path),f.queryKey=pC(f,f.query),f}function hC(n,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 pC(n,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(r[d]=f)}),r}const Gm=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ac=[];Gm&&addEventListener("offline",()=>{Ac.forEach(n=>n())},!1);class Ts extends Bt{constructor(i,r){if(super(),this.binaryType=YN,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=Fm(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=Fm(r.host).host);Jc(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=eC(this.opts.query)),Gm&&(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=L1,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&&Ts.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",Ts.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+=$N(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,Wc(()=>{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(Ts.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(),Gm&&(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}}}Ts.protocol=L1;class gC extends Ts{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;Ts.priorWebsocketSuccess=!1;const d=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",b=>{if(!o)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Ts.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(x(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=r.name,this.emitReserved("upgradeError",S)}}))};function f(){o||(o=!0,x(),r.close(),r=null)}const m=b=>{const S=new Error("probe error: "+b);S.transport=r.name,f(),this.emitReserved("upgradeError",S)};function p(){m("transport closed")}function h(){m("socket closed")}function v(b){r&&b.name!==r.name&&f()}const x=()=>{r.removeListener("open",d),r.removeListener("error",m),r.removeListener("close",p),this.off("close",h),this.off("upgrading",v)};r.once("open",d),r.once("error",m),r.once("close",p),this.once("close",h),this.once("upgrading",v),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 xC=class extends gC{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=>dC[f]).filter(f=>!!f)),super(o?d:i,d)}};function yC(n,i="",r){let o=n;r=r||typeof location<"u"&&location,n==null&&(n=r.protocol+"//"+r.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=r.protocol+n:n=r.host+n),/^(https?|wss?):\/\//.test(n)||(typeof r<"u"?n=r.protocol+"//"+n:n="https://"+n),o=Fm(n)),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 vC=typeof ArrayBuffer=="function",bC=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,q1=Object.prototype.toString,wC=typeof Blob=="function"||typeof Blob<"u"&&q1.call(Blob)==="[object BlobConstructor]",SC=typeof File=="function"||typeof File<"u"&&q1.call(File)==="[object FileConstructor]";function mh(n){return vC&&(n instanceof ArrayBuffer||bC(n))||wC&&n instanceof Blob||SC&&n instanceof File}function Tc(n,i){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let r=0,o=n.length;r<o;r++)if(Tc(n[r]))return!0;return!1}if(mh(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Tc(n.toJSON(),!0);for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&Tc(n[r]))return!0;return!1}function kC(n){const i=[],r=n.data,o=n;return o.data=_c(r,i),o.attachments=i.length,{packet:o,buffers:i}}function _c(n,i,r){if(!n)return n;if(mh(n)){const o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){const o=new Array(n.length);for(let d=0;d<n.length;d++)o[d]=_c(n[d],i);return o}else if(typeof n=="object"&&!(n instanceof Date)){if(n.toJSON&&typeof n.toJSON=="function"&&!r)return _c(n.toJSON(),i,!0);const o={};for(const d in n)Object.prototype.hasOwnProperty.call(n,d)&&(o[d]=_c(n[d],i));return o}return n}function jC(n,i){return n.data=Im(n.data,i),delete n.attachments,n}function Im(n,i){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<i.length)return i[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let r=0;r<n.length;r++)n[r]=Im(n[r],i);else if(typeof n=="object")for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=Im(n[r],i));return n}const NC=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var lt;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(lt||(lt={}));class CC{constructor(i){this.replacer=i}encode(i){return(i.type===lt.EVENT||i.type===lt.ACK)&&Tc(i)?this.encodeAsBinary({type:i.type===lt.EVENT?lt.BINARY_EVENT:lt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===lt.BINARY_EVENT||i.type===lt.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=kC(i),o=this.encodeAsString(r.packet),d=r.buffers;return d.unshift(o),d}}class hh extends Bt{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===lt.BINARY_EVENT;o||r.type===lt.BINARY_ACK?(r.type=o?lt.EVENT:lt.ACK,this.reconstructor=new EC(r)):super.emitReserved("decoded",r)}else if(mh(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(lt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===lt.BINARY_EVENT||o.type===lt.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const m=i.substring(f,r);if(m!=Number(m)||i.charAt(r)!=="-")throw new Error("Illegal attachments");const p=Number(m);if(!AC(p)||p<1)throw new Error("Illegal attachments");if(p>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=p}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 m=i.charAt(r);if(m==null||Number(m)!=m){--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(hh.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 lt.CONNECT:return yv(r);case lt.DISCONNECT:return r===void 0;case lt.CONNECT_ERROR:return typeof r=="string"||yv(r);case lt.EVENT:case lt.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&NC.indexOf(r[0])===-1);case lt.ACK:case lt.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class EC{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=jC(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const AC=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};function yv(n){return Object.prototype.toString.call(n)==="[object Object]"}const TC=Object.freeze(Object.defineProperty({__proto__:null,Decoder:hh,Encoder:CC,get PacketType(){return lt}},Symbol.toStringTag,{value:"Module"}));function na(n,i,r){return n.on(i,r),function(){n.off(i,r)}}const _C=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class F1 extends Bt{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=[na(i,"open",this.onopen.bind(this)),na(i,"packet",this.onpacket.bind(this)),na(i,"error",this.onerror.bind(this)),na(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(_C.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 m={type:lt.EVENT,data:r};if(m.options={},m.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const x=this.ids++,b=r.pop();this._registerAckCallback(x,b),m.id=x}const p=(d=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||d===void 0?void 0:d.writable,h=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!p||(h?(this.notifyOutgoingListeners(m),this.packet(m)):this.sendBuffer.push(m)),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 p=0;p<this.sendBuffer.length;p++)this.sendBuffer[p].id===i&&this.sendBuffer.splice(p,1);r.call(this,new Error("operation has timed out"))},d),m=(...p)=>{this.io.clearTimeoutFn(f),r.apply(this,p)};m.withError=!0,this.acks[i]=m}emitWithAck(i,...r){return new Promise((o,d)=>{const f=(m,p)=>m?d(m):o(p);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:lt.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 lt.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 lt.EVENT:case lt.BINARY_EVENT:this.onevent(i);break;case lt.ACK:case lt.BINARY_ACK:this.onack(i);break;case lt.DISCONNECT:this.ondisconnect();break;case lt.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:lt.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:lt.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 ji(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}ji.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*n);n=(Math.floor(i*10)&1)==0?n-r:n+r}return Math.min(n,this.max)|0};ji.prototype.reset=function(){this.attempts=0};ji.prototype.setMin=function(n){this.ms=n};ji.prototype.setMax=function(n){this.max=n};ji.prototype.setJitter=function(n){this.jitter=n};class Vm extends Bt{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,Jc(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 ji({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||TC;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 xC(this.uri,this.opts);const r=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const d=na(r,"open",function(){o.onopen(),i&&i()}),f=p=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",p),i?i(p):this.maybeReconnectOnOpen()},m=na(r,"error",f);if(this._timeout!==!1){const p=this._timeout,h=this.setTimeoutFn(()=>{d(),f(new Error("timeout")),r.close()},p);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(d),this.subs.push(m),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(na(i,"ping",this.onping.bind(this)),na(i,"data",this.ondata.bind(this)),na(i,"error",this.onerror.bind(this)),na(i,"close",this.onclose.bind(this)),na(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){Wc(()=>{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 F1(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 Sr={};function Dc(n,i){typeof n=="object"&&(i=n,n=void 0),i=i||{};const r=yC(n,i.path||"/socket.io"),o=r.source,d=r.id,f=r.path,m=Sr[d]&&f in Sr[d].nsps,p=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let h;return p?h=new Vm(o,i):(Sr[d]||(Sr[d]=new Vm(o,i)),h=Sr[d]),r.query&&!i.query&&(i.query=r.queryKey),h.socket(r.path,i)}Object.assign(Dc,{Manager:Vm,Socket:F1,io:Dc,connect:Dc});let Xf=null;function vv(){return Xf||(Xf=Dc(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),Xf}function DC(n){const[i,r]=y.useState(!1),[o,d]=y.useState(null);return y.useEffect(()=>{const f=vv(),m=()=>r(!0),p=()=>r(!1),h=j=>{d(L=>({...L,...j,state:(j==null?void 0:j.state)||(L==null?void 0:L.state)||"idle"})),n==null||n("session",j)},v=j=>{d(L=>({...L,state:(j==null?void 0:j.state)||(L==null?void 0:L.state)||"idle",status:(j==null?void 0:j.status)||(L==null?void 0:L.status)})),n==null||n("status_update",j)},x=j=>{d(L=>({...L,...j})),n==null||n("status",j)},b=j=>{d(L=>({...L,state:"waiting_for_qr",qr:j})),n==null||n("qr",j)},S=j=>{const L=typeof j=="object"&&j&&"code"in j?String(j.code):String(j||"");d(_=>({..._,state:"waiting_for_qr",pairingCode:L})),n==null||n("pairing_code",L)},A=()=>{d(j=>j?{...j,qr:null}:null),n==null||n("qr_cleared",{})},k=()=>{d(j=>j?{...j,pairingCode:null}:null),n==null||n("pairing_code_cleared",{})},N=(j,...L)=>{n==null||n(j,L[0])};return f.on("connect",m),f.on("disconnect",p),f.on("session",h),f.on("status_update",v),f.on("status",x),f.on("qr",b),f.on("pairing_code",S),f.on("pairing-code",S),f.on("qr_cleared",A),f.on("pairing_code_cleared",k),f.onAny(N),r(f.connected),()=>{f.off("connect",m),f.off("disconnect",p),f.off("session",h),f.off("status_update",v),f.off("status",x),f.off("qr",b),f.off("pairing_code",S),f.off("pairing-code",S),f.off("qr_cleared",A),f.off("pairing_code_cleared",k),f.offAny(N)}},[n]),{isConnected:i,sessionStatus:o,socket:vv()}}const MC=[{key:"text",icon:ij,labelKey:"capText",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>(n==null?void 0:n.textInput)!=null&&(n==null?void 0:n.textOutput)!=null?!!(n.textInput&&n.textOutput):null},{key:"vision",icon:Si,labelKey:"capVision",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.vision},{key:"audioInput",icon:uj,labelKey:"capAudio",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.audioInput},{key:"stt",icon:c0,labelKey:"capStt",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.stt},{key:"pdfInput",icon:Ur,labelKey:"capPdf",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.pdfInput},{key:"videoInput",icon:cj,labelKey:"capVideo",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:n=>n==null?void 0:n.videoInput}];function RC(n,i){return i==="unknown"||!i||n==null?"unknown":n?"supported":"unsupported"}function zC({capabilities:n,capabilitySource:i}){const{t:r}=Ue(),o=i==="provider"?"ok":i==="seed"?"info":"neutral",d=r(i==="provider"?"sourceLive":i==="seed"?"sourceSeed":"sourceUnknown");return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-1 sm:gap-1.5",children:MC.map(f=>{const m=f.getValue(n),p=RC(m,i),h=f.icon,v=r(p==="supported"?"supported":p==="unsupported"?"unsupported":"sourceUnknown"),x=`${r(f.labelKey)}: ${v}`,b=s.jsxs("span",{className:"flex flex-col gap-1 text-xs",children:[s.jsxs("span",{className:"flex items-center gap-1.5 font-bold text-text-main",children:[p==="supported"&&s.jsx(gi,{size:13,strokeWidth:2.5,className:"text-ok shrink-0"}),p==="unsupported"&&s.jsx(Rn,{size:13,strokeWidth:2.5,className:"text-danger shrink-0"}),p==="unknown"&&s.jsx("span",{className:"font-mono text-faint shrink-0",children:"?"}),s.jsx("span",{children:x})]}),s.jsx("span",{className:"text-[11px] text-muted",children:r(p==="supported"?f.supportedDescKey:p==="unsupported"?f.unsupportedDescKey:"capUnknownDesc")})]});return s.jsx(mN,{label:x,content:b,className:"size-10 min-h-10 min-w-10 rounded-lg p-0",children:s.jsxs("span",{className:"relative inline-flex size-5 items-center justify-center",children:[s.jsx(h,{size:18,className:p==="supported"?"text-ok":p==="unsupported"?"text-muted/60":"text-muted/40"}),p==="supported"&&s.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-1 -end-1 flex size-3.5 items-center justify-center rounded-full bg-panel-raised text-ok ring-1 ring-line",children:s.jsx(gi,{size:9,strokeWidth:3})}),p==="unsupported"&&s.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-1 -end-1 flex size-3.5 items-center justify-center rounded-full bg-panel-raised text-danger ring-1 ring-line",children:s.jsx(Rn,{size:9,strokeWidth:3})}),p==="unknown"&&s.jsx("span",{"aria-hidden":!0,className:"absolute -bottom-1 -end-1 flex size-3.5 items-center justify-center rounded-full bg-panel-raised text-faint ring-1 ring-line font-mono text-[9px] font-bold leading-none",children:"?"})]})},f.key)})}),s.jsx(et,{tone:o,children:d})]})}const rl=[{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 LC(n){const i=n.ai_provider||"gemini";return rl.find(r=>{var o,d;return r.provider!==i?!1:!!(r.id==="gemini"||r.id==="anthropic"||r.id==="groq"&&((o=n.openai_base_url)!=null&&o.includes("groq.com"))||r.id==="ollama"&&((d=n.openai_base_url)!=null&&d.includes("11434"))||r.id==="openai"&&(!n.openai_base_url||n.openai_base_url.includes("api.openai.com")))})||rl[0]}const OC=()=>{var Ls,Xa,ja,Sl,Za,kl;const{t:n,language:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState({}),[f,m]=y.useState({}),[p,h]=y.useState(!0),[v,x]=y.useState({}),[b,S]=y.useState(!1),[A,k]=y.useState(!1),[N,j]=y.useState(!1),[L,_]=y.useState(""),[F,R]=y.useState(!1),[ne,B]=y.useState([]),[M,T]=y.useState(null),[H,O]=y.useState(""),[W,Z]=y.useState(!1),[se,E]=y.useState(!1),[z,q]=y.useState([]),[le,pe]=y.useState(null),[fe,G]=y.useState(null),[ce,ie]=y.useState(!1),de=LC(o),C=Pc({presetId:de.id,apiKey:"",baseUrl:de.baseUrlSetting?String(o[de.baseUrlSetting]||de.defaultBaseUrl):"",model:String(o[de.modelSetting]||de.defaultModel)}),Y=fn(String(o.ai_stt_provider||"auto")),K=fn(String(o.bot_language||"auto")),me=fn(String(o.translate_engine||"ai")),te=fn(String(o.google_translate_api_key||"")),oe=rl.find(re=>re.id===C.draft.presetId)||de,ye=async()=>{try{const re=await $.getSettings();if(re!=null&&re.settings){const ze={},Pe={};re.settings.forEach(P=>{ze[P.key]=P.value,P.type==="secret"&&(Pe[P.key]=!!P.configured,ze[P.key]="")}),d(ze),m(Pe)}}catch(re){r(re.message,"error")}finally{h(!1)}};y.useEffect(()=>{ye()},[]);const ve=async(re,ze,Pe=!1)=>{d(P=>({...P,[re]:ze}));try{await $.updateSetting(re,ze),Pe||r(n("savedSuccessfully"),"success")}catch(P){r(P.message,"error")}},be=async(re,ze)=>{await $.updateSetting(re,ze),re.endsWith("_api_key")?(d(Pe=>({...Pe,[re]:""})),m(Pe=>({...Pe,[re]:!!ze}))):d(Pe=>({...Pe,[re]:ze}))},rt=re=>{const ze=rl.find(P=>P.id===re);if(!ze)return;const Pe=rl.find(P=>P.id===C.draft.presetId)||de;C.setDraft({presetId:ze.id,apiKey:ze.keySetting===Pe.keySetting?C.draft.apiKey:"",baseUrl:ze.defaultBaseUrl,model:ze.defaultModel})},xt=async(re=!1,ze=!1)=>{S(!0);const Pe=String(C.draft.apiKey||"").trim(),P=!!f[oe.keySetting];try{const Ce={provider:oe.provider,refresh:re,cacheOnly:ze};Pe&&(Ce.apiKey=Pe),oe.baseUrlSetting&&C.draft.baseUrl&&(Ce.baseUrl=C.draft.baseUrl);const Ve=await $.fetchAiModels(Ce);Ve&&(Ve.success||Ve.fallback)?(x(Qt=>{var Xt;return{...Qt,[oe.id]:{live:!!Ve.live,requiresApiKey:!!Ve.requiresApiKey,fallback:!!Ve.fallback,models:Ve.models||[],cached:!!Ve.cached,error:Ve.success||(Xt=Ve.error)==null?void 0:Xt.message}}}),!Ve.live&&Ve.requiresApiKey&&re?r(n("connectKeyFirstPrompt"),"info"):!Ve.success&&Ve.error&&r(Ve.error.message||"Failed to discover models","error")):Ve&&!Ve.success&&Ve.error&&(x(Qt=>{var Xt;return{...Qt,[oe.id]:{live:!1,requiresApiKey:!(P||Pe),fallback:!0,models:Ve.models||[],error:(Xt=Ve.error)==null?void 0:Xt.message}}}),r(Ve.error.message||"Failed to discover models","error"))}catch(Ce){ze||r(Ce.message||"Failed to fetch models","error")}finally{S(!1)}};y.useEffect(()=>{p||xt(!1,!0)},[oe.id,p]);const Ee=((Ls=v[oe.id])==null?void 0:Ls.models)||[],Ie=!!((Xa=v[oe.id])!=null&&Xa.live),He=!!(((ja=v[oe.id])==null?void 0:ja.requiresApiKey)??!f[oe.keySetting]),he=o[de.modelSetting]||de.defaultModel,Ae=C.draft.model||oe.defaultModel,Ne=re=>Ee.find(ze=>ze.id.toLowerCase()===re.toLowerCase())||{id:re,displayName:re,provider:oe.provider,recommended:!1,capabilities:{textInput:!0,textOutput:!0,vision:!1,audioInput:!1,stt:!1,videoInput:!1,pdfInput:!1},capabilitySource:"unknown"},Ke=Ne(Ae),yt=Ne(he),Nt=!!yt.capabilities.vision,we=!!yt.capabilities.stt,I=yt.capabilitySource==="provider"||yt.capabilitySource==="seed",ke=o.ai_auto_detect_capabilities!==!1,Ye=I&&ke&&!Nt,Ge=I&&ke&&!we;y.useEffect(()=>{p||(Ye&&o.ai_vision_enabled&&ve("ai_vision_enabled",!1,!0),Ge&&o.ai_stt_enabled&&ve("ai_stt_enabled",!1,!0))},[he,Ye,Ge,p]);const kt=async()=>{j(!0),R(!0);try{const re=await $.getPersona(),ze=re==null?void 0:re.persona;_(typeof ze=="string"?ze:(ze==null?void 0:ze.body)||"")}catch(re){r(re.message,"error")}finally{R(!1)}},hn=async()=>{try{await $.updatePersona(L),r(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),j(!1)}catch(re){r(re.message,"error")}},rn=async()=>{try{const re=await $.getMemoryFiles(),ze=((re==null?void 0:re.scopes)||[]).map(Pe=>({scope:Pe.scope,label:Pe.label,entries:Pe.entries??0}));B(ze.some(Pe=>Pe.scope==="global")?ze:[{scope:"global",label:"Global memory",entries:0},...ze])}catch(re){B([{scope:"global",label:"Global memory",entries:0}]),r(re.message,"error")}},ka=async re=>{T(re),O(""),Z(!0);try{const ze=await $.getMemoryFile(re);O((ze==null?void 0:ze.content)||"")}catch(ze){r(ze.message,"error")}finally{Z(!1)}},pn=async()=>{T("global"),Z(!0),await rn();try{const re=await $.getMemoryFile("global");O((re==null?void 0:re.content)||"")}catch(re){r(re.message,"error")}finally{Z(!1)}},Ka=async()=>{if(M)try{await $.updateMemoryFile(M,H),r(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),rn(),T(null)}catch(re){r(re.message,"error")}},Rs=async()=>{E(!0),pe(null),G(null),ie(!0);try{const re=await $.getAiConversations();q((re==null?void 0:re.conversations)||[])}catch(re){r(re.message,"error")}finally{ie(!1)}},zs=async re=>{pe(re),G(null),ie(!0);try{const ze=await $.getAiConversation(re);G(ze||null)}catch(ze){r(ze.message,"error")}finally{ie(!1)}},Ni=re=>re?new Date(re).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—",Ya={saveLabel:n("save"),savedLabel:n("saved")},Ht={saveLabel:n("save"),discardLabel:n("discard"),unsavedLabel:n("unsavedChanges"),savedLabel:n("saved")};if(p)return s.jsx(_s,{text:n("starting")});const Qa=!!o.ai_agent;return s.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[s.jsx(xl,{icon:s.jsx(Jm,{size:20}),title:n("aiTitle"),description:n("aiSubtitle")}),s.jsx($e,{"data-tour":"ai-agent",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:n("aiAgentEnabled")}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-bold text-muted",children:n(Qa?"toggleOn":"toggleOff")}),s.jsx(Kn,{checked:Qa,onChange:re=>ve("ai_agent",re),"aria-label":n("aiAgentEnabled")})]})]})}),s.jsxs($e,{className:"flex flex-col gap-3","data-tour":"ai-provider",children:[s.jsx(Sn,{icon:s.jsx(L0,{size:18}),title:n("aiProvider")}),s.jsx(Va,{"aria-label":n("aiProvider"),value:C.draft.presetId,onChange:re=>rt(re),options:rl.map(re=>({value:re.id,label:re.name})),className:"w-full"}),s.jsx("p",{className:"text-xs text-muted",children:n(oe.descKey)}),He&&s.jsx("p",{className:"text-xs text-warn",children:n("connectKeyFirstPrompt")}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:re=>{re.preventDefault(),C.save(async ze=>{const Pe=rl.find(P=>P.id===ze.presetId)||oe;await be("ai_provider",Pe.provider),Pe.baseUrlSetting&&await be(Pe.baseUrlSetting,ze.baseUrl),await be(Pe.modelSetting,ze.model),ze.apiKey.trim()&&await be(Pe.keySetting,ze.apiKey.trim()),C.setDraft({...ze,apiKey:""})})},onKeyDown:re=>{re.key==="Escape"&&C.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[s.jsx(Me,{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:n("apiKey")}),f[oe.keySetting]&&s.jsxs(et,{tone:"ok",children:[s.jsx(Es,{size:11}),n("saved")]})]}),children:s.jsx(Fa,{id:"input-api-key",className:"font-mono",value:C.draft.apiKey,onChange:re=>C.setField("apiKey",re.target.value),placeholder:f[oe.keySetting]?"••••••••••••":n("enterApiKey")})}),oe.baseUrlSetting&&s.jsx(Me,{className:"min-w-0",label:n("baseUrl"),htmlFor:"input-base-url",children:s.jsx(Be,{id:"input-base-url",technical:!0,className:"font-mono",value:C.draft.baseUrl,onChange:re=>C.setField("baseUrl",re.target.value),placeholder:oe.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-1.5",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:n("modelName")}),s.jsx(et,{tone:Ie?"ok":"info",children:n(Ie?"sourceLive":"sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ue,{type:"button",variant:"ghost",size:"sm",onClick:()=>k(!A),children:n(A?"modelListToggle":"modelCustomToggle")}),s.jsx(Oe,{type:"button",variant:"ghost",label:n("refreshModels"),icon:s.jsx(Ia,{size:16}),onClick:()=>xt(!0),loading:b})]})]}),((Sl=v[oe.id])==null?void 0:Sl.error)&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-xl border border-danger/30 bg-danger/10 p-2 text-xs text-danger",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(il,{size:15,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 break-words",children:(Za=v[oe.id])==null?void 0:Za.error})]}),s.jsx(ue,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Ia,{size:14}),onClick:()=>xt(!0),loading:b,children:n("retry")})]}),b?s.jsx("div",{className:"flex min-h-10 items-center gap-2 rounded-xl border border-line bg-panel-raised px-3",children:s.jsx(ba,{label:n("fetchingModels")})}):A?s.jsx(Be,{id:"input-model-name",technical:!0,className:"font-mono",value:C.draft.model,onChange:re=>C.setField("model",re.target.value),placeholder:oe.defaultModel}):Ee.length===0?s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-xl border border-line bg-panel-raised p-2 text-xs text-muted",children:[s.jsx("span",{children:n(He?"connectKeyFirstPrompt":"noModelsFound")}),s.jsx(ue,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Ia,{size:14}),onClick:()=>xt(!0),loading:b,children:n("retry")})]}):s.jsxs(dt,{id:"input-model-name",dir:"ltr",className:"font-mono text-start",value:Ae,onChange:re=>C.setField("model",re.target.value),children:[s.jsx("optgroup",{label:n(Ie?"modelsAvailableLive":"modelsRecommendedSeed"),children:Ee.map(re=>s.jsxs("option",{value:re.id,dir:"ltr",children:[re.displayName&&re.displayName!==re.id?re.displayName:re.id,re.recommended?" ★":""]},re.id))}),!Ee.some(re=>re.id.toLowerCase()===Ae.toLowerCase())&&s.jsx("option",{value:Ae,dir:"ltr",children:Ae})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-xs text-muted",dir:"ltr",title:Ae,children:[s.jsx("span",{className:"shrink-0 text-faint",children:"ID:"}),s.jsx("span",{className:"truncate font-mono",children:Ae})]})]})]}),s.jsx(qc,{dirty:C.dirty,saving:C.status==="saving",justSaved:C.status==="saved",error:C.error,onDiscard:C.revert,...Ht})]}),s.jsx(zC,{capabilities:Ke.capabilities,capabilitySource:Ke.capabilitySource})]}),s.jsxs($e,{className:"flex flex-col gap-3",children:[s.jsx(Sn,{title:n("capabilities")}),s.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.jsxs("div",{className:"py-2",children:[s.jsx(Kn,{checked:Ye?!1:!!o.ai_vision_enabled,disabled:Ye,onChange:re=>{Ye||ve("ai_vision_enabled",re)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(Si,{size:17,className:Ye?"shrink-0 text-muted":"shrink-0 text-brand-cyan"}),n("aiVision")]}),description:n("aiVisionDesc")}),Ye&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(hl,{size:13,className:"shrink-0"}),s.jsx("span",{children:n("visionUnsupportedNotice")})]})]}),s.jsxs("div",{className:"py-2",children:[s.jsx(Kn,{checked:Ge?!1:!!(o.ai_stt_enabled??!0),disabled:Ge,onChange:re=>{Ge||ve("ai_stt_enabled",re)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(c0,{size:17,className:Ge?"shrink-0 text-muted":"shrink-0 text-brand-purple"}),n("aiSttEnabled")]}),description:n("aiSttEnabledDesc")}),Ge&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(hl,{size:13,className:"shrink-0"}),s.jsx("span",{children:n("sttUnsupportedNotice")})]})]}),s.jsx("div",{className:"py-2",children:s.jsx(mn,{label:n("aiStt"),description:n("sttDesc"),htmlFor:"ai-stt-provider",dirty:Y.dirty,saving:Y.status==="saving",justSaved:Y.status==="saved",error:Y.error,onSave:()=>Y.save(re=>be("ai_stt_provider",re)),onRevert:Y.revert,...Ya,children:s.jsxs(dt,{id:"ai-stt-provider","aria-label":n("aiStt"),value:Y.value,disabled:Ge,onChange:re=>Y.setValue(re.target.value),children:[s.jsx("option",{value:"auto",children:n("sttAuto")}),s.jsx("option",{value:"gemini",children:n("sttGemini")}),s.jsx("option",{value:"openai",children:n("sttOpenAI")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(mn,{label:n("botLanguage"),description:n("botLanguageDesc"),htmlFor:"ai-bot-language",dirty:K.dirty,saving:K.status==="saving",justSaved:K.status==="saved",error:K.error,onSave:()=>K.save(re=>be("bot_language",re)),onRevert:K.revert,...Ya,children:s.jsxs(dt,{id:"ai-bot-language","aria-label":n("botLanguage"),value:K.value,onChange:re=>K.setValue(re.target.value),children:[s.jsx("option",{value:"auto",children:n("langAuto")}),s.jsx("option",{value:"ar",children:n("langAr")}),s.jsx("option",{value:"en",children:n("langEn")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(mn,{label:n("translateEngine"),description:n("translateEngineDesc"),htmlFor:"ai-translate-engine",dirty:me.dirty,saving:me.status==="saving",justSaved:me.status==="saved",error:me.error,onSave:()=>me.save(re=>be("translate_engine",re)),onRevert:me.revert,...Ya,children:s.jsxs(dt,{id:"ai-translate-engine","aria-label":n("translateEngine"),value:me.value,onChange:re=>me.setValue(re.target.value),children:[s.jsx("option",{value:"ai",children:n("translateEngineAi")}),s.jsx("option",{value:"google",children:n("translateEngineGoogle")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(mn,{label:n("googleTranslateApiKey"),description:n("googleTranslateApiKeyDesc"),htmlFor:"ai-google-translate-key",dirty:te.dirty,saving:te.status==="saving",justSaved:te.status==="saved",error:te.error,onSave:()=>te.save(async re=>{await be("google_translate_api_key",re),te.setValue("")}),onRevert:te.revert,...Ya,children:s.jsx(Fa,{id:"ai-google-translate-key",className:"font-mono",placeholder:f.google_translate_api_key?"••••••••••••":n("enterApiKey"),value:te.value,onChange:re=>te.setValue(re.target.value)})})})]})]}),s.jsxs($e,{className:"grid grid-cols-1 gap-2 sm:grid-cols-2","data-tour":"ai-memory",children:[s.jsx(ue,{variant:"secondary",icon:s.jsx(Ur,{size:16}),onClick:kt,title:n("personaDesc"),children:n("editPersona")}),s.jsx(ue,{variant:"secondary",icon:s.jsx(Bk,{size:16}),onClick:pn,title:n("memoryDesc"),children:n("manageMemory")}),s.jsx(ue,{variant:"secondary",icon:s.jsx(nj,{size:16}),onClick:Rs,title:n("aiInspectorDesc"),children:n("openInspector")})]}),s.jsx(an,{isOpen:N,onClose:()=>j(!1),title:n("personaPrompt"),maxWidth:"750px",footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:()=>j(!1),children:n("cancel")}),s.jsx(ue,{variant:"primary",icon:s.jsx(xi,{size:16}),onClick:hn,disabled:F,children:n("save")})]}),children:F?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(ba,{className:"size-6",label:n("starting")})}):s.jsx(cl,{className:"font-mono",rows:12,value:L,onChange:re=>_(re.target.value)})}),s.jsx(an,{isOpen:!!M,onClose:()=>T(null),title:n("memoryFiles"),maxWidth:"900px",footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:()=>T(null),children:n("cancel")}),s.jsx(ue,{variant:"primary",icon:s.jsx(xi,{size:16}),onClick:Ka,disabled:W,children:n("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:ne.length===0?s.jsx(mt,{kind:"empty",text:n("noMemoryFiles"),className:"py-6"}):ne.map(re=>{const ze=re.scope==="global",Pe=M===re.scope;return s.jsxs(ue,{variant:Pe?"primary":"secondary","aria-pressed":Pe,onClick:()=>ka(re.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(Bc,{size:14,className:"shrink-0"}):s.jsx(kc,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:ze?n("memoryGlobalScope"):re.label||n(re.scope.endsWith("@g.us")?"unnamedGroup":"unknownContact")})]}),s.jsxs("span",{className:"block text-start text-[10px] opacity-80",children:[n(ze?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",n("memoryEntriesCount").replace("{n}",String(re.entries))]})]},re.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:n("memoryProseHint")}),W?s.jsx("div",{className:"flex min-h-[340px] items-center justify-center",children:s.jsx(ba,{className:"size-6",label:n("starting")})}):s.jsx(cl,{className:"min-h-[340px] flex-1 font-mono",rows:12,value:H,onChange:re=>O(re.target.value),placeholder:n("memoryEditorPlaceholder")})]})]})}),s.jsx(an,{isOpen:se,onClose:()=>E(!1),title:n("aiInspector"),maxWidth:"750px",footer:s.jsx(ue,{variant:"secondary",onClick:()=>E(!1),children:n("cancel")}),children:ce?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(ba,{className:"size-6",label:n("starting")})}):le?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(ue,{variant:"ghost",size:"sm",icon:s.jsx(Lr,{size:16,className:"rtl:rotate-180"}),onClick:()=>pe(null),children:n("backToList")}),s.jsx(ln,{lines:2,className:"text-xs text-muted",children:(fe==null?void 0:fe.name)||((kl=z.find(re=>re.chatId===le))==null?void 0:kl.name)||n((fe==null?void 0:fe.kind)==="group"?"unnamedGroup":"unknownContact")})]}),(fe==null?void 0:fe.truncated)&&s.jsx("p",{className:"text-[11px] font-semibold text-warn",children:n("convTruncated")}),s.jsxs("div",{className:"flex max-h-[420px] flex-col gap-1.5 overflow-y-auto",children:[(fe==null?void 0:fe.messages.length)===0&&s.jsx(mt,{kind:"empty",text:n("noConversations"),className:"py-6"}),fe==null?void 0:fe.messages.map((re,ze)=>s.jsxs("div",{className:`rounded-xl border p-2.5 text-xs ${re.kind==="tool"||re.kind==="toolResult"?"border-line bg-panel font-mono text-muted":re.role==="model"?"border-brand-blue/25 bg-brand-blue/10 text-text-main":"border-line bg-panel-raised text-text-main"}`,children:[re.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:re.text}),re.kind==="media"&&s.jsxs("span",{children:["📎 ",re.mimeType||n("convMedia")]}),re.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",re.name]}),re.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",re.name]})]},ze))]})]}):z.length===0?s.jsx(mt,{kind:"empty",icon:s.jsx(kc,{size:20}),text:n("noConversations"),className:"py-8"}):s.jsx("div",{className:"flex flex-col gap-1.5",children:z.map(re=>s.jsxs(ue,{variant:"secondary",onClick:()=>zs(re.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(kc,{size:14,className:"shrink-0 text-brand-blue"}),s.jsx(ln,{lines:2,children:re.name||n(re.kind==="group"?"unnamedGroup":"unknownContact")})]}),s.jsxs("span",{className:"block text-start text-[10px] text-muted",children:[n("convTurns").replace("{n}",String(re.turns))," ·"," ",Ni(re.updatedAt)]})]},re.chatId))})})]})},In={rules:100,keywords:50,keywordChars:100,nameChars:60,senders:200,phoneMin:8,phoneMax:15},BC=/[\u064B-\u065F\u0670\u0640]/g,UC=/[\u0622\u0623\u0625\u0671]/g,HC=/\u0649/g,Zf={enabled:"any",chatScope:"any",senders:"any"};function Km(n){let i=String(n??"");return i=i.normalize("NFKC"),i=i.replace(BC,""),i=i.replace(UC,"ا"),i=i.replace(HC,"ي"),i=i.toLowerCase(),i=i.replace(/\s+/g," ").trim(),i}function PC(n){const i=String(n??"").normalize("NFC").replace(/\s+/g," ").trim();return i?i.length>In.keywordChars?{error:"long"}:Km(i)?{value:i}:{error:"empty"}:{error:"empty"}}class hi extends Error{constructor(i){super(i),this.reason=i,this.name="SenderInputError"}}function qC(n){var d;const i=String(n??"").trim();if(!i)throw new hi("invalid");const r=i.toLowerCase();if(r.endsWith("@g.us")||r.endsWith("@broadcast")||r.endsWith("@newsletter"))throw new hi("group");if(i.includes("@")){if(r.includes("@lid")){const f=(d=i.split("@")[0])==null?void 0:d.split(":")[0];if(!f)throw new hi("invalid");return`${f}@lid`}if(i.includes(":")){const f=i.split(":")[0],m=i.split("@")[1];if(!f||!m)throw new hi("invalid");return`${f}@${m}`}return i}const o=i.replace(/\D/g,"");if(o.length>=In.phoneMin&&o.length<=In.phoneMax)return`${o}@s.whatsapp.net`;throw new hi("invalid")}function bi(n){var r;const i=(r=n.name)==null?void 0:r.trim();return i||n.keywords[0]||""}function Fc(n,i){if(!n)return"";const r=i==null?void 0:i.get(n);if(r)return r;const o=/^(\d+)@s\.whatsapp\.net$/i.exec(n);return o?`+${o[1]}`:n}function Ym(n,i){return n&&(i!=null&&i.has(n))?"auto":"ltr"}function FC(n){const i={};return n.name.trim().length>In.nameChars&&(i.name="long"),n.keywords.length<1?i.keywords="required":n.keywords.length>In.keywords&&(i.keywords="max"),n.sendersMode==="selected"&&(n.senders.length<1?i.senders="required":n.senders.length>In.senders&&(i.senders="max")),i}function GC(n,i){return{name:n.name.trim()||null,keywords:n.keywords,match:n.match,chatScope:n.chatScope,senders:{mode:n.sendersMode,list:n.sendersMode==="everyone"?[]:n.senders},includeOwn:n.includeOwn,forEveryone:n.forEveryone,keepCopy:n.keepCopy,...i===void 0?{}:{enabled:i}}}function IC(n,i,r){const o=Km(i);return!(o&&!Km(`${n.name??""} ${n.keywords.join(" ")}`).includes(o)||r.enabled==="on"&&!n.enabled||r.enabled==="off"&&n.enabled||r.chatScope!=="any"&&n.chatScope!==r.chatScope||r.senders!=="any"&&n.senders.mode!==r.senders)}function VC(n,i,r){const o=[...n],d=(f,m)=>bi(f).localeCompare(bi(m),r,{sensitivity:"base"});return i==="name"?o.sort(d):i==="deleted"?o.sort((f,m)=>m.deletedCount-f.deletedCount||d(f,m)):i==="last"?o.sort((f,m)=>(m.lastDeletedAt??-1)-(f.lastDeletedAt??-1)||d(f,m)):o.sort((f,m)=>m.createdAt-f.createdAt||m.id-f.id),o}function KC(n){return[n.enabled,n.chatScope,n.senders].filter(i=>i!=="any").length}const $f=20;function bv(n,i){return n instanceof Mt&&n.message?n.message:i}const YC=({rules:n,names:i,ruleId:r,onRuleIdChange:o})=>{const{t:d}=Ue(),{toast:f}=Et(),[m,p]=y.useState([]),[h,v]=y.useState(0),[x,b]=y.useState(1),[S,A]=y.useState(!0),[k,N]=y.useState(null),[j,L]=y.useState(0),[_,F]=y.useState(null),[R,ne]=y.useState(!1),B=y.useRef(0),M=`${r}|${j}`,[T,H]=y.useState(M);T!==M&&(H(M),b(1)),y.useEffect(()=>{const z=++B.current;A(!0),N(null),$.listAutoDeleteLog({ruleId:r||void 0,limit:$f,offset:(x-1)*$f}).then(q=>{B.current===z&&(p(q.log),v(q.total))}).catch(q=>{if(B.current!==z)return;const le=bv(q,d("copiesLoadFailed"));N(le),f(le,"error")}).finally(()=>{B.current===z&&A(!1)})},[r,j,x,d,f]);const O=async()=>{ne(!0);try{await $.clearAutoDeleteLog(_==="rule"?r:void 0),f(d("copiesCleared"),"success"),F(null),L(z=>z+1)}catch(z){f(bv(z,d("copiesLoadFailed")),"error")}finally{ne(!1)}},W=y.useCallback(z=>{if(!z)return d("mediaText");const le={image:"mediaImage",video:"mediaVideo",audio:"mediaAudio",sticker:"mediaSticker",document:"mediaDocument"}[z];return le?d(le):z},[d]),Z=n.find(z=>String(z.id)===r),se=Math.max(1,Math.ceil(h/$f)),E=Math.min(x,se);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(vl,{children:[s.jsx(yl,{label:d("filter"),resetLabel:d("reset"),activeCount:r?1:0,onReset:()=>o(""),children:s.jsx(Me,{label:d("filterByRule"),children:s.jsxs(dt,{"aria-label":d("filterByRule"),value:r,onChange:z=>o(z.target.value),children:[s.jsx("option",{value:"",children:d("allRules")}),n.map(z=>s.jsx("option",{value:String(z.id),children:bi(z)},z.id))]})})}),s.jsx("span",{className:"ms-auto",children:s.jsxs(Yn,{label:d("more"),children:[r&&s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>F("rule"),children:d("clearCopiesForRule")}),s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>F("all"),children:d("clearCopies")})]})})]}),S&&s.jsx("div",{className:"flex flex-col gap-3","aria-busy":"true",children:["s1","s2","s3"].map(z=>s.jsxs($e,{className:"flex flex-col gap-3",children:[s.jsx(Gt,{className:"h-4 w-40"}),s.jsx(Gt,{className:"h-12 w-full"}),s.jsx(Gt,{className:"h-5 w-24"})]},z))}),!S&&k&&s.jsx(mt,{kind:"error",icon:s.jsx(fl,{size:28}),description:k,action:s.jsx(ue,{variant:"secondary",icon:s.jsx(fl,{size:16}),onClick:()=>L(z=>z+1),children:d("retryLoad")})}),!S&&!k&&m.length===0&&r&&s.jsx(mt,{kind:"no-results",description:d("noCopiesForRule"),action:s.jsx(ue,{variant:"secondary",onClick:()=>o(""),children:d("clearFilters")})}),!S&&!k&&m.length===0&&!r&&s.jsx(mt,{kind:"empty",title:d("noCopiesTitle"),description:d("noCopiesBody")}),!S&&!k&&m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col gap-3",children:m.map(z=>{const q=Fc(z.chatJid,i)||"—",le=Fc(z.sender,i)||"—",pe=z.mode==="revoke"?d("modeRevoke"):z.mode==="deleteForMe"?d("modeForMe"):z.mode;return s.jsxs($e,{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:Ym(z.chatJid,i),className:"truncate text-sm font-semibold",children:q})]}),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:Ym(z.sender,i),className:"truncate text-sm",children:le})]}),s.jsx(Br,{value:z.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:z.text||"—"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(et,{children:W(z.mediaType)}),s.jsx(et,{tone:z.mode==="revoke"?"info":"neutral",children:pe})]})]},z.id)})}),s.jsx(ki,{page:E,pageCount:se,total:h,onPageChange:b})]}),s.jsx(pl,{isOpen:_!==null,onClose:()=>F(null),onConfirm:()=>void O(),title:d("clearCopiesTitle"),description:_==="rule"?Ut(d("clearCopiesRuleBody"),{name:Z?bi(Z):""}):d("clearCopiesBody"),confirmLabel:d("clearCopies"),cancelLabel:d("cancel"),loading:R})]})},QC={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 G1(n){return n?QC[n]??null:null}function ph(n,i){const r=G1(i);return n(r||"stickerErr_INTERNAL")}function jt(n,i){return i instanceof Mt?ph(n,i.code):n("stickerErr_INTERNAL")}function XC(n,i){const o=i?{probing:"jobStage_probing",decoding:"jobStage_decoding",encoding:"jobStage_encoding",optimizing:"jobStage_optimizing",queued:"jobQueued"}[i]:null;return n(o||"jobQueued")}const gh=({open:n,busy:i=!1,onClose:r,onPick:o,title:d,includeGroups:f=!0,selectedIds:m,emptyText:p})=>{const{t:h}=Ue(),[v,x]=y.useState([]),[b,S]=y.useState(""),[A,k]=y.useState(!1),[N,j]=y.useState(null);y.useEffect(()=>{if(!n)return;let _=!1;return k(!0),j(null),$.getRecipients().then(F=>{_||x(F.recipients)}).catch(F=>{_||(F instanceof Mt&&!G1(F.code)?j(F.message||h("recipientsLoadFailed")):j(jt(h,F)))}).finally(()=>{_||k(!1)}),()=>{_=!0}},[n,h]);const L=y.useMemo(()=>{const _=f?v:v.filter(R=>R.type==="contact"),F=b.trim().toLowerCase();return F?_.filter(R=>R.name.toLowerCase().includes(F)||(R.phone||"").toLowerCase().includes(F)):_},[f,v,b]);return s.jsx(an,{isOpen:n,onClose:r,title:d??h("sendViaWhatsapp"),footer:s.jsx(ue,{onClick:r,disabled:i,children:h("cancel")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(eh,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Be,{type:"search",value:b,onChange:_=>S(_.target.value),placeholder:h("searchRecipients"),"aria-label":h("searchRecipients"),className:"ps-9"})]}),A&&s.jsx(_s,{text:h("loading")}),N&&s.jsx("p",{className:"text-sm text-danger",role:"alert",children:N}),!A&&!N&&L.length===0&&s.jsx("p",{className:"text-sm text-muted",children:p??h("noRecipients")}),s.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto",children:L.map(_=>{const F=(m==null?void 0:m.includes(_.id))??!1;return s.jsxs(ue,{variant:"secondary",disabled:i||F,onClick:()=>o(_.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:_.name}),F&&s.jsx(et,{tone:"info",children:h("contactAdded")})]}),s.jsxs("span",{className:"block w-full text-[11px] font-medium text-muted",children:[_.type==="group"?h("recipientGroup"):h("recipientContact"),_.phone?s.jsx("span",{dir:"ltr",className:"ms-2",children:_.phone}):null]})]},_.id)})}),i&&s.jsx("p",{className:"text-xs text-muted",children:h("sending")})]})})},ZC=["contains","word","exact"],$C=["all","groups","private"],WC=({open:n,rule:i,names:r,onClose:o,onSaved:d})=>{const{t:f}=Ue(),m=y.useRef(i);m.current=i;const p=(i==null?void 0:i.id)??null,[h,v]=y.useState(""),[x,b]=y.useState([]),[S,A]=y.useState("contains"),[k,N]=y.useState("all"),[j,L]=y.useState("everyone"),[_,F]=y.useState([]),[R,ne]=y.useState(!1),[B,M]=y.useState(!0),[T,H]=y.useState(!1),[O,W]=y.useState(""),[Z,se]=y.useState(!1),[E,z]=y.useState(!1),[q,le]=y.useState(null),[pe,fe]=y.useState(null),[G,ce]=y.useState(null),[ie,de]=y.useState(null);y.useEffect(()=>{if(!n)return;const te=m.current;((te==null?void 0:te.id)??null)===p&&(v((te==null?void 0:te.name)??""),b((te==null?void 0:te.keywords)??[]),A((te==null?void 0:te.match)??"contains"),N((te==null?void 0:te.chatScope)??"all"),L((te==null?void 0:te.senders.mode)??"everyone"),F((te==null?void 0:te.senders.list)??[]),ne((te==null?void 0:te.includeOwn)??!1),M((te==null?void 0:te.forEveryone)??!0),H((te==null?void 0:te.keepCopy)??!1),W(""),se(!1),z(!1),le(null),fe(null),ce(null),de(null))},[n,p]);const C=f(S==="word"?"matchWordHint":S==="exact"?"matchExactHint":"matchContainsHint"),Y=te=>{ce(te==="long"?f("keywordTooLong"):te==="max"?f("keywordsMax"):te==="empty"?f("keywordEmpty"):te==="duplicate"?f("keywordDuplicate"):null)},K=te=>{try{const oe=qC(te);if(_.includes(oe)){W(""),de(null);return}if(_.length>=In.senders){de(f("tooManySenders"));return}F(ye=>ye.includes(oe)?ye:[...ye,oe]),W(""),de(null)}catch(oe){de(oe instanceof hi&&oe.reason==="group"?f("groupSenderRejected"):f("invalidPhone"))}},me=async te=>{var ve;te.preventDefault();const oe={name:h,keywords:x,match:S,chatScope:k,sendersMode:j,senders:_,includeOwn:R,forEveryone:B,keepCopy:T},ye=FC(oe);if(fe(ye.name?f("nameTooLong"):null),ce(ye.keywords==="required"?f("keywordsRequired"):ye.keywords==="max"?f("keywordsMax"):null),de(ye.senders==="required"?f("sendersRequired"):ye.senders==="max"?f("tooManySenders"):null),!(ye.name||ye.keywords||ye.senders)){z(!0),le(null);try{const be=GC(oe,(ve=m.current)==null?void 0:ve.enabled),rt=m.current?await $.updateAutoDeleteRule(m.current.id,be):await $.createAutoDeleteRule(be);d(rt.rule)}catch(be){const rt=be instanceof Mt&&be.message?be.message:f("ruleSaveFailed");le(rt)}finally{z(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsx(an,{isOpen:n,onClose:o,title:f(i?"editRule":"newRule"),maxWidth:"40rem",footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:o,disabled:E,children:f("cancel")}),s.jsx(ue,{variant:"primary",type:"submit",form:"auto-delete-rule-form",loading:E,children:f("saveRule")})]}),children:s.jsxs("form",{id:"auto-delete-rule-form",className:"flex flex-col gap-4",onSubmit:te=>void me(te),children:[q&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:q}),s.jsx(Me,{label:f("ruleName"),htmlFor:"ad-rule-name",error:pe,children:s.jsx(Be,{id:"ad-rule-name",name:"rule-name",dir:"auto",value:h,"aria-invalid":pe?!0:void 0,placeholder:f("ruleNamePlaceholder"),onChange:te=>{v(te.target.value),pe&&te.target.value.trim().length<=In.nameChars&&fe(null)},onBlur:()=>{h.trim().length>In.nameChars&&fe(f("nameTooLong"))}})}),s.jsx(Me,{label:f("keywordsLabel"),error:G,children:s.jsx(oN,{id:"ad-keywords",value:x,onChange:b,max:In.keywords,prepare:PC,onReject:Y,removeLabel:te=>Ut(f("removeKeyword"),{word:te}),countLabel:Ut(f("keywordCount"),{n:x.length,max:In.keywords}),placeholder:f("keywordsPlaceholder"),"aria-label":f("keywordsLabel"),"aria-invalid":G?!0:void 0,disabled:E})}),s.jsx(Me,{label:f("matchMode"),description:C,children:s.jsx(Va,{"aria-label":f("matchMode"),className:"flex w-full flex-wrap",value:S,onChange:A,options:ZC.map(te=>({value:te,label:f(te==="contains"?"matchContains":te==="word"?"matchWord":"matchExact")}))})}),s.jsx(Me,{label:f("chatScopeLabel"),children:s.jsx(Va,{"aria-label":f("chatScopeLabel"),className:"flex w-full flex-wrap",value:k,onChange:N,options:$C.map(te=>({value:te,label:f(te==="all"?"chatsAll":te==="groups"?"chatsGroups":"chatsPrivate")}))})}),s.jsxs(Me,{label:f("filterSender"),error:j==="selected"?ie:null,children:[s.jsx(Va,{"aria-label":f("filterSender"),className:"flex w-full flex-wrap",value:j,onChange:L,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")}),_.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.map(te=>s.jsx(Qc,{dir:Ym(te,r),removeLabel:Ut(f("removeContact"),{name:Fc(te,r)}),onRemove:()=>F(oe=>oe.filter(ye=>ye!==te)),children:Fc(te,r)},te))}),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:O,placeholder:f("phonePlaceholder"),"aria-label":f("phonePlaceholder"),className:"min-w-0 flex-1",onChange:te=>W(te.target.value),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),K(O))}}),s.jsx(ue,{type:"button",variant:"secondary",onClick:()=>K(O),children:f("addPhone")})]}),s.jsx(ue,{type:"button",variant:"secondary",onClick:()=>se(!0),children:f("selectContacts")})]})]}),s.jsx(Kn,{checked:R,onChange:ne,label:f("includeOwn"),description:f("includeOwnHint")}),s.jsx(Kn,{checked:B,onChange:M,label:f("forEveryone"),description:f("forEveryoneHint")}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Kn,{checked:T,onChange:H,label:f("keepCopy"),description:f("keepCopyHint")}),s.jsx("p",{className:"text-xs text-faint",children:f("keepCopyPrivacy")})]})]})}),s.jsx(gh,{open:Z,onClose:()=>se(!1),title:f("selectContacts"),includeGroups:!1,selectedIds:_,emptyText:f("noContacts"),onPick:te=>K(te)})]})},wv=4,JC={contains:"matchContains",word:"matchWord",exact:"matchExact"};function kr(n,i){return n instanceof Mt&&n.message?n.message:i}const eE=()=>{const{t:n,language:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState("rules"),[f,m]=y.useState([]),[p,h]=y.useState(()=>new Map),[v,x]=y.useState(!0),[b,S]=y.useState(null),[A,k]=y.useState(0),[N,j]=y.useState(""),[L,_]=y.useState("newest"),[F,R]=y.useState(Zf),[ne,B]=y.useState(!1),[M,T]=y.useState(null),[H,O]=y.useState(null),[W,Z]=y.useState(!1),[se,E]=y.useState(""),z=y.useRef(new Set),q=y.useRef(new Map),le=y.useRef(0),pe=y.useRef(!0),fe=y.useRef(0),G=y.useMemo(()=>new Intl.NumberFormat(i),[i]),ce=y.useCallback(he=>{m(Ae=>he.map(Ne=>{if(!z.current.has(Ne.id))return Ne;const Ke=Ae.find(yt=>yt.id===Ne.id);return Ke?{...Ne,enabled:Ke.enabled}:Ne}))},[]);y.useEffect(()=>{const he=++le.current;return x(!0),$.listAutoDeleteRules().then(Ae=>{!pe.current||le.current!==he||(ce(Ae.rules),S(null))}).catch(Ae=>{if(!pe.current||le.current!==he)return;const Ne=kr(Ae,n("rulesLoadFailed"));S(Ne),r(Ne,"error")}).finally(()=>{pe.current&&le.current===he&&x(!1)}),()=>{le.current+=1}},[A,n,r,ce]),y.useEffect(()=>(pe.current=!0,()=>{pe.current=!1}),[]);const ie=y.useCallback(async()=>{const he=++le.current,Ae=fe.current;try{const Ne=await $.listAutoDeleteRules();if(!pe.current||le.current!==he||fe.current!==Ae)return;ce(Ne.rules),S(null)}catch{}},[ce]);y.useEffect(()=>{if(v)return;const he=()=>{document.visibilityState!=="hidden"&&ie()};window.addEventListener("focus",he),document.addEventListener("visibilitychange",he);const Ae=window.setInterval(he,3e4);return()=>{window.removeEventListener("focus",he),document.removeEventListener("visibilitychange",he),window.clearInterval(Ae)}},[v,ie]),y.useEffect(()=>{let he=!1;return $.getRecipients().then(Ae=>{if(he)return;const Ne=new Map;for(const Ke of Ae.recipients)Ke.name&&Ne.set(Ke.id,Ke.name);h(Ne)}).catch(Ae=>{he||r(kr(Ae,n("recipientsLoadFailed")),"error")}),()=>{he=!0}},[n,r]);const de=y.useMemo(()=>VC(f.filter(he=>IC(he,N,F)),L,i),[f,N,F,L,i]),C=`${N}|${L}|${F.enabled}|${F.chatScope}|${F.senders}`,{page:Y,pageCount:K,pageItems:me,setPage:te,total:oe}=Zc(de,20,C),ye=()=>{j(""),R(Zf)},ve=M?f.find(he=>he.id===M.id)??M:null,be=()=>{if(f.length>=In.rules){r(n("rulesLimit"),"warning");return}T(null),B(!0)},rt=async(he,Ae)=>{fe.current+=1;const Ne=he.enabled,Ke=(q.current.get(he.id)??0)+1;q.current.set(he.id,Ke),z.current.add(he.id),m(yt=>yt.map(Nt=>Nt.id===he.id?{...Nt,enabled:Ae}:Nt));try{const yt=await $.updateAutoDeleteRule(he.id,{enabled:Ae});if(q.current.get(he.id)!==Ke)return;m(Nt=>Nt.map(we=>we.id===he.id?yt.rule:we))}catch(yt){q.current.get(he.id)===Ke&&(m(Nt=>Nt.map(we=>we.id===he.id?{...we,enabled:Ne}:we)),r(kr(yt,n("toggleFailed")),"error"))}finally{fe.current+=1,q.current.get(he.id)===Ke&&z.current.delete(he.id)}},xt=async he=>{fe.current+=1;try{const Ae=await $.resetAutoDeleteRule(he.id);m(Ne=>Ne.map(Ke=>Ke.id===he.id?Ae.rule:Ke)),r(n("counterReset"),"success")}catch(Ae){r(kr(Ae,n("toggleFailed")),"error")}finally{fe.current+=1}},Ee=async()=>{if(H){fe.current+=1,Z(!0);try{await $.deleteAutoDeleteRule(H.id),m(he=>he.filter(Ae=>Ae.id!==H.id)),se===String(H.id)&&E(""),r(n("ruleDeleted"),"success"),O(null)}catch(he){r(kr(he,n("toggleFailed")),"error")}finally{fe.current+=1,Z(!1)}}},Ie=he=>he.chatScope==="groups"?n("chatsGroups"):he.chatScope==="private"?n("chatsPrivate"):n("chatsAll"),He=he=>he.senders.mode==="everyone"?n("sendersEveryone"):he.senders.list.length===1?n("oneContact"):Ut(n("sendersCount"),{n:he.senders.list.length});return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(xl,{icon:s.jsx(jc,{size:24}),title:n("autoDelete"),description:n("autoDeleteSubtitle"),actions:f.length>0||o==="copies"?s.jsx(ue,{variant:"primary",icon:s.jsx(dl,{size:16}),onClick:be,children:n("newRule")}):void 0}),s.jsx($c,{"aria-label":n("autoDelete"),className:"overflow-x-auto no-scrollbar",value:o,onChange:d,options:[{value:"rules",label:n("rulesTab")},{value:"copies",label:n("copiesTab")}]}),o==="rules"&&s.jsxs("div",{className:"flex flex-col gap-3",children:[!v&&!b&&f.length>0&&s.jsxs(vl,{children:[s.jsx(Be,{type:"search",name:"q",autoComplete:"off",value:N,onChange:he=>j(he.target.value),placeholder:n("searchRules"),"aria-label":n("searchRules"),className:"min-w-48 flex-1"}),s.jsx(Pr,{label:n("sort"),value:L,onChange:_,options:[{value:"newest",label:n("sortNewest")},{value:"name",label:n("sortByName")},{value:"deleted",label:n("sortMostDeleted")},{value:"last",label:n("sortLastDeleted")}]}),s.jsxs(yl,{label:n("filter"),resetLabel:n("reset"),activeCount:KC(F),onReset:()=>R(Zf),children:[s.jsx(kn,{label:n("filterStatus"),name:"ad-status",value:F.enabled,onChange:he=>R(Ae=>({...Ae,enabled:he})),options:[{value:"any",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(kn,{label:n("filterChat"),name:"ad-scope",value:F.chatScope,onChange:he=>R(Ae=>({...Ae,chatScope:he})),options:[{value:"any",label:n("statusAny")},{value:"all",label:n("chatsAll")},{value:"groups",label:n("chatsGroups")},{value:"private",label:n("chatsPrivate")}]}),s.jsx(kn,{label:n("filterSender"),name:"ad-senders",value:F.senders,onChange:he=>R(Ae=>({...Ae,senders:he})),options:[{value:"any",label:n("statusAny")},{value:"everyone",label:n("sendersEveryone")},{value:"selected",label:n("sendersSelected")}]})]})]}),v&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(he=>s.jsxs($e,{className:"flex flex-col gap-3",children:[s.jsx(Gt,{className:"h-5 w-40"}),s.jsx(Gt,{className:"h-6 w-full"}),s.jsx(Gt,{className:"h-8 w-24"})]},he))}),!v&&b&&f.length===0&&s.jsx(mt,{kind:"error",icon:s.jsx(jc,{size:28}),description:b,action:s.jsx(ue,{variant:"secondary",icon:s.jsx(fl,{size:16}),onClick:()=>k(he=>he+1),children:n("retryLoad")})}),!v&&!b&&f.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(jc,{size:28}),title:n("noRulesTitle"),description:n("noRulesBody"),action:s.jsx(ue,{variant:"primary",icon:s.jsx(dl,{size:16}),onClick:be,children:n("newRule")})}),!v&&!b&&f.length>0&&de.length===0&&s.jsx(mt,{kind:"no-results",action:s.jsx(ue,{variant:"secondary",onClick:ye,children:n("clearFilters")})}),!v&&!b&&de.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:me.map(he=>{const Ae=bi(he),Ne=Math.max(0,he.keywords.length-wv);return s.jsxs($e,{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:Ae||"—"}),s.jsx(Kn,{checked:he.enabled,"aria-label":n("ruleEnabled"),onChange:Ke=>void rt(he,Ke)}),s.jsxs(Yn,{label:n("more"),children:[s.jsx(it,{icon:s.jsx(p0,{size:16}),onSelect:()=>{T(he),B(!0)},children:n("edit")}),s.jsx(it,{icon:s.jsx(fl,{size:16}),onSelect:()=>void xt(he),children:n("resetCounter")}),he.keepCopy&&s.jsx(it,{icon:s.jsx(Si,{size:16}),onSelect:()=>{E(String(he.id)),d("copies")},children:n("viewCopies")}),s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>O(he),children:n("delete")})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[he.keywords.slice(0,wv).map(Ke=>s.jsx(Qc,{children:Ke},Ke)),Ne>0&&s.jsx(et,{children:Ut(n("moreKeywords"),{n:Ne})})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(et,{children:n(JC[he.match])}),s.jsx(et,{children:Ie(he)}),s.jsx(et,{children:He(he)})]}),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:G.format(he.deletedCount)}),s.jsx("span",{className:"text-xs text-muted",children:n("deletedLabel")}),s.jsx("span",{className:"ms-auto text-xs text-muted",children:he.lastDeletedAt?s.jsxs(s.Fragment,{children:[n("lastDeleted")," ",s.jsx(Br,{value:he.lastDeletedAt})]}):n("neverDeleted")})]})]},he.id)})}),s.jsx(ki,{page:Y,pageCount:K,total:oe,onPageChange:te})]})]}),o==="copies"&&s.jsx(YC,{rules:f,names:p,ruleId:se,onRuleIdChange:E}),s.jsx(WC,{open:ne,rule:ve,names:p,onClose:()=>B(!1),onSaved:he=>{fe.current+=1,m(Ae=>{const Ne=Ae.findIndex(yt=>yt.id===he.id);if(Ne===-1)return[he,...Ae];const Ke=Ae.slice();return Ke[Ne]=he,Ke}),r(n("ruleSaved"),"success"),B(!1)}}),s.jsx(pl,{isOpen:H!==null,onClose:()=>O(null),onConfirm:()=>void Ee(),title:n("deleteRuleTitle"),description:s.jsx("span",{dir:"auto",children:Ut(n("deleteRuleBody"),{name:H?bi(H):""})}),confirmLabel:n("delete"),cancelLabel:n("cancel"),loading:W})]})},tE=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/;function Ga(n){return n.key??n.name}function I1(n){return`cmd-details-${Ga(n).replace(/[^a-zA-Z0-9_-]+/g,"-")}`}const nE={MEMBERS:"permMembers",ALL:"permMembers",ADMINS_ONLY:"permAdminsOnly",ADMINS_OWNER:"permAdminsOwner",OWNER_ONLY:"permOwnerOnly"},aE={all:"scopeAll",group:"scopeGroup",private:"scopePrivate"};function qr(){const{t:n,language:i}=Ue(),r=p=>{const h=nE[p];return h?n(h):p},o=p=>{const h=aE[p];return h?n(h):p},d=p=>{var h;return((h=p.descriptions)==null?void 0:h[i])||p.description||""},f=p=>{var h;return((h=p.usages)==null?void 0:h[i])||p.usage||""};return{t:n,language:i,permissionLabel:r,scopeLabel:o,describe:d,usageOf:f,usageLines:(p,h)=>f(p).split(`
|
|
547
|
+
`).map(v=>v.trim()).filter(Boolean).map(v=>`${h}${v}`)}}function xh({alias:n,prefix:i,onRemove:r,removeLabel:o}){const{t:d,language:f}=Ue(),m=tE.test(n),p=m!==(f==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-panel-raised px-2 py-0.5 text-[11px] text-muted",children:[s.jsxs("span",{dir:"ltr",className:"font-mono",children:[i,n]}),p&&s.jsx("span",{className:"font-sans text-[9px] font-bold uppercase tracking-wide text-brand-cyan/80",children:m?"AR":"EN"}),r&&s.jsx(Oe,{variant:"ghost",label:o??d("delete"),icon:s.jsx(Rn,{size:14}),onMouseDown:h=>h.preventDefault(),onClick:r})]})}function sE({command:n,prefix:i,onClose:r,onSaved:o}){const{t:d}=Ue(),{toast:f}=Et(),[m,p]=y.useState([]),[h,v]=y.useState(""),[x,b]=y.useState(!1);y.useEffect(()=>{n&&(p(Array.isArray(n.aliases)?[...n.aliases]:[]),v(""),b(!1))},[n]);const S=()=>{const N=h.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(N){if(m.includes(N)){f(d("aliasAlreadyAdded"),"warning");return}p([...m,N]),v("")}},A=N=>{p(m.filter(j=>j!==N))},k=async()=>{if(n){b(!0);try{await $.updateCommand(n.name,{aliases:m}),o(n,m),f(d("savedSuccessfully"),"success"),r()}catch(N){f(N.message,"error")}finally{b(!1)}}};return s.jsx(an,{isOpen:!!n,onClose:r,title:n?s.jsxs(s.Fragment,{children:[d("aliasesFor")," ",s.jsxs("span",{dir:"ltr",className:"font-mono",children:[i,n.name]})]}):d("aliasesFor"),footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:r,children:d("cancel")}),s.jsx(ue,{variant:"primary",onClick:k,loading:x,children:d(x?"saving":"save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsx("p",{className:"text-xs text-muted sm:text-sm",children:d("aliasesHelp")}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"block text-xs font-bold text-muted",children:d("thAliases")}),s.jsx("div",{className:"flex min-h-[42px] flex-wrap items-center gap-2 rounded-xl border border-line bg-panel-raised p-2",children:m.length>0?m.map(N=>s.jsx(xh,{alias:N,prefix:i,removeLabel:d("delete"),onRemove:()=>A(N)},N)):s.jsx("span",{className:"px-1 text-xs text-faint",children:d("noAliases")})})]}),s.jsx(Me,{label:d("addAlias"),htmlFor:"new-alias-input",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(lj,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Be,{id:"new-alias-input",type:"text",value:h,onChange:N=>v(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),S())},placeholder:d("newAliasPlaceholder"),className:"ps-10"})]}),s.jsx(ue,{variant:"secondary",icon:s.jsx(dl,{size:16}),onClick:S,className:"shrink-0",children:d("add")})]})})]})})}function V1({command:n,levels:i,actions:r}){const{t:o,permissionLabel:d}=qr(),f=fn(n.permission);return n.permissionLocked?s.jsxs(x1,{padded:!1,role:"group","aria-label":`${o("thRequiredRole")}: ${n.name}`,className:"flex min-h-11 items-center gap-2.5 px-3 py-3",children:[s.jsx(e0,{size:16,className:"shrink-0 text-muted","aria-hidden":!0}),s.jsx("span",{className:"min-w-0 break-words text-sm text-text-main",children:d(n.permission)})]}):s.jsx(mn,{dirty:f.dirty,saving:f.status==="saving",justSaved:f.status==="saved",error:f.error,onSave:()=>f.save(m=>r.onSavePermission(n,m)),onRevert:f.revert,saveLabel:o("save"),savedLabel:o("saved"),children:s.jsx(dt,{"aria-label":`${o("thRequiredRole")}: ${n.name}`,value:f.value,onChange:m=>f.setValue(m.target.value),children:i.map(m=>s.jsx("option",{value:m,children:d(m)},m))})})}function jr({label:n,children:i}){return s.jsxs("section",{className:"flex min-w-0 flex-col gap-2.5",children:[s.jsx("p",{className:"text-xs font-bold text-muted",children:n}),i]})}function K1({command:n,prefix:i,levels:r,actions:o}){var b;const{t:d,describe:f,scopeLabel:m,permissionLabel:p,usageLines:h}=qr(),v=f(n),x=h(n,i);return s.jsxs("div",{className:"flex flex-col gap-5",children:[v&&s.jsx("p",{dir:"auto",className:"min-w-0 break-words text-sm leading-relaxed text-muted",children:v}),s.jsxs("div",{className:"grid grid-cols-1 gap-x-5 gap-y-5 sm:grid-cols-2",children:[s.jsx(jr,{label:d("thAliases"),children:s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[(b=n.aliases)!=null&&b.length?n.aliases.map(S=>s.jsx(xh,{alias:S,prefix:i},S)):s.jsx("span",{className:"text-xs text-faint",children:d("noAliases")}),s.jsx(Oe,{label:d("editAliases"),icon:s.jsx(Jk,{size:16}),onClick:()=>o.onEditAliases(n)})]})}),s.jsxs(jr,{label:d("thRequiredRole"),children:[s.jsx(V1,{command:n,levels:r,actions:o}),n.permissionLocked&&s.jsx("p",{className:"text-xs text-muted",children:d("permissionLockedReason")})]}),s.jsx(jr,{label:d("thScope"),children:s.jsx("div",{children:s.jsx(et,{tone:"info",children:m(n.chat)})})}),s.jsxs(jr,{label:d("thStatus"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx(et,{tone:n.enabled?"ok":"neutral",children:n.enabled?d("statusEnabled"):d("statusDisabled")}),n.overridden&&s.jsx(et,{tone:"info",children:d("overridden")})]}),s.jsxs("p",{className:"text-xs text-muted",children:[d("defaultLabel"),": ",p(n.defaultPermission)]})]})]}),x.length>0&&s.jsx(jr,{label:d("usage"),children:s.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:x.map(S=>s.jsx("li",{children:s.jsxs(x1,{padded:!1,className:"flex min-h-11 items-center gap-2 px-3 py-2",children:[s.jsx("code",{dir:"ltr",title:S,className:"min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-muted",children:S}),s.jsx(Oe,{label:d("copyCommand"),variant:"ghost",icon:s.jsx(Rb,{size:16}),onClick:()=>o.onCopy(S)})]})},S))})})]})}function lE({commands:n,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:m}=Ue();return s.jsx("ul",{className:"divide-y divide-line/50",children:n.map(p=>{const h=Ga(p),v=o===h,x=I1(p);return s.jsxs("li",{children:[s.jsxs("div",{className:"flex min-h-12 items-center gap-2 px-4",children:[s.jsxs("span",{dir:"ltr",className:"min-w-0 flex-1 truncate font-mono text-sm font-bold text-brand-cyan",children:[i,p.name]}),s.jsx(Kn,{checked:p.enabled,"aria-label":`${m("thStatus")}: ${i}${p.name}`,onChange:b=>f.onToggleEnabled(p,b)}),s.jsx(Oe,{size:"md",variant:"ghost",label:m(v?"hideDetails":"details"),"aria-expanded":v,"aria-controls":x,icon:s.jsx(ul,{size:18,className:qe("transition-transform",v&&"rotate-180")}),onClick:()=>d(h)})]}),v&&s.jsx("div",{id:x,className:"border-t border-line/40 bg-panel-raised/40 px-4 py-4",children:s.jsx(K1,{command:p,prefix:i,levels:r,actions:f})})]},h)})})}const Sv=2;function iE({command:n,prefix:i}){const r=n.aliases||[];if(r.length===0)return s.jsx("span",{className:"text-xs text-faint",children:"—"});const o=r.length-Sv;return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[r.slice(0,Sv).map(d=>s.jsx(xh,{alias:d,prefix:i},d)),o>0&&s.jsxs(et,{tone:"neutral",children:["+",o]})]})}function rE({commands:n,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:m}=Ue(),{describe:p}=qr();return s.jsx("div",{className:"overflow-hidden",children:s.jsxs("table",{className:"w-full table-fixed border-collapse 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:"w-[26%] px-3 py-3 text-start",children:m("thCommand")}),s.jsx("th",{className:"px-3 py-3 text-start",children:m("thDescription")}),s.jsx("th",{className:"hidden px-3 py-3 text-start lg:table-cell lg:w-[16%]",children:m("thAliases")}),s.jsx("th",{className:"hidden px-3 py-3 text-start sm:table-cell sm:w-[26%] md:table-cell",children:m("thRequiredRole")}),s.jsx("th",{className:"w-[72px] px-3 py-3 text-center",children:m("thStatus")}),s.jsx("th",{className:"w-14 px-3 py-3 text-end",children:s.jsx("span",{className:"sr-only",children:m("details")})})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:n.map(h=>{const v=Ga(h),x=o===v,b=I1(h);return s.jsxs(y.Fragment,{children:[s.jsxs("tr",{className:"hover:bg-panel-hover/40",children:[s.jsx("td",{className:"min-w-0 px-3 py-2.5",children:s.jsxs("span",{dir:"ltr",className:"block truncate font-mono font-bold text-brand-cyan",children:[i,h.name]})}),s.jsx("td",{className:"min-w-0 px-3 py-2.5",children:s.jsx(ln,{as:"p",lines:1,className:"text-xs text-text-main md:text-sm",children:p(h)})}),s.jsx("td",{className:"hidden min-w-0 px-3 py-2.5 lg:table-cell",children:s.jsx(iE,{command:h,prefix:i})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(V1,{command:h,levels:r,actions:f})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Kn,{checked:h.enabled,"aria-label":`${m("thStatus")}: ${i}${h.name}`,onChange:S=>f.onToggleEnabled(h,S)})})}),s.jsx("td",{className:"px-3 py-2.5 text-end",children:s.jsx(Oe,{size:"md",variant:"ghost",label:m(x?"hideDetails":"details"),"aria-expanded":x,"aria-controls":b,icon:s.jsx(ul,{size:18,className:qe("transition-transform",x&&"rotate-180")}),onClick:()=>d(v)})})]}),x&&s.jsx("tr",{className:"bg-panel-raised/40",children:s.jsx("td",{colSpan:6,className:"border-t border-line/40 px-3 py-4",children:s.jsx(K1,{command:h,prefix:i,levels:r,actions:f})})})]},v)})})]})})}const kv={status:"all",scope:"all",permission:"all"};function oE(n){let i=0;return n.status!=="all"&&(i+=1),n.scope!=="all"&&(i+=1),n.permission!=="all"&&(i+=1),i}function cE(n,i,r){var o,d,f,m;return!(i&&![n.name,...n.aliases||[],n.description,(o=n.descriptions)==null?void 0:o.en,(d=n.descriptions)==null?void 0:d.ar,n.usage,(f=n.usages)==null?void 0:f.en,(m=n.usages)==null?void 0:m.ar].filter(Boolean).join(" ").toLowerCase().includes(i)||r.status==="on"&&!n.enabled||r.status==="off"&&n.enabled||r.scope==="allChats"&&n.chat!=="all"||r.scope==="groups"&&n.chat!=="group"||r.scope==="private"&&n.chat!=="private"||r.scope==="groupSub"&&n.category!=="group"||r.scope==="general"&&n.category==="group"||r.permission==="overridden"&&!n.overridden||r.permission==="locked"&&!n.permissionLocked||r.permission!=="all"&&r.permission!=="overridden"&&r.permission!=="locked"&&n.permission!==r.permission)}function uE(n,i,r){const o=(f,m)=>r.compare(f.name,m.name),d=[...n];return i==="status"?d.sort((f,m)=>f.enabled===m.enabled?o(f,m):f.enabled?-1:1):d.sort(o),d}const dE=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],fE=["s1","s2","s3","s4","s5"],mE=()=>{const{t:n,language:i}=Ue(),{toast:r}=Et(),{permissionLabel:o}=qr(),[d,f]=y.useState([]),[m,p]=y.useState(dE),[h,v]=y.useState("!"),[x,b]=y.useState(!1),[S,A]=y.useState("!"),[k,N]=y.useState(""),[j,L]=y.useState(kv),[_,F]=y.useState("name"),[R,ne]=y.useState(!0),[B,M]=y.useState(null),[T,H]=y.useState(null),[O,W]=y.useState(null),Z=y.useCallback(async()=>{ne(!0);try{const K=await $.getCommands();K!=null&&K.commands&&f(K.commands),K!=null&&K.prefix&&(v(K.prefix),A(K.prefix)),Array.isArray(K==null?void 0:K.levels)&&K.levels.length&&p(K.levels),M(null)}catch(K){M((K==null?void 0:K.message)||n("loadError")),r(K.message,"error")}finally{ne(!1)}},[n,r]);y.useEffect(()=>{Z()},[Z]);const se=async()=>{const K=S.trim();if(!K||K.length>3){r(n("prefixValidation"),"error");return}try{await $.updatePrefix(K),v(K),b(!1),r(`${n("prefixUpdated")} (${K})`,"success")}catch(me){r(me.message,"error")}},E=async(K,me)=>{f(te=>te.map(oe=>Ga(oe)===Ga(K)?{...oe,enabled:me,overridden:!0}:oe));try{await $.updateCommand(K.name,{enabled:me}),r(n(me?"commandEnabled":"commandDisabled").replace("{name}",K.name),"success")}catch(te){r(te.message,"error"),Z()}},z=async(K,me)=>{await $.updateCommand(K.name,{permission:me}),f(te=>te.map(oe=>Ga(oe)===Ga(K)?{...oe,permission:me,overridden:!0}:oe))},q=async K=>{try{await navigator.clipboard.writeText(K),r(n("copied"),"success")}catch{r(n("copyFailed"),"error")}},le=K=>{H(me=>me===K?null:K)},pe=(K,me)=>{f(te=>te.map(oe=>Ga(oe)===Ga(K)?{...oe,aliases:me}:oe))},fe=()=>{N(""),L(kv)},G=y.useMemo(()=>new Intl.Collator(i),[i]),ce=k.trim().toLowerCase(),ie=y.useMemo(()=>uE(d.filter(K=>cE(K,ce,j)),_,G),[d,ce,j,_,G]),de=oE(j),C=ce.length>0||de>0,Y={onToggleEnabled:(K,me)=>void E(K,me),onEditAliases:K=>W(K),onSavePermission:z,onCopy:K=>void q(K)};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(xl,{icon:s.jsx(ml,{size:20}),title:n("commands"),description:n("commandsSub"),actions:s.jsxs("div",{className:"inline-flex flex-wrap items-center gap-2 rounded-xl border border-line bg-panel-raised px-3 py-1.5",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted",children:[n("activePrefix"),":"]}),x?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Be,{type:"text",technical:!0,maxLength:3,value:S,onChange:K=>A(K.target.value),className:"w-14 text-center font-mono",onKeyDown:K=>{K.key==="Enter"&&se(),K.key==="Escape"&&b(!1)}}),s.jsx(ue,{variant:"primary",size:"sm",onClick:se,children:n("save")}),s.jsx(ue,{variant:"secondary",size:"sm",onClick:()=>b(!1),children:n("cancel")})]}):s.jsx(ue,{variant:"ghost",size:"sm",title:n("editPrefixHint"),onClick:()=>{A(h),b(!0)},children:s.jsx("span",{dir:"ltr",className:"font-mono",children:h})})]})}),s.jsxs("div",{className:"flex flex-col gap-3","data-tour":"commands-list",children:[s.jsxs(vl,{children:[s.jsxs("div",{className:"relative min-w-48 flex-1",children:[s.jsx(eh,{size:18,className:"pointer-events-none absolute start-3.5 top-3 text-muted"}),s.jsx(Be,{type:"search",value:k,onChange:K=>N(K.target.value),placeholder:n("searchPlaceholder"),"aria-label":n("searchPlaceholder"),className:"ps-10"})]}),s.jsx(Pr,{label:n("sort"),value:_,onChange:F,options:[{value:"name",label:n("sortByName")},{value:"status",label:n("sortStatus")}]}),s.jsxs(yl,{label:n("filter"),resetLabel:n("clearFilters"),activeCount:de,onReset:fe,children:[s.jsx(kn,{label:n("filterStatus"),name:"cmd-status",value:j.status,onChange:K=>L(me=>({...me,status:K})),options:[{value:"all",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(kn,{label:n("filterScope"),name:"cmd-scope",value:j.scope,onChange:K=>L(me=>({...me,scope:K})),options:[{value:"all",label:n("statusAny")},{value:"allChats",label:n("scopeAllChats")},{value:"groups",label:n("scopeGroupsOnly")},{value:"private",label:n("scopePrivateOnly")},{value:"groupSub",label:n("scopeGroupSub")},{value:"general",label:n("scopeGeneral")}]}),s.jsx(kn,{label:n("filterPermission"),name:"cmd-permission",value:j.permission,onChange:K=>L(me=>({...me,permission:K})),options:[{value:"all",label:n("statusAny")},...m.map(K=>({value:K,label:o(K)})),{value:"overridden",label:n("overriddenOnly")},{value:"locked",label:n("lockedOnly")}]})]})]}),!R&&!B&&s.jsx("p",{"aria-live":"polite",className:"text-xs text-muted",children:Ut(n("resultCountOf"),{n:ie.length,total:d.length})})]}),R?s.jsx($e,{padded:!1,className:"overflow-hidden",children:s.jsx("div",{className:"divide-y divide-line/40","aria-busy":"true",children:fE.map(K=>s.jsxs("div",{className:"flex min-h-12 items-center gap-3 px-4 py-2.5",children:[s.jsx(Gt,{className:"h-4 w-28"}),s.jsx(Gt,{className:"ms-auto h-4 w-14"}),s.jsx(Gt,{className:"h-8 w-10"})]},K))})}):B&&d.length===0?s.jsx(mt,{kind:"error",description:B,action:s.jsx(ue,{variant:"primary",onClick:()=>void Z(),children:n("retryLoad")})}):d.length===0?s.jsx(mt,{kind:"empty"}):ie.length===0?s.jsx(mt,{kind:"no-results",description:n("noMatchingCommands"),action:C?s.jsx(ue,{variant:"secondary",onClick:fe,children:n("clearFilters")}):void 0}):s.jsxs($e,{padded:!1,className:"overflow-hidden",children:[s.jsx("div",{className:"md:hidden",children:s.jsx(lE,{commands:ie,prefix:h,levels:m,expanded:T,onToggleDetails:le,actions:Y})}),s.jsx("div",{className:"hidden md:block",children:s.jsx(rE,{commands:ie,prefix:h,levels:m,expanded:T,onToggleDetails:le,actions:Y})})]}),s.jsx(sE,{command:O,prefix:h,onClose:()=>W(null),onSaved:pe})]})};var mi={},Wf,jv;function hE(){return jv||(jv=1,Wf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Wf}var Jf={},Ns={},Nv;function bl(){if(Nv)return Ns;Nv=1;let n;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 Ns.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},Ns.getSymbolTotalCodewords=function(o){return i[o]},Ns.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},Ns.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');n=o},Ns.isKanjiModeEnabled=function(){return typeof n<"u"},Ns.toSJIS=function(o){return n(o)},Ns}var em={},Cv;function yh(){return Cv||(Cv=1,(function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.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 n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+r)}}n.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},n.from=function(o,d){if(n.isValid(o))return o;try{return i(o)}catch{return d}}})(em)),em}var tm,Ev;function pE(){if(Ev)return tm;Ev=1;function n(){this.buffer=[],this.length=0}return n.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++}},tm=n,tm}var nm,Av;function gE(){if(Av)return nm;Av=1;function n(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 n.prototype.set=function(i,r,o,d){const f=i*this.size+r;this.data[f]=o,d&&(this.reservedBit[f]=!0)},n.prototype.get=function(i,r){return this.data[i*this.size+r]},n.prototype.xor=function(i,r,o){this.data[i*this.size+r]^=o},n.prototype.isReserved=function(i,r){return this.reservedBit[i*this.size+r]},nm=n,nm}var am={},Tv;function xE(){return Tv||(Tv=1,(function(n){const i=bl().getSymbolSize;n.getRowColCoords=function(o){if(o===1)return[];const d=Math.floor(o/7)+2,f=i(o),m=f===145?26:Math.ceil((f-13)/(2*d-2))*2,p=[f-7];for(let h=1;h<d-1;h++)p[h]=p[h-1]-m;return p.push(6),p.reverse()},n.getPositions=function(o){const d=[],f=n.getRowColCoords(o),m=f.length;for(let p=0;p<m;p++)for(let h=0;h<m;h++)p===0&&h===0||p===0&&h===m-1||p===m-1&&h===0||d.push([f[p],f[h]]);return d}})(am)),am}var sm={},_v;function yE(){if(_v)return sm;_v=1;const n=bl().getSymbolSize,i=7;return sm.getPositions=function(o){const d=n(o);return[[0,0],[d-i,0],[0,d-i]]},sm}var lm={},Dv;function vE(){return Dv||(Dv=1,(function(n){n.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};n.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},n.from=function(d){return n.isValid(d)?parseInt(d,10):void 0},n.getPenaltyN1=function(d){const f=d.size;let m=0,p=0,h=0,v=null,x=null;for(let b=0;b<f;b++){p=h=0,v=x=null;for(let S=0;S<f;S++){let A=d.get(b,S);A===v?p++:(p>=5&&(m+=i.N1+(p-5)),v=A,p=1),A=d.get(S,b),A===x?h++:(h>=5&&(m+=i.N1+(h-5)),x=A,h=1)}p>=5&&(m+=i.N1+(p-5)),h>=5&&(m+=i.N1+(h-5))}return m},n.getPenaltyN2=function(d){const f=d.size;let m=0;for(let p=0;p<f-1;p++)for(let h=0;h<f-1;h++){const v=d.get(p,h)+d.get(p,h+1)+d.get(p+1,h)+d.get(p+1,h+1);(v===4||v===0)&&m++}return m*i.N2},n.getPenaltyN3=function(d){const f=d.size;let m=0,p=0,h=0;for(let v=0;v<f;v++){p=h=0;for(let x=0;x<f;x++)p=p<<1&2047|d.get(v,x),x>=10&&(p===1488||p===93)&&m++,h=h<<1&2047|d.get(x,v),x>=10&&(h===1488||h===93)&&m++}return m*i.N3},n.getPenaltyN4=function(d){let f=0;const m=d.data.length;for(let h=0;h<m;h++)f+=d.data[h];return Math.abs(Math.ceil(f*100/m/5)-10)*i.N4};function r(o,d,f){switch(o){case n.Patterns.PATTERN000:return(d+f)%2===0;case n.Patterns.PATTERN001:return d%2===0;case n.Patterns.PATTERN010:return f%3===0;case n.Patterns.PATTERN011:return(d+f)%3===0;case n.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case n.Patterns.PATTERN101:return d*f%2+d*f%3===0;case n.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case n.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}n.applyMask=function(d,f){const m=f.size;for(let p=0;p<m;p++)for(let h=0;h<m;h++)f.isReserved(h,p)||f.xor(h,p,r(d,h,p))},n.getBestMask=function(d,f){const m=Object.keys(n.Patterns).length;let p=0,h=1/0;for(let v=0;v<m;v++){f(v),n.applyMask(v,d);const x=n.getPenaltyN1(d)+n.getPenaltyN2(d)+n.getPenaltyN3(d)+n.getPenaltyN4(d);n.applyMask(v,d),x<h&&(h=x,p=v)}return p}})(lm)),lm}var wc={},Mv;function Y1(){if(Mv)return wc;Mv=1;const n=yh(),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 wc.getBlocksCount=function(d,f){switch(f){case n.L:return i[(d-1)*4+0];case n.M:return i[(d-1)*4+1];case n.Q:return i[(d-1)*4+2];case n.H:return i[(d-1)*4+3];default:return}},wc.getTotalCodewordsCount=function(d,f){switch(f){case n.L:return r[(d-1)*4+0];case n.M:return r[(d-1)*4+1];case n.Q:return r[(d-1)*4+2];case n.H:return r[(d-1)*4+3];default:return}},wc}var im={},Nr={},Rv;function bE(){if(Rv)return Nr;Rv=1;const n=new Uint8Array(512),i=new Uint8Array(256);return(function(){let o=1;for(let d=0;d<255;d++)n[d]=o,i[o]=d,o<<=1,o&256&&(o^=285);for(let d=255;d<512;d++)n[d]=n[d-255]})(),Nr.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},Nr.exp=function(o){return n[o]},Nr.mul=function(o,d){return o===0||d===0?0:n[i[o]+i[d]]},Nr}var zv;function wE(){return zv||(zv=1,(function(n){const i=bE();n.mul=function(o,d){const f=new Uint8Array(o.length+d.length-1);for(let m=0;m<o.length;m++)for(let p=0;p<d.length;p++)f[m+p]^=i.mul(o[m],d[p]);return f},n.mod=function(o,d){let f=new Uint8Array(o);for(;f.length-d.length>=0;){const m=f[0];for(let h=0;h<d.length;h++)f[h]^=i.mul(d[h],m);let p=0;for(;p<f.length&&f[p]===0;)p++;f=f.slice(p)}return f},n.generateECPolynomial=function(o){let d=new Uint8Array([1]);for(let f=0;f<o;f++)d=n.mul(d,new Uint8Array([1,i.exp(f)]));return d}})(im)),im}var rm,Lv;function SE(){if(Lv)return rm;Lv=1;const n=wE();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=n.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=n.mod(d,this.genPoly),m=this.degree-f.length;if(m>0){const p=new Uint8Array(this.degree);return p.set(f,m),p}return f},rm=i,rm}var om={},cm={},um={},Ov;function Q1(){return Ov||(Ov=1,um.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),um}var ya={},Bv;function X1(){if(Bv)return ya;Bv=1;const n="[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
|
|
548
|
+
]))+`;ya.KANJI=new RegExp(r,"g"),ya.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ya.BYTE=new RegExp(o,"g"),ya.NUMERIC=new RegExp(n,"g"),ya.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+r+"$"),f=new RegExp("^"+n+"$"),m=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ya.testKanji=function(h){return d.test(h)},ya.testNumeric=function(h){return f.test(h)},ya.testAlphanumeric=function(h){return m.test(h)},ya}var Uv;function wl(){return Uv||(Uv=1,(function(n){const i=Q1(),r=X1();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(f,m){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!i.isValid(m))throw new Error("Invalid version: "+m);return m>=1&&m<10?f.ccBits[0]:m<27?f.ccBits[1]:f.ccBits[2]},n.getBestModeForData=function(f){return r.testNumeric(f)?n.NUMERIC:r.testAlphanumeric(f)?n.ALPHANUMERIC:r.testKanji(f)?n.KANJI:n.BYTE},n.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},n.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 n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+d)}}n.from=function(f,m){if(n.isValid(f))return f;try{return o(f)}catch{return m}}})(cm)),cm}var Hv;function kE(){return Hv||(Hv=1,(function(n){const i=bl(),r=Y1(),o=yh(),d=wl(),f=Q1(),m=7973,p=i.getBCHDigit(m);function h(S,A,k){for(let N=1;N<=40;N++)if(A<=n.getCapacity(N,k,S))return N}function v(S,A){return d.getCharCountIndicator(S,A)+4}function x(S,A){let k=0;return S.forEach(function(N){const j=v(N.mode,A);k+=j+N.getBitsLength()}),k}function b(S,A){for(let k=1;k<=40;k++)if(x(S,k)<=n.getCapacity(k,A,d.MIXED))return k}n.from=function(A,k){return f.isValid(A)?parseInt(A,10):k},n.getCapacity=function(A,k,N){if(!f.isValid(A))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=d.BYTE);const j=i.getSymbolTotalCodewords(A),L=r.getTotalCodewordsCount(A,k),_=(j-L)*8;if(N===d.MIXED)return _;const F=_-v(N,A);switch(N){case d.NUMERIC:return Math.floor(F/10*3);case d.ALPHANUMERIC:return Math.floor(F/11*2);case d.KANJI:return Math.floor(F/13);case d.BYTE:default:return Math.floor(F/8)}},n.getBestVersionForData=function(A,k){let N;const j=o.from(k,o.M);if(Array.isArray(A)){if(A.length>1)return b(A,j);if(A.length===0)return 1;N=A[0]}else N=A;return h(N.mode,N.getLength(),j)},n.getEncodedBits=function(A){if(!f.isValid(A)||A<7)throw new Error("Invalid QR Code version");let k=A<<12;for(;i.getBCHDigit(k)-p>=0;)k^=m<<i.getBCHDigit(k)-p;return A<<12|k}})(om)),om}var dm={},Pv;function jE(){if(Pv)return dm;Pv=1;const n=bl(),i=1335,r=21522,o=n.getBCHDigit(i);return dm.getEncodedBits=function(f,m){const p=f.bit<<3|m;let h=p<<10;for(;n.getBCHDigit(h)-o>=0;)h^=i<<n.getBCHDigit(h)-o;return(p<<10|h)^r},dm}var fm={},mm,qv;function NE(){if(qv)return mm;qv=1;const n=wl();function i(r){this.mode=n.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,m;for(d=0;d+3<=this.data.length;d+=3)f=this.data.substr(d,3),m=parseInt(f,10),o.put(m,10);const p=this.data.length-d;p>0&&(f=this.data.substr(d),m=parseInt(f,10),o.put(m,p*3+1))},mm=i,mm}var hm,Fv;function CE(){if(Fv)return hm;Fv=1;const n=wl(),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=n.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 m=i.indexOf(this.data[f])*45;m+=i.indexOf(this.data[f+1]),d.put(m,11)}this.data.length%2&&d.put(i.indexOf(this.data[f]),6)},hm=r,hm}var pm,Gv;function EE(){if(Gv)return pm;Gv=1;const n=wl();function i(r){this.mode=n.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)},pm=i,pm}var gm,Iv;function AE(){if(Iv)return gm;Iv=1;const n=wl(),i=bl();function r(o){this.mode=n.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]+`
|
|
549
|
+
Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},gm=r,gm}var xm={exports:{}},Vv;function TE(){return Vv||(Vv=1,(function(n){var i={single_source_shortest_paths:function(r,o,d){var f={},m={};m[o]=0;var p=i.PriorityQueue.make();p.push(o,0);for(var h,v,x,b,S,A,k,N,j;!p.empty();){h=p.pop(),v=h.value,b=h.cost,S=r[v]||{};for(x in S)S.hasOwnProperty(x)&&(A=S[x],k=b+A,N=m[x],j=typeof m[x]>"u",(j||N>k)&&(m[x]=k,p.push(x,k),f[x]=v))}if(typeof d<"u"&&typeof m[d]>"u"){var L=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(L)}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}}};n.exports=i})(xm)),xm.exports}var Kv;function _E(){return Kv||(Kv=1,(function(n){const i=wl(),r=NE(),o=CE(),d=EE(),f=AE(),m=X1(),p=bl(),h=TE();function v(L){return unescape(encodeURIComponent(L)).length}function x(L,_,F){const R=[];let ne;for(;(ne=L.exec(F))!==null;)R.push({data:ne[0],index:ne.index,mode:_,length:ne[0].length});return R}function b(L){const _=x(m.NUMERIC,i.NUMERIC,L),F=x(m.ALPHANUMERIC,i.ALPHANUMERIC,L);let R,ne;return p.isKanjiModeEnabled()?(R=x(m.BYTE,i.BYTE,L),ne=x(m.KANJI,i.KANJI,L)):(R=x(m.BYTE_KANJI,i.BYTE,L),ne=[]),_.concat(F,R,ne).sort(function(M,T){return M.index-T.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function S(L,_){switch(_){case i.NUMERIC:return r.getBitsLength(L);case i.ALPHANUMERIC:return o.getBitsLength(L);case i.KANJI:return f.getBitsLength(L);case i.BYTE:return d.getBitsLength(L)}}function A(L){return L.reduce(function(_,F){const R=_.length-1>=0?_[_.length-1]:null;return R&&R.mode===F.mode?(_[_.length-1].data+=F.data,_):(_.push(F),_)},[])}function k(L){const _=[];for(let F=0;F<L.length;F++){const R=L[F];switch(R.mode){case i.NUMERIC:_.push([R,{data:R.data,mode:i.ALPHANUMERIC,length:R.length},{data:R.data,mode:i.BYTE,length:R.length}]);break;case i.ALPHANUMERIC:_.push([R,{data:R.data,mode:i.BYTE,length:R.length}]);break;case i.KANJI:_.push([R,{data:R.data,mode:i.BYTE,length:v(R.data)}]);break;case i.BYTE:_.push([{data:R.data,mode:i.BYTE,length:v(R.data)}])}}return _}function N(L,_){const F={},R={start:{}};let ne=["start"];for(let B=0;B<L.length;B++){const M=L[B],T=[];for(let H=0;H<M.length;H++){const O=M[H],W=""+B+H;T.push(W),F[W]={node:O,lastCount:0},R[W]={};for(let Z=0;Z<ne.length;Z++){const se=ne[Z];F[se]&&F[se].node.mode===O.mode?(R[se][W]=S(F[se].lastCount+O.length,O.mode)-S(F[se].lastCount,O.mode),F[se].lastCount+=O.length):(F[se]&&(F[se].lastCount=O.length),R[se][W]=S(O.length,O.mode)+4+i.getCharCountIndicator(O.mode,_))}}ne=T}for(let B=0;B<ne.length;B++)R[ne[B]].end=0;return{map:R,table:F}}function j(L,_){let F;const R=i.getBestModeForData(L);if(F=i.from(_,R),F!==i.BYTE&&F.bit<R.bit)throw new Error('"'+L+'" cannot be encoded with mode '+i.toString(F)+`.
|
|
550
|
+
Suggested mode is: `+i.toString(R));switch(F===i.KANJI&&!p.isKanjiModeEnabled()&&(F=i.BYTE),F){case i.NUMERIC:return new r(L);case i.ALPHANUMERIC:return new o(L);case i.KANJI:return new f(L);case i.BYTE:return new d(L)}}n.fromArray=function(_){return _.reduce(function(F,R){return typeof R=="string"?F.push(j(R,null)):R.data&&F.push(j(R.data,R.mode)),F},[])},n.fromString=function(_,F){const R=b(_,p.isKanjiModeEnabled()),ne=k(R),B=N(ne,F),M=h.find_path(B.map,"start","end"),T=[];for(let H=1;H<M.length-1;H++)T.push(B.table[M[H]].node);return n.fromArray(A(T))},n.rawSplit=function(_){return n.fromArray(b(_,p.isKanjiModeEnabled()))}})(fm)),fm}var Yv;function DE(){if(Yv)return Jf;Yv=1;const n=bl(),i=yh(),r=pE(),o=gE(),d=xE(),f=yE(),m=vE(),p=Y1(),h=SE(),v=kE(),x=jE(),b=wl(),S=_E();function A(B,M){const T=B.size,H=f.getPositions(M);for(let O=0;O<H.length;O++){const W=H[O][0],Z=H[O][1];for(let se=-1;se<=7;se++)if(!(W+se<=-1||T<=W+se))for(let E=-1;E<=7;E++)Z+E<=-1||T<=Z+E||(se>=0&&se<=6&&(E===0||E===6)||E>=0&&E<=6&&(se===0||se===6)||se>=2&&se<=4&&E>=2&&E<=4?B.set(W+se,Z+E,!0,!0):B.set(W+se,Z+E,!1,!0))}}function k(B){const M=B.size;for(let T=8;T<M-8;T++){const H=T%2===0;B.set(T,6,H,!0),B.set(6,T,H,!0)}}function N(B,M){const T=d.getPositions(M);for(let H=0;H<T.length;H++){const O=T[H][0],W=T[H][1];for(let Z=-2;Z<=2;Z++)for(let se=-2;se<=2;se++)Z===-2||Z===2||se===-2||se===2||Z===0&&se===0?B.set(O+Z,W+se,!0,!0):B.set(O+Z,W+se,!1,!0)}}function j(B,M){const T=B.size,H=v.getEncodedBits(M);let O,W,Z;for(let se=0;se<18;se++)O=Math.floor(se/3),W=se%3+T-8-3,Z=(H>>se&1)===1,B.set(O,W,Z,!0),B.set(W,O,Z,!0)}function L(B,M,T){const H=B.size,O=x.getEncodedBits(M,T);let W,Z;for(W=0;W<15;W++)Z=(O>>W&1)===1,W<6?B.set(W,8,Z,!0):W<8?B.set(W+1,8,Z,!0):B.set(H-15+W,8,Z,!0),W<8?B.set(8,H-W-1,Z,!0):W<9?B.set(8,15-W-1+1,Z,!0):B.set(8,15-W-1,Z,!0);B.set(H-8,8,1,!0)}function _(B,M){const T=B.size;let H=-1,O=T-1,W=7,Z=0;for(let se=T-1;se>0;se-=2)for(se===6&&se--;;){for(let E=0;E<2;E++)if(!B.isReserved(O,se-E)){let z=!1;Z<M.length&&(z=(M[Z]>>>W&1)===1),B.set(O,se-E,z),W--,W===-1&&(Z++,W=7)}if(O+=H,O<0||T<=O){O-=H,H=-H;break}}}function F(B,M,T){const H=new r;T.forEach(function(E){H.put(E.mode.bit,4),H.put(E.getLength(),b.getCharCountIndicator(E.mode,B)),E.write(H)});const O=n.getSymbolTotalCodewords(B),W=p.getTotalCodewordsCount(B,M),Z=(O-W)*8;for(H.getLengthInBits()+4<=Z&&H.put(0,4);H.getLengthInBits()%8!==0;)H.putBit(0);const se=(Z-H.getLengthInBits())/8;for(let E=0;E<se;E++)H.put(E%2?17:236,8);return R(H,B,M)}function R(B,M,T){const H=n.getSymbolTotalCodewords(M),O=p.getTotalCodewordsCount(M,T),W=H-O,Z=p.getBlocksCount(M,T),se=H%Z,E=Z-se,z=Math.floor(H/Z),q=Math.floor(W/Z),le=q+1,pe=z-q,fe=new h(pe);let G=0;const ce=new Array(Z),ie=new Array(Z);let de=0;const C=new Uint8Array(B.buffer);for(let oe=0;oe<Z;oe++){const ye=oe<E?q:le;ce[oe]=C.slice(G,G+ye),ie[oe]=fe.encode(ce[oe]),G+=ye,de=Math.max(de,ye)}const Y=new Uint8Array(H);let K=0,me,te;for(me=0;me<de;me++)for(te=0;te<Z;te++)me<ce[te].length&&(Y[K++]=ce[te][me]);for(me=0;me<pe;me++)for(te=0;te<Z;te++)Y[K++]=ie[te][me];return Y}function ne(B,M,T,H){let O;if(Array.isArray(B))O=S.fromArray(B);else if(typeof B=="string"){let z=M;if(!z){const q=S.rawSplit(B);z=v.getBestVersionForData(q,T)}O=S.fromString(B,z||40)}else throw new Error("Invalid data");const W=v.getBestVersionForData(O,T);if(!W)throw new Error("The amount of data is too big to be stored in a QR Code");if(!M)M=W;else if(M<W)throw new Error(`
|
|
551
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
552
|
+
Minimum version required to store current data is: `+W+`.
|
|
553
|
+
`);const Z=F(M,T,O),se=n.getSymbolSize(M),E=new o(se);return A(E,M),k(E),N(E,M),L(E,T,0),M>=7&&j(E,M),_(E,Z),isNaN(H)&&(H=m.getBestMask(E,L.bind(null,E,T))),m.applyMask(H,E),L(E,T,H),{modules:E,version:M,errorCorrectionLevel:T,maskPattern:H,segments:O}}return Jf.create=function(M,T){if(typeof M>"u"||M==="")throw new Error("No input text");let H=i.M,O,W;return typeof T<"u"&&(H=i.from(T.errorCorrectionLevel,i.M),O=v.from(T.version),W=m.from(T.maskPattern),T.toSJISFunc&&n.setToSJISFunction(T.toSJISFunc)),ne(M,O,H,W)},Jf}var ym={},vm={},Qv;function Z1(){return Qv||(Qv=1,(function(n){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("")}}n.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,m=o.scale||4;return{width:f,scale:f?4:m,margin:d,color:{dark:i(o.color.dark||"#000000ff"),light:i(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},n.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},n.getImageWidth=function(o,d){const f=n.getScale(o,d);return Math.floor((o+d.margin*2)*f)},n.qrToImageData=function(o,d,f){const m=d.modules.size,p=d.modules.data,h=n.getScale(m,f),v=Math.floor((m+f.margin*2)*h),x=f.margin*h,b=[f.color.light,f.color.dark];for(let S=0;S<v;S++)for(let A=0;A<v;A++){let k=(S*v+A)*4,N=f.color.light;if(S>=x&&A>=x&&S<v-x&&A<v-x){const j=Math.floor((S-x)/h),L=Math.floor((A-x)/h);N=b[p[j*m+L]?1:0]}o[k++]=N.r,o[k++]=N.g,o[k++]=N.b,o[k]=N.a}}})(vm)),vm}var Xv;function ME(){return Xv||(Xv=1,(function(n){const i=Z1();function r(d,f,m){d.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=m,f.width=m,f.style.height=m+"px",f.style.width=m+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}n.render=function(f,m,p){let h=p,v=m;typeof h>"u"&&(!m||!m.getContext)&&(h=m,m=void 0),m||(v=o()),h=i.getOptions(h);const x=i.getImageWidth(f.modules.size,h),b=v.getContext("2d"),S=b.createImageData(x,x);return i.qrToImageData(S.data,f,h),r(b,v,x),b.putImageData(S,0,0),v},n.renderToDataURL=function(f,m,p){let h=p;typeof h>"u"&&(!m||!m.getContext)&&(h=m,m=void 0),h||(h={});const v=n.render(f,m,h),x=h.type||"image/png",b=h.rendererOpts||{};return v.toDataURL(x,b.quality)}})(ym)),ym}var bm={},Zv;function RE(){if(Zv)return bm;Zv=1;const n=Z1();function i(d,f){const m=d.a/255,p=f+'="'+d.hex+'"';return m<1?p+" "+f+'-opacity="'+m.toFixed(2).slice(1)+'"':p}function r(d,f,m){let p=d+f;return typeof m<"u"&&(p+=" "+m),p}function o(d,f,m){let p="",h=0,v=!1,x=0;for(let b=0;b<d.length;b++){const S=Math.floor(b%f),A=Math.floor(b/f);!S&&!v&&(v=!0),d[b]?(x++,b>0&&S>0&&d[b-1]||(p+=v?r("M",S+m,.5+A+m):r("m",h,0),h=0,v=!1),S+1<f&&d[b+1]||(p+=r("h",x),x=0)):h++}return p}return bm.render=function(f,m,p){const h=n.getOptions(m),v=f.modules.size,x=f.modules.data,b=v+h.margin*2,S=h.color.light.a?"<path "+i(h.color.light,"fill")+' d="M0 0h'+b+"v"+b+'H0z"/>':"",A="<path "+i(h.color.dark,"stroke")+' d="'+o(x,v,h.margin)+'"/>',k='viewBox="0 0 '+b+" "+b+'"',j='<svg xmlns="http://www.w3.org/2000/svg" '+(h.width?'width="'+h.width+'" height="'+h.width+'" ':"")+k+' shape-rendering="crispEdges">'+S+A+`</svg>
|
|
554
|
+
`;return typeof p=="function"&&p(null,j),j},bm}var $v;function zE(){if($v)return mi;$v=1;const n=hE(),i=DE(),r=ME(),o=RE();function d(f,m,p,h,v){const x=[].slice.call(arguments,1),b=x.length,S=typeof x[b-1]=="function";if(!S&&!n())throw new Error("Callback required as last argument");if(S){if(b<2)throw new Error("Too few arguments provided");b===2?(v=p,p=m,m=h=void 0):b===3&&(m.getContext&&typeof v>"u"?(v=h,h=void 0):(v=h,h=p,p=m,m=void 0))}else{if(b<1)throw new Error("Too few arguments provided");return b===1?(p=m,m=h=void 0):b===2&&!m.getContext&&(h=p,p=m,m=void 0),new Promise(function(A,k){try{const N=i.create(p,h);A(f(N,m,h))}catch(N){k(N)}})}try{const A=i.create(p,h);v(null,f(A,m,h))}catch(A){v(A)}}return mi.create=i.create,mi.toCanvas=d.bind(null,r.render),mi.toDataURL=d.bind(null,r.renderToDataURL),mi.toString=d.bind(null,function(f,m,p){return o.render(f,p)}),mi}var $1=zE();const wm=$m($1);function LE(){return typeof window<"u"&&!!window.LevixHost}const OE=({status:n,onRefresh:i,onStatusUpdate:r})=>{var te;const{t:o,language:d}=Ue(),{toast:f}=Et(),[m,p]=y.useState(!1),[h,v]=y.useState(!1),[x,b]=y.useState(null),[S,A]=y.useState("pairing"),[k,N]=y.useState(""),[j,L]=y.useState(!1),_=(n==null?void 0:n.state)||"idle",F=_==="connected",R=_==="waiting_for_qr",ne=_==="starting"||_==="linking",B=_==="reconnecting",M=_==="paused",T=_==="logged_out",H=!!(n!=null&&n.linked)&&!T,O=!H,W=!!(n!=null&&n.canUnlink),Z=(n==null?void 0:n.isOnline)!==!1,se=M||_==="disconnected"||_==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";y.useEffect(()=>{if(n!=null&&n.qr){const oe=$1.toDataURL||(wm==null?void 0:wm.toDataURL);if(typeof oe=="function"){const ye=getComputedStyle(document.documentElement),ve=document.documentElement.getAttribute("data-theme")==="light",be=(ve?ye.getPropertyValue("--text"):ye.getPropertyValue("--bg")).trim(),rt=(ve?ye.getPropertyValue("--panel"):ye.getPropertyValue("--text")).trim();oe(n.qr,{width:280,margin:2,color:{dark:be,light:rt}}).then(xt=>b(xt)).catch(()=>b(null))}}else b(null)},[n==null?void 0:n.qr]),y.useEffect(()=>{if(R&&!(n!=null&&n.qr)&&!(n!=null&&n.pairingCode)){const oe=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(oe)}},[R,n==null?void 0:n.qr,n==null?void 0:n.pairingCode,i]);const E=async(oe,ye)=>{v(!0);try{const ve=await oe();ve&&typeof ve=="object"&&"session"in ve&&(r==null||r(ve.session)),f(ye,"success"),await(i==null?void 0:i())}catch(ve){f(ve instanceof Error?ve.message:String(ve),"error")}finally{v(!1)}},z=async oe=>{oe&&oe.preventDefault();const ye=k.replace(/\D/g,"");if(!ye){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(ye.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await E(()=>$.startSession({method:"pairing",phone:ye}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},q=async()=>{await E(()=>$.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},le=async()=>{await E($.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),A("pairing")},pe=()=>{n!=null&&n.pairingCode&&(navigator.clipboard.writeText(n.pairingCode.replace(/\s+/g,"")),L(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>L(!1),2500))},fe=async()=>{p(!1),await E($.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},G=(te=n==null?void 0:n.user)!=null&&te.id?n.user.id.split("@")[0].split(":")[0]:null,ce=LE(),ie={key:"unlink",label:o("unlink"),icon:s.jsx(rj,{size:16}),danger:!0,onSelect:()=>p(!0)},de={key:"restart",label:o("restart"),icon:s.jsx(fl,{size:16}),onSelect:()=>E($.restartBot,o("restart"))},C={key:"reconnect",label:o("reconnect"),icon:s.jsx(Ia,{size:16}),onSelect:()=>E($.reconnectSession,o("reconnecting"))},Y=oe=>ce?oe:[...oe,de],K=Y(W?[ie]:[]),me=oe=>{if(oe.length===0)return null;if(oe.length===1){const ye=oe[0];return s.jsx(Oe,{label:ye.label,icon:ye.icon,onClick:ye.onSelect,disabled:h})}return s.jsx(Yn,{label:o("moreActions"),children:oe.map(ye=>s.jsx(it,{danger:ye.danger,icon:ye.icon,disabled:h,onSelect:ye.onSelect,children:ye.label},ye.key))})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs($e,{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 ${F?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":R?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":ne||B?"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(Or,{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:F?o("sessionActive"):M?o("paused"):H?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 ${F?"bg-ok/15 text-ok border-ok/30":R?"bg-warn/15 text-warn border-warn/30":ne||B?"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(_,_)})]})})]}),n!=null&&n.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(il,{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"?`المحاولة التالية خلال ${n.retryInSeconds} ثانية`:`Next attempt in ${n.retryInSeconds}s`})]})]}):null,F&&G&&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(Es,{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:["+",G]})]})]}),s.jsx(Nc,{tone:"ok",className:"shrink-0",children:d==="ar"?"متصل":"Online"})]}),s.jsxs("div",{children:[F&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(ue,{variant:"danger",icon:s.jsx(Lm,{size:16}),onClick:()=>E($.stopSession,o("stop")),disabled:h,className:"flex-1 sm:flex-none",children:o("stop")}),me(Y([C,ie]))]}),(ne||R||B)&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(ue,{variant:"danger",icon:s.jsx(Lm,{size:16}),onClick:()=>E($.stopSession,o("stop")),disabled:h,className:"flex-1 sm:flex-none",children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"}),me(Y([]))]}),!F&&!ne&&!R&&!B&&H&&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:Z?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(ue,{variant:"primary",icon:s.jsx(Or,{size:16}),onClick:()=>E($.startSession,se),disabled:h,className:"flex-1 sm:flex-none","data-tour":"connection-start",children:se}),me(K)]})]}),!F&&!ne&&!R&&!B&&O&&s.jsxs("div",{className:"flex flex-col gap-4 w-full","data-tour":"connection-pairing",children:[s.jsx(Va,{"aria-label":o("connection"),value:S,onChange:A,className:"w-full sm:w-fit",options:[{value:"pairing",label:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)",icon:s.jsx(_r,{size:16})},{value:"qr",label:d==="ar"?"مسح رمز QR":"QR Code Scan",icon:s.jsx(Hf,{size:16})}]}),S==="pairing"&&s.jsxs("form",{onSubmit:z,className:"flex w-full max-w-xl flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(ej,{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:k,onChange:oe=>N(oe.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(ue,{type:"submit",variant:"primary",icon:s.jsx(Rm,{size:16}),disabled:h,className:"flex-1 whitespace-nowrap sm:flex-none","data-tour":"connection-start",children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"}),me(K)]}),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."})]}),S==="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(ue,{variant:"primary",icon:s.jsx(Hf,{size:18}),onClick:q,disabled:h,className:"flex-1 whitespace-nowrap sm:flex-none","data-tour":"connection-start",children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"}),me(K)]}),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."})]})]})]})]}),ne&&s.jsxs($e,{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(Ia,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children:_==="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."})]}),R&&s.jsx($e,{className:"mx-auto flex w-full max-w-2xl flex-col items-center text-center",children:n!=null&&n.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(_r,{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:n.pairingCode.length===8?`${n.pairingCode.slice(0,4)} - ${n.pairingCode.slice(4)}`:n.pairingCode}),s.jsx(ue,{variant:"primary",icon:j?s.jsx(gi,{size:18}):s.jsx(Rb,{size:18}),onClick:pe,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!"})]})]})]}):x?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(Hf,{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:x,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(ue,{variant:"secondary",icon:s.jsx(_r,{size:16}),onClick:le,disabled:h,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(ba,{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(an,{isOpen:m,onClose:()=>p(!1),title:o("unlink"),footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:()=>p(!1),children:o("cancel")}),s.jsx(ue,{variant:"danger",onClick:fe,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")})]})]})},Tr={mode:"simple",limit:3,limitAction:"KICK",features:{antilink:null,media:null,forbidden:null,antispam:null},hitMerge:"max",weights:{antilink:1,media:1,forbidden:1,antispam:1,manual:1},flagAt:3,kickAt:5,decay:{mode:"off",days:30},membership:"clear",flag:{notify:"group",mentionAdmins:!0,cooldownMinutes:0,whileFlagged:"record",escalateAfter:3}},Mc={relaxed:{...Tr,limit:5,limitAction:"FLAG",decay:{mode:"expire",days:14},flag:{...Tr.flag,cooldownMinutes:60,whileFlagged:"hold"}},standard:Tr,strict:{...Tr,limit:2,features:{antilink:"KICK",media:"WARN",forbidden:"WARN",antispam:"KICK"}}};function Wv(n){return{policyMode:n.mode,policyLimit:n.limit,policyLimitAction:n.limitAction,policyLinkAction:n.features.antilink,policyMediaAction:n.features.media,policyForbiddenAction:n.features.forbidden,policySpamAction:n.features.antispam,policyHitMerge:n.hitMerge,policyWeightLink:n.weights.antilink,policyWeightMedia:n.weights.media,policyWeightForbidden:n.weights.forbidden,policyWeightSpam:n.weights.antispam,policyWeightManual:n.weights.manual,policyFlagAt:n.flagAt,policyKickAt:n.kickAt,policyDecayMode:n.decay.mode,policyDecayDays:n.decay.days,policyMembership:n.membership,policyNotify:n.flag.notify,policyMentionAdmins:n.flag.mentionAdmins,policyCooldown:n.flag.cooldownMinutes,policyWhileFlagged:n.flag.whileFlagged,policyEscalateAfter:n.flag.escalateAfter}}function Qm(n){return{mode:n.policyMode,limit:n.policyLimit,limitAction:n.policyLimitAction,features:{antilink:n.policyLinkAction,media:n.policyMediaAction,forbidden:n.policyForbiddenAction,antispam:n.policySpamAction},hitMerge:n.policyHitMerge,weights:{antilink:n.policyWeightLink,media:n.policyWeightMedia,forbidden:n.policyWeightForbidden,antispam:n.policyWeightSpam,manual:n.policyWeightManual},flagAt:n.policyFlagAt,kickAt:n.policyKickAt,decay:{mode:n.policyDecayMode,days:n.policyDecayDays},membership:n.policyMembership,flag:{notify:n.policyNotify,mentionAdmins:n.policyMentionAdmins,cooldownMinutes:n.policyCooldown,whileFlagged:n.policyWhileFlagged,escalateAfter:n.policyEscalateAfter}}}function Sm(n,i){return JSON.stringify(n)===JSON.stringify(i)}function BE(n){return Sm(n,Mc.relaxed)?"relaxed":Sm(n,Mc.standard)?"standard":Sm(n,Mc.strict)?"strict":"custom"}function UE(n,i){const r=Qm(n),o=[["mode",r.mode],["limit",r.limit],["limitAction",r.limitAction],["features.antilink",r.features.antilink],["features.media",r.features.media],["features.forbidden",r.features.forbidden],["features.antispam",r.features.antispam],["hitMerge",r.hitMerge],["weights.antilink",r.weights.antilink],["weights.media",r.weights.media],["weights.forbidden",r.weights.forbidden],["weights.antispam",r.weights.antispam],["weights.manual",r.weights.manual],["flagAt",r.flagAt],["kickAt",r.kickAt],["decay.mode",r.decay.mode],["decay.days",r.decay.days],["membership",r.membership],["flag.notify",r.flag.notify],["flag.mentionAdmins",r.flag.mentionAdmins],["flag.cooldownMinutes",r.flag.cooldownMinutes],["flag.whileFlagged",r.flag.whileFlagged],["flag.escalateAfter",r.flag.escalateAfter]],d={};let f=!1;for(const[m,p]of o){if(i[m]===!1)continue;f=!0;const h=m.split(".");let v=d;for(let x=0;x<h.length-1;x+=1){const b=v[h[x]];(typeof b!="object"||b===null)&&(v[h[x]]={}),v=v[h[x]]}v[h.at(-1)]=p}return f?d:void 0}function km(n){const i={};for(const r of n||[])r!=null&&r.field&&r.message&&!(r.field in i)&&(i[r.field]=r.message);return i}const jm={antilink:"any",welcome:"any",media:"any"};function HE(n,i,r){const o=i.trim().toLowerCase();if(o&&!`${n.subject||""} ${n.jid}`.toLowerCase().includes(o))return!1;const d=!!n.antilink.enabled;if(r.antilink==="on"&&!d||r.antilink==="off"&&d)return!1;const f=!!n.welcomeEnabled;return!(r.welcome==="on"&&!f||r.welcome==="off"&&f||r.media!=="any"&&(n.mediaRestriction||"none")!==r.media)}const PE=()=>{const{t:n,language:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState([]),[f,m]=y.useState(!0),[p,h]=y.useState(null),[v,x]=y.useState(0),[b,S]=y.useState(""),[A,k]=y.useState("name"),[N,j]=y.useState(jm),[L,_]=y.useState([]),[F,R]=y.useState("!"),ne=y.useRef(new Set),[B,M]=y.useState(new Set),T=y.useCallback(async()=>{m(!0);try{const ie=await $.getGroups();ie!=null&&ie.groups&&d(ie.groups),h(null)}catch(ie){h(ie.message),r(ie.message,"error")}finally{m(!1)}},[r]);y.useEffect(()=>{T()},[v,T]),y.useEffect(()=>{let ie=!0;return $.getCommands().then(de=>{ie&&(_(de.commands.filter(C=>C.chat==="group")),R(de.prefix||"!"))}).catch(()=>{}),()=>{ie=!1}},[]);const H=ie=>{d(de=>de.map(C=>C.jid===ie.jid?ie:C))},O=async(ie,de,C)=>{if(ne.current.has(ie))throw new Error(n("saving"));ne.current.add(ie),M(new Set(ne.current));try{const Y=C==="kick"?await $.kickFlagged(ie,de):C==="clear"?await $.clearFlagged(ie,de):await $.dismissFlagged(ie,de);Y!=null&&Y.group&&H(Y.group),r(n("savedSuccessfully"),"success")}catch(Y){throw r(Y.message,"error"),Y}finally{ne.current.delete(ie),M(new Set(ne.current))}},W=async(ie,de)=>{if(ne.current.has(ie))throw new Error(n("saving"));ne.current.add(ie),M(new Set(ne.current));try{const C=await $.updateGroup(ie,de);C!=null&&C.group&&H(C.group),r(n("savedSuccessfully"),"success")}catch(C){throw r(C.message,"error"),C}finally{ne.current.delete(ie),M(new Set(ne.current))}},Z=y.useMemo(()=>{const ie=o.filter(de=>HE(de,b,N));return ie.sort((de,C)=>{const Y=(de.subject||de.jid).localeCompare(C.subject||C.jid,i,{sensitivity:"base"});return A==="members"&&(C.memberCount||0)-(de.memberCount||0)||Y}),ie},[o,b,N,A,i]),se=`${b}|${A}|${N.antilink}|${N.welcome}|${N.media}`,{page:E,pageCount:z,pageItems:q,setPage:le,total:pe}=Zc(Z,20,se),fe=(N.antilink!=="any"?1:0)+(N.welcome!=="any"?1:0)+(N.media!=="any"?1:0),G=()=>{S(""),j(jm)},ce=!f&&!p&&o.length>0;return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(xl,{icon:s.jsx(ol,{size:24}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[n("groups"),s.jsx(et,{tone:"info",children:Ut(n("groupsCount"),{n:o.length})})]}),description:n("groupsSubtitle")}),ce&&s.jsxs(vl,{"data-tour":"groups-list",children:[s.jsx(Be,{type:"search",name:"group-search",autoComplete:"off",value:b,onChange:ie=>S(ie.target.value),placeholder:n("searchGroups"),"aria-label":n("searchGroups"),className:"min-w-48 flex-1"}),s.jsx(Pr,{label:n("sort"),value:A,onChange:k,options:[{value:"name",label:n("sortByName")},{value:"members",label:n("sortByMembers")}]}),s.jsxs(yl,{label:n("filter"),resetLabel:n("reset"),activeCount:fe,onReset:()=>j(jm),children:[s.jsx(kn,{label:n("thAntiLink"),name:"group-antilink",value:N.antilink,onChange:ie=>j(de=>({...de,antilink:ie})),options:[{value:"any",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(kn,{label:n("thWelcome"),name:"group-welcome",value:N.welcome,onChange:ie=>j(de=>({...de,welcome:ie})),options:[{value:"any",label:n("statusAny")},{value:"on",label:n("statusEnabled")},{value:"off",label:n("statusDisabled")}]}),s.jsx(kn,{label:n("thMedia"),name:"group-media",value:N.media,onChange:ie=>j(de=>({...de,media:ie})),options:[{value:"any",label:n("statusAny")},{value:"none",label:n("mediaNone")},{value:"block_all",label:n("mediaBlockAll")},{value:"custom",label:n("mediaCustom")}]})]})]}),f&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["g1","g2","g3","g4"].map(ie=>s.jsxs($e,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Gt,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Gt,{className:"h-5 w-40"}),s.jsx(Gt,{className:"h-4 w-28"})]})]}),s.jsx(Gt,{className:"h-10 w-full"}),s.jsx(Gt,{className:"h-10 w-full"})]},ie))}),!f&&p&&s.jsx(mt,{kind:"error",icon:s.jsx(Wy,{size:28}),description:p,action:s.jsx(ue,{variant:"secondary",icon:s.jsx(fl,{size:16}),onClick:()=>x(ie=>ie+1),children:n("retryLoad")})}),!f&&!p&&o.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(Wy,{size:28}),title:n("noGroupsTitle"),description:n("noGroupsBody")}),!f&&!p&&o.length>0&&Z.length===0&&s.jsx(mt,{kind:"no-results",action:s.jsx(ue,{variant:"secondary",onClick:G,children:n("clearFilters")})}),!f&&!p&&Z.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 items-start gap-3 xl:grid-cols-2",children:q.map(ie=>s.jsx(rh,{summary:s.jsxs("span",{className:"flex items-center gap-3",children:[s.jsx(fj,{src:`/dashboard/api/groups/${encodeURIComponent(ie.jid)}/photo`,name:ie.subject||n("unnamedGroup")}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(ln,{lines:2,className:"block font-bold text-text-main",children:ie.subject||n("unnamedGroup")}),s.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5",children:[s.jsxs(et,{children:[ie.memberCount??"—"," ",n("thMembers")]}),ie.antilink.enabled&&s.jsx(et,{tone:"info",children:n("thAntiLink")}),ie.antispam.enabled&&s.jsx(et,{tone:"ok",children:n("antiSpam")})]})]})]}),children:s.jsx(qE,{group:ie,pending:B.has(ie.jid),onSave:de=>W(ie.jid,de),onFlagged:(de,C)=>O(ie.jid,de,C),commands:L,prefix:F})},ie.jid))}),s.jsx(ki,{page:E,pageCount:z,total:pe,onPageChange:le})]})]})};function qE({group:n,pending:i,onSave:r,onFlagged:o,commands:d,prefix:f}){var W,Z,se;const{t:m,language:p}=Ue(),{permissionLabel:h}=qr(),v={...Tr,...n.moderation_policy},x=Pc({linkMode:n.antilink.mode,domains:n.antilink.allowed_domains.join(`
|
|
555
|
+
`),spamWindow:n.antispam.time_window,spamLimit:n.antispam.message_count,rules:n.rules,welcome:n.welcome_system.messages.join(`
|
|
556
|
+
`),...Wv(v)}),[b,S]=y.useState(n.moderation_policy_visibility??{}),[A,k]=y.useState({});y.useEffect(()=>{S(n.moderation_policy_visibility??{}),k({})},[n.moderation_policy_visibility]);const N=E=>b[E]!==!1,j=E=>A[E],L=BE(Qm(x.draft)),_=E=>{E!=="custom"&&x.setDraft(z=>({...z,...Wv(Mc[E])}))},F=E=>{r(E).catch(()=>{})},R=(E,z,q)=>s.jsx(Kn,{label:E,checked:z,disabled:i,onChange:le=>F(q(le))}),ne=y.useMemo(()=>{var E,z;return{antilink:{enabled:n.antilink.enabled,mode:x.draft.linkMode,allowed_domains:x.draft.domains.split(`
|
|
557
|
+
`).map(q=>q.trim()).filter(Boolean)},antispam:{enabled:n.antispam.enabled,time_window:x.draft.spamWindow,message_count:x.draft.spamLimit},media_control:{enabled:n.media_control.enabled,blocked_types:n.media_control.blocked_types},forbidden_words:{enabled:!!((E=n.forbidden_words)!=null&&E.enabled),count:((z=n.forbidden_words)==null?void 0:z.count)||0},moderation_policy:Qm(x.draft)}},[x.draft,n.antilink.enabled,n.antispam.enabled,n.media_control,n.forbidden_words]),B=p==="en"?(W=n.moderation_summary)==null?void 0:W.en:(Z=n.moderation_summary)==null?void 0:Z.ar,[M,T]=y.useState(B||""),H=JSON.stringify(ne);y.useEffect(()=>{let E=!1;const z=window.setTimeout(()=>{$.previewModeration(ne).then(q=>{E||(T(p==="en"?q.en:q.ar),q.visibility&&S(q.visibility),k(km(q.errors)))}).catch(q=>{var le;E||(Array.isArray((le=q==null?void 0:q.data)==null?void 0:le.errors)?k(km(q.data.errors)):B&&T(B))})},200);return()=>{E=!0,window.clearTimeout(z)}},[H,p,B,ne]);const O=M||B||"";return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx("p",{className:"text-xs text-muted",children:m("botAdminHint")}),s.jsx("form",{className:"flex flex-col gap-5",onSubmit:E=>{E.preventDefault(),x.save(async z=>{var q,le,pe;try{const fe=UE(z,b);await r({antilink:{enabled:n.antilink.enabled,mode:z.linkMode,allowed_domains:z.domains.split(`
|
|
558
|
+
`).map(G=>G.trim()).filter(Boolean)},antispam:{enabled:n.antispam.enabled,time_window:z.spamWindow,message_count:z.spamLimit},media_control:{enabled:n.media_control.enabled,blocked_types:n.media_control.blocked_types},forbidden_words:{enabled:!!((q=n.forbidden_words)!=null&&q.enabled),count:((le=n.forbidden_words)==null?void 0:le.count)||0},welcome_system:{...n.welcome_system,messages:z.welcome===n.welcome_system.messages.join(`
|
|
559
|
+
`)?n.welcome_system.messages:z.welcome.split(`
|
|
560
|
+
`).filter(Boolean)},rules:z.rules,moderation_policy:fe}),k({})}catch(fe){throw Array.isArray((pe=fe==null?void 0:fe.data)==null?void 0:pe.errors)&&k(km(fe.data.errors)),fe}})},children:s.jsxs("fieldset",{disabled:i,className:"flex min-w-0 flex-col gap-5",children:[s.jsxs(lv,{title:m("rulesAndModeration"),children:[R(m("thAntiLink"),n.antilink.enabled,E=>({antilink:{...n.antilink,enabled:E}})),R(m("antiSpam"),n.antispam.enabled,E=>({antispam:{...n.antispam,enabled:E}})),R(m("forbiddenWords"),!!((se=n.forbidden_words)!=null&&se.enabled),E=>{var z;return{forbidden_words:{...n.forbidden_words,enabled:E,count:((z=n.forbidden_words)==null?void 0:z.count)||0}}}),s.jsx("div",{className:"grid grid-cols-1 gap-x-5 sm:grid-cols-2",children:[["image","blockImages"],["video","blockVideos"],["audio","blockAudio"],["sticker","blockStickers"]].map(([E,z])=>s.jsx(Kn,{label:m(z),disabled:i,checked:n.media_control.enabled&&n.media_control.blocked_types.includes(E),onChange:q=>{const le=n.media_control.enabled?n.media_control.blocked_types:[],pe=q?[...new Set([...le,E])]:le.filter(fe=>fe!==E);F({media_control:{enabled:pe.length>0,blocked_types:pe}})}},E))}),s.jsx(Me,{label:m("linkMode"),children:s.jsxs(dt,{"aria-label":m("linkMode"),value:x.draft.linkMode,onChange:E=>x.setField("linkMode",E.target.value),children:[s.jsx("option",{value:"ALL",children:m("linkAll")}),s.jsx("option",{value:"WHITELIST",children:m("linkWhitelist")}),s.jsx("option",{value:"BLACKLIST",children:m("linkBlacklist")})]})}),s.jsx(Me,{label:m("allowedDomains"),children:s.jsx(cl,{"aria-label":m("allowedDomains"),dir:"ltr",value:x.draft.domains,onChange:E=>x.setField("domains",E.target.value)})}),s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Me,{label:m("spamWindow"),children:s.jsx(Be,{"aria-label":m("spamWindow"),type:"number",min:1,max:600,required:!0,value:x.draft.spamWindow,onChange:E=>x.setField("spamWindow",Number(E.target.value))})}),s.jsx(Me,{label:m("spamLimit"),children:s.jsx(Be,{"aria-label":m("spamLimit"),type:"number",min:2,max:100,required:!0,value:x.draft.spamLimit,onChange:E=>x.setField("spamLimit",Number(E.target.value))})})]}),s.jsx("p",{className:"text-sm font-bold text-text-main",children:m("policyBlockTitle")}),s.jsx(Me,{label:m("policyPreset"),children:s.jsx(Va,{"aria-label":m("policyPreset"),value:L,onChange:_,options:[{value:"relaxed",label:m("presetRelaxed")},{value:"standard",label:m("presetStandard")},{value:"strict",label:m("presetStrict")},{value:"custom",label:m("presetCustom")}]})}),s.jsx(Me,{label:m("policyMode"),error:j("mode"),children:s.jsxs(dt,{"aria-label":m("policyMode"),value:x.draft.policyMode,onChange:E=>{const z=E.target.value==="severity"?"severity":"simple";x.setField("policyMode",z),z==="severity"&&x.draft.policyWhileFlagged==="escalate"&&x.setField("policyWhileFlagged","record")},children:[s.jsx("option",{value:"simple",children:m("policyModeSimple")}),s.jsx("option",{value:"severity",children:m("policyModeSeverity")})]})}),N("limit")&&s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Me,{label:m("warningLimit"),error:j("limit"),children:s.jsx(Be,{"aria-label":m("warningLimit"),type:"number",min:1,max:50,required:!0,value:x.draft.policyLimit,onChange:E=>x.setField("policyLimit",Number(E.target.value))})}),s.jsx(Me,{label:m("warningAction"),error:j("limitAction"),children:s.jsxs(dt,{"aria-label":m("warningAction"),value:x.draft.policyLimitAction,onChange:E=>x.setField("policyLimitAction",E.target.value==="FLAG"?"FLAG":"KICK"),children:[s.jsx("option",{value:"KICK",children:m("actionKick")}),s.jsx("option",{value:"FLAG",children:m("actionFlag")})]})})]}),N("flagAt")&&s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Me,{label:m("policyFlagAt"),error:j("flagAt"),children:s.jsx(Be,{"aria-label":m("policyFlagAt"),type:"number",min:1,max:49,required:!0,value:x.draft.policyFlagAt,onChange:E=>x.setField("policyFlagAt",Number(E.target.value))})}),s.jsx(Me,{label:m("policyKickAt"),error:j("kickAt"),children:s.jsx(Be,{"aria-label":m("policyKickAt"),type:"number",min:2,max:50,required:!0,value:x.draft.policyKickAt,onChange:E=>x.setField("policyKickAt",Number(E.target.value))})})]}),N("hitMerge")&&s.jsx(Me,{label:m("policyHitMerge"),error:j("hitMerge"),children:s.jsxs(dt,{"aria-label":m("policyHitMerge"),value:x.draft.policyHitMerge,onChange:E=>x.setField("policyHitMerge",E.target.value==="sum"?"sum":"max"),children:[s.jsx("option",{value:"max",children:m("policyHitMergeMax")}),s.jsx("option",{value:"sum",children:m("policyHitMergeSum")})]})}),N("weights.antilink")&&s.jsxs("div",{className:"grid grid-cols-1 gap-x-5 gap-y-3 sm:grid-cols-2",children:[s.jsx(Me,{label:m("policyWeightLink"),error:j("weights.antilink"),children:s.jsx(Be,{"aria-label":m("policyWeightLink"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightLink,onChange:E=>x.setField("policyWeightLink",Number(E.target.value))})}),s.jsx(Me,{label:m("policyWeightMedia"),error:j("weights.media"),children:s.jsx(Be,{"aria-label":m("policyWeightMedia"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightMedia,onChange:E=>x.setField("policyWeightMedia",Number(E.target.value))})}),s.jsx(Me,{label:m("policyWeightForbidden"),error:j("weights.forbidden"),children:s.jsx(Be,{"aria-label":m("policyWeightForbidden"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightForbidden,onChange:E=>x.setField("policyWeightForbidden",Number(E.target.value))})}),s.jsx(Me,{label:m("policyWeightSpam"),error:j("weights.antispam"),children:s.jsx(Be,{"aria-label":m("policyWeightSpam"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightSpam,onChange:E=>x.setField("policyWeightSpam",Number(E.target.value))})}),s.jsx(Me,{label:m("policyWeightManual"),error:j("weights.manual"),children:s.jsx(Be,{"aria-label":m("policyWeightManual"),type:"number",min:1,max:10,required:!0,value:x.draft.policyWeightManual,onChange:E=>x.setField("policyWeightManual",Number(E.target.value))})})]}),N("features.antilink")&&s.jsx(Me,{label:m("policyLinkLabel"),error:j("features.antilink"),children:s.jsxs(dt,{"aria-label":m("policyLinkLabel"),value:x.draft.policyLinkAction??"DEFAULT",onChange:E=>x.setField("policyLinkAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"DELETE",children:m("actionDelete")}),s.jsx("option",{value:"WARN",children:m("actionDeleteWarn")}),s.jsx("option",{value:"KICK",children:m("actionDeleteKick")})]})}),N("features.media")&&s.jsx(Me,{label:m("policyMediaLabel"),error:j("features.media"),children:s.jsxs(dt,{"aria-label":m("policyMediaLabel"),value:x.draft.policyMediaAction??"DEFAULT",onChange:E=>x.setField("policyMediaAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"DELETE",children:m("actionDelete")}),s.jsx("option",{value:"WARN",children:m("actionDeleteWarn")}),s.jsx("option",{value:"KICK",children:m("actionDeleteKick")})]})}),N("features.forbidden")&&s.jsx(Me,{label:m("policyForbiddenLabel"),error:j("features.forbidden"),children:s.jsxs(dt,{"aria-label":m("policyForbiddenLabel"),value:x.draft.policyForbiddenAction??"DEFAULT",onChange:E=>x.setField("policyForbiddenAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"DELETE",children:m("actionDelete")}),s.jsx("option",{value:"WARN",children:m("actionDeleteWarn")}),s.jsx("option",{value:"KICK",children:m("actionDeleteKick")})]})}),N("features.antispam")&&s.jsx(Me,{label:m("policySpamLabel"),error:j("features.antispam"),children:s.jsxs(dt,{"aria-label":m("policySpamLabel"),value:x.draft.policySpamAction??"DEFAULT",onChange:E=>x.setField("policySpamAction",E.target.value==="DEFAULT"?null:E.target.value),children:[s.jsx("option",{value:"DEFAULT",children:m("policyActionDefault")}),s.jsx("option",{value:"WARN",children:m("actionWarn")}),s.jsx("option",{value:"KICK",children:m("actionKick")})]})}),s.jsx(Me,{label:m("policyDecay"),error:j("decay.mode"),children:s.jsxs(dt,{"aria-label":m("policyDecay"),value:x.draft.policyDecayMode,onChange:E=>x.setField("policyDecayMode",E.target.value==="expire"?"expire":E.target.value==="step"?"step":"off"),children:[s.jsx("option",{value:"off",children:m("policyDecayOff")}),s.jsx("option",{value:"expire",children:m("policyDecayExpire")}),s.jsx("option",{value:"step",children:m("policyDecayStep")})]})}),N("decay.days")&&s.jsx(Me,{label:m("policyDecayDays"),error:j("decay.days"),children:s.jsx(Be,{"aria-label":m("policyDecayDays"),type:"number",min:1,max:365,required:!0,value:x.draft.policyDecayDays,onChange:E=>x.setField("policyDecayDays",Number(E.target.value))})}),s.jsx(Me,{label:m("policyMembership"),error:j("membership"),children:s.jsxs(dt,{"aria-label":m("policyMembership"),value:x.draft.policyMembership,onChange:E=>x.setField("policyMembership",E.target.value==="clear"?"clear":"keep"),children:[s.jsx("option",{value:"keep",children:m("policyMembershipKeep")}),s.jsx("option",{value:"clear",children:m("policyMembershipClear")})]})}),N("flag.notify")&&s.jsx(Me,{label:m("policyFlagNotify"),error:j("flag.notify"),children:s.jsxs(dt,{"aria-label":m("policyFlagNotify"),value:x.draft.policyNotify,onChange:E=>x.setField("policyNotify",E.target.value==="silent"?"silent":"group"),children:[s.jsx("option",{value:"group",children:m("policyNotifyGroup")}),s.jsx("option",{value:"silent",children:m("policyNotifySilent")})]})}),N("flag.mentionAdmins")&&s.jsx(vi,{label:m("policyMentionAdmins"),checked:x.draft.policyMentionAdmins,disabled:i,onChange:E=>x.setField("policyMentionAdmins",E.target.checked)}),N("flag.cooldownMinutes")&&s.jsx(Me,{label:m("policyCooldown"),description:m("policyCooldownHint"),error:j("flag.cooldownMinutes"),children:s.jsx(Be,{"aria-label":m("policyCooldown"),type:"number",min:0,max:10080,required:!0,value:x.draft.policyCooldown,onChange:E=>x.setField("policyCooldown",Number(E.target.value))})}),N("flag.whileFlagged")&&s.jsx(Me,{label:m("policyWhileFlagged"),error:j("flag.whileFlagged"),children:s.jsxs(dt,{"aria-label":m("policyWhileFlagged"),value:x.draft.policyWhileFlagged,onChange:E=>{const z=E.target.value==="hold"?"hold":E.target.value==="escalate"?"escalate":"record";x.setField("policyWhileFlagged",z)},children:[s.jsx("option",{value:"record",children:m("policyWhileFlaggedRecord")}),s.jsx("option",{value:"hold",children:m("policyWhileFlaggedHold")}),x.draft.policyMode==="simple"&&s.jsx("option",{value:"escalate",children:m("policyWhileFlaggedEscalate")})]})}),N("flag.escalateAfter")&&x.draft.policyWhileFlagged==="escalate"&&s.jsx(Me,{label:m("policyEscalateAfter"),error:j("flag.escalateAfter"),children:s.jsx(Be,{"aria-label":m("policyEscalateAfter"),type:"number",min:1,max:50,required:!0,value:x.draft.policyEscalateAfter,onChange:E=>x.setField("policyEscalateAfter",Number(E.target.value))})}),s.jsx(Me,{label:m("groupRules"),children:s.jsx(cl,{"aria-label":m("groupRules"),dir:"auto",maxLength:4e3,value:x.draft.rules,onChange:E=>x.setField("rules",E.target.value)})}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-sm font-bold text-text-main",children:m("flaggedMembers")}),(n.flagged_members||[]).length===0?s.jsx("p",{className:"text-sm text-muted",children:m("flaggedEmpty")}):s.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:(n.flagged_members||[]).map(E=>s.jsxs("li",{className:"flex min-w-0 items-center gap-2 rounded-xl border border-line bg-bg px-3 py-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(ln,{className:"block text-sm font-bold text-text-main",children:E.name}),s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted",dir:"ltr",children:[E.warn_count," · ",E.last_rule||"—",E.flagged_at?s.jsxs(s.Fragment,{children:[" · ",s.jsx(Br,{value:E.flagged_at})]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Oe,{label:m("kickFlagged"),icon:s.jsx(oj,{size:16}),disabled:i,onClick:()=>{o(E.user_id,"kick")}}),s.jsxs(Yn,{label:m("moreActions"),children:[s.jsx(it,{icon:s.jsx(Hk,{size:16}),onSelect:()=>{o(E.user_id,"clear")},children:m("clearWarnings")}),s.jsx(it,{onSelect:()=>{o(E.user_id,"dismiss")},children:m("dismissFlag")})]})]})]},E.user_id))})]}),s.jsx(Me,{label:m("moderationPreview"),description:m("moderationPreviewHint"),children:s.jsx("div",{dir:"auto",className:"min-h-10 whitespace-pre-wrap rounded-xl border border-line bg-bg p-3 text-sm text-text-main",children:O})})]}),s.jsxs(lv,{title:m("thWelcome"),children:[R(m("thWelcome"),n.welcome_system.enabled,E=>({welcome_system:{...n.welcome_system,enabled:E}})),R(m("autoApprove"),n.join_requests.auto_approve_enabled,E=>({join_requests:{auto_approve_enabled:E}})),s.jsx(Me,{label:m("welcomeMessages"),children:s.jsx(cl,{"aria-label":m("welcomeMessages"),dir:"auto",value:x.draft.welcome,onChange:E=>x.setField("welcome",E.target.value)})})]}),s.jsx(qc,{dirty:x.dirty,saving:i,justSaved:x.status==="saved",error:x.error,onDiscard:x.revert,saveLabel:m("save"),discardLabel:m("discard"),unsavedLabel:m("unsavedChanges"),savedLabel:m("saved")})]})}),d.length>0&&s.jsx(rh,{summary:m("groupCommands"),children:s.jsx("ul",{className:"flex list-none flex-col gap-3 p-0",children:d.map(E=>{var z;return s.jsxs("li",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("code",{dir:"ltr",className:"font-mono text-sm font-bold text-brand-cyan",children:[f,E.name]}),s.jsx(et,{children:h(E.permission)}),s.jsx(et,{tone:E.enabled?"ok":"neutral",children:E.enabled?m("statusEnabled"):m("statusDisabled")})]}),s.jsx("p",{dir:"auto",className:"text-xs text-muted",children:((z=E.descriptions)==null?void 0:z[p])||E.description})]},E.key||E.name)})})})]})}var cb;const Jv=typeof((cb=window.LevixHost)==null?void 0:cb.hostLog)=="function",FE=()=>{const{t:n}=Ue(),{toast:i}=Et(),[r,o]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1),h=y.useRef(!1),v=y.useRef(0),[x,b]=y.useState([]),[S,A]=y.useState("all"),[k,N]=y.useState(!0),j=y.useRef(null),[L,_]=y.useState("bot"),[F,R]=y.useState([]),ne=y.useCallback(async()=>{var W;if(h.current)return;const O=v.current;try{if(L==="bot"){const Z=await $.getLogs();if(O!==v.current)return;b(Z.logs||[])}else{const Z=((W=window.LevixHost)==null?void 0:W.hostLog(500))??"";if(O!==v.current)return;R(Z.split(`
|
|
561
|
+
`).filter(Boolean))}o(!1)}catch{O===v.current&&o(!0)}},[L]);y.useEffect(()=>{v.current+=1;let O=!1,W;const Z=async()=>{await ne(),O||(W=setTimeout(Z,3e3))};return Z(),()=>{O=!0,clearTimeout(W),v.current+=1}},[ne]);const B=async()=>{var O;if(!h.current){h.current=!0,p(!0),v.current+=1;try{if(L==="bot")await $.clearLogs();else if(!JSON.parse(((O=window.LevixHost)==null?void 0:O.clearHostLogs())||"{}").ok)throw new Error("clear failed");f(!1),i(n("logsCleared"),"success")}catch{i(n("logsClearFailed"),"error")}finally{h.current=!1,p(!1),await ne()}}};y.useEffect(()=>{k&&j.current&&j.current.scrollIntoView({behavior:"smooth"})},[x,F,k]);const M=x.filter(O=>S==="all"?!0:O.level===S),T=L==="bot"?M.length:F.length,H=O=>O==="error"?"danger":O==="warn"?"warn":"info";return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(xl,{icon:s.jsx(ml,{size:20}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[n("liveServerLogs"),s.jsx(et,{tone:"neutral",className:"font-mono",children:T})]}),description:n("logsSubtitle"),actions:s.jsxs(vl,{children:[Jv&&s.jsx(Va,{"aria-label":n("logs"),value:L,onChange:O=>{h.current||_(O)},options:[{value:"bot",label:n("logSourceBot")},{value:"host",label:n("logSourceHost"),icon:s.jsx(_r,{size:14})}]}),L==="bot"&&s.jsx(yl,{label:n("filter"),resetLabel:n("reset"),activeCount:S==="all"?0:1,onReset:()=>A("all"),children:s.jsx(kn,{name:"log-level",label:n("allLogs"),value:S,onChange:A,options:[{value:"all",label:n("allLogs")},{value:"info",label:"INFO"},{value:"warn",label:"WARN"},{value:"error",label:"ERROR"}]})}),L==="host"&&Jv&&s.jsx(Oe,{label:n("shareLogs"),icon:s.jsx(Hr,{size:18}),onClick:()=>{var O;try{(O=window.LevixHost)==null||O.shareHostLogs()}catch{}}}),s.jsx(Oe,{label:n("autoScroll"),pressed:k,icon:s.jsx(Ck,{size:18,className:k?"animate-bounce":""}),onClick:()=>N(O=>!O)}),s.jsx(Oe,{label:n("clearLogs"),variant:"ghost",icon:s.jsx(Mn,{size:18}),disabled:m,onClick:()=>f(!0)})]})}),s.jsxs(pl,{isOpen:d,onClose:()=>{m||f(!1)},onConfirm:B,title:n("clearLogsConfirm"),confirmLabel:n("clearLogs"),cancelLabel:n("cancel"),loading:m,children:[n("clearLogsBody")," · ",n(L==="host"?"logSourceHost":"logSourceBot")]}),r&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:n("logsLoadFailed")}),s.jsxs($e,{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","data-tour":"logs-stream",children:[L==="bot"?M.length===0?s.jsx(mt,{icon:s.jsx(ml,{size:24}),text:n("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:M.map((O,W)=>s.jsxs("div",{className:"rounded px-1 py-0.5 hover:bg-panel-hover/40",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"shrink-0 select-none text-[11px] text-faint",children:O.time||new Date().toLocaleTimeString()}),s.jsx(et,{tone:H(O.level||"info"),className:"px-1.5 py-px font-mono text-[10px]",children:(O.level||"info").toUpperCase()})]}),s.jsx("span",{className:"whitespace-pre-wrap break-words font-mono text-text-main [overflow-wrap:anywhere]",children:O.msg})]},W))}):F.length===0?s.jsx(mt,{icon:s.jsx(_r,{size:24}),text:n("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:F.map((O,W)=>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:O})},W))}),s.jsx("div",{ref:j})]})]})},GE=n=>{if(!n||n.endsWith("@lid"))return null;const i=n.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},IE=({status:n,onNavigate:i})=>{var _,F;const{t:r}=Ue(),{toast:o}=Et(),[d,f]=y.useState(null),[m,p]=y.useState(!0),[h,v]=y.useState(null),x=!!((_=n==null?void 0:n.user)!=null&&_.id&&h===n.user.id);y.useEffect(()=>{(n==null?void 0:n.state)!=="connected"&&v(null)},[n==null?void 0:n.state]),y.useEffect(()=>{let R=!0;return $.getStats().then(ne=>{R&&(ne!=null&&ne.stats)&&f(ne.stats)}).catch(ne=>{o(ne.message,"error")}).finally(()=>{R&&p(!1)}),()=>{R=!1}},[o]);const b=R=>{const ne=Math.floor(R/86400),B=Math.floor(R%86400/3600),M=Math.floor(R%3600/60);return ne?`${ne} ${r("uptimeDayUnit")} ${B} ${r("uptimeHourUnit")}`:B?`${B} ${r("uptimeHourUnit")} ${M} ${r("uptimeMinuteUnit")}`:`${M} ${r("uptimeMinuteUnit")}`},S=(n==null?void 0:n.state)==="connected",A=GE((F=n==null?void 0:n.user)==null?void 0:F.id),k=async()=>{try{await $.startSession(),o(r("starting"),"info")}catch(R){o(R.message,"error")}},N=async()=>{try{await $.stopSession(),o(r("stop"),"info")}catch(R){o(R.message,"error")}},j=[{id:"connection",title:r("connection"),desc:S?r("connected"):r(n==null?void 0:n.state,"disconnected"),icon:Or,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:Jm,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:ml,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:M0,color:"border-ok/20 bg-ok/10 text-ok"}],L=[{label:r("totalGroups"),value:(d==null?void 0:d.totalGroups)??0,icon:ol,tone:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{label:r("commandCount"),value:(d==null?void 0:d.commandCount)??0,icon:ml,tone:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{label:r("uptime"),value:b((d==null?void 0:d.uptime)||0),icon:_b,tone:"border-ok/20 bg-ok/10 text-ok"},{label:r("activeSchedules"),value:(d==null?void 0:d.activeSchedules)??0,icon:kc,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($e,{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:"min-w-0 pe-6 rtl:ps-6 rtl:pe-0",children:[s.jsx("h2",{className:"text-base font-extrabold tracking-tight text-text-main sm:text-lg",children:S?r("connected"):r(n==null?void 0:n.state,"disconnected")}),A&&S?s.jsxs("div",{className:"mt-1 flex min-h-10 items-center gap-2",children:[s.jsx("bdi",{dir:"ltr",className:"text-base font-bold text-text-main",children:x?A:"••• ••• ••••"}),s.jsx(Oe,{label:r(x?"hideNumber":"showNumber"),pressed:x,variant:"ghost",icon:x?s.jsx(Pb,{size:18}):s.jsx(Si,{size:18}),onClick:()=>{var R;return v(x?null:((R=n==null?void 0:n.user)==null?void 0:R.id)||null)}})]}):null,s.jsx("p",{className:"mt-1 text-sm text-muted",children:r(S?"activeListening":"pausedOrLinking")})]}),s.jsx("div",{className:"absolute end-0 top-1 rtl:start-0 rtl:end-auto",children:s.jsx(iN,{tone:S?"ok":"warn",label:r(S?"online":"offline")})})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[S?s.jsx(ue,{variant:"danger",icon:s.jsx(Lm,{size:16}),onClick:N,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("stop")}):s.jsx(ue,{variant:"primary",icon:s.jsx(tj,{size:16}),onClick:k,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("start")}),s.jsx(ue,{variant:"secondary",icon:s.jsx(Or,{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","data-tour":"overview-stats",children:L.map(R=>{const ne=R.icon;return s.jsxs($e,{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:R.label}),s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${R.tone}`,children:s.jsx(ne,{size:18})})]}),s.jsx("div",{className:"mt-2 font-mono text-2xl font-extrabold tracking-tight text-text-main sm:text-3xl",children:m?"—":R.value})]},R.label)})}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4",children:j.map(R=>{const ne=R.icon;return s.jsx($e,{padded:!1,className:"h-full transition-colors hover:border-brand-blue/30",children:s.jsxs(ue,{variant:"ghost",onClick:()=>i(R.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 ${R.color}`,children:s.jsx(ne,{size:18})}),s.jsx(Oc,{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:R.title}),s.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted sm:text-xs",children:R.desc})]})]})},R.id)})})]})},wi=()=>window.LevixHost,Mr=new Map;let eb=!1;function VE(){eb||(eb=!0,window.__levixHostDone=(n,i)=>{const r=Mr.get(n);Mr.delete(n),r==null||r(i)})}function Fr(n,i,r){const o=wi(),d=o==null?void 0:o[n];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});VE();const f=crypto.randomUUID();return new Promise(m=>{var h,v,x,b,S;const p=A=>{m(A)};Mr.set(f,p);try{const A=n==="pickStickerSource"?(h=o.pickStickerSource)==null?void 0:h.call(o,f):n==="pickFile"?(v=o.pickFile)==null?void 0:v.call(o,f):n==="uploadSource"?(x=o.uploadSource)==null?void 0:x.call(o,f,i[0],i[1],i[2]):n==="uploadForm"?(b=o.uploadForm)==null?void 0:b.call(o,f,i[0],i[1],i[2],i[3]):(S=o.exportFile)==null?void 0:S.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),k=JSON.parse(A||"");k.ok||(Mr.delete(f),p(k))}catch{Mr.delete(f),p({ok:!1,code:"UNAVAILABLE"})}})}function Rc(){var n;return typeof((n=wi())==null?void 0:n.pickStickerSource)=="function"}function eu(){var n;return typeof((n=wi())==null?void 0:n.exportFile)=="function"}async function KE(){const n=await Fr("pickStickerSource",[]);if(!n.ok&&!n.cancelled)throw Gr(n);return n.ok&&n.token&&n.url?n:null}function YE(){try{const n=wi(),i=n!=null&&n.takePendingSticker?JSON.parse(n.takePendingSticker()):null;return i!=null&&i.ok&&i.token&&i.url&&["create","save"].includes(i.intent)?i:null}catch{return null}}function Gr(n){n.status===401&&(window.location.href="/login");const i=n.body,r=i?(()=>{try{return JSON.parse(i)}catch{return null}})():null,o=n.cancelled?"CANCELLED":n.code==="UNAVAILABLE"?"STORAGE_UNAVAILABLE":n.code;return new Mt(n.status||0,(r==null?void 0:r.error)||n.error||o||"Sticker operation failed",r||{code:o})}async function W1(n,i,r,o){const d=await Fr("uploadSource",[n,i,r]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw Gr(d);try{return JSON.parse(d.body||"")}catch{throw new Mt(d.status,"Invalid upload response",{code:"INTERNAL"})}}function Gc(){var n,i;return typeof((n=wi())==null?void 0:n.uploadForm)=="function"&&typeof((i=wi())==null?void 0:i.pickFile)=="function"}async function J1(){const n=await Fr("pickFile",[]);if(!n.ok&&!n.cancelled)throw Gr(n);return n.ok&&n.token&&n.url?n:null}async function ew(n,i,r,o,d){const f=await Fr("uploadForm",[n,JSON.stringify(i),r,o]);if(!f.ok||!f.status||f.status<200||f.status>=300)throw Gr(f);try{return f.body?JSON.parse(f.body):{}}catch{throw new Mt(f.status||0,"Invalid upload response",{code:"INTERNAL"})}}async function QE(n,i,r,o,d,f){const m=await Fr("exportFile",[n,i,r,o,d,f]);if(!m.ok)throw Gr(m);return m}const XE=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],ZE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$E=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],tw=[1,2,3,4,6,8,12];function WE(){const n=window.LevixHost;return!!(n&&typeof n.pickContact=="function")}function JE(n){let i=String(n||"").replace(/\D/g,"");return i.startsWith("00")&&(i=i.slice(2)),i.length<8||i.length>15?null:`${i}@s.whatsapp.net`}function Vn(n){const i=String(n||"").trim();return!i||i.includes("@")||/^\d{8,}$/.test(i)?null:i}function eA(n,i){return Vn(n.savedName)||Vn(n.pushName)||Vn(n.name)||Vn(n.targetLabel)||n.phone||i}function Xm(n){return String(n).padStart(2,"0")}function tA(n,i){const r=n.map(o=>i?$E[o]:ZE[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 nA(n){return n===1?"كل ساعة":n===2?"كل ساعتين":n>=3&&n<=10?`كل ${n} ساعات`:`كل ${n} ساعة`}function tb(n,i){return i==="image"?n("mediaKindImage"):i==="video"?n("mediaKindVideo"):i==="audio"?n("mediaKindAudio"):i==="document"?n("mediaKindDocument"):i}const qa=({label:n,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:n}),s.jsx("span",{className:"min-w-0",children:i})]});function aA(n,i,r,o,d,f,m,p){const h=/^\d{1,2}:\d{2}$/.test(i),v=m||"UTC";if(n==="hourly")return!Number.isInteger(d)||!tw.includes(d)||!Number.isInteger(f)||f<0||f>59?null:p?`${`${nA(d)} عند الدقيقة ${f}`} (${v})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${v})`;if(!h)return null;const[x,b]=i.split(":").map(Number);if(x>23||b>59)return null;const S=`${Xm(x)}:${Xm(b)}`;if(n==="daily")return p?`يومياً الساعة ${S} (${v})`:`Daily at ${S} (${v})`;if(n==="weekly"){const A=[...new Set(r.filter(N=>N>=0&&N<=6))].sort((N,j)=>N-j);if(!A.length)return null;const k=tA(A,p);return p?`كل يوم ${k} الساعة ${S} (${v})`:`Every ${k} at ${S} (${v})`}return n==="monthly"?!Number.isInteger(o)||o<1||o>31?null:p?`كل شهر في اليوم ${o} الساعة ${S} (${v})`:`Every month on day ${o} at ${S} (${v})`:null}const Nm={type:"any",delivery:"any",media:"any"};function nb(n){return Vn(n.savedName)||Vn(n.pushName)||Vn(n.targetLabel)||n.targetPhone||n.phone||n.targetJid}function sA(n,i,r){const o=i.trim().toLowerCase();return!(o&&![n.message,n.targetLabel,n.savedName,n.pushName,n.phone,n.targetPhone,n.when,n.whenAr].filter(Boolean).join(" ").toLowerCase().includes(o)||r.type!=="any"&&n.type!==r.type||r.delivery==="failed"&&n.lastDeliveryStatus!=="failed"||r.delivery==="active"&&n.lastDeliveryStatus==="failed"||r.media==="with"&&!n.media||r.media==="without"&&n.media)}function lA(n,i,r){const o=[...n],d=(f,m)=>nb(f).localeCompare(nb(m),r,{sensitivity:"base"});if(i==="oldest")o.sort((f,m)=>(f.createdAt??0)-(m.createdAt??0)||d(f,m));else if(i==="target")o.sort(d);else if(i==="status"){const f=m=>m.lastDeliveryStatus==="failed"?0:1;o.sort((m,p)=>f(m)-f(p)||(p.createdAt??0)-(m.createdAt??0)||d(m,p))}else o.sort((f,m)=>(m.createdAt??0)-(f.createdAt??0)||d(f,m));return o}const iA=({isConnected:n=!1,onNavigate:i})=>{const{t:r,language:o}=Ue(),{toast:d}=Et(),[f,m]=y.useState([]),[p,h]=y.useState("UTC"),[v,x]=y.useState(!0),[b,S]=y.useState(null),[A,k]=y.useState(0),[N,j]=y.useState(""),[L,_]=y.useState("newest"),[F,R]=y.useState(Nm),[ne,B]=y.useState([]),[M,T]=y.useState(!1),[H,O]=y.useState(null),[W,Z]=y.useState(""),[se,E]=y.useState(!1),[z,q]=y.useState(""),[le,pe]=y.useState("recurring"),[fe,G]=y.useState("daily"),[ce,ie]=y.useState("09:00"),[de,C]=y.useState([1]),[Y,K]=y.useState(1),[me,te]=y.useState(1),[oe,ye]=y.useState(0),[ve,be]=y.useState(""),[rt,xt]=y.useState(!1),[Ee,Ie]=y.useState(null),[He,he]=y.useState(null),Ae=y.useRef(null),[Ne,Ke]=y.useState(null),yt=3,Nt=20*1024*1024,we=20,I=f.length>=yt,ke=o==="ar",Ye=y.useMemo(()=>aA(fe,ce,de,Y,me,oe,p,ke),[fe,ce,de,Y,me,oe,p,ke]),Ge=async()=>{x(!0);try{const P=await $.getSchedules();P!=null&&P.schedules&&(m(P.schedules),P.timezone&&h(P.timezone)),S(null)}catch(P){S(P.message),d(P.message,"error")}finally{x(!1)}},kt=async()=>{T(!0);try{const P=await $.getRecipients();P!=null&&P.recipients&&B(P.recipients)}catch{}finally{T(!1)}};y.useEffect(()=>{Ge(),n&&kt()},[n,A]);const hn=y.useMemo(()=>lA(f.filter(P=>sA(P,N,F)),L,o),[f,N,F,L,o]),rn=`${N}|${L}|${F.type}|${F.delivery}|${F.media}`,{page:ka,pageCount:pn,pageItems:Ka,setPage:Rs,total:zs}=Zc(hn,20,rn),Ni=(F.type!=="any"?1:0)+(F.delivery!=="any"?1:0)+(F.media!=="any"?1:0),Ya=()=>{j(""),R(Nm)},Ht=async P=>{try{await $.deleteSchedule(P),d(r("savedSuccessfully"),"success"),m(Ce=>Ce.filter(Ve=>Ve.id!==P))}catch(Ce){d(Ce.message,"error")}},Qa=async P=>{if(!n){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await $.retrySchedule(P),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),Ge()}catch(Ce){d(Ce.message,"error")}},Ls=async()=>{const P=window.LevixHost;if(!(P!=null&&P.pickContact)){d(o==="ar"?"دليل الهاتف متاح من تطبيق أندرويد فقط":"Phone book is available in the Android app","info");return}const Ce=await new Promise(Qn=>{var sa;const aa=Xn=>{window.removeEventListener("levix-contact",aa);const la=Xn.detail;if(!(la!=null&&la.phone)){Qn(null);return}Qn({name:String(la.name||""),phone:String(la.phone)})};window.addEventListener("levix-contact",aa);try{(sa=P.pickContact)==null||sa.call(P)}catch{window.removeEventListener("levix-contact",aa),Qn(null)}});if(!Ce)return;const Ve=JE(Ce.phone);if(!Ve){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const Qt=`+${Ve.split("@")[0]}`,Xt=Vn(Ce.name);O({id:Ve,name:Xt||Qt,savedName:Xt,pushName:null,phone:Qt,type:"contact"})},Xa=()=>{O(null),Z(""),q(""),pe("recurring"),G("daily"),ie("09:00"),C([1]),K(1),te(1),ye(0),be(""),Ie(null),he(null)},ja=()=>{Ie(null),he(null)},Sl=async()=>{try{const P=await J1();if(!P)return;if(P.size>Nt){d(r("feedbackFileTooLarge").replace("{max}",String(we)),"error");return}he(P)}catch(P){d((P==null?void 0:P.message)||"Could not attach the file","error")}},Za=()=>{if(!n){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(I){d(r("maxSchedulesReached"),"warning");return}Xa(),E(!0),ne.length||kt()},kl=P=>{C(Ce=>Ce.includes(P)?Ce.filter(Ve=>Ve!==P):[...Ce,P].sort((Ve,Qt)=>Ve-Qt))},re=async()=>{if(!H){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!z.trim()&&!Ee&&!He){d(o==="ar"?"يرجى كتابة نص الرسالة أو إرفاق ملف":"Please write the message text or attach a file","warning");return}if(le==="once"&&(!ve||new Date(ve).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if(le==="recurring"&&fe==="weekly"&&de.length===0){d(r("weekdayRequired"),"warning");return}xt(!0);const P={targetJid:H.id,message:z.trim(),type:le};if(H.type==="contact"){const Ce=Vn(H.savedName)||Vn(H.name);Ce&&Ce!==H.phone&&(P.targetName=Ce)}if(le==="recurring"){const Ce={kind:fe};fe==="hourly"?(Ce.everyHours=me,Ce.time=`00:${Xm(oe)}`):(Ce.time=ce,fe==="weekly"&&(Ce.weekdays=de),fe==="monthly"&&(Ce.dayOfMonth=Y)),P.recurrence=Ce}else P.scheduledTime=new Date(ve).getTime();try{const Ce={};for(const[Ve,Qt]of Object.entries(P))Ce[Ve]=Ve==="recurrence"?JSON.stringify(Qt):String(Qt);He?await ew("/dashboard/api/schedules",Ce,He.token,Nt+1024*1024):Ee?await $.postMultipart("/schedules",Ce,Ee):await $.createSchedule(P),d(r("savedSuccessfully"),"success"),E(!1),Xa(),Ge()}catch(Ce){d(Ce.message,"error")}finally{xt(!1)}},ze=ne.filter(P=>{var Ve,Qt,Xt;const Ce=W.toLowerCase().trim();return Ce?P.name.toLowerCase().includes(Ce)||!!((Ve=P.savedName)!=null&&Ve.toLowerCase().includes(Ce))||!!((Qt=P.pushName)!=null&&Qt.toLowerCase().includes(Ce))||!!((Xt=P.phone)!=null&&Xt.toLowerCase().includes(Ce)):!0}),Pe=(P,Ce,Ve=!0)=>{var sa;if(P.type==="group"||P.targetKind==="group"||!!((sa=P.targetJid)!=null&&sa.includes("@g.us"))){const Xn=Vn(P.name)||(Vn(P.targetLabel)&&P.targetLabel!=="Group"?P.targetLabel:null)||r("groupFallback");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-brand-cyan min-w-0",children:[Ve&&s.jsx(ol,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${Ce} truncate`,children:Xn})]})}const Xt=P.phone||P.targetPhone||null,Qn=eA(P,r("contactFallback")),aa=!!(Xt&&Qn!==Xt);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[Ve&&s.jsx(hc,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${Ce} truncate block`,children:Qn}),aa&&s.jsx("span",{className:"block text-[11px] text-muted font-mono",dir:"ltr",children:Xt})]})]})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[!n&&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(il,{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(ue,{variant:"primary",className:"shrink-0",onClick:()=>i==null?void 0:i("connection"),children:o==="ar"?"الذهاب للاتصال":"Go to Connection"})]}),s.jsx(xl,{icon:s.jsx(Mm,{size:24}),title:s.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:[r("schedules"),s.jsxs(et,{tone:I?"warn":"info",children:[f.length," / ",yt," ",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:p})," ","· ",r("headerSubtitle")]}),actions:f.length>0?s.jsx(ue,{variant:"primary",size:"lg",className:"w-full sm:w-auto",icon:s.jsx(dl,{size:18}),onClick:Za,disabled:I||!n,children:n?r(I?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"}):void 0}),!v&&!b&&f.length>0&&s.jsxs(vl,{"data-tour":"schedules-list",children:[s.jsx(Be,{type:"search",name:"schedule-search",autoComplete:"off",value:N,onChange:P=>j(P.target.value),placeholder:r("searchSchedules"),"aria-label":r("searchSchedules"),className:"min-w-48 flex-1"}),s.jsx(Pr,{label:r("sort"),value:L,onChange:_,options:[{value:"newest",label:r("sortNewest")},{value:"oldest",label:r("sortOldest")},{value:"target",label:r("thTarget")},{value:"status",label:r("thDelivery")}]}),s.jsxs(yl,{label:r("filter"),resetLabel:r("reset"),activeCount:Ni,onReset:()=>R(Nm),children:[s.jsx(kn,{label:r("thType"),name:"schedule-type-filter",value:F.type,onChange:P=>R(Ce=>({...Ce,type:P})),options:[{value:"any",label:r("statusAny")},{value:"recurring",label:r("typeRecurring")},{value:"once",label:r("typeOnce")}]}),s.jsx(kn,{label:r("thDelivery"),name:"schedule-delivery-filter",value:F.delivery,onChange:P=>R(Ce=>({...Ce,delivery:P})),options:[{value:"any",label:r("statusAny")},{value:"active",label:r("deliveryActive")},{value:"failed",label:r("deliveryFailed")}]}),s.jsx(kn,{label:r("thMedia"),name:"schedule-media-filter",value:F.media,onChange:P=>R(Ce=>({...Ce,media:P})),options:[{value:"any",label:r("statusAny")},{value:"with",label:r("mediaWith")},{value:"without",label:r("mediaWithout")}]})]})]}),v&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(P=>s.jsxs($e,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Gt,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Gt,{className:"h-4 w-32"}),s.jsx(Gt,{className:"h-3 w-24"})]})]}),s.jsx(Gt,{className:"h-4 w-full"}),s.jsx(Gt,{className:"h-6 w-28"})]},P))}),!v&&b&&s.jsx(mt,{kind:"error",icon:s.jsx(il,{size:28}),description:b,action:s.jsx(ue,{variant:"secondary",icon:s.jsx(fl,{size:16}),onClick:()=>k(P=>P+1),children:r("retryLoad")})}),!v&&!b&&f.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(Mm,{size:28}),text:r("noSchedules"),action:s.jsx(ue,{variant:"primary",icon:s.jsx(dl,{size:16}),onClick:Za,disabled:!n||I,children:r("scheduleNewMsg")})}),!v&&!b&&f.length>0&&hn.length===0&&s.jsx(mt,{kind:"no-results",action:s.jsx(ue,{variant:"secondary",onClick:Ya,children:r("clearFilters")})}),!v&&!b&&hn.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:hidden",children:Ka.map(P=>s.jsxs($e,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-brand-blue/10 text-brand-cyan",children:P.targetKind==="group"||P.targetJid.includes("@g.us")?s.jsx(ol,{size:18}):s.jsx(hc,{size:18})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("bdi",{children:Pe({targetJid:P.targetJid,targetKind:P.targetKind,targetLabel:P.targetLabel,targetPhone:P.targetPhone,savedName:P.savedName,pushName:P.pushName,phone:P.phone},"text-sm font-bold text-text-main",!1)}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted",dir:"auto",children:ke?P.whenAr||P.when:P.when||P.cronString||"—"})]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[P.lastDeliveryStatus==="failed"&&s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Ia,{size:16}),onClick:()=>{Qa(P.id)}}),s.jsx(Oe,{label:r("scheduleDetails"),variant:"ghost",icon:s.jsx(Si,{size:16}),onClick:()=>Ke(P)}),s.jsx(Yn,{label:r("moreActions"),children:s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{Ht(P.id)},children:r("delete")})})]})]}),s.jsx(ln,{lines:2,className:"text-sm text-text-main",children:P.media?`${P.media.fileName||""} ${P.message}`.trim():P.message||"—"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[P.media&&s.jsxs(et,{tone:"info",children:[s.jsx(Er,{size:12}),tb(r,P.media.kind)]}),s.jsx(et,{tone:P.type==="recurring"?"info":"neutral",children:P.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsxs(Nc,{tone:P.lastDeliveryStatus==="failed"?"danger":P.status==="active"?"ok":"neutral",children:[P.lastDeliveryStatus==="failed"?s.jsx(il,{size:13}):s.jsx(Es,{size:13}),s.jsx("span",{children:P.lastDeliveryStatus==="failed"?r("deliveryFailed"):P.status==="active"?r("deliveryActive"):P.status})]})]})]},P.id))}),s.jsx($e,{padded:!1,className:"hidden overflow-hidden md:block",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full table-fixed 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:"w-[22%] px-4 py-4 text-start",children:r("thTarget")}),s.jsx("th",{className:"w-[30%] px-4 py-4 text-start",children:r("thMessage")}),s.jsx("th",{className:"w-[16%] px-4 py-4 text-start",children:r("thSchedule")}),s.jsx("th",{className:"w-[9%] px-4 py-4 text-start",children:r("thType")}),s.jsx("th",{className:"w-[13%] px-4 py-4 text-start",children:r("thDelivery")}),s.jsx("th",{className:"w-[10%] px-4 py-4 text-center",children:r("thActions")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:Ka.map(P=>s.jsxs("tr",{onClick:()=>Ke(P),className:"cursor-pointer transition-colors hover:bg-panel-hover/50",children:[s.jsx("td",{className:"px-4 py-4 text-xs text-text-main",children:s.jsx("bdi",{children:Pe({targetJid:P.targetJid,targetKind:P.targetKind,targetLabel:P.targetLabel,targetPhone:P.targetPhone,savedName:P.savedName,pushName:P.pushName,phone:P.phone},"font-semibold")})}),s.jsx("td",{className:"px-4 py-4 text-xs text-text-main sm:text-sm",children:s.jsx(ln,{lines:2,children:P.media?`${P.media.fileName||""} ${P.message}`.trim():P.message||"—"})}),s.jsx("td",{className:"px-4 py-4 text-xs text-muted",children:s.jsx("span",{dir:"auto",children:ke?P.whenAr||P.when:P.when||P.cronString||"—"})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx(et,{tone:P.type==="recurring"?"info":"neutral",children:P.type==="recurring"?r("typeRecurring"):r("typeOnce")})}),s.jsx("td",{className:"px-4 py-4",children:s.jsxs(Nc,{tone:P.lastDeliveryStatus==="failed"?"danger":P.status==="active"?"ok":"neutral",children:[P.lastDeliveryStatus==="failed"?s.jsx(il,{size:13}):s.jsx(Es,{size:13}),s.jsx("span",{children:P.lastDeliveryStatus==="failed"?r("deliveryFailed"):P.status==="active"?r("deliveryActive"):P.status})]})}),s.jsx("td",{className:"px-4 py-4 text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-1",onClick:Ce=>Ce.stopPropagation(),children:[P.lastDeliveryStatus==="failed"&&s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Ia,{size:16}),onClick:()=>{Qa(P.id)}}),s.jsx(Yn,{label:r("moreActions"),children:s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{Ht(P.id)},children:r("delete")})})]})})]},P.id))})]})})}),s.jsx(ki,{page:ka,pageCount:pn,total:zs,onPageChange:Rs})]}),s.jsx(an,{isOpen:se,onClose:()=>E(!1),title:r("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:()=>E(!1),children:r("cancel")}),s.jsx(ue,{variant:"primary",loading:rt,onClick:re,disabled:rt||!H||!z.trim()&&!Ee&&!He,children:r(rt?"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:"*"})]}),H?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:H.type==="group"?s.jsx(ol,{size:16}):s.jsx(hc,{size:16})}),s.jsx("div",{className:"min-w-0",children:Pe(H,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx(Oe,{label:r("changeChat"),variant:"ghost",icon:s.jsx(Rn,{size:16}),onClick:()=>O(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(eh,{size:16,className:"pointer-events-none absolute start-3 top-1/2 -translate-y-1/2 text-muted"}),s.jsx(Be,{type:"search",value:W,onChange:P=>Z(P.target.value),placeholder:r("searchRecipients"),"aria-label":r("searchRecipients"),className:"ps-9"})]}),WE()&&s.jsx(ue,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(Tk,{size:15}),onClick:Ls,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:M?s.jsx("div",{className:"flex justify-center p-4",children:s.jsx(ba,{label:r("loading")})}):ze.length===0?s.jsx(mt,{className:"px-4 py-4",text:r("noRecipientsFound")}):ze.map(P=>s.jsxs(ue,{variant:"ghost",onClick:()=>O(P),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:P.type==="group"?s.jsx(ol,{size:14}):s.jsx(hc,{size:14})}),s.jsx("div",{className:"min-w-0",children:Pe(P,"text-xs font-bold text-text-main",!1)})]}),s.jsx(et,{tone:"neutral",className:"shrink-0",children:P.type==="group"?r("groupFallback"):r("contactFallback")})]},P.id))})]})]}),s.jsx(Me,{label:r("scheduleType"),htmlFor:"schedule-type",children:s.jsxs(dt,{id:"schedule-type",value:le,onChange:P=>pe(P.target.value),children:[s.jsx("option",{value:"recurring",children:r("scheduleRecurring")}),s.jsx("option",{value:"once",children:r("scheduleOnce")})]})}),le==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsx(Me,{label:r("repeat"),htmlFor:"repeat-kind",children:s.jsxs(dt,{id:"repeat-kind",value:fe,onChange:P=>G(P.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")})]})}),fe==="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:XE.map((P,Ce)=>{const Ve=de.includes(Ce);return s.jsx(ue,{size:"sm",variant:Ve?"primary":"secondary","aria-pressed":Ve,onClick:()=>kl(Ce),children:r(P)},P)})})]}),fe==="monthly"&&s.jsx(Me,{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:Y,onChange:P=>K(Number(P.target.value))})}),fe==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Me,{label:r("everyHours"),htmlFor:"every-hours",children:s.jsx(dt,{id:"every-hours",value:me,onChange:P=>te(Number(P.target.value)),children:tw.map(P=>s.jsx("option",{value:P,children:P},P))})}),s.jsx(Me,{label:r("atMinute"),htmlFor:"hourly-minute",children:s.jsx(Be,{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",value:oe,onChange:P=>ye(Number(P.target.value)),dir:"ltr"})})]}):s.jsx(Me,{label:s.jsxs(s.Fragment,{children:[r("sendTime"),s.jsxs("span",{className:"ms-1.5 font-semibold text-muted",children:["(",p,")"]})]}),htmlFor:"send-time",children:s.jsx(Be,{id:"send-time",type:"time",value:ce,onChange:P=>ie(P.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:Ye||"—"})]})]}):s.jsx(Me,{label:r("deliveryDateTime"),htmlFor:"one-off-time",children:s.jsx(Be,{id:"one-off-time",type:"datetime-local",value:ve,onChange:P=>be(P.target.value),dir:"ltr"})}),s.jsx(Me,{label:s.jsxs(s.Fragment,{children:[r("messageText")," ",!Ee&&!He&&s.jsx("span",{className:"text-danger",children:"*"})]}),htmlFor:"schedule-message",children:s.jsx(cl,{id:"schedule-message",rows:3,placeholder:r("messagePlaceholder"),value:z,onChange:P=>q(P.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:[He||Ee?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(Er,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"max-w-[220px] truncate",children:(He==null?void 0:He.name)??(Ee==null?void 0:Ee.name)}),s.jsx(Oe,{label:r("scheduleRemoveMedia"),variant:"ghost",icon:s.jsx(Rn,{size:14}),onClick:ja})]}):s.jsx(ue,{variant:"secondary",size:"sm",icon:s.jsx(Er,{size:14,className:"text-brand-cyan"}),onClick:()=>{var P;return Gc()?void Sl():(P=Ae.current)==null?void 0:P.click()},children:r("scheduleAttachMedia")}),s.jsx("span",{className:"text-[11px] text-muted",children:r("scheduleMediaHint").replace("{max}",String(we))})]}),!Gc()&&s.jsx("input",{ref:Ae,type:"file",className:"sr-only",onChange:P=>{var Ve;const Ce=((Ve=P.target.files)==null?void 0:Ve[0])??null;if(P.target.value="",!!Ce){if(Ce.size>Nt){d(r("feedbackFileTooLarge").replace("{max}",String(we)),"error");return}Ie(Ce)}}})]})]})}),s.jsx(an,{isOpen:!!Ne,onClose:()=>Ke(null),title:r("scheduleDetails"),maxWidth:"560px",footer:s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[(Ne==null?void 0:Ne.lastDeliveryStatus)==="failed"?s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Ia,{size:16}),onClick:()=>{const P=Ne.id;Ke(null),Qa(P)}}):s.jsx("span",{}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ue,{variant:"secondary",onClick:()=>Ke(null),children:r("close")}),s.jsx(Yn,{label:r("moreActions"),children:s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{const P=Ne==null?void 0:Ne.id;Ke(null),P&&Ht(P)},children:r("delete")})})]})]}),children:Ne&&s.jsxs("div",{className:"flex flex-col gap-3.5 py-1 text-xs sm:text-sm",children:[s.jsx(qa,{label:r("thTarget"),children:s.jsx("bdi",{children:Pe({targetJid:Ne.targetJid,targetKind:Ne.targetKind,targetLabel:Ne.targetLabel,targetPhone:Ne.targetPhone,savedName:Ne.savedName,pushName:Ne.pushName,phone:Ne.phone},"font-semibold",!1)})}),s.jsx(qa,{label:r("thMessage"),children:Ne.message?s.jsx("span",{className:"whitespace-pre-wrap break-words",children:Ne.message}):s.jsx("span",{className:"text-muted",children:"—"})}),Ne.media&&s.jsx(qa,{label:r("detailMedia"),children:s.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[s.jsx(Er,{size:13,className:"text-brand-cyan shrink-0"}),s.jsxs("span",{className:"truncate",children:[tb(r,Ne.media.kind),Ne.media.fileName?` · ${Ne.media.fileName}`:""]})]})}),s.jsx(qa,{label:r("thSchedule"),children:s.jsx("span",{dir:"auto",children:ke&&Ne.whenAr||Ne.when})}),s.jsx(qa,{label:r("thType"),children:Ne.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsx(qa,{label:r("thDelivery"),children:s.jsxs(Nc,{tone:Ne.lastDeliveryStatus==="failed"?"danger":Ne.status==="active"?"ok":"neutral",children:[Ne.lastDeliveryStatus==="failed"?s.jsx(il,{size:13}):s.jsx(Es,{size:13}),s.jsx("span",{children:Ne.lastDeliveryStatus==="failed"?r("deliveryFailed"):Ne.status==="active"?r("deliveryActive"):Ne.status})]})}),Ne.lastRunAt&&s.jsx(qa,{label:r("detailLastRun"),children:new Date(Ne.lastRunAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")}),Ne.lastError&&s.jsx(qa,{label:r("detailError"),children:s.jsx("span",{className:"text-danger break-words",dir:"auto",children:Ne.lastError})}),Ne.createdAt&&s.jsx(qa,{label:r("detailCreated"),children:new Date(Ne.createdAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")})]})})]})};function nw(n,i){const r=Number.isFinite(n)&&n>0?n:0;return r>=1024*1024?i("fileSizeMb").replace("{size}",(r/(1024*1024)).toFixed(1)):i("fileSizeKb").replace("{size}",String(Math.max(1,Math.round(r/1024))))}const aw=({debugLog:n})=>{const{t:i}=Ue();if(!n)return null;const r=new TextEncoder().encode(n).length;return s.jsx("div",{className:"w-full min-w-0",children:s.jsxs(rh,{summary:s.jsxs("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[s.jsx("span",{className:"min-w-0 break-words text-sm font-semibold text-text-main",children:i("debugLogSectionLabel")}),s.jsx("span",{className:"text-xs text-muted tabular-nums",children:nw(r,i)})]}),children:[s.jsx("p",{className:"mb-2 text-xs leading-relaxed text-muted",children:i("debugLogHint")}),s.jsx("pre",{dir:"ltr",className:"max-h-64 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-panel-raised p-2.5 font-mono text-[11px] leading-relaxed text-text-main select-text",children:n})]})})},Cm={messageMin:10,messageMax:2e3,attachmentMax:20*1024*1024},Em={bug:{icon:_k,labelKey:"feedbackTopicBug"},idea:{icon:Kk,labelKey:"feedbackTopicIdea"},question:{icon:L0,labelKey:"feedbackTopicQuestion"},praise:{icon:Fk,labelKey:"feedbackTopicPraise"},other:{icon:yi,labelKey:"feedbackTopicOther"}},rA=["bug","idea","question","praise","other"],oA=()=>{var xt;const{t:n,language:i,theme:r}=Ue(),{toast:o}=Et(),[d,f]=y.useState(null),[m,p]=y.useState("bug"),[h,v]=y.useState(""),[x,b]=y.useState(0),[S,A]=y.useState(""),[k,N]=y.useState(null),[j,L]=y.useState(null),[_,F]=y.useState(!1),[R,ne]=y.useState(null),[B,M]=y.useState(""),[T,H]=y.useState(""),[O,W]=y.useState(!1),[Z,se]=y.useState(!1),[E,z]=y.useState(null),[q,le]=y.useState(!1),[pe,fe]=y.useState(!1),G=y.useRef(null);y.useEffect(()=>{$.getFeedbackMeta().then(f).catch(()=>{})},[]),y.useEffect(()=>{if(!_){ne(null),M(""),H("");return}const Ee=Bm(i,r);W(!0),$.getFeedbackDiagnosticsPreview(Ee).then(Ie=>{Ie!=null&&Ie.diagnostics?(ne(Ie.diagnostics),M(Ie.debugLog||""),H(typeof Ie.debugLogId=="string"?Ie.debugLogId:"")):(ne(Ee),M(""),H(""))}).catch(()=>{ne(Ee),M(""),H("")}).finally(()=>{W(!1)})},[_,i,r]);const ce=(d==null?void 0:d.messageMin)??Cm.messageMin,ie=(d==null?void 0:d.messageMax)??Cm.messageMax,de=(d==null?void 0:d.attachmentMax)??Cm.attachmentMax,C=Math.round(de/(1024*1024)),Y=h.trim(),K=Math.max(0,ce-Y.length),me=Ee=>nw(Ee,n),te=((xt=d==null?void 0:d.topics)!=null&&xt.length?d.topics:rA).filter(Ee=>Ee in Em),oe=()=>o(n("feedbackFileTooLarge").replace("{max}",String(C)),"error"),ye=async()=>{try{const Ee=await J1();if(!Ee)return;if(Ee.size>de){oe();return}L(Ee)}catch(Ee){o((Ee==null?void 0:Ee.message)||"Could not attach the file","error")}},ve=async Ee=>{if(Ee.preventDefault(),K>0||q)return;le(!0),z(j?0:null);const Ie=_?Bm(i,r):void 0,He={message:Y,topic:m,rating:x||null,contact:S.trim()||null,...Ie?{diagnostics:Ie}:{},...Ie&&T?{debugLogId:T}:{}};try{j?await ew("/dashboard/api/feedback",{message:He.message,topic:He.topic,...He.rating?{rating:String(He.rating)}:{},...He.contact?{contact:He.contact}:{},...Ie?{diagnostics:JSON.stringify(Ie)}:{},...Ie&&T?{debugLogId:T}:{}},j.token,de+1024*1024):k?await $.sendFeedbackMultipart(He,k,he=>z(he)):await $.sendFeedback(He),fe(!0),o(n("feedbackSent"),"success")}catch(he){o(he==null?void 0:he.message,"error")}finally{le(!1),z(null)}},be=()=>{v(""),A(""),b(0),p("bug"),N(null),L(null),F(!1),ne(null),se(!1),fe(!1)},rt=()=>{N(null),L(null)};return pe?s.jsxs($e,{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(Es,{size:26})}),s.jsx("h3",{className:"mt-4 text-lg font-bold text-text-main",children:n("feedbackSent")}),s.jsx("p",{className:"mx-auto mt-2 max-w-md text-xs leading-relaxed text-muted sm:text-sm",children:n("feedbackSentDesc")}),s.jsx(ue,{className:"mt-6",onClick:be,children:n("feedbackSendAnother")})]}):s.jsx("div",{className:"flex flex-col gap-5",children:s.jsx($e,{children:s.jsxs("form",{onSubmit:ve,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(yi,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:n("feedbackTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:n("feedbackDesc")})]})]}),s.jsx(Me,{label:n("feedbackTopicLabel"),children:s.jsx($c,{"aria-label":n("feedbackTopicLabel"),value:m,onChange:p,className:"flex-wrap gap-1.5 sm:gap-2",options:te.map(Ee=>{const Ie=Em[Ee].icon;return{value:Ee,label:n(Em[Ee].labelKey),icon:s.jsx(Ie,{size:16})}})})}),s.jsxs(Me,{label:n("feedbackMessageLabel"),htmlFor:"feedback-message",children:[s.jsx(cl,{id:"feedback-message",rows:6,required:!0,maxLength:ie,value:h,onChange:Ee=>v(Ee.target.value),placeholder:n("feedbackMessagePlaceholder")}),s.jsx("span",{className:"self-end text-[11px] tabular-nums text-muted",children:K>0?`${K} ${n("feedbackCharsNeeded")}`:`${h.length} / ${ie}`})]}),s.jsxs(Me,{label:n("feedbackAttach"),description:n("feedbackAttachmentHint").replace("{max}",String(C)),children:[j||k?s.jsx("span",{className:"flex",children:s.jsx(Qc,{onRemove:rt,removeLabel:n("feedbackRemoveAttachment"),className:"max-w-full",children:`${(j==null?void 0:j.name)??(k==null?void 0:k.name)} · ${me((j==null?void 0:j.size)??(k==null?void 0:k.size)??0)}`})}):s.jsx(ue,{type:"button",variant:"secondary",icon:s.jsx(Er,{size:16,className:"text-brand-cyan"}),className:"w-full justify-center border-dashed",onClick:()=>{var Ee;return Gc()?void ye():(Ee=G.current)==null?void 0:Ee.click()},children:n("feedbackAttach")}),!Gc()&&s.jsx("input",{ref:G,type:"file",className:"sr-only",onChange:Ee=>{var He;const Ie=((He=Ee.target.files)==null?void 0:He[0])??null;if(Ee.target.value="",!!Ie){if(Ie.size>de){oe();return}N(Ie)}}})]}),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:n("feedbackRatingLabel")}),s.jsx("div",{className:"flex items-center justify-center gap-1",children:[1,2,3,4,5].map(Ee=>s.jsx(Oe,{label:`${Ee} / 5`,variant:"ghost","aria-pressed":x===Ee,onClick:()=>b(x===Ee?0:Ee),icon:s.jsx(Kc,{size:22,className:Ee<=x?"fill-brand-cyan text-brand-cyan":"text-muted"})},Ee))})]}),s.jsx(Me,{label:n("feedbackContactLabel"),htmlFor:"feedback-contact",children:s.jsx(Be,{id:"feedback-contact",type:"text",maxLength:200,value:S,onChange:Ee=>A(Ee.target.value),placeholder:n("feedbackContactPlaceholder")})}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(vi,{id:"feedback-diagnostics-consent",checked:_,onChange:Ee=>F(Ee.target.checked),label:n("feedbackAttachDiagnostics")}),_&&s.jsxs("details",{open:Z,onToggle:Ee=>se(Ee.currentTarget.open),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("span",{className:"flex-1",children:n("feedbackDiagnosticsPreview")}),O?s.jsx(ba,{className:"size-3.5 shrink-0 text-muted"}):s.jsx(ul,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsx("div",{className:"border-t border-line px-3 py-2 text-xs",children:O&&!R?s.jsx("p",{className:"text-muted",children:n("feedbackDiagnosticsLoading")}):R?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("pre",{dir:"ltr",className:"overflow-x-auto rounded-lg bg-panel p-2 font-mono text-[11px] leading-relaxed text-text-main border border-line select-text",children:JSON.stringify(R,null,2)}),s.jsx(aw,{debugLog:B})]}):s.jsx("p",{className:"text-muted",children:n("feedbackDiagnosticsEmpty")})})]})]}),q&&(j||k)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:j?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((E??0)*100))}%`}})}),s.jsxs("span",{className:"text-[11px] text-muted tabular-nums",children:[n("feedbackSending"),!j&&E!==null&&E>0?` ${Math.round(E*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:[d!=null&&d.runtime?s.jsxs("span",{className:"text-[11px] text-muted",children:[n("feedbackRuntimeLabel"),": v",d.runtime.version," · ",d.runtime.platform]}):s.jsx("span",{}),s.jsx(ue,{type:"submit",variant:"primary",disabled:K>0,loading:q,icon:s.jsx(yi,{size:16}),className:"w-full sm:w-auto",children:n(q?"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(th,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"flex-1",children:n("feedbackWhatIsSent")}),s.jsx(ul,{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:n("feedbackWhatIsSentDesc")})]}),s.jsxs("p",{className:"text-xs leading-relaxed text-muted",children:[n("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:[n("feedbackOpenGithub"),s.jsx(Pk,{size:13,"aria-hidden":!0,className:"shrink-0"})]})]})]})]})})})},cA=()=>{const{t:n}=Ue(),{toast:i}=Et(),[r,o]=y.useState([]),[d,f]=y.useState([]),[m,p]=y.useState(!0),[h,v]=y.useState(null),[x,b]=y.useState(null),[S,A]=y.useState(null),[k,N]=y.useState(!1),j=y.useCallback(async()=>{v(null);try{const R=await $.getCrashReports();R&&(o(R.reports||[]),f(R.sent||[]))}catch(R){v((R==null?void 0:R.message)||"Failed to load crash reports")}finally{p(!1)}},[]);y.useEffect(()=>{j()},[j]);const L=async(R,ne)=>{b(R);try{await $.sendCrashReport(R,ne),i(n("reportSentSuccess"),"success"),await j()}catch(B){i((B==null?void 0:B.message)||"Send failed","error"),await j()}finally{b(null)}},_=async R=>{try{await $.deleteCrashReport(R),i(n("reportDeleteSuccess"),"success"),await j()}catch(ne){i((ne==null?void 0:ne.message)||"Delete failed","error")}finally{A(null)}},F=async()=>{try{await $.deleteAllCrashReports(),i(n("allReportsDeleted"),"success"),await j()}catch(R){i((R==null?void 0:R.message)||"Delete all failed","error")}finally{N(!1)}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs($e,{className:"flex flex-col gap-5",children:[s.jsx(Sn,{icon:s.jsx(Ur,{size:22}),title:n("diagnosticsTitle"),description:n("diagnosticsDesc"),actions:r.length>0?s.jsx(Yn,{label:n("more"),children:s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>N(!0),children:n("deleteAllReports")})}):void 0}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("h3",{className:"text-sm font-bold text-text-main flex items-center gap-2",children:[s.jsx("span",{children:n("pendingReports")}),r.length>0&&s.jsx(et,{tone:"info",className:"tabular-nums",children:r.length})]}),m?s.jsx(_s,{text:n("loading")}):h?s.jsx(mt,{kind:"error",title:h,action:s.jsx(ue,{variant:"secondary",onClick:j,children:n("retry")})}):r.length===0?s.jsx(mt,{kind:"empty",icon:s.jsx(Es,{size:32,className:"text-ok"}),title:n("noPendingReports")}):s.jsx("div",{className:"flex flex-col gap-3",children:r.map(R=>{const{status:ne,lastError:B,debugLog:M,debugLogId:T,...H}=R;return s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-line bg-panel-raised p-4 transition-colors",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-line pb-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[s.jsx(et,{tone:"neutral",children:R.category}),s.jsx("span",{className:"font-mono text-xs sm:text-sm font-bold text-text-main truncate",children:R.error.type}),s.jsx(Br,{value:R.createdAt,className:"text-xs text-muted"})]}),s.jsxs("div",{className:"flex items-center gap-2 self-end sm:self-auto shrink-0",children:[s.jsx(ue,{variant:"primary",size:"sm",loading:x===R.id,disabled:x!==null,onClick:()=>L(R.id,T),icon:s.jsx(yi,{size:14}),children:x===R.id?n("sendingReport"):n("sendReport")}),s.jsx(Oe,{label:n("deleteReport"),icon:s.jsx(Mn,{size:16}),variant:"ghost",onClick:()=>A(R.id)})]})]}),s.jsx("p",{className:"text-xs leading-relaxed text-muted select-text",children:R.error.message}),R.lastError&&s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-danger/30 bg-danger/10 p-2.5 text-xs text-danger",children:[s.jsx(hl,{size:15,className:"shrink-0 mt-0.5"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"font-semibold",children:[n("reportLastError"),": "]}),s.jsx("span",{children:R.lastError})]})]}),s.jsxs("details",{className:"group rounded-xl border border-line bg-panel mt-1",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("span",{className:"flex-1",children:n("crashReportPreview")}),s.jsx(ul,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t border-line p-3",children:[s.jsx("pre",{dir:"ltr",className:"overflow-x-auto rounded-lg bg-panel-raised p-2.5 font-mono text-[11px] leading-relaxed text-text-main border border-line select-text",children:JSON.stringify(H,null,2)}),s.jsx("div",{className:"mt-2",children:s.jsx(aw,{debugLog:M})})]})]})]},R.id)})})]}),s.jsxs("div",{className:"flex flex-col gap-3 border-t border-line pt-4",children:[s.jsxs("h3",{className:"text-sm font-bold text-text-main flex items-center gap-2",children:[s.jsx("span",{children:n("sentReports")}),d.length>0&&s.jsx(et,{tone:"neutral",className:"tabular-nums",children:d.length})]}),d.length===0?s.jsx("p",{className:"text-xs text-muted py-2",children:n("noSentReports")}):s.jsx("div",{className:"flex flex-col gap-2",children:d.map(R=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 rounded-xl border border-line bg-panel-raised p-3 text-xs",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[s.jsx(et,{tone:"neutral",className:"shrink-0",children:R.category}),s.jsx("span",{className:"font-mono font-semibold text-text-main select-all",children:R.id}),s.jsx("span",{className:"text-muted truncate",children:R.type})]}),s.jsx(Br,{value:R.sentAt,className:"text-muted shrink-0"})]},R.id))})]})]}),s.jsx(pl,{isOpen:S!==null,onClose:()=>A(null),onConfirm:()=>S&&_(S),title:n("confirmDeleteReport"),description:n("confirmDeleteReportDesc"),confirmLabel:n("deleteReport"),cancelLabel:n("cancel"),variant:"danger"}),s.jsx(pl,{isOpen:k,onClose:()=>N(!1),onConfirm:F,title:n("confirmDeleteAllReports"),description:n("confirmDeleteAllDesc"),confirmLabel:n("deleteAllReports"),cancelLabel:n("cancel"),variant:"danger"})]})},uA=["general","integrations","proxy","security","storage","feedback","diagnostics"];function ab(){const n=window.location.hash.replace(/^#\/?/,"").split("/");return n[0]==="settings"&&n[1]&&uA.includes(n[1])?n[1]:"general"}const dA=["!","/",".","#","$","?"],fA="levix-settings";function mA(n){const i=new TextEncoder().encode(n);let r="";for(const o of i)r+=String.fromCharCode(o);return btoa(r)}function Am(n,i){const r=i instanceof Mt?i.data:null,o=typeof(r==null?void 0:r.error)=="string"?r.error:"",d=o==="expired"||o==="no_pending"||o==="too_many_attempts";switch(o){case"invalid_email":return{text:n("recoveryErrInvalidEmail"),backToEmail:d};case"wrong_password":return{text:n("recoveryErrWrongPassword"),backToEmail:d};case"throttled":return{text:Ut(n("recoveryErrThrottled"),{n:Number(r==null?void 0:r.retryAfter)||60}),backToEmail:d};case"rate_limited":return{text:r!=null&&r.retryAfter?Ut(n("recoveryErrThrottled"),{n:r.retryAfter}):n("recoveryErrRateLimited"),backToEmail:d};case"":case"unavailable":return{text:n("recoveryErrUnavailable"),backToEmail:d};case"invalid":return{text:n("recoveryErrInvalid"),backToEmail:d};case"wrong_code":{const f=(r==null?void 0:r.attemptsLeft)==null?"":` ${Ut(n("recoveryErrAttemptsLeft"),{n:r.attemptsLeft})}`;return{text:`${n("recoveryErrWrongCode")}${f}`,backToEmail:d}}case"expired":case"no_pending":case"too_many_attempts":return{text:n("recoveryErrExpired"),backToEmail:d};default:return{text:n("recoveryErrFailed"),backToEmail:!1}}}function hA(){const{t:n,language:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState(!1),[f,m]=y.useState(!1),[p,h]=y.useState(!1),[v,x]=y.useState(!1),[b,S]=y.useState(null),[A,k]=y.useState(!1),[N,j]=y.useState("email"),[L,_]=y.useState(""),[F,R]=y.useState(""),[ne,B]=y.useState(""),[M,T]=y.useState(!1),[H,O]=y.useState(null),[W,Z]=y.useState(null),[se,E]=y.useState(!1),[z,q]=y.useState(!1);y.useEffect(()=>{let de=!1;return $.getRecoveryEmail().then(C=>{de||(h(!!C.verified),x(!!C.needsVerification),S(typeof C.masked=="string"?C.masked:null),d(!0))}).catch(()=>{de||(m(!0),d(!0))}),()=>{de=!0}},[]);function le(){j("email"),_(""),R(""),B(""),O(null),Z(null)}function pe(){k(!0),le()}function fe(){k(!1),le()}async function G(de){if(de.preventDefault(),!M){if(T(!0),N==="email"){O(null);try{await $.startRecoveryEmail(L.trim(),F,i==="ar"?"ar":"en"),j("code"),R(""),B(""),Z(null)}catch(C){O(Am(n,C).text)}finally{T(!1)}return}Z(null);try{const C=await $.verifyRecoveryEmail(ne.trim());h(!0),x(!1),S(C.masked),k(!1),le(),r(n("recoveryEmailVerified"),"success")}catch(C){const Y=Am(n,C);Y.backToEmail?(j("email"),B(""),Z(null),O(Y.text)):Z(Y.text)}finally{T(!1)}}}async function ce(){q(!0);try{await $.deleteRecoveryEmail(),h(!1),x(!1),S(null),k(!1),le(),E(!1),r(n("recoveryEmailRemoved"),"success")}catch(de){r(Am(n,de).text,"error")}finally{q(!1)}}const ie=!f&&o&&(!p||A||N==="code");return s.jsxs($e,{className:"flex max-w-xl flex-col gap-4",children:[s.jsx(Sn,{icon:s.jsx(Qk,{size:20}),title:n("recoveryEmailTitle"),description:n("recoveryEmailDesc")}),s.jsx("p",{className:"text-xs text-muted",children:n("recoveryEmailTokenPolicy")}),v&&s.jsx("p",{role:"status",className:"text-sm text-warn",children:n("recoveryEmailReverify")}),f?s.jsx("p",{className:"text-sm text-danger",children:n("recoveryErrFailed")}):o?b&&!A&&N==="email"?s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-bold text-text-main",children:n("recoveryEmailCurrent")}),s.jsx(ln,{dir:"ltr",className:"font-mono text-sm text-text-main",children:b})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p&&s.jsx(ue,{variant:"secondary",onClick:pe,children:n("recoveryEmailChange")}),s.jsx(Oe,{label:n("recoveryEmailRemove"),variant:"danger",icon:s.jsx(Mn,{size:16}),onClick:()=>E(!0)})]})]}):null:s.jsx(ba,{className:"size-5",label:n("loading")}),ie&&s.jsxs("form",{onSubmit:G,className:"flex flex-col gap-3.5",children:[p&&b&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-xs text-muted",children:n("recoveryEmailStays")}),s.jsx(ln,{dir:"ltr",className:"font-mono text-sm text-text-main",children:b})]}),N==="email"?s.jsxs(s.Fragment,{children:[s.jsx(Me,{label:n("recoveryEmailLabel"),htmlFor:"recovery-email",error:H,children:s.jsx(Be,{id:"recovery-email",type:"text",inputMode:"email",autoComplete:"email",technical:!0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",required:!0,value:L,onChange:de=>_(de.target.value)})}),s.jsx(Me,{label:n("currentPassword"),description:n("recoveryEmailPasswordHint"),htmlFor:"recovery-current-password",children:s.jsx(Fa,{id:"recovery-current-password",autoComplete:"current-password",required:!0,value:F,onChange:de=>R(de.target.value)})})]}):s.jsx(Me,{label:n("recoveryEmailCode"),description:n("recoveryEmailCodeSent"),htmlFor:"recovery-code",error:W,children:s.jsx(Be,{id:"recovery-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",technical:!0,className:"font-mono",maxLength:6,required:!0,value:ne,onChange:de=>B(de.target.value)})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ue,{type:"submit",variant:"primary",loading:M,children:n(N==="email"?"recoveryEmailSendCode":"recoveryEmailVerify")}),N==="code"?s.jsx(ue,{variant:"ghost",onClick:()=>{j("email"),B(""),Z(null)},disabled:M,children:n("cancel")}):A&&s.jsx(ue,{variant:"ghost",onClick:fe,disabled:M,children:n("cancel")})]})]}),s.jsx(pl,{isOpen:se,onClose:()=>{z||E(!1)},onConfirm:ce,title:n("recoveryEmailRemoveTitle"),description:n("recoveryEmailRemoveDesc"),confirmLabel:n("delete"),cancelLabel:n("cancel"),variant:"danger",loading:z})]})}const pA=()=>{var Ke,yt,Nt,we;const{t:n,language:i,setLanguage:r}=Ue(),{toast:o}=Et(),d=T1(),[f,m]=y.useState(ab);y.useEffect(()=>{const I=()=>{const ke=ab();m(Ye=>Ye!==ke?ke:Ye)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]);const p=I=>{m(I),window.location.hash=`settings/${I}`},[h,v]=y.useState({}),[x,b]=y.useState({}),[S,A]=y.useState(!0),[k,N]=y.useState("!"),[j,L]=y.useState("!"),[_,F]=y.useState(!1),[R,ne]=y.useState(""),[B,M]=y.useState(""),[T,H]=y.useState(""),[O,W]=y.useState(!1),[Z,se]=y.useState(!1),[E,z]=y.useState(!1),[q,le]=y.useState(null),pe=y.useRef(null),fe=async(I,ke)=>{await $.updateSetting(I,ke),I.endsWith("_api_key")||I==="whatsapp_proxy_password"?(v(Ge=>({...Ge,[I]:""})),b(Ge=>({...Ge,[I]:!!String(ke||"").trim()}))):v(Ge=>({...Ge,[I]:ke}))},G=async(I,ke)=>{v(Ye=>({...Ye,[I]:ke}));try{await $.updateSetting(I,ke),o(n("savedSuccessfully"),"success")}catch(Ye){o(Ye.message,"error"),await Ie()}},ce=fn(i),ie=fn(String(h.bot_language||"auto")),de=fn(String(h.bot_timezone||"Africa/Cairo")),C=fn(String(h.connection_log_level||"info")),Y=fn(String(h.openweathermap_api_key||"")),K=fn(String(h.youtube_api_key||"")),me=fn(Number(h.forward_score_ttl_days||30)),te=fn(Number(h.max_fetch_bytes||524288)),oe=fn(Number(h.sticker_library_limit||1e3)),ye=fn(Number(h.auto_delete_keep_days||30)),ve=Pc({min:Number(h.bot_min_delay_ms??400),max:Number(h.bot_max_delay_ms??900)}),be=Pc({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||"")}),rt=async()=>{var I;se(!0);try{const ke=await $.exportSettings(),Ye=JSON.stringify(ke,null,2),Ge=`levix-settings-${((I=ke.exportedAt)==null?void 0:I.slice(0,10))||"export"}.json`,kt=window.LevixHost;if(kt&&typeof kt.saveExportFile=="function"){const pn=JSON.parse(kt.saveExportFile(Ge,mA(Ye)));if(!(pn!=null&&pn.ok))throw new Error((pn==null?void 0:pn.error)||n("exportSettingsError"));o(`${n("exportSettingsSuccess")} — ${n("exportSavedTo")} ${pn.dir}`,"success");return}const hn=new Blob([Ye],{type:"application/json"}),rn=URL.createObjectURL(hn),ka=document.createElement("a");ka.href=rn,ka.download=Ge,ka.click(),URL.revokeObjectURL(rn),o(n("exportSettingsSuccess"),"success")}catch(ke){o(ke.message||n("exportSettingsError"),"error")}finally{se(!1)}},xt=async I=>{var Ge;const ke=(Ge=I.target.files)==null?void 0:Ge[0];if(I.target.value="",!ke)return;let Ye;try{Ye=JSON.parse(await ke.text())}catch{o(n("importSettingsError"),"error");return}if((Ye==null?void 0:Ye.format)!==fA){o(n("importSettingsError"),"error");return}le(Ye)},Ee=async()=>{var I,ke,Ye;if(q){z(!0);try{const Ge=await $.importSettings(q),kt=[`${((I=Ge.applied)==null?void 0:I.length)||0} ${n("importSettingsCount")}`];(ke=Ge.skipped)!=null&&ke.length&&kt.push(`${n("importSkipped")}: ${Ge.skipped.length}`),(Ye=Ge.restartNeeded)!=null&&Ye.length&&kt.push(`${n("importRestartNeeded")}: ${Ge.restartNeeded.join(", ")}`),o(`${n("importSuccess")} — ${kt.join(" · ")}`,"success"),le(null),await Ie()}catch(Ge){o(Ge.message,"error")}finally{z(!1)}}},Ie=async()=>{try{const I=await $.getSettings();if(I!=null&&I.settings){const ke={},Ye={};I.settings.forEach(Ge=>{Ge.type==="secret"?(Ye[Ge.key]=!!Ge.configured,ke[Ge.key]=""):ke[Ge.key]=Ge.value}),v(ke),b(Ye)}I!=null&&I.prefix&&(N(I.prefix),L(I.prefix))}catch(I){o(I.message,"error")}finally{A(!1)}};y.useEffect(()=>{Ie()},[]);const He=async I=>{const ke=(I!==void 0?I:j).trim();if(!ke||ke.length>3){o(n("prefixValidation"),"error");return}F(!0);try{await $.updatePrefix(ke),N(ke),L(ke),o(`${n("prefixUpdated")} (${ke})`,"success")}catch(Ye){o(Ye.message,"error")}finally{F(!1)}},he=async I=>{if(I.preventDefault(),B!==T){o(n("passwordMatchError"),"error");return}if(B.length<8){o(n("passwordMinLength"),"error");return}W(!0);try{await $.changePassword(R,B),o(n("passwordChangedSuccess"),"success"),ne(""),M(""),H("")}catch(ke){o(ke.message,"error")}finally{W(!1)}},Ae={saveLabel:n("save"),savedLabel:n("saved")},Ne={saveLabel:n("save"),discardLabel:n("discard"),unsavedLabel:n("unsavedChanges"),savedLabel:n("saved")};return S?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(ba,{className:"size-6",label:n("loading")})}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx($c,{value:f,onChange:I=>p(I),"aria-label":n("settings"),className:"overflow-x-auto no-scrollbar",options:[{value:"general",label:n("tabGeneral"),icon:s.jsx(M0,{size:17})},{value:"integrations",label:n("tabIntegrations"),icon:s.jsx(Rm,{size:17})},{value:"proxy",label:n("tabProxy"),icon:s.jsx(Bc,{size:17})},{value:"security",label:n("tabSecurity"),icon:s.jsx(th,{size:17})},{value:"storage",label:n("tabStorage"),icon:s.jsx($y,{size:17})},{value:"feedback",label:n("tabFeedback"),icon:s.jsx($k,{size:17})},{value:"diagnostics",label:n("tabDiagnostics"),icon:s.jsx(Ur,{size:17})}]}),f==="general"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs($e,{className:"flex flex-col gap-4 sm:gap-5","data-tour":"settings-general",children:[s.jsx(Sn,{icon:s.jsx(ml,{size:22}),title:n("prefixTitle"),description:n("prefixDesc"),actions:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted",children:[n("activePrefix"),":"]}),s.jsx(et,{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 min-w-0 flex-col gap-1.5 sm:max-w-72",children:[s.jsx("span",{className:"text-xs font-semibold text-muted",children:n("prefixPresets")}),s.jsx("div",{className:"flex max-w-full items-center gap-2 overflow-x-auto no-scrollbar pb-1",children:dA.map(I=>{const ke=k===I;return s.jsx(Oe,{label:I,size:"md",variant:ke?"primary":"secondary",className:"shrink-0 font-mono",onClick:()=>{L(I),He(I)},children:I},I)})})]}),s.jsx(Me,{label:n("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:n("prefixPlaceholder"),value:j,onChange:I=>L(I.target.value),onKeyDown:I=>{I.key==="Enter"&&He()}}),s.jsx(ue,{variant:"primary",icon:s.jsx(xi,{size:16}),onClick:()=>He(),disabled:_||j.trim()===k,loading:_,children:n(_?"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:n("prefixPreview")}),s.jsx(et,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||k,"help"]})}),s.jsx(et,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||k,"lang ar"]})}),s.jsx(et,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||k,"sticker"]})})]})]}),s.jsxs($e,{className:"flex flex-col gap-4",children:[s.jsx(Sn,{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(mn,{label:n("interfaceLanguage"),description:n("interfaceLanguageDesc"),htmlFor:"panel-language",dirty:ce.dirty,saving:ce.status==="saving",justSaved:ce.status==="saved",error:ce.error,onSave:()=>ce.save(async I=>r(I)),onRevert:ce.revert,...Ae,children:s.jsxs(dt,{id:"panel-language",value:ce.value,onChange:I=>{const ke=I.target.value;(ke==="ar"||ke==="en")&&ce.setValue(ke)},children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]})}),s.jsx(mn,{label:n("botLanguage"),description:n("botLanguageDesc"),htmlFor:"bot-language",dirty:ie.dirty,saving:ie.status==="saving",justSaved:ie.status==="saved",error:ie.error,onSave:()=>ie.save(I=>fe("bot_language",I)),onRevert:ie.revert,...Ae,children:s.jsxs(dt,{id:"bot-language",value:ie.value,onChange:I=>ie.setValue(I.target.value),children:[s.jsx("option",{value:"auto",children:n("langAuto")}),s.jsx("option",{value:"ar",children:n("langAr")}),s.jsx("option",{value:"en",children:n("langEn")})]})}),s.jsx(mn,{label:n("botTimezone"),description:n("botTimezoneDesc"),htmlFor:"bot-timezone",dirty:de.dirty,saving:de.status==="saving",justSaved:de.status==="saved",error:de.error,onSave:()=>de.save(I=>fe("bot_timezone",I)),onRevert:de.revert,...Ae,children:s.jsx(Be,{id:"bot-timezone",type:"text",technical:!0,className:"font-mono",placeholder:"Africa/Cairo",value:de.value,onChange:I=>de.setValue(I.target.value)})})]}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:I=>{I.preventDefault(),ve.save(async ke=>{if(ke.min>ke.max)throw new Error(n("delayRangeError"));await fe("bot_min_delay_ms",ke.min),await fe("bot_max_delay_ms",ke.max)})},onKeyDown:I=>{I.key==="Escape"&&ve.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(Me,{label:n("botMinDelay"),description:n("delaysDesc"),htmlFor:"bot-min-delay",children:s.jsx(Be,{id:"bot-min-delay",type:"number",value:ve.draft.min,onChange:I=>ve.setField("min",Number(I.target.value))})}),s.jsx(Me,{label:n("botMaxDelay"),htmlFor:"bot-max-delay",children:s.jsx(Be,{id:"bot-max-delay",type:"number",value:ve.draft.max,onChange:I=>ve.setField("max",Number(I.target.value))})})]}),s.jsx(qc,{dirty:ve.dirty,saving:ve.status==="saving",justSaved:ve.status==="saved",error:ve.error,onDiscard:ve.revert,...Ne})]})]}),s.jsxs($e,{className:"flex flex-col gap-4",children:[s.jsx(Sn,{icon:s.jsx(Hr,{size:20}),title:n("shareSettingsTitle"),description:n("shareSettingsDesc")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ue,{variant:"secondary",icon:s.jsx(Y0,{size:16}),onClick:rt,loading:Z,children:n("exportAction")}),s.jsx(ue,{variant:"secondary",icon:s.jsx(Vc,{size:16}),onClick:()=>{var I;return(I=pe.current)==null?void 0:I.click()},children:n("importSettings")})]}),s.jsx("input",{ref:pe,type:"file",accept:"application/json,.json",className:"hidden",onChange:xt})]}),s.jsxs($e,{className:"flex flex-col gap-4",children:[s.jsx(Sn,{icon:s.jsx(Ok,{size:20}),title:n("tourReplayTitle"),description:n("tourReplayDesc")}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsx(ue,{variant:"secondary",icon:s.jsx(Mk,{size:16}),onClick:()=>d==null?void 0:d.startMainTour(),children:n("tourReplayAction")})})]})]}),f==="integrations"&&s.jsxs($e,{className:"flex flex-col gap-5",children:[s.jsx(Sn,{icon:s.jsx(Rm,{size:22}),title:n("tabIntegrations"),description:n("integrationsDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[s.jsx(mn,{label:n("weatherApiKey"),description:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command",htmlFor:"weather-api-key",dirty:Y.dirty,saving:Y.status==="saving",justSaved:Y.status==="saved",error:Y.error,onSave:()=>Y.save(async I=>{await fe("openweathermap_api_key",I),Y.setValue("")}),onRevert:Y.revert,...Ae,children:s.jsx(Fa,{id:"weather-api-key",className:"font-mono",placeholder:x.openweathermap_api_key?"••••••••••••":"OpenWeatherMap API Key",value:Y.value,onChange:I=>Y.setValue(I.target.value)})}),s.jsx(mn,{label:n("youtubeApiKey"),description:i==="ar"?"مطلوب لأدوات البحث ومعلومات الفيديوهات من يوتيوب":"Required for YouTube search and video tools",htmlFor:"youtube-api-key",dirty:K.dirty,saving:K.status==="saving",justSaved:K.status==="saved",error:K.error,onSave:()=>K.save(async I=>{await fe("youtube_api_key",I),K.setValue("")}),onRevert:K.revert,...Ae,children:s.jsx(Fa,{id:"youtube-api-key",className:"font-mono",placeholder:x.youtube_api_key?"••••••••••••":"YouTube Data API Key",value:K.value,onChange:I=>K.setValue(I.target.value)})})]})]}),f==="proxy"&&s.jsxs($e,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Sn,{className:"min-w-0 flex-1",icon:s.jsx(Bc,{size:22}),title:n("proxyTitle"),description:n("proxyDesc")}),s.jsx(Kn,{className:"shrink-0",checked:!!h.whatsapp_proxy_enabled,onChange:I=>G("whatsapp_proxy_enabled",I)})]}),s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:I=>{I.preventDefault(),be.save(async ke=>{await fe("whatsapp_proxy_protocol",ke.protocol),await fe("whatsapp_proxy_host",ke.host),await fe("whatsapp_proxy_port",ke.port),await fe("whatsapp_proxy_username",ke.username),ke.password.trim()&&await fe("whatsapp_proxy_password",ke.password),be.setDraft({...ke,password:""})})},onKeyDown:I=>{I.key==="Escape"&&be.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(Me,{label:n("proxyProtocol"),htmlFor:"proxy-protocol",children:s.jsxs(dt,{id:"proxy-protocol",value:be.draft.protocol,onChange:I=>be.setField("protocol",I.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(Me,{label:n("proxyHost"),htmlFor:"proxy-host",children:s.jsx(Be,{id:"proxy-host",type:"text",technical:!0,className:"font-mono",placeholder:"proxy.example.com",value:be.draft.host,onChange:I=>be.setField("host",I.target.value)})}),s.jsx(Me,{label:n("proxyPort"),htmlFor:"proxy-port",children:s.jsx(Be,{id:"proxy-port",type:"number",placeholder:"1080",value:be.draft.port,onChange:I=>be.setField("port",Number(I.target.value))})}),s.jsx(Me,{label:n("proxyUsername"),htmlFor:"proxy-username",children:s.jsx(Be,{id:"proxy-username",type:"text",technical:!0,className:"font-mono",value:be.draft.username,onChange:I=>be.setField("username",I.target.value)})}),s.jsx(Me,{label:n("proxyPassword"),htmlFor:"proxy-password",children:s.jsx(Fa,{id:"proxy-password",placeholder:x.whatsapp_proxy_password?"••••••••••••":void 0,value:be.draft.password,onChange:I=>be.setField("password",I.target.value)})})]}),s.jsx(qc,{dirty:be.dirty,saving:be.status==="saving",justSaved:be.status==="saved",error:be.error,onDiscard:be.revert,...Ne})]})]}),f==="security"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs($e,{className:"flex max-w-xl flex-col gap-4","data-tour":"settings-password",children:[s.jsx(Sn,{icon:s.jsx(e0,{size:20}),title:n("changePassword")}),s.jsxs("form",{onSubmit:he,className:"flex flex-col gap-3.5",children:[s.jsx(Me,{label:n("currentPassword"),htmlFor:"current-password",children:s.jsx(Fa,{id:"current-password",required:!0,value:R,onChange:I=>ne(I.target.value)})}),s.jsx(Me,{label:n("newPassword"),description:n("passwordMinLength"),htmlFor:"new-password",children:s.jsx(Fa,{id:"new-password",required:!0,minLength:8,value:B,onChange:I=>M(I.target.value)})}),s.jsx(Me,{label:n("confirmPassword"),htmlFor:"confirm-password",children:s.jsx(Fa,{id:"confirm-password",required:!0,minLength:8,value:T,onChange:I=>H(I.target.value)})}),s.jsx(ue,{type:"submit",variant:"primary",className:"mt-2 w-full self-start sm:w-auto",icon:s.jsx(xi,{size:16}),disabled:O,loading:O,children:n(O?"saving":"save")})]})]}),s.jsx(hA,{})]}),f==="storage"&&s.jsxs($e,{className:"flex flex-col gap-5",children:[s.jsx(Sn,{icon:s.jsx($y,{size:22}),title:n("storageTitle"),description:n("storageDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(mn,{label:n("forwardTtl"),description:n("forwardTtlDesc"),htmlFor:"forward-ttl",dirty:me.dirty,saving:me.status==="saving",justSaved:me.status==="saved",error:me.error,onSave:()=>me.save(I=>fe("forward_score_ttl_days",I)),onRevert:me.revert,...Ae,children:s.jsx(Be,{id:"forward-ttl",type:"number",value:me.value,onChange:I=>me.setValue(Number(I.target.value))})}),s.jsx(mn,{label:n("maxFetchBytes"),description:n("maxFetchBytesDesc"),htmlFor:"max-fetch-bytes",dirty:te.dirty,saving:te.status==="saving",justSaved:te.status==="saved",error:te.error,onSave:()=>te.save(I=>fe("max_fetch_bytes",I)),onRevert:te.revert,...Ae,children:s.jsx(Be,{id:"max-fetch-bytes",type:"number",value:te.value,onChange:I=>te.setValue(Number(I.target.value))})}),s.jsx(mn,{label:n("stickerLibraryLimit"),htmlFor:"sticker-library-limit",description:n("stickerLibraryLimitDesc"),dirty:oe.dirty,saving:oe.status==="saving",justSaved:oe.status==="saved",error:oe.error,onSave:()=>oe.save(I=>fe("sticker_library_limit",I)),onRevert:oe.revert,...Ae,children:s.jsx(Be,{id:"sticker-library-limit",type:"number",min:1,max:1e5,value:oe.value,onChange:I=>oe.setValue(Number(I.target.value))})}),s.jsx(mn,{label:n("autoDeleteKeepDays"),htmlFor:"auto-delete-keep-days",description:n("autoDeleteKeepDaysDesc"),dirty:ye.dirty,saving:ye.status==="saving",justSaved:ye.status==="saved",error:ye.error,onSave:()=>ye.save(I=>fe("auto_delete_keep_days",I)),onRevert:ye.revert,...Ae,children:s.jsx(Be,{id:"auto-delete-keep-days",type:"number",min:1,max:365,value:ye.value,onChange:I=>ye.setValue(Number(I.target.value))})})]})]}),f==="feedback"&&s.jsx("div",{"data-tour":"settings-feedback",children:s.jsx(oA,{})}),f==="diagnostics"&&s.jsxs("div",{"data-tour":"settings-diagnostics",className:"flex flex-col gap-5",children:[s.jsx($e,{children:s.jsx(mn,{label:n("connectionLogLevel"),description:n("connectionLogLevelDesc"),htmlFor:"connection-log-level",dirty:C.dirty,saving:C.status==="saving",justSaved:C.status==="saved",error:C.error,onSave:()=>C.save(I=>fe("connection_log_level",I)),onRevert:C.revert,...Ae,children:s.jsxs(dt,{id:"connection-log-level",value:C.value,onChange:I=>C.setValue(I.target.value),children:[s.jsx("option",{value:"silent",children:n("connectionLogOff")}),s.jsx("option",{value:"error",children:n("connectionLogError")}),s.jsx("option",{value:"warn",children:n("connectionLogWarn")}),s.jsx("option",{value:"info",children:n("connectionLogInfo")}),s.jsx("option",{value:"debug",children:n("connectionLogDebug")}),s.jsx("option",{value:"trace",children:n("connectionLogTrace")})]})})}),s.jsx(cA,{})]}),s.jsx(an,{isOpen:!!q,onClose:()=>le(null),title:n("importTitle"),footer:s.jsxs(s.Fragment,{children:[s.jsx(ue,{variant:"secondary",onClick:()=>le(null),children:n("cancel")}),s.jsx(ue,{variant:"primary",onClick:Ee,disabled:E,loading:E,children:n("importApply")})]}),children:q&&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:n("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:[n("importPrefix"),":"," ",s.jsx("span",{className:"font-mono font-bold",children:(Ke=q.commands)==null?void 0:Ke.prefix})]}),s.jsxs("li",{children:[Object.keys(q.settings||{}).length," ",n("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((yt=q.commands)==null?void 0:yt.permissions)||{}).length," ",n("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((Nt=q.commands)==null?void 0:Nt.aliases)||{}).length," ",n("importAliasesCount")]}),s.jsxs("li",{children:[(((we=q.commands)==null?void 0:we.disabled)||[]).length," ",n("importDisabledCount")]})]})]})})]})};function Ic(n,i){return`${[...(n||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function sw(n,i){const r=URL.createObjectURL(n),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 lw(n,i){return sw(n,i),{ok:!0,via:"browser"}}async function iw(n,i,r){const o=new File([n],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 sw(n,i),{ok:!0,via:"browser"}}async function tu(n,i,r,o,d,f){const m=await QE(n,i,r,o,d,f);return n==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:m.name||d,dir:m.dir||"Downloads/Levix"}}const Ds={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function nu(n,i,r,o){return{name:n||i,mime:r.type||o,blob:r}}async function Rr(n,i){if(eu())return tu("save",`/dashboard/api/stickers/${encodeURIComponent(n.id)}/export?format=${i}`,"GET","",Ic(n.name,i),Ds[i]);const r=await $.exportSticker(n.id,i),o=nu(r.fileName,Ic(n.name,i),r.blob,Ds[i]);return lw(o.blob,o.name)}async function rw(n,i){if(eu())return tu("share",`/dashboard/api/stickers/${encodeURIComponent(n.id)}/export?format=${i}`,"GET","",Ic(n.name,i),Ds[i]);const r=await $.exportSticker(n.id,i),o=nu(r.fileName,Ic(n.name,i),r.blob,Ds[i]);return iw(o.blob,o.name,o.mime)}async function gA(n,i){if(eu())return tu("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:n,format:i}),`stickers-${i}.zip`,Ds.zip);const r=await $.exportStickers(n,i),o=nu(r.fileName,`stickers-${i}.zip`,r.blob,Ds.zip);return lw(o.blob,o.name)}async function xA(n,i){if(eu())return tu("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:n,format:i}),`stickers-${i}.zip`,Ds.zip);const r=await $.exportStickers(n,i),o=nu(r.fileName,`stickers-${i}.zip`,r.blob,Ds.zip);return iw(o.blob,o.name,o.mime)}async function Zm(n){if(n.length)try{await $.bulkStickers({action:"touch",ids:n})}catch{}}const yA=16*1024*1024,sb=200,vA=10,ow=40,au=60,bA=[['"','"'],["'","'"],["“","”"],["«","»"],["„","‟"],["‹","›"]],lb=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter("en",{granularity:"grapheme"}):null;function wA(n){const i=n.trim();if(i.length<2)return i;for(const[r,o]of bA)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 SA(n){if(!lb)return[...n].length;let i=0;for(const r of lb.segment(n))i+=1;return i}function zr(n){const i=wA(n).normalize("NFC").replace(/\s+/g," ").trim(),r=SA(i);return r<1?"empty":r>ow?"long":null}function kA(n){return n.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(n.name)}function jA(n){return new Promise(i=>{const r=URL.createObjectURL(n),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 NA(n){return new Promise(i=>{const r=URL.createObjectURL(n),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 CA(n,i){if(n.size<=0)return"stickerErr_NO_MEDIA";if(n.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(kA(n)){const o=await NA(n);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 jA(n);return r&&(r.width>i.maxSide||r.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}function EA(n){return!n||n==="transparent"?"transparent":n==="#ffffff"?"white":n==="#000000"?"black":"custom"}const AA=({options:n,onChange:i,canRemoveBackground:r,name:o,onName:d,packId:f,onPack:m,packs:p})=>{var S,A,k;const{t:h}=Ue(),v=EA(n.background),x=((S=n.removeBackground)==null?void 0:S.tolerance)??.15,b=n.rotate??0;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{children:[s.jsx(As,{htmlFor:"sticker-fit",children:h("fit")}),s.jsxs(dt,{id:"sticker-fit",value:n.fit||"contain",onChange:N=>i({fit:N.target.value==="cover"?"cover":"contain"}),children:[s.jsx("option",{value:"contain",children:h("contain")}),s.jsx("option",{value:"cover",children:h("cover")})]})]}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-zoom",children:[h("zoom")," (",(n.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:n.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:[h("panX")," (",(n.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:n.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:[h("panY")," (",(n.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:n.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(ue,{onClick:()=>i({panX:0,panY:0,zoom:1}),children:h("resetPan")}),s.jsxs(ue,{onClick:()=>{const N=(b+90)%360;i({rotate:N})},children:[h("rotateQuarter")," (",b,"°)"]})]}),s.jsx(Va,{"aria-label":h("background"),className:"max-w-full flex-wrap",value:v,onChange:N=>{i(N==="transparent"?{background:"transparent"}:N==="white"?{background:"#ffffff"}:N==="black"?{background:"#000000"}:{background:"#3366ff"})},options:[{value:"transparent",label:h("transparent")},{value:"white",label:h("white")},{value:"black",label:h("black")},{value:"custom",label:h("customColor")}]}),v==="custom"&&s.jsx("input",{type:"color","aria-label":h("customColor"),value:/^#[0-9a-f]{6}$/i.test(n.background||"")?n.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(vi,{checked:((A=n.removeBackground)==null?void 0:A.mode)==="plain",onChange:N=>i({removeBackground:N.target.checked?{mode:"plain",tolerance:.15}:null}),label:h("removePlainBackground"),description:h("stickerRemoveHint")}),((k=n.removeBackground)==null?void 0:k.mode)==="plain"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-tolerance",children:[h("tolerance")," (",x.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:x,onChange:N=>i({removeBackground:{mode:"plain",tolerance:Number(N.target.value)}}),className:"w-full accent-brand-blue"})]})]}),s.jsxs("div",{children:[s.jsx(As,{htmlFor:"sticker-name",children:h("stickerName")}),s.jsx(Be,{id:"sticker-name",value:o,maxLength:au,dir:"auto",onChange:N=>d(N.target.value),placeholder:h("stickerNamePlaceholder")})]}),s.jsxs("div",{children:[s.jsx(As,{htmlFor:"sticker-pack",children:h("targetPack")}),s.jsxs(dt,{id:"sticker-pack",value:f,onChange:N=>m(N.target.value),children:[s.jsx("option",{value:"",children:h("noPack")}),p.map(N=>s.jsx("option",{value:N.id,children:N.name},N.id))]})]})]})},TA=({options:n,onChange:i,kind:r,durationMs:o,limits:d,animatedOk:f})=>{const{t:m}=Ue();if(!(r==="video"||r==="gif"))return null;const h=o>0?o/1e3:d.videoSeconds,v=Math.min(d.videoSeconds,Math.max(0,h)),x=(b,S)=>{const A=Math.min(v,Math.max(0,b)),k=Math.min(d.stickerSeconds,Math.max(.5,S));i({trim:{start:A,duration:k}})};return s.jsxs($e,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx(vi,{checked:!!n.trim,onChange:b=>{b.target.checked?x(0,Math.min(d.stickerSeconds,Math.max(.5,h))):i({trim:null})},label:s.jsx("span",{className:"font-bold",children:m("trim")})}),n.trim&&s.jsxs("span",{className:"font-mono text-xs text-muted",dir:"ltr",children:[n.trim.start.toFixed(1),"s →"," ",(n.trim.start+n.trim.duration).toFixed(1),"s"]})]}),!f&&s.jsx("p",{className:"text-xs text-warn",children:m("animatedUnavailable")}),s.jsx("p",{className:"text-xs text-muted",children:m(r==="gif"?"gifTrimNote":"trimApplied")}),n.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[m("trimStart")," (",n.trim.start.toFixed(1)," ",m("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:v,step:.1,value:n.trim.start,onChange:b=>{var S;return x(Number(b.target.value),((S=n.trim)==null?void 0:S.duration)??.5)},className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-duration",children:[m("trimDuration")," (",n.trim.duration.toFixed(1)," ",m("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:n.trim.duration,onChange:b=>{var S;return x(((S=n.trim)==null?void 0:S.start)??0,Number(b.target.value))},className:"w-full accent-brand-blue"})]})]})},Ft=512;function _A(n,i,r){const o=r.fit||"contain",d=r.zoom??1,f=r.panX??0,m=r.panY??0,p=r.rotate??0,h=p===90||p===270,v=h?i:n,x=h?n:i,S=(o==="cover"?Ft/Math.min(v,x):Ft/Math.max(v,x))*d,A=Math.max(1,Math.round(v*S)),k=Math.max(1,Math.round(x*S)),N=Math.round((Ft-A)/2+f*Math.abs(Ft-A)/2),j=Math.round((Ft-k)/2+m*Math.abs(Ft-k)/2);return{width:A,height:k,x:N,y:j}}const DA='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function MA(n){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(n)}function RA(n){const i=/^#([0-9a-f]{6})$/i.exec(n.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 zA(n,i,r,o,d,f){const m=Math.max(0,Math.min(f,o/2,d/2));n.beginPath(),n.moveTo(i+m,r),n.arcTo(i+o,r,i+o,r+d,m),n.arcTo(i+o,r+d,i,r+d,m),n.arcTo(i,r+d,i,r,m),n.arcTo(i,r,i+o,r,m),n.closePath(),n.fill()}function LA(n,i,r,o){const d=n==="center"?"center":n==="start"?i==="rtl"?"right":"left":i==="rtl"?"left":"right";return d==="center"?-r/2-o:d==="right"?-r-o:-o}function cw(n,i,r){const o=[];for(const d of i){if(!d.text)continue;const f=MA(d.text)?"rtl":"ltr";n.save(),n.translate(d.x,d.y),n.rotate(d.rotate*Math.PI/180),n.direction=f,n.font=`${d.fontSize}px ${DA}`,n.textAlign=d.align,n.textBaseline="middle";const m=n.measureText(d.text).width,p=d.background?d.fontSize*.4:8,h=d.background?d.fontSize*.22:6,v=m+p*2,x=d.fontSize*1.25+h*2,b=LA(d.align,f,m,p),S=-x/2;d.background&&(n.fillStyle="rgba(0, 0, 0, 0.55)",zA(n,b,S,v,x,x/2)),r===d.id&&(n.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue("--color-brand-cyan").trim(),n.lineWidth=2,n.strokeRect(b-3,S-3,v+6,x+6)),d.outline&&(n.lineJoin="round",n.miterLimit=2,n.lineWidth=Math.max(2,d.fontSize/10),n.strokeStyle=RA(d.color),n.strokeText(d.text,0,0)),n.fillStyle=d.color,n.fillText(d.text,0,0),n.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:b,top:S,right:b+v,bottom:S+x})}return o}function OA(n,i,r){for(let o=n.length-1;o>=0;o--){const d=n[o],f=i-d.cx,m=r-d.cy,p=-d.rotate*Math.PI/180,h=f*Math.cos(p)-m*Math.sin(p),v=f*Math.sin(p)+m*Math.cos(p);if(h>=d.left&&h<=d.right&&v>=d.top&&v<=d.bottom)return d.id}return null}function BA(n){const i=n.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 cw(o,i,null),r.toDataURL("image/png")}const UA=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function Sc(n,i,r){return Math.min(r,Math.max(i,n))}const HA=({mediaUrl:n,kind:i,width:r,height:o,options:d,layers:f,selectedId:m,onPan:p,onSelect:h,onMoveLayer:v,label:x})=>{const b=y.useRef(null),S=y.useRef(null),A=y.useRef([]),k=y.useRef(null),N=y.useRef(null),j=y.useRef(1),L=d.rotate??0,_=r>0&&o>0?_A(r,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:L}):null,F=L===90||L===270,R=_?F?_.height:_.width:0,ne=_?F?_.width:_.height:0,B=_?_.x+(_.width-R)/2:0,M=_?_.y+(_.height-ne)/2:0,T=d.background&&d.background!=="transparent"?d.background:null;y.useEffect(()=>{const E=b.current;if(!E)return;const z=()=>{const le=Math.min(E.clientWidth,512);j.current=le>0?le/Ft:1,E.style.setProperty("--stage-scale",String(j.current))};z();const q=new ResizeObserver(z);return q.observe(E),()=>q.disconnect()},[]),y.useEffect(()=>{const E=S.current;if(!E)return;const z=window.devicePixelRatio||1;E.width=Ft*z,E.height=Ft*z;const q=E.getContext("2d");q&&(q.setTransform(z,0,0,z,0,0),q.clearRect(0,0,Ft,Ft),A.current=cw(q,f,m))},[f,m]),y.useEffect(()=>{const E=N.current,z=d.trim;if(!E||!z||i!=="video"||!n)return;const q=z.start,le=z.start+z.duration,pe=()=>{(E.currentTime<q-.05||E.currentTime>=le-.02)&&(E.currentTime=q)};return E.addEventListener("timeupdate",pe),E.addEventListener("ended",pe),E.currentTime=q,()=>{E.removeEventListener("timeupdate",pe),E.removeEventListener("ended",pe)}},[d.trim,i,n]);const H=E=>{const z=E.currentTarget.getBoundingClientRect();return{x:(E.clientX-z.left)/z.width*Ft,y:(E.clientY-z.top)/z.height*Ft}},O=E=>{if(E.button!==0)return;E.currentTarget.setPointerCapture(E.pointerId);const z=H(E),q=OA(A.current,z.x,z.y);if(q){const le=f.find(pe=>pe.id===q);if(!le)return;h(q),k.current={kind:"layer",id:q,x:z.x,y:z.y,originX:le.x,originY:le.y};return}h(null),_&&(k.current={kind:"pan",x:z.x,y:z.y,panX:d.panX??0,panY:d.panY??0,placeW:_.width,placeH:_.height})},W=E=>{const z=k.current;if(!z)return;const q=H(E);if(z.kind==="layer"){v(z.id,Sc(z.originX+(q.x-z.x),0,Ft),Sc(z.originY+(q.y-z.y),0,Ft));return}const le=Math.abs(Ft-z.placeW),pe=Math.abs(Ft-z.placeH),fe=le<1?z.panX:Sc(z.panX+(q.x-z.x)*2/le,-1,1),G=pe<1?z.panY:Sc(z.panY+(q.y-z.y)*2/pe,-1,1);p(fe,G)},Z=()=>{k.current=null},se={position:"absolute",left:B,top:M,width:R,height:ne,transform:`rotate(${L}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:b,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":x,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:Ft,height:Ft,transform:"scale(var(--stage-scale, 1))"},children:[T&&s.jsx("div",{className:"absolute inset-0",style:{background:T}}),_&&i==="video"?s.jsx("video",{ref:N,src:n,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:se}):_&&s.jsx("img",{src:n,alt:"",draggable:!1,style:se}),s.jsx("canvas",{ref:S,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:O,onPointerMove:W,onPointerUp:Z,onPointerCancel:Z})]})})})},PA=({layers:n,selectedId:i,onSelect:r,onChange:o,onDelete:d,onAddText:f,onAddEmoji:m})=>{const{t:p}=Ue(),h=n.find(v=>v.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(ue,{onClick:f,children:p("addText")}),s.jsx(ue,{onClick:()=>m("😀"),children:p("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(As,{children:p("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:UA.map(v=>s.jsx(Oe,{label:v,variant:"secondary",onClick:()=>m(v),children:s.jsx("span",{className:"text-lg leading-none",children:v})},v))}),s.jsx(As,{htmlFor:"emoji-free",children:p("customEmoji")}),s.jsx(Be,{id:"emoji-free",className:"mt-1",placeholder:p("emojiInputLabel"),onKeyDown:v=>{if(v.key==="Enter"){const x=v.currentTarget.value.trim();x&&(m(x),v.currentTarget.value="")}}})]}),n.length===0&&s.jsx("p",{className:"text-xs text-muted",children:p("noLayers")}),n.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:n.map(v=>{const x=v.id===i;return s.jsx(ue,{variant:x?"secondary":"ghost","aria-pressed":x,onClick:()=>r(v.id),className:qe("h-auto w-full justify-start",x&&"border-brand-blue bg-brand-blue/10"),children:s.jsx("span",{className:"truncate",children:v.text||p("textPlaceholder")})},v.id)})}),h&&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:p("layerSelected")}),s.jsx(As,{htmlFor:"layer-text",children:p("textContent")}),s.jsx(Be,{id:"layer-text",value:h.text,onChange:v=>o(h.id,{text:v.target.value})}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-size",children:p("textSize")}),s.jsx("input",{id:"layer-size",type:"range",min:16,max:200,value:h.fontSize,onChange:v=>o(h.id,{fontSize:Number(v.target.value)}),className:"w-full accent-brand-blue"}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-color",children:p("textColor")}),s.jsx("input",{id:"layer-color",type:"color",value:/^#[0-9a-f]{6}$/i.test(h.color)?h.color:"#ffffff",onChange:v=>o(h.id,{color:v.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx(Va,{"aria-label":p("textAlignment"),value:h.align,onChange:v=>o(h.id,{align:v}),options:[{value:"start",label:p("stickerAlignmentStart")},{value:"center",label:p("stickerAlignmentCenter")},{value:"end",label:p("stickerAlignmentEnd")}]}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-rotate",children:p("layerRotation")}),s.jsx("input",{id:"layer-rotate",type:"range",min:-180,max:180,value:h.rotate,onChange:v=>o(h.id,{rotate:Number(v.target.value)}),className:"w-full accent-brand-blue"}),s.jsx(vi,{checked:h.outline,onChange:v=>o(h.id,{outline:v.target.checked}),label:p("textOutline")}),s.jsx(vi,{checked:h.background,onChange:v=>o(h.id,{background:v.target.checked}),label:p("textBackground")}),s.jsx(ue,{variant:"danger",onClick:()=>d(h.id),icon:s.jsx(Mn,{size:16}),children:p("deleteLayer")})]})]})},uw=({open:n,title:i,packs:r,onClose:o,onPick:d,onCreated:f})=>{const{t:m}=Ue(),{toast:p}=Et(),[h,v]=y.useState(""),[x,b]=y.useState(null),[S,A]=y.useState(!1);y.useEffect(()=>{n||(v(""),b(null))},[n]);const k=async()=>{if(zr(h)){b(m("packNameLength"));return}A(!0),b(null);try{const j=await $.createPack(h.trim());v(""),f(j),d(j.id),p(m("packCreated"),"success")}catch(j){p(jt(m,j),"error")}finally{A(!1)}};return s.jsx(an,{isOpen:n,onClose:o,title:i,footer:s.jsx(ue,{onClick:o,children:m("close")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[r.length===0?s.jsx("p",{className:"text-sm text-muted",children:m("noPacks")}):s.jsx("div",{className:"flex max-h-64 flex-col gap-1.5 overflow-y-auto",children:r.map(N=>s.jsxs(ue,{variant:"ghost",onClick:()=>d(N.id),className:"h-auto w-full min-w-0 justify-start px-3 py-2.5",children:[s.jsx(ln,{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(As,{htmlFor:"new-pack-name",children:m("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Be,{id:"new-pack-name",value:h,onChange:N=>{const j=N.target.value;v(j),x&&b(zr(j)?m("packNameLength"):null)},placeholder:m("newPackPlaceholder"),maxLength:80,dir:"auto"}),s.jsx(ue,{variant:"primary",onClick:k,disabled:S,children:m("createPack")})]}),x&&s.jsx("p",{className:"text-xs text-danger",children:x})]})]})})},qA=600;function FA(){const[n,i]=y.useState(null),[r,o]=y.useState(!1),[d,f]=y.useState(null),m=y.useRef(0);return y.useEffect(()=>()=>{m.current+=1},[]),{job:n,running:r,submitError:d,start:async v=>{const x=++m.current;f(null),i(null),o(!0);try{const{jobId:b}=await $.createStickerJob(v);for(;m.current===x;){const S=await $.getStickerJob(b);if(m.current!==x)return;if(i(S),S.state==="done"||S.state==="failed")break;await new Promise(A=>setTimeout(A,qA))}}catch(b){m.current===x&&f(b)}finally{m.current===x&&o(!1)}},reset:()=>{m.current+=1,i(null),f(null),o(!1)}}}const Tm={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function GA(n,i){return n(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const IA=({capabilities:n,capsError:i,onRetryCaps:r,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:m,onCreated:p})=>{var be,rt,xt,Ee,Ie,He,he,Ae,Ne,Ke,yt,Nt;const{t:h}=Ue(),{toast:v}=Et(),x=FA(),[b,S]=y.useState(null),[A,k]=y.useState(null),[N,j]=y.useState("PANEL_UPLOAD"),[L,_]=y.useState(!1),[F,R]=y.useState(!1),[ne,B]=y.useState(Tm),[M,T]=y.useState([]),[H,O]=y.useState(null),[W,Z]=y.useState(""),[se,E]=y.useState(""),[z,q]=y.useState([]),[le,pe]=y.useState(!1),[fe,G]=y.useState(!1),ce=y.useRef(null),ie=y.useRef(null),de=y.useRef(async()=>{});y.useEffect(()=>($.getPacks().then(we=>q(we.packs)).catch(()=>{}),()=>{ce.current&&URL.revokeObjectURL(ce.current)}),[]);const C=we=>{ce.current&&URL.revokeObjectURL(ce.current);const I=URL.createObjectURL(we);ce.current=I,k(I)},Y=async(we,I,ke,Ye,Ge)=>{if(!(n!=null&&n.webp))return;const kt=we instanceof File?we:new File([we],I,{type:we.type}),hn=await CA(kt,n.limits);if(hn){v(h(hn),"error");return}_(!0),j(ke);try{const rn=Ye?await W1(Ye,I,n.limits.uploadBytes):Ge?await $.uploadExistingStickerSource(Ge):await $.uploadStickerSource(kt,I);C(kt),S(rn),B(Tm),v(h("uploadReady"),"success")}catch(rn){v(jt(h,rn),"error")}finally{_(!1)}};de.current=Y,y.useEffect(()=>{!o||!n||o===ie.current||(ie.current=o,d(),Promise.resolve(o.blob).then(we=>de.current(we,o.name,o.source,o.token,o.existingId)).catch(we=>v(jt(h,we),"error")))},[o,n,d]);const K=()=>{x.reset(),S(null),Z(""),E(""),T([]),O(null),B(Tm),j("PANEL_UPLOAD"),ce.current&&URL.revokeObjectURL(ce.current),ce.current=null,k(null),ie.current=null},me=()=>{if(!b)return null;const we=W.trim();if([...we].length>au)return v(h("stickerNameTooLong"),"warning"),null;const I=BA(M);return{uploadId:b.uploadId,options:ne,...I?{overlay:I}:{},...we?{name:we}:{},...se?{packId:se}:{},source:N}},te=()=>{const we=me();we&&x.start(we)},oe=async(we,I)=>{we.ok&&(we.via==="host"?v(Ut(h("stickerShareSaved"),{dir:we.dir}),"success"):we.via==="share"?v(h("shareDone"),"success"):v(h("downloaded"),"success"),await Zm([I.id]),p())};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(ue,{onClick:r,children:h("retryLoad")})]});if(!n)return s.jsx(_s,{text:h("loading")});if(!n.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:h("stickerErr_ENCODER_MISSING")});const ye=((be=x.job)==null?void 0:be.state)==="done"?x.job.sticker:null;if(ye)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:ye.url,alt:ye.name||h("stickerPreview"),className:"w-full h-full object-contain"})}),((rt=x.job)==null?void 0:rt.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:h("alreadyInLibrary")}),((xt=x.job)==null?void 0:xt.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:h("qualityReduced")}),((Ee=x.job)==null?void 0:Ee.created)!==!1&&s.jsx("p",{className:"text-sm text-ok",children:h("stickerCreated")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Oe,{label:h("downloadWebp"),icon:s.jsx(Vc,{size:18}),onClick:()=>{Rr(ye,"webp").then(we=>oe(we,ye)).catch(we=>v(jt(h,we),"error"))}}),s.jsx(Oe,{label:h("shareSticker"),icon:s.jsx(Hr,{size:18}),onClick:()=>{rw(ye,"webp").then(we=>oe(we,ye)).catch(we=>v(jt(h,we),"error"))}}),s.jsx(ue,{disabled:!f,title:f?void 0:h("notConnectedHint"),onClick:()=>pe(!0),children:h("sendViaWhatsapp")}),s.jsx(ue,{onClick:()=>G(!0),children:h("addToPack")}),s.jsx(ue,{variant:"primary",onClick:K,children:h("createAnother")}),s.jsx(ue,{onClick:m,children:h("goToLibrary")}),s.jsxs(Yn,{label:h("moreActions"),children:[s.jsx(it,{onSelect:()=>{ye.animated&&v(h("firstFrameHint"),"info"),Rr(ye,"png").then(we=>oe(we,ye)).catch(we=>v(jt(h,we),"error"))},children:h("downloadPng")}),ye.animated&&s.jsx(it,{disabled:!n.gif,title:h("gifOnlyAnimated"),onSelect:()=>{Rr(ye,"gif").then(we=>oe(we,ye)).catch(we=>v(jt(h,we),"error"))},children:h("downloadGif")})]})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:h("notConnectedHint")}),s.jsx(gh,{open:le,busy:!1,onClose:()=>pe(!1),onPick:we=>{$.sendStickers({ids:[ye.id],jid:we}).then(I=>{I.sent>0?(v(h("stickerSent"),"success"),pe(!1),p()):v(h("stickerErr_NOT_CONNECTED"),"error")}).catch(I=>v(jt(h,I),"error"))}}),s.jsx(uw,{open:fe,title:h("addToPack"),packs:z,onClose:()=>G(!1),onCreated:we=>q(I=>[...I,we]),onPick:we=>{$.bulkStickers({action:"addToPack",ids:[ye.id],packId:we}).then(()=>{v(h("addedToPack"),"success"),G(!1),p()}).catch(I=>v(jt(h,I),"error"))}})]});const ve=x.submitError||((Ie=x.job)==null?void 0:Ie.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:[!b&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${F?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:we=>{Rc()&&(we.preventDefault(),KE().then(async I=>{if(!I)return;const ke=await fetch(I.url);if(!ke.ok)throw new Error("source unavailable");await Y(await ke.blob(),I.name,"PANEL_UPLOAD",I.token)}).catch(I=>v(jt(h,I),"error")))},onDragOver:we=>{we.preventDefault(),R(!0)},onDragLeave:()=>R(!1),onDrop:we=>{if(we.preventDefault(),R(!1),Rc())return;const I=we.dataTransfer.files[0];I&&Y(I,I.name,"PANEL_UPLOAD")},children:[s.jsx(Y0,{size:28,className:"text-muted"}),s.jsx("span",{className:"text-sm font-bold text-text-main",children:h("stickerDrag")}),s.jsx("span",{className:"text-xs text-muted",children:h("uploadHint")}),s.jsx("input",{type:"file",accept:"image/*,video/*,.webp,.gif",className:"sr-only",disabled:Rc(),onChange:we=>{var ke;const I=(ke=we.target.files)==null?void 0:ke[0];we.target.value="",I&&Y(I,I.name,"PANEL_UPLOAD")}})]}),L&&s.jsx(_s,{text:h("loading")}),b&&A&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:Ut(h("stickerUploadInfo"),{kind:GA(h,b.kind),size:Math.max(1,Math.round(b.size/1024))})}),s.jsx(HA,{mediaUrl:A,kind:b.kind,width:b.width,height:b.height,options:ne,layers:M,selectedId:H,label:h("previewStage"),onPan:(we,I)=>B(ke=>({...ke,panX:we,panY:I})),onSelect:O,onMoveLayer:(we,I,ke)=>T(Ye=>Ye.map(Ge=>Ge.id===we?{...Ge,x:I,y:ke}:Ge))}),s.jsx(TA,{options:ne,onChange:we=>B(I=>({...I,...we})),kind:b.kind,durationMs:b.durationMs,limits:n.limits,animatedOk:n.animated})]}),(x.running||((He=x.job)==null?void 0:He.state)==="queued"||((he=x.job)==null?void 0:he.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((((Ae=x.job)==null?void 0:Ae.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:XC(h,((Ne=x.job)==null?void 0:Ne.state)==="queued"?"queued":(Ke=x.job)==null?void 0:Ke.stage)})]}),ve&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:x.submitError?jt(h,x.submitError):ph(h,(Nt=(yt=x.job)==null?void 0:yt.error)==null?void 0:Nt.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ue,{variant:"primary",onClick:te,children:h("tryAgain")}),s.jsx(ue,{onClick:K,children:h("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[b&&s.jsx(AA,{options:ne,onChange:we=>B(I=>({...I,...we})),canRemoveBackground:n.backgroundRemoval.includes("plain"),name:W,onName:Z,packId:se,onPack:E,packs:z}),b&&s.jsx(PA,{layers:M,selectedId:H,onSelect:O,onChange:(we,I)=>T(ke=>ke.map(Ye=>Ye.id===we?{...Ye,...I}:Ye)),onDelete:we=>{T(I=>I.filter(ke=>ke.id!==we)),O(I=>I===we?null:I)},onAddText:()=>{const we=crypto.randomUUID();T(I=>[...I,{id:we,text:h("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),O(we)},onAddEmoji:we=>{const I=crypto.randomUUID();T(ke=>[...ke,{id:I,text:we,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),O(I)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ue,{variant:"primary",disabled:!b||x.running||L,onClick:te,icon:s.jsx(dl,{size:16}),children:h("createBtn")}),b&&s.jsx(ue,{onClick:K,disabled:x.running,children:h("clearLbl")})]})]})]})};let zc=null,Lc=!1,va=null;function ib(n){va=n}async function VA(n,i){var r;try{const o=await W1(n,i,yA),{jobId:d}=await $.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await $.getStickerJob(d);if(f.state==="done"){va==null||va({type:"saved",created:f.created!==!1,qualityReduced:f.qualityReduced===!0});return}if(f.state==="failed"){va==null||va({type:"error",code:(r=f.error)==null?void 0:r.code});return}await new Promise(m=>setTimeout(m,600))}}catch(o){va==null||va({type:"error",code:o instanceof Mt?o.code:void 0})}finally{Lc=!1}}function KA(){if(Lc)return zc;const n=YE();return(n==null?void 0:n.intent)==="create"?zc={blob:fetch(n.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:n.name||"sticker",source:"MEDIA_HUB",token:n.token}:(n==null?void 0:n.intent)==="save"&&!Lc&&(Lc=!0,VA(n.token,n.name||"sticker")),zc}function YA(){zc=null}const dw=({count:n,animatedSelected:i,canRemove:r,sendReason:o,exportReason:d,onSelectAll:f,selectAllLabel:m,onClear:p,onFavorite:h,onUnfavorite:v,onAdd:x,onMove:b,onRemove:S,onDownload:A,onConvert:k,onShare:N,onSend:j,onDelete:L})=>{const{t:_}=Ue();return n===0?null:s.jsx("div",{className:"sticky bottom-2 z-20 pb-[max(0.25rem,env(safe-area-inset-bottom))] sm:static sm:pb-0",children:s.jsxs($e,{className:"border-brand-blue/40 bg-panel/95 backdrop-blur-md shadow-lg shadow-black/15 p-2 sm:p-2.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[s.jsx("span",{className:"me-auto min-w-0 truncate text-xs sm:text-sm font-bold text-text-main",children:Ut(_("nSelected"),{n})}),s.jsx(Oe,{label:n>1?_("downloadZip"):_("download"),icon:s.jsx(Vc,{size:16}),onClick:A,disabled:!!d}),s.jsx(Oe,{label:_("sendViaWhatsapp"),icon:s.jsx(yi,{size:16,className:"rtl:-scale-x-100"}),onClick:j,disabled:!!o}),s.jsx(Oe,{label:_("shareSticker"),icon:s.jsx(Hr,{size:16}),onClick:N}),s.jsxs(Yn,{label:_("moreActions"),children:[s.jsx(it,{onSelect:f,children:m}),s.jsx(it,{onSelect:p,children:_("clearSelection")}),s.jsx(Dr,{}),s.jsx(it,{onSelect:h,children:_("favorite")}),s.jsx(it,{onSelect:v,children:_("unfavorite")}),s.jsx(Dr,{}),s.jsx(it,{onSelect:x,children:_("addToPack")}),s.jsx(it,{onSelect:b,children:_("moveToPack")}),r&&s.jsx(it,{onSelect:S,children:_("removeFromPack")}),s.jsx(it,{onSelect:k,disabled:!!d,children:_("convertToImage")}),s.jsx(Dr,{}),s.jsx(it,{danger:!0,onSelect:L,children:_("delete")})]}),s.jsx(Oe,{variant:"ghost",label:_("clearSelection"),icon:s.jsx(Rn,{size:16}),onClick:p})]}),(o||d||i)&&s.jsxs("div",{className:"mt-1.5 space-y-0.5 border-t border-line/50 pt-1 text-xs text-muted",children:[o&&s.jsx("p",{children:o}),d&&s.jsx("p",{children:d}),i&&s.jsx("p",{children:_("firstFrameHint")})]})]})})},QA=({open:n,busy:i,count:r,inUse:o,packs:d,onClose:f,onConfirm:m,onConfirmEverywhere:p})=>{const{t:h}=Ue();return s.jsx(an,{isOpen:n,onClose:f,title:h("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[s.jsx(ue,{onClick:f,disabled:i,children:h("cancel")}),o?s.jsx(ue,{variant:"danger",onClick:p,disabled:i,children:h("deleteEverywhere")}):s.jsx(ue,{variant:"danger",onClick:m,disabled:i,children:h("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2 text-sm text-text-main",children:[s.jsx("p",{children:Ut(h("nSelected"),{n:r})}),o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:h(r===1?"inUseBody":"inUseBulkBody")}),d.length>0&&s.jsxs("p",{children:[h("inUsePacksLabel"),":"," ",d.map((v,x)=>s.jsxs(y.Fragment,{children:[x>0&&", ",s.jsx(ln,{as:"bdi",children:v.name})]},v.id))]}),s.jsx("p",{className:"text-xs text-muted",children:h("deleteEverywhereHint")})]}):s.jsx("p",{children:h("deleteConfirm")})]})})},XA="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",ZA=({sticker:n,packs:i,isConnected:r,gifEnabled:o,onClose:d,onRename:f,onFavorite:m,onAddToPack:p,onRemoveFromPack:h,onDownload:v,onShare:x,onSend:b,onDelete:S,onOpenInCreate:A})=>{const{t:k}=Ue(),[N,j]=y.useState(""),[L,_]=y.useState("");if(y.useEffect(()=>{j((n==null?void 0:n.name)||""),_("")},[n]),!n)return null;const F=i.filter(B=>n.packIds.includes(B.id)),R=i.filter(B=>!n.packIds.includes(B.id)),ne=n.animated&&o?"gif":"webp";return s.jsx(an,{isOpen:!!n,onClose:d,title:s.jsx(ln,{children:n.name||k("stickerPreview")}),maxWidth:"38rem",footer:s.jsx("div",{className:"flex w-full justify-end gap-2",children:s.jsx(ue,{onClick:d,children:k("close")})}),children:s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[s.jsxs("div",{className:`relative mx-auto aspect-square w-full max-w-[240px] sm:max-w-[280px] max-h-[min(40vh,280px)] overflow-hidden rounded-2xl border border-line ${XA}`,children:[s.jsx("img",{src:n.url,alt:n.name||k("stickerPreview"),className:"h-full w-full object-contain"}),s.jsxs("div",{className:"absolute end-2 top-2 flex gap-1",children:[s.jsx(Oe,{label:k(ne==="gif"?"downloadGif":"downloadWebp"),icon:s.jsx(Vc,{size:16}),onClick:()=>v(ne)}),s.jsx(Oe,{label:k("shareSticker"),icon:s.jsx(Hr,{size:16}),onClick:x})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(ue,{variant:"primary",size:"sm",className:"h-auto min-w-0 flex-1 py-2",onClick:b,disabled:!r,title:r?void 0:k("notConnectedHint"),icon:s.jsx(yi,{size:16,className:"rtl:-scale-x-100"}),children:s.jsx("span",{className:"min-w-0 break-words",children:k("sendViaWhatsapp")})}),s.jsx(Oe,{label:n.favorite?k("unfavorite"):k("favorite"),"aria-pressed":n.favorite,onClick:()=>m(!n.favorite),icon:s.jsx(Kc,{size:16,className:n.favorite?"fill-warn text-warn":void 0})}),s.jsx("span",{className:"shrink-0",children:s.jsxs(Yn,{label:k("moreActions"),align:"end",children:[s.jsx(it,{onSelect:()=>v("webp"),children:k("downloadWebp")}),s.jsx(it,{title:n.animated?k("firstFrameHint"):void 0,onSelect:()=>v("png"),children:k("downloadPng")}),n.animated&&s.jsx(it,{disabled:!o,title:k("gifOnlyAnimated"),onSelect:()=>v("gif"),children:k("downloadGif")}),s.jsx(it,{onSelect:A,children:k("openInCreate")}),s.jsx(Dr,{}),s.jsx(it,{danger:!0,onSelect:S,children:k("delete")})]})})]}),n.animated&&s.jsx("p",{className:"text-xs text-muted",children:k("firstFrameHint")}),!r&&s.jsx("p",{className:"text-xs text-muted",children:k("notConnectedHint")}),s.jsxs("div",{className:"flex gap-2 min-w-0",children:[s.jsx(Be,{value:N,onChange:B=>j(B.target.value),maxLength:au,dir:"auto","aria-label":k("stickerName"),placeholder:k("stickerNamePlaceholder"),className:"min-w-0 flex-1"}),s.jsx(ue,{variant:"secondary",onClick:()=>f(N.trim()),children:k("rename")})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-bold text-text-main",children:k("inUsePacksLabel")}),F.length===0?s.jsx("p",{className:"text-xs text-muted",children:k("notInPack")}):s.jsx("ul",{className:"flex flex-col gap-1.5",children:F.map(B=>s.jsxs("li",{className:"flex items-center justify-between gap-2",children:[s.jsx(ln,{className:"flex-1 text-sm",children:B.name}),s.jsx(Oe,{label:k("removeFromPack"),variant:"ghost",icon:s.jsx(Rn,{size:16}),onClick:()=>h(B.id)})]},B.id))}),R.length>0&&s.jsxs("div",{className:"mt-2 flex gap-2",children:[s.jsxs(dt,{value:L,onChange:B=>_(B.target.value),"aria-label":k("addToPack"),children:[s.jsx("option",{value:"",children:k("selectPack")}),R.map(B=>s.jsx("option",{value:B.id,children:B.name},B.id))]}),s.jsx(ue,{variant:"primary",disabled:!L,onClick:()=>L&&p(L),children:k("addToPack")})]})]})]})})};function $A(n){const{t:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState(null),[f,m]=y.useState(!1);return{phase:o,busy:f,requestDelete:x=>{x.length&&d({kind:"ask",ids:x})},run:async(x,b)=>{var S;m(!0);try{if(x.length===1&&!b){try{await $.deleteSticker(x[0],!1),r(i("deleted"),"success"),d(null),n()}catch(j){if(j instanceof Mt&&j.code==="IN_USE"){const L=Array.isArray((S=j.data)==null?void 0:S.packs)?j.data.packs:[];d({kind:"inUse",ids:x,packs:L,otherSkipped:0})}else r(jt(i,j),"error")}return}const A=await $.bulkStickers({action:"delete",ids:x,confirm:b}),k=A.skipped.filter(j=>j.code==="IN_USE").map(j=>j.id),N=A.skipped.length-k.length;if(!b&&k.length>0){d({kind:"inUse",ids:k,packs:[],otherSkipped:N});return}N>0?r(i("skippedOther"),"warning"):r(i("deleted"),"success"),d(null),n()}catch(A){r(jt(i,A),"error")}finally{m(!1)}},close:()=>{f||d(null)}}}function WA(n,i,r){const o=new Map(r.map(f=>[f.id,f.name])),d=new Map;for(const f of n){const m=i.find(p=>p.id===f);for(const p of(m==null?void 0:m.packIds)??[])d.set(p,o.get(p)||p)}return[...d].map(([f,m])=>({id:f,name:m}))}function fw({items:n,packs:i,selectedIds:r,clearSelection:o,reload:d,fromPackId:f,isConnected:m,gifEnabled:p,onOpenInCreate:h,onPackCreated:v}){var pe,fe,G;const{t:x}=Ue(),{toast:b}=Et(),S=y.useRef(!1),[A,k]=y.useState(null),[N,j]=y.useState(null),[L,_]=y.useState([]),[F,R]=y.useState([]),[ne,B]=y.useState(!1),M=$A(()=>{k(null),o(),d()}),T=n.find(ce=>ce.id===A)||null,H=r.length>sb?x("stickerExportLimit"):null,O=m?r.length>vA?x("stickerSendLimit"):null:x("notConnectedHint"),W=((pe=M.phase)==null?void 0:pe.kind)==="inUse"?M.phase.packs.length?M.phase.packs:WA(M.phase.ids,n,i):[],Z=ce=>{ce.ok&&(ce.via==="host"?b(Ut(x("stickerShareSaved"),{dir:ce.dir}),"success"):ce.via==="share"?b(x("shareDone"),"success"):b(x("downloaded"),"success"))},se=async ce=>{if(!S.current){S.current=!0;try{await ce()}catch(ie){b(jt(x,ie),"error")}finally{S.current=!1}}},E=ce=>n.find(ie=>ie.id===ce),z=(ce,ie,de)=>se(async()=>{if(!ce.length||ce.length>sb)return;const C=ce.length===1?E(ce[0]):null,Y=ce.some(me=>{var te;return(te=E(me))==null?void 0:te.animated});ie==="png"&&Y&&b(x("firstFrameHint"),"info");const K=ce.length===1&&C?await(de?rw(C,ie):Rr(C,ie)):await(de?xA(ce,ie):gA(ce,ie));Z(K),K.ok&&(await Zm(ce),d())}),q=(ce,ie)=>se(async()=>{if(!ce.length)return;const de=await $.bulkStickers({action:ie?"favorite":"unfavorite",ids:ce});b(de.skipped.length?x("skippedOther"):x("saved"),de.skipped.length?"warning":"success"),d()}),le=(ce,ie,de)=>se(async()=>{if(!de.length)return;const C=await $.bulkStickers({action:ce,ids:de,packId:ie,...ce==="moveToPack"&&f?{fromPackId:f}:{}}),Y=x(ce==="addToPack"?"addedToPack":"movedToPack");b(C.skipped.length?x("skippedOther"):Y,C.skipped.length?"warning":"success"),j(null),d()});return{exportReason:H,sendReason:O,openDetail:ce=>k(ce.id),toggleFavorite:ce=>void q([ce.id],!ce.favorite),favorite:()=>void q(r,!0),unfavorite:()=>void q(r,!1),askAdd:()=>{_(r),j("add")},askMove:()=>{_(r),j("move")},remove:()=>{!f||!r.length||se(async()=>{const ce=await $.bulkStickers({action:"removeFromPack",ids:r,packId:f});b(ce.skipped.length?x("skippedOther"):x("removedFromPack"),ce.skipped.length?"warning":"success"),o(),d()})},download:()=>void z(r,"webp",!1),convert:()=>void z(r,"png",!1),share:()=>void z(r,"webp",!0),askSend:()=>{O||!r.length||R(r)},askDelete:()=>M.requestDelete(r),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(uw,{open:N!==null,title:x(N==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>j(null),onCreated:v,onPick:ce=>void le(N==="move"?"moveToPack":"addToPack",ce,L)}),s.jsx(gh,{open:F.length>0,busy:ne,onClose:()=>R([]),onPick:ce=>{se(async()=>{B(!0);try{(await $.sendStickers({ids:F,jid:ce})).sent>0?(b(F.length>1?x("stickersSent"):x("stickerSent"),"success"),R([]),d()):b(x("stickerErr_NOT_CONNECTED"),"error")}finally{B(!1)}})}}),s.jsx(QA,{open:M.phase!==null,busy:M.busy,count:((fe=M.phase)==null?void 0:fe.ids.length)??0,inUse:((G=M.phase)==null?void 0:G.kind)==="inUse",packs:W,onClose:M.close,onConfirm:()=>{M.phase&&M.run(M.phase.ids,!1)},onConfirmEverywhere:()=>{M.phase&&M.run(M.phase.ids,!0)}}),s.jsx(ZA,{sticker:T,packs:i,isConnected:m,gifEnabled:p,onClose:()=>k(null),onRename:ce=>{if(T){if([...ce.trim()].length>au){b(x("stickerNameTooLong"),"warning");return}se(async()=>{await $.updateSticker(T.id,{name:ce.trim()}),b(x("renamed"),"success"),d()})}},onFavorite:ce=>{T&&se(async()=>{await $.updateSticker(T.id,{favorite:ce}),b(x("saved"),"success"),d()})},onAddToPack:ce=>{T&&le("addToPack",ce,[T.id])},onRemoveFromPack:ce=>{T&&se(async()=>{await $.bulkStickers({action:"removeFromPack",ids:[T.id],packId:ce}),b(x("removedFromPack"),"success"),d()})},onDownload:ce=>{if(T){if(ce==="gif"){se(async()=>{const ie=await Rr(T,"gif");Z(ie),ie.ok&&(await Zm([T.id]),d())});return}z([T.id],ce,!1)}},onShare:()=>{T&&z([T.id],"webp",!0)},onSend:()=>{T&&m&&R([T.id])},onDelete:()=>{T&&M.requestDelete([T.id])},onOpenInCreate:()=>{T&&(k(null),h(T))}})]})}}const JA="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:16px_16px]",mw=({sticker:n,selected:i,onToggle:r,onOpen:o,onFavorite:d})=>{const{t:f}=Ue(),m=n.name||f("stickerPreview");return s.jsxs("div",{className:qe("relative aspect-square overflow-hidden rounded-xl border bg-panel transition-shadow",i?"border-brand-blue ring-2 ring-brand-blue/50":"border-line"),children:[s.jsx(ue,{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 focus-visible:ring-inset",children:s.jsx("img",{src:n.thumbUrl,alt:"",loading:"lazy",draggable:!1,className:qe("h-full w-full object-contain",JA)})}),s.jsx(Oe,{label:f(i?"deselectSticker":"stickerSelect"),role:"checkbox","aria-checked":i,"aria-pressed":i,variant:"ghost",className:"absolute top-0.5 start-0.5 z-10 size-10 min-h-10 min-w-10 p-0 hover:bg-transparent focus-visible:ring-offset-0",onClick:p=>r(p.shiftKey),icon:s.jsx("span",{className:qe("flex size-7 items-center justify-center rounded-lg border transition-all shadow-xs",i?"border-brand-blue bg-brand-blue text-white":"border-line/70 bg-panel/85 text-muted backdrop-blur-xs hover:border-line hover:text-text-main"),children:s.jsx(gi,{size:14,strokeWidth:i?3:2.5,className:i?void 0:"opacity-40"})})}),n.animated&&s.jsx(et,{tone:"neutral",className:"pointer-events-none absolute bottom-1 start-1 z-10 px-1.5 py-0.5 text-[10px] font-bold",children:f("gifBadge")}),s.jsx(Oe,{label:n.favorite?f("unfavorite"):f("favorite"),"aria-pressed":n.favorite,variant:"ghost",className:"absolute top-0.5 end-0.5 z-10 size-10 min-h-10 min-w-10 p-0 hover:bg-transparent focus-visible:ring-offset-0",onClick:d,icon:s.jsx("span",{className:qe("flex size-7 items-center justify-center rounded-lg border transition-all shadow-xs",n.favorite?"border-warn/50 bg-panel/90 text-warn backdrop-blur-xs":"border-line/70 bg-panel/85 text-muted backdrop-blur-xs hover:border-line hover:text-text-main"),children:s.jsx(Kc,{size:14,className:n.favorite?"fill-warn text-warn":void 0})})}),s.jsx("span",{className:"sr-only",children:m})]})},eT=({items:n,total:i,page:r,pageCount:o,loading:d,error:f,emptyText:m,isFiltered:p,selected:h,onToggle:v,onOpen:x,onFavorite:b,onPageChange:S,onRetry:A,onClearFilters:k,onGoCreate:N})=>{const{t:j}=Ue();return s.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[d&&n.length===0?s.jsx(_s,{text:j("loading")}):f?s.jsx(mt,{kind:"error",description:f,action:s.jsx(ue,{onClick:A,children:j("retryLoad")})}):n.length===0?p?s.jsx(mt,{kind:"no-results",description:m,action:k?s.jsx(ue,{variant:"secondary",onClick:k,children:j("reset")}):void 0}):s.jsx(mt,{kind:"empty",icon:s.jsx(nh,{size:28,className:"text-muted"}),description:m,action:N?s.jsx(ue,{variant:"primary",onClick:N,children:j("createBtn")}):void 0}):s.jsx("div",{className:qe("grid grid-cols-3 min-[390px]:grid-cols-4 sm:grid-cols-5 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10 gap-2 sm:gap-3 transition-opacity",d&&"opacity-60 pointer-events-none"),children:n.map((L,_)=>s.jsx(mw,{sticker:L,selected:h.has(L.id),onToggle:F=>v(_,F),onOpen:()=>x(L),onFavorite:()=>b(L)},L.id))}),i>0&&s.jsx(ki,{page:r,pageCount:o,total:i,onPageChange:S,className:"pt-1"})]})};function hw(n,i){const[r,o]=y.useState(new Set),d=y.useRef(null),f=y.useRef(i);return y.useEffect(()=>{f.current!==i&&(f.current=i,o(new Set),d.current=null)},[i]),{selected:r,toggle:(v,x)=>{const b=n[v];b&&o(S=>{const A=new Set(S);if(x&&d.current!=null){const k=Math.min(d.current,v),N=Math.max(d.current,v);for(let j=k;j<=N;j++){const L=n[j];L&&A.add(L)}return A}return A.has(b)?A.delete(b):A.add(b),d.current=v,A})},selectAll:()=>{o(v=>{const x=new Set(v);for(const b of n)b&&x.add(b);return x})},clear:()=>{d.current=null,o(new Set)}}}const Cr=24;function tT(n){const{t:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState(""),[f,m]=y.useState(""),[p,h]=y.useState(n==="recent"?"recent":"newest"),[v,x]=y.useState(n),[b,S]=y.useState(""),[A,k]=y.useState(1),[N,j]=y.useState(null),[L,_]=y.useState(0),[F,R]=y.useState([]),[ne,B]=y.useState(!0),[M,T]=y.useState(null),H=y.useRef(0),O=`${f}|${v}|${p}|${b}`;y.useEffect(()=>{x(n)},[n]),y.useEffect(()=>{const pe=setTimeout(()=>m(o),300);return()=>clearTimeout(pe)},[o]);const W=y.useCallback(()=>{$.getPacks().then(pe=>R(pe.packs)).catch(()=>{})},[]);y.useEffect(()=>{W()},[W]);const Z=y.useCallback(async pe=>{const fe=++H.current;B(!0),T(null);const G=Math.max(0,(pe-1)*Cr);try{const ce=await $.getStickers({q:f||void 0,sort:p,filter:v,pack:b||void 0,offset:G,limit:Cr});if(fe!==H.current)return;const ie=ce.total,de=Math.max(1,Math.ceil(ie/Cr));if(pe>de){k(de);return}j({page:pe,filterKey:O,items:ce.items}),_(ie)}catch(ce){if(fe!==H.current)return;const ie=jt(i,ce);T({page:pe,filterKey:O,message:ie}),r(ie,"error")}finally{fe===H.current&&B(!1)}},[f,p,v,b,O,i,r]),se=y.useRef(O);y.useEffect(()=>{if(se.current!==O&&(se.current=O,A!==1)){k(1);return}Z(A)},[O,A,Z]);const E=y.useCallback(()=>{W(),Z(A)},[Z,W,A]),z=y.useCallback(pe=>{k(Math.max(1,Math.floor(pe)||1))},[]),q=(N==null?void 0:N.page)===A&&N.filterKey===O,le=(M==null?void 0:M.page)===A&&M.filterKey===O?M.message:null;return{q:o,setQ:d,sort:p,setSort:h,filter:v,setFilter:x,pack:b,setPack:S,page:A,setPage:z,pageCount:Math.max(1,Math.ceil(L/Cr)),pageSize:Cr,items:q?N.items:[],loadedItems:(N==null?void 0:N.items)??null,total:L,packs:F,loading:ne||!q&&!le,error:le,reload:E,loadPacks:W,lockedFilter:n!=="all"}}const _m=({preset:n,isConnected:i,gifEnabled:r,refreshKey:o,onOpenInCreate:d,onGoCreate:f})=>{const{t:m}=Ue(),p=tT(n),h=p.items.map(B=>B.id),v=`${p.q}|${p.filter}|${p.sort}|${p.pack}`,x=hw(h,v),b=[...x.selected],S=y.useRef({key:v,loadedItems:null,stickers:new Map});if(S.current.key!==v&&(S.current={key:v,loadedItems:p.loadedItems,stickers:new Map}),p.loadedItems&&S.current.loadedItems!==p.loadedItems){for(const B of p.loadedItems)S.current.stickers.set(B.id,B);S.current.loadedItems=p.loadedItems}const A=new Map(p.items.map(B=>[B.id,B]));for(const B of b){const M=S.current.stickers.get(B);M&&!A.has(B)&&A.set(B,M)}const k=p.pack&&p.pack!=="none"?p.pack:void 0,N=y.useRef(p.reload);N.current=p.reload,y.useEffect(()=>{o!==0&&N.current()},[o]);const j=fw({items:[...A.values()],packs:p.packs,selectedIds:b,clearSelection:x.clear,reload:p.reload,fromPackId:k,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:p.loadPacks}),L=!!(p.q||p.pack||!p.lockedFilter&&p.filter!=="all"),_=m(L?"noResults":n==="favorites"?"favoritesEmpty":n==="recent"?"recentEmpty":"emptyLibrary"),F=[...A.values()].some(B=>x.selected.has(B.id)&&B.animated),R=(p.lockedFilter||p.filter==="all"?0:1)+(p.pack?1:0),ne=()=>{p.setQ(""),p.lockedFilter||p.setFilter("all"),p.setPack("")};return s.jsxs("div",{className:qe("flex flex-col gap-3 min-w-0",b.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs(vl,{children:[s.jsx(Be,{type:"search",value:p.q,onChange:B=>p.setQ(B.target.value),placeholder:m("searchStickers"),"aria-label":m("searchStickers"),className:"min-w-48 flex-1"}),s.jsxs(yl,{label:m("filter"),resetLabel:m("reset"),activeCount:R,onReset:()=>{p.lockedFilter||p.setFilter("all"),p.setPack("")},children:[!p.lockedFilter&&s.jsxs(dt,{"aria-label":m("filterBy"),value:p.filter,onChange:B=>p.setFilter(B.target.value),children:[s.jsx("option",{value:"all",children:m("allStickers")}),s.jsx("option",{value:"favorites",children:m("favorites")}),s.jsx("option",{value:"recent",children:m("recent")}),s.jsx("option",{value:"animated",children:m("animated")}),s.jsx("option",{value:"static",children:m("static")})]}),s.jsxs(dt,{"aria-label":m("packFilter"),value:p.pack,onChange:B=>p.setPack(B.target.value),children:[s.jsx("option",{value:"",children:m("anyPack")}),s.jsx("option",{value:"none",children:m("noPack")}),p.packs.map(B=>s.jsx("option",{value:B.id,children:B.name},B.id))]})]}),s.jsx(Pr,{label:m("sort"),value:p.sort,onChange:B=>p.setSort(B),options:[{value:"newest",label:m("sortNewest")},{value:"oldest",label:m("sortOldest")},{value:"name",label:m("sortName")},{value:"recent",label:m("sortRecent")}]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2 px-0.5 text-xs text-muted",children:[s.jsx("span",{children:m("resultCount").replace("{n}",String(p.total))}),p.items.length>0&&s.jsx(ue,{variant:"ghost",size:"sm",onClick:x.selectAll,children:m(p.pageCount>1?"selectCurrentPage":"selectAll")})]}),s.jsx(dw,{count:b.length,animatedSelected:F,canRemove:!!k,sendReason:b.length?j.sendReason:null,exportReason:b.length?j.exportReason:null,onSelectAll:x.selectAll,selectAllLabel:m(p.pageCount>1?"selectCurrentPage":"selectAll"),onClear:x.clear,onFavorite:j.favorite,onUnfavorite:j.unfavorite,onAdd:j.askAdd,onMove:j.askMove,onRemove:j.remove,onDownload:j.download,onConvert:j.convert,onShare:j.share,onSend:j.askSend,onDelete:j.askDelete}),s.jsx(eT,{items:p.items,total:p.total,page:p.page,pageCount:p.pageCount,loading:p.loading,error:p.error,emptyText:_,isFiltered:L,selected:x.selected,onToggle:x.toggle,onOpen:j.openDetail,onFavorite:j.toggleFavorite,onPageChange:p.setPage,onRetry:p.reload,onClearFilters:L?ne:void 0,onGoCreate:n==="all"&&!L?f:void 0}),j.dialogs]})},nT=({packId:n,isConnected:i,gifEnabled:r,onBack:o,onOpenInCreate:d})=>{const{t:f}=Ue(),{toast:m}=Et(),[p,h]=y.useState(null),[v,x]=y.useState([]),[b,S]=y.useState([]),[A,k]=y.useState(!0),[N,j]=y.useState(null),[L,_]=y.useState(0),[F,R]=y.useState(!1),ne=y.useRef(""),{page:B,pageCount:M,pageItems:T,setPage:H,total:O}=Zc(v,48,n),W=T.map(G=>G.id),Z=hw(W,n),se=[...Z.selected];y.useEffect(()=>{if(L<0)return;let G=!0;return j(null),Promise.all([$.getPack(n),$.getPacks()]).then(([ce,ie])=>{G&&(h(ce.pack),x(ce.items),S(ie.packs))}).catch(ce=>{G&&j(jt(f,ce))}).finally(()=>{G&&k(!1)}),()=>{G=!1}},[n,L,f]);const E=()=>{k(v.length===0),_(G=>G+1)},z=fw({items:v,packs:b,selectedIds:se,clearSelection:Z.clear,reload:E,fromPackId:n,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:E}),q=async G=>{const ce=v;x(G),R(!0);try{await $.reorderPack(n,G.map(ie=>ie.id))}catch(ie){x(ce),m(jt(f,ie),"error")}finally{R(!1)}},le=(G,ce)=>{const ie=G+ce;if(F||ie<0||ie>=v.length)return;const de=v.slice(),[C]=de.splice(G,1);C&&(de.splice(ie,0,C),q(de))},pe=G=>{const ce=v.findIndex(Y=>Y.id===ne.current),ie=v.findIndex(Y=>Y.id===G);if(ne.current="",F||ce<0||ie<0||ce===ie)return;const de=v.slice(),[C]=de.splice(ce,1);C&&(de.splice(ie,0,C),q(de))},fe=v.some(G=>Z.selected.has(G.id)&&G.animated);return s.jsxs("div",{className:qe("flex flex-col gap-3 min-w-0",se.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(ue,{onClick:o,children:[s.jsx(Lr,{size:16,className:"rtl:-scale-x-100"}),f("backToPacks")]}),p&&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(ln,{children:p.name})}),s.jsx("p",{className:"text-xs text-muted",children:Ut(f("stickerCount"),{n:p.count})})]})]}),A&&v.length===0&&s.jsx(_s,{text:f("loading")}),N&&v.length===0&&s.jsx(mt,{kind:"error",description:N,action:s.jsx(ue,{onClick:E,children:f("retryLoad")})}),!A&&!N&&v.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(Zy,{size:28,className:"text-muted"}),description:f("packEmpty")}),v.length>0&&s.jsxs(s.Fragment,{children:[se.length===0&&s.jsx("div",{children:s.jsx(ue,{variant:"ghost",size:"sm",onClick:Z.selectAll,children:f(M>1?"selectCurrentPage":"selectAll")})}),s.jsx(dw,{count:se.length,animatedSelected:fe,canRemove:!0,sendReason:se.length?z.sendReason:null,exportReason:se.length?z.exportReason:null,onSelectAll:Z.selectAll,selectAllLabel:f(M>1?"selectCurrentPage":"selectAll"),onClear:Z.clear,onFavorite:z.favorite,onUnfavorite:z.unfavorite,onAdd:z.askAdd,onMove:z.askMove,onRemove:z.remove,onDownload:z.download,onConvert:z.convert,onShare:z.share,onSend:z.askSend,onDelete:z.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:T.map((G,ce)=>{const ie=(B-1)*48+ce;return s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:de=>de.preventDefault(),onDrop:de=>{de.preventDefault(),pe(G.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(mw,{sticker:G,selected:Z.selected.has(G.id),onToggle:de=>Z.toggle(ce,de),onOpen:()=>z.openDetail(G),onFavorite:()=>z.toggleFavorite(G)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold",children:s.jsx(ln,{children:G.name||f("stickerPreview")})}),s.jsx(Oe,{label:f("reorderUp"),disabled:F||ie===0,onClick:()=>le(ie,-1),children:s.jsx(Dk,{size:14})}),s.jsx(Oe,{label:f("reorderDown"),disabled:F||ie===v.length-1,onClick:()=>le(ie,1),children:s.jsx(ul,{size:14})}),s.jsx(Oe,{label:f("reorderDragHint"),variant:"ghost",className:"cursor-grab",draggable:!F,onDragStart:de=>{ne.current=G.id,de.dataTransfer.effectAllowed="move",de.dataTransfer.setData("text/plain",G.id)},icon:s.jsx(Zy,{size:16})})]},G.id)})}),s.jsx(ki,{page:B,pageCount:M,total:O,onPageChange:H})]}),z.dialogs]})},aT=({isConnected:n,gifEnabled:i,onOpenInCreate:r})=>{const{t:o}=Ue(),{toast:d}=Et(),[f,m]=y.useState([]),[p,h]=y.useState(!0),[v,x]=y.useState(null),[b,S]=y.useState(""),[A,k]=y.useState(null),[N,j]=y.useState(!1),[L,_]=y.useState(null),[F,R]=y.useState(null),[ne,B]=y.useState(""),[M,T]=y.useState(null),[H,O]=y.useState(!1),[W,Z]=y.useState(null),[se,E]=y.useState(""),z=y.useCallback(()=>{x(null),$.getPacks().then(G=>m(G.packs)).catch(G=>x(jt(o,G))).finally(()=>h(!1))},[o]);y.useEffect(()=>{z()},[z]);const q=async()=>{if(zr(b)){k(o("packNameLength"));return}j(!0),k(null);try{await $.createPack(b.trim()),S(""),d(o("packCreated"),"success"),z()}catch(G){d(jt(o,G),"error")}finally{j(!1)}},le=async()=>{if(F){if(zr(ne)){d(o("packNameLength"),"warning");return}j(!0);try{await $.updatePack(F.id,ne.trim()),d(o("packRenamed"),"success"),R(null),z()}catch(G){d(jt(o,G),"error")}finally{j(!1)}}},pe=async()=>{if(M){j(!0);try{await $.deletePack(M.id,H),d(o("packDeleted"),"success"),T(null),O(!1),z()}catch(G){d(jt(o,G),"error")}finally{j(!1)}}},fe=async()=>{if(W){if(!se){d(o("noDestinationPack"),"warning");return}j(!0);try{await $.mergePack(W.id,se),d(o("packsMerged"),"success"),Z(null),E(""),z()}catch(G){d(jt(o,G),"error")}finally{j(!1)}}};return L?s.jsx(nT,{packId:L,isConnected:n,gifEnabled:i,onOpenInCreate:r,onBack:()=>{_(null),z()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Be,{value:b,onChange:G=>{const ce=G.target.value;S(ce),A&&k(zr(ce)?o("packNameLength"):null)},onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),q())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),dir:"auto",maxLength:ow+20,className:"min-w-0 flex-1"}),s.jsxs(ue,{variant:"primary",onClick:()=>void q(),disabled:N,icon:s.jsx(dl,{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")})]})]}),A&&s.jsx("p",{className:"text-xs text-danger",children:A}),p&&s.jsx(_s,{text:o("loading")}),v&&!p&&s.jsx(mt,{kind:"error",description:v,action:s.jsx(ue,{onClick:z,children:o("retryLoad")})}),!p&&!v&&f.length===0&&s.jsx(mt,{kind:"empty",icon:s.jsx(zm,{size:28,className:"text-muted"}),description:o("noPacks")}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f.map(G=>s.jsxs($e,{className:"flex items-center gap-3",children:[s.jsxs(ue,{variant:"ghost",onClick:()=>_(G.id),className:"h-auto min-h-11 min-w-0 flex-1 justify-start gap-3 px-1","aria-label":o("openPack"),children:[G.coverUrl?s.jsx("img",{src:G.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(zm,{size:20})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(ln,{lines:2,className:"font-bold text-text-main text-start",children:G.name}),s.jsx("span",{className:"block text-xs text-muted",children:Ut(o("stickerCount"),{n:G.count})})]})]}),s.jsxs(Yn,{label:o("moreActions"),children:[s.jsx(it,{icon:s.jsx(p0,{size:16}),onSelect:()=>{R(G),B(G.name)},children:o("renamePack")}),s.jsx(it,{icon:s.jsx(Zk,{size:16}),onSelect:()=>{Z(G),E("")},children:o("merge")}),s.jsx(Dr,{}),s.jsx(it,{danger:!0,icon:s.jsx(Mn,{size:16}),onSelect:()=>{T(G),O(!1)},children:o("deletePack")})]})]},G.id))}),s.jsx(an,{isOpen:F!==null,onClose:()=>R(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(ue,{onClick:()=>R(null),children:o("cancel")}),s.jsx(ue,{variant:"primary",onClick:()=>void le(),disabled:N,children:o("save")})]}),children:s.jsx(Be,{value:ne,onChange:G=>B(G.target.value),"aria-label":o("packName"),dir:"auto"})}),s.jsx(an,{isOpen:M!==null,onClose:()=>T(null),title:o("deletePackTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(ue,{onClick:()=>T(null),children:o("cancel")}),s.jsx(ue,{variant:"danger",onClick:()=>void pe(),disabled:N,children:o("delete")})]}),children:s.jsx(kn,{name:"delete-pack-mode",value:H?"stickers":"keep",onChange:G=>O(G==="stickers"),options:[{value:"keep",label:o("deleteKeepStickers")},{value:"stickers",label:o("deletePackAndStickers")}]})}),s.jsx(an,{isOpen:W!==null,onClose:()=>Z(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(ue,{onClick:()=>Z(null),children:o("cancel")}),s.jsx(ue,{variant:"primary",onClick:()=>void fe(),disabled:N||!se,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(dt,{id:"merge-into",value:se,onChange:G=>E(G.target.value),children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(G=>G.id!==(W==null?void 0:W.id)).map(G=>s.jsx("option",{value:G.id,children:G.name},G.id))]})]})})]})},sT=["library","packs","favorites","create","recent"];function rb(){const n=window.location.hash.replace(/^#/,"");if(n.startsWith("stickers/")){const i=n.slice(9);if(sT.includes(i))return i}return"library"}const lT=({isConnected:n})=>{const{t:i}=Ue(),{toast:r}=Et(),[o,d]=y.useState(rb),[f,m]=y.useState(o==="create"),[p,h]=y.useState(null),[v,x]=y.useState(null),[b,S]=y.useState(0),[A,k]=y.useState(null),[N,j]=y.useState(0),L=y.useCallback(()=>{let M=!0;return x(null),$.getStickerCapabilities().then(T=>{M&&h(T)}).catch(T=>{M&&x(jt(i,T))}),()=>{M=!1}},[i]);y.useEffect(()=>{if(!(b<0))return L()},[L,b]);const _=y.useCallback(M=>{d(M),M==="create"&&m(!0);const T=`stickers/${M}`;window.location.hash.replace(/^#/,"")!==T&&(window.location.hash=T)},[]);y.useEffect(()=>{const M=()=>d(rb());return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),y.useEffect(()=>{o==="create"&&m(!0)},[o]),y.useEffect(()=>(ib(M=>{if(M.type==="saved"){r(M.created?i("stickerCreated"):i("alreadyInLibrary"),M.created?"success":"info"),M.qualityReduced&&r(i("qualityReduced"),"info"),j(T=>T+1);return}r(ph(i,M.code),"error")}),()=>ib(null)),[i,r]),y.useEffect(()=>{const M=()=>{const H=KA();H&&(k(H),m(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};M();const T=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[]);const F=y.useCallback(()=>{YA(),k(null)},[]),R=y.useCallback(async M=>{try{const T=await fetch(M.url,{credentials:"same-origin"});if(!T.ok)throw new Error(String(T.status));const H=await T.blob(),O=M.name.trim(),W=O?O.toLowerCase().endsWith(".webp")?O:`${O}.webp`:"sticker.webp";k({blob:H,name:W,source:"PANEL_UPLOAD",...Rc()?{existingId:M.id}:{}}),_("create")}catch(T){r(jt(i,T),"error")}},[_,i,r]),ne=p!==null&&!p.webp,B=[{id:"library",label:i("library"),icon:s.jsx(Gk,{size:16})},{id:"packs",label:i("packs"),icon:s.jsx(zm,{size:16})},{id:"favorites",label:i("favorites"),icon:s.jsx(Kc,{size:16})},{id:"create",label:i("create"),icon:s.jsx(Rk,{size:16})},{id:"recent",label:i("recent"),icon:s.jsx(_b,{size:16})}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6 min-w-0",children:[s.jsx(xl,{icon:s.jsx(nh,{size:24}),title:i("stickers"),description:i("stickersDesc")}),ne&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(hl,{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 no-scrollbar px-4 sm:mx-0 sm:px-0","data-tour":"stickers-tabs",children:s.jsx($c,{"aria-label":i("stickers"),className:"min-w-max",value:o,onChange:_,options:B.map(M=>({value:M.id,label:M.label,icon:M.icon}))})}),o==="library"&&s.jsx(_m,{preset:"all",isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:N,onOpenInCreate:M=>void R(M),onGoCreate:()=>_("create")}),o==="favorites"&&s.jsx(_m,{preset:"favorites",isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:N,onOpenInCreate:M=>void R(M),onGoCreate:()=>_("create")}),o==="recent"&&s.jsx(_m,{preset:"recent",isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:N,onOpenInCreate:M=>void R(M),onGoCreate:()=>_("create")}),o==="packs"&&s.jsx(aT,{isConnected:n,gifEnabled:(p==null?void 0:p.gif)===!0,onOpenInCreate:M=>void R(M)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(IA,{capabilities:p,capsError:v,onRetryCaps:()=>S(M=>M+1),incoming:A,onConsumedIncoming:F,isConnected:n,onGoLibrary:()=>_("library"),onCreated:()=>j(M=>M+1)})})]})},pw=["overview","connection","commands","ai","groups","autodelete","schedules","settings","logs","stickers"];function iT(){const n=window.location.hash.replace(/^#/,"").split("/")[0];return pw.includes(n)?n:"overview"}const rT=()=>{const{t:n}=Ue(),{toast:i}=Et(),[r,o]=y.useState(iT),[d,f]=y.useState(!1),{sessionStatus:m}=DC((k,N)=>{if(k==="status"){const j=N==null?void 0:N.state;i(`Connection state: ${j}`,"info")}}),[p,h]=y.useState(null),v=y.useCallback(async()=>{try{const k=await $.getSession();k!=null&&k.session?h({...k.session,qr:k.qr??null,pairingCode:k.pairingCode??null}):k!=null&&k.status&&h(k.status)}catch{}},[]);y.useEffect(()=>{v()},[v]);const x=p||m?{state:(m==null?void 0:m.state)||(p==null?void 0:p.state)||"idle",...p||{},...m||{}}:null,b=(x==null?void 0:x.connected)===!0||(x==null?void 0:x.state)==="connected";y.useEffect(()=>{const k=x==null?void 0:x.state,j=k==="starting"||k==="linking"||k==="reconnecting"||k==="waiting_for_qr"&&!(x!=null&&x.qr)&&!(x!=null&&x.pairingCode)?2e3:15e3,L=setInterval(()=>{v()},j);return()=>clearInterval(L)},[x==null?void 0:x.state,x==null?void 0:x.qr,x==null?void 0:x.pairingCode,v]);const S=k=>{o(k),window.location.hash=k};y.useEffect(()=>{const k=()=>{const N=window.location.hash.replace(/^#/,"").split("/")[0];pw.includes(N)&&o(N)};return window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[]);const A={overview:n("overview"),connection:n("connection"),commands:n("commands"),ai:n("ai"),groups:n("groups"),autodelete:n("autoDelete"),schedules:n("schedules"),settings:n("settings"),logs:n("logs"),stickers:n("stickers")};return y.useEffect(()=>DN(),[]),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(BN,{currentView:r,onSelectView:S,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(ON,{onToggleMobileMenu:()=>f(k=>!k),title:A[r]||"Dashboard",view:r,status:x}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[s.jsx(AN,{}),s.jsxs(C1,{children:[r==="overview"&&s.jsx(IE,{status:x,onNavigate:S}),r==="connection"&&s.jsx(OE,{status:x,onRefresh:v,onStatusUpdate:k=>h(N=>({...N||{},...k}))}),r==="ai"&&s.jsx(OC,{}),r==="commands"&&s.jsx(mE,{}),r==="schedules"&&s.jsx(iA,{isConnected:b,onNavigate:S}),r==="groups"&&s.jsx(PE,{}),r==="autodelete"&&s.jsx(eE,{}),r==="settings"&&s.jsx(pA,{}),r==="stickers"&&s.jsx(lT,{isConnected:b}),r==="logs"&&s.jsx(FE,{})]})]})]})]})},oT=()=>s.jsx(dj,{children:s.jsx(EN,{children:s.jsx(LN,{children:s.jsx(rT,{})})})}),ob=document.getElementById("root");ob&&hk.createRoot(ob).render(s.jsx(rk.StrictMode,{children:s.jsx(oT,{})}));
|