levix-bot 4.8.0 → 4.9.1
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-B1sOW2VX.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/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/defaults.cjs +2 -0
- package/src/config/secrets.cjs +71 -3
- package/src/config/settings.cjs +22 -1
- package/src/core/socket.js +4 -5
- package/src/db/db.cjs +66 -0
- package/src/db/store.cjs +264 -16
- package/src/diagnostics/crashReports.cjs +35 -9
- package/src/diagnostics/debugLog.cjs +405 -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 +5 -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
|
@@ -1,540 +0,0 @@
|
|
|
1
|
-
var Tw=Object.defineProperty;var Dw=(a,i,r)=>i in a?Tw(a,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[i]=r;var jy=(a,i,r)=>Dw(a,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 Um(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Nf={exports:{}},gr={};/**
|
|
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 Ny;function Rw(){if(Ny)return gr;Ny=1;var a=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:a,type:o,key:m,ref:d!==void 0?d:null,props:f}}return gr.Fragment=i,gr.jsx=r,gr.jsxs=r,gr}var Cy;function zw(){return Cy||(Cy=1,Nf.exports=Rw()),Nf.exports}var s=zw(),Cf={exports:{}},Ge={};/**
|
|
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 Ey;function Mw(){if(Ey)return Ge;Ey=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),C=Symbol.iterator;function k(E){return E===null||typeof E!="object"?null:(E=C&&E[C]||E["@@iterator"],typeof E=="function"?E:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,O={};function R(E,Q,V){this.props=E,this.context=Q,this.refs=O,this.updater=V||j}R.prototype.isReactComponent={},R.prototype.setState=function(E,Q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,Q,"setState")},R.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=R.prototype;function z(E,Q,V){this.props=E,this.context=Q,this.refs=O,this.updater=V||j}var se=z.prototype=new I;se.constructor=z,N(se,R.prototype),se.isPureReactComponent=!0;var B=Array.isArray;function D(){}var T={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function U(E,Q,V){var re=V.ref;return{$$typeof:a,type:E,key:Q,ref:re!==void 0?re:null,props:V}}function W(E,Q){return U(E.type,Q,E.props)}function ee(E){return typeof E=="object"&&E!==null&&E.$$typeof===a}function ue(E){var Q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(V){return Q[V]})}var ie=/\/+/g;function H(E,Q){return typeof E=="object"&&E!==null&&E.key!=null?ue(""+E.key):Q.toString(36)}function X(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(D,D):(E.status="pending",E.then(function(Q){E.status==="pending"&&(E.status="fulfilled",E.value=Q)},function(Q){E.status==="pending"&&(E.status="rejected",E.reason=Q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function me(E,Q,V,re,te){var ce=typeof E;(ce==="undefined"||ce==="boolean")&&(E=null);var he=!1;if(E===null)he=!0;else switch(ce){case"bigint":case"string":case"number":he=!0;break;case"object":switch(E.$$typeof){case a:case i:he=!0;break;case b:return he=E._init,me(he(E._payload),Q,V,re,te)}}if(he)return te=te(E),he=re===""?"."+H(E,0):re,B(te)?(V="",he!=null&&(V=he.replace(ie,"$&/")+"/"),me(te,Q,V,"",function(qe){return qe})):te!=null&&(ee(te)&&(te=W(te,V+(te.key==null||E&&E.key===te.key?"":(""+te.key).replace(ie,"$&/")+"/")+he)),Q.push(te)),1;he=0;var oe=re===""?".":re+":";if(B(E))for(var we=0;we<E.length;we++)re=E[we],ce=oe+H(re,we),he+=me(re,Q,V,ce,te);else if(we=k(E),typeof we=="function")for(E=we.call(E),we=0;!(re=E.next()).done;)re=re.value,ce=oe+H(re,we++),he+=me(re,Q,V,ce,te);else if(ce==="object"){if(typeof E.then=="function")return me(X(E),Q,V,re,te);throw Q=String(E),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return he}function de(E,Q,V){if(E==null)return E;var re=[],te=0;return me(E,re,"","",function(ce){return Q.call(V,ce,te++)}),re}function be(E){if(E._status===-1){var Q=E._result,V=Q();V.then(function(re){(E._status===0||E._status===-1)&&(E._status=1,E._result=re,V.status===void 0&&(V.status="fulfilled",V.value=re))},function(re){(E._status===0||E._status===-1)&&(E._status=2,E._result=re,V.status===void 0&&(V.status="rejected",V.reason=re))}),E._status===-1&&(E._status=0,E._result=V)}if(E._status===1)return E._result.default;throw E._result}var _=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=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(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function J(E){var Q=T.T,V={};V.types=Q!==null?Q.types:null,T.T=V;try{var re=E(),te=T.S;te!==null&&te(V,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(D,_)}catch(ce){_(ce)}finally{Q!==null&&V.types!==null&&(Q.types=V.types),T.T=Q}}function ye(E){var Q=T.T;if(Q!==null){var V=Q.types;V===null?Q.types=[E]:V.indexOf(E)===-1&&V.push(E)}else J(ye.bind(null,E))}var Se={map:de,forEach:function(E,Q,V){de(E,function(){Q.apply(this,arguments)},V)},count:function(E){var Q=0;return de(E,function(){Q++}),Q},toArray:function(E){return de(E,function(Q){return Q})||[]},only:function(E){if(!ee(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Ge.Activity=x,Ge.Children=Se,Ge.Component=R,Ge.Fragment=r,Ge.Profiler=d,Ge.PureComponent=z,Ge.StrictMode=o,Ge.Suspense=h,Ge.ViewTransition=w,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(E){return T.H.useMemoCache(E)}},Ge.addTransitionType=ye,Ge.cache=function(E){return function(){return E.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(E,Q,V){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var re=N({},E.props),te=E.key;if(Q!=null)for(ce in Q.key!==void 0&&(te=""+Q.key),Q)!F.call(Q,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&Q.ref===void 0||(re[ce]=Q[ce]);var ce=arguments.length-2;if(ce===1)re.children=V;else if(1<ce){for(var he=Array(ce),oe=0;oe<ce;oe++)he[oe]=arguments[oe+2];re.children=he}return U(E.type,te,re)},Ge.createContext=function(E){return E={$$typeof:m,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},Ge.createElement=function(E,Q,V){var re,te={},ce=null;if(Q!=null)for(re in Q.key!==void 0&&(ce=""+Q.key),Q)F.call(Q,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(te[re]=Q[re]);var he=arguments.length-2;if(he===1)te.children=V;else if(1<he){for(var oe=Array(he),we=0;we<he;we++)oe[we]=arguments[we+2];te.children=oe}if(E&&E.defaultProps)for(re in he=E.defaultProps,he)te[re]===void 0&&(te[re]=he[re]);return U(E,ce,te)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(E){return{$$typeof:p,render:E}},Ge.isValidElement=ee,Ge.lazy=function(E){return{$$typeof:b,_payload:{_status:-1,_result:E},_init:be}},Ge.memo=function(E,Q){return{$$typeof:y,type:E,compare:Q===void 0?null:Q}},Ge.startTransition=J,Ge.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ge.use=function(E){return T.H.use(E)},Ge.useActionState=function(E,Q,V){return T.H.useActionState(E,Q,V)},Ge.useCallback=function(E,Q){return T.H.useCallback(E,Q)},Ge.useContext=function(E){return T.H.useContext(E)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(E,Q){return T.H.useDeferredValue(E,Q)},Ge.useEffect=function(E,Q){return T.H.useEffect(E,Q)},Ge.useEffectEvent=function(E){return T.H.useEffectEvent(E)},Ge.useId=function(){return T.H.useId()},Ge.useImperativeHandle=function(E,Q,V){return T.H.useImperativeHandle(E,Q,V)},Ge.useInsertionEffect=function(E,Q){return T.H.useInsertionEffect(E,Q)},Ge.useLayoutEffect=function(E,Q){return T.H.useLayoutEffect(E,Q)},Ge.useMemo=function(E,Q){return T.H.useMemo(E,Q)},Ge.useOptimistic=function(E,Q){return T.H.useOptimistic(E,Q)},Ge.useReducer=function(E,Q,V){return T.H.useReducer(E,Q,V)},Ge.useRef=function(E){return T.H.useRef(E)},Ge.useState=function(E){return T.H.useState(E)},Ge.useSyncExternalStore=function(E,Q,V){return T.H.useSyncExternalStore(E,Q,V)},Ge.useTransition=function(){return T.H.useTransition()},Ge.version="19.3.0",Ge}var Ay;function Hm(){return Ay||(Ay=1,Cf.exports=Mw()),Cf.exports}var v=Hm();const Ow=Um(v);var Ef={exports:{}},xr={},Af={exports:{}},_f={};/**
|
|
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 _y;function Lw(){return _y||(_y=1,(function(a){function i(X,me){var de=X.length;X.push(me);e:for(;0<de;){var be=de-1>>>1,_=X[be];if(0<d(_,me))X[be]=me,X[de]=_,de=be;else break e}}function r(X){return X.length===0?null:X[0]}function o(X){if(X.length===0)return null;var me=X[0],de=X.pop();if(de!==me){X[0]=de;e:for(var be=0,_=X.length,J=_>>>1;be<J;){var ye=2*(be+1)-1,Se=X[ye],E=ye+1,Q=X[E];if(0>d(Se,de))E<_&&0>d(Q,Se)?(X[be]=Q,X[E]=de,be=E):(X[be]=Se,X[ye]=de,be=ye);else if(E<_&&0>d(Q,de))X[be]=Q,X[E]=de,be=E;else break e}}return me}function d(X,me){var de=X.sortIndex-me.sortIndex;return de!==0?de:X.id-me.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();a.unstable_now=function(){return m.now()-p}}var h=[],y=[],b=1,x=null,w=3,C=!1,k=!1,j=!1,N=!1,O=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function z(X){for(var me=r(y);me!==null;){if(me.callback===null)o(y);else if(me.startTime<=X)o(y),me.sortIndex=me.expirationTime,i(h,me);else break;me=r(y)}}function se(X){if(j=!1,z(X),!k)if(r(h)!==null)k=!0,B||(B=!0,ee());else{var me=r(y);me!==null&&H(se,me.startTime-X)}}var B=!1,D=-1,T=5,F=-1;function U(){return N?!0:!(a.unstable_now()-F<T)}function W(){if(N=!1,B){var X=a.unstable_now();F=X;var me=!0;try{e:{k=!1,j&&(j=!1,R(D),D=-1),C=!0;var de=w;try{t:{for(z(X),x=r(h);x!==null&&!(x.expirationTime>X&&U());){var be=x.callback;if(typeof be=="function"){x.callback=null,w=x.priorityLevel;var _=be(x.expirationTime<=X);if(X=a.unstable_now(),typeof _=="function"){x.callback=_,z(X),me=!0;break t}x===r(h)&&o(h),z(X)}else o(h);x=r(h)}if(x!==null)me=!0;else{var J=r(y);J!==null&&H(se,J.startTime-X),me=!1}}break e}finally{x=null,w=de,C=!1}me=void 0}}finally{me?ee():B=!1}}}var ee;if(typeof I=="function")ee=function(){I(W)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ie=ue.port2;ue.port1.onmessage=W,ee=function(){ie.postMessage(null)}}else ee=function(){O(W,0)};function H(X,me){D=O(function(){X(a.unstable_now())},me)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(X){X.callback=null},a.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<X?Math.floor(1e3/X):5},a.unstable_getCurrentPriorityLevel=function(){return w},a.unstable_next=function(X){switch(w){case 1:case 2:case 3:var me=3;break;default:me=w}var de=w;w=me;try{return X()}finally{w=de}},a.unstable_requestPaint=function(){N=!0},a.unstable_runWithPriority=function(X,me){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var de=w;w=X;try{return me()}finally{w=de}},a.unstable_scheduleCallback=function(X,me,de){var be=a.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?be+de:be):de=be,X){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=de+_,X={id:b++,callback:me,priorityLevel:X,startTime:de,expirationTime:_,sortIndex:-1},de>be?(X.sortIndex=de,i(y,X),r(h)===null&&X===r(y)&&(j?(R(D),D=-1):j=!0,H(se,de-be))):(X.sortIndex=_,i(h,X),k||C||(k=!0,B||(B=!0,ee()))),X},a.unstable_shouldYield=U,a.unstable_wrapCallback=function(X){var me=w;return function(){var de=w;w=me;try{return X.apply(this,arguments)}finally{w=de}}}})(_f)),_f}var Ty;function Bw(){return Ty||(Ty=1,Af.exports=Lw()),Af.exports}var Tf={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 Dy;function Uw(){if(Dy)return nn;Dy=1;var a=Hm();function i(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)x+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+b+"; visit "+x+" 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(b,x,w){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:C==null?null:C===m?m:""+C,children:b,containerInfo:x,implementation:w}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,nn.browser=function(b){return{$$typeof:f,_reason:b}},nn.createPortal=function(b,x){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return p(b,x,null,w)},nn.flushSync=function(b){var x=h.T,w=o.p;try{if(h.T=null,o.p=2,b)return b()}finally{h.T=x,o.p=w,o.d.f()}},nn.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(b,x))},nn.prefetchDNS=function(b){typeof b=="string"&&o.d.D(b)},nn.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var w=x.as,C=y(w,x.crossOrigin),k=typeof x.integrity=="string"?x.integrity:void 0,j=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;w==="style"?o.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:C,integrity:k,fetchPriority:j}):w==="script"&&o.d.X(b,{crossOrigin:C,integrity:k,fetchPriority:j,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},nn.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var w=y(x.as,x.crossOrigin);o.d.M(b,{crossOrigin:w,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}}else x==null&&o.d.M(b)},nn.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var w=x.as,C=y(w,x.crossOrigin);o.d.L(b,w,{crossOrigin:C,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},nn.preloadModule=function(b,x){if(typeof b=="string")if(x){var w=y(x.as,x.crossOrigin);o.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:w,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}else o.d.m(b)},nn.requestFormReset=function(b){o.d.r(b)},nn.unstable_batchedUpdates=function(b,x){return b(x)},nn.useFormState=function(b,x,w){return h.H.useFormState(b,x,w)},nn.useFormStatus=function(){return h.H.useHostTransitionStatus()},nn.version="19.3.0",nn}var Ry;function Kb(){if(Ry)return Tf.exports;Ry=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Tf.exports=Uw(),Tf.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 zy;function Hw(){if(zy)return xr;zy=1;var a=Bw(),i=Hm(),r=Kb();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function 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 y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(l=c.return,l!==null){n=l;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return h(c),e;if(u===l)return h(c),t;u=u.sibling}throw Error(o(188))}if(n.return!==l.return)n=c,l=u;else{for(var g=!1,S=c.child;S;){if(S===n){g=!0,n=c,l=u;break}if(S===l){g=!0,l=c,n=u;break}S=S.sibling}if(!g){for(S=u.child;S;){if(S===n){g=!0,n=u,l=c;break}if(S===l){g=!0,l=u,n=c;break}S=S.sibling}if(!g)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function x(e,t,n,l,c,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,l,c,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&x(e.child,t,n,l,c,u))return!0;e=e.sibling}return!1}function w(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 C(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],n=w(e);return n===null||j(t,e,n.child,{foundSelf:!1}),t}function j(e,t,n,l){for(;n!==null;){if(n===t)l.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(l.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&j(e,t,n.child,l))return!0;n=n.sibling}return!1}function N(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 O=null,R=null;function I(e,t,n){return e===n?!0:e===t?(O=e,!0):!1}function z(e,t,n){return e===n?(R=e,!1):e===t?(R!==null&&(O=e),!0):!1}function se(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,n){for(var l=0,c=e;c;c=n(c))l++;c=0;for(var u=t;u;u=n(u))c++;for(;0<l-c;)e=n(e),l--;for(;0<c-l;)t=n(t),c--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,T=Symbol.for("react.element"),F=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),ue=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),H=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),be=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),ye=Symbol.for("react.legacy_hidden"),Se=Symbol.for("react.memo_cache_sentinel"),E=Symbol.for("react.view_transition"),Q=Symbol.for("react.recoverable"),V=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function ce(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 ue:return"Profiler";case ee:return"StrictMode";case me:return"Suspense";case de:return"SuspenseList";case J:return"Activity";case E:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case U:return"Portal";case H:return e.displayName||"Context";case ie:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case be:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case _:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var he=Array.isArray,oe=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qe={pending:!1,data:null,method:null,action:null},lt=[],ht=-1;function kt(e){return{current:e}}function Le(e){0>ht||(e.current=lt[ht],lt[ht]=null,ht--)}function xe(e,t){ht++,lt[ht]=e.current,e.current=t}var ze=kt(null),Ne=kt(null),Pe=kt(null),vt=kt(null);function ae(e,t){switch(xe(Pe,t),xe(Ne,e),xe(ze,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?zx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=zx(t),e=Mx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Le(ze),xe(ze,e)}function ne(){Le(ze),Le(Ne),Le(Pe)}function ve(e){var t=e.memoizedState;t!==null&&(ri._currentValue=t.memoizedState,xe(vt,e)),t=ze.current;var n=Mx(t,e.type);t!==n&&(xe(Ne,e),xe(ze,n))}function Te(e){Ne.current===e&&(Le(ze),Le(Ne)),vt.current===e&&(Le(vt),ri._currentValue=qe)}var jt,Xt;function Tt(e){if(jt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);jt=t&&t[1]||"",Xt=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+jt+e+Xt}var sn=!1;function qt(e,t){if(!e||sn)return"";sn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(je){var q=je}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(je){q=je}ge=!1;try{var Z=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ge=!0,new e}finally{ge&&(Z!==void 0?Object.defineProperty(e.prototype,"props",Z):delete e.prototype.props)}}}else{try{throw Error()}catch(je){q=je}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(je){if(je&&q&&typeof je.stack=="string")return[je.stack,q.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],S=u[1];if(g&&S){var A=g.split(`
|
|
44
|
-
`),G=S.split(`
|
|
45
|
-
`);for(c=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;c<G.length&&!G[c].includes("DetermineComponentFrameRoot");)c++;if(l===A.length||c===G.length)for(l=A.length-1,c=G.length-1;1<=l&&0<=c&&A[l]!==G[c];)c--;for(;1<=l&&0<=c;l--,c--)if(A[l]!==G[c]){if(l!==1||c!==1)do if(l--,c--,0>c||A[l]!==G[c]){var $=`
|
|
46
|
-
`+A[l].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=l&&0<=c);break}}}finally{sn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Tt(n):""}function wi(e,t){switch(e.tag){case 26:case 27:case 5:return Tt(e.type);case 16:return Tt("Lazy");case 13:return e.child!==t&&t!==null?Tt("Suspense Fallback"):Tt("Suspense");case 19:return Tt("SuspenseList");case 0:case 15:return qt(e.type,!1);case 11:return qt(e.type.render,!1);case 1:return qt(e.type,!0);case 31:return Tt("Activity");case 30:return Tt("ViewTransition");default:return""}}function yl(e){try{var t="",n=null;do t+=wi(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
-
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var Ia=Object.prototype.hasOwnProperty,_s=a.unstable_scheduleCallback,Fa=a.unstable_cancelCallback,ki=a.unstable_shouldYield,bl=a.unstable_requestPaint,Rt=a.unstable_now,Ka=a.unstable_getCurrentPriorityLevel,Ts=a.unstable_ImmediatePriority,Ya=a.unstable_UserBlockingPriority,ka=a.unstable_NormalPriority,vl=a.unstable_LowPriority,le=a.unstable_IdlePriority,Re=a.log,tt=a.unstable_setDisableYieldValue,gt=null,St=null;function L(e){if(typeof Re=="function"&&tt(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(gt,e)}catch{}}var Ce=Math.clz32?Math.clz32:Yn,it=Math.log,bn=Math.LN2;function Yn(e){return e>>>=0,e===0?32:31-(it(e)/bn|0)|0}var Qn=256,sa=262144,la=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 ia(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var c=0,u=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var S=l&134217727;return S!==0?(l=S&~u,l!==0?c=Xn(l):(g&=S,g!==0?c=Xn(g):n||(n=S&~e,n!==0&&(c=Xn(n))))):(S=l&~u,S!==0?c=Xn(S):g!==0?c=Xn(g):n||(n=l&~e,n!==0&&(c=Xn(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function ji(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lh(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-Ce(n),c=1<<l;t|=e[l],n&=~c}return t}function I1(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 ih(){var e=la;return la<<=1,(la&62914560)===0&&(la=4194304),e}function Jc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ni(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function F1(e,t,n,l,c,u){var g=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,A=e.expirationTimes,G=e.hiddenUpdates;for(n=g&~n;0<n;){var $=31-Ce(n),ge=1<<$;S[$]=0,A[$]=-1;var q=G[$];if(q!==null)for(G[$]=null,$=0;$<q.length;$++){var Z=q[$];Z!==null&&(Z.lane&=-536870913)}n&=~ge}l!==0&&rh(e,l,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(g&~t))}function rh(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Ce(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function oh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Ce(n),c=1<<l;c&t|e[l]&t&&(e[l]|=t),n&=~c}}function ch(e,t){var n=t&-t;return n=(n&42)!==0?1:$c(n),(n&(e.suspendedLanes|t))!==0?0:n}function $c(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 Wc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function uh(){var e=we.p;return e!==0?e:(e=window.event,e===void 0?32:xy(e.type))}function dh(e,t){var n=we.p;try{return we.p=e,t()}finally{we.p=n}}var ja=Math.random().toString(36).slice(2),Zt="__reactFiber$"+ja,fn="__reactProps$"+ja,Sl="__reactContainer$"+ja,fh="__reactEvents$"+ja,K1="__reactListeners$"+ja,Y1="__reactHandles$"+ja,mh="__reactResources$"+ja,Ci="__reactMarker$"+ja,qr="__reactLoad$"+ja;function Pr(e){delete e[Zt],delete e[fn],delete e[K1],delete e[Y1]}function Ds(e){var t;if(t=e[Zt])return t;for(var n=e.parentNode;n;){if(t=n[Sl]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jx(e);e!==null;){if(n=e[Zt])return n;e=Jx(e)}return t}e=n,n=e.parentNode}return null}function wl(e){if(e=e[Zt]||e[Sl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ei(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function kl(e){var t=e[mh];return t||(t=e[mh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ft(e){e[Ci]=!0}function hh(e){e[qr]=void 0}var ph=new Set,gh={};function Rs(e,t){jl(e,t),jl(e+"Capture",t)}function jl(e,t){for(gh[e]=t,e=0;e<t.length;e++)ph.add(t[e])}var Q1=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]*$"),xh={},yh={};function X1(e){return Ia.call(yh,e)?!0:Ia.call(xh,e)?!1:Q1.test(e)?yh[e]=!0:(xh[e]=!0,!1)}var rt=!1;function bh(){var e=rt;return rt=!1,e}function Gr(e,t,n){if(X1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Vr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function Na(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,l)}}function vn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Z1(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(g){n=""+g,u.call(this,g)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function eu(e){if(!e._valueTracker){var t=vh(e)?"checked":"value";e._valueTracker=Z1(e,t,""+e[t])}}function Sh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=vh(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}var J1=/[\n"\\]/g;function _n(e){return e.replace(J1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tu(e,t,n,l,c,u,g,S){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=""+vn(t)):e.value!==""+vn(t)&&(e.value=""+vn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?g==="number"&&e.value==t?nu(e,vn(e.value)):nu(e,vn(t)):n!=null?nu(e,vn(n)):l!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+vn(S):e.removeAttribute("name")}function wh(e,t,n,l,c,u,g,S){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){eu(e);return}n=n!=null?""+vn(n):"",t=t!=null?""+vn(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=S?e.checked:!!l,e.defaultChecked=!!l,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),eu(e)}function nu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Nl(e,t,n,l){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&l&&(e[n].defaultSelected=!0)}else{for(n=""+vn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function kh(e,t,n){if(t!=null&&(t=""+vn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+vn(n):""}function jh(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(he(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=vn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),eu(e)}function Cl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $1=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 Nh(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||$1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ch(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",rt=!0);for(var c in t)l=t[c],t.hasOwnProperty(c)&&n[c]!==l&&(Nh(e,c,l),rt=!0)}else for(var u in t)t.hasOwnProperty(u)&&Nh(e,u,t[u])}function au(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 W1=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"]]),e2=/^[\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 Ir(e){return e2.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ra(){}var su=null;function lu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var El=null,Al=null;function Eh(e){var t=wl(e);if(t&&(e=t.stateNode)){var n=e[fn]||null;e:switch(e=t.stateNode,t.type){case"input":if(tu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_n(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var c=l[fn]||null;if(!c)throw Error(o(90));tu(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Sh(l)}break e;case"textarea":kh(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Nl(e,!!n.multiple,t,!1)}}}var iu=!1;function Ah(e,t,n){if(iu)return e(t,n);iu=!0;try{var l=e(t);return l}finally{if(iu=!1,(El!==null||Al!==null)&&(Fo(),El&&(t=El,e=Al,Al=El=null,Eh(t),e)))for(t=0;t<e.length;t++)Eh(e[t])}}function Ai(e,t){var n=e.stateNode;if(n===null)return null;var l=n[fn]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ru=!1;if(Ca)try{var _i={};Object.defineProperty(_i,"passive",{get:function(){ru=!0}}),window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch{ru=!1}var Qa=null,ou=null,Fr=null;function _h(){if(Fr)return Fr;var e,t=ou,n=t.length,l,c="value"in Qa?Qa.value:Qa.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var g=n-e;for(l=1;l<=g&&t[n-l]===c[u-l];l++);return Fr=c.slice(e,1<l?1-l:void 0)}function Kr(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 Yr(){return!0}function Th(){return!1}function on(e){function t(n,l,c,u,g){this._reactName=n,this._targetInst=c,this.type=l,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(u):u[S]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Yr:Th,this.isPropagationStopped=Th,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Yr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yr)},persist:function(){},isPersistent:Yr}),t}var Xa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qr=on(Xa),Ti=D({},Xa,{view:0,detail:0}),t2=on(Ti),cu,uu,Di,Xr=D({},Ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fu,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!==Di&&(Di&&e.type==="mousemove"?(cu=e.screenX-Di.screenX,uu=e.screenY-Di.screenY):uu=cu=0,Di=e),cu)},movementY:function(e){return"movementY"in e?e.movementY:uu}}),Dh=on(Xr),n2=D({},Xr,{dataTransfer:0}),a2=on(n2),s2=D({},Ti,{relatedTarget:0}),du=on(s2),l2=D({},Xa,{animationName:0,elapsedTime:0,pseudoElement:0}),i2=on(l2),r2=D({},Xa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),o2=on(r2),c2=D({},Xa,{data:0}),Rh=on(c2),u2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d2={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"},f2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function m2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=f2[e])?!!t[e]:!1}function fu(){return m2}var h2=D({},Ti,{key:function(e){if(e.key){var t=u2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Kr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?d2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fu,charCode:function(e){return e.type==="keypress"?Kr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),p2=on(h2),g2=D({},Xr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zh=on(g2),x2=D({},Xa,{submitter:0}),y2=on(x2),b2=D({},Ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fu}),v2=on(b2),S2=D({},Xa,{propertyName:0,elapsedTime:0,pseudoElement:0}),w2=on(S2),k2=D({},Xr,{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}),j2=on(k2),N2=D({},Xa,{newState:0,oldState:0,source:0}),C2=on(N2),E2=[9,13,27,32],mu=Ca&&"CompositionEvent"in window,Ri=null;Ca&&"documentMode"in document&&(Ri=document.documentMode);var A2=Ca&&"TextEvent"in window&&!Ri,Mh=Ca&&(!mu||Ri&&8<Ri&&11>=Ri),Oh=" ",Lh=!1;function Bh(e,t){switch(e){case"keyup":return E2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _l=!1;function _2(e,t){switch(e){case"compositionend":return Uh(t);case"keypress":return t.which!==32?null:(Lh=!0,Oh);case"textInput":return e=t.data,e===Oh&&Lh?null:e;default:return null}}function T2(e,t){if(_l)return e==="compositionend"||!mu&&Bh(e,t)?(e=_h(),Fr=ou=Qa=null,_l=!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 Mh&&t.locale!=="ko"?null:t.data;default:return null}}var D2={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 Hh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!D2[e.type]:t==="textarea"}function qh(e,t,n,l){El?Al?Al.push(l):Al=[l]:El=l,t=Jo(t,"onChange"),0<t.length&&(n=new Qr("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var zi=null,Mi=null;function R2(e){Ex(e,0)}function Zr(e){var t=Ei(e);if(Sh(t))return e}function Ph(e,t){if(e==="change")return t}var Gh=!1;if(Ca){var hu;if(Ca){var pu="oninput"in document;if(!pu){var Vh=document.createElement("div");Vh.setAttribute("oninput","return;"),pu=typeof Vh.oninput=="function"}hu=pu}else hu=!1;Gh=hu&&(!document.documentMode||9<document.documentMode)}function Ih(){zi&&(zi.detachEvent("onpropertychange",Fh),Mi=zi=null)}function Fh(e){if(e.propertyName==="value"&&Zr(Mi)){var t=[];qh(t,Mi,e,lu(e)),Ah(R2,t)}}function z2(e,t,n){e==="focusin"?(Ih(),zi=t,Mi=n,zi.attachEvent("onpropertychange",Fh)):e==="focusout"&&Ih()}function M2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zr(Mi)}function O2(e,t){if(e==="click")return Zr(t)}function L2(e,t){if(e==="input"||e==="change")return Zr(t)}function B2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sn=typeof Object.is=="function"?Object.is:B2;function Oi(e,t){if(Sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var c=n[l];if(!Ia.call(t,c)||!Sn(e[c],t[c]))return!1}return!0}function gu(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 Kh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yh(e,t){var n=Kh(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kh(n)}}function Qh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gu(e.document)}return t}function xu(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 U2=Ca&&"documentMode"in document&&11>=document.documentMode,Tl=null,yu=null,Li=null,bu=!1;function Zh(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bu||Tl==null||Tl!==gu(l)||(l=Tl,"selectionStart"in l&&xu(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}),Li&&Oi(Li,l)||(Li=l,l=Jo(yu,"onSelect"),0<l.length&&(t=new Qr("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Tl)))}function zs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Dl={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionrun:zs("Transition","TransitionRun"),transitionstart:zs("Transition","TransitionStart"),transitioncancel:zs("Transition","TransitionCancel"),transitionend:zs("Transition","TransitionEnd")},vu={},Jh={};Ca&&(Jh=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ms(e){if(vu[e])return vu[e];if(!Dl[e])return e;var t=Dl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jh)return vu[e]=t[n];return e}var $h=Ms("animationend"),Wh=Ms("animationiteration"),ep=Ms("animationstart"),H2=Ms("transitionrun"),q2=Ms("transitionstart"),P2=Ms("transitioncancel"),tp=Ms("transitionend"),np=new Map,Su="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(" ");Su.push("scrollEnd");function Zn(e,t){np.set(e,t),Rs(t,[e])}var G2=0;function Ea(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ea.identifierPrefix;var n=G2++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function ap(e){if(e==null||typeof e=="string")return e;var t=null,n=Jl;if(n!==null)for(var l=0;l<n.length;l++){var c=e[n[l]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function Aa(e,t){return e=ap(e),t=ap(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Jr=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)},Tn=[],Rl=0,wu=0;function $r(){for(var e=Rl,t=wu=Rl=0;t<e;){var n=Tn[t];Tn[t++]=null;var l=Tn[t];Tn[t++]=null;var c=Tn[t];Tn[t++]=null;var u=Tn[t];if(Tn[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&&sp(n,c,u)}}function Wr(e,t,n,l){Tn[Rl++]=e,Tn[Rl++]=t,Tn[Rl++]=n,Tn[Rl++]=l,wu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ku(e,t,n,l){return Wr(e,t,n,l),eo(e)}function Os(e,t){return Wr(e,null,null,t),eo(e)}function sp(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,l=u.alternate,l!==null&&(l.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Ce(n),e=u.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=n|536870912),u):null}function eo(e){if(50<sr)throw sr=0,Io=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zl={};function V2(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,n,l){return new V2(e,t,n,l)}function ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _a(e,t){var n=e.alternate;return n===null?(n=mn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function lp(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function to(e,t,n,l,c,u){var g=0;if(l=e,typeof l=="function")ju(l)&&(g=1);else if(typeof l=="string")g=xw(e,n,ze.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case J:return e=mn(31,n,t,c),e.elementType=J,e.lanes=u,e;case W:return Ls(n.children,c,u,t);case ee:g=8,c|=24;break;case ue:return e=mn(12,n,t,c|2),e.elementType=ue,e.lanes=u,e;case me:return e=mn(13,n,t,c),e.elementType=me,e.lanes=u,e;case de:return e=mn(19,n,t,c),e.elementType=de,e.lanes=u,e;case ye:case E:return e=c|32,e=mn(30,n,t,e),e.elementType=E,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 H:g=10;break e;case ie:g=9;break e;case X:g=11;break e;case be:g=14;break e;case _:g=16,l=null;break e}g=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=mn(g,n,t,c),t.elementType=e,t.type=l,t.lanes=u,t}function Ls(e,t,n,l){return e=mn(7,e,l,t),e.lanes=n,e}function Nu(e,t,n){return e=mn(6,e,null,t),e.lanes=n,e}function ip(e){var t=mn(18,null,null,0);return t.stateNode=e,t}function Cu(e,t,n){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rp=new WeakMap;function Dn(e,t){if(typeof e=="object"&&e!==null){var n=rp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:yl(t)},rp.set(e,t),t)}return{value:e,source:t,stack:yl(t)}}var Ml=[],Ol=0,no=null,Bi=0,Rn=[],zn=0,Za=null,oa=1,ca="";function Ta(e,t){Ml[Ol++]=Bi,Ml[Ol++]=no,no=e,Bi=t}function op(e,t,n){Rn[zn++]=oa,Rn[zn++]=ca,Rn[zn++]=Za,Za=e;var l=oa;e=ca;var c=32-Ce(l)-1;l&=~(1<<c),n+=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,oa=1<<32-Ce(t)+c|n<<c|l,ca=u+e}else oa=1<<u|n<<c|l,ca=e}function ao(e){e.return!==null&&(Ta(e,1),op(e,1,0))}function Eu(e){for(;e===no;)no=Ml[--Ol],Ml[Ol]=null,Bi=Ml[--Ol],Ml[Ol]=null;for(;e===Za;)Za=Rn[--zn],Rn[zn]=null,ca=Rn[--zn],Rn[zn]=null,oa=Rn[--zn],Rn[zn]=null}function cp(e,t){Rn[zn++]=oa,Rn[zn++]=ca,Rn[zn++]=Za,oa=t.id,ca=t.overflow,Za=e}var Kt=null,yt=null,Qe=!1,Ja=null,Mn=!1,Au=Error(o(519));function $a(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ui(Dn(t,e)),Au}function up(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Zt]=e,t[fn]=l,n){case"dialog":Je("cancel",t),Je("close",t);break;case"iframe":case"object":case"embed":Je("load",t);break;case"video":case"audio":for(n=0;n<ir.length;n++)Je(ir[n],t);break;case"source":Je("error",t);break;case"img":case"image":case"link":Je("error",t),Je("load",t);break;case"details":Je("toggle",t);break;case"input":Je("invalid",t),wh(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Je("invalid",t);break;case"textarea":Je("invalid",t),jh(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Dx(t.textContent,n)?(l.popover!=null&&(Je("beforetoggle",t),Je("toggle",t)),l.onScroll!=null&&Je("scroll",t),l.onScrollEnd!=null&&Je("scrollend",t),l.onClick!=null&&(t.onclick=ra),t=!0):t=!1,t||$a(e,!0)}function so(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:Mn=!1;return;case 27:case 3:Mn=!0;return;default:Kt=Kt.return}}function Ll(e){if(e!==Kt)return!1;if(!Qe)return so(e),Qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||sf(e.type,e.memoizedProps)),n=!n),n&&yt&&$a(e),so(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));yt=Zx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));yt=Zx(e)}else t===27?(t=yt,hs(e.type)?(e=hf,hf=null,yt=e):yt=t):yt=Kt?Ln(e.stateNode.nextSibling):null;return!0}function Bs(){yt=Kt=null,Qe=!1}function _u(){var e=Ja;return e!==null&&(gn===null?gn=e:gn.push.apply(gn,e),Ja=null),e}function Ui(e){Ja===null?Ja=[e]:Ja.push(e)}var Tu=kt(null),Us=null,Da=null;function Wa(e,t,n){xe(Tu,t._currentValue),t._currentValue=n}function Ra(e){e._currentValue=Tu.current,Le(Tu)}function lo(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Du(e,t,n,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 S=u;u=c;for(var A=0;A<t.length;A++)if(S.context===t[A]){u.lanes|=n,S=u.alternate,S!==null&&(S.lanes|=n),lo(u.return,n,e),l||(g=null);break e}u=S.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(o(341));g.lanes|=n,u=g.alternate,u!==null&&(u.lanes|=n),lo(g,n,e),g=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=n,g=c.alternate,g!==null&&(g.lanes|=n),lo(c.return,n,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 Hs(e,t,n,l){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(o(387));if(g=g.memoizedProps,g!==null){var S=c.type;Sn(c.pendingProps.value,g.value)||(e!==null?e.push(S):e=[S])}}else if(c===vt.current){if(g=c.alternate,g===null)throw Error(o(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ri):e=[ri])}c=c.return}return e!==null&&Du(t,e,n,l),t.flags|=262144,e!==null}function io(e){for(e=e.firstContext;e!==null;){if(!Sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qs(e){Us=e,Da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return dp(Us,e)}function ro(e,t){return Us===null&&qs(e),dp(e,t)}function dp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Da===null){if(e===null)throw Error(o(308));Da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Da=Da.next=t;return n}var I2=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},F2=a.unstable_scheduleCallback,K2=a.unstable_NormalPriority,zt={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ru(){return{controller:new I2,data:new Map,refCount:0}}function Hi(e){e.refCount--,e.refCount===0&&F2(K2,function(){e.controller.abort()})}function fp(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];n.indexOf(l)===-1&&n.push(l)}}}var qi=null;function Y2(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pi=null,zu=0,Ps=0,Bl=null;function Q2(e,t){if(Pi===null){var n=Pi=[];zu=0,Ps=Xd(),Bl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return zu++,t.then(mp,mp),t}function mp(){if(--zu===0&&(qi=null,Pi!==null)){Bl!==null&&(Bl.status="fulfilled");var e=Pi;Pi=null,Ps=0,Bl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function X2(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),l}var hp=oe.S;oe.S=function(e,t){if(ix=Rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Q2(e,t),qi!==null)for(var n=ti;n!==null;)fp(n,qi),n=n.next;if(n=e.types,n!==null){for(var l=ti;l!==null;)fp(l,n),l=l.next;if(Ps!==0){l=qi,l===null&&(l=qi=[]);for(var c=0;c<n.length;c++){var u=n[c];l.indexOf(u)===-1&&l.push(u)}}}hp!==null&&hp(e,t)};var Gs=kt(null);function Mu(){var e=Gs.current;return e!==null?e:xt.pooledCache}function oo(e,t){t===null?xe(Gs,Gs.current):xe(Gs,t.pool)}function pp(){var e=Mu();return e===null?null:{parent:zt._currentValue,pool:e}}var Ul=Error(o(460)),Ou=Error(o(474)),co=Error(o(542)),uo={then:function(){}};function gp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ra,ra),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bp(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(ra,ra);else{if(e=xt,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,bp(e),e}throw Is=t,Ul}}function Vs(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Is=n,Ul):n}}var Is=null;function yp(){if(Is===null)throw Error(o(459));var e=Is;return Is=null,e}function bp(e){if(e===Ul||e===co)throw Error(o(483))}var Hl=null,Gi=0;function fo(e){var t=Gi;return Gi+=1,Hl===null&&(Hl=[]),xp(Hl,e,t)}function es(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mo(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 vp(e){function t(P,M){if(e){var K=P.deletions;K===null?(P.deletions=[M],P.flags|=16):K.push(M)}}function n(P,M){if(!e)return null;for(;M!==null;)t(P,M),M=M.sibling;return null}function l(P){for(var M=new Map;P!==null;)P.key===null?M.set(P.index,P):M.set(P.key,P),P=P.sibling;return M}function c(P,M){return P=_a(P,M),P.index=0,P.sibling=null,P}function u(P,M,K){return P.index=K,e?(K=P.alternate,K!==null?(K=K.index,K<M?(P.flags|=2,M):K):(P.flags|=134217730,M)):(P.flags|=1048576,M)}function g(P){return e&&P.alternate===null&&(P.flags|=134217730),P}function S(P,M,K,pe){return M===null||M.tag!==6?(M=Nu(K,P.mode,pe),M.return=P,M):(M=c(M,K),M.return=P,M)}function A(P,M,K,pe){var Ee=K.type;return Ee===W?(P=$(P,M,K.props.children,pe,K.key),es(P,K),P):M!==null&&(M.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===_&&Vs(Ee)===M.type)?(M=c(M,K.props),es(M,K),M.return=P,M):(M=to(K.type,K.key,K.props,null,P.mode,pe),es(M,K),M.return=P,M)}function G(P,M,K,pe){return M===null||M.tag!==4||M.stateNode.containerInfo!==K.containerInfo||M.stateNode.implementation!==K.implementation?(M=Cu(K,P.mode,pe),M.return=P,M):(M=c(M,K.children||[]),M.return=P,M)}function $(P,M,K,pe,Ee){return M===null||M.tag!==7?(M=Ls(K,P.mode,pe,Ee),M.return=P,M):(M=c(M,K),M.return=P,M)}function ge(P,M,K){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Nu(""+M,P.mode,K),M.return=P,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case F:return K=to(M.type,M.key,M.props,null,P.mode,K),es(K,M),K.return=P,K;case U:return M=Cu(M,P.mode,K),M.return=P,M;case _:return M=Vs(M),ge(P,M,K)}if(he(M)||re(M))return M=Ls(M,P.mode,K,null),M.return=P,M;if(typeof M.then=="function")return ge(P,fo(M),K);if(M.$$typeof===H)return ge(P,ro(P,M),K);mo(P,M)}return null}function q(P,M,K,pe){var Ee=M!==null?M.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Ee!==null?null:S(P,M,""+K,pe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case F:return K.key===Ee?A(P,M,K,pe):null;case U:return K.key===Ee?G(P,M,K,pe):null;case _:return K=Vs(K),q(P,M,K,pe)}if(he(K)||re(K))return Ee!==null?null:$(P,M,K,pe,null);if(typeof K.then=="function")return q(P,M,fo(K),pe);if(K.$$typeof===H)return q(P,M,ro(P,K),pe);mo(P,K)}return null}function Z(P,M,K,pe,Ee){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return P=P.get(K)||null,S(M,P,""+pe,Ee);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case F:return P=P.get(pe.key===null?K:pe.key)||null,A(M,P,pe,Ee);case U:return P=P.get(pe.key===null?K:pe.key)||null,G(M,P,pe,Ee);case _:return pe=Vs(pe),Z(P,M,K,pe,Ee)}if(he(pe)||re(pe))return P=P.get(K)||null,$(M,P,pe,Ee,null);if(typeof pe.then=="function")return Z(P,M,K,fo(pe),Ee);if(pe.$$typeof===H)return Z(P,M,K,ro(M,pe),Ee);mo(M,pe)}return null}function je(P,M,K,pe){for(var Ee=null,et=null,Me=M,Be=M=0,Lt=null;Me!==null&&Be<K.length;Be++){Me.index>Be?(Lt=Me,Me=null):Lt=Me.sibling;var at=q(P,Me,K[Be],pe);if(at===null){Me===null&&(Me=Lt);break}e&&Me&&at.alternate===null&&t(P,Me),M=u(at,M,Be),et===null?Ee=at:et.sibling=at,et=at,Me=Lt}if(Be===K.length)return n(P,Me),Qe&&Ta(P,Be),Ee;if(Me===null){for(;Be<K.length;Be++)Me=ge(P,K[Be],pe),Me!==null&&(M=u(Me,M,Be),et===null?Ee=Me:et.sibling=Me,et=Me);return Qe&&Ta(P,Be),Ee}for(Me=l(Me);Be<K.length;Be++)Lt=Z(Me,P,Be,K[Be],pe),Lt!==null&&(e&&(at=Lt.alternate,at!==null&&Me.delete(at.key===null?Be:at.key)),M=u(Lt,M,Be),et===null?Ee=Lt:et.sibling=Lt,et=Lt);return e&&Me.forEach(function(bs){return t(P,bs)}),Qe&&Ta(P,Be),Ee}function De(P,M,K,pe){if(K==null)throw Error(o(151));for(var Ee=null,et=null,Me=M,Be=M=0,Lt=null,at=K.next();Me!==null&&!at.done;Be++,at=K.next()){Me.index>Be?(Lt=Me,Me=null):Lt=Me.sibling;var bs=q(P,Me,at.value,pe);if(bs===null){Me===null&&(Me=Lt);break}e&&Me&&bs.alternate===null&&t(P,Me),M=u(bs,M,Be),et===null?Ee=bs:et.sibling=bs,et=bs,Me=Lt}if(at.done)return n(P,Me),Qe&&Ta(P,Be),Ee;if(Me===null){for(;!at.done;Be++,at=K.next())at=ge(P,at.value,pe),at!==null&&(M=u(at,M,Be),et===null?Ee=at:et.sibling=at,et=at);return Qe&&Ta(P,Be),Ee}for(Me=l(Me);!at.done;Be++,at=K.next())at=Z(Me,P,Be,at.value,pe),at!==null&&(e&&(Lt=at.alternate,Lt!==null&&Me.delete(Lt.key===null?Be:Lt.key)),M=u(at,M,Be),et===null?Ee=at:et.sibling=at,et=at);return e&&Me.forEach(function(_w){return t(P,_w)}),Qe&&Ta(P,Be),Ee}function Ie(P,M,K,pe){if(typeof K=="object"&&K!==null&&K.type===W&&K.key===null&&K.props.ref===void 0&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case F:e:{for(var Ee=K.key;M!==null;){if(M.key===Ee){if(Ee=K.type,Ee===W){if(M.tag===7){n(P,M.sibling),pe=c(M,K.props.children),es(pe,K),pe.return=P,P=pe;break e}}else if(M.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===_&&Vs(Ee)===M.type){n(P,M.sibling),pe=c(M,K.props),es(pe,K),pe.return=P,P=pe;break e}n(P,M);break}else t(P,M);M=M.sibling}K.type===W?(pe=Ls(K.props.children,P.mode,pe,K.key),es(pe,K),pe.return=P,P=pe):(pe=to(K.type,K.key,K.props,null,P.mode,pe),es(pe,K),pe.return=P,P=pe)}return g(P);case U:e:{for(Ee=K.key;M!==null;){if(M.key===Ee)if(M.tag===4&&M.stateNode.containerInfo===K.containerInfo&&M.stateNode.implementation===K.implementation){n(P,M.sibling),pe=c(M,K.children||[]),pe.return=P,P=pe;break e}else{n(P,M);break}else t(P,M);M=M.sibling}pe=Cu(K,P.mode,pe),pe.return=P,P=pe}return g(P);case _:return K=Vs(K),Ie(P,M,K,pe)}if(he(K))return je(P,M,K,pe);if(re(K)){if(Ee=re(K),typeof Ee!="function")throw Error(o(150));return K=Ee.call(K),De(P,M,K,pe)}if(typeof K.then=="function")return Ie(P,M,fo(K),pe);if(K.$$typeof===H)return Ie(P,M,ro(P,K),pe);mo(P,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,M!==null&&M.tag===6?(n(P,M.sibling),pe=c(M,K),pe.return=P,P=pe):(n(P,M),pe=Nu(K,P.mode,pe),pe.return=P,P=pe),g(P)):n(P,M)}return function(P,M,K,pe){try{Gi=0;var Ee=Ie(P,M,K,pe);return Hl=null,Ee}catch(Me){if(Me===Ul||Me===co)throw Me;var et=mn(29,Me,null,P.mode);return et.lanes=pe,et.return=P,et}finally{}}}var Fs=vp(!0),Sp=vp(!1),ts=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ns(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function as(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(ot&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=eo(e),sp(e,null,n),t}return Wr(e,l,t,n),eo(e)}function Vi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,oh(e,n)}}function Uu(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var g={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=g:u=u.next=g,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Hu=!1;function Ii(){if(Hu){var e=Bl;if(e!==null)throw e}}function Fi(e,t,n,l){Hu=!1;var c=e.updateQueue;ts=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var A=S,G=A.next;A.next=null,g===null?u=G:g.next=G,g=A;var $=e.alternate;$!==null&&($=$.updateQueue,S=$.lastBaseUpdate,S!==g&&(S===null?$.firstBaseUpdate=G:S.next=G,$.lastBaseUpdate=A))}if(u!==null){var ge=c.baseState;g=0,$=G=A=null,S=u;do{var q=S.lane&-536870913,Z=q!==S.lane;if(Z?(We&q)===q:(l&q)===q){q!==0&&q===Ps&&(Hu=!0),$!==null&&($=$.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var je=e,De=S;q=t;var Ie=n;switch(De.tag){case 1:if(je=De.payload,typeof je=="function"){ge=je.call(Ie,ge,q);break e}ge=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=De.payload,q=typeof je=="function"?je.call(Ie,ge,q):je,q==null)break e;ge=D({},ge,q);break e;case 2:ts=!0}}q=S.callback,q!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=c.callbacks,Z===null?c.callbacks=[q]:Z.push(q))}else Z={lane:q,tag:S.tag,payload:S.payload,callback:S.callback,next:null},$===null?(G=$=Z,A=ge):$=$.next=Z,g|=q;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;Z=S,S=Z.next,Z.next=null,c.lastBaseUpdate=Z,c.shared.pending=null}}while(!0);$===null&&(A=ge),c.baseState=A,c.firstBaseUpdate=G,c.lastBaseUpdate=$,u===null&&(c.shared.lanes=0),us|=g,e.lanes=g,e.memoizedState=ge}}function wp(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function kp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wp(n[e],t)}var ss=kt(null),ho=kt(0);function jp(e,t){e=Ba,xe(ho,e),xe(ss,t),Ba=e|t.baseLanes}function qu(){xe(ho,Ba),xe(ss,ss.current)}function Pu(){Ba=ho.current,Le(ss),Le(ho)}var $t=kt(null),ln=null;function ls(e){var t=e.alternate;xe(Wt,Wt.current&1),xe($t,e),ln===null&&(t===null||ss.current!==null||t.memoizedState!==null)&&(ln=e)}function Gu(e){xe(Wt,Wt.current),xe($t,e),ln===null&&(ln=e)}function Np(e){e.tag===22?(xe(Wt,Wt.current),xe($t,e),ln===null&&(ln=e)):is()}function is(){xe(Wt,Wt.current),xe($t,$t.current)}function wn(e){Le($t),ln===e&&(ln=null),Le(Wt)}var Wt=kt(0);function Ki(e,t){xe($t,$t.current),xe(Wt,t)}function Vu(e){Le(Wt),Le($t),ln===e&&(ln=null)}function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ff(n)||mf(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var za=0,Ve=null,pt=null,Mt=null,go=!1,ql=!1,Ks=!1,xo=0,Yi=0,Pl=null,Z2=0;function At(){throw Error(o(321))}function Iu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sn(e[n],t[n]))return!1;return!0}function Fu(e,t,n,l,c,u){return za=u,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oe.H=e===null||e.memoizedState===null?og:cg,Ks=!1,u=n(l,c),Ks=!1,ql&&(u=Ep(t,n,l,c)),Cp(e),u}function Cp(e){oe.H=jo;var t=pt!==null&&pt.next!==null;if(za=0,Mt=pt=Ve=null,go=!1,Yi=0,Pl=null,t)throw Error(o(300));e===null||Ot||(e=e.dependencies,e!==null&&io(e)&&(Ot=!0))}function Ep(e,t,n,l){Ve=e;var c=0;do{if(ql&&(Pl=null),Yi=0,ql=!1,25<=c)throw Error(o(301));if(c+=1,Mt=pt=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}oe.H=sS,u=t(n,l)}while(ql);return u}function J2(){var e=oe.H,t=e.useState()[0];return t=typeof t.then=="function"?Qi(t):t,e=e.useState()[0],(pt!==null?pt.memoizedState:null)!==e&&(Ve.flags|=1024),t}function Ku(){var e=xo!==0;return xo=0,e}function Yu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qu(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}za=0,Mt=pt=Ve=null,ql=!1,Yi=xo=0,Pl=null}function cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Ve.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Dt(){if(pt===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var t=Mt===null?Ve.memoizedState:Mt.next;if(t!==null)Mt=t,pt=e;else{if(e===null)throw Ve.alternate===null?Error(o(467)):Error(o(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Mt===null?Ve.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function yo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qi(e){var t=Yi;return Yi+=1,Pl===null&&(Pl=[]),e=xp(Pl,e,t),t=Ve,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,oe.H=t===null||t.memoizedState===null?og:cg),e}function bo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qi(e);if(e.$$typeof===Q)return;if(e.$$typeof===H)return Jt(e)}throw Error(o(438,String(e)))}function Xu(e){var t=null,n=Ve.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ve.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=yo(),Ve.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=Se;return t.index++,n}function Ma(e,t){return typeof t=="function"?t(e):t}function vo(e){var t=Dt();return Zu(t,pt,e)}function Zu(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var c=e.baseQueue,u=l.pending;if(u!==null){if(c!==null){var 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 S=g=null,A=null,G=t,$=!1;do{var ge=G.lane&-536870913;if(ge!==G.lane?(We&ge)===ge:(za&ge)===ge){var q=G.revertLane;if(q===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ge===Ps&&($=!0);else if((za&q)===q){G=G.next,q===Ps&&($=!0);continue}else ge={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},A===null?(S=A=ge,g=u):A=A.next=ge,Ve.lanes|=q,us|=q;ge=G.action,Ks&&n(u,ge),u=G.hasEagerState?G.eagerState:n(u,ge)}else q={lane:ge,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},A===null?(S=A=q,g=u):A=A.next=q,Ve.lanes|=ge,us|=ge;G=G.next}while(G!==null&&G!==t);if(A===null?g=u:A.next=S,!Sn(u,e.memoizedState)&&(Ot=!0,$&&(n=Bl,n!==null)))throw n;e.memoizedState=u,e.baseState=g,e.baseQueue=A,l.lastRenderedState=u}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ju(e){var t=Dt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var g=c=c.next;do u=e(u,g.action),g=g.next;while(g!==c);Sn(u,t.memoizedState)||(Ot=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function Ap(e,t,n){var l=Ve,c=Dt(),u=Qe;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var g=!Sn((pt||c).memoizedState,n);if(g&&(c.memoizedState=n,Ot=!0),c=c.queue,ed(Dp.bind(null,l,c,e),[e]),e=c.getSnapshot!==t||g||Mt!==null&&(Mt.memoizedState.tag&1)!==0,Gl(e?9:8,{destroy:void 0},Tp.bind(null,l,c,n,t),null),e){if(l.flags|=2048,xt===null)throw Error(o(349));u||(za&127)!==0||_p(l,t,n)}return n}function _p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t=yo(),Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Tp(e,t,n,l){t.value=n,t.getSnapshot=l,Rp(t)&&zp(e)}function Dp(e,t,n){return n(function(){Rp(t)&&zp(e)})}function Rp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sn(e,n)}catch{return!0}}function zp(e){var t=Os(e,2);t!==null&&xn(t,e,2)}function $u(e){var t=cn();if(typeof e=="function"){var n=e;if(e=n(),Ks){L(!0);try{n()}finally{L(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t}function Mp(e,t,n,l){return e.baseState=n,Zu(e,pt,typeof l=="function"?l:Ma)}function $2(e,t,n,l,c){if(ko(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)}};oe.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,Op(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Op(e,t){var n=t.action,l=t.payload,c=e.state;if(t.isTransition){var u=oe.T,g={};g.types=u!==null?u.types:null,oe.T=g;try{var S=n(c,l),A=oe.S;A!==null&&A(g,S),Lp(e,t,S)}catch(G){Wu(e,t,G)}finally{u!==null&&g.types!==null&&(u.types=g.types),oe.T=u}}else try{u=n(c,l),Lp(e,t,u)}catch(G){Wu(e,t,G)}}function Lp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Bp(e,t,l)},function(l){return Wu(e,t,l)}):Bp(e,t,n)}function Bp(e,t,n){t.status="fulfilled",t.value=n,Up(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Op(e,n)))}function Wu(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Up(t),t=t.next;while(t!==l)}e.action=null}function Up(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hp(e,t){return t}function qp(e,t){if(Qe){var n=xt.formState;if(n!==null){e:{var l=Ve;if(Qe){if(yt){t:{for(var c=yt,u=Mn;c.nodeType!==8;){if(!u){c=null;break t}if(c=Ln(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){yt=Ln(c.nextSibling),l=c.data==="F!";break e}}$a(l)}l=!1}l&&(t=n[0])}}return n=cn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:t},n.queue=l,n=lg.bind(null,Ve,l),l.dispatch=n,l=$u(!1),u=ld.bind(null,Ve,!1,l.queue),l=cn(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,n=$2.bind(null,Ve,c,u,n),c.dispatch=n,l.memoizedState=e,[t,n,!1]}function Pp(e){var t=Dt();return Gp(t,pt,e)}function Gp(e,t,n){if(t=Zu(e,t,Hp)[0],e=vo(Ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Qi(t)}catch(g){throw g===Ul?co:g}else l=t;t=Dt();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(Ve.flags|=2048,Gl(9,{destroy:void 0},W2.bind(null,c,n),null)),[l,u,e]}function W2(e,t){e.action=t}function Vp(e){var t=Dt(),n=pt;if(n!==null)return Gp(t,n,e);Dt(),t=t.memoizedState,n=Dt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Gl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ve.updateQueue,t===null&&(t=yo(),Ve.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Ip(){return Dt().memoizedState}function So(e,t,n,l){var c=cn();Ve.flags|=e,c.memoizedState=Gl(1|t,{destroy:void 0},n,l===void 0?null:l)}function wo(e,t,n,l){var c=Dt();l=l===void 0?null:l;var u=c.memoizedState.inst;pt!==null&&l!==null&&Iu(l,pt.memoizedState.deps)?c.memoizedState=Gl(t,u,n,l):(Ve.flags|=e,c.memoizedState=Gl(1|t,u,n,l))}function Fp(e,t){So(8390656,8,e,t)}function ed(e,t){wo(2048,8,e,t)}function eS(e){Ve.flags|=4;var t=Ve.updateQueue;if(t===null)t=yo(),Ve.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Kp(e){var t=Dt().memoizedState;return eS({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Yp(e,t){return wo(4,2,e,t)}function Qp(e,t){return wo(4,4,e,t)}function Xp(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Zp(e,t,n){n=n!=null?n.concat([e]):null,wo(4,4,Xp.bind(null,t,e),n)}function td(){}function Jp(e,t){var n=Dt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Iu(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function $p(e,t){var n=Dt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Iu(t,l[1]))return l[0];if(l=e(),Ks){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[l,t],l}function nd(e,t,n){return n===void 0||(za&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=ox(),Ve.lanes|=e,us|=e,n)}function Wp(e,t,n,l){return Sn(n,t)?n:ss.current!==null?(e=nd(e,n,l),Sn(e,t)||(Ot=!0),e):(za&106)===0||(za&1073741824)!==0&&(We&261930)===0?(Ot=!0,e.memoizedState=n):(e=ox(),Ve.lanes|=e,us|=e,t)}function eg(e,t,n,l,c){var u=we.p;we.p=u!==0&&8>u?u:8;var g=oe.T,S={};S.types=g!==null?g.types:null,oe.T=S,ld(e,!1,t,n);try{var A=c(),G=oe.S;if(G!==null&&G(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var $=X2(A,l);Xi(e,t,$,Cn(e))}else Xi(e,t,l,Cn(e))}catch(ge){Xi(e,t,{then:function(){},status:"rejected",reason:ge},Cn())}finally{we.p=u,g!==null&&S.types!==null&&(g.types=S.types),oe.T=g}}function tS(){}function ad(e,t,n,l){if(e.tag!==5)throw Error(o(476));var c=tg(e).queue;eg(e,c,t,qe,n===null?tS:function(){return ng(e),n(l)})}function tg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:qe,baseState:qe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:qe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ng(e){var t=tg(e);t.next===null&&(t=e.alternate.memoizedState),Xi(e,t.next.queue,{},Cn())}function sd(){return Jt(ri)}function ag(){return Dt().memoizedState}function sg(){return Dt().memoizedState}function nS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cn();e=ns(n);var l=as(t,e,n);l!==null&&(xn(l,t,n),Vi(l,t,n)),t={cache:Ru()},e.payload=t;return}t=t.return}}function aS(e,t,n){var l=Cn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ko(e)?ig(t,n):(n=ku(e,t,n,l),n!==null&&(xn(n,e,l),rg(n,t,l)))}function lg(e,t,n){var l=Cn();Xi(e,t,n,l)}function Xi(e,t,n,l){var c={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ko(e))ig(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,S=u(g,n);if(c.hasEagerState=!0,c.eagerState=S,Sn(S,g))return Wr(e,t,c,0),xt===null&&$r(),!1}catch{}finally{}if(n=ku(e,t,c,l),n!==null)return xn(n,e,l),rg(n,t,l),!0}return!1}function ld(e,t,n,l){if(l={lane:2,revertLane:Xd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ko(e)){if(t)throw Error(o(479))}else t=ku(e,n,l,2),t!==null&&xn(t,e,2)}function ko(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function ig(e,t){ql=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function rg(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,oh(e,n)}}var jo={readContext:Jt,use:bo,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At,useEffectEvent:At},og={readContext:Jt,use:bo,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:Fp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,So(4194308,4,Xp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return So(4194308,4,e,t)},useInsertionEffect:function(e,t){So(4,2,e,t)},useMemo:function(e,t){var n=cn();t=t===void 0?null:t;var l=e();if(Ks){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=cn();if(n!==void 0){var c=n(t);if(Ks){L(!0);try{n(t)}finally{L(!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=aS.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:function(e){e=$u(e);var t=e.queue,n=lg.bind(null,Ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:td,useDeferredValue:function(e,t){var n=cn();return nd(n,e,t)},useTransition:function(){var e=$u(!1);return e=eg.bind(null,Ve,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ve,c=cn();if(Qe){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),xt===null)throw Error(o(349));(We&127)!==0||_p(l,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,Fp(Dp.bind(null,l,u,e),[e]),l.flags|=2048,Gl(9,{destroy:void 0},Tp.bind(null,l,u,n,t),null),n},useId:function(){var e=cn(),t=xt.identifierPrefix;if(Qe){var n=ca,l=oa;n=(l&~(1<<32-Ce(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=xo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Z2++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sd,useFormState:qp,useActionState:qp,useOptimistic:function(e){var t=cn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ld.bind(null,Ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:Xu,useCacheRefresh:function(){return cn().memoizedState=nS.bind(null,Ve)},useEffectEvent:function(e){var t=cn(),n={impl:e};return t.memoizedState=n,function(){if((ot&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},cg={readContext:Jt,use:bo,useCallback:Jp,useContext:Jt,useEffect:ed,useImperativeHandle:Zp,useInsertionEffect:Yp,useLayoutEffect:Qp,useMemo:$p,useReducer:vo,useRef:Ip,useState:function(){return vo(Ma)},useDebugValue:td,useDeferredValue:function(e,t){var n=Dt();return Wp(n,pt.memoizedState,e,t)},useTransition:function(){var e=vo(Ma)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:Ap,useId:ag,useHostTransitionStatus:sd,useFormState:Pp,useActionState:Pp,useOptimistic:function(e,t){var n=Dt();return Mp(n,pt,e,t)},useMemoCache:Xu,useCacheRefresh:sg,useEffectEvent:Kp},sS={readContext:Jt,use:bo,useCallback:Jp,useContext:Jt,useEffect:ed,useImperativeHandle:Zp,useInsertionEffect:Yp,useLayoutEffect:Qp,useMemo:$p,useReducer:Ju,useRef:Ip,useState:function(){return Ju(Ma)},useDebugValue:td,useDeferredValue:function(e,t){var n=Dt();return pt===null?nd(n,e,t):Wp(n,pt.memoizedState,e,t)},useTransition:function(){var e=Ju(Ma)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:Ap,useId:ag,useHostTransitionStatus:sd,useFormState:Vp,useActionState:Vp,useOptimistic:function(e,t){var n=Dt();return pt!==null?Mp(n,pt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Xu,useCacheRefresh:sg,useEffectEvent:Kp};function id(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rd={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Cn(),c=ns(l);c.payload=t,n!=null&&(c.callback=n),t=as(e,c,l),t!==null&&(xn(t,e,l),Vi(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Cn(),c=ns(l);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=as(e,c,l),t!==null&&(xn(t,e,l),Vi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cn(),l=ns(n);l.tag=2,t!=null&&(l.callback=t),t=as(e,l,n),t!==null&&(xn(t,e,n),Vi(t,e,n))}};function ug(e,t,n,l,c,u,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,g):t.prototype&&t.prototype.isPureReactComponent?!Oi(n,l)||!Oi(c,u):!0}function dg(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&rd.enqueueReplaceState(t,t.state,null)}function Ys(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=D({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function fg(e){Jr(e)}function mg(e){console.error(e)}function hg(e){Jr(e)}function No(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function pg(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function od(e,t,n){return n=ns(n),n.tag=3,n.payload={element:null},n.callback=function(){No(e,t)},n}function gg(e){return e=ns(e),e.tag=3,e}function xg(e,t,n,l){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=l.value;e.payload=function(){return c(u)},e.callback=function(){pg(t,n,l)}}var g=n.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){pg(t,n,l),typeof c!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var S=l.stack;this.componentDidCatch(l.value,{componentStack:S!==null?S:""})})}function lS(e,t,n,l,c){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Hs(t,n,c,!0),n=$t.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ln===null?Ko():n.alternate===null&&_t===0&&(_t=3),n.flags&=-257,n.flags|=65536,n.lanes=c,l===uo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Kd(e,l,c)),!1;case 22:return n.flags|=65536,l===uo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Kd(e,l,c)),!1}throw Error(o(435,n.tag))}return Kd(e,l,c),Ko(),!1}if(Qe)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Au&&(e=Error(o(422),{cause:l}),Ui(Dn(e,n)))):(l!==Au&&(t=Error(o(423),{cause:l}),Ui(Dn(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=Dn(l,n),c=od(e.stateNode,l,c),Uu(e,c),_t!==4&&(_t=2)),!1;var u=Error(o(520),{cause:l});if(u=Dn(u,n),ar===null?ar=[u]:ar.push(u),_t!==4&&(_t=2),t===null)return!0;l=Dn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=od(n.stateNode,l,e),Uu(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(ds===null||!ds.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=gg(c),xg(c,e,n,l),Uu(n,c),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var cd=Error(o(461)),Ot=!1;function Pt(e,t,n,l){t.child=e===null?Sp(t,null,n,l):Fs(t,e.child,n,l)}function yg(e,t,n,l,c){n=n.render;var u=t.ref;if("ref"in l){var g={};for(var S in l)S!=="ref"&&(g[S]=l[S])}else g=l;return qs(t),l=Fu(e,t,n,g,u,c),S=Ku(),e!==null&&!Ot?(Yu(e,t,c),Oa(e,t,c)):(Qe&&S&&ao(t),t.flags|=1,Pt(e,t,l,c),t.child)}function bg(e,t,n,l,c){if(e===null){var u=n.type;return typeof u=="function"&&!ju(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,vg(e,t,u,l,c)):(e=to(n.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!xd(e,c)){var g=u.memoizedProps;if(n=n.compare,n=n!==null?n:Oi,n(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 vg(e,t,n,l,c){if(e!==null){var u=e.memoizedProps;if(Oi(u,l)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=l=u,xd(e,c))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,Oa(e,t,c)}return ud(e,t,n,l,c)}function Sg(e,t,n,l){var c=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~u}else l=0,t.child=null;return wg(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oo(t,u!==null?u.cachePool:null),u!==null?jp(t,u):qu(),Np(t);else return l=t.lanes=536870912,wg(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(oo(t,u.cachePool),jp(t,u),is(),t.memoizedState=null):(e!==null&&oo(t,null),qu(),is());return Pt(e,t,c,n),t.child}function Zi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function wg(e,t,n,l,c){var u=Mu();return u=u===null?null:{parent:zt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&oo(t,null),qu(),Np(t),e!==null&&Hs(e,t,l,!0),t.childLanes=c,null}function Co(e,t){return t=Eo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function kg(e,t,n){return Fs(t,e.child,null,n),e=Co(t,t.pendingProps),e.flags|=2,wn(t),t.memoizedState=null,e}function iS(e,t,n){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Qe){if(l.mode==="hidden")return e=Co(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Zi(null,e);if(Gu(t),(e=yt)?(e=Xx(e,Mn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Za!==null?{id:oa,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},n=ip(e),n.return=t,t.child=n,Kt=t,yt=null)):e=null,e===null)throw $a(t);return t.lanes=536870912,null}return Co(t,l)}var u=e.memoizedState;if(u!==null){var g=u.dehydrated;if(Gu(t),c)if(t.flags&256)t.flags&=-257,t=kg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ot||Hs(e,t,n,!1),c=(n&e.childLanes)!==0,Ot||c){if(ss.current===null){if(l=xt,l!==null&&(g=ch(l,n),g!==0&&g!==u.retryLane))throw u.retryLane=g,Os(e,g),xn(l,e,g),cd;Ko()}t=kg(e,t,n)}else e=u.treeContext,yt=Ln(g.nextSibling),Kt=t,Qe=!0,Ja=null,Mn=!1,e!==null&&cp(t,e),t=Co(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 Vl(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ud(e,t,n,l,c){return qs(t),n=Fu(e,t,n,l,void 0,c),l=Ku(),e!==null&&!Ot?(Yu(e,t,c),Oa(e,t,c)):(Qe&&l&&ao(t),t.flags|=1,Pt(e,t,n,c),t.child)}function jg(e,t,n,l,c,u){return qs(t),t.updateQueue=null,n=Ep(t,l,n,c),Cp(e),l=Ku(),e!==null&&!Ot?(Yu(e,t,u),Oa(e,t,u)):(Qe&&l&&ao(t),t.flags|=1,Pt(e,t,n,u),t.child)}function Ng(e,t,n,l,c){if(qs(t),t.stateNode===null){var u=zl,g=n.contextType;typeof g=="object"&&g!==null&&(u=Jt(g)),u=new n(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=rd,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},Lu(t),g=n.contextType,u.context=typeof g=="object"&&g!==null?Jt(g):zl,u.state=t.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(id(t,n,g,l),u.state=t.memoizedState),typeof n.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&&rd.enqueueReplaceState(u,u.state,null),Fi(t,l,u,c),Ii(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var S=t.memoizedProps,A=Ys(n,S);u.props=A;var G=u.context,$=n.contextType;g=zl,typeof $=="object"&&$!==null&&(g=Jt($));var ge=n.getDerivedStateFromProps;$=typeof ge=="function"||typeof u.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,$||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(S||G!==g)&&dg(t,u,l,g),ts=!1;var q=t.memoizedState;u.state=q,Fi(t,l,u,c),Ii(),G=t.memoizedState,S||q!==G||ts?(typeof ge=="function"&&(id(t,n,ge,l),G=t.memoizedState),(A=ts||ug(t,n,A,l,q,G,g))?($||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=G),u.props=l,u.state=G,u.context=g,l=A):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,Bu(e,t),g=t.memoizedProps,$=Ys(n,g),u.props=$,ge=t.pendingProps,q=u.context,G=n.contextType,A=zl,typeof G=="object"&&G!==null&&(A=Jt(G)),S=n.getDerivedStateFromProps,(G=typeof S=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==ge||q!==A)&&dg(t,u,l,A),ts=!1,q=t.memoizedState,u.state=q,Fi(t,l,u,c),Ii();var Z=t.memoizedState;g!==ge||q!==Z||ts||e!==null&&e.dependencies!==null&&io(e.dependencies)?(typeof S=="function"&&(id(t,n,S,l),Z=t.memoizedState),($=ts||ug(t,n,$,l,q,Z,A)||e!==null&&e.dependencies!==null&&io(e.dependencies))?(G||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,Z,A),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,Z,A)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Z),u.props=l,u.state=Z,u.context=A,l=$):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Vl(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Fs(t,e.child,null,c),t.child=Fs(t,null,n,c)):Pt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Oa(e,t,c),e}function Cg(e,t,n,l){return Bs(),t.flags|=256,Pt(e,t,n,l),t.child}var dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fd(e){return{baseLanes:e,cachePool:pp()}}function md(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Nn),e}function Eg(e,t,n){var l=t.pendingProps,c=!1,u=(t.flags&128)!==0,g;if((g=u)||(g=e!==null&&e.memoizedState===null?!1:(Wt.current&2)!==0),g&&(c=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Qe){if(c?ls(t):is(),(e=yt)?(e=Xx(e,Mn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Za!==null?{id:oa,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},n=ip(e),n.return=t,t.child=n,Kt=t,yt=null)):e=null,e===null)throw $a(t);return mf(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,c?(is(),c=t.mode,u=Eo({mode:"hidden",children:u},c),l=Ls(l,c,n,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=fd(n),l.childLanes=md(e,g,n),t.memoizedState=dd,Zi(null,l)):(ls(t),hd(t,u))}var S=e.memoizedState;if(S!==null){var A=S.dehydrated;if(A!==null)return rS(e,t,u,g,l,A,S,n)}return c?(is(),c=l.fallback,u=t.mode,S=e.child,A=S.sibling,l=_a(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&1206910976,A!==null?c=_a(A,c):(c=Ls(c,u,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,Zi(null,l),l=t.child,c=e.child.memoizedState,c===null?c=fd(n):(u=c.cachePool,u!==null?(S=zt._currentValue,u=u.parent!==S?{parent:S,pool:S}:u):u=pp(),c={baseLanes:c.baseLanes|n,cachePool:u}),l.memoizedState=c,l.childLanes=md(e,g,n),t.memoizedState=dd,Zi(e.child,l)):(ls(t),n=e.child,e=n.sibling,n=_a(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=n,t.memoizedState=null,n)}function hd(e,t){return t=Eo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Eo(e,t){return e=mn(22,e,null,t),e.lanes=0,e}function Ao(e,t,n){return Fs(t,e.child,null,n),e=hd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rS(e,t,n,l,c,u,g,S){if(n)return t.flags&256?(ls(t),t.flags&=-257,Ao(e,t,S)):t.memoizedState!==null?(is(),t.child=e.child,t.flags|=128,null):(is(),u=c.fallback,g=t.mode,c=Eo({mode:"visible",children:c.children},g),u=Ls(u,g,S,null),u.flags|=2,c.return=t,u.return=t,c.sibling=u,t.child=c,Fs(t,e.child,null,S),c=t.child,c.memoizedState=fd(S),c.childLanes=md(e,l,S),t.memoizedState=dd,Zi(null,c));if(ls(t),mf(u)){if(l=u.nextSibling&&u.nextSibling.dataset,l)var A=l.dgst;return l=A,l!==""&&(c=Error(o(419)),c.stack="",c.digest=l,Ui({value:c,source:null,stack:null})),Ao(e,t,S)}if(Ot||Hs(e,t,S,!1),l=(S&e.childLanes)!==0,Ot||l){if(ss.current!==null)return Ao(e,t,S);if(l=xt,l!==null&&(c=ch(l,S),c!==0&&c!==g.retryLane))throw g.retryLane=c,Os(e,c),xn(l,e,c),cd;return ff(u)||Ko(),Ao(e,t,S)}return ff(u)?(t.flags|=192,t.child=e.child,null):(e=g.treeContext,yt=Ln(u.nextSibling),Kt=t,Qe=!0,Ja=null,Mn=!1,e!==null&&cp(t,e),t=hd(t,c.children),t.flags|=134221824,t)}function Ag(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),lo(e.return,t,n)}function _g(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&po(n)===null&&(t=e),e=e.sibling}return t}function _o(e,t,n,l,c,u){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:c,treeForkCount:u}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=n,g.tailMode=c,g.treeForkCount=u)}function pd(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function gd(e,t,n){var l=t.pendingProps,c=l.revealOrder,u=l.tail;l=l.children;var g=Wt.current;if(t.flags&128)return Ki(t,g),null;var S=(g&2)!==0;if(S?(g=g&1|2,t.flags|=128):g&=1,Ki(t,g),c==="backwards"&&e!==null?(pd(e),Pt(e,t,l,n),pd(e)):Pt(e,t,l,n),l=Qe?Bi:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ag(e,n,t);else if(e.tag===19)Ag(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":n=_g(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null,pd(t)),_o(t,!0,c,null,u,l);break;case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&po(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}_o(t,!0,n,null,u,l);break;case"together":_o(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:n=_g(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),_o(t,!1,c,n,u,l)}return t.child}function Tg(e,t,n){var l=t.pendingProps;return Wa(t,t.type,l.value),Pt(e,t,l.children,n),t.child}function Oa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),us|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hs(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=_a(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_a(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&io(e)))}function oS(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Wa(t,zt,e.memoizedState.cache),Bs();break;case 27:case 5:ve(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Wa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gu(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return ls(t),t.flags|=128,null;l=Hs(e,t,n,!1);var c=t.child.childLanes;return l||(n&c)!==0?Eg(e,t,n):(ls(t),e=Oa(e,t,n),e!==null?e.sibling:null)}ls(t);break;case 19:if(t.flags&128)return gd(e,t,n);if(c=(e.flags&128)!==0,l=(n&t.childLanes)!==0,l||(Hs(e,t,n,!1),l=(n&t.childLanes)!==0),c){if(l)return gd(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Ki(t,Wt.current),l)break;return null;case 22:return t.lanes=0,Sg(e,t,n,t.pendingProps);case 24:Wa(t,zt,e.memoizedState.cache)}return Oa(e,t,n)}function Dg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!xd(e,n)&&(t.flags&128)===0)return Ot=!1,oS(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Qe&&(t.flags&1048576)!==0&&op(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Vs(t.elementType),t.type=e,typeof e=="function")ju(e)?(l=Ys(e,l),t.tag=1,t=Ng(null,t,e,l,n)):(t.tag=0,t=ud(null,t,e,l,n));else{if(e!=null){var c=e.$$typeof;if(c===X){t.tag=11,t=yg(null,t,e,l,n);break e}else if(c===be){t.tag=14,t=bg(null,t,e,l,n);break e}else if(c===H){t.tag=10,t.type=e,t=Tg(null,t,n);break e}}throw t=ce(e)||e,Error(o(306,t,""))}}return t;case 0:return ud(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,c=Ys(l,t.pendingProps),Ng(e,t,l,c,n);case 3:e:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var u=t.memoizedState;c=u.element,Bu(e,t),Fi(t,l,null,n);var g=t.memoizedState;if(l=g.cache,Wa(t,zt,l),l!==u.cache&&Du(t,[zt],n,!0),Ii(),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=Cg(e,t,l,n);break e}else if(l!==c){c=Dn(Error(o(424)),t),Ui(c),t=Cg(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(yt=Ln(e.firstChild),Kt=t,Qe=!0,Ja=null,Mn=!0,n=Sp(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Bs(),l===c){t=Oa(e,t,n);break e}Pt(e,t,l,n)}t=t.child}return t;case 26:return Vl(e,t),e===null?(n=ny(t.type,null,t.pendingProps,null))?t.memoizedState=n:Qe||(t.stateNode=Ox(t.type,t.pendingProps,Pe.current,t)):t.memoizedState=ny(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Qe&&(l=t.stateNode=$x(t.type,t.pendingProps,Pe.current),Kt=t,Mn=!0,c=yt,hs(t.type)?(hf=c,yt=Ln(l.firstChild)):yt=c),Pt(e,t,t.pendingProps.children,n),Vl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Qe&&((c=l=yt)&&(l=nw(l,t.type,t.pendingProps,Mn),l!==null?(t.stateNode=l,Kt=t,yt=Ln(l.firstChild),Mn=!1,c=!0):c=!1),c||$a(t)),ve(t),c=t.type,u=t.pendingProps,g=e!==null?e.memoizedProps:null,l=u.children,sf(c,u)?l=null:g!==null&&sf(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Fu(e,t,J2,null,null,n),ri._currentValue=c),Vl(e,t),Pt(e,t,l,n),t.child;case 6:return e===null&&Qe&&((e=n=yt)&&(n=aw(n,t.pendingProps,Mn),n!==null?(t.stateNode=n,Kt=t,yt=null,e=!0):e=!1),e||$a(t)),null;case 13:return Eg(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fs(t,null,l,n):Pt(e,t,l,n),t.child;case 11:return yg(e,t,t.type,t.pendingProps,n);case 7:return l=t.pendingProps,Vl(e,t),Pt(e,t,l,n),t.child;case 8:return Pt(e,t,t.pendingProps.children,n),t.child;case 12:return Pt(e,t,t.pendingProps.children,n),t.child;case 10:return Tg(e,t,n);case 9:return c=t.type._context,l=t.pendingProps.children,qs(t),c=Jt(c),l=l(c),t.flags|=1,Pt(e,t,l,n),t.child;case 14:return bg(e,t,t.type,t.pendingProps,n);case 15:return vg(e,t,t.type,t.pendingProps,n);case 19:return gd(e,t,n);case 31:return iS(e,t,n);case 22:return Sg(e,t,n,t.pendingProps);case 24:return qs(t),l=Jt(zt),e===null?(c=Mu(),c===null&&(c=xt,u=Ru(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:l,cache:c},Lu(t),Wa(t,zt,c)):((e.lanes&n)!==0&&(Bu(e,t),Fi(t,null,null,n),Ii()),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),Wa(t,zt,l)):(l=u.cache,Wa(t,zt,l),l!==c.cache&&Du(t,[zt],n,!0))),Pt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:Qe&&ao(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Vl(e,t),Pt(e,t,l.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function La(e){e.flags|=4}function yd(e,t,n,l,c){var u;if((u=(e.mode&32)!==0)&&(u=n===null?iy(t,l):iy(t,l)&&(l.src!==n.src||l.srcSet!==n.srcSet)),u){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(fx())e.flags|=8192;else throw Is=uo,Ou}else e.flags&=-16777217}function Rg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ry(t))if(fx())e.flags|=8192;else throw Is=uo,Ou}function To(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ih():536870912,e.lanes|=t,Ql|=t)}function Ji(e,t){if(!Qe)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,l|=c.subtreeFlags&1206910976,l|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function cS(e,t,n){var l=t.pendingProps;switch(Eu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return bt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ra(zt),ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?La(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,_u())),bt(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(La(t),u!==null?(bt(t),Rg(t,u)):(bt(t),yd(t,c,null,l,n))):u?u!==e.memoizedState?(La(t),bt(t),Rg(t,u)):(bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&La(t),bt(t),yd(t,c,e,l,n)),null;case 27:if(Te(t),n=Pe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&La(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return bt(t),t.subtreeFlags&=-33554433,null}e=ze.current,Ll(t)?up(t):(e=$x(c,l,n),t.stateNode=e,La(t))}return bt(t),t.subtreeFlags&=-33554433,null;case 5:if(Te(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&La(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return bt(t),t.subtreeFlags&=-33554433,null}if(u=ze.current,Ll(t))up(t);else{var g=or(Pe.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[fn]=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&&La(t)}}return bt(t),t.subtreeFlags&=-33554433,yd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&La(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Pe.current,Ll(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,c=Kt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Zt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Dx(e.nodeValue,n)),e||$a(t,!0)}else e=or(e).createTextNode(l),e[Zt]=t,t.stateNode=e}return bt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ll(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Zt]=t}else Bs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),e=!1}else n=_u(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wn(t),t):(wn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return bt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ll(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 Bs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),c=!1}else c=_u(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(wn(t),t):(wn(t),null)}return wn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==c&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),To(t,t.updateQueue),bt(t),null);case 4:return ne(),e===null&&Wd(t.stateNode.containerInfo),t.flags|=67108864,bt(t),null;case 10:return Ra(t.type),bt(t),null;case 19:if(Vu(t),l=t.memoizedState,l===null)return bt(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=po(e),u!==null){for(t.flags|=128,Ji(l,!1),e=u.updateQueue,t.updateQueue=e,To(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)lp(n,e),n=n.sibling;return Ki(t,Wt.current&1|2),Qe&&Ta(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Rt()>Go&&(t.flags|=128,c=!0,Ji(l,!1),t.lanes=4194304)}else{if(!c)if(e=po(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,To(t,e),Ji(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!Qe)return bt(t),null}else 2*Rt()-l.renderingStartTime>Go&&n!==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(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Rt(),e.sibling=null,u=Wt.current,u=c?u&1|2:u&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!n||Qe?Ki(t,u):(n=u,xe($t,t),xe(Wt,n),ln===null&&(ln=t)),Qe&&Ta(t,l.treeForkCount),e}return bt(t),null;case 22:case 23:return wn(t),Pu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),n=t.updateQueue,n!==null&&To(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Le(Gs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ra(zt),bt(t),null;case 25:return null;case 30:return t.flags|=33554432,bt(t),null}throw Error(o(156,t.tag))}function uS(e,t){switch(Eu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ra(zt),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(wn(t),t.alternate===null)throw Error(o(340));Bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vu(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 ne(),null;case 10:return Ra(t.type),null;case 22:case 23:return wn(t),Pu(),e!==null&&Le(Gs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ra(zt),null;case 25:return null;default:return null}}function zg(e,t){switch(Eu(t),t.tag){case 3:Ra(zt),ne();break;case 26:case 27:case 5:Te(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&wn(t);break;case 13:wn(t);break;case 19:Vu(t);break;case 10:Ra(t.type);break;case 22:case 23:wn(t),Pu(),e!==null&&Le(Gs);break;case 24:Ra(zt)}}function $i(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var c=l.next;n=c;do{if((n.tag&e)===e){l=void 0;var u=n.create,g=n.inst;l=u(),g.destroy=l}n=n.next}while(n!==c)}}catch(S){ft(t,t.return,S)}}function rs(e,t,n){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var u=c.next;l=u;do{if((l.tag&e)===e){var g=l.inst,S=g.destroy;if(S!==void 0){g.destroy=void 0,c=t;var A=n,G=S;try{G()}catch($){ft(c,A,$)}}}l=l.next}while(l!==u)}}catch($){ft(t,t.return,$)}}function Mg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{kp(t,n)}catch(l){ft(e,e.return,l)}}}function Og(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ft(e,t,l)}}function ua(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var c=e.stateNode,u=Ea(e.memoizedProps,c);(c.ref===null||c.ref.name!==u)&&(c.ref=Gx(u)),l=c.ref;break;case 7:if(e.stateNode===null){var g=new En(e);x(e.child,!1,ew,g,void 0,void 0),e.stateNode=g}l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(S){ft(e,t,S)}}function en(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(c){ft(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){ft(e,t,c)}else n.current=null}function Do(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Qx(e.stateNode,t[n])}function Lg(e){for(var t=e.return;t!==null&&(vd(t)&&Qx(e.stateNode,t.stateNode),!bd(t));)t=t.return}function Wi(e){for(var t=e.return;t!==null&&(vd(t)&&tw(e.stateNode,t.stateNode),!bd(t));)t=t.return}function bd(e){return e.tag===5||e.tag===3||e.tag===27}function vd(e){return e&&e.tag===7&&e.stateNode!==null}function Sd(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(c){ft(e,e.return,c)}}function wd(e,t,n){try{var l=e.stateNode;LS(l,e.type,n,t),l[fn]=t}catch(c){ft(e,e.return,c)}}function Bg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hs(e.type)||e.tag===4}function kd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bg(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&&hs(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 jd(e,t,n,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(c,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(c),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ra)),Do(e,l),rt=!0;else if(c!==4&&(c===27&&(Do(e,l),l=null,hs(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jd(e,t,n,l),e=e.sibling;e!==null;)jd(e,t,n,l),e=e.sibling}function Ro(e,t,n,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?n.insertBefore(c,t):n.appendChild(c),Do(e,l),rt=!0;else if(c!==4&&(c===27&&(Do(e,l),l=null,hs(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ro(e,t,n,l),e=e.sibling;e!==null;)Ro(e,t,n,l),e=e.sibling}function Ug(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);tn(t,l,n),t[Zt]=e,t[fn]=n}catch(u){ft(e,e.return,u)}}var zo=!1,kn=null;function Hg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(zo=!0)}var da=null;function qg(){var e=da;return da=null,e}var hn=0;function Il(e,t,n,l,c){return hn=0,Pg(e.child,t,n,l,c)}function Pg(e,t,n,l,c){for(var u=!1;e!==null;){if(e.tag===5){var g=e.stateNode;if(l!==null){var S=of(g);l.push(S),S.view&&(u=!0)}else u||of(g).view&&(u=!0);zo=!0,qx(g,hn===0?t:t+"_"+hn,n),hn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||Pg(e.child,t,n,l,c)&&(u=!0));e=e.sibling}return u}function fa(e,t){for(;e!==null;)e.tag===5?Px(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||fa(e.child,t)),e=e.sibling}function Mo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Mo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var n=t.name;t=Aa(t.default,t.share),t!=="none"&&(Il(e,n,t,null,!1)||fa(e.child,!1))}e=e.sibling}}function Nd(e,t){if(e.tag===30){var n=e.stateNode,l=e.memoizedProps,c=Ea(l,n),u=Aa(l.default,n.paired?l.share:l.enter);u!=="none"?Il(e,c,u,null,!1)?(Mo(e),n.paired||t||$l(e,l.onEnter)):fa(e.child,!1):Mo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Nd(e,t),e=e.sibling;else Mo(e)}function Cd(e){if(kn!==null&&kn.size!==0){var t=kn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,l=n.name;if(l!=null&&l!=="auto"){var c=t.get(l);if(c!==void 0){var u=Aa(n.default,n.share);if(u!=="none"&&(Il(e,l,u,null,!1)?(u=e.stateNode,c.paired=u,u.paired=c,$l(e,n.onShare)):fa(e.child,!1)),t.delete(l),t.size===0)break}}}Cd(e)}e=e.sibling}}}function Ed(e){if(e.tag===30){var t=e.memoizedProps,n=Ea(t,e.stateNode),l=kn!==null?kn.get(n):void 0,c=Aa(t.default,l!==void 0?t.share:t.exit);c!=="none"&&(Il(e,n,c,null,!1)?l!==void 0?(c=e.stateNode,l.paired=c,c.paired=l,kn.delete(n),$l(e,t.onShare)):$l(e,t.onExit):fa(e.child,!1)),kn!==null&&Cd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ed(e),e=e.sibling;else kn!==null&&Cd(e)}function Gg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ea(t,e.stateNode);t=Aa(t.default,t.update),e.flags&=-5,t!=="none"&&Il(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Gg(e);e=e.sibling}}function Ad(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,fa(e.child,!1))}Ad(e)}e=e.sibling}}function Oo(e){if(e.tag===30)e.stateNode.paired=null,fa(e.child,!1),Ad(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Oo(e),e=e.sibling;else Ad(e)}function Vg(e){for(e=e.child;e!==null;)e.tag===30?fa(e.child,!1):(e.subtreeFlags&33554432)!==0&&Vg(e),e=e.sibling}function _d(e,t,n,l,c,u,g){for(var S=!1;t!==null;){if(t.tag===5){var A=t.stateNode;if(u!==null&&hn<u.length){var G=u[hn],$=of(A);(G.view||$.view)&&(S=!0);var ge;if(ge=(e.flags&4)===0)if($.clip)ge=!0;else{ge=G.rect;var q=$.rect;ge=ge.y!==q.y||ge.x!==q.x||ge.height!==q.height||ge.width!==q.width}ge&&(e.flags|=4),$.abs?$=!G.abs:(G=G.rect,$=$.rect,$=G.height!==$.height||G.width!==$.width),$&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&qx(A,hn===0?n:n+"_"+hn,c),S&&(e.flags&4)!==0||(da===null&&(da=[]),da.push(A,hn===0?l:l+"_"+hn,t.memoizedProps)),hn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&g?e.flags|=t.flags&32:_d(e,t.child,n,l,c,u,g)&&(S=!0));t=t.sibling}return S}function Ig(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=e.stateNode,c=Ea(n,l),u=Aa(n.default,n.update),g;g=e.memoizedState,e.memoizedState=null,l=e;var S=e.child;hn=0,c=_d(l,S,c,c,u,g,!1),(e.flags&4)!==0&&c&&$l(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Ig(e);e=e.sibling}}var Yt=!1,ct=!1,ma=!1,Td=!1,Fg=typeof WeakSet=="function"?WeakSet:Set,Qt=null,ha=!1,er=!1,Lo=!1,Dd=!1;function dS(e,t,n){if(e=e.containerInfo,nf=oi,e=Xh(e),xu(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 S=0,A=-1,G=-1,$=0,ge=0,q=e,Z=null;t:for(;;){for(var je;q!==l||u!==0&&q.nodeType!==3||(A=S+u),q!==g||c!==0&&q.nodeType!==3||(G=S+c),q.nodeType===3&&(S+=q.nodeValue.length),(je=q.firstChild)!==null;)Z=q,q=je;for(;;){if(q===e)break t;if(Z===l&&++$===u&&(A=S),Z===g&&++ge===c&&(G=S),(je=q.nextSibling)!==null)break;q=Z,Z=q.parentNode}q=je}l=A===-1||G===-1?null:{start:A,end:G}}else l=null}l=l||{start:0,end:0}}else l=null;for(af={focusedElem:e,selectionRange:l},oi=!1,n=(n&335544064)===n,Qt=t,t=n?9270:1024;Qt!==null;){if(e=Qt,n&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)n&&Ed(l[u]);if(e.alternate===null&&(e.flags&2)!==0)n&&Hg(e),Bo(n);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&n&&Ed(l),Bo(n);continue}else if(l!==null&&l.memoizedState!==null){n&&Hg(e),Bo(n);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Qt=l):(n&&Gg(e),Bo(n))}}kn=null}function Bo(e){for(;Qt!==null;){var t=Qt,n=e,l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&l!==null){n=void 0,c=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var g=Ys(t.type,c);n=u.getSnapshotBeforeUpdate(g,l),u.__reactInternalSnapshotBeforeUpdate=n}catch(S){ft(t,t.return,S)}}break;case 3:if((c&1024)!==0){if(l=t.stateNode.containerInfo,n=l.nodeType,n===9)df(l);else if(n===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":df(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&l!==null&&(n=Ea(l.memoizedProps,l.stateNode),c=t.memoizedProps,c=Aa(c.default,c.update),c!=="none"&&Il(l,n,c,l.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(o(163))}if(l=t.sibling,l!==null){l.return=t.return,Qt=l;break}Qt=t.return}}function Kg(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:pa(e,n),l&4&&$i(5,n);break;case 1:if(pa(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(g){ft(n,n.return,g)}else{var c=Ys(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){ft(n,n.return,g)}}l&64&&Mg(n),l&512&&ua(n,n.return);break;case 3:if(pa(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{kp(e,t)}catch(g){ft(n,n.return,g)}}break;case 27:t===null&&l&4&&Ug(n);case 26:case 5:pa(e,n),t===null&&l&4&&Sd(n),l&512&&ua(n,n.return);break;case 12:pa(e,n);break;case 31:pa(e,n),l&4&&Zg(e,n);break;case 13:pa(e,n),l&4&&Jg(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=kS.bind(null,n),sw(e,n))));break;case 22:if(l=n.memoizedState!==null||Yt,!l){var u=t!==null&&t.memoizedState!==null||ct;t=Yt,c=ct,Yt=l,(ct=u)&&!c?(l=2,(n.subtreeFlags&8772)!==0&&(l|=1),Wn(e,n,l)):pa(e,n),Yt=t,ct=c}break;case 30:pa(e,n),l&512&&ua(n,n.return);break;case 7:l&512&&ua(n,n.return);default:pa(e,n)}}function Rd(e,t){for(e=e.child;e!==null;)Yg(e,t),e=e.sibling}function Yg(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var l=n.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var c=e.stateNode,u=e.memoizedProps.style,g=u!=null&&u.hasOwnProperty("display")?u.display:null;c.style.display=g==null||typeof g=="boolean"?"":(""+g).trim()}}catch(A){ft(e,e.return,A)}zd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,rt=!0}catch(A){ft(e,e.return,A)}break;case 18:try{var S=e.stateNode;t?Hx(S,!0):Hx(e.stateNode,!1)}catch(A){ft(e,e.return,A)}break;case 22:case 23:e.memoizedState===null&&Rd(e,t);break;default:Rd(e,t)}}function zd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,l=t;switch(n.tag){case 4:Yg(n,l);break e;case 22:n.memoizedState===null&&zd(n,l);break e;default:zd(n,l)}}e=e.sibling}}function Qg(e){var t=e.alternate;t!==null&&(e.alternate=null,Qg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pr(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 Nt=null,pn=!1;function Jn(e,t,n){for(n=n.child;n!==null;)Xg(e,t,n),n=n.sibling}function Xg(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(gt,n)}catch{}switch(n.tag){case 26:ct||en(n,t),Jn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ct&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ct||en(n,t),Wi(n);var l=Nt,c=pn;hs(n.type)&&(Nt=n.stateNode,pn=!1),Jn(e,t,n),Wx(n.stateNode,n.type,n.memoizedProps),Nt=l,pn=c;break;case 5:ct||en(n,t),Wi(n);case 6:if(n.tag===6&&Wi(n),l=Nt,c=pn,Nt=null,Jn(e,t,n),Nt=l,pn=c,Nt!==null)if(pn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(n.stateNode),rt=!0}catch(u){ft(n,t,u)}else try{Nt.removeChild(n.stateNode),rt=!0}catch(u){ft(n,t,u)}break;case 18:Nt!==null&&(pn?(e=Nt,Ux(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ci(e)):Ux(Nt,n.stateNode));break;case 4:l=Nt,c=pn,Nt=n.stateNode.containerInfo,pn=!0,Jn(e,t,n),Nt=l,pn=c;break;case 0:case 11:case 14:case 15:rs(2,n,t),ct||rs(4,n,t),Jn(e,t,n);break;case 1:ct||(en(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Og(n,t,l)),Jn(e,t,n);break;case 21:Jn(e,t,n);break;case 22:ct=(l=ct)||n.memoizedState!==null,Jn(e,t,n),ct=l;break;case 30:en(n,t),Jn(e,t,n);break;case 7:ct||en(n,t),Jn(e,t,n);break;default:Jn(e,t,n)}}function Zg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ci(e)}catch(n){ft(t,t.return,n)}}}function Jg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ci(e)}catch(n){ft(t,t.return,n)}}function fS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fg),t;default:throw Error(o(435,e.tag))}}function Uo(e,t){var n=fS(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var c=jS.bind(null,e,l);l.then(c,c)}})}function un(e,t,n){var l=t.deletions;if(l!==null)for(var c=0;c<l.length;c++){var u=l[c],g=e,S=t,A=S;e:for(;A!==null;){switch(A.tag){case 27:if(hs(A.type)){Nt=A.stateNode,pn=!1;break e}break;case 5:Nt=A.stateNode,pn=!1;break e;case 3:case 4:Nt=A.stateNode.containerInfo,pn=!0;break e}A=A.return}if(Nt===null)throw Error(o(160));Xg(g,S,u),Nt=null,pn=!1,g=u.alternate,g!==null&&(g.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)$g(t,e,n),t=t.sibling}var $n=null;function $g(e,t,n){var l=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var u=0;u<l.length;u++){var g=l[u];g.ref.impl=g.nextImpl}un(t,e,n),dn(e),c&4&&(rs(3,e,e.return),$i(3,e),rs(5,e,e.return));break;case 1:un(t,e,n),dn(e),c&512&&(ct||l===null||en(l,l.return)),c&64&&Yt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(u=$n,un(t,e,n),dn(e),c&512&&(ct||l===null||en(l,l.return)),c&4)if(c=l!==null?l.memoizedState:null,n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null)if(Yt)e.stateNode=Ox(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,c=u.ownerDocument||u;t:switch(t){case"title":l=c.getElementsByTagName("title")[0],(!l||l[Ci]||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,n),l[Zt]=e,Ft(l),t=l;break e;case"link":if(u=ly("link","href",c).get(t+(n.href||""))){for(g=0;g<u.length;g++)if(l=u[g],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){u.splice(g,1);break t}}l=c.createElement(t),tn(l,t,n),c.head.appendChild(l);break;case"meta":if(u=ly("meta","content",c).get(t+(n.content||""))){for(g=0;g<u.length;g++)if(l=u[g],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){u.splice(g,1);break t}}l=c.createElement(t),tn(l,t,n),c.head.appendChild(l);break;default:throw Error(o(468,t))}l[Zt]=e,Ft(l),t=l}e.stateNode=t}else Yt||yf(u,e.type,e.stateNode);else e.stateNode=sy(u,n,e.memoizedProps);else c!==n?(c===null?(t=l.stateNode,t===null||ct||t.parentNode.removeChild(t)):c.count--,n===null?Yt||yf(u,e.type,e.stateNode):sy(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&wd(e,e.memoizedProps,l.memoizedProps);break;case 27:un(t,e,n),dn(e),c&512&&(ct||l===null||en(l,l.return)),l!==null&&c&4&&wd(e,e.memoizedProps,l.memoizedProps);break;case 5:if(u=ma,ma=!1,un(t,e,n),ma=u,dn(e),c&512&&(ct||l===null||en(l,l.return)),e.flags&32){t=e.stateNode;try{Cl(t,""),rt=!0}catch($){ft(e,e.return,$)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,wd(e,t,l!==null?l.memoizedProps:t)),c&1024&&(Td=!0);break;case 6:if(un(t,e,n),dn(e),c&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,rt=!0}catch($){ft(e,e.return,$)}}break;case 3:if(rt=!1,Wo=null,u=$n,$n=cr(t.containerInfo),un(t,e,n),$n=u,dn(e),c&4&&l!==null&&l.memoizedState.isDehydrated)try{ci(t.containerInfo)}catch($){ft(e,e.return,$)}Td&&(Td=!1,Wg(e)),rt=!1;break;case 4:c=ma,ma=Yt,l=bh(),u=$n,$n=cr(e.stateNode.containerInfo),un(t,e,n),dn(e),$n=u,rt&&er&&(Lo=!0),rt=l,ma=c;break;case 12:un(t,e,n),dn(e);break;case 31:un(t,e,n),dn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Uo(e,t)));break;case 13:un(t,e,n),dn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Po=Rt()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Uo(e,t)));break;case 22:u=e.memoizedState!==null,g=l!==null&&l.memoizedState!==null;var S=Yt,A=ct,G=ma;Yt=S||u,ma=G||u,ct=A||g,un(t,e,n),ct=A,ma=G,Yt=S,dn(e),c&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||g||Yt||ct||(t=g||ct,n=Yt,l=ct,Yt=u||Yt,ct=t,os(e,2),Yt=n,ct=l),!u&&ma||Rd(e,u)),c&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Uo(e,n))));break;case 19:un(t,e,n),dn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Uo(e,t)));break;case 30:c&512&&(ct||l===null||en(l,l.return)),c=bh(),u=er,g=(n&335544064)===n,S=e.memoizedProps,er=g&&Aa(S.default,S.update)!=="none",un(t,e,n),dn(e),g&&l!==null&&rt&&(e.flags|=4),er=u,rt=c;break;case 21:break;case 7:c&512&&(ct||l===null||en(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:un(t,e,n),dn(e)}}function dn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Bg(l)){n=l;break}l=l.return}l=null;for(var c=e.return;c!==null;){if(vd(c)){var u=c.stateNode;l===null?l=[u]:l.push(u)}if(bd(c))break;c=c.return}var g=l;if(n==null)throw Error(o(160));switch(n.tag){case 27:var S=n.stateNode,A=kd(e);Ro(e,A,S,g);break;case 5:var G=n.stateNode;n.flags&32&&(Cl(G,""),n.flags&=-33);var $=kd(e);Ro(e,$,G,g);break;case 3:case 4:var ge=n.stateNode.containerInfo,q=kd(e);jd(e,q,ge,g);break;default:throw Error(o(161))}}catch(Z){ft(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,oi=!0,t.reset(),oi=!1),e=e.sibling}}function Fl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ex(t,e),t=t.sibling;else Ig(t)}function ex(e,t){var n=e.alternate;if(n===null)Nd(e,!1);else switch(e.tag){case 3:if(Dd=ha=!1,qg(),Fl(t,e),!ha&&!Lo){if(e=da,e!==null)for(var l=0;l<e.length;l+=3){n=e[l];var c=e[l+1];Px(n,e[l+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Dd=!0}da=null;break;case 5:Fl(t,e);break;case 4:l=ha,ha=!1,Fl(t,e),ha&&(Lo=!0),ha=l;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?Nd(e,!1):Fl(t,e));break;case 30:l=ha,c=qg(),ha=!1,Fl(t,e),ha&&(e.flags|=4);var u=e.memoizedProps,g=e.stateNode;t=Ea(u,g),g=Ea(n.memoizedProps,g);var S=Aa(u.default,u.update);S==="none"?t=!1:(u=n.memoizedState,n.memoizedState=null,n=e.child,hn=0,t=_d(e,n,t,g,S,u,!0),hn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?($l(e,e.memoizedProps.onUpdate),da=c):c!==null&&(c.push.apply(c,da),da=c),ha=(e.flags&32)!==0?!0:l;break;default:Fl(t,e)}}function pa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Kg(e,t.alternate,t),t=t.sibling}function os(e,t){for(e=e.child;e!==null;){var n=e,l=t;switch(n.tag){case 0:case 11:case 14:case 15:rs(4,n,n.return),os(n,l);break;case 1:en(n,n.return);var c=n.stateNode;typeof c.componentWillUnmount=="function"&&Og(n,n.return,c),os(n,l);break;case 27:(l&2)!==0&&Wx(n.stateNode,n.type,n.memoizedProps);case 5:en(n,n.return),n.tag!==5&&n.tag!==27||Wi(n),os(n,l);break;case 6:Wi(n);break;case 26:en(n,n.return),c=n.stateNode,n.memoizedState!==null||c===null||ct||c.parentNode.removeChild(c),os(n,l);break;case 22:n.memoizedState===null&&os(n,l);break;case 30:en(n,n.return),os(n,l);break;case 7:en(n,n.return);default:os(n,l)}e=e.sibling}}function Wn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var l=t.alternate,c=e,u=t,g=u.flags,S=(n&1)!==0;switch(u.tag){case 0:case 11:case 15:Wn(c,u,n),$i(4,u);break;case 1:if(Wn(c,u,n),l=u,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch($){ft(l,l.return,$)}if(l=u,c=l.updateQueue,c!==null){var A=l.stateNode;try{var G=c.shared.hiddenCallbacks;if(G!==null)for(c.shared.hiddenCallbacks=null,c=0;c<G.length;c++)wp(G[c],A)}catch($){ft(l,l.return,$)}}S&&g&64&&Mg(u),ua(u,u.return);break;case 27:(n&2)!==0&&Ug(u);case 5:u.tag!==5&&u.tag!==27||Lg(u),Wn(c,u,n),S&&l===null&&g&4&&Sd(u),ua(u,u.return);break;case 6:Lg(u);break;case 26:A=u.stateNode,u.memoizedState!==null||A===null||Yt||yf(cr(A.ownerDocument),u.type,A),Wn(c,u,n),S&&l===null&&g&4&&Sd(u),ua(u,u.return);break;case 12:Wn(c,u,n);break;case 31:Wn(c,u,n),S&&g&4&&Zg(c,u);break;case 13:Wn(c,u,n),S&&g&4&&Jg(c,u);break;case 22:u.memoizedState===null&&Wn(c,u,n),ua(u,u.return);break;case 30:Wn(c,u,n),ua(u,u.return);break;case 7:ua(u,u.return);default:Wn(c,u,n)}t=t.sibling}}function Md(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Hi(n))}function Od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hi(e))}function On(e,t,n,l){var c=(n&335544064)===n;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)tx(e,t,n,l),t=t.sibling;else c&&Vg(t)}function tx(e,t,n,l){var c=(n&335544064)===n;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Oo(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:On(e,t,n,l),u&2048&&$i(9,t);break;case 1:On(e,t,n,l);break;case 3:On(e,t,n,l),c&&Dd&&(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&&Hi(u)));break;case 12:if(u&2048){On(e,t,n,l),u=t.stateNode;try{var g=t.memoizedProps,S=g.id,A=g.onPostCommit;typeof A=="function"&&A(S,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(G){ft(t,t.return,G)}}else On(e,t,n,l);break;case 31:On(e,t,n,l);break;case 13:On(e,t,n,l);break;case 23:break;case 22:g=t.stateNode,S=t.alternate,t.memoizedState!==null?(c&&S!==null&&S.memoizedState===null&&Oo(S),g._visibility&2?On(e,t,n,l):tr(e,t)):(c&&S!==null&&S.memoizedState!==null&&Oo(t),g._visibility&2?On(e,t,n,l):(g._visibility|=2,Kl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&Md(S,t);break;case 24:On(e,t,n,l),u&2048&&Od(t.alternate,t);break;case 30:c&&(u=t.alternate,u!==null&&(fa(u.child,!0),fa(t.child,!0))),On(e,t,n,l);break;default:On(e,t,n,l)}}function Kl(e,t,n,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,g=t,S=n,A=l,G=g.flags;switch(g.tag){case 0:case 11:case 15:Kl(u,g,S,A,c),$i(8,g);break;case 23:break;case 22:var $=g.stateNode;g.memoizedState!==null?$._visibility&2?Kl(u,g,S,A,c):tr(u,g):($._visibility|=2,Kl(u,g,S,A,c)),c&&G&2048&&Md(g.alternate,g);break;case 24:Kl(u,g,S,A,c),c&&G&2048&&Od(g.alternate,g);break;default:Kl(u,g,S,A,c)}t=t.sibling}}function tr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,c=l.flags;switch(l.tag){case 22:tr(n,l),c&2048&&Md(l.alternate,l);break;case 24:tr(n,l),c&2048&&Od(l.alternate,l);break;default:tr(n,l)}t=t.sibling}}var Qs=8192;function Xs(e,t,n){if(e.subtreeFlags&Qs)for(e=e.child;e!==null;)nx(e,t,n),e=e.sibling}function nx(e,t,n){switch(e.tag){case 26:Xs(e,t,n),e.flags&Qs&&(e.memoizedState!==null?yw(n,$n,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&cy(n,e)));break;case 5:Xs(e,t,n),e.flags&Qs&&(e=e.stateNode,(t&335544128)===t&&cy(n,e));break;case 3:case 4:var l=$n;$n=cr(e.stateNode.containerInfo),Xs(e,t,n),$n=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Qs,Qs=16777216,Xs(e,t,n),Qs=l):Xs(e,t,n));break;case 30:if((e.flags&Qs)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var c=e.stateNode;c.paired=null,kn===null&&(kn=new Map),kn.set(l,c)}Xs(e,t,n);break;default:Xs(e,t,n)}}function ax(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 nr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Qt=l,lx(l,e)}ax(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sx(e),e=e.sibling}function sx(e){switch(e.tag){case 0:case 11:case 15:nr(e),e.flags&2048&&rs(9,e,e.return);break;case 3:nr(e);break;case 12:nr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ho(e)):nr(e);break;default:nr(e)}}function Ho(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Qt=l,lx(l,e)}ax(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:rs(8,t,t.return),Ho(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ho(t));break;default:Ho(t)}e=e.sibling}}function lx(e,t){for(;Qt!==null;){var n=Qt;switch(n.tag){case 0:case 11:case 15:rs(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Hi(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Qt=l;else e:for(n=e;Qt!==null;){l=Qt;var c=l.sibling,u=l.return;if(Qg(l),l===n){Qt=null;break e}if(c!==null){c.return=u,Qt=c;break e}Qt=u}}}var mS={getCacheForType:function(e){var t=Jt(zt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Jt(zt).controller.signal}},hS=typeof WeakMap=="function"?WeakMap:Map,ot=0,xt=null,Ze=null,We=0,dt=0,jn=null,cs=!1,Yl=!1,Ld=!1,Ba=0,_t=0,us=0,Zs=0,qo=0,Nn=0,Ql=0,ar=null,gn=null,Bd=!1,Po=0,ix=0,Go=1/0,Vo=null,ds=null,Ct=0,ea=null,Js=null,ga=0,Ud=0,Hd=null,rx=null,Xl=null,Zl=null,Jl=null,sr=0,Io=null;function Cn(){return(ot&2)!==0&&We!==0?We&-We:oe.T!==null?Xd():uh()}function ox(){if(Nn===0)if((We&536870912)===0||Qe){var e=sa;sa<<=1,(sa&3932160)===0&&(sa=262144),Nn=e}else Nn=536870912;return e=$t.current,e!==null&&(e.flags|=32),Nn}function $l(e,t){if(t!=null){var n=e.stateNode,l=n.ref;l===null&&(l=n.ref=Gx(Ea(e.memoizedProps,n))),Zl===null&&(Zl=[]),Zl.push(t.bind(null,l))}}function xn(e,t,n){(e===xt&&(dt===2||dt===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),fs(e,We,Nn,!1)),Ni(e,n),((ot&2)===0||e!==xt)&&(e===xt&&((ot&2)===0&&(Zs|=n),_t===4&&fs(e,We,Nn,!1)),xa(e))}function cx(e,t,n){if((ot&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ji(e,t),c=l?xS(e,t):Pd(e,t,!0),u=l;do{if(c===0){Yl&&!l&&fs(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!pS(n)){c=Pd(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 S=e;c=ar;var A=S.current.memoizedState.isDehydrated;if(A&&(Wl(S,g).flags|=256),g=Pd(S,g,!1),g!==2&&g!==6){if(Ld&&!A){S.errorRecoveryDisabledLanes|=u,Zs|=u,c=4;break e}u=gn,gn=c,u!==null&&(gn===null?gn=u:gn.push.apply(gn,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Wl(e,0),fs(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:fs(l,t,Nn,!cs);break e;case 2:gn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Po+300-Rt(),10<c)){if(fs(l,t,Nn,!cs),ia(l,0,!0)!==0)break e;ga=t,l.timeoutHandle=rf(ux.bind(null,l,n,gn,Vo,Bd,t,Nn,Zs,Ql,cs,u,"Throttled",-0,0),c);break e}ux(l,n,gn,Vo,Bd,t,Nn,Zs,Ql,cs,u,null,-0,0)}}break}while(!0);xa(e)}function ux(e,t,n,l,c,u,g,S,A,G,$,ge,q,Z){e.timeoutHandle=-1;var je=t.subtreeFlags,De=(u&335544064)===u;if(ge=null,(De||je&8192||(je&16785408)===16785408)&&(ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ra},kn=null,nx(t,u,ge),De&&(je=ge,De=e.containerInfo,De=(De.nodeType===9?De:De.ownerDocument).__reactViewTransition,De!=null&&(je.count++,je.waitingForViewTransition=!0,je=fr.bind(je),De.finished.then(je,je))),je=(u&62914560)===u?Po-Rt():(u&4194048)===u?ix-Rt():0,je=bw(ge,je),je!==null)){ga=u,e.cancelPendingCommit=je(yx.bind(null,e,t,u,n,l,c,g,S,A,G,$,ge,null,q,Z)),fs(e,u,g,!G);return}yx(e,t,u,n,l,c,g,S,A,G,$,ge)}function pS(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var c=n[l],u=c.getSnapshot;c=c.value;try{if(!Sn(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function fs(e,t,n,l){t=lh(e,t),t&=~qo,t&=~Zs,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}n!==0&&rh(e,n,t)}function Fo(){return(ot&6)===0?(lr(0),!1):!0}function qd(){if(Ze!==null){if(dt===0)var e=Ze.return;else e=Ze,Da=Us=null,Qu(e),Hl=null,Gi=0,e=Ze;for(;e!==null;)zg(e.alternate,e),e=e.return;Ze=null}}function Wl(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,HS(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ga=0,qd(),xt=e,Ze=n=_a(e.current,null),We=t,dt=0,jn=null,cs=!1,Yl=ji(e,t),Ld=!1,Ql=Nn=qo=Zs=us=_t=0,gn=ar=null,Bd=!1,Ba=lh(e,t),$r(),n}function dx(e,t){Ve=null,oe.H=jo,t===Ul||t===co?(t=yp(),dt=3):t===Ou?(t=yp(),dt=4):dt=t===cd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jn=t,Ze===null&&(_t=1,No(e,Dn(t,e.current)))}function fx(){var e=$t.current;return e===null?!0:(We&4194048)===We?ln===null:(We&62914560)===We||(We&536870912)!==0?e===ln:!1}function mx(){var e=oe.H;return oe.H=jo,e===null?jo:e}function hx(){var e=oe.A;return oe.A=mS,e}function Ko(){_t=4,cs||(We&4194048)!==We&&$t.current!==null||(Yl=!0),(us&134217727)===0&&(Zs&134217727)===0||xt===null||fs(xt,We,Nn,!1)}function Pd(e,t,n){var l=ot;ot|=2;var c=mx(),u=hx();(xt!==e||We!==t)&&(Vo=null,Wl(e,t)),t=!1;var g=_t;e:do try{if(dt!==0&&Ze!==null){var S=Ze,A=jn;switch(dt){case 8:qd(),g=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var G=dt;if(dt=0,jn=null,ei(e,S,A,G),n&&Yl){g=0;break e}break;default:G=dt,dt=0,jn=null,ei(e,S,A,G)}}gS(),g=_t;break}catch($){dx(e,$)}while(!0);return t&&e.shellSuspendCounter++,Da=Us=null,ot=l,oe.H=c,oe.A=u,Ze===null&&(xt=null,We=0,$r()),g}function gS(){for(;Ze!==null;)px(Ze)}function xS(e,t){var n=ot;ot|=2;var l=mx(),c=hx();xt!==e||We!==t?(Vo=null,Go=Rt()+500,Wl(e,t)):Yl=ji(e,t);e:do try{if(dt!==0&&Ze!==null){t=Ze;var u=jn;t:switch(dt){case 1:dt=0,jn=null,ei(e,t,u,1);break;case 2:case 9:if(gp(u)){dt=0,jn=null,gx(t);break}t=function(){dt!==2&&dt!==9||xt!==e||(dt=7),xa(e)},u.then(t,t);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:gp(u)?(dt=0,jn=null,gx(t)):(dt=0,jn=null,ei(e,t,u,7));break;case 5:var g=null;switch(Ze.tag){case 26:g=Ze.memoizedState;case 5:case 27:var S=Ze;if(g?ry(g):S.stateNode.complete){dt=0,jn=null;var A=S.sibling;if(A!==null)Ze=A;else{var G=S.return;G!==null?(Ze=G,Yo(G)):Ze=null}break t}}dt=0,jn=null,ei(e,t,u,5);break;case 6:dt=0,jn=null,ei(e,t,u,6);break;case 8:qd(),_t=6;break e;default:throw Error(o(462))}}yS();break}catch($){dx(e,$)}while(!0);return Da=Us=null,oe.H=l,oe.A=c,ot=n,Ze!==null?0:(xt=null,We=0,$r(),_t)}function yS(){for(;Ze!==null&&!ki();)px(Ze)}function px(e){var t=Dg(e.alternate,e,Ba);e.memoizedProps=e.pendingProps,t===null?Yo(e):Ze=t}function gx(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jg(n,t,t.pendingProps,t.type,void 0,We);break;case 11:t=jg(n,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:Qu(t);var l=t;l===Kt&&(Qe?(so(l),l.tag===5&&l.stateNode!=null&&(yt=l.stateNode)):(so(l),Qe=!0));default:zg(n,t),t=Ze=lp(t,Ba),t=Dg(n,t,Ba)}e.memoizedProps=e.pendingProps,t===null?Yo(e):Ze=t}function ei(e,t,n,l){Da=Us=null,Qu(t),Hl=null,Gi=0;var c=t.return;try{if(lS(e,c,t,n,We)){_t=1,No(e,Dn(n,e.current)),Ze=null;return}}catch(u){if(c!==null)throw Ze=c,u;_t=1,No(e,Dn(n,e.current)),Ze=null;return}t.flags&32768?(Qe||l===1?e=!0:Yl||(We&536870912)!==0?e=!1:(cs=e=!0,(l===2||l===9||l===3||l===6)&&(l=$t.current,l!==null&&l.tag===13&&(l.flags|=16384))),xx(t,e)):Yo(t)}function Yo(e){var t=e;do{if((t.flags&32768)!==0){xx(t,cs);return}e=t.return;var n=cS(t.alternate,t,Ba);if(n!==null){Ze=n;return}if(t=t.sibling,t!==null){Ze=t;return}Ze=t=e}while(t!==null);_t===0&&(_t=5)}function xx(e,t){do{var n=uS(e.alternate,e);if(n!==null){n.flags&=32767,Ze=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ze=e;return}Ze=e=n}while(e!==null);_t=6,Ze=null}function yx(e,t,n,l,c,u,g,S,A,G,$,ge){e.cancelPendingCommit=null;do Qo();while(Ct!==0);if((ot&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===xt&&(Ze=xt=null,We=0),Js=t,ea=e,ga=n,Hd=c,rx=l,bS(e,t,n,g,S,A,ge)}}function bS(e,t,n,l,c,u,g){var S=t.lanes|t.childLanes;if(Ud=S,S|=wu,F1(e,n,S,l,c,u),Zl=null,(n&335544064)===n?(Jl=Y2(e),l=10262):(Jl=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,NS(ka,function(){return Fd(),null})):(e.callbackNode=null,e.callbackPriority=0),zo=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=oe.T,oe.T=null,c=we.p,we.p=2,u=ot,ot|=4;try{dS(e,t,n)}finally{ot=u,we.p=c,oe.T=l}}Ct=1,zo?Xl=FS(g,e.containerInfo,Jl,Gd,Vd,SS,Id,Fd,vS):(Gd(),Vd(),Id())}function vS(e){if(Ct!==0){var t=ea.onRecoverableError;t(e,{componentStack:null})}}function SS(){Ct===3&&(Ct=0,ex(Js,ea),Ct=4)}function Gd(){if(Ct===1){Ct=0;var e=ea,t=Js,n=ga,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=oe.T,oe.T=null;var c=we.p;we.p=2;var u=ot;ot|=4;try{er=Lo=!1,$g(t,e,n),n=af;var g=Xh(e.containerInfo),S=n.focusedElem,A=n.selectionRange;if(g!==S&&S&&S.ownerDocument&&Qh(S.ownerDocument.documentElement,S)){if(A!==null&&xu(S)){var G=A.start,$=A.end;if($===void 0&&($=G),"selectionStart"in S)S.selectionStart=G,S.selectionEnd=Math.min($,S.value.length);else{var ge=S.ownerDocument||document,q=ge&&ge.defaultView||window;if(q.getSelection){var Z=q.getSelection(),je=S.textContent.length,De=Math.min(A.start,je),Ie=A.end===void 0?De:Math.min(A.end,je);!Z.extend&&De>Ie&&(g=Ie,Ie=De,De=g);var P=Yh(S,De),M=Yh(S,Ie);if(P&&M&&(Z.rangeCount!==1||Z.anchorNode!==P.node||Z.anchorOffset!==P.offset||Z.focusNode!==M.node||Z.focusOffset!==M.offset)){var K=ge.createRange();K.setStart(P.node,P.offset),Z.removeAllRanges(),De>Ie?(Z.addRange(K),Z.extend(M.node,M.offset)):(K.setEnd(M.node,M.offset),Z.addRange(K))}}}}for(ge=[],Z=S;Z=Z.parentNode;)Z.nodeType===1&&ge.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ge.length;S++){var pe=ge[S];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}oi=!!nf,af=nf=null}finally{ot=u,we.p=c,oe.T=l}}e.current=t,Ct=2}}function Vd(){if(Ct===2){Ct=0;var e=ea,t=Js,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=oe.T,oe.T=null;var l=we.p;we.p=2;var c=ot;ot|=4;try{Kg(e,t.alternate,t)}finally{ot=c,we.p=l,oe.T=n}}Ct=3}}function Id(){if(Ct===4||Ct===3){Ct=0;var e=Xl;Xl=null,bl();var t=ea,n=Js,l=ga,c=rx,u=(l&335544064)===l?10262:10256;if((n.subtreeFlags&u)!==0||(n.flags&u)!==0?Ct=5:(Ct=0,Js=ea=null,bx(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(ds=null),Wc(l),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(gt,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=oe.T,u=we.p,we.p=2,oe.T=null;try{for(var g=t.onRecoverableError,S=0;S<c.length;S++){var A=c[S];g(A.value,{componentStack:A.stack})}}finally{oe.T=n,we.p=u}}if(c=Zl,g=Jl,Jl=null,c!==null&&(Zl=null,g===null&&(g=[]),e!==null))for(A=0;A<c.length;A++)n=(0,c[A])(g),n!==void 0&&e.finished.finally(n);(ga&3)!==0&&Qo(),xa(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Io?sr++:(sr=0,Io=t):(sr=0,Io=null),lr(0)}}function bx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hi(t)))}function Qo(){return Xl!==null&&(Xl.skipTransition(),Xl=null),Gd(),Vd(),Id(),Fd()}function Fd(){if(Ct!==5)return!1;var e=ea,t=Ud;Ud=0;var n=Wc(ga),l=oe.T,c=we.p;try{we.p=32>n?32:n,oe.T=null,n=Hd,Hd=null;var u=ea,g=ga;if(Ct=0,Js=ea=null,ga=0,(ot&6)!==0)throw Error(o(331));var S=ot;if(ot|=4,sx(u.current),tx(u,u.current,g,n),ot=S,lr(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(gt,u)}catch{}return!0}finally{we.p=c,oe.T=l,bx(e,t)}}function vx(e,t,n){t=Dn(n,t),t=od(e.stateNode,t,2),e=as(e,t,2),e!==null&&(Ni(e,2),xa(e))}function ft(e,t,n){if(e.tag===3)vx(e,e,n);else for(;t!==null;){if(t.tag===3){vx(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ds===null||!ds.has(l))){e=Dn(n,e),n=gg(2),l=as(t,n,2),l!==null&&(xg(n,l,t,e),Ni(l,2),xa(l));break}}t=t.return}}function Kd(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new hS;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(n)||(Ld=!0,c.add(n),e=wS.bind(null,e,t,n),t.then(e,e))}function wS(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,xt===e&&(We&n)===n&&((_t===4||_t===3&&(We&62914560)===We&&300>Rt()-Po)&&(ot&2)===0?Wl(e,0):qo|=n,Ql===We&&(Ql=0)),xa(e)}function Sx(e,t){t===0&&(t=ih()),e=Os(e,t),e!==null&&(Ni(e,t),xa(e))}function kS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sx(e,n)}function jS(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Sx(e,n)}function NS(e,t){return _s(e,t)}var ti=null,ni=null,Yd=!1,Xo=!1,Qd=!1,ms=0;function xa(e){e!==ni&&e.next===null&&(ni===null?ti=ni=e:ni=ni.next=e),Xo=!0,Yd||(Yd=!0,ES())}function lr(e,t){if(!Qd&&Xo){Qd=!0;do for(var n=!1,l=ti;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var u=0;else{var g=l.suspendedLanes,S=l.pingedLanes;u=(1<<31-Ce(42|e)+1)-1,u&=c&~(g&~S),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Nx(l,u))}else u=We,u=ia(l,l===xt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||ji(l,u)||(n=!0,Nx(l,u));l=l.next}while(n);Qd=!1}}function CS(){wx()}function wx(){Xo=Yd=!1;var e=0;ms!==0&&US()&&(e=ms);for(var t=Rt(),n=null,l=ti;l!==null;){var c=l.next,u=kx(l,t);u===0?(l.next=null,n===null?ti=c:n.next=c,c===null&&(ni=n)):(n=l,(e!==0||(u&3)!==0)&&(Xo=!0)),l=c}Ct!==0&&Ct!==5||lr(e),ms!==0&&(ms=0)}function kx(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var g=31-Ce(u),S=1<<g,A=c[g];A===-1?((S&n)===0||(S&l)!==0)&&(c[g]=I1(S,t)):A<=t&&(e.expiredLanes|=S),u&=~S}if(t=xt,n=We,n=ia(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(dt===2||dt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Fa(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ji(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Fa(l),Wc(n)){case 2:case 8:n=Ya;break;case 32:n=ka;break;case 268435456:n=le;break;default:n=ka}return l=jx.bind(null,e),n=_s(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Fa(l),e.callbackPriority=2,e.callbackNode=null,2}function jx(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qo()&&e.callbackNode!==n)return null;var l=We;return l=ia(e,e===xt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(cx(e,l,t),kx(e,Rt()),e.callbackNode!=null&&e.callbackNode===n?jx.bind(null,e):null)}function Nx(e,t){if(Qo())return null;cx(e,t,!0)}function ES(){qS(function(){(ot&6)!==0?_s(Ts,CS):wx()})}function Xd(){if(ms===0){var e=Ps;e===0&&(e=Qn,Qn<<=1,(Qn&261888)===0&&(Qn=256)),ms=e}return ms}function Cx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ir(e)}function AS(e,t,n,l,c){if(t==="submit"&&n&&n.stateNode===c){var u=Cx((c[fn]||null).action),g=l.submitter;g&&(t=(t=g[fn]||null)?Cx(t.formAction):g.getAttribute("formAction"),t!==null&&(u=t,g=null));var S=new Qr("action","action",null,l,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ms!==0){var A=new FormData(c,g);ad(n,{pending:!0,data:A,method:c.method,action:u},null,A)}}else typeof u=="function"&&(S.preventDefault(),A=new FormData(c,g),ad(n,{pending:!0,data:A,method:c.method,action:u},u,A))},currentTarget:c}]})}}for(var Zd=0;Zd<Su.length;Zd++){var Jd=Su[Zd],_S=Jd.toLowerCase(),TS=Jd[0].toUpperCase()+Jd.slice(1);Zn(_S,"on"+TS)}Zn($h,"onAnimationEnd"),Zn(Wh,"onAnimationIteration"),Zn(ep,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(H2,"onTransitionRun"),Zn(q2,"onTransitionStart"),Zn(P2,"onTransitionCancel"),Zn(tp,"onTransitionEnd"),jl("onMouseEnter",["mouseout","mouseover"]),jl("onMouseLeave",["mouseout","mouseover"]),jl("onPointerEnter",["pointerout","pointerover"]),jl("onPointerLeave",["pointerout","pointerover"]),Rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="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(" "),DS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function Ex(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],c=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var g=l.length-1;0<=g;g--){var S=l[g],A=S.instance,G=S.currentTarget;if(S=S.listener,A!==u&&c.isPropagationStopped())break e;u=S,c.currentTarget=G;try{u(c)}catch($){Jr($)}c.currentTarget=null,u=A}else for(g=0;g<l.length;g++){if(S=l[g],A=S.instance,G=S.currentTarget,S=S.listener,A!==u&&c.isPropagationStopped())break e;u=S,c.currentTarget=G;try{u(c)}catch($){Jr($)}c.currentTarget=null,u=A}}}}function Je(e,t){var n=t[fh];n===void 0&&(n=t[fh]=new Set);var l=e+"__bubble";n.has(l)||(Ax(t,e,2,!1),n.add(l))}function $d(e,t,n){var l=0;t&&(l|=4),Ax(n,e,l,t)}var Zo="_reactListening"+Math.random().toString(36).slice(2);function Wd(e){if(!e[Zo]){e[Zo]=!0,ph.forEach(function(n){n!=="selectionchange"&&(DS.has(n)||$d(n,!1,e),$d(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zo]||(t[Zo]=!0,$d("selectionchange",!1,t))}}function Ax(e,t,n,l){switch(xy(t)){case 2:var c=kw;break;case 8:c=jw;break;default:c=vf}n=c.bind(null,t,n,e),c=void 0,!ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function ef(e,t,n,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 S=l.stateNode.containerInfo;if(S===c)break;if(g===4)for(g=l.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;S!==null;){if(g=Ds(S),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){l=u=g;continue e}S=S.parentNode}}l=l.return}Ah(function(){var G=u,$=lu(n),ge=[];e:{var q=np.get(e);if(q!==void 0){var Z=Qr,je=e;switch(e){case"keypress":if(Kr(n)===0)break e;case"keydown":case"keyup":Z=p2;break;case"focusin":je="focus",Z=du;break;case"focusout":je="blur",Z=du;break;case"beforeblur":case"afterblur":Z=du;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Dh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=a2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=v2;break;case $h:case Wh:case ep:Z=i2;break;case tp:Z=w2;break;case"scroll":case"scrollend":Z=t2;break;case"wheel":Z=j2;break;case"copy":case"cut":case"paste":Z=o2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=zh;break;case"submit":Z=y2;break;case"toggle":case"beforetoggle":Z=C2}var De=(t&4)!==0,Ie=!De&&(e==="scroll"||e==="scrollend"),P=De?q!==null?q+"Capture":null:q;De=[];for(var M=G,K;M!==null;){var pe=M;if(K=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||K===null||P===null||(pe=Ai(M,P),pe!=null&&De.push(rr(M,pe,K))),Ie)break;M=M.return}0<De.length&&(q=new Z(q,je,null,n,$),ge.push({event:q,listeners:De}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",Z&&n!==su&&(je=n.relatedTarget||n.fromElement)&&(Ds(je)||je[Sl]))break e;(q||Z)&&(je=$.window===$?$:(Z=$.ownerDocument)?Z.defaultView||Z.parentWindow:window,q?(Z=n.relatedTarget||n.toElement,q=G,Z=Z?Ds(Z):null,Z!==null&&(Ie=f(Z),De=Z.tag,Z!==Ie||De!==5&&De!==27&&De!==6)&&(Z=null)):(q=null,Z=G),q!==Z&&(De=Dh,pe="onMouseLeave",P="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(De=zh,pe="onPointerLeave",P="onPointerEnter",M="pointer"),Ie=q==null?je:Ei(q),K=Z==null?je:Ei(Z),je=new De(pe,M+"leave",q,n,$),je.target=Ie,je.relatedTarget=K,pe=null,Ds($)===G&&(De=new De(P,M+"enter",Z,n,$),De.target=K,De.relatedTarget=Ie,pe=De),Ie=pe,De=q&&Z?B(q,Z,RS):null,q!==null&&_x(ge,je,q,De,!1),Z!==null&&Ie!==null&&_x(ge,Ie,Z,De,!0)))}e:{if(q=G?Ei(G):window,Z=q.nodeName&&q.nodeName.toLowerCase(),Z==="select"||Z==="input"&&q.type==="file")var Ee=Ph;else if(Hh(q))if(Gh)Ee=L2;else{Ee=M2;var et=z2}else Z=q.nodeName,!Z||Z.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?G&&au(G.elementType)&&(Ee=Ph):Ee=O2;if(Ee&&(Ee=Ee(e,G))){qh(ge,Ee,n,$);break e}et&&et(e,q,G)}switch(et=G?Ei(G):window,e){case"focusin":(Hh(et)||et.contentEditable==="true")&&(Tl=et,yu=G,Li=null);break;case"focusout":Li=yu=Tl=null;break;case"mousedown":bu=!0;break;case"contextmenu":case"mouseup":case"dragend":bu=!1,Zh(ge,n,$);break;case"selectionchange":if(U2)break;case"keydown":case"keyup":Zh(ge,n,$)}var Me;if(mu)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else _l?Bh(e,n)&&(Be="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Be="onCompositionStart");Be&&(Mh&&n.locale!=="ko"&&(_l||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&_l&&(Me=_h()):(Qa=$,ou="value"in Qa?Qa.value:Qa.textContent,_l=!0)),et=Jo(G,Be),0<et.length&&(Be=new Rh(Be,e,null,n,$),ge.push({event:Be,listeners:et}),Me?Be.data=Me:(Me=Uh(n),Me!==null&&(Be.data=Me)))),(Me=A2?_2(e,n):T2(e,n))&&(Be=Jo(G,"onBeforeInput"),0<Be.length&&(et=new Rh("onBeforeInput","beforeinput",null,n,$),ge.push({event:et,listeners:Be}),et.data=Me)),AS(ge,e,G,n,$)}Ex(ge,t)})}function rr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jo(e,t){for(var n=t+"Capture",l=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=Ai(e,n),c!=null&&l.unshift(rr(e,c,u)),c=Ai(e,t),c!=null&&l.push(rr(e,c,u))),e.tag===3)return l;e=e.return}return[]}function RS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _x(e,t,n,l,c){for(var u=t._reactName,g=[];n!==null&&n!==l;){var S=n,A=S.alternate,G=S.stateNode;if(S=S.tag,A!==null&&A===l)break;S!==5&&S!==26&&S!==27||G===null||(A=G,c?(G=Ai(n,u),G!=null&&g.unshift(rr(n,G,A))):c||(G=Ai(n,u),G!=null&&g.push(rr(n,G,A)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var zS=/\r\n?/g,MS=/\u0000|\uFFFD/g;function Tx(e){return(typeof e=="string"?e:""+e).replace(zS,`
|
|
49
|
-
`).replace(MS,"")}function Dx(e,t){return t=Tx(t),Tx(e)===t}function mt(e,t,n,l,c,u){switch(n){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Cl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Cl(e,""+l);else return;break;case"className":Vr(e,"class",l);break;case"tabIndex":Vr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Vr(e,n,l);break;case"style":Ch(e,l,u);return;case"data":if(t!=="object"){Vr(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Ir(l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&mt(e,t,"name",c.name,c,null),mt(e,t,"formEncType",c.formEncType,c,null),mt(e,t,"formMethod",c.formMethod,c,null),mt(e,t,"formTarget",c.formTarget,c,null)):(mt(e,t,"encType",c.encType,c,null),mt(e,t,"method",c.method,c,null),mt(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Ir(l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=ra);return;case"onScroll":l!=null&&Je("scroll",e);return;case"onScrollEnd":l!=null&&Je("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=Ir(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Je("beforetoggle",e),Je("toggle",e),Gr(e,"popover",l);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Gr(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=W1.get(n)||n,Gr(e,n,l);else return}rt=!0}function tf(e,t,n,l,c,u){switch(n){case"style":Ch(e,l,u);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof l=="string")Cl(e,l);else if(typeof l=="number"||typeof l=="bigint")Cl(e,""+l);else return;break;case"onScroll":l!=null&&Je("scroll",e);return;case"onScrollEnd":l!=null&&Je("scrollend",e);return;case"onClick":l!=null&&(e.onclick=ra);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!gh.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),u=n.slice(2,c?n.length-7:void 0),t=e[fn]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(u,t,c),typeof l=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(u,l,c);break e}rt=!0,n in e?e[n]=l:l===!0?e.setAttribute(n,""):Gr(e,n,l)}return}rt=!0}function tn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",e),Je("load",e);var l=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var g=n[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:mt(e,t,u,g,n,null)}}c&&mt(e,t,"srcSet",n.srcSet,n,null),l&&mt(e,t,"src",n.src,n,null);return;case"input":Je("invalid",e);var S=u=g=c=null,A=null,G=null;for(l in n)if(n.hasOwnProperty(l)){var $=n[l];if($!=null)switch(l){case"name":c=$;break;case"type":g=$;break;case"checked":A=$;break;case"defaultChecked":G=$;break;case"value":u=$;break;case"defaultValue":S=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:mt(e,t,l,$,n,null)}}wh(e,u,S,A,G,g,c,!1);return;case"select":Je("invalid",e),l=g=u=null;for(c in n)if(n.hasOwnProperty(c)&&(S=n[c],S!=null))switch(c){case"value":u=S;break;case"defaultValue":g=S;break;case"multiple":l=S;default:mt(e,t,c,S,n,null)}t=u,n=g,e.multiple=!!l,t!=null?Nl(e,!!l,t,!1):n!=null&&Nl(e,!!l,n,!0);return;case"textarea":Je("invalid",e),u=c=l=null;for(g in n)if(n.hasOwnProperty(g)&&(S=n[g],S!=null))switch(g){case"value":l=S;break;case"defaultValue":c=S;break;case"children":u=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(o(91));break;default:mt(e,t,g,S,n,null)}jh(e,l,c,u);return;case"option":for(A in n)if(n.hasOwnProperty(A)&&(l=n[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:mt(e,t,A,l,n,null)}return;case"dialog":Je("beforetoggle",e),Je("toggle",e),Je("cancel",e),Je("close",e);break;case"iframe":case"object":Je("load",e);break;case"video":case"audio":for(l=0;l<ir.length;l++)Je(ir[l],e);break;case"image":Je("error",e),Je("load",e);break;case"details":Je("toggle",e);break;case"embed":case"source":case"link":Je("error",e),Je("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(G in n)if(n.hasOwnProperty(G)&&(l=n[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:mt(e,t,G,l,n,null)}return;default:if(au(t)){for($ in n)n.hasOwnProperty($)&&(l=n[$],l!==void 0&&tf(e,t,$,l,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(l=n[S],l!=null&&mt(e,t,S,l,n,null))}var OS={};function LS(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,g=null,S=null,A=null,G=null,$=null;for(Z in n){var ge=n[Z];if(n.hasOwnProperty(Z)&&ge!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":A=ge;default:l.hasOwnProperty(Z)||mt(e,t,Z,null,l,ge)}}for(var q in l){var Z=l[q];if(ge=n[q],l.hasOwnProperty(q)&&(Z!=null||ge!=null))switch(q){case"type":Z!==ge&&(rt=!0),u=Z;break;case"name":Z!==ge&&(rt=!0),c=Z;break;case"checked":Z!==ge&&(rt=!0),G=Z;break;case"defaultChecked":Z!==ge&&(rt=!0),$=Z;break;case"value":Z!==ge&&(rt=!0),g=Z;break;case"defaultValue":Z!==ge&&(rt=!0),S=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Z!==ge&&mt(e,t,q,Z,l,ge)}}tu(e,g,S,A,G,$,u,c);return;case"select":Z=g=S=q=null;for(u in n)if(A=n[u],n.hasOwnProperty(u)&&A!=null)switch(u){case"value":break;case"multiple":Z=A;default:l.hasOwnProperty(u)||mt(e,t,u,null,l,A)}for(c in l)if(u=l[c],A=n[c],l.hasOwnProperty(c)&&(u!=null||A!=null))switch(c){case"value":u!==A&&(rt=!0),q=u;break;case"defaultValue":u!==A&&(rt=!0),S=u;break;case"multiple":u!==A&&(rt=!0),g=u;default:u!==A&&mt(e,t,c,u,l,A)}t=S,n=g,l=Z,q!=null?Nl(e,!!n,q,!1):!!l!=!!n&&(t!=null?Nl(e,!!n,t,!0):Nl(e,!!n,n?[]:"",!1));return;case"textarea":Z=q=null;for(S in n)if(c=n[S],n.hasOwnProperty(S)&&c!=null&&!l.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:mt(e,t,S,null,l,c)}for(g in l)if(c=l[g],u=n[g],l.hasOwnProperty(g)&&(c!=null||u!=null))switch(g){case"value":c!==u&&(rt=!0),q=c;break;case"defaultValue":c!==u&&(rt=!0),Z=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==u&&mt(e,t,g,c,l,u)}kh(e,q,Z);return;case"option":for(var je in n)if(q=n[je],n.hasOwnProperty(je)&&q!=null&&!l.hasOwnProperty(je))switch(je){case"selected":e.selected=!1;break;default:mt(e,t,je,null,l,q)}for(A in l)if(q=l[A],Z=n[A],l.hasOwnProperty(A)&&q!==Z&&(q!=null||Z!=null))switch(A){case"selected":q!==Z&&(rt=!0),e.selected=q&&typeof q!="function"&&typeof q!="symbol";break;default:mt(e,t,A,q,l,Z)}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 De in n)q=n[De],n.hasOwnProperty(De)&&q!=null&&!l.hasOwnProperty(De)&&mt(e,t,De,null,l,q);for(G in l)if(q=l[G],Z=n[G],l.hasOwnProperty(G)&&q!==Z&&(q!=null||Z!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(137,t));break;default:mt(e,t,G,q,l,Z)}return;default:if(au(t)){for(var Ie in n)q=n[Ie],n.hasOwnProperty(Ie)&&q!==void 0&&!l.hasOwnProperty(Ie)&&tf(e,t,Ie,void 0,l,q);for($ in l)q=l[$],Z=n[$],!l.hasOwnProperty($)||q===Z||q===void 0&&Z===void 0||tf(e,t,$,q,l,Z);return}}for(var P in n)q=n[P],n.hasOwnProperty(P)&&q!=null&&!l.hasOwnProperty(P)&&mt(e,t,P,null,l,q);for(ge in l)q=l[ge],Z=n[ge],!l.hasOwnProperty(ge)||q===Z||q==null&&Z==null||mt(e,t,ge,q,l,Z)}function Rx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var c=n[l],u=c.transferSize,g=c.initiatorType,S=c.duration;if(u&&S&&Rx(g)){for(g=0,S=c.responseEnd,l+=1;l<n.length;l++){var A=n[l],G=A.startTime;if(G>S)break;var $=A.transferSize,ge=A.initiatorType;$&&Rx(ge)&&(A=A.responseEnd,g+=$*(A<S?1:(S-G)/(A-G)))}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 nf=null,af=null;function or(e){return e.nodeType===9?e:e.ownerDocument}function zx(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 Mx(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 Ox(e,t,n,l){return n=or(n).createElement(e),n[Zt]=l,n[fn]=t,tn(n,e,t),Ft(n),n}function sf(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 lf=null;function US(){var e=window.event;return e&&e.type==="popstate"?e===lf?!1:(lf=e,!0):(lf=null,!1)}var rf=typeof setTimeout=="function"?setTimeout:void 0,HS=typeof clearTimeout=="function"?clearTimeout:void 0,Lx=typeof Promise=="function"?Promise:void 0,Bx=typeof requestAnimationFrame=="function"?requestAnimationFrame:rf,qS=typeof queueMicrotask=="function"?queueMicrotask:typeof Lx<"u"?function(e){return Lx.resolve(null).then(e).catch(PS)}:rf;function PS(e){setTimeout(function(){throw e})}function hs(e){return e==="head"}function Ux(e,t){var n=t,l=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(c),ci(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")pf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,pf(n);for(var u=n.firstChild;u;){var g=u.nextSibling,S=u.nodeName;u[Ci]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=g}}else n==="body"&&pf(e.ownerDocument.body);n=c}while(n);ci(t)}function Hx(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function qx(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var c=l=0;c<t.length;c++){var u=t[c];0<u.width&&0<u.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Px(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function GS(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function of(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return GS(t,n,e)}function VS(e){return e.documentElement.clientHeight}function IS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function FS(e,t,n,l,c,u,g,S,A){var G=t.nodeType===9?t:t.ownerDocument;try{var $=G.startViewTransition({update:function(){var q=G.defaultView,Z=q.navigation&&q.navigation.transition,je=G.fonts.status;l();var De=[];if(je==="loaded"&&(VS(G),G.fonts.status==="loading"&&De.push(G.fonts.ready)),je=De.length,e!==null)for(var Ie=e.suspenseyImages,P=0,M=0;M<Ie.length;M++){var K=Ie[M];if(!K.complete){var pe=K.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<q.innerHeight&&pe.left<q.innerWidth){if(P+=oy(K),P>ec){De.length=je;break}K=new Promise(IS.bind(K)),De.push(K)}}}if(0<De.length)return q=Promise.race([Promise.all(De),new Promise(function(Ee){return setTimeout(Ee,500)})]).then(c,c),(Z?Promise.allSettled([Z.finished,q]):q).then(u,u);if(c(),Z)return Z.finished.then(u,u);u()},types:n});G.__reactViewTransition=$;var ge=[];return $.ready.then(function(){for(var q=G.documentElement.getAnimations({subtree:!0}),Z=0;Z<q.length;Z++){var je=q[Z],De=je.effect,Ie=De.pseudoElement;if(Ie!=null&&Ie.startsWith("::view-transition")){ge.push(je),je=De.getKeyframes();for(var P=Ie=void 0,M=!0,K=0;K<je.length;K++){var pe=je[K],Ee=pe.width;if(Ie===void 0)Ie=Ee;else if(Ie!==Ee){M=!1;break}if(Ee=pe.height,P===void 0)P=Ee;else if(P!==Ee){M=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}M&&Ie!==void 0&&P!==void 0&&(De.setKeyframes(je),M=getComputedStyle(De.target,De.pseudoElement),M.width!==Ie||M.height!==P)&&(M=je[0],M.width=Ie,M.height=P,M=je[je.length-1],M.width=Ie,M.height=P,De.setKeyframes(je))}}g()},function(q){G.__reactViewTransition===$&&(G.__reactViewTransition=null);try{if(typeof q=="object"&&q!==null)switch(q.name){case"InvalidStateError":(q.message==="View transition was skipped because document visibility state is hidden."||q.message==="Skipping view transition because document visibility state has become hidden."||q.message==="Skipping view transition because viewport size changed."||q.message==="Transition was aborted because of invalid state")&&(q=null)}q!==null&&A(q)}finally{l(),c(),g()}}),$.finished.finally(function(){for(var q=0;q<ge.length;q++)ge[q].cancel();G.__reactViewTransition===$&&(G.__reactViewTransition=null),S()}),$}catch{return l(),c(),g(),null}}function $s(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}$s.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},$s.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),l=[],c=0;c<n.length;c++){var u=n[c].effect;u!==null&&u.target===e&&u.pseudoElement===t&&l.push(n[c])}return l},$s.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Gx(e){return{name:e,group:new $s("group",e),imagePair:new $s("image-pair",e),old:new $s("old",e),new:new $s("new",e)}}function En(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}En.prototype.addEventListener=function(e,t,n){var l=null,c=null;if(!(n!=null&&typeof n!="boolean"&&(l=n.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(Ix(u,e,t,n)===-1){var g=this,S=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(S=function(A){g.removeEventListener(e,t,n),typeof t=="function"?t.call(this,A):t.handleEvent(A)}),l!==null&&(c=g.removeEventListener.bind(g,e,t,n),l.addEventListener("abort",c,{once:!0}),c=l.removeEventListener.bind(l,"abort",c)),l=ai(n),u.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:S,cleanup:c}),x(this._fragmentFiber.child,!1,KS,e,S,l)}this._eventListeners=u}};function KS(e,t,n,l){return N(e).addEventListener(t,n,l),!1}En.prototype.removeEventListener=function(e,t,n){var l=this._eventListeners;if(l!==null&&(t=Ix(l,e,t,n),t!==-1)){var c=l[t];n=c.attachedListener;var u=c.cleanup;c=ai(c.optionsOrUseCapture),x(this._fragmentFiber.child,!1,YS,e,n,c),l.splice(t,1),u!==null&&u()}};function YS(e,t,n,l){return N(e).removeEventListener(t,n,l),!1}function ai(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vx(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Ix(e,t,n,l){if(e.length===0)return-1;l=Vx(l);for(var c=0;c<e.length;c++){var u=e[c];if(u.type===t&&u.listener===n&&Vx(u.optionsOrUseCapture)===l)return c}return-1}En.prototype.dispatchEvent=function(e){var t=w(this._fragmentFiber);if(t===null)return!0;t=N(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var c=0;c<n.length;c++){var u=n[c];l.addEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),n)for(c=0;c<n.length;c++)u=n[c],l.removeEventListener(u.type,u.attachedListener,ai(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},En.prototype.focus=function(e){x(this._fragmentFiber.child,!0,Fx,e,void 0,void 0)};function Fx(e,t){return e.tag===6?!1:(e=N(e),lw(e,t))}En.prototype.focusLast=function(e){var t=[];x(this._fragmentFiber.child,!0,cf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Fx(t[n],e);n--);};function cf(e,t){return t.push(e),!1}En.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=N(e),e=or(e).activeElement,e!==null&&x(this._fragmentFiber.child,!1,QS,e,void 0,void 0))};function QS(e,t){return e.tag===6?!1:(e=N(e),e===t||e.contains(t)?(t.blur(),!0):!1)}En.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),x(this._fragmentFiber.child,!1,XS,e,void 0,void 0)};function XS(e,t){return e.tag===6||(e=N(e),t.observe(e)),!1}En.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),x(this._fragmentFiber.child,!1,ZS,e,void 0,void 0);for(var n=t=0;n<ta.length;n++){var l=ta[n];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):ta[t++]=l}ta.length=t}};function ZS(e,t){return e.tag===6||(e=N(e),t.unobserve(e)),!1}var ta=[],uf=!1;function JS(e,t,n){ta.push({fragmentInstance:e,observer:t,instance:n}),uf||(uf=!0,iw(function(){uf=!1;var l=ta;ta=[];for(var c=0;c<l.length;c++){var u=l[c];u.observer.unobserve(u.instance)}}))}En.prototype.getClientRects=function(){var e=[];return x(this._fragmentFiber.child,!1,$S,e,void 0,void 0),e};function $S(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=N(e),t.push.apply(t,e.getClientRects());return!1}En.prototype.getRootNode=function(e){var t=w(this._fragmentFiber);return t===null?this:N(t).getRootNode(e)},En.prototype.compareDocumentPosition=function(e){var t=w(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];x(this._fragmentFiber.child,!1,cf,n,void 0,void 0);var l=N(t);if(n.length===0){if(n=l,C(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var c=l=n.compareDocumentPosition(e);return n===e?c=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=k(t)[1],n===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=N(n).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=N(n[0]),c=N(n[n.length-1]);var u=C(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),S=c.compareDocumentPosition(e),A=g&Node.DOCUMENT_POSITION_CONTAINED_BY||S&Node.DOCUMENT_POSITION_CONTAINED_BY;return S=l&&u&&g&Node.DOCUMENT_POSITION_FOLLOWING&&S&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||u&&c===e||A||S?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||WS(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function WS(e,t,n,l,c){var u=Ds(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){n=!0;break e}u=u.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=c.ownerDocument,c===u||c===u.documentElement||c===u.body;e:{for(u=t,t=w(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===n)&&(t=B(n,u,se),t===null?t=!1:(x(t,!0,I,u,n),u=O,O=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=B(l,u,se),t===null?t=!1:(x(t,!0,z,u,l),u=O,R=O=null,t=u!==null)),t):!1}function Kx(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}En.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];x(this._fragmentFiber.child,!1,cf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var l=k(this._fragmentFiber);if(l=n?l[1]||l[0]||w(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=N(l),Kx(e,n);return}if(l=N(l),l.nodeType!==9){if(l.nodeType===11){n="host"in l?l.host:null,n!==null&&n.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=n?t.length-1:0;l!==(n?-1:t.length);){var c=t[l];c.tag===6?(c=N(c),Kx(c,n)):N(c).scrollIntoView(e),l+=n?-1:1}};function ew(e,t){return e=N(e),Yx(e,t),!1}function Yx(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Qx(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var c=n[l];e.addEventListener(c.type,c.attachedListener,ai(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){for(var g=0,S=0;S<ta.length;S++){var A=ta[S];(A.fragmentInstance!==t||A.observer!==u||A.instance!==e)&&(ta[g++]=A)}ta.length=g,u.observe(e)}),Yx(e,t))}function tw(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var c=n[l];e.removeEventListener(c.type,c.attachedListener,ai(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){typeof u.rootMargin=="string"?JS(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function df(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":df(n),Pr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function nw(e,t,n,l){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ci])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=Ln(e.nextSibling),e===null)break}return null}function aw(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ln(e.nextSibling),e===null))return null;return e}function Xx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ln(e.nextSibling),e===null))return null;return e}function ff(e){return e.data==="$?"||e.data==="$~"}function mf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function sw(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ln(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 hf=null;function Zx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ln(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Jx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function lw(e,t){function n(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return l}function iw(e){Bx(function(){Bx(function(t){return e(t)})})}function $x(e,t,n){switch(t=or(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Wx(e,t,n){for(var l in n){var c=n[l];n.hasOwnProperty(l)&&c!=null&&mt(e,t,l,null,OS,c)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ra&&(e.onclick=null),Pr(e)}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pr(e)}var Bn=new Map,ey=new Set;function cr(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 Ua=we.d;we.d={f:rw,r:ow,D:cw,C:uw,L:dw,m:fw,X:hw,S:mw,M:pw};function rw(){var e=Ua.f(),t=Fo();return e||t}function ow(e){var t=wl(e);t!==null&&t.tag===5&&t.type==="form"?ng(t):Ua.r(e)}var si=typeof document>"u"?null:document;function ty(e,t,n){var l=si;if(l&&typeof t=="string"&&t){var c=_n(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),ey.has(c)||(ey.add(c),e={rel:e,crossOrigin:n,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),tn(t,"link",e),Ft(t),l.head.appendChild(t)))}}function cw(e){Ua.D(e),ty("dns-prefetch",e,null)}function uw(e,t){Ua.C(e,t),ty("preconnect",e,t)}function dw(e,t,n){Ua.L(e,t,n);var l=si;if(l&&e&&t){var c='link[rel="preload"][as="'+_n(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+_n(n.imageSizes)+'"]')):c+='[href="'+_n(e)+'"]';var u=c;switch(t){case"style":u=li(e);break;case"script":u=ii(e)}if(!(Bn.has(u)||(e=D({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bn.set(u,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(ur(u))||t==="script"&&l.querySelector(dr(u))))){var g=l.createElement("link");tn(g,"link",e),t==="style"&&(g[qr]=!0,g.onload=g.onerror=function(){hh(g)}),Ft(g),l.head.appendChild(g)}}}function fw(e,t){Ua.m(e,t);var n=si;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+_n(l)+'"][href="'+_n(e)+'"]',u=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ii(e)}if(!Bn.has(u)&&(e=D({rel:"modulepreload",href:e},t),Bn.set(u,e),n.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(dr(u)))return}l=n.createElement("link"),tn(l,"link",e),Ft(l),n.head.appendChild(l)}}}function mw(e,t,n){Ua.S(e,t,n);var l=si;if(l&&e){var c=kl(l).hoistableStyles,u=li(e);t=t||"default";var g=c.get(u);if(!g){var S={loading:0,preload:null};if(g=l.querySelector(ur(u)))S.loading=5;else{e=D({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bn.get(u))&&gf(e,n);var A=g=l.createElement("link");Ft(A),tn(A,"link",e),A._p=new Promise(function(G,$){A.onload=G,A.onerror=$}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,$o(g,t,l)}g={type:"stylesheet",instance:g,count:1,state:S},c.set(u,g)}}}function hw(e,t){Ua.X(e,t);var n=si;if(n&&e){var l=kl(n).hoistableScripts,c=ii(e),u=l.get(c);u||(u=n.querySelector(dr(c)),u||(e=D({src:e,async:!0},t),(t=Bn.get(c))&&xf(e,t),u=n.createElement("script"),Ft(u),tn(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function pw(e,t){Ua.M(e,t);var n=si;if(n&&e){var l=kl(n).hoistableScripts,c=ii(e),u=l.get(c);u||(u=n.querySelector(dr(c)),u||(e=D({src:e,async:!0,type:"module"},t),(t=Bn.get(c))&&xf(e,t),u=n.createElement("script"),Ft(u),tn(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function ny(e,t,n,l){var c=(c=Pe.current)?cr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=li(n.href),t=kl(c).hoistableStyles,l=t.get(n),l||(l={type:"style",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=li(n.href);var u=kl(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(ur(e)))?u._p||(g.instance=u,g.state.loading=5):(u=Bn.get(e),u||(u={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bn.set(e,u)),gw(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=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=ii(n),t=kl(c).hoistableScripts,l=t.get(n),l||(l={type:"script",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function li(e){return'href="'+_n(e)+'"'}function ur(e){return'link[rel="stylesheet"]['+e+"]"}function ay(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function gw(e,t,n,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[qr]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[qr]=!0,t.onload=t.onerror=hh.bind(null,t),tn(t,"link",n),Ft(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 ii(e){return'[src="'+_n(e)+'"]'}function dr(e){return"script[async]"+e}function sy(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+_n(n.href)+'"]');if(l)return t.instance=l,Ft(l),l;var c=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ft(l),tn(l,"style",c),$o(l,n.precedence,e),t.instance=l;case"stylesheet":c=li(n.href);var u=e.querySelector(ur(c));if(u)return t.state.loading|=4,t.instance=u,Ft(u),u;l=ay(n),(c=Bn.get(c))&&gf(l,c),u=(e.ownerDocument||e).createElement("link"),Ft(u);var g=u;return g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),tn(u,"link",l),t.state.loading|=4,$o(u,n.precedence,e),t.instance=u;case"script":return u=ii(n.src),(c=e.querySelector(dr(u)))?(t.instance=c,Ft(c),c):(l=n,(c=Bn.get(u))&&(l=D({},n),xf(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),Ft(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,$o(l,n.precedence,e));return t.instance}function $o(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,u=c,g=0;g<l.length;g++){var S=l[g];if(S.dataset.precedence===t)u=S;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function gf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function xf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wo=null;function ly(e,t,n){if(Wo===null){var l=new Map,c=Wo=new Map;c.set(n,l)}else c=Wo,l=c.get(n),l||(l=new Map,c.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[Ci]||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 S=l.get(g);S?S.push(u):l.set(g,[u])}}return l}function yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function xw(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function iy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function ry(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function oy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function cy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=oy(t),e.suspenseyImages.push(t)),e=vw.bind(e),t.decode().then(e,e))}function yw(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=li(l.href),u=t.querySelector(ur(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Ft(u);return}u=t.ownerDocument||t,l=ay(l),(c=Bn.get(c))&&gf(l,c),u=u.createElement("link"),Ft(u);var g=u;g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),tn(u,"link",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=fr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var ec=0;function bw(e,t){return e.stylesheets&&e.count===0&&nc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&nc(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&ec===0&&(ec=62500*BS());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&nc(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>ec?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function uy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)nc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fr(){this.count--,uy(this)}function vw(){this.imgCount--,uy(this)}var tc=null;function nc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tc=new Map,t.forEach(Sw,e),tc=null,fr.call(e))}function Sw(e,t){if(!(t.state.loading&4)){var n=tc.get(e);if(n)var l=n.get(null);else{n=new Map,tc.set(e,n);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")&&(n.set(g.dataset.precedence,g),l=g)}l&&n.set(null,l)}c=t.instance,g=c.getAttribute("data-precedence"),u=n.get(g)||l,u===l&&n.set(null,c),n.set(g,c),this.count++,l=fr.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 ri={$$typeof:H,Provider:null,Consumer:null,_currentValue:qe,_currentValue2:qe,_threadCount:0};function ww(e,t,n,l,c,u,g,S,A){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=Jc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jc(0),this.hiddenUpdates=Jc(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.transitionTypes=null,this.incompleteTransitions=new Map}function dy(e,t,n,l,c,u,g,S,A,G,$,ge){return e=new ww(e,t,n,g,A,G,$,ge,S),t=1,u===!0&&(t|=24),u=mn(3,null,null,t),e.current=u,u.stateNode=e,t=Ru(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},Lu(u),e}function fy(e){return e?(e=zl,e):zl}function my(e,t,n,l,c,u){c=fy(c),l.context===null?l.context=c:l.pendingContext=c,l=ns(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=as(e,l,t),n!==null&&(xn(n,e,t),Vi(n,e,t))}function hy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bf(e,t){hy(e,t),(e=e.alternate)&&hy(e,t)}function py(e){if(e.tag===13||e.tag===31){var t=Os(e,67108864);t!==null&&xn(t,e,67108864),bf(e,67108864)}}function gy(e){if(e.tag===13||e.tag===31){var t=Cn();t=$c(t);var n=Os(e,t);n!==null&&xn(n,e,t),bf(e,t)}}var oi=!0;function kw(e,t,n,l){var c=oe.T;oe.T=null;var u=we.p;try{we.p=2,vf(e,t,n,l)}finally{we.p=u,oe.T=c}}function jw(e,t,n,l){var c=oe.T;oe.T=null;var u=we.p;try{we.p=8,vf(e,t,n,l)}finally{we.p=u,oe.T=c}}function vf(e,t,n,l){if(oi){var c=Sf(l);if(c===null)ef(e,t,l,ac,n),yy(e,l);else if(Cw(c,e,t,n,l))l.stopPropagation();else if(yy(e,l),t&4&&-1<Nw.indexOf(e)){for(;c!==null;){var u=wl(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 S=u;for(S.pendingLanes|=2,S.entangledLanes|=2;g;){var A=1<<31-Ce(g);S.entanglements[1]|=A,g&=~A}xa(u),(ot&6)===0&&(Go=Rt()+500,lr(0))}}break;case 31:case 13:S=Os(u,2),S!==null&&xn(S,u,2),Fo(),bf(u,2)}if(u=Sf(l),u===null&&ef(e,t,l,ac,n),u===c)break;c=u}c!==null&&l.stopPropagation()}else ef(e,t,l,null,n)}}function Sf(e){return e=lu(e),wf(e)}var ac=null;function wf(e){if(ac=null,e=Ds(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ac=e,null}function xy(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(Ka()){case Ts:return 2;case Ya:return 8;case ka:case vl:return 32;case le:return 268435456;default:return 32}default:return 32}}var kf=!1,ps=null,gs=null,xs=null,mr=new Map,hr=new Map,ys=[],Nw="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 yy(e,t){switch(e){case"focusin":case"focusout":ps=null;break;case"dragenter":case"dragleave":gs=null;break;case"mouseover":case"mouseout":xs=null;break;case"pointerover":case"pointerout":mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hr.delete(t.pointerId)}}function pr(e,t,n,l,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[c]},t!==null&&(t=wl(t),t!==null&&py(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Cw(e,t,n,l,c){switch(t){case"focusin":return ps=pr(ps,e,t,n,l,c),!0;case"dragenter":return gs=pr(gs,e,t,n,l,c),!0;case"mouseover":return xs=pr(xs,e,t,n,l,c),!0;case"pointerover":var u=c.pointerId;return mr.set(u,pr(mr.get(u)||null,e,t,n,l,c)),!0;case"gotpointercapture":return u=c.pointerId,hr.set(u,pr(hr.get(u)||null,e,t,n,l,c)),!0}return!1}function by(e){var t=Ds(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,dh(e.priority,function(){gy(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,dh(e.priority,function(){gy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sf(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);su=l,n.target.dispatchEvent(l),su=null}else return t=wl(n),t!==null&&py(t),e.blockedOn=n,!1;t.shift()}return!0}function vy(e,t,n){sc(e)&&n.delete(t)}function Ew(){kf=!1,ps!==null&&sc(ps)&&(ps=null),gs!==null&&sc(gs)&&(gs=null),xs!==null&&sc(xs)&&(xs=null),mr.forEach(vy),hr.forEach(vy)}function lc(e,t){e.blockedOn===t&&(e.blockedOn=null,kf||(kf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Ew)))}var ic=null;function Sy(e){ic!==e&&(ic=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){ic===e&&(ic=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(wf(l||n)===null)continue;break}var u=wl(n);u!==null&&(e.splice(t,3),t-=3,ad(u,{pending:!0,data:c,method:n.method,action:l},l,c))}}))}function ci(e){function t(A){return lc(A,e)}ps!==null&&lc(ps,e),gs!==null&&lc(gs,e),xs!==null&&lc(xs,e),mr.forEach(t),hr.forEach(t);for(var n=0;n<ys.length;n++){var l=ys[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ys.length&&(n=ys[0],n.blockedOn===null);)by(n),n.blockedOn===null&&ys.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var c=n[l],u=n[l+1],g=c[fn]||null;if(typeof u=="function")g||Sy(n);else if(g){var S=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[fn]||null)S=g.formAction;else if(wf(c)!==null)continue}else S=g.action;typeof S=="function"?n[l+1]=S:(n.splice(l,3),l-=3),Sy(n)}}}function wy(){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(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function jf(e){this._internalRoot=e}rc.prototype.render=jf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=Cn();my(n,l,e,t,null,null)},rc.prototype.unmount=jf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;my(e.current,2,null,e,null,null),Fo(),t[Sl]=null}};function rc(e){this._internalRoot=e}rc.prototype.unstable_scheduleHydration=function(e){if(e){var t=uh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ys.length&&t!==0&&t<ys[n].priority;n++);ys.splice(n,0,e),n===0&&by(e)}};var ky=i.version;if(ky!=="19.3.0")throw Error(o(527,ky,"19.3.0"));we.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=y(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Aw={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:oe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{gt=oc.inject(Aw),St=oc}catch{}}return xr.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",c=fg,u=mg,g=hg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=dy(e,1,!1,null,null,n,l,null,c,u,g,wy),e[Sl]=t.current,Wd(e),new jf(t)},xr.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,c="",u=fg,g=mg,S=hg,A=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(A=n.formState)),t=dy(e,1,!0,t,n??null,l,c,A,u,g,S,wy),t.context=fy(null),n=t.current,l=Cn(),l=$c(l),c=ns(l),c.callback=null,as(n,c,l),n=l,t.current.lanes=n,Ni(t,n),xa(t),e[Sl]=t.current,Wd(e),new rc(t)},xr.version="19.3.0",xr}var My;function qw(){if(My)return Ef.exports;My=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Ef.exports=Hw(),Ef.exports}var Pw=qw();const Gw=Um(Pw);class Bt 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 Ws(a,i={}){const r=a.startsWith("/dashboard/api")?a:`/dashboard/api${a.startsWith("/")?a:`/${a}`}`,o={...i.body instanceof Blob?{}:{"Content-Type":"application/json"},...i.headers},d=await fetch(r,{...i,headers:o});if(d.status===401)throw window.location.href="/login",new Bt(401,"Session expired, redirecting to login...");const f=await d.json().catch(()=>null);if(!d.ok)throw new Bt(d.status,(f==null?void 0:f.error)||(f==null?void 0:f.message)||`HTTP ${d.status}: Request failed`,f);return f}function Vw(a){if(!a)return null;const i=/filename\*=UTF-8''([^;]+)/i.exec(a);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}const r=/filename="([^"]*)"/.exec(a);return(r==null?void 0:r[1])||null}async function Oy(a,i={}){const r=await fetch(`/dashboard/api${a}`,i);if(r.status===401)throw window.location.href="/login",new Bt(401,"Session expired");if(!r.ok){const o=await r.json().catch(()=>null);throw new Bt(r.status,(o==null?void 0:o.error)||"Sticker operation failed",o)}return{blob:await r.blob(),fileName:Vw(r.headers.get("Content-Disposition")),animated:r.headers.get("X-Levix-Animated")==="1"}}const Y={get:a=>Ws(a,{method:"GET"}),post:(a,i)=>Ws(a,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(a,i)=>Ws(a,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(a,i)=>Ws(a,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:a=>Ws(a,{method:"DELETE"}),getStats:()=>Y.get("/stats"),getSession:()=>Y.get("/bot/session"),startSession:a=>Y.post("/bot/session/start",a),reconnectSession:()=>Y.post("/bot/session/reconnect"),stopSession:()=>Y.post("/bot/session/stop"),unlinkSession:()=>Y.post("/bot/logout"),restartBot:()=>Y.post("/bot/restart"),getSettings:()=>Y.get("/settings"),updateSetting:(a,i)=>Y.patch("/settings",{key:a,value:i}),updatePrefix:a=>Y.patch("/settings",{key:"prefix",value:a}),exportSettings:()=>Y.get("/settings/export"),importSettings:a=>Y.post("/settings/import",a),getCommands:()=>Y.get("/commands"),updateCommand:(a,i)=>Y.patch(`/commands/${encodeURIComponent(a)}`,i),postMultipart:(a,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${a}`),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 Bt(401,"Session expired"));return}m.status>=200&&m.status<300?o(p):d(new Bt(m.status,(p==null?void 0:p.error)||(p==null?void 0:p.message)||`HTTP ${m.status}: Request failed`,p))},m.onerror=()=>d(new Bt(0,"Network error")),m.send(f)}),getSchedules:()=>Y.get("/schedules"),createSchedule:a=>Y.post("/schedules",a),deleteSchedule:a=>Y.delete(`/schedules/${encodeURIComponent(a)}`),retrySchedule:a=>Y.post(`/schedules/${encodeURIComponent(a)}/retry`),getGroups:()=>Y.get("/groups"),updateGroup:(a,i)=>Y.patch(`/groups/${encodeURIComponent(a)}`,i),getPersona:()=>Y.get("/ai/persona"),updatePersona:a=>Y.put("/ai/persona",{body:a}),getMemoryFiles:()=>Y.get("/ai/memory"),getMemoryFile:a=>Y.get(`/ai/memory/${encodeURIComponent(a)}`),updateMemoryFile:(a,i)=>Y.put(`/ai/memory/${encodeURIComponent(a)}`,{content:i}),deleteMemoryFile:a=>Y.delete(`/ai/memory/${encodeURIComponent(a)}`),getAiConversations:()=>Y.get("/ai/conversations"),getAiConversation:a=>Y.get(`/ai/conversations/${encodeURIComponent(a)}`),getRecipients:()=>Y.get("/recipients"),fetchAiModels:a=>Y.post("/ai/models",a||{}),changePassword:(a,i)=>Y.post("/security/password",{current:a,next:i}),getFeedbackMeta:()=>Y.get("/feedback/meta"),getFeedbackDiagnosticsPreview:a=>Y.post("/feedback/diagnostics-preview",{client:a}),sendFeedback:a=>Y.post("/feedback",a),sendFeedbackMultipart:(a,i,r)=>new Promise((o,d)=>{const f=new FormData;f.set("message",a.message),f.set("topic",a.topic),a.rating&&f.set("rating",String(a.rating)),a.contact&&f.set("contact",a.contact),a.diagnostics&&f.set("diagnostics",JSON.stringify(a.diagnostics)),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 Bt(401,"Session expired"));return}m.status>=200&&m.status<300?o(p??{success:!0}):d(new Bt(m.status,(p==null?void 0:p.error)||(p==null?void 0:p.message)||`HTTP ${m.status}: Request failed`,p))},m.onerror=()=>d(new Bt(0,"Network error")),m.send(f)}),getCrashReports:()=>Y.get("/crash-reports"),submitCrashReport:a=>Y.post("/crash-reports",a),sendCrashReport:a=>Y.post(`/crash-reports/${encodeURIComponent(a)}/send`),deleteCrashReport:a=>Y.delete(`/crash-reports/${encodeURIComponent(a)}`),deleteAllCrashReports:()=>Y.delete("/crash-reports"),clearLogs:()=>Y.delete("/logs"),getLogs:()=>Y.get("/logs"),getStickerCapabilities:()=>Y.get("/stickers/capabilities"),getStickers:a=>{const i=new URLSearchParams;return a.q&&i.set("q",a.q),a.sort&&i.set("sort",a.sort),a.filter&&i.set("filter",a.filter),a.pack&&i.set("pack",a.pack),a.offset!==void 0&&i.set("offset",a.offset.toString()),a.limit!==void 0&&i.set("limit",a.limit.toString()),Y.get(`/stickers?${i.toString()}`)},uploadStickerSource:(a,i)=>{const r={};return i&&(r["X-Filename"]=encodeURIComponent(i)),Ws("/stickers/uploads",{method:"POST",body:a,headers:r})},uploadExistingStickerSource:a=>Ws(`/stickers/${encodeURIComponent(a)}/uploads`,{method:"POST"}),createStickerJob:a=>Y.post("/stickers/jobs",a),getStickerJob:a=>Y.get(`/stickers/jobs/${encodeURIComponent(a)}`),exportSticker:(a,i)=>Oy(`/stickers/${encodeURIComponent(a)}/export?format=${i}`),exportStickers:(a,i)=>Oy("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a,format:i})}),updateSticker:(a,i)=>Y.patch(`/stickers/${encodeURIComponent(a)}`,i),deleteSticker:(a,i)=>Y.delete(`/stickers/${encodeURIComponent(a)}${i?"?confirm=1":""}`),bulkStickers:a=>Y.post("/stickers/bulk",a),sendStickers:a=>Y.post("/stickers/send",a),getPacks:()=>Y.get("/sticker-packs"),createPack:a=>Y.post("/sticker-packs",{name:a}),getPack:a=>Y.get(`/sticker-packs/${encodeURIComponent(a)}`),updatePack:(a,i)=>Y.patch(`/sticker-packs/${encodeURIComponent(a)}`,{name:i}),deletePack:(a,i)=>Y.delete(`/sticker-packs/${encodeURIComponent(a)}${i?"?deleteStickers=1":""}`),reorderPack:(a,i)=>Y.put(`/sticker-packs/${encodeURIComponent(a)}/order`,{ids:i}),mergePack:(a,i)=>Y.post(`/sticker-packs/${encodeURIComponent(a)}/merge`,{intoPackId:i}),listAutoDeleteRules:()=>Y.get("/auto-delete/rules"),createAutoDeleteRule:a=>Y.post("/auto-delete/rules",a),updateAutoDeleteRule:(a,i)=>Y.patch(`/auto-delete/rules/${a}`,i),deleteAutoDeleteRule:a=>Y.delete(`/auto-delete/rules/${a}`),resetAutoDeleteRule:a=>Y.post(`/auto-delete/rules/${a}/reset`),listAutoDeleteLog:(a={})=>{const i=new URLSearchParams;a.ruleId&&i.set("ruleId",a.ruleId),a.limit!==void 0&&i.set("limit",String(a.limit)),a.offset!==void 0&&i.set("offset",String(a.offset));const r=i.toString();return Y.get(`/auto-delete/log${r?`?${r}`:""}`)},clearAutoDeleteLog:a=>Y.delete(a?`/auto-delete/log?ruleId=${encodeURIComponent(a)}`:"/auto-delete/log")};/**
|
|
50
|
-
* @license lucide-react v1.46.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const Iw=a=>a==null?void 0:a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
55
|
-
* @license lucide-react v1.46.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/function Fw(a,i,r=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Iw(a),size:24,node:i,...r.length>0?{aliases:r}:{}}}/**
|
|
60
|
-
* @license lucide-react v1.46.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const Kw=a=>{let i="",r=!1;for(const o of a){if(o==="-"||o==="_"||o<=" "){r=i.length>0;continue}i.length===0?i+=o.toLowerCase():i+=r?o.toUpperCase():o,r=!1}return i};/**
|
|
65
|
-
* @license lucide-react v1.46.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const Yw=a=>{const i=Kw(a);return i.charAt(0).toUpperCase()+i.slice(1)};/**
|
|
70
|
-
* @license lucide-react v1.46.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const ym=(...a)=>a.filter((i,r,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===r).join(" ").trim();/**
|
|
75
|
-
* @license lucide-react v1.46.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const el={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 Df(a){return a!=null}function Qw(a,i={}){var w,C;const r=i.attributeNames??{},o=k=>r[k]??k,d=a.size??a.width??el.width,f=a.size??a.height??el.height,m=((w=a.aliases)==null?void 0:w.filter(k=>typeof k=="string"&&k.trim()!=="").map(k=>`lucide-${k}`))??[],p=[...a.name?[`lucide-${a.name}`]:[],...m],h=((C=i.className)==null?void 0:C.split(" ").filter(Boolean))??[],y=i.includeDefaultClasses===!1?ym(...h):ym("lucide",...p,...h),b=i.absoluteStrokeWidth?Number(i.strokeWidth??el["stroke-width"])*Number(a.size??a.width??el.width)/Number(i.size??i.width??el.width):i.strokeWidth??el["stroke-width"];return["svg",{...Object.entries(el).reduce((k,[j,N])=>(k[o(j)]=N,k),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&Df(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&Df(i.width)&&{[o("width")]:i.width},..."height"in i&&Df(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:b,...y&&{[o("class")]:y},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},a.node.map(k=>{const[j,N,O]=k,R=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...N}:N;return O?[j,R,O]:[j,R]})]}/**
|
|
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 Xw(a,i={}){return Qw(a,{...i,attributeNames:{...i.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
90
|
-
* @license lucide-react v1.46.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const Zw=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},Jw=v.createContext({}),$w=()=>v.useContext(Jw),Ww=v.forwardRef(({color:a,size:i,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:m,className:p="",children:h,iconNode:y=[],icon:b={node:y,aliases:[],size:24},...x},w)=>{const{size:C=24,strokeWidth:k=2,absoluteStrokeWidth:j=!1,nonScalingStroke:N=!1,color:O="currentColor",className:R=""}=$w()??{},I=!!h||Zw(x),[z,se,B=[]]=Xw(b,{color:a??O,width:r??i??C,height:o??i??C,strokeWidth:d??k,absoluteStrokeWidth:f??j,nonScalingStroke:m??N,className:ym(R,p),hasA11yProp:I,attributes:x});return v.createElement(z,{ref:w,...se},[...B.map(([D,T])=>v.createElement(D,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 ke(a,i=[],r=[]){const o=typeof a=="string"?Fw(a,i,r):a,d=v.forwardRef(({className:f,...m},p)=>v.createElement(Ww,{ref:p,icon:o,className:f,...m}));return o.name&&(d.displayName=Yw(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 Yb={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};Yb.node;const ek=ke(Yb);/**
|
|
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 Qb={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};Qb.node;const tk=ke(Qb);/**
|
|
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 Xb={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"}]]};Xb.node;const nk=ke(Xb);/**
|
|
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 Zb={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"}]]};Zb.node;const ak=ke(Zb);/**
|
|
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 Jb={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"}]]};Jb.node;const qm=ke(Jb);/**
|
|
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 $b={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"}]]};$b.node;const sk=ke($b);/**
|
|
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 Wb={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"}]]};Wb.node;const bm=ke(Wb);/**
|
|
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 e0={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};e0.node;const mi=ke(e0);/**
|
|
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 t0={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};t0.node;const rl=ke(t0);/**
|
|
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 n0={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};n0.node;const _c=ke(n0);/**
|
|
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 a0={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};a0.node;const vm=ke(a0);/**
|
|
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 s0={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};s0.node;const lk=ke(s0);/**
|
|
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 l0={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"]};l0.node;const al=ke(l0);/**
|
|
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 i0={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"]};i0.node;const ws=ke(i0);/**
|
|
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 r0={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"]};r0.node;const ik=ke(r0);/**
|
|
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 o0={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"]};o0.node;const rk=ke(o0);/**
|
|
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 c0={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};c0.node;const u0=ke(c0);/**
|
|
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 d0={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"}]]};d0.node;const f0=ke(d0);/**
|
|
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 m0={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"}]]};m0.node;const ok=ke(m0);/**
|
|
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 h0={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"}]]};h0.node;const Hc=ke(h0);/**
|
|
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 p0={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"]};p0.node;const ck=ke(p0);/**
|
|
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 g0={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"}]]};g0.node;const uk=ke(g0);/**
|
|
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 x0={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"}]]};x0.node;const y0=ke(x0);/**
|
|
215
|
-
* @license lucide-react v1.46.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const b0={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};b0.node;const bi=ke(b0);/**
|
|
220
|
-
* @license lucide-react v1.46.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const v0={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"}]]};v0.node;const Mr=ke(v0);/**
|
|
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 S0={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};S0.node;const dk=ke(S0);/**
|
|
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 w0={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"]};w0.node;const fk=ke(w0);/**
|
|
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 k0={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"}]]};k0.node;const Tc=ke(k0);/**
|
|
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 j0={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"}]]};j0.node;const Ly=ke(j0);/**
|
|
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 N0={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"}]]};N0.node;const By=ke(N0);/**
|
|
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 C0={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"}]]};C0.node;const mk=ke(C0);/**
|
|
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 E0={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"}]]};E0.node;const hk=ke(E0);/**
|
|
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 A0={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"}]]};A0.node;const pk=ke(A0);/**
|
|
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 _0={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"}]]};_0.node;const Sm=ke(_0);/**
|
|
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 T0={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"}]]};T0.node;const gk=ke(T0);/**
|
|
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 D0={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"}]]};D0.node;const xk=ke(D0);/**
|
|
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 R0={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"}]]};R0.node;const z0=ke(R0);/**
|
|
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 M0={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"}]]};M0.node;const yk=ke(M0);/**
|
|
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 O0={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};O0.node;const bk=ke(O0);/**
|
|
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 L0={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"}]]};L0.node;const vk=ke(L0);/**
|
|
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 B0={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"}]]};B0.node;const Sk=ke(B0);/**
|
|
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 U0={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"}]]};U0.node;const xc=ke(U0);/**
|
|
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 H0={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"}]]};H0.node;const yc=ke(H0);/**
|
|
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 q0={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"}]]};q0.node;const P0=ke(q0);/**
|
|
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 G0={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"}]]};G0.node;const wk=ke(G0);/**
|
|
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 V0={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"}]]};V0.node;const wm=ke(V0);/**
|
|
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 I0={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"}]]};I0.node;const Nr=ke(I0);/**
|
|
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 F0={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"]};F0.node;const kk=ke(F0);/**
|
|
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 K0={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"}]]};K0.node;const Y0=ke(K0);/**
|
|
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 Q0={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"}]]};Q0.node;const jk=ke(Q0);/**
|
|
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 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 Nk=ke(X0);/**
|
|
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 Z0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Z0.node;const ol=ke(Z0);/**
|
|
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 J0={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"}]]};J0.node;const Rf=ke(J0);/**
|
|
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 $0={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"}]]};$0.node;const Rr=ke($0);/**
|
|
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 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 Va=ke(W0);/**
|
|
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 ev={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"]};ev.node;const Ck=ke(ev);/**
|
|
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 tv={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"}]]};tv.node;const cl=ke(tv);/**
|
|
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 nv={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"}]]};nv.node;const hi=ke(nv);/**
|
|
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 av={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};av.node;const Pm=ke(av);/**
|
|
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 sv={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"}]]};sv.node;const pi=ke(sv);/**
|
|
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 lv={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"}]]};lv.node;const Ek=ke(lv);/**
|
|
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 iv={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"}]]};iv.node;const Or=ke(iv);/**
|
|
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 rv={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"}]]};rv.node;const Uy=ke(rv);/**
|
|
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 ov={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"}]]};ov.node;const Gm=ke(ov);/**
|
|
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 cv={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"]};cv.node;const uv=ke(cv);/**
|
|
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 dv={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"}]]};dv.node;const Er=ke(dv);/**
|
|
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 fv={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"]};fv.node;const mv=ke(fv);/**
|
|
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 hv={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};hv.node;const km=ke(hv);/**
|
|
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 pv={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"}]]};pv.node;const qc=ke(pv);/**
|
|
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 gv={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"}]]};gv.node;const Vm=ke(gv);/**
|
|
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 xv={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"}]]};xv.node;const Ak=ke(xv);/**
|
|
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 yv={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"}]]};yv.node;const _k=ke(yv);/**
|
|
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 bv={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};bv.node;const ul=ke(bv);/**
|
|
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 vv={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"]};vv.node;const In=ke(vv);/**
|
|
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 Sv={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"]};Sv.node;const dl=ke(Sv);/**
|
|
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 wv={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"}]]};wv.node;const Tk=ke(wv);/**
|
|
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 kv={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"}]]};kv.node;const Dk=ke(kv);/**
|
|
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 jv={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"}]]};jv.node;const Nv=ke(jv);/**
|
|
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 Cv={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"}]]};Cv.node;const cc=ke(Cv);/**
|
|
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 Ev={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"}]]};Ev.node;const ll=ke(Ev);/**
|
|
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 Av={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"}]]};Av.node;const Rk=ke(Av);/**
|
|
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 _v={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"}]]};_v.node;const zk=ke(_v);/**
|
|
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 Tv={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"}]]};Tv.node;const Dv=ke(Tv);/**
|
|
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 Rv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Rv.node;const Kn=ke(Rv);/**
|
|
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 zv={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};zv.node;const Mk=ke(zv),zf={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:"إبقاء العضو",warningLimit:"الحد الأقصى للإنذارات",warningAction:"عند بلوغ حد الإنذارات",groupRules:"قوانين المجموعة",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:"الوضع الداكن",dataDir:"مجلد البيانات",quickStatus:"حالة النظام",activeSchedules:"المهام المجدولة النشطة",activeListening:"المساعد نشط ويستقبل الرسائل",pausedOrLinking:"اتصال واتساب متوقف حالياً أو قيد المزامنة",aiTitle:"إعدادات الذكاء الاصطناعي",aiSubtitle:"اختر المزود المناسب بضغطة زر أو خصص النماذج والمفاتيح",aiAgentEnabled:"تفعيل وكيل الذكاء الاصطناعي",aiProvider:"المزود النشط",quickSetup:"معالج الإعداد السريع للمزودين",aiVision:"تحليل وفهم الصور (Vision)",aiVisionDesc:"تحويل الصور وتمريرها لنماذج الرؤية الذكية المتوافقة",aiStt:"محرك تحويل الصوت إلى نص (STT)",sttDesc:"محرك تفريغ الرسائل الصوتية وتحويلها إلى نص",sttAuto:"تلقائي (مطابق للمزود النشط)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"لغة ردود البوت",botLanguageDesc:"تحديد لغة ردود البوت أو تغييرها عبر الأمر !lang",langAuto:"تلقائي (حسب لغة رسالة المستخدم)",langAr:"العربية الفصحى (دائماً)",langEn:"English (دائماً)",modelName:"النموذج",apiKey:"مفتاح API",enterApiKey:"أدخل المفتاح",baseUrl:"Base URL",maxToolSteps:"الحد الأقصى لخطوات الأدوات",googleSearch:"أداة بحث جوجل المدمجة (Google Search)",personaPrompt:"توجيه شخصية البوت (AI Persona)",personaDesc:"تعديل التوجيه الأساسي الذي يحدد أسلوب وشخصية مساعدك الذكي",editPersona:"تعديل توجيه الشخصية",memoryFiles:"الذاكرة طويلة المدى",memoryDesc:"ذاكرة البوت الدائمة: تشترك جميع المحادثات في الذاكرة العامة، ولكل محادثة ملف خاص. يقرأ البوت المعلومات المحفوظة وأي نص حر تكتبه.",manageMemory:"إدارة ملفات الذاكرة",memoryGlobalScope:"الذاكرة العامة",memoryGlobalScopeHint:"تُضاف إلى سياق جميع المحادثات",memoryChatScopeHint:"تُضاف إلى سياق هذه المحادثة فقط",memoryEntriesCount:"{n} معلومة محفوظة",memoryProseHint:"يقرأ البوت محتوى الملف كله: الأسطر التي تبدأ بـ `-` معلومات منفصلة يمكنه إضافتها أو حذفها، ويقرأ أي نص حر كما كُتب.",memoryEditorPlaceholder:"اكتب هنا ما تريد أن يتذكره البوت دائمًا…",aiInspector:"معاينة محادثات الذكاء الاصطناعي",aiInspectorDesc:"نظرة للقراءة فقط على السياق المخزّن لكل محادثة: الردود، الوسائط، واستخدام الأدوات.",openInspector:"فتح المعاينة",noConversations:"لا توجد محادثات محفوظة بعد.",convTurns:"{n} جزء",backToList:"رجوع للقائمة",convTruncated:"يقتصر العرض على آخر 200 جزء.",convMedia:"ملف وسائط",capabilities:"القدرات والميزات المتقدمة",modelsAvailableLive:"نماذج متاحة لحسابك (تم التحقق عبر API)",modelsRecommendedSeed:"نماذج مقترحة / معروفة (دليل النماذج)",connectKeyFirstPrompt:"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك",refreshModels:"تحديث قائمة النماذج",refreshing:"جارٍ التحديث...",fetchModels:"فحص النماذج المتاحة",fetchingModels:"جارٍ فحص النماذج...",capVision:"الرؤية",capStt:"الصوت",capAudio:"إدخال الصوت",capText:"نص",capPdf:"PDF",capVideo:"فيديو",supported:"مدعوم",unsupported:"غير مدعوم",sourceLive:"حسابك",sourceSeed:"مقترح",sourceUnknown:"غير معروف",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:"تم تغيير كلمة مرور لوحة التحكم بنجاح!",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:"لا توجد بيانات تشخيص متاحة",tabDiagnostics:"التشخيص والأعطال",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:"تعذر تحميل المحادثات."},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",warningLimit:"Warning limit",warningAction:"At the warning limit",groupRules:"Group rules",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",dataDir:"Data Directory",quickStatus:"System Status",activeSchedules:"Active Schedules",activeListening:"Active and listening to messages",pausedOrLinking:"WhatsApp connection is currently paused or linking",aiTitle:"AI Assistant Configuration",aiSubtitle:"Select a provider with one click or configure custom endpoints and keys",aiAgentEnabled:"Enable AI Agent",aiProvider:"Active Provider",quickSetup:"Quick Provider Setup Wizard",aiVision:"Image Understanding (Vision)",aiVisionDesc:"Encode attached images and pass to supported multimodal vision models",aiStt:"Speech-to-Text Provider (STT)",sttDesc:"Speech-to-text transcription engine for voice notes",sttAuto:"Auto (Matches active provider)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"Bot Response Language",botLanguageDesc:"Set bot response language directly or via command !lang",langAuto:"Auto-detect (matches user's language)",langAr:"Modern Standard Arabic (Always)",langEn:"English (Always)",modelName:"Model",apiKey:"API key",enterApiKey:"Enter API key",baseUrl:"Base URL",maxToolSteps:"Max Tool Steps",googleSearch:"Built-in Google Search Grounding",personaPrompt:"AI Persona System Prompt",personaDesc:"Edit the live system prompt that shapes your AI assistant's persona, tone, and behavior.",editPersona:"Edit System Prompt",memoryFiles:"Long-term Memory",memoryDesc:"The bot's durable memory. Global memory is shared by every chat; each chat also has its own file. The bot reads saved entries and any free-form text you write.",manageMemory:"Manage Memory Files",memoryGlobalScope:"Global memory",memoryGlobalScopeHint:"Injected into every chat",memoryChatScopeHint:"Injected into this chat only",memoryEntriesCount:"{n} saved entries",memoryProseHint:"Everything in this file reaches the bot: lines starting with '-' are separate entries it can add or forget, and free-form text is included verbatim.",memoryEditorPlaceholder:"Write anything you want the bot to remember for good…",aiInspector:"AI Conversation Inspector",aiInspectorDesc:"Read-only view of each chat's stored conversation context: replies, media references and tool usage.",openInspector:"Open Inspector",noConversations:"No stored conversations yet.",convTurns:"{n} parts",backToList:"Back to list",convTruncated:"Showing only the latest 200 parts.",convMedia:"media file",capabilities:"Capabilities & Toggles",modelsAvailableLive:"Models Available for Your Account (Live API Verified)",modelsRecommendedSeed:"Recommended / Known Models (Catalog)",connectKeyFirstPrompt:"Please connect your API key first to discover models available to your account",refreshModels:"Refresh Models",refreshing:"Refreshing...",fetchModels:"Fetch Available Models",fetchingModels:"Discovering models...",capVision:"Vision",capStt:"Speech",capAudio:"Audio in",capText:"Text",capPdf:"PDF",capVideo:"Video",supported:"Supported",unsupported:"Unsupported",sourceLive:"Your account",sourceSeed:"Catalog",sourceUnknown:"Unknown",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!",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",feedbackDiagnosticsPreview:"See exactly what is sent",feedbackDiagnosticsLoading:"Loading diagnostics preview...",feedbackDiagnosticsError:"Could not load diagnostics preview",feedbackDiagnosticsEmpty:"No diagnostics available",tabDiagnostics:"Diagnostics",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."}},Im=v.createContext(null),Ok=({children:a})=>{const[i,r]=v.useState(()=>document.documentElement.lang==="ar"?"ar":"en"),[o,d]=v.useState(()=>document.documentElement.getAttribute("data-theme")==="light"?"light":"dark"),f=i==="ar"?"rtl":"ltr";v.useEffect(()=>{const b=x=>{const w=x.detail;((w==null?void 0:w.language)==="ar"||(w==null?void 0:w.language)==="en")&&r(w.language),((w==null?void 0:w.theme)==="light"||(w==null?void 0:w.theme)==="dark")&&d(w.theme)};return window.addEventListener("levix-ui-prefs",b),()=>window.removeEventListener("levix-ui-prefs",b)},[]);const m=(b,x,w)=>{var k;const C=window.LevixHost;(k=C==null?void 0:C.setUiPrefs)==null||k.call(C,b,x,w)},p=b=>{b!==i&&(r(b),document.documentElement.lang=b,document.documentElement.dir=b==="ar"?"rtl":"ltr",localStorage.setItem("levix_lang",b),m(b,o,"language"))},h=b=>{b!==o&&(d(b),document.documentElement.setAttribute("data-theme",b),localStorage.setItem("levix_theme",b),m(i,b,"theme"))},y=v.useMemo(()=>(b,x)=>(zf[i]||zf.en)[b]??zf.en[b]??x??String(b),[i]);return s.jsx(Im.Provider,{value:{language:i,theme:o,direction:f,setLanguage:p,setTheme:h,t:y},children:a})},He=()=>{const a=v.useContext(Im);if(!a)throw new Error("useI18n must be used within an I18nProvider");return a};function Lk({src:a,name:i}){var d;const[r,o]=v.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:a,alt:"",loading:"lazy",onError:()=>o(!0),className:"absolute inset-0 size-full object-cover"})]})}function Mv(a){var i,r,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(i=0;i<d;i++)a[i]&&(r=Mv(a[i]))&&(o&&(o+=" "),o+=r)}else for(r in a)a[r]&&(o&&(o+=" "),o+=r);return o}function Bk(){for(var a,i,r=0,o="",d=arguments.length;r<d;r++)(a=arguments[r])&&(i=Mv(a))&&(o&&(o+=" "),o+=i);return o}const Uk=(a,i)=>{const r=new Array(a.length+i.length);for(let o=0;o<a.length;o++)r[o]=a[o];for(let o=0;o<i.length;o++)r[a.length+o]=i[o];return r},Hk=(a,i)=>({classGroupId:a,validator:i}),Ov=(a=new Map,i=null,r)=>({nextPart:a,validators:i,classGroupId:r}),Dc="-",Hy=[],qk="arbitrary..",Pk=a=>{const i=Vk(a),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Gk(m);const p=m.split(Dc),h=p[0]===""&&p.length>1?1:0;return Lv(p,h,i)},getConflictingClassGroupIds:(m,p)=>{if(p){const h=o[m],y=r[m];return h?y?Uk(y,h):h:y||Hy}return r[m]||Hy}}},Lv=(a,i,r)=>{if(a.length-i===0)return r.classGroupId;const d=a[i],f=r.nextPart.get(d);if(f){const y=Lv(a,i+1,f);if(y)return y}const m=r.validators;if(m===null)return;const p=i===0?a.join(Dc):a.slice(i).join(Dc),h=m.length;for(let y=0;y<h;y++){const b=m[y];if(b.validator(p))return b.classGroupId}},Gk=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=a.slice(1,-1),r=i.indexOf(":"),o=i.slice(0,r);return o?qk+o:void 0})(),Vk=a=>{const{theme:i,classGroups:r}=a;return Ik(r,i)},Ik=(a,i)=>{const r=Ov();for(const o in a){const d=a[o];Fm(d,r,o,i)}return r},Fm=(a,i,r,o)=>{const d=a.length;for(let f=0;f<d;f++){const m=a[f];Fk(m,i,r,o)}},Fk=(a,i,r,o)=>{if(typeof a=="string"){Kk(a,i,r);return}if(typeof a=="function"){Yk(a,i,r,o);return}Qk(a,i,r,o)},Kk=(a,i,r)=>{const o=a===""?i:Bv(i,a);o.classGroupId=r},Yk=(a,i,r,o)=>{if(Xk(a)){Fm(a(o),i,r,o);return}i.validators===null&&(i.validators=[]),i.validators.push(Hk(r,a))},Qk=(a,i,r,o)=>{const d=Object.entries(a),f=d.length;for(let m=0;m<f;m++){const[p,h]=d[m];Fm(h,Bv(i,p),r,o)}},Bv=(a,i)=>{let r=a;const o=i.split(Dc),d=o.length;for(let f=0;f<d;f++){const m=o[f];let p=r.nextPart.get(m);p||(p=Ov(),r.nextPart.set(m,p)),r=p}return r},Xk=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,Zk=a=>{if(a<1)return{get:()=>{},set:()=>{}};let i=0,r=Object.create(null),o=Object.create(null);const d=(f,m)=>{r[f]=m,i++,i>a&&(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)}}},jm="!",qy=":",Jk=[],Py=(a,i,r,o,d)=>({modifiers:a,hasImportantModifier:i,baseClassName:r,maybePostfixModifierPosition:o,isExternal:d}),$k=a=>{const{prefix:i,experimentalParseClassName:r}=a;let o=d=>{const f=[];let m=0,p=0,h=0,y;const b=d.length;for(let j=0;j<b;j++){const N=d[j];if(m===0&&p===0){if(N===qy){f.push(d.slice(h,j)),h=j+1;continue}if(N==="/"){y=j;continue}}N==="["?m++:N==="]"?m--:N==="("?p++:N===")"&&p--}const x=f.length===0?d:d.slice(h);let w=x,C=!1;x.endsWith(jm)?(w=x.slice(0,-1),C=!0):x.startsWith(jm)&&(w=x.slice(1),C=!0);const k=y&&y>h?y-h:void 0;return Py(f,C,w,k)};if(i){const d=i+qy,f=o;o=m=>m.startsWith(d)?f(m.slice(d.length)):Py(Jk,!1,m,void 0,!0)}if(r){const d=o;o=f=>r({className:f,parseClassName:d})}return o},Wk=a=>{const i=new Map;return a.orderSensitiveModifiers.forEach((r,o)=>{i.set(r,1e6+o)}),r=>{const o=[];let d=[];for(let f=0;f<r.length;f++){const 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}},ej=a=>({cache:Zk(a.cacheSize),parseClassName:$k(a),sortModifiers:Wk(a),postfixLookupClassGroupIds:tj(a),...Pk(a)}),tj=a=>{const i=Object.create(null),r=a.postfixLookupClassGroups;if(r)for(let o=0;o<r.length;o++)i[r[o]]=!0;return i},nj=/\s+/,aj=(a,i)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:m}=i,p=[],h=a.trim().split(nj);let y="";for(let b=h.length-1;b>=0;b-=1){const x=h[b],{isExternal:w,modifiers:C,hasImportantModifier:k,baseClassName:j,maybePostfixModifierPosition:N}=r(x);if(w){y=x+(y.length>0?" "+y:y);continue}let O=!!N,R;if(O){const D=j.substring(0,N);R=o(D);const T=R&&m[R]?o(j):void 0;T&&T!==R&&(R=T,O=!1)}else R=o(j);if(!R){if(!O){y=x+(y.length>0?" "+y:y);continue}if(R=o(j),!R){y=x+(y.length>0?" "+y:y);continue}O=!1}const I=C.length===0?"":C.length===1?C[0]:f(C).join(":"),z=k?I+jm:I,se=z+R;if(p.indexOf(se)>-1)continue;p.push(se);const B=d(R,O);for(let D=0;D<B.length;++D){const T=B[D];p.push(z+T)}y=x+(y.length>0?" "+y:y)}return y},sj=(...a)=>{let i=0,r,o,d="";for(;i<a.length;)(r=a[i++])&&(o=Uv(r))&&(d&&(d+=" "),d+=o);return d},Uv=a=>{if(typeof a=="string")return a;let i,r="";for(let o=0;o<a.length;o++)a[o]&&(i=Uv(a[o]))&&(r&&(r+=" "),r+=i);return r},lj=(a,...i)=>{let r,o,d,f;const m=h=>{const y=i.reduce((b,x)=>x(b),a());return r=ej(y),o=r.cache.get,d=r.cache.set,f=p,p(h)},p=h=>{const y=o(h);if(y)return y;const b=aj(h,r);return d(h,b),b};return f=m,(...h)=>f(sj(...h))},ij=[],Gt=a=>{const i=r=>r[a]||ij;return i.isThemeGetter=!0,i.themeKey=a,i},Hv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cj=/\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$/,uj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,dj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vs=a=>rj.test(a),Xe=a=>!!a&&!Number.isNaN(Number(a)),ya=a=>!!a&&Number.isInteger(Number(a)),Mf=a=>a.endsWith("%")&&Xe(a.slice(0,-1)),Ha=a=>oj.test(a),Pv=()=>!0,mj=a=>cj.test(a)&&!uj.test(a),Km=()=>!1,hj=a=>dj.test(a),pj=a=>fj.test(a),gj=a=>!Ae(a)&&!_e(a),xj=a=>a.startsWith("@container")&&(a[10]==="/"&&a[11]!==void 0||a[11]==="s"&&a[16]!==void 0&&a.startsWith("-size/",10)||a[11]==="n"&&a[18]!==void 0&&a.startsWith("-normal/",10)),yj=a=>As(a,Iv,Km),Ae=a=>Hv.test(a),tl=a=>As(a,Fv,mj),Gy=a=>As(a,Cj,Xe),bj=a=>As(a,Yv,Pv),vj=a=>As(a,Kv,Km),Vy=a=>As(a,Gv,Km),Sj=a=>As(a,Vv,pj),uc=a=>As(a,Qv,hj),_e=a=>qv.test(a),yr=a=>fl(a,Fv),wj=a=>fl(a,Kv),Iy=a=>fl(a,Gv),kj=a=>fl(a,Iv),jj=a=>fl(a,Vv),dc=a=>fl(a,Qv,!0),Nj=a=>fl(a,Yv,!0),As=(a,i,r)=>{const o=Hv.exec(a);return o?o[1]?i(o[1]):r(o[2]):!1},fl=(a,i,r=!1)=>{const o=qv.exec(a);return o?o[1]?i(o[1]):r:!1},Gv=a=>a==="position"||a==="percentage",Vv=a=>a==="image"||a==="url",Iv=a=>a==="length"||a==="size"||a==="bg-size",Fv=a=>a==="length",Cj=a=>a==="number",Kv=a=>a==="family-name",Yv=a=>a==="number"||a==="weight",Qv=a=>a==="shadow",Ej=()=>{const a=Gt("color"),i=Gt("font"),r=Gt("text"),o=Gt("font-weight"),d=Gt("tracking"),f=Gt("leading"),m=Gt("breakpoint"),p=Gt("container"),h=Gt("spacing"),y=Gt("radius"),b=Gt("shadow"),x=Gt("inset-shadow"),w=Gt("text-shadow"),C=Gt("drop-shadow"),k=Gt("blur"),j=Gt("perspective"),N=Gt("aspect"),O=Gt("ease"),R=Gt("animate"),I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],se=()=>[...z(),_e,Ae],B=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],T=()=>[_e,Ae,h],F=()=>[vs,"full","auto",...T()],U=()=>[ya,"none","subgrid",_e,Ae],W=()=>["auto",{span:["full",ya,_e,Ae]},ya,_e,Ae],ee=()=>[ya,"auto",_e,Ae],ue=()=>["auto","min","max","fr",_e,Ae],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...T()],me=()=>[vs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],de=()=>[p,vs,"screen","full","dvw","lvw","svw","min","max","fit",...T()],be=()=>[vs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],_=()=>[a,_e,Ae],J=()=>[...z(),Iy,Vy,{position:[_e,Ae]}],ye=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Se=()=>["auto","cover","contain",kj,yj,{size:[_e,Ae]}],E=()=>[Mf,yr,tl],Q=()=>["","none","full",y,_e,Ae],V=()=>["",Xe,yr,tl],re=()=>["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"],ce=()=>[Xe,Mf,Iy,Vy],he=()=>["","none",k,_e,Ae],oe=()=>["none",Xe,_e,Ae],we=()=>["none",Xe,_e,Ae],qe=()=>[Xe,_e,Ae],lt=()=>[vs,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ha],breakpoint:[Ha],color:[Pv],container:[Ha],"drop-shadow":[Ha],ease:["in","out","in-out"],font:[gj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ha],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ha],shadow:[Ha],spacing:["px",Xe],text:[Ha],"text-shadow":[Ha],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vs,Ae,_e,N]}],container:["container"],"container-type":[{"@container":["","normal","size",_e,Ae]}],"container-named":[xj],columns:[{columns:[Xe,"auto",Ae,_e,p]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:se()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[ya,"auto",_e,Ae]}],basis:[{basis:[vs,"full","auto",p,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,vs,"auto","initial","none",Ae]}],grow:[{grow:["",Xe,_e,Ae]}],shrink:[{shrink:["",Xe,_e,Ae]}],order:[{order:[ya,"first","last","none",_e,Ae]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],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:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:me()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...be()]}],"min-block-size":[{"min-block":["auto",...be()]}],"max-block-size":[{"max-block":["none",...be()]}],w:[{w:[p,"screen",...me()]}],"min-w":[{"min-w":[p,"screen","none",...me()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...me()]}],h:[{h:["screen","lh",...me()]}],"min-h":[{"min-h":["screen","lh","none",...me()]}],"max-h":[{"max-h":["screen","lh","none",...me()]}],"font-size":[{text:["base",r,yr,tl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Nj,bj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mf,Ae]}],"font-family":[{font:[wj,vj,i]}],"font-features":[{"font-features":[Ae]}],"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,_e,Ae]}],"line-clamp":[{"line-clamp":[Xe,"none",_e,Gy]}],leading:[{leading:["none",f,...T()]}],"list-image":[{"list-image":["none",_e,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",_e,tl]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Xe,"auto",_e,Ae]}],"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:[ya,_e,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Ae]}],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",_e,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:ye()}],"bg-size":[{bg:Se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ya,_e,Ae],radial:["",_e,Ae],conic:["",ya,_e,Ae]},jj,Sj]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:E()}],"gradient-via-pos":[{via:E()}],"gradient-to-pos":[{to:E()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,_e,Ae]}],"outline-w":[{outline:["",Xe,yr,tl]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","inner","none",b,dc,uc]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",x,dc,uc]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Xe,tl]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",w,dc,uc]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Xe,_e,Ae]}],"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":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[_e,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:ye()}],"mask-size":[{mask:Se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Ae]}],filter:[{filter:["","none",_e,Ae]}],blur:[{blur:he()}],brightness:[{brightness:[Xe,_e,Ae]}],contrast:[{contrast:[Xe,_e,Ae]}],"drop-shadow":[{"drop-shadow":["","none",C,dc,uc]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Xe,_e,Ae]}],"hue-rotate":[{"hue-rotate":[Xe,_e,Ae]}],invert:[{invert:["",Xe,_e,Ae]}],saturate:[{saturate:[Xe,_e,Ae]}],sepia:[{sepia:["",Xe,_e,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Ae]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,_e,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,_e,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,_e,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,_e,Ae]}],"backdrop-invert":[{"backdrop-invert":["",Xe,_e,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,_e,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,_e,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,_e,Ae]}],"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",_e,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",_e,Ae]}],ease:[{ease:["linear","initial",O,_e,Ae]}],delay:[{delay:[Xe,_e,Ae]}],animate:[{animate:["none",R,_e,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,_e,Ae]}],"perspective-origin":[{"perspective-origin":se()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:we()}],"scale-x":[{"scale-x":we()}],"scale-y":[{"scale-y":we()}],"scale-z":[{"scale-z":we()}],"scale-3d":["scale-3d"],skew:[{skew:qe()}],"skew-x":[{"skew-x":qe()}],"skew-y":[{"skew-y":qe()}],transform:[{transform:[_e,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:se()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:lt()}],"translate-x":[{"translate-x":lt()}],"translate-y":[{"translate-y":lt()}],"translate-z":[{"translate-z":lt()}],"translate-none":["translate-none"],zoom:[{zoom:[ya,_e,Ae]}],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",_e,Ae]}],"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":_()}],"scrollbar-track-color":[{"scrollbar-track":_()}],"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",_e,Ae]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Xe,yr,tl,Gy]}],stroke:[{stroke:["none",..._()]}],"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"]}},Aj=lj(Ej);function Ue(...a){return Aj(Bk(a))}const _j={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 $e({tone:a="neutral",className:i,children:r,...o}){return s.jsx("span",{className:Ue("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-bold",_j[a],i),...o,children:r})}function bc({dot:a=!1,pulse:i=!1,children:r,...o}){return s.jsxs($e,{...o,children:[a&&s.jsx("span",{className:Ue("size-2 shrink-0 rounded-full bg-current",i&&"pulse-dot")}),r]})}function Tj({tone:a="neutral",label:i}){return s.jsxs("span",{role:"status",className:Ue("inline-flex size-4 items-center justify-center",{ok:"text-ok",warn:"text-warn",danger:"text-danger",info:"text-info",neutral:"text-muted"}[a]),children:[s.jsx("span",{"aria-hidden":!0,className:"size-2.5 rounded-full bg-current"}),s.jsx("span",{className:"sr-only",children:i})]})}const fi={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"}},fe=v.forwardRef(function({variant:i="secondary",size:r="md",loading:o=!1,icon:d,className:f,type:m="button",disabled:p,children:h,...y},b){return s.jsxs("button",{ref:b,type:m,disabled:p||o,"aria-busy":o||void 0,className:Ue(fi.base,fi.variant[i],fi.size[r],f),...y,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=v.forwardRef(function({label:i,icon:r,children:o,variant:d="secondary",size:f="sm",loading:m=!1,pressed:p,className:h,type:y="button",disabled:b,...x},w){const C=r??o;return s.jsx("button",{ref:w,type:y,title:i,"aria-label":i,...p===void 0?{}:{"aria-pressed":p},disabled:b||m,"aria-busy":m||void 0,className:Ue(fi.base,fi.variant[d],fi.icon[f],p&&"border-brand-blue/40 bg-brand-blue/15 text-brand-blue",h),...x,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:C})})}),Ye=v.forwardRef(function({className:i,padded:r=!0,...o},d){return s.jsx("div",{ref:d,className:Ue("rounded-2xl border border-line bg-panel shadow-sm",r&&"p-4 md:p-5",i),...o})}),Xv=Ye;function qn({title:a,description:i,actions:r,icon:o,className:d}){return s.jsxs("div",{className:Ue("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",d),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o&&s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-brand-cyan/10 text-brand-cyan",children:o}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h2",{className:"truncate text-base font-bold text-text-main md:text-lg",children:a}),i&&s.jsx("p",{className:"mt-0.5 text-xs text-muted",children:i})]})]}),r&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r})]})}function ml({className:a,...i}){return s.jsx(Ye,{className:a,children:s.jsx(qn,{...i})})}function Fy({title:a,description:i,actions:r,children:o,className:d}){return s.jsxs("section",{className:Ue("flex flex-col gap-3",d),children:[a&&s.jsx(qn,{title:a,description:i,actions:r}),o]})}const Pc="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 ks({children:a,htmlFor:i}){return s.jsx("label",{htmlFor:i,className:"mb-1 block text-xs font-bold text-text-main",children:a})}function Fe({label:a,description:i,error:r,htmlFor:o,children:d,className:f}){return s.jsxs("div",{className:Ue("flex flex-col gap-1.5",f),children:[a&&s.jsx(ks,{htmlFor:o,children:a}),d,r?s.jsx("p",{className:"text-xs text-danger",children:r}):i&&s.jsx("p",{className:"text-xs text-muted",children:i})]})}const Ke=v.forwardRef(function({className:i,technical:r=!1,dir:o,...d},f){return s.jsx("input",{ref:f,dir:o??(r?"ltr":void 0),className:Ue(Pc,r&&"text-start",i),...d})}),il=v.forwardRef(function({className:i,...r},o){return s.jsx("textarea",{ref:o,className:Ue(Pc,"h-auto min-h-24 resize-y py-3 leading-relaxed",i),...r})}),Ht=v.forwardRef(function({className:i,...r},o){return s.jsx("select",{ref:o,className:Ue(Pc,"pe-8",i),...r})}),zr=v.forwardRef(function({label:i,description:r,className:o,id:d,...f},m){const p=v.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:Ue("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 yn({label:a,name:i,value:r,onChange:o,options:d,orientation:f="vertical",className:m}){return s.jsxs("div",{role:"radiogroup","aria-label":a,className:Ue("flex gap-1",f==="horizontal"?"flex-row flex-wrap":"flex-col",m),children:[a&&s.jsx("p",{className:"mb-1 w-full text-xs font-bold text-text-main",children:a}),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 Fn=v.forwardRef(function({checked:i,onChange:r,disabled:o,id:d,label:f,description:m,className:p,...h},y){const b=v.useId(),x=d||b,w=`${x}-label`,C=`${x}-description`,k=!!(f||m);return s.jsxs("div",{className:Ue(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:w,htmlFor:x,className:"block cursor-pointer text-sm font-semibold text-text-main",children:f}),m&&s.jsx("p",{id:C,className:"mt-0.5 text-xs text-muted",children:m})]}),s.jsx("button",{ref:y,type:"button",...h,role:"switch","aria-checked":i,"aria-labelledby":h["aria-labelledby"]??(f&&!h["aria-label"]?w:void 0),"aria-describedby":[h["aria-describedby"],m?C:void 0].filter(Boolean).join(" ")||void 0,id:x,disabled:o,onClick:()=>r(!i),className:Ue("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:Ue("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 Gc({children:a,removeLabel:i,onRemove:r,dir:o="auto",className:d,disabled:f}){return s.jsxs("span",{className:Ue("inline-flex max-w-full items-center gap-0.5 rounded-full border border-line bg-panel-raised py-0.5 ps-2.5 text-xs font-semibold text-text-main",r?"pe-0.5":"pe-2.5",d),children:[s.jsx("span",{dir:o,className:"min-w-0 truncate",children:a}),r&&i&&s.jsx(Oe,{variant:"ghost",label:i,icon:s.jsx(Kn,{size:14}),disabled:f,onMouseDown:m=>m.preventDefault(),onClick:r})]})}function Dj(a){return a.split(/[,،\n\r]+/)}const Rj=v.forwardRef(function({value:i,onChange:r,max:o,maxLength:d,prepare:f,onReject:m,removeLabel:p,countLabel:h,chipDir:y="auto",className:b,disabled:x,id:w,placeholder:C,"aria-label":k,"aria-invalid":j,"aria-describedby":N,...O},R){const I=v.useId(),z=w??I,[se,B]=v.useState(""),D=(F,U)=>{const W=F.trim();if(!W)return{next:U,reason:null};let ee=W;if(f){const ue=f(W);if("error"in ue)return{next:U,reason:ue.error};if(ee=ue.value,!ee)return{next:U,reason:"empty"}}else if(d!==void 0&&ee.length>d)return{next:U,reason:"long"};return U.includes(ee)?{next:U,reason:"duplicate"}:o!==void 0&&U.length>=o?{next:U,reason:"max"}:{next:[...U,ee],reason:null}},T=F=>{const U=Dj(F);let W=i,ee=null,ue=!1;for(const ie of U){if(!ie.trim())continue;ue=!0;const H=D(ie,W);W=H.next,H.reason&&(ee=H.reason)}!ue&&F.trim()&&(ee="empty"),W!==i&&r(W),m==null||m(ee),B("")};return s.jsxs("div",{className:Ue("flex flex-col gap-1.5",b),children:[s.jsxs("div",{className:Ue(Pc,"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(F=>s.jsx(Gc,{dir:y,disabled:x,removeLabel:p(F),onRemove:x?void 0:()=>{r(i.filter(U=>U!==F)),m==null||m(null)},children:F},F)),s.jsx(Ke,{...O,ref:R,id:z,value:se,disabled:x,placeholder:i.length===0?C:void 0,"aria-label":k,"aria-invalid":j,"aria-describedby":N,className:"min-h-10 min-w-24 flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0",onChange:F=>{const U=F.target.value;if(/[,،\n\r]/.test(U)){T(U);return}B(U)},onKeyDown:F=>{if(!F.nativeEvent.isComposing){if(F.key==="Enter"||F.key===","||F.key==="،"){F.preventDefault(),T(se);return}F.key==="Backspace"&&se.length===0&&i.length>0&&(F.preventDefault(),r(i.slice(0,-1)),m==null||m(null))}},onPaste:F=>{const U=F.clipboardData.getData("text");/[,،\n\r]/.test(U)&&(F.preventDefault(),T(`${se}${U}`))},onBlur:()=>{se.trim()&&T(se)}})]}),h&&s.jsx("p",{className:"text-xs text-muted tabular-nums",children:h})]})});var Ym=Kb();const zj='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Mj(a){return[...a.querySelectorAll(zj)].filter(i=>!(i.tabIndex<0||i.closest("[aria-hidden='true']")))}function Zv(a,i,r){const o=v.useRef(r);o.current=r,v.useLayoutEffect(()=>{if(!i)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,f=a.current;f&&(!(document.activeElement instanceof Node)||!f.contains(document.activeElement))&&f.focus();const m=h=>{var k;if(h.key==="Escape"){if(h.defaultPrevented)return;const j=a.current;if(j){const N=document.querySelectorAll("[data-overlay]"),O=N.item(N.length-1);if(O&&O!==j)return}h.preventDefault(),h.stopImmediatePropagation(),(k=o.current)==null||k.call(o);return}if(h.key!=="Tab"||!a.current)return;const y=document.activeElement;if(y instanceof Element&&y.closest("[data-overlay='popover']"))return;if(a.current.dataset.overlay==="dialog"&&y instanceof Element){const j=y.closest("[data-overlay]");if(j&&j!==a.current)return}const b=Mj(a.current);if(b.length===0){h.preventDefault(),a.current.focus();return}const x=b[0],w=b[b.length-1],C=y instanceof Node&&a.current.contains(y);h.shiftKey&&(!C||y===x)?(h.preventDefault(),w==null||w.focus()):!h.shiftKey&&(!C||y===w)&&(h.preventDefault(),x==null||x.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,a])}function an({isOpen:a,onClose:i,title:r,children:o,footer:d,maxWidth:f,description:m,className:p}){const{t:h}=He(),y=v.useRef(null),b=v.useId(),x=v.useId();if(Zv(y,a,i),!a)return null;const w={paddingBottom:"max(1rem, env(safe-area-inset-bottom))"};return Ym.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",style:w,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:y,role:"dialog","aria-modal":"true","aria-labelledby":b,"aria-describedby":m?x:void 0,tabIndex:-1,"data-overlay":"dialog",className:Ue("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:b,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(Kn,{size:18}),onClick:i})]}),s.jsxs("div",{className:Ue("min-h-0 overflow-y-auto p-4 md:p-5",!d&&"pb-[max(1rem,env(safe-area-inset-bottom))]"),style:d?void 0:w,children:[m&&s.jsx("p",{id:x,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:w,children:d})]})]}),document.body)}function gi({isOpen:a,onClose:i,onConfirm:r,title:o,description:d,confirmLabel:f,cancelLabel:m,variant:p="danger",loading:h=!1,children:y,maxWidth:b}){return s.jsx(an,{isOpen:a,onClose:i,title:o,description:d,maxWidth:b,footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:i,disabled:h,children:m}),s.jsx(fe,{variant:p==="danger"?"danger":"primary",onClick:r,loading:h,children:f})]}),children:y})}function Jv({summary:a,children:i}){const[r,o]=v.useState(!1),d=v.useId();return s.jsxs(Ye,{padded:!1,className:"min-w-0 self-start overflow-hidden",children:[s.jsxs(fe,{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:a}),s.jsx(rl,{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 Ga({className:a,label:i}){return s.jsxs("span",{role:i?"status":void 0,className:Ue("inline-flex items-center gap-2",i&&"text-muted"),children:[s.jsx("span",{"aria-hidden":!0,className:Ue("size-4 shrink-0 rounded-full border-2 border-brand-blue border-t-transparent animate-spin",a)}),i&&s.jsx("span",{className:"text-xs",children:i})]})}function Cs({text:a}){return s.jsx("div",{className:"flex flex-col items-center justify-center gap-2 py-16",children:s.jsx(Ga,{className:"size-6",label:a})})}function It({className:a}){return s.jsx("div",{"aria-hidden":!0,className:Ue("animate-pulse rounded-lg bg-panel-hover",a)})}function ut({kind:a,icon:i,title:r,text:o,description:d,action:f,className:m}){const{t:p}=He(),h=a==="empty"?p("emptyRecords"):a==="no-results"?p("emptyMatches"):a==="error"?p("loadError"):null;return s.jsxs("div",{role:a==="error"?"alert":void 0,className:Ue("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 Ky="(max-width: 639px)";function Oj(){const[a,i]=v.useState(()=>typeof window<"u"?window.matchMedia(Ky).matches:!1);return v.useEffect(()=>{const r=window.matchMedia(Ky),o=()=>i(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),a}function Lj(a,i,r,o){const m=window.innerWidth,p=window.innerHeight;let h=a.bottom+6;h+i.height>p-8&&a.top-i.height-6>=8&&(h=a.top-i.height-6),h=Math.max(8,Math.min(h,p-8-i.height));const y=r==="center"?a.left+a.width/2-i.width/2:r==="start"?o==="rtl"?a.right-i.width:a.left:o==="rtl"?a.left:a.right-i.width,b=Math.max(8,Math.min(y,m-8-i.width));return{top:h,left:b}}function $v({open:a,defaultOpen:i=!1,onOpenChange:r,trigger:o,children:d,align:f="end",label:m,haspopup:p="dialog",className:h,badge:y}){const{t:b}=He(),[x,w]=v.useState(i),C=a??x,k=v.useCallback(U=>{a===void 0&&w(U),r==null||r(U)},[r,a]),j=Oj(),N=v.useRef(null),O=v.useRef(null),R=v.useId(),[I,z]=v.useState(null),se=v.useRef(k);se.current=k;const B=v.useCallback(()=>{const U=N.current,W=O.current;if(!U||!W)return;const ee=document.documentElement.dir==="rtl"?"rtl":"ltr";z(Lj(U.getBoundingClientRect(),W.getBoundingClientRect(),f,ee))},[f]);v.useLayoutEffect(()=>{if(!C||j)return;B();const U=O.current,W=U?new ResizeObserver(()=>B()):null;return U&&W&&W.observe(U),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{W==null||W.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[C,j,B]),v.useEffect(()=>{if(!C)return;const U=ee=>{var ie,H;const ue=ee.target;ue instanceof Node&&((ie=N.current)!=null&&ie.contains(ue)||(H=O.current)!=null&&H.contains(ue)||se.current(!1))},W=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),se.current(!1))};return document.addEventListener("pointerdown",U,!0),document.addEventListener("keydown",W,!0),()=>{document.removeEventListener("pointerdown",U,!0),document.removeEventListener("keydown",W,!0)}},[C]),Zv(O,C&&j,()=>k(!1));const D=v.isValidElement(o)?o.props:{},T=v.isValidElement(o)?v.cloneElement(o,{onClick:U=>{var W;(W=D.onClick)==null||W.call(D,U),U.defaultPrevented||k(!C)},"aria-expanded":C,"aria-haspopup":p,"aria-controls":R}):o,F=s.jsxs("div",{ref:O,id:R,role:p==="menu"?"presentation":"dialog",...p==="menu"||!m?{}:{"aria-label":m},tabIndex:-1,"data-overlay":"popover",className:Ue("z-[70] border border-line bg-panel-solid text-text-main shadow-2xl outline-none",h,j?"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:j?{animation:"modal-enter 150ms ease-out",paddingBottom:"max(1rem, env(safe-area-inset-bottom))"}:{top:(I==null?void 0:I.top)??0,left:(I==null?void 0:I.left)??0,visibility:I?"visible":"hidden",animation:"modal-enter 150ms ease-out"},children:[j&&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:b("close"),icon:s.jsx(Kn,{size:16}),variant:"ghost",className:"absolute end-0",onClick:()=>k(!1)})]}),d]});return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:N,className:"relative inline-flex",children:[T,y]}),C&&Ym.createPortal(j?s.jsxs("div",{className:"fixed inset-0 z-[70] flex items-end",children:[s.jsx("button",{type:"button",className:"absolute inset-0 cursor-default border-0 bg-black/60 p-0","aria-label":b("close"),onClick:()=>k(!1)}),F]}):F,document.body)]})}function hl({label:a,resetLabel:i,activeCount:r=0,onReset:o,children:d}){const[f,m]=v.useState(!1),p=r>0?`${a} (${r})`:a;return s.jsxs($v,{open:f,onOpenChange:m,align:"end",label:a,haspopup:"dialog",className:"w-[min(20rem,calc(100vw-1rem))] p-3",badge:r>0?s.jsx($e,{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(fk,{size:18}),pressed:r>0}),children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm font-bold text-text-main",children:a}),o&&s.jsx(fe,{variant:"ghost",size:"sm",onClick:o,disabled:r===0,children:i})]}),s.jsx("div",{className:"flex flex-col gap-3",children:d})]})}function Bj({label:a,content:i,children:r,className:o}){const[d,f]=v.useState(!1),[m,p]=v.useState(null),h=v.useRef(null),y=v.useRef(null),b=v.useRef(!1),x=v.useId();return v.useLayoutEffect(()=>{if(!d)return;const w=()=>{var I,z;const C=(I=h.current)==null?void 0:I.getBoundingClientRect(),k=(z=y.current)==null?void 0:z.getBoundingClientRect();if(!C||!k)return;const j=8,N=Math.max(j,Math.min(C.left+C.width/2-k.width/2,window.innerWidth-j-k.width)),O=C.top>=k.height+j+6?C.top-k.height-6:C.bottom+6,R=Math.max(j,Math.min(O,window.innerHeight-j-k.height));p({top:R,left:N})};return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,!0)}},[d]),v.useEffect(()=>{if(!d)return;const w=k=>{var j,N;k.target instanceof Node&&!((j=h.current)!=null&&j.contains(k.target))&&!((N=y.current)!=null&&N.contains(k.target))&&f(!1)},C=k=>{k.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",w),document.addEventListener("keydown",C),()=>{document.removeEventListener("pointerdown",w),document.removeEventListener("keydown",C)}},[d]),s.jsxs(s.Fragment,{children:[s.jsx(Oe,{ref:h,label:a,title:"",icon:r,variant:"ghost",className:o,"aria-describedby":d?x:void 0,onPointerDown:w=>{b.current=w.pointerType==="touch"},onPointerEnter:w=>{w.pointerType==="mouse"&&f(!0)},onPointerLeave:w=>{w.pointerType==="mouse"&&document.activeElement!==h.current&&f(!1)},onFocus:()=>{b.current||f(!0)},onBlur:()=>{b.current=!1,f(!1)},onClick:()=>{b.current&&f(w=>!w)}}),d&&Ym.createPortal(s.jsx("div",{ref:y,id:x,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 Qm=v.createContext(()=>{});function Xm({trigger:a,label:i,align:r="end",children:o}){const[d,f]=v.useState(!1);return s.jsx(Qm.Provider,{value:()=>f(!1),children:s.jsx($v,{open:d,onOpenChange:f,trigger:a,label:i,align:r,haspopup:"menu",className:"min-w-52 p-1",children:s.jsx(Uj,{label:i,children:o})})})}function Uj({label:a,children:i}){const r=v.useRef(null),o=v.useContext(Qm);v.useEffect(()=>{var f,m;(m=(f=r.current)==null?void 0:f.querySelector("[role='menuitem']:not([disabled])"))==null||m.focus()},[]);const d=f=>{var y,b,x;const m=[...((y=r.current)==null?void 0:y.querySelectorAll("[role='menuitem']:not([disabled])"))??[]];if(m.length===0)return;const p=m.indexOf(document.activeElement),h=w=>{var C;f.preventDefault(),(C=m[(w+m.length)%m.length])==null||C.focus()};f.key==="ArrowDown"?h(p+1):f.key==="ArrowUp"?h(p<=0?m.length-1:p-1):f.key==="Home"?(f.preventDefault(),(b=m[0])==null||b.focus()):f.key==="End"?(f.preventDefault(),(x=m[m.length-1])==null||x.focus()):f.key==="Escape"&&(f.preventDefault(),o())};return s.jsx("div",{ref:r,role:"menu","aria-label":a,"aria-orientation":"vertical",onKeyDown:d,className:"flex flex-col gap-0.5",children:i})}function st({icon:a,danger:i=!1,checked:r=!1,onSelect:o,className:d,type:f="button",children:m,onClick:p,...h}){const y=v.useContext(Qm);return s.jsxs("button",{type:f,role:"menuitem",className:Ue("flex min-h-10 w-full items-center gap-2 rounded-lg px-3 py-2 text-start text-sm font-medium","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50","disabled:cursor-not-allowed disabled:opacity-40",i?"text-danger hover:bg-danger/10":"text-text-main hover:bg-panel-hover",d),onClick:b=>{p==null||p(b),!b.defaultPrevented&&(o==null||o(),f!=="submit"&&y())},...h,children:[a&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:a}),s.jsx("span",{className:"min-w-0 flex-1",children:m}),r&&s.jsx(mi,{size:16,className:"shrink-0 text-brand-cyan"})]})}function Ar(){return s.jsx("hr",{className:"my-1 border-0 border-t border-line"})}function Hj({children:a}){return s.jsx("div",{className:"px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-faint",children:a})}function aa({label:a,align:i="end",id:r,children:o}){return s.jsx(Xm,{label:a,align:i,trigger:s.jsx(Oe,{id:r,label:a,icon:s.jsx(ck,{size:18})}),children:o})}function vi({page:a,pageCount:i,total:r,onPageChange:o,label:d,className:f}){const{t:m,direction:p}=He(),h=Math.max(1,i),y=Math.min(Math.max(1,a),h),b=p==="rtl"?s.jsx(vm,{size:18}):s.jsx(_c,{size:18}),x=p==="rtl"?s.jsx(_c,{size:18}):s.jsx(vm,{size:18});return s.jsxs("nav",{"aria-label":d??m("pagination"),className:Ue("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:b,disabled:y<=1,onClick:()=>o(y-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(y)).replace("{count}",String(h))}),s.jsx(Oe,{label:m("nextPage"),icon:x,disabled:y>=h,onClick:()=>o(y+1)})]})]})}function Vc(a,i=20,r){const o=Math.max(1,Math.floor(i)||20),d=a.length,f=Math.max(1,Math.ceil(d/o)),[m,p]=v.useState({page:1,resetKey:r}),h=Object.is(m.resetKey,r)?Math.min(m.page,f):1;v.useEffect(()=>{(!Object.is(m.resetKey,r)||m.page!==h)&&p({page:h,resetKey:r})},[h,r,m]);const y=b=>{p({page:Math.min(Math.max(1,Math.floor(b)||1),f),resetKey:r})};return{page:h,pageCount:f,pageItems:a.slice((h-1)*o,h*o),setPage:y,total:d}}const nl=v.forwardRef(function({className:i,dir:r="ltr",spellCheck:o=!1,autoCapitalize:d="off",autoCorrect:f="off",disabled:m,...p},h){const{t:y}=He(),[b,x]=v.useState(!1),w=v.useRef(null),C=v.useRef(null);return v.useLayoutEffect(()=>{const k=C.current,j=w.current;!k||!j||(j.focus({preventScroll:!0}),j.setSelectionRange(k.start,k.end),C.current=null)}),s.jsxs("span",{dir:r,className:"grid w-full min-w-0 items-center",children:[s.jsx(Ke,{...p,ref:k=>{w.current=k,typeof h=="function"?h(k):h&&(h.current=k)},type:b?"text":"password",dir:r,spellCheck:o,autoCapitalize:d,autoCorrect:f,disabled:m,className:Ue("col-start-1 row-start-1 pe-12 text-start",i)}),s.jsx(Oe,{label:y(b?"hideSecret":"showSecret"),icon:b?s.jsx(y0,{size:18}):s.jsx(bi,{size:18}),pressed:b,variant:"ghost",disabled:m,className:"col-start-1 row-start-1 me-0.5 justify-self-end",onMouseDown:k=>k.preventDefault(),onClick:()=>{const k=w.current;k&&(C.current={start:k.selectionStart??k.value.length,end:k.selectionEnd??k.value.length}),x(j=>!j)}})]})}),fc=new Set;let br=null;function qj(a){return fc.add(a),br===null&&(br=window.setInterval(()=>{for(const i of fc)i()},3e4)),()=>{fc.delete(a),fc.size===0&&br!==null&&(window.clearInterval(br),br=null)}}function Wv(a){return a==="ar"?"ar":"en"}function Pj(a){const i=a instanceof Date?a.getTime():typeof a=="number"?a:Date.parse(a);return Number.isFinite(i)?i:null}const Of=[{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 Gj(a,i,r){const o=a-i,d=Math.abs(o),f=new Intl.RelativeTimeFormat(Wv(r),{numeric:"auto"}),m=Of.find(h=>d>=h.ms)??Of[Of.length-1],p=Math.round(o/m.ms);return f.format(p,m.unit)}function Rc({value:a,className:i}){const{language:r}=He(),[o,d]=v.useState(()=>Date.now());v.useEffect(()=>qj(()=>d(Date.now())),[]);const f=Pj(a);if(f===null)return null;const m=Wv(r),p=new Intl.DateTimeFormat(m,{dateStyle:"medium",timeStyle:"short"}).format(f);return s.jsx("time",{dateTime:new Date(f).toISOString(),title:p,className:Ue("whitespace-nowrap",i),children:Gj(f,o,r)})}const Vj=1500;function e1(a){return a instanceof Error&&a.message?a.message:typeof a=="string"&&a?a:""}function zc(a,i){if(Object.is(a,i))return!0;if(typeof a!="object"||typeof i!="object"||a===null||i===null)return!1;const r=a,o=i,d=Object.keys(r);return d.length!==Object.keys(o).length?!1:d.every(f=>Object.is(r[f],o[f]))}function t1(a,i){v.useEffect(()=>{if(a!=="saved")return;const r=window.setTimeout(()=>{i(o=>o==="saved"?"idle":o)},Vj);return()=>window.clearTimeout(r)},[a,i])}function Un(a){const[i,r]=v.useState(a),[o,d]=v.useState("idle"),[f,m]=v.useState(null),p=v.useRef(a);v.useEffect(()=>{o!=="saving"&&(zc(a,p.current)||(p.current=a,r(a)))},[a,o]),t1(o,d);const h=!zc(i,a),y=v.useCallback(async x=>{if(!(!h||o==="saving")){d("saving"),m(null);try{await x(i),d("saved")}catch(w){d("idle"),m(e1(w)||null)}}},[h,o,i]),b=v.useCallback(()=>{r(a),m(null),d("idle")},[a]);return{value:i,setValue:r,dirty:h,status:o,error:f,save:y,revert:b}}function Mc(a){const[i,r]=v.useState(a),[o,d]=v.useState("idle"),[f,m]=v.useState(null),p=v.useRef(a);v.useEffect(()=>{o!=="saving"&&(zc(a,p.current)||(p.current=a,r(a)))},[a,o]),t1(o,d);const h=!zc(i,a),y=v.useCallback((w,C)=>{r(k=>({...k,[w]:C}))},[]),b=v.useCallback(async w=>{if(!(!h||o==="saving")){d("saving"),m(null);try{await w(i),d("saved")}catch(C){d("idle"),m(e1(C)||null)}}},[h,o,i]),x=v.useCallback(()=>{r(a),m(null),d("idle")},[a]);return{draft:i,setDraft:r,setField:y,dirty:h,status:o,error:f,save:b,revert:x}}function Hn({label:a,description:i,error:r,htmlFor:o,className:d,dirty:f,saving:m,justSaved:p,onSave:h,onRevert:y,saveLabel:b,savedLabel:x,actions:w,children:C}){const k=N=>{var R;const O=(R=N.target)==null?void 0:R.tagName;N.key==="Enter"&&O==="INPUT"&&!N.nativeEvent.isComposing&&(N.preventDefault(),f&&!m&&h()),N.key==="Escape"&&(N.preventDefault(),y())},j=v.isValidElement(C)?v.cloneElement(C,{onKeyDown:N=>{var O,R;(R=(O=C.props).onKeyDown)==null||R.call(O,N),k(N)}}):C;return s.jsx(Fe,{label:a,description:i,error:r,htmlFor:o,className:d,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:j}),w,s.jsx(Oe,{type:"button",label:p?x??b:b,icon:p?s.jsx(mi,{size:16}):s.jsx(hi,{size:16}),loading:m,disabled:!f&&!p||m,onClick:()=>{f&&!m&&h()},className:p?"text-ok":void 0})]})})}function Oc({dirty:a,saving:i,justSaved:r,error:o,onDiscard:d,saveLabel:f,discardLabel:m,unsavedLabel:p,savedLabel:h,className:y}){return s.jsxs("div",{className:Ue("flex flex-wrap items-center gap-2",y),children:[s.jsx("div",{className:"min-w-0 flex-1",children:o?s.jsx("p",{role:"alert",className:"text-xs text-danger",children:o}):a?s.jsx("p",{className:"text-xs text-warn",children:p}):r&&h?s.jsx("p",{className:"text-xs text-ok",children:h}):null}),s.jsx(fe,{type:"button",variant:"ghost",disabled:!a||i,onClick:d,children:m}),s.jsx(fe,{type:"submit",variant:"primary",icon:s.jsx(hi,{size:16}),disabled:!a,loading:i,children:f})]})}function Lr({label:a,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(Xm,{label:a,trigger:s.jsx(Oe,{label:d?`${a}: ${d}`:a,icon:s.jsx(nk,{size:18})}),children:r.map(m=>s.jsx(st,{checked:m.value===i,onSelect:()=>o(m.value),children:m.label},m.value))})}function n1(a){var f,m;if(!(a.target instanceof HTMLButtonElement))return;const i=Array.from(a.currentTarget.querySelectorAll('[role="tab"]')),r=i.indexOf(a.target);if(r<0)return;const o=getComputedStyle(a.currentTarget).direction==="rtl";let d;switch(a.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}a.preventDefault(),i[d].focus({preventScroll:!0}),(m=(f=i[d]).scrollIntoView)==null||m.call(f,{block:"nearest",inline:"nearest"}),i[d].click()}function a1(a){const i=v.useRef(null);return v.useEffect(()=>{var r,o;(o=(r=i.current)==null?void 0:r.scrollIntoView)==null||o.call(r,{block:"nearest",inline:"nearest"})},[a]),i}function js({value:a,onChange:i,options:r,"aria-label":o,className:d}){var p;const f=a1(a),m=r.some(h=>h.value===a)?a:(p=r[0])==null?void 0:p.value;return s.jsx("div",{role:"tablist","aria-label":o,onKeyDown:n1,className:Ue("inline-flex max-w-full flex-nowrap overflow-x-auto rounded-xl border border-line bg-panel-raised p-1",d),children:r.map(h=>{const y=h.value===a;return s.jsxs("button",{ref:y?f:void 0,type:"button",role:"tab","aria-selected":y,tabIndex:h.value===m?0:-1,onClick:()=>i(h.value),className:Ue("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",y?"bg-brand-blue text-white":"text-muted hover:text-text-main"),children:[h.icon,h.label]},h.value)})})}function Ic({value:a,onChange:i,options:r,"aria-label":o,className:d}){var p;const f=a1(a),m=r.some(h=>h.value===a)?a:(p=r[0])==null?void 0:p.value;return s.jsx("div",{role:"tablist","aria-label":o,onKeyDown:n1,className:Ue("flex items-center gap-1 sm:gap-2",d),children:r.map(h=>{const y=h.value===a,b=!!h.icon&&!y;return s.jsxs("button",{ref:y?f:void 0,type:"button",role:"tab","aria-selected":y,tabIndex:h.value===m?0:-1,title:b&&typeof h.label=="string"?h.label:void 0,onClick:()=>i(h.value),className:Ue("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",b?"px-2.5 sm:px-4":"px-4",y?"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:Ue(b&&"sr-only sm:not-sr-only"),children:h.label})]},h.value)})})}const pl=v.forwardRef(function({className:i,...r},o){return s.jsx("div",{ref:o,className:Ue("flex flex-wrap items-center gap-2",i),...r})}),Ij={1:"line-clamp-1",2:"line-clamp-2",3:"line-clamp-3"},An=v.forwardRef(function({as:i="span",lines:r,title:o,className:d,children:f,dir:m,...p},h){const y={...p,dir:m??"auto",title:o??(r!==void 0&&typeof f=="string"?f:void 0),className:Ue("min-w-0 whitespace-normal break-words",r!==void 0&&Ij[r],d),children:f};return i==="p"?s.jsx("p",{ref:h,...y}):i==="bdi"?s.jsx("bdi",{ref:h,...y}):i==="strong"?s.jsx("strong",{ref:h,...y}):i==="em"?s.jsx("em",{ref:h,...y}):s.jsx("span",{ref:h,...y})}),s1=v.createContext(null),Fj=({children:a})=>{const{t:i}=He(),[r,o]=v.useState([]),d=v.useCallback(m=>{o(p=>p.filter(h=>h.id!==m))},[]),f=v.useCallback((m,p="info",h=4e3)=>{const y=Math.random().toString(36).slice(2,9);o(b=>[...b,{id:y,message:m,type:p,duration:h}]),setTimeout(()=>d(y),h)},[d]);return s.jsxs(s1.Provider,{value:{toast:f},children:[a,s.jsx("div",{className:"fixed bottom-5 end-5 z-50 flex flex-col gap-2.5 max-w-sm w-full px-4 pointer-events-none","aria-live":"polite",children:r.map(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(ws,{size:18,className:"shrink-0 text-ok"}),m.type==="error"&&s.jsx(rk,{size:18,className:"shrink-0 text-danger"}),m.type==="warning"&&s.jsx(dl,{size:18,className:"shrink-0 text-warn"}),m.type==="info"&&s.jsx(pk,{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(Kn,{size:16}),onClick:()=>d(m.id)})]},m.id))})]})},Et=()=>{const a=v.useContext(s1);if(!a)throw new Error("useToast must be used within a ToastProvider");return a};let Yy=!1;const Kj=()=>{const{t:a}=He(),{toast:i}=Et(),[r,o]=v.useState(!1),[d,f]=v.useState(!1),[m,p]=v.useState(!1);if(v.useEffect(()=>{typeof window>"u"||window.LevixHost||Yy||(Yy=!0,Y.getCrashReports().then(b=>{b!=null&&b.reports&&b.reports.length>0&&o(!0)}).catch(()=>{}))},[]),!r)return null;const h=()=>{o(!1),window.location.hash="settings/diagnostics"},y=async()=>{p(!0);try{await Y.deleteAllCrashReports(),i(a("allReportsDeleted"),"success"),o(!1)}catch(b){i((b==null?void 0:b.message)||"Delete failed","error")}finally{p(!1),f(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-4",children:s.jsx(Ye,{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(dl,{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:a("crashBannerTitle")}),s.jsx("p",{className:"text-xs leading-relaxed text-muted",children:a("crashBannerDesc")})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 self-end sm:self-auto shrink-0",children:[s.jsx(fe,{variant:"primary",size:"sm",onClick:h,icon:s.jsx(Dv,{size:14}),children:a("crashBannerReview")}),s.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:a("crashBannerNotNow")}),s.jsx(fe,{variant:"danger",size:"sm",onClick:()=>f(!0),icon:s.jsx(In,{size:14}),children:a("crashBannerDelete")})]})]})})}),s.jsx(gi,{isOpen:d,onClose:()=>f(!1),onConfirm:y,loading:m,title:a("confirmDeleteAllReports"),description:a("confirmDeleteAllDesc"),confirmLabel:a("deleteAllReports"),cancelLabel:a("cancel"),variant:"danger"})]})};function Nm(a,i){const r=a||(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 y=["nativeApp","android","device","abi","webview","connectivity","memory","storage"];for(const b of y)typeof h[b]=="string"&&(f[b]=h[b])}}}catch{}return f}const Yj=3,Qj=20;let Qy=0;const Xy=new Set;let Cm=!1;const vc=[];function Em(){try{const a=window.location.hash.replace(/^#\/?/,"").split("/")[0];return(a?a.trim():"overview").slice(0,40)||"overview"}catch{return"overview"}}function Zy(a){try{const i=(a||"overview").slice(0,60);vc.push({at:new Date().toISOString(),kind:"nav",name:i}),vc.length>Qj&&vc.shift()}catch{}}if(typeof window<"u")try{window.addEventListener("beforeunload",()=>{Cm=!0}),window.addEventListener("pagehide",()=>{Cm=!0}),Zy(Em()),window.addEventListener("hashchange",()=>{Zy(Em())})}catch{}function Am(a,i,r){try{if(Cm||Qy>=Yj)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(`
|
|
525
|
-
`).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(`
|
|
526
|
-
`).map(y=>y.trim().slice(0,200)).filter(Boolean).slice(0,20))}o=o.slice(0,120),d=d.slice(0,300);const m=`${o}|${d}`;if(Xy.has(m))return;Xy.add(m),Qy++;const p={category:a,error:{type:o,message:d,stack:f},screen:Em(),breadcrumbs:[...vc],device:Nm()};Y.submitCrashReport(p).catch(()=>{})}catch{}}function Xj(){if(typeof window>"u")return()=>{};const a=r=>{try{Am("web-error",r.error||r.message)}catch{}},i=r=>{try{Am("web-rejection",r.reason)}catch{}};return window.addEventListener("error",a),window.addEventListener("unhandledrejection",i),()=>{window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",i)}}class l1 extends v.Component{constructor(i){super(i),this.state={hasError:!1,error:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,r){try{Am("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(Ye,{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(dl,{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(fe,{variant:"primary",onClick:()=>window.location.reload(),icon:s.jsx(Va,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryReload")}),s.jsx(fe,{variant:"secondary",onClick:()=>{window.location.hash="settings/diagnostics",this.setState({hasError:!1,error:null})},icon:s.jsx(Dv,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryGoDiagnostics")})]})]})})}return this.props.children}}jy(l1,"contextType",Im);const Zj=({onToggleMobileMenu:a,title:i,status:r})=>{const{language:o,setLanguage:d,theme:f,setTheme:m,t:p}=He(),h=()=>{m(f==="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:p("openNavigation"),icon:s.jsx(bk,{size:20}),onClick:a}),s.jsx("h1",{className:"truncate text-lg font-bold tracking-tight text-text-main md:text-xl",title:i,children:i})]}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[s.jsxs(Xm,{label:p("chooseLanguage"),trigger:s.jsx(Oe,{id:"btn-header-lang",label:p("chooseLanguage"),icon:s.jsx(Tc,{size:18,className:"text-brand-cyan"})}),children:[s.jsx(Hj,{children:p("chooseLanguage")}),s.jsx(st,{checked:o==="ar",onSelect:()=>d("ar"),children:"العربية"}),s.jsx(st,{checked:o==="en",onSelect:()=>d("en"),children:"English"})]}),s.jsx(Oe,{id:"btn-header-theme",label:p(f==="dark"?"lightMode":"darkMode"),icon:f==="dark"?s.jsx(Ak,{size:18,className:"text-brand-cyan"}):s.jsx(wk,{size:18,className:"text-brand-cyan"}),onClick:h})]})]})},Jj=({currentView:a,onSelectView:i,isOpenMobile:r,onCloseMobile:o})=>{var h;const{t:d}=He(),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:gk},{id:"connection",label:d("connection"),icon:Rr},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:ul},{id:"ai",label:d("ai"),icon:qm},{id:"groups",label:d("groups"),icon:ll},{id:"autodelete",label:d("autoDelete"),icon:yc},{id:"schedules",label:d("schedules"),icon:bm},{id:"stickers",label:d("stickers"),icon:Vm},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:Ek},{id:"logs",label:d("logs"),icon:Mr}];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:Ue("fixed start-0 top-0 bottom-0 z-50 flex w-72 flex-col border-e border-line bg-panel transition-transform duration-200 ease-out md:static md:z-auto md:w-64",r?"translate-x-0":"max-md:-translate-x-full rtl:max-md:translate-x-full"),"aria-label":"Main Navigation",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-line p-4",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-brand-blue via-brand-blue to-brand-cyan text-white shadow-md shadow-brand-blue/20",children:s.jsx(Mk,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-base font-extrabold leading-tight tracking-tight text-text-main",children: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(Kn,{size:18}),onClick:o})]}),s.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-3",children:p.map(y=>{if(y.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:y.labelCategory},`cat-${y.labelCategory}`);if(!y.icon||!y.id)return null;const b=y.icon,x=a===y.id;return s.jsx(fe,{variant:x?"primary":"ghost",className:"w-full justify-start",icon:s.jsx(b,{size:20}),onClick:()=>{i(y.id),o()},children:s.jsx("span",{className:"truncate",children:y.label})},y.id)})}),s.jsxs("div",{className:"flex flex-col gap-1 border-t border-line p-3",children:[f&&s.jsx(fe,{variant:"ghost",className:"w-full justify-start",icon:s.jsx(tk,{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(fe,{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(Gm,{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}),")"]})]})]})]})},wa=Object.create(null);wa.open="0";wa.close="1";wa.ping="2";wa.pong="3";wa.message="4";wa.upgrade="5";wa.noop="6";const Sc=Object.create(null);Object.keys(wa).forEach(a=>{Sc[wa[a]]=a});const _m={type:"error",data:"parser error"},i1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",r1=typeof ArrayBuffer=="function",o1=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,Zm=({type:a,data:i},r,o)=>i1&&i instanceof Blob?r?o(i):Jy(i,o):r1&&(i instanceof ArrayBuffer||o1(i))?r?o(i):Jy(new Blob([i]),o):o(wa[a]+(i||"")),Jy=(a,i)=>{const r=new FileReader;return r.onload=function(){const o=r.result.split(",")[1];i("b"+(o||""))},r.readAsDataURL(a)};function $y(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let Lf;function $j(a,i){if(i1&&a.data instanceof Blob)return a.data.arrayBuffer().then($y).then(i);if(r1&&(a.data instanceof ArrayBuffer||o1(a.data)))return i($y(a.data));Zm(a,!1,r=>{Lf||(Lf=new TextEncoder),i(Lf.encode(r))})}const Wy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<Wy.length;a++)Cr[Wy.charCodeAt(a)]=a;const Wj=a=>{let i=a.length*.75,r=a.length,o,d=0,f,m,p,h;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const y=new ArrayBuffer(i),b=new Uint8Array(y);for(o=0;o<r;o+=4)f=Cr[a.charCodeAt(o)],m=Cr[a.charCodeAt(o+1)],p=Cr[a.charCodeAt(o+2)],h=Cr[a.charCodeAt(o+3)],b[d++]=f<<2|m>>4,b[d++]=(m&15)<<4|p>>2,b[d++]=(p&3)<<6|h&63;return y},eN=typeof ArrayBuffer=="function",Jm=(a,i)=>{if(typeof a!="string")return{type:"message",data:c1(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:tN(a.substring(1),i)}:Sc[r]?a.length>1?{type:Sc[r],data:a.substring(1)}:{type:Sc[r]}:_m},tN=(a,i)=>{if(eN){const r=Wj(a);return c1(r,i)}else return{base64:!0,data:a}},c1=(a,i)=>{switch(i){case"blob":return a instanceof Blob?a:new Blob([a]);case"arraybuffer":default:return a instanceof ArrayBuffer?a:a.buffer}},u1="",nN=(a,i)=>{const r=a.length,o=new Array(r);let d=0;a.forEach((f,m)=>{Zm(f,!1,p=>{o[m]=p,++d===r&&i(o.join(u1))})})},aN=(a,i)=>{const r=a.split(u1),o=[];for(let d=0;d<r.length;d++){const f=Jm(r[d],i);if(o.push(f),f.type==="error")break}return o};function sN(){return new TransformStream({transform(a,i){$j(a,r=>{const o=r.length;let d;if(o<126)d=new Uint8Array(1),new DataView(d.buffer).setUint8(0,o);else if(o<65536){d=new Uint8Array(3);const f=new DataView(d.buffer);f.setUint8(0,126),f.setUint16(1,o)}else{d=new Uint8Array(9);const f=new DataView(d.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(o))}a.data&&typeof a.data!="string"&&(d[0]|=128),i.enqueue(d),i.enqueue(r)})}})}let Bf;function mc(a){return a.reduce((i,r)=>i+r.length,0)}function hc(a,i){if(a[0].length===i)return a.shift();const r=new Uint8Array(i);let o=0;for(let d=0;d<i;d++)r[d]=a[0][o++],o===a[0].length&&(a.shift(),o=0);return a.length&&o<a[0].length&&(a[0]=a[0].slice(o)),r}function lN(a,i){Bf||(Bf=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(mc(r)<1)break;const h=hc(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(mc(r)<2)break;const h=hc(r,2);d=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),o=3}else if(o===2){if(mc(r)<8)break;const h=hc(r,8),y=new DataView(h.buffer,h.byteOffset,h.length),b=y.getUint32(0);if(b>Math.pow(2,21)-1){p.enqueue(_m);break}d=b*Math.pow(2,32)+y.getUint32(4),o=3}else{if(mc(r)<d)break;const h=hc(r,d);p.enqueue(Jm(f?h:Bf.decode(h),i)),o=0}if(d===0||d>a){p.enqueue(_m);break}}}})}const d1=4;function Ut(a){if(a)return iN(a)}function iN(a){for(var i in Ut.prototype)a[i]=Ut.prototype[i];return a}Ut.prototype.on=Ut.prototype.addEventListener=function(a,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(i),this};Ut.prototype.once=function(a,i){function r(){this.off(a,r),i.apply(this,arguments)}return r.fn=i,this.on(a,r),this};Ut.prototype.off=Ut.prototype.removeListener=Ut.prototype.removeAllListeners=Ut.prototype.removeEventListener=function(a,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+a];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var o,d=0;d<r.length;d++)if(o=r[d],o===i||o.fn===i){r.splice(d,1);break}return r.length===0&&delete this._callbacks["$"+a],this};Ut.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+a],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(r){r=r.slice(0);for(var o=0,d=r.length;o<d;++o)r[o].apply(this,i)}return this};Ut.prototype.emitReserved=Ut.prototype.emit;Ut.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};Ut.prototype.hasListeners=function(a){return!!this.listeners(a).length};const Fc=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),Pn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),rN="arraybuffer";function f1(a,...i){return i.reduce((r,o)=>(a.hasOwnProperty(o)&&(r[o]=a[o]),r),{})}const oN=Pn.setTimeout,cN=Pn.clearTimeout;function Kc(a,i){i.useNativeTimers?(a.setTimeoutFn=oN.bind(Pn),a.clearTimeoutFn=cN.bind(Pn)):(a.setTimeoutFn=Pn.setTimeout.bind(Pn),a.clearTimeoutFn=Pn.clearTimeout.bind(Pn))}const uN=1.33;function dN(a){return typeof a=="string"?fN(a):Math.ceil((a.byteLength||a.size)*uN)}function fN(a){let i=0,r=0;for(let o=0,d=a.length;o<d;o++)i=a.charCodeAt(o),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(o++,r+=4);return r}function m1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function mN(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function hN(a){let i={},r=a.split("&");for(let o=0,d=r.length;o<d;o++){let f=r[o].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class pN extends Error{constructor(i,r,o){super(i),this.description=r,this.context=o,this.type="TransportError"}}class $m extends Ut{constructor(i){super(),this.writable=!1,Kc(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 pN(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=Jm(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=mN(i);return r.length?"?"+r:""}}class gN extends $m{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)};aN(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,nN(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]=m1()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let h1=!1;try{h1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xN=h1;function yN(){}class bN extends gN{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 Sa extends Ut{constructor(i,r,o){super(),this.createRequest=i,Kc(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=f1(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=Sa.requestsCount++,Sa.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=yN,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Sa.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()}}Sa.requestsCount=0;Sa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",eb);else if(typeof addEventListener=="function"){const a="onpagehide"in Pn?"pagehide":"unload";addEventListener(a,eb,!1)}}function eb(){for(let a in Sa.requests)Sa.requests.hasOwnProperty(a)&&Sa.requests[a].abort()}const vN=(function(){const a=p1({xdomain:!1});return a&&a.responseType!==null})();class SN extends bN{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=vN&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Sa(p1,this.uri(),i)}}function p1(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||xN))return new XMLHttpRequest}catch{}if(!i)try{return new Pn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const g1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class wN extends $m{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,o=g1?{}:f1(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;Zm(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Fc(()=>{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]=m1()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Uf=Pn.WebSocket||Pn.MozWebSocket;class kN extends wN{createSocket(i,r,o){return g1?new Uf(i,r,o):r?new Uf(i,r):new Uf(i)}doWrite(i,r){this.ws.send(r)}}class jN extends $m{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=lN(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(r).getReader(),d=sN();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&&Fc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const NN={websocket:kN,webtransport:jN,polling:SN},CN=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,EN=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tm(a){if(a.length>8e3)throw"URI too long";const i=a,r=a.indexOf("["),o=a.indexOf("]");r!=-1&&o!=-1&&(a=a.substring(0,r)+a.substring(r,o).replace(/:/g,";")+a.substring(o,a.length));let d=CN.exec(a||""),f={},m=14;for(;m--;)f[EN[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=AN(f,f.path),f.queryKey=_N(f,f.query),f}function AN(a,i){const r=/\/{2,9}/g,o=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function _N(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(r[d]=f)}),r}const Dm=typeof addEventListener=="function"&&typeof removeEventListener=="function",wc=[];Dm&&addEventListener("offline",()=>{wc.forEach(a=>a())},!1);class Ns extends Ut{constructor(i,r){if(super(),this.binaryType=rN,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=Tm(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=Tm(r.host).host);Kc(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=hN(this.opts.query)),Dm&&(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"})},wc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=d1,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&&Ns.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",Ns.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+=dN(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,Fc(()=>{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(Ns.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(),Dm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=wc.indexOf(this._offlineEventListener);o!==-1&&wc.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}Ns.protocol=d1;class TN extends Ns{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;Ns.priorWebsocketSuccess=!1;const d=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",x=>{if(!o)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Ns.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(b(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function f(){o||(o=!0,b(),r.close(),r=null)}const m=x=>{const w=new Error("probe error: "+x);w.transport=r.name,f(),this.emitReserved("upgradeError",w)};function p(){m("transport closed")}function h(){m("socket closed")}function y(x){r&&x.name!==r.name&&f()}const b=()=>{r.removeListener("open",d),r.removeListener("error",m),r.removeListener("close",p),this.off("close",h),this.off("upgrading",y)};r.once("open",d),r.once("error",m),r.once("close",p),this.once("close",h),this.once("upgrading",y),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 DN=class extends TN{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=>NN[f]).filter(f=>!!f)),super(o?d:i,d)}};function RN(a,i="",r){let o=a;r=r||typeof location<"u"&&location,a==null&&(a=r.protocol+"//"+r.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=r.protocol+a:a=r.host+a),/^(https?|wss?):\/\//.test(a)||(typeof r<"u"?a=r.protocol+"//"+a:a="https://"+a),o=Tm(a)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const f=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+f+":"+o.port+i,o.href=o.protocol+"://"+f+(r&&r.port===o.port?"":":"+o.port),o}const zN=typeof ArrayBuffer=="function",MN=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,x1=Object.prototype.toString,ON=typeof Blob=="function"||typeof Blob<"u"&&x1.call(Blob)==="[object BlobConstructor]",LN=typeof File=="function"||typeof File<"u"&&x1.call(File)==="[object FileConstructor]";function Wm(a){return zN&&(a instanceof ArrayBuffer||MN(a))||ON&&a instanceof Blob||LN&&a instanceof File}function kc(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,o=a.length;r<o;r++)if(kc(a[r]))return!0;return!1}if(Wm(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return kc(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&kc(a[r]))return!0;return!1}function BN(a){const i=[],r=a.data,o=a;return o.data=jc(r,i),o.attachments=i.length,{packet:o,buffers:i}}function jc(a,i,r){if(!a)return a;if(Wm(a)){const o={_placeholder:!0,num:i.length};return i.push(a),o}else if(Array.isArray(a)){const o=new Array(a.length);for(let d=0;d<a.length;d++)o[d]=jc(a[d],i);return o}else if(typeof a=="object"&&!(a instanceof Date)){if(a.toJSON&&typeof a.toJSON=="function"&&!r)return jc(a.toJSON(),i,!0);const o={};for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=jc(a[d],i));return o}return a}function UN(a,i){return a.data=Rm(a.data,i),delete a.attachments,a}function Rm(a,i){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<i.length)return i[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let r=0;r<a.length;r++)a[r]=Rm(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=Rm(a[r],i));return a}const HN=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var nt;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(nt||(nt={}));class qN{constructor(i){this.replacer=i}encode(i){return(i.type===nt.EVENT||i.type===nt.ACK)&&kc(i)?this.encodeAsBinary({type:i.type===nt.EVENT?nt.BINARY_EVENT:nt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===nt.BINARY_EVENT||i.type===nt.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=BN(i),o=this.encodeAsString(r.packet),d=r.buffers;return d.unshift(o),d}}class eh extends Ut{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===nt.BINARY_EVENT;o||r.type===nt.BINARY_ACK?(r.type=o?nt.EVENT:nt.ACK,this.reconstructor=new PN(r)):super.emitReserved("decoded",r)}else if(Wm(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(nt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===nt.BINARY_EVENT||o.type===nt.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(!GN(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(eh.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 nt.CONNECT:return tb(r);case nt.DISCONNECT:return r===void 0;case nt.CONNECT_ERROR:return typeof r=="string"||tb(r);case nt.EVENT:case nt.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&HN.indexOf(r[0])===-1);case nt.ACK:case nt.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class PN{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=UN(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const GN=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a};function tb(a){return Object.prototype.toString.call(a)==="[object Object]"}const VN=Object.freeze(Object.defineProperty({__proto__:null,Decoder:eh,Encoder:qN,get PacketType(){return nt}},Symbol.toStringTag,{value:"Module"}));function na(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const IN=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class y1 extends Ut{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(IN.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:nt.EVENT,data:r};if(m.options={},m.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const b=this.ids++,x=r.pop();this._registerAckCallback(b,x),m.id=b}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:nt.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 nt.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 nt.EVENT:case nt.BINARY_EVENT:this.onevent(i);break;case nt.ACK:case nt.BINARY_ACK:this.onack(i);break;case nt.DISCONNECT:this.ondisconnect();break;case nt.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:nt.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:nt.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 Si(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}Si.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*a);a=(Math.floor(i*10)&1)==0?a-r:a+r}return Math.min(a,this.max)|0};Si.prototype.reset=function(){this.attempts=0};Si.prototype.setMin=function(a){this.ms=a};Si.prototype.setMax=function(a){this.max=a};Si.prototype.setJitter=function(a){this.jitter=a};class zm extends Ut{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,Kc(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 Si({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||VN;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 DN(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){Fc(()=>{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 y1(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 vr={};function Nc(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=RN(a,i.path||"/socket.io"),o=r.source,d=r.id,f=r.path,m=vr[d]&&f in vr[d].nsps,p=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let h;return p?h=new zm(o,i):(vr[d]||(vr[d]=new zm(o,i)),h=vr[d]),r.query&&!i.query&&(i.query=r.queryKey),h.socket(r.path,i)}Object.assign(Nc,{Manager:zm,Socket:y1,io:Nc,connect:Nc});let Hf=null;function nb(){return Hf||(Hf=Nc(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),Hf}function FN(a){const[i,r]=v.useState(!1),[o,d]=v.useState(null);return v.useEffect(()=>{const f=nb(),m=()=>r(!0),p=()=>r(!1),h=N=>{d(O=>({...O,...N,state:(N==null?void 0:N.state)||(O==null?void 0:O.state)||"idle"})),a==null||a("session",N)},y=N=>{d(O=>({...O,state:(N==null?void 0:N.state)||(O==null?void 0:O.state)||"idle",status:(N==null?void 0:N.status)||(O==null?void 0:O.status)})),a==null||a("status_update",N)},b=N=>{d(O=>({...O,...N})),a==null||a("status",N)},x=N=>{d(O=>({...O,state:"waiting_for_qr",qr:N})),a==null||a("qr",N)},w=N=>{const O=typeof N=="object"&&N&&"code"in N?String(N.code):String(N||"");d(R=>({...R,state:"waiting_for_qr",pairingCode:O})),a==null||a("pairing_code",O)},C=()=>{d(N=>N?{...N,qr:null}:null),a==null||a("qr_cleared",{})},k=()=>{d(N=>N?{...N,pairingCode:null}:null),a==null||a("pairing_code_cleared",{})},j=(N,...O)=>{a==null||a(N,O[0])};return f.on("connect",m),f.on("disconnect",p),f.on("session",h),f.on("status_update",y),f.on("status",b),f.on("qr",x),f.on("pairing_code",w),f.on("pairing-code",w),f.on("qr_cleared",C),f.on("pairing_code_cleared",k),f.onAny(j),r(f.connected),()=>{f.off("connect",m),f.off("disconnect",p),f.off("session",h),f.off("status_update",y),f.off("status",b),f.off("qr",x),f.off("pairing_code",w),f.off("pairing-code",w),f.off("qr_cleared",C),f.off("pairing_code_cleared",k),f.offAny(j)}},[a]),{isConnected:i,sessionStatus:o,socket:nb()}}const KN=[{key:"text",icon:Tk,labelKey:"capText",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>(a==null?void 0:a.textInput)!=null&&(a==null?void 0:a.textOutput)!=null?!!(a.textInput&&a.textOutput):null},{key:"vision",icon:bi,labelKey:"capVision",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.vision},{key:"audioInput",icon:zk,labelKey:"capAudio",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.audioInput},{key:"stt",icon:P0,labelKey:"capStt",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.stt},{key:"pdfInput",icon:Mr,labelKey:"capPdf",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.pdfInput},{key:"videoInput",icon:Rk,labelKey:"capVideo",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.videoInput}];function YN(a,i){return i==="unknown"||!i||a==null?"unknown":a?"supported":"unsupported"}function QN({capabilities:a,capabilitySource:i}){const{t:r}=He(),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:KN.map(f=>{const m=f.getValue(a),p=YN(m,i),h=f.icon,y=r(p==="supported"?"supported":p==="unsupported"?"unsupported":"sourceUnknown"),b=`${r(f.labelKey)}: ${y}`,x=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(mi,{size:13,strokeWidth:2.5,className:"text-ok shrink-0"}),p==="unsupported"&&s.jsx(Kn,{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:b})]}),s.jsx("span",{className:"text-[11px] text-muted",children:r(p==="supported"?f.supportedDescKey:p==="unsupported"?f.unsupportedDescKey:"capUnknownDesc")})]});return s.jsx(Bj,{label:b,content:x,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(mi,{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(Kn,{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($e,{tone:o,children:d})]})}const sl=[{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 XN(a){const i=a.ai_provider||"gemini";return sl.find(r=>{var o,d;return r.provider!==i?!1:!!(r.id==="gemini"||r.id==="anthropic"||r.id==="groq"&&((o=a.openai_base_url)!=null&&o.includes("groq.com"))||r.id==="ollama"&&((d=a.openai_base_url)!=null&&d.includes("11434"))||r.id==="openai"&&(!a.openai_base_url||a.openai_base_url.includes("api.openai.com")))})||sl[0]}const ZN=()=>{var Rt,Ka,Ts,Ya,ka,vl;const{t:a,language:i}=He(),{toast:r}=Et(),[o,d]=v.useState({}),[f,m]=v.useState({}),[p,h]=v.useState(!0),[y,b]=v.useState({}),[x,w]=v.useState(!1),[C,k]=v.useState(!1),[j,N]=v.useState(!1),[O,R]=v.useState(""),[I,z]=v.useState(!1),[se,B]=v.useState([]),[D,T]=v.useState(null),[F,U]=v.useState(""),[W,ee]=v.useState(!1),[ue,ie]=v.useState(!1),[H,X]=v.useState([]),[me,de]=v.useState(null),[be,_]=v.useState(null),[J,ye]=v.useState(!1),Se=XN(o),E=Mc({presetId:Se.id,apiKey:"",baseUrl:Se.baseUrlSetting?String(o[Se.baseUrlSetting]||Se.defaultBaseUrl):"",model:String(o[Se.modelSetting]||Se.defaultModel)}),Q=Un(String(o.ai_stt_provider||"auto")),V=Un(String(o.bot_language||"auto")),re=sl.find(le=>le.id===E.draft.presetId)||Se,te=async()=>{try{const le=await Y.getSettings();if(le!=null&&le.settings){const Re={},tt={};le.settings.forEach(gt=>{Re[gt.key]=gt.value,gt.type==="secret"&&(tt[gt.key]=!!gt.configured,Re[gt.key]="")}),d(Re),m(tt)}}catch(le){r(le.message,"error")}finally{h(!1)}};v.useEffect(()=>{te()},[]);const ce=async(le,Re,tt=!1)=>{d(gt=>({...gt,[le]:Re}));try{await Y.updateSetting(le,Re),tt||r(a("savedSuccessfully"),"success")}catch(gt){r(gt.message,"error")}},he=async(le,Re)=>{await Y.updateSetting(le,Re),le.endsWith("_api_key")?(d(tt=>({...tt,[le]:""})),m(tt=>({...tt,[le]:!!Re}))):d(tt=>({...tt,[le]:Re}))},oe=le=>{const Re=sl.find(gt=>gt.id===le);if(!Re)return;const tt=sl.find(gt=>gt.id===E.draft.presetId)||Se;E.setDraft({presetId:Re.id,apiKey:Re.keySetting===tt.keySetting?E.draft.apiKey:"",baseUrl:Re.defaultBaseUrl,model:Re.defaultModel})},we=async(le=!1,Re=!1)=>{w(!0);const tt=String(E.draft.apiKey||"").trim(),gt=!!f[re.keySetting];try{const St={provider:re.provider,refresh:le,cacheOnly:Re};tt&&(St.apiKey=tt),re.baseUrlSetting&&E.draft.baseUrl&&(St.baseUrl=E.draft.baseUrl);const L=await Y.fetchAiModels(St);L&&(L.success||L.fallback)?(b(Ce=>{var it;return{...Ce,[re.id]:{live:!!L.live,requiresApiKey:!!L.requiresApiKey,fallback:!!L.fallback,models:L.models||[],cached:!!L.cached,error:L.success||(it=L.error)==null?void 0:it.message}}}),!L.live&&L.requiresApiKey&&le?r(a("connectKeyFirstPrompt"),"info"):!L.success&&L.error&&r(L.error.message||"Failed to discover models","error")):L&&!L.success&&L.error&&(b(Ce=>{var it;return{...Ce,[re.id]:{live:!1,requiresApiKey:!(gt||tt),fallback:!0,models:L.models||[],error:(it=L.error)==null?void 0:it.message}}}),r(L.error.message||"Failed to discover models","error"))}catch(St){Re||r(St.message||"Failed to fetch models","error")}finally{w(!1)}};v.useEffect(()=>{p||we(!1,!0)},[re.id,p]);const qe=((Rt=y[re.id])==null?void 0:Rt.models)||[],lt=!!((Ka=y[re.id])!=null&&Ka.live),ht=!!(((Ts=y[re.id])==null?void 0:Ts.requiresApiKey)??!f[re.keySetting]),kt=o[Se.modelSetting]||Se.defaultModel,Le=E.draft.model||re.defaultModel,xe=le=>qe.find(Re=>Re.id.toLowerCase()===le.toLowerCase())||{id:le,displayName:le,provider:re.provider,recommended:!1,capabilities:{textInput:!0,textOutput:!0,vision:!1,audioInput:!1,stt:!1,videoInput:!1,pdfInput:!1},capabilitySource:"unknown"},ze=xe(Le),Ne=xe(kt),Pe=!!Ne.capabilities.vision,vt=!!Ne.capabilities.stt,ae=Ne.capabilitySource==="provider"||Ne.capabilitySource==="seed",ne=o.ai_auto_detect_capabilities!==!1,ve=ae&&ne&&!Pe,Te=ae&&ne&&!vt;v.useEffect(()=>{p||(ve&&o.ai_vision_enabled&&ce("ai_vision_enabled",!1,!0),Te&&o.ai_stt_enabled&&ce("ai_stt_enabled",!1,!0))},[kt,ve,Te,p]);const jt=async()=>{N(!0),z(!0);try{const le=await Y.getPersona(),Re=le==null?void 0:le.persona;R(typeof Re=="string"?Re:(Re==null?void 0:Re.body)||"")}catch(le){r(le.message,"error")}finally{z(!1)}},Xt=async()=>{try{await Y.updatePersona(O),r(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),N(!1)}catch(le){r(le.message,"error")}},Tt=async()=>{try{const le=await Y.getMemoryFiles(),Re=((le==null?void 0:le.scopes)||[]).map(tt=>({scope:tt.scope,label:tt.label,entries:tt.entries??0}));B(Re.some(tt=>tt.scope==="global")?Re:[{scope:"global",label:"Global memory",entries:0},...Re])}catch(le){B([{scope:"global",label:"Global memory",entries:0}]),r(le.message,"error")}},sn=async le=>{T(le),U(""),ee(!0);try{const Re=await Y.getMemoryFile(le);U((Re==null?void 0:Re.content)||"")}catch(Re){r(Re.message,"error")}finally{ee(!1)}},qt=async()=>{T("global"),ee(!0),await Tt();try{const le=await Y.getMemoryFile("global");U((le==null?void 0:le.content)||"")}catch(le){r(le.message,"error")}finally{ee(!1)}},wi=async()=>{if(D)try{await Y.updateMemoryFile(D,F),r(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),Tt(),T(null)}catch(le){r(le.message,"error")}},yl=async()=>{ie(!0),de(null),_(null),ye(!0);try{const le=await Y.getAiConversations();X((le==null?void 0:le.conversations)||[])}catch(le){r(le.message,"error")}finally{ye(!1)}},Ia=async le=>{de(le),_(null),ye(!0);try{const Re=await Y.getAiConversation(le);_(Re||null)}catch(Re){r(Re.message,"error")}finally{ye(!1)}},_s=le=>le?new Date(le).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—",Fa={saveLabel:a("save"),savedLabel:a("saved")},ki={saveLabel:a("save"),discardLabel:a("discard"),unsavedLabel:a("unsavedChanges"),savedLabel:a("saved")};if(p)return s.jsx(Cs,{text:a("starting")});const bl=!!o.ai_agent;return s.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[s.jsx(ml,{icon:s.jsx(qm,{size:20}),title:a("aiTitle"),description:a("aiSubtitle")}),s.jsx(Ye,{children:s.jsxs("div",{className:"flex min-h-10 items-center justify-between gap-4",children:[s.jsx("span",{className:"text-sm font-semibold text-text-main",children:a("aiAgentEnabled")}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-bold text-muted",children:a(bl?"toggleOn":"toggleOff")}),s.jsx(Fn,{checked:bl,onChange:le=>ce("ai_agent",le),"aria-label":a("aiAgentEnabled")})]})]})}),s.jsxs(Ye,{className:"flex flex-col gap-3",children:[s.jsx(qn,{icon:s.jsx(mv,{size:18}),title:a("aiProvider")}),s.jsx(js,{"aria-label":a("aiProvider"),value:E.draft.presetId,onChange:le=>oe(le),options:sl.map(le=>({value:le.id,label:le.name})),className:"w-full"}),s.jsx("p",{className:"text-xs text-muted",children:a(re.descKey)}),ht&&s.jsx("p",{className:"text-xs text-warn",children:a("connectKeyFirstPrompt")}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:le=>{le.preventDefault(),E.save(async Re=>{const tt=sl.find(gt=>gt.id===Re.presetId)||re;await he("ai_provider",tt.provider),tt.baseUrlSetting&&await he(tt.baseUrlSetting,Re.baseUrl),await he(tt.modelSetting,Re.model),Re.apiKey.trim()&&await he(tt.keySetting,Re.apiKey.trim()),E.setDraft({...Re,apiKey:""})})},onKeyDown:le=>{le.key==="Escape"&&E.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[s.jsx(Fe,{className:"min-w-0",htmlFor:"input-api-key",label:s.jsxs("span",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("span",{children:a("apiKey")}),f[re.keySetting]&&s.jsxs($e,{tone:"ok",children:[s.jsx(ws,{size:11}),a("saved")]})]}),children:s.jsx(nl,{id:"input-api-key",className:"font-mono",value:E.draft.apiKey,onChange:le=>E.setField("apiKey",le.target.value),placeholder:f[re.keySetting]?"••••••••••••":a("enterApiKey")})}),re.baseUrlSetting&&s.jsx(Fe,{className:"min-w-0",label:a("baseUrl"),htmlFor:"input-base-url",children:s.jsx(Ke,{id:"input-base-url",technical:!0,className:"font-mono",value:E.draft.baseUrl,onChange:le=>E.setField("baseUrl",le.target.value),placeholder:re.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:a("modelName")}),s.jsx($e,{tone:lt?"ok":"info",children:a(lt?"sourceLive":"sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fe,{type:"button",variant:"ghost",size:"sm",onClick:()=>k(!C),children:a(C?"modelListToggle":"modelCustomToggle")}),s.jsx(Oe,{type:"button",variant:"ghost",label:a("refreshModels"),icon:s.jsx(Va,{size:16}),onClick:()=>we(!0),loading:x})]})]}),((Ya=y[re.id])==null?void 0:Ya.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(al,{size:15,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 break-words",children:(ka=y[re.id])==null?void 0:ka.error})]}),s.jsx(fe,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Va,{size:14}),onClick:()=>we(!0),loading:x,children:a("retry")})]}),x?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(Ga,{label:a("fetchingModels")})}):C?s.jsx(Ke,{id:"input-model-name",technical:!0,className:"font-mono",value:E.draft.model,onChange:le=>E.setField("model",le.target.value),placeholder:re.defaultModel}):qe.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:a(ht?"connectKeyFirstPrompt":"noModelsFound")}),s.jsx(fe,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Va,{size:14}),onClick:()=>we(!0),loading:x,children:a("retry")})]}):s.jsxs(Ht,{id:"input-model-name",dir:"ltr",className:"font-mono text-start",value:Le,onChange:le=>E.setField("model",le.target.value),children:[s.jsx("optgroup",{label:a(lt?"modelsAvailableLive":"modelsRecommendedSeed"),children:qe.map(le=>s.jsxs("option",{value:le.id,dir:"ltr",children:[le.displayName&&le.displayName!==le.id?le.displayName:le.id,le.recommended?" ★":""]},le.id))}),!qe.some(le=>le.id.toLowerCase()===Le.toLowerCase())&&s.jsx("option",{value:Le,dir:"ltr",children:Le})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-xs text-muted",dir:"ltr",title:Le,children:[s.jsx("span",{className:"shrink-0 text-faint",children:"ID:"}),s.jsx("span",{className:"truncate font-mono",children:Le})]})]})]}),s.jsx(Oc,{dirty:E.dirty,saving:E.status==="saving",justSaved:E.status==="saved",error:E.error,onDiscard:E.revert,...ki})]}),s.jsx(QN,{capabilities:ze.capabilities,capabilitySource:ze.capabilitySource})]}),s.jsxs(Ye,{className:"flex flex-col gap-3",children:[s.jsx(qn,{title:a("capabilities")}),s.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.jsxs("div",{className:"py-2",children:[s.jsx(Fn,{checked:ve?!1:!!o.ai_vision_enabled,disabled:ve,onChange:le=>{ve||ce("ai_vision_enabled",le)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(bi,{size:17,className:ve?"shrink-0 text-muted":"shrink-0 text-brand-cyan"}),a("aiVision")]}),description:a("aiVisionDesc")}),ve&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(dl,{size:13,className:"shrink-0"}),s.jsx("span",{children:a("visionUnsupportedNotice")})]})]}),s.jsxs("div",{className:"py-2",children:[s.jsx(Fn,{checked:Te?!1:!!(o.ai_stt_enabled??!0),disabled:Te,onChange:le=>{Te||ce("ai_stt_enabled",le)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(P0,{size:17,className:Te?"shrink-0 text-muted":"shrink-0 text-brand-purple"}),a("aiSttEnabled")]}),description:a("aiSttEnabledDesc")}),Te&&s.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] font-semibold text-warn",children:[s.jsx(dl,{size:13,className:"shrink-0"}),s.jsx("span",{children:a("sttUnsupportedNotice")})]})]}),s.jsx("div",{className:"py-2",children:s.jsx(Hn,{label:a("aiStt"),description:a("sttDesc"),htmlFor:"ai-stt-provider",dirty:Q.dirty,saving:Q.status==="saving",justSaved:Q.status==="saved",error:Q.error,onSave:()=>Q.save(le=>he("ai_stt_provider",le)),onRevert:Q.revert,...Fa,children:s.jsxs(Ht,{id:"ai-stt-provider","aria-label":a("aiStt"),value:Q.value,disabled:Te,onChange:le=>Q.setValue(le.target.value),children:[s.jsx("option",{value:"auto",children:a("sttAuto")}),s.jsx("option",{value:"gemini",children:a("sttGemini")}),s.jsx("option",{value:"openai",children:a("sttOpenAI")})]})})}),s.jsx("div",{className:"py-2",children:s.jsx(Hn,{label:a("botLanguage"),description:a("botLanguageDesc"),htmlFor:"ai-bot-language",dirty:V.dirty,saving:V.status==="saving",justSaved:V.status==="saved",error:V.error,onSave:()=>V.save(le=>he("bot_language",le)),onRevert:V.revert,...Fa,children:s.jsxs(Ht,{id:"ai-bot-language","aria-label":a("botLanguage"),value:V.value,onChange:le=>V.setValue(le.target.value),children:[s.jsx("option",{value:"auto",children:a("langAuto")}),s.jsx("option",{value:"ar",children:a("langAr")}),s.jsx("option",{value:"en",children:a("langEn")})]})})})]})]}),s.jsxs(Ye,{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[s.jsx(fe,{variant:"secondary",icon:s.jsx(Mr,{size:16}),onClick:jt,title:a("personaDesc"),children:a("editPersona")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(ok,{size:16}),onClick:qt,title:a("memoryDesc"),children:a("manageMemory")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(Ck,{size:16}),onClick:yl,title:a("aiInspectorDesc"),children:a("openInspector")})]}),s.jsx(an,{isOpen:j,onClose:()=>N(!1),title:a("personaPrompt"),maxWidth:"750px",footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>N(!1),children:a("cancel")}),s.jsx(fe,{variant:"primary",icon:s.jsx(hi,{size:16}),onClick:Xt,disabled:I,children:a("save")})]}),children:I?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(Ga,{className:"size-6",label:a("starting")})}):s.jsx(il,{className:"font-mono",rows:12,value:O,onChange:le=>R(le.target.value)})}),s.jsx(an,{isOpen:!!D,onClose:()=>T(null),title:a("memoryFiles"),maxWidth:"900px",footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>T(null),children:a("cancel")}),s.jsx(fe,{variant:"primary",icon:s.jsx(hi,{size:16}),onClick:wi,disabled:W,children:a("save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row",children:[s.jsx("div",{className:"flex shrink-0 flex-col gap-1.5 md:max-h-[420px] md:w-60 md:overflow-y-auto",children:se.length===0?s.jsx(ut,{kind:"empty",text:a("noMemoryFiles"),className:"py-6"}):se.map(le=>{const Re=le.scope==="global",tt=D===le.scope;return s.jsxs(fe,{variant:tt?"primary":"secondary","aria-pressed":tt,onClick:()=>sn(le.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:[Re?s.jsx(Tc,{size:14,className:"shrink-0"}):s.jsx(xc,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:Re?a("memoryGlobalScope"):le.label||a(le.scope.endsWith("@g.us")?"unnamedGroup":"unknownContact")})]}),s.jsxs("span",{className:"block text-start text-[10px] opacity-80",children:[a(Re?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",a("memoryEntriesCount").replace("{n}",String(le.entries))]})]},le.scope)})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] leading-relaxed text-muted",children:a("memoryProseHint")}),W?s.jsx("div",{className:"flex min-h-[340px] items-center justify-center",children:s.jsx(Ga,{className:"size-6",label:a("starting")})}):s.jsx(il,{className:"min-h-[340px] flex-1 font-mono",rows:12,value:F,onChange:le=>U(le.target.value),placeholder:a("memoryEditorPlaceholder")})]})]})}),s.jsx(an,{isOpen:ue,onClose:()=>ie(!1),title:a("aiInspector"),maxWidth:"750px",footer:s.jsx(fe,{variant:"secondary",onClick:()=>ie(!1),children:a("cancel")}),children:J?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(Ga,{className:"size-6",label:a("starting")})}):me?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(fe,{variant:"ghost",size:"sm",icon:s.jsx(_c,{size:16,className:"rtl:rotate-180"}),onClick:()=>de(null),children:a("backToList")}),s.jsx(An,{lines:2,className:"text-xs text-muted",children:(be==null?void 0:be.name)||((vl=H.find(le=>le.chatId===me))==null?void 0:vl.name)||a((be==null?void 0:be.kind)==="group"?"unnamedGroup":"unknownContact")})]}),(be==null?void 0:be.truncated)&&s.jsx("p",{className:"text-[11px] font-semibold text-warn",children:a("convTruncated")}),s.jsxs("div",{className:"flex max-h-[420px] flex-col gap-1.5 overflow-y-auto",children:[(be==null?void 0:be.messages.length)===0&&s.jsx(ut,{kind:"empty",text:a("noConversations"),className:"py-6"}),be==null?void 0:be.messages.map((le,Re)=>s.jsxs("div",{className:`rounded-xl border p-2.5 text-xs ${le.kind==="tool"||le.kind==="toolResult"?"border-line bg-panel font-mono text-muted":le.role==="model"?"border-brand-blue/25 bg-brand-blue/10 text-text-main":"border-line bg-panel-raised text-text-main"}`,children:[le.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:le.text}),le.kind==="media"&&s.jsxs("span",{children:["📎 ",le.mimeType||a("convMedia")]}),le.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",le.name]}),le.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",le.name]})]},Re))]})]}):H.length===0?s.jsx(ut,{kind:"empty",icon:s.jsx(xc,{size:20}),text:a("noConversations"),className:"py-8"}):s.jsx("div",{className:"flex flex-col gap-1.5",children:H.map(le=>s.jsxs(fe,{variant:"secondary",onClick:()=>Ia(le.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(xc,{size:14,className:"shrink-0 text-brand-blue"}),s.jsx(An,{lines:2,children:le.name||a(le.kind==="group"?"unnamedGroup":"unknownContact")})]}),s.jsxs("span",{className:"block text-start text-[10px] text-muted",children:[a("convTurns").replace("{n}",String(le.turns))," ·"," ",_s(le.updatedAt)]})]},le.chatId))})})]})},Gn={rules:100,keywords:50,keywordChars:100,nameChars:60,senders:200,phoneMin:8,phoneMax:15},JN=/[\u064B-\u065F\u0670\u0640]/g,$N=/[\u0622\u0623\u0625\u0671]/g,WN=/\u0649/g,qf={enabled:"any",chatScope:"any",senders:"any"};function Mm(a){let i=String(a??"");return i=i.normalize("NFKC"),i=i.replace(JN,""),i=i.replace($N,"ا"),i=i.replace(WN,"ي"),i=i.toLowerCase(),i=i.replace(/\s+/g," ").trim(),i}function eC(a){const i=String(a??"").normalize("NFC").replace(/\s+/g," ").trim();return i?i.length>Gn.keywordChars?{error:"long"}:Mm(i)?{value:i}:{error:"empty"}:{error:"empty"}}class di extends Error{constructor(i){super(i),this.reason=i,this.name="SenderInputError"}}function tC(a){var d;const i=String(a??"").trim();if(!i)throw new di("invalid");const r=i.toLowerCase();if(r.endsWith("@g.us")||r.endsWith("@broadcast")||r.endsWith("@newsletter"))throw new di("group");if(i.includes("@")){if(r.includes("@lid")){const f=(d=i.split("@")[0])==null?void 0:d.split(":")[0];if(!f)throw new di("invalid");return`${f}@lid`}if(i.includes(":")){const f=i.split(":")[0],m=i.split("@")[1];if(!f||!m)throw new di("invalid");return`${f}@${m}`}return i}const o=i.replace(/\D/g,"");if(o.length>=Gn.phoneMin&&o.length<=Gn.phoneMax)return`${o}@s.whatsapp.net`;throw new di("invalid")}function xi(a){var r;const i=(r=a.name)==null?void 0:r.trim();return i||a.keywords[0]||""}function Lc(a,i){if(!a)return"";const r=i==null?void 0:i.get(a);if(r)return r;const o=/^(\d+)@s\.whatsapp\.net$/i.exec(a);return o?`+${o[1]}`:a}function Om(a,i){return a&&(i!=null&&i.has(a))?"auto":"ltr"}function nC(a){const i={};return a.name.trim().length>Gn.nameChars&&(i.name="long"),a.keywords.length<1?i.keywords="required":a.keywords.length>Gn.keywords&&(i.keywords="max"),a.sendersMode==="selected"&&(a.senders.length<1?i.senders="required":a.senders.length>Gn.senders&&(i.senders="max")),i}function aC(a,i){return{name:a.name.trim()||null,keywords:a.keywords,match:a.match,chatScope:a.chatScope,senders:{mode:a.sendersMode,list:a.sendersMode==="everyone"?[]:a.senders},includeOwn:a.includeOwn,forEveryone:a.forEveryone,keepCopy:a.keepCopy,...i===void 0?{}:{enabled:i}}}function sC(a,i,r){const o=Mm(i);return!(o&&!Mm(`${a.name??""} ${a.keywords.join(" ")}`).includes(o)||r.enabled==="on"&&!a.enabled||r.enabled==="off"&&a.enabled||r.chatScope!=="any"&&a.chatScope!==r.chatScope||r.senders!=="any"&&a.senders.mode!==r.senders)}function lC(a,i,r){const o=[...a],d=(f,m)=>xi(f).localeCompare(xi(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 iC(a){return[a.enabled,a.chatScope,a.senders].filter(i=>i!=="any").length}function rn(a,i){return a.replace(/\{([A-Za-z0-9_]+)\}/g,(r,o)=>Object.hasOwn(i,o)?String(i[o]):r)}const Pf=20;function ab(a,i){return a instanceof Bt&&a.message?a.message:i}const rC=({rules:a,names:i,ruleId:r,onRuleIdChange:o})=>{const{t:d}=He(),{toast:f}=Et(),[m,p]=v.useState([]),[h,y]=v.useState(0),[b,x]=v.useState(1),[w,C]=v.useState(!0),[k,j]=v.useState(null),[N,O]=v.useState(0),[R,I]=v.useState(null),[z,se]=v.useState(!1),B=v.useRef(0),D=`${r}|${N}`,[T,F]=v.useState(D);T!==D&&(F(D),x(1)),v.useEffect(()=>{const H=++B.current;C(!0),j(null),Y.listAutoDeleteLog({ruleId:r||void 0,limit:Pf,offset:(b-1)*Pf}).then(X=>{B.current===H&&(p(X.log),y(X.total))}).catch(X=>{if(B.current!==H)return;const me=ab(X,d("copiesLoadFailed"));j(me),f(me,"error")}).finally(()=>{B.current===H&&C(!1)})},[r,N,b,d,f]);const U=async()=>{se(!0);try{await Y.clearAutoDeleteLog(R==="rule"?r:void 0),f(d("copiesCleared"),"success"),I(null),O(H=>H+1)}catch(H){f(ab(H,d("copiesLoadFailed")),"error")}finally{se(!1)}},W=v.useCallback(H=>{if(!H)return d("mediaText");const me={image:"mediaImage",video:"mediaVideo",audio:"mediaAudio",sticker:"mediaSticker",document:"mediaDocument"}[H];return me?d(me):H},[d]),ee=a.find(H=>String(H.id)===r),ue=Math.max(1,Math.ceil(h/Pf)),ie=Math.min(b,ue);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(pl,{children:[s.jsx(hl,{label:d("filter"),resetLabel:d("reset"),activeCount:r?1:0,onReset:()=>o(""),children:s.jsx(Fe,{label:d("filterByRule"),children:s.jsxs(Ht,{"aria-label":d("filterByRule"),value:r,onChange:H=>o(H.target.value),children:[s.jsx("option",{value:"",children:d("allRules")}),a.map(H=>s.jsx("option",{value:String(H.id),children:xi(H)},H.id))]})})}),s.jsx("span",{className:"ms-auto",children:s.jsxs(aa,{label:d("more"),children:[r&&s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>I("rule"),children:d("clearCopiesForRule")}),s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>I("all"),children:d("clearCopies")})]})})]}),w&&s.jsx("div",{className:"flex flex-col gap-3","aria-busy":"true",children:["s1","s2","s3"].map(H=>s.jsxs(Ye,{className:"flex flex-col gap-3",children:[s.jsx(It,{className:"h-4 w-40"}),s.jsx(It,{className:"h-12 w-full"}),s.jsx(It,{className:"h-5 w-24"})]},H))}),!w&&k&&s.jsx(ut,{kind:"error",icon:s.jsx(cl,{size:28}),description:k,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(cl,{size:16}),onClick:()=>O(H=>H+1),children:d("retryLoad")})}),!w&&!k&&m.length===0&&r&&s.jsx(ut,{kind:"no-results",description:d("noCopiesForRule"),action:s.jsx(fe,{variant:"secondary",onClick:()=>o(""),children:d("clearFilters")})}),!w&&!k&&m.length===0&&!r&&s.jsx(ut,{kind:"empty",title:d("noCopiesTitle"),description:d("noCopiesBody")}),!w&&!k&&m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col gap-3",children:m.map(H=>{const X=Lc(H.chatJid,i)||"—",me=Lc(H.sender,i)||"—",de=H.mode==="revoke"?d("modeRevoke"):H.mode==="deleteForMe"?d("modeForMe"):H.mode;return s.jsxs(Ye,{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:Om(H.chatJid,i),className:"truncate text-sm font-semibold",children:X})]}),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:Om(H.sender,i),className:"truncate text-sm",children:me})]}),s.jsx(Rc,{value:H.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:H.text||"—"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx($e,{children:W(H.mediaType)}),s.jsx($e,{tone:H.mode==="revoke"?"info":"neutral",children:de})]})]},H.id)})}),s.jsx(vi,{page:ie,pageCount:ue,total:h,onPageChange:x})]}),s.jsx(gi,{isOpen:R!==null,onClose:()=>I(null),onConfirm:()=>void U(),title:d("clearCopiesTitle"),description:R==="rule"?rn(d("clearCopiesRuleBody"),{name:ee?xi(ee):""}):d("clearCopiesBody"),confirmLabel:d("clearCopies"),cancelLabel:d("cancel"),loading:z})]})},oC={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 b1(a){return a?oC[a]??null:null}function th(a,i){const r=b1(i);return a(r||"stickerErr_INTERNAL")}function wt(a,i){return i instanceof Bt?th(a,i.code):a("stickerErr_INTERNAL")}function cC(a,i){const o=i?{probing:"jobStage_probing",decoding:"jobStage_decoding",encoding:"jobStage_encoding",optimizing:"jobStage_optimizing",queued:"jobQueued"}[i]:null;return a(o||"jobQueued")}const nh=({open:a,busy:i=!1,onClose:r,onPick:o,title:d,includeGroups:f=!0,selectedIds:m,emptyText:p})=>{const{t:h}=He(),[y,b]=v.useState([]),[x,w]=v.useState(""),[C,k]=v.useState(!1),[j,N]=v.useState(null);v.useEffect(()=>{if(!a)return;let R=!1;return k(!0),N(null),Y.getRecipients().then(I=>{R||b(I.recipients)}).catch(I=>{R||(I instanceof Bt&&!b1(I.code)?N(I.message||h("recipientsLoadFailed")):N(wt(h,I)))}).finally(()=>{R||k(!1)}),()=>{R=!0}},[a,h]);const O=v.useMemo(()=>{const R=f?y:y.filter(z=>z.type==="contact"),I=x.trim().toLowerCase();return I?R.filter(z=>z.name.toLowerCase().includes(I)||(z.phone||"").toLowerCase().includes(I)):R},[f,y,x]);return s.jsx(an,{isOpen:a,onClose:r,title:d??h("sendViaWhatsapp"),footer:s.jsx(fe,{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(Pm,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Ke,{type:"search",value:x,onChange:R=>w(R.target.value),placeholder:h("searchRecipients"),"aria-label":h("searchRecipients"),className:"ps-9"})]}),C&&s.jsx(Cs,{text:h("loading")}),j&&s.jsx("p",{className:"text-sm text-danger",role:"alert",children:j}),!C&&!j&&O.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:O.map(R=>{const I=(m==null?void 0:m.includes(R.id))??!1;return s.jsxs(fe,{variant:"secondary",disabled:i||I,onClick:()=>o(R.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:R.name}),I&&s.jsx($e,{tone:"info",children:h("contactAdded")})]}),s.jsxs("span",{className:"block w-full text-[11px] font-medium text-muted",children:[R.type==="group"?h("recipientGroup"):h("recipientContact"),R.phone?s.jsx("span",{dir:"ltr",className:"ms-2",children:R.phone}):null]})]},R.id)})}),i&&s.jsx("p",{className:"text-xs text-muted",children:h("sending")})]})})},uC=["contains","word","exact"],dC=["all","groups","private"],fC=({open:a,rule:i,names:r,onClose:o,onSaved:d})=>{const{t:f}=He(),m=v.useRef(i);m.current=i;const p=(i==null?void 0:i.id)??null,[h,y]=v.useState(""),[b,x]=v.useState([]),[w,C]=v.useState("contains"),[k,j]=v.useState("all"),[N,O]=v.useState("everyone"),[R,I]=v.useState([]),[z,se]=v.useState(!1),[B,D]=v.useState(!0),[T,F]=v.useState(!1),[U,W]=v.useState(""),[ee,ue]=v.useState(!1),[ie,H]=v.useState(!1),[X,me]=v.useState(null),[de,be]=v.useState(null),[_,J]=v.useState(null),[ye,Se]=v.useState(null);v.useEffect(()=>{if(!a)return;const te=m.current;((te==null?void 0:te.id)??null)===p&&(y((te==null?void 0:te.name)??""),x((te==null?void 0:te.keywords)??[]),C((te==null?void 0:te.match)??"contains"),j((te==null?void 0:te.chatScope)??"all"),O((te==null?void 0:te.senders.mode)??"everyone"),I((te==null?void 0:te.senders.list)??[]),se((te==null?void 0:te.includeOwn)??!1),D((te==null?void 0:te.forEveryone)??!0),F((te==null?void 0:te.keepCopy)??!1),W(""),ue(!1),H(!1),me(null),be(null),J(null),Se(null))},[a,p]);const E=f(w==="word"?"matchWordHint":w==="exact"?"matchExactHint":"matchContainsHint"),Q=te=>{J(te==="long"?f("keywordTooLong"):te==="max"?f("keywordsMax"):te==="empty"?f("keywordEmpty"):te==="duplicate"?f("keywordDuplicate"):null)},V=te=>{try{const ce=tC(te);if(R.includes(ce)){W(""),Se(null);return}if(R.length>=Gn.senders){Se(f("tooManySenders"));return}I(he=>he.includes(ce)?he:[...he,ce]),W(""),Se(null)}catch(ce){Se(ce instanceof di&&ce.reason==="group"?f("groupSenderRejected"):f("invalidPhone"))}},re=async te=>{var oe;te.preventDefault();const ce={name:h,keywords:b,match:w,chatScope:k,sendersMode:N,senders:R,includeOwn:z,forEveryone:B,keepCopy:T},he=nC(ce);if(be(he.name?f("nameTooLong"):null),J(he.keywords==="required"?f("keywordsRequired"):he.keywords==="max"?f("keywordsMax"):null),Se(he.senders==="required"?f("sendersRequired"):he.senders==="max"?f("tooManySenders"):null),!(he.name||he.keywords||he.senders)){H(!0),me(null);try{const we=aC(ce,(oe=m.current)==null?void 0:oe.enabled),qe=m.current?await Y.updateAutoDeleteRule(m.current.id,we):await Y.createAutoDeleteRule(we);d(qe.rule)}catch(we){const qe=we instanceof Bt&&we.message?we.message:f("ruleSaveFailed");me(qe)}finally{H(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsx(an,{isOpen:a,onClose:o,title:f(i?"editRule":"newRule"),maxWidth:"40rem",footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:o,disabled:ie,children:f("cancel")}),s.jsx(fe,{variant:"primary",type:"submit",form:"auto-delete-rule-form",loading:ie,children:f("saveRule")})]}),children:s.jsxs("form",{id:"auto-delete-rule-form",className:"flex flex-col gap-4",onSubmit:te=>void re(te),children:[X&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:X}),s.jsx(Fe,{label:f("ruleName"),htmlFor:"ad-rule-name",error:de,children:s.jsx(Ke,{id:"ad-rule-name",name:"rule-name",dir:"auto",value:h,"aria-invalid":de?!0:void 0,placeholder:f("ruleNamePlaceholder"),onChange:te=>{y(te.target.value),de&&te.target.value.trim().length<=Gn.nameChars&&be(null)},onBlur:()=>{h.trim().length>Gn.nameChars&&be(f("nameTooLong"))}})}),s.jsx(Fe,{label:f("keywordsLabel"),error:_,children:s.jsx(Rj,{id:"ad-keywords",value:b,onChange:x,max:Gn.keywords,prepare:eC,onReject:Q,removeLabel:te=>rn(f("removeKeyword"),{word:te}),countLabel:rn(f("keywordCount"),{n:b.length,max:Gn.keywords}),placeholder:f("keywordsPlaceholder"),"aria-label":f("keywordsLabel"),"aria-invalid":_?!0:void 0,disabled:ie})}),s.jsx(Fe,{label:f("matchMode"),description:E,children:s.jsx(js,{"aria-label":f("matchMode"),className:"flex w-full flex-wrap",value:w,onChange:C,options:uC.map(te=>({value:te,label:f(te==="contains"?"matchContains":te==="word"?"matchWord":"matchExact")}))})}),s.jsx(Fe,{label:f("chatScopeLabel"),children:s.jsx(js,{"aria-label":f("chatScopeLabel"),className:"flex w-full flex-wrap",value:k,onChange:j,options:dC.map(te=>({value:te,label:f(te==="all"?"chatsAll":te==="groups"?"chatsGroups":"chatsPrivate")}))})}),s.jsxs(Fe,{label:f("filterSender"),error:N==="selected"?ye:null,children:[s.jsx(js,{"aria-label":f("filterSender"),className:"flex w-full flex-wrap",value:N,onChange:O,options:[{value:"everyone",label:f("sendersEveryone")},{value:"selected",label:f("sendersSelected")}]}),N==="selected"&&s.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:f("sendersHelp")}),R.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:R.map(te=>s.jsx(Gc,{dir:Om(te,r),removeLabel:rn(f("removeContact"),{name:Lc(te,r)}),onRemove:()=>I(ce=>ce.filter(he=>he!==te)),children:Lc(te,r)},te))}),s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[s.jsx(Ke,{type:"tel",inputMode:"tel",name:"phone",autoComplete:"tel",dir:"ltr",value:U,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(),V(U))}}),s.jsx(fe,{type:"button",variant:"secondary",onClick:()=>V(U),children:f("addPhone")})]}),s.jsx(fe,{type:"button",variant:"secondary",onClick:()=>ue(!0),children:f("selectContacts")})]})]}),s.jsx(Fn,{checked:z,onChange:se,label:f("includeOwn"),description:f("includeOwnHint")}),s.jsx(Fn,{checked:B,onChange:D,label:f("forEveryone"),description:f("forEveryoneHint")}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Fn,{checked:T,onChange:F,label:f("keepCopy"),description:f("keepCopyHint")}),s.jsx("p",{className:"text-xs text-faint",children:f("keepCopyPrivacy")})]})]})}),s.jsx(nh,{open:ee,onClose:()=>ue(!1),title:f("selectContacts"),includeGroups:!1,selectedIds:R,emptyText:f("noContacts"),onPick:te=>V(te)})]})},sb=4,mC={contains:"matchContains",word:"matchWord",exact:"matchExact"};function Sr(a,i){return a instanceof Bt&&a.message?a.message:i}const hC=()=>{const{t:a,language:i}=He(),{toast:r}=Et(),[o,d]=v.useState("rules"),[f,m]=v.useState([]),[p,h]=v.useState(()=>new Map),[y,b]=v.useState(!0),[x,w]=v.useState(null),[C,k]=v.useState(0),[j,N]=v.useState(""),[O,R]=v.useState("newest"),[I,z]=v.useState(qf),[se,B]=v.useState(!1),[D,T]=v.useState(null),[F,U]=v.useState(null),[W,ee]=v.useState(!1),[ue,ie]=v.useState(""),H=v.useRef(new Set),X=v.useRef(new Map),me=v.useRef(0),de=v.useRef(!0),be=v.useRef(0),_=v.useMemo(()=>new Intl.NumberFormat(i),[i]),J=v.useCallback(xe=>{m(ze=>xe.map(Ne=>{if(!H.current.has(Ne.id))return Ne;const Pe=ze.find(vt=>vt.id===Ne.id);return Pe?{...Ne,enabled:Pe.enabled}:Ne}))},[]);v.useEffect(()=>{const xe=++me.current;return b(!0),Y.listAutoDeleteRules().then(ze=>{!de.current||me.current!==xe||(J(ze.rules),w(null))}).catch(ze=>{if(!de.current||me.current!==xe)return;const Ne=Sr(ze,a("rulesLoadFailed"));w(Ne),r(Ne,"error")}).finally(()=>{de.current&&me.current===xe&&b(!1)}),()=>{me.current+=1}},[C,a,r,J]),v.useEffect(()=>(de.current=!0,()=>{de.current=!1}),[]);const ye=v.useCallback(async()=>{const xe=++me.current,ze=be.current;try{const Ne=await Y.listAutoDeleteRules();if(!de.current||me.current!==xe||be.current!==ze)return;J(Ne.rules),w(null)}catch{}},[J]);v.useEffect(()=>{if(y)return;const xe=()=>{document.visibilityState!=="hidden"&&ye()};window.addEventListener("focus",xe),document.addEventListener("visibilitychange",xe);const ze=window.setInterval(xe,3e4);return()=>{window.removeEventListener("focus",xe),document.removeEventListener("visibilitychange",xe),window.clearInterval(ze)}},[y,ye]),v.useEffect(()=>{let xe=!1;return Y.getRecipients().then(ze=>{if(xe)return;const Ne=new Map;for(const Pe of ze.recipients)Pe.name&&Ne.set(Pe.id,Pe.name);h(Ne)}).catch(ze=>{xe||r(Sr(ze,a("recipientsLoadFailed")),"error")}),()=>{xe=!0}},[a,r]);const Se=v.useMemo(()=>lC(f.filter(xe=>sC(xe,j,I)),O,i),[f,j,I,O,i]),E=`${j}|${O}|${I.enabled}|${I.chatScope}|${I.senders}`,{page:Q,pageCount:V,pageItems:re,setPage:te,total:ce}=Vc(Se,20,E),he=()=>{N(""),z(qf)},oe=D?f.find(xe=>xe.id===D.id)??D:null,we=()=>{if(f.length>=Gn.rules){r(a("rulesLimit"),"warning");return}T(null),B(!0)},qe=async(xe,ze)=>{be.current+=1;const Ne=xe.enabled,Pe=(X.current.get(xe.id)??0)+1;X.current.set(xe.id,Pe),H.current.add(xe.id),m(vt=>vt.map(ae=>ae.id===xe.id?{...ae,enabled:ze}:ae));try{const vt=await Y.updateAutoDeleteRule(xe.id,{enabled:ze});if(X.current.get(xe.id)!==Pe)return;m(ae=>ae.map(ne=>ne.id===xe.id?vt.rule:ne))}catch(vt){X.current.get(xe.id)===Pe&&(m(ae=>ae.map(ne=>ne.id===xe.id?{...ne,enabled:Ne}:ne)),r(Sr(vt,a("toggleFailed")),"error"))}finally{be.current+=1,X.current.get(xe.id)===Pe&&H.current.delete(xe.id)}},lt=async xe=>{be.current+=1;try{const ze=await Y.resetAutoDeleteRule(xe.id);m(Ne=>Ne.map(Pe=>Pe.id===xe.id?ze.rule:Pe)),r(a("counterReset"),"success")}catch(ze){r(Sr(ze,a("toggleFailed")),"error")}finally{be.current+=1}},ht=async()=>{if(F){be.current+=1,ee(!0);try{await Y.deleteAutoDeleteRule(F.id),m(xe=>xe.filter(ze=>ze.id!==F.id)),ue===String(F.id)&&ie(""),r(a("ruleDeleted"),"success"),U(null)}catch(xe){r(Sr(xe,a("toggleFailed")),"error")}finally{be.current+=1,ee(!1)}}},kt=xe=>xe.chatScope==="groups"?a("chatsGroups"):xe.chatScope==="private"?a("chatsPrivate"):a("chatsAll"),Le=xe=>xe.senders.mode==="everyone"?a("sendersEveryone"):xe.senders.list.length===1?a("oneContact"):rn(a("sendersCount"),{n:xe.senders.list.length});return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(ml,{icon:s.jsx(yc,{size:24}),title:a("autoDelete"),description:a("autoDeleteSubtitle"),actions:f.length>0||o==="copies"?s.jsx(fe,{variant:"primary",icon:s.jsx(ol,{size:16}),onClick:we,children:a("newRule")}):void 0}),s.jsx(Ic,{"aria-label":a("autoDelete"),className:"overflow-x-auto",value:o,onChange:d,options:[{value:"rules",label:a("rulesTab")},{value:"copies",label:a("copiesTab")}]}),o==="rules"&&s.jsxs("div",{className:"flex flex-col gap-3",children:[!y&&!x&&f.length>0&&s.jsxs(pl,{children:[s.jsx(Ke,{type:"search",name:"q",autoComplete:"off",value:j,onChange:xe=>N(xe.target.value),placeholder:a("searchRules"),"aria-label":a("searchRules"),className:"min-w-48 flex-1"}),s.jsx(Lr,{label:a("sort"),value:O,onChange:R,options:[{value:"newest",label:a("sortNewest")},{value:"name",label:a("sortByName")},{value:"deleted",label:a("sortMostDeleted")},{value:"last",label:a("sortLastDeleted")}]}),s.jsxs(hl,{label:a("filter"),resetLabel:a("reset"),activeCount:iC(I),onReset:()=>z(qf),children:[s.jsx(yn,{label:a("filterStatus"),name:"ad-status",value:I.enabled,onChange:xe=>z(ze=>({...ze,enabled:xe})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(yn,{label:a("filterChat"),name:"ad-scope",value:I.chatScope,onChange:xe=>z(ze=>({...ze,chatScope:xe})),options:[{value:"any",label:a("statusAny")},{value:"all",label:a("chatsAll")},{value:"groups",label:a("chatsGroups")},{value:"private",label:a("chatsPrivate")}]}),s.jsx(yn,{label:a("filterSender"),name:"ad-senders",value:I.senders,onChange:xe=>z(ze=>({...ze,senders:xe})),options:[{value:"any",label:a("statusAny")},{value:"everyone",label:a("sendersEveryone")},{value:"selected",label:a("sendersSelected")}]})]})]}),y&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(xe=>s.jsxs(Ye,{className:"flex flex-col gap-3",children:[s.jsx(It,{className:"h-5 w-40"}),s.jsx(It,{className:"h-6 w-full"}),s.jsx(It,{className:"h-8 w-24"})]},xe))}),!y&&x&&f.length===0&&s.jsx(ut,{kind:"error",icon:s.jsx(yc,{size:28}),description:x,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(cl,{size:16}),onClick:()=>k(xe=>xe+1),children:a("retryLoad")})}),!y&&!x&&f.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(yc,{size:28}),title:a("noRulesTitle"),description:a("noRulesBody"),action:s.jsx(fe,{variant:"primary",icon:s.jsx(ol,{size:16}),onClick:we,children:a("newRule")})}),!y&&!x&&f.length>0&&Se.length===0&&s.jsx(ut,{kind:"no-results",action:s.jsx(fe,{variant:"secondary",onClick:he,children:a("clearFilters")})}),!y&&!x&&Se.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:re.map(xe=>{const ze=xi(xe),Ne=Math.max(0,xe.keywords.length-sb);return s.jsxs(Ye,{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:ze||"—"}),s.jsx(Fn,{checked:xe.enabled,"aria-label":a("ruleEnabled"),onChange:Pe=>void qe(xe,Pe)}),s.jsxs(aa,{label:a("more"),children:[s.jsx(st,{icon:s.jsx(Y0,{size:16}),onSelect:()=>{T(xe),B(!0)},children:a("edit")}),s.jsx(st,{icon:s.jsx(cl,{size:16}),onSelect:()=>void lt(xe),children:a("resetCounter")}),xe.keepCopy&&s.jsx(st,{icon:s.jsx(bi,{size:16}),onSelect:()=>{ie(String(xe.id)),d("copies")},children:a("viewCopies")}),s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>U(xe),children:a("delete")})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[xe.keywords.slice(0,sb).map(Pe=>s.jsx(Gc,{children:Pe},Pe)),Ne>0&&s.jsx($e,{children:rn(a("moreKeywords"),{n:Ne})})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx($e,{children:a(mC[xe.match])}),s.jsx($e,{children:kt(xe)}),s.jsx($e,{children:Le(xe)})]}),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:_.format(xe.deletedCount)}),s.jsx("span",{className:"text-xs text-muted",children:a("deletedLabel")}),s.jsx("span",{className:"ms-auto text-xs text-muted",children:xe.lastDeletedAt?s.jsxs(s.Fragment,{children:[a("lastDeleted")," ",s.jsx(Rc,{value:xe.lastDeletedAt})]}):a("neverDeleted")})]})]},xe.id)})}),s.jsx(vi,{page:Q,pageCount:V,total:ce,onPageChange:te})]})]}),o==="copies"&&s.jsx(rC,{rules:f,names:p,ruleId:ue,onRuleIdChange:ie}),s.jsx(fC,{open:se,rule:oe,names:p,onClose:()=>B(!1),onSaved:xe=>{be.current+=1,m(ze=>{const Ne=ze.findIndex(vt=>vt.id===xe.id);if(Ne===-1)return[xe,...ze];const Pe=ze.slice();return Pe[Ne]=xe,Pe}),r(a("ruleSaved"),"success"),B(!1)}}),s.jsx(gi,{isOpen:F!==null,onClose:()=>U(null),onConfirm:()=>void ht(),title:a("deleteRuleTitle"),description:s.jsx("span",{dir:"auto",children:rn(a("deleteRuleBody"),{name:F?xi(F):""})}),confirmLabel:a("delete"),cancelLabel:a("cancel"),loading:W})]})},pC=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/;function Pa(a){return a.key??a.name}function v1(a){return`cmd-details-${Pa(a).replace(/[^a-zA-Z0-9_-]+/g,"-")}`}const gC={MEMBERS:"permMembers",ALL:"permMembers",ADMINS_ONLY:"permAdminsOnly",ADMINS_OWNER:"permAdminsOwner",OWNER_ONLY:"permOwnerOnly"},xC={all:"scopeAll",group:"scopeGroup",private:"scopePrivate"};function Br(){const{t:a,language:i}=He(),r=p=>{const h=gC[p];return h?a(h):p},o=p=>{const h=xC[p];return h?a(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:a,language:i,permissionLabel:r,scopeLabel:o,describe:d,usageOf:f,usageLines:(p,h)=>f(p).split(`
|
|
527
|
-
`).map(y=>y.trim()).filter(Boolean).map(y=>`${h}${y}`)}}function ah({alias:a,prefix:i,onRemove:r,removeLabel:o}){const{t:d,language:f}=He(),m=pC.test(a),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,a]}),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(Kn,{size:14}),onMouseDown:h=>h.preventDefault(),onClick:r})]})}function yC({command:a,prefix:i,onClose:r,onSaved:o}){const{t:d}=He(),{toast:f}=Et(),[m,p]=v.useState([]),[h,y]=v.useState(""),[b,x]=v.useState(!1);v.useEffect(()=>{a&&(p(Array.isArray(a.aliases)?[...a.aliases]:[]),y(""),x(!1))},[a]);const w=()=>{const j=h.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(j){if(m.includes(j)){f(d("aliasAlreadyAdded"),"warning");return}p([...m,j]),y("")}},C=j=>{p(m.filter(N=>N!==j))},k=async()=>{if(a){x(!0);try{await Y.updateCommand(a.name,{aliases:m}),o(a,m),f(d("savedSuccessfully"),"success"),r()}catch(j){f(j.message,"error")}finally{x(!1)}}};return s.jsx(an,{isOpen:!!a,onClose:r,title:a?s.jsxs(s.Fragment,{children:[d("aliasesFor")," ",s.jsxs("span",{dir:"ltr",className:"font-mono",children:[i,a.name]})]}):d("aliasesFor"),footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:r,children:d("cancel")}),s.jsx(fe,{variant:"primary",onClick:k,loading:b,children:d(b?"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(j=>s.jsx(ah,{alias:j,prefix:i,removeLabel:d("delete"),onRemove:()=>C(j)},j)):s.jsx("span",{className:"px-1 text-xs text-faint",children:d("noAliases")})})]}),s.jsx(Fe,{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(_k,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Ke,{id:"new-alias-input",type:"text",value:h,onChange:j=>y(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),w())},placeholder:d("newAliasPlaceholder"),className:"ps-10"})]}),s.jsx(fe,{variant:"secondary",icon:s.jsx(ol,{size:16}),onClick:w,className:"shrink-0",children:d("add")})]})})]})})}function S1({command:a,levels:i,actions:r}){const{t:o,permissionLabel:d}=Br(),f=Un(a.permission);return a.permissionLocked?s.jsxs(Xv,{padded:!1,role:"group","aria-label":`${o("thRequiredRole")}: ${a.name}`,className:"flex min-h-11 items-center gap-2.5 px-3 py-3",children:[s.jsx(z0,{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(a.permission)})]}):s.jsx(Hn,{dirty:f.dirty,saving:f.status==="saving",justSaved:f.status==="saved",error:f.error,onSave:()=>f.save(m=>r.onSavePermission(a,m)),onRevert:f.revert,saveLabel:o("save"),savedLabel:o("saved"),children:s.jsx(Ht,{"aria-label":`${o("thRequiredRole")}: ${a.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 wr({label:a,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:a}),i]})}function w1({command:a,prefix:i,levels:r,actions:o}){var x;const{t:d,describe:f,scopeLabel:m,permissionLabel:p,usageLines:h}=Br(),y=f(a),b=h(a,i);return s.jsxs("div",{className:"flex flex-col gap-5",children:[y&&s.jsx("p",{dir:"auto",className:"min-w-0 break-words text-sm leading-relaxed text-muted",children:y}),s.jsxs("div",{className:"grid grid-cols-1 gap-x-5 gap-y-5 sm:grid-cols-2",children:[s.jsx(wr,{label:d("thAliases"),children:s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[(x=a.aliases)!=null&&x.length?a.aliases.map(w=>s.jsx(ah,{alias:w,prefix:i},w)):s.jsx("span",{className:"text-xs text-faint",children:d("noAliases")}),s.jsx(Oe,{label:d("editAliases"),icon:s.jsx(kk,{size:16}),onClick:()=>o.onEditAliases(a)})]})}),s.jsxs(wr,{label:d("thRequiredRole"),children:[s.jsx(S1,{command:a,levels:r,actions:o}),a.permissionLocked&&s.jsx("p",{className:"text-xs text-muted",children:d("permissionLockedReason")})]}),s.jsx(wr,{label:d("thScope"),children:s.jsx("div",{children:s.jsx($e,{tone:"info",children:m(a.chat)})})}),s.jsxs(wr,{label:d("thStatus"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx($e,{tone:a.enabled?"ok":"neutral",children:a.enabled?d("statusEnabled"):d("statusDisabled")}),a.overridden&&s.jsx($e,{tone:"info",children:d("overridden")})]}),s.jsxs("p",{className:"text-xs text-muted",children:[d("defaultLabel"),": ",p(a.defaultPermission)]})]})]}),b.length>0&&s.jsx(wr,{label:d("usage"),children:s.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:b.map(w=>s.jsx("li",{children:s.jsxs(Xv,{padded:!1,className:"flex min-h-11 items-center gap-2 px-3 py-2",children:[s.jsx("code",{dir:"ltr",title:w,className:"min-w-0 flex-1 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-muted",children:w}),s.jsx(Oe,{label:d("copyCommand"),variant:"ghost",icon:s.jsx(f0,{size:16}),onClick:()=>o.onCopy(w)})]})},w))})})]})}function bC({commands:a,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:m}=He();return s.jsx("ul",{className:"divide-y divide-line/50",children:a.map(p=>{const h=Pa(p),y=o===h,b=v1(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(Fn,{checked:p.enabled,"aria-label":`${m("thStatus")}: ${i}${p.name}`,onChange:x=>f.onToggleEnabled(p,x)}),s.jsx(Oe,{size:"md",variant:"ghost",label:m(y?"hideDetails":"details"),"aria-expanded":y,"aria-controls":b,icon:s.jsx(rl,{size:18,className:Ue("transition-transform",y&&"rotate-180")}),onClick:()=>d(h)})]}),y&&s.jsx("div",{id:b,className:"border-t border-line/40 bg-panel-raised/40 px-4 py-4",children:s.jsx(w1,{command:p,prefix:i,levels:r,actions:f})})]},h)})})}const lb=2;function vC({command:a,prefix:i}){const r=a.aliases||[];if(r.length===0)return s.jsx("span",{className:"text-xs text-faint",children:"—"});const o=r.length-lb;return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[r.slice(0,lb).map(d=>s.jsx(ah,{alias:d,prefix:i},d)),o>0&&s.jsxs($e,{tone:"neutral",children:["+",o]})]})}function SC({commands:a,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:m}=He(),{describe:p}=Br();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:a.map(h=>{const y=Pa(h),b=o===y,x=v1(h);return s.jsxs(v.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(An,{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(vC,{command:h,prefix:i})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(S1,{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(Fn,{checked:h.enabled,"aria-label":`${m("thStatus")}: ${i}${h.name}`,onChange:w=>f.onToggleEnabled(h,w)})})}),s.jsx("td",{className:"px-3 py-2.5 text-end",children:s.jsx(Oe,{size:"md",variant:"ghost",label:m(b?"hideDetails":"details"),"aria-expanded":b,"aria-controls":x,icon:s.jsx(rl,{size:18,className:Ue("transition-transform",b&&"rotate-180")}),onClick:()=>d(y)})})]}),b&&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(w1,{command:h,prefix:i,levels:r,actions:f})})})]},y)})})]})})}const ib={status:"all",scope:"all",permission:"all"};function wC(a){let i=0;return a.status!=="all"&&(i+=1),a.scope!=="all"&&(i+=1),a.permission!=="all"&&(i+=1),i}function kC(a,i,r){var o,d,f,m;return!(i&&![a.name,...a.aliases||[],a.description,(o=a.descriptions)==null?void 0:o.en,(d=a.descriptions)==null?void 0:d.ar,a.usage,(f=a.usages)==null?void 0:f.en,(m=a.usages)==null?void 0:m.ar].filter(Boolean).join(" ").toLowerCase().includes(i)||r.status==="on"&&!a.enabled||r.status==="off"&&a.enabled||r.scope==="allChats"&&a.chat!=="all"||r.scope==="groups"&&a.chat!=="group"||r.scope==="private"&&a.chat!=="private"||r.scope==="groupSub"&&a.category!=="group"||r.scope==="general"&&a.category==="group"||r.permission==="overridden"&&!a.overridden||r.permission==="locked"&&!a.permissionLocked||r.permission!=="all"&&r.permission!=="overridden"&&r.permission!=="locked"&&a.permission!==r.permission)}function jC(a,i,r){const o=(f,m)=>r.compare(f.name,m.name),d=[...a];return i==="status"?d.sort((f,m)=>f.enabled===m.enabled?o(f,m):f.enabled?-1:1):d.sort(o),d}const NC=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],CC=["s1","s2","s3","s4","s5"],EC=()=>{const{t:a,language:i}=He(),{toast:r}=Et(),{permissionLabel:o}=Br(),[d,f]=v.useState([]),[m,p]=v.useState(NC),[h,y]=v.useState("!"),[b,x]=v.useState(!1),[w,C]=v.useState("!"),[k,j]=v.useState(""),[N,O]=v.useState(ib),[R,I]=v.useState("name"),[z,se]=v.useState(!0),[B,D]=v.useState(null),[T,F]=v.useState(null),[U,W]=v.useState(null),ee=v.useCallback(async()=>{se(!0);try{const V=await Y.getCommands();V!=null&&V.commands&&f(V.commands),V!=null&&V.prefix&&(y(V.prefix),C(V.prefix)),Array.isArray(V==null?void 0:V.levels)&&V.levels.length&&p(V.levels),D(null)}catch(V){D((V==null?void 0:V.message)||a("loadError")),r(V.message,"error")}finally{se(!1)}},[a,r]);v.useEffect(()=>{ee()},[ee]);const ue=async()=>{const V=w.trim();if(!V||V.length>3){r(a("prefixValidation"),"error");return}try{await Y.updatePrefix(V),y(V),x(!1),r(`${a("prefixUpdated")} (${V})`,"success")}catch(re){r(re.message,"error")}},ie=async(V,re)=>{f(te=>te.map(ce=>Pa(ce)===Pa(V)?{...ce,enabled:re,overridden:!0}:ce));try{await Y.updateCommand(V.name,{enabled:re}),r(a(re?"commandEnabled":"commandDisabled").replace("{name}",V.name),"success")}catch(te){r(te.message,"error"),ee()}},H=async(V,re)=>{await Y.updateCommand(V.name,{permission:re}),f(te=>te.map(ce=>Pa(ce)===Pa(V)?{...ce,permission:re,overridden:!0}:ce))},X=async V=>{try{await navigator.clipboard.writeText(V),r(a("copied"),"success")}catch{r(a("copyFailed"),"error")}},me=V=>{F(re=>re===V?null:V)},de=(V,re)=>{f(te=>te.map(ce=>Pa(ce)===Pa(V)?{...ce,aliases:re}:ce))},be=()=>{j(""),O(ib)},_=v.useMemo(()=>new Intl.Collator(i),[i]),J=k.trim().toLowerCase(),ye=v.useMemo(()=>jC(d.filter(V=>kC(V,J,N)),R,_),[d,J,N,R,_]),Se=wC(N),E=J.length>0||Se>0,Q={onToggleEnabled:(V,re)=>void ie(V,re),onEditAliases:V=>W(V),onSavePermission:H,onCopy:V=>void X(V)};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(ml,{icon:s.jsx(ul,{size:20}),title:a("commands"),description:a("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:[a("activePrefix"),":"]}),b?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Ke,{type:"text",technical:!0,maxLength:3,value:w,onChange:V=>C(V.target.value),className:"w-14 text-center font-mono",onKeyDown:V=>{V.key==="Enter"&&ue(),V.key==="Escape"&&x(!1)}}),s.jsx(fe,{variant:"primary",size:"sm",onClick:ue,children:a("save")}),s.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>x(!1),children:a("cancel")})]}):s.jsx(fe,{variant:"ghost",size:"sm",title:a("editPrefixHint"),onClick:()=>{C(h),x(!0)},children:s.jsx("span",{dir:"ltr",className:"font-mono",children:h})})]})}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(pl,{children:[s.jsxs("div",{className:"relative min-w-48 flex-1",children:[s.jsx(Pm,{size:18,className:"pointer-events-none absolute start-3.5 top-3 text-muted"}),s.jsx(Ke,{type:"search",value:k,onChange:V=>j(V.target.value),placeholder:a("searchPlaceholder"),"aria-label":a("searchPlaceholder"),className:"ps-10"})]}),s.jsx(Lr,{label:a("sort"),value:R,onChange:I,options:[{value:"name",label:a("sortByName")},{value:"status",label:a("sortStatus")}]}),s.jsxs(hl,{label:a("filter"),resetLabel:a("clearFilters"),activeCount:Se,onReset:be,children:[s.jsx(yn,{label:a("filterStatus"),name:"cmd-status",value:N.status,onChange:V=>O(re=>({...re,status:V})),options:[{value:"all",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(yn,{label:a("filterScope"),name:"cmd-scope",value:N.scope,onChange:V=>O(re=>({...re,scope:V})),options:[{value:"all",label:a("statusAny")},{value:"allChats",label:a("scopeAllChats")},{value:"groups",label:a("scopeGroupsOnly")},{value:"private",label:a("scopePrivateOnly")},{value:"groupSub",label:a("scopeGroupSub")},{value:"general",label:a("scopeGeneral")}]}),s.jsx(yn,{label:a("filterPermission"),name:"cmd-permission",value:N.permission,onChange:V=>O(re=>({...re,permission:V})),options:[{value:"all",label:a("statusAny")},...m.map(V=>({value:V,label:o(V)})),{value:"overridden",label:a("overriddenOnly")},{value:"locked",label:a("lockedOnly")}]})]})]}),!z&&!B&&s.jsx("p",{"aria-live":"polite",className:"text-xs text-muted",children:rn(a("resultCountOf"),{n:ye.length,total:d.length})})]}),z?s.jsx(Ye,{padded:!1,className:"overflow-hidden",children:s.jsx("div",{className:"divide-y divide-line/40","aria-busy":"true",children:CC.map(V=>s.jsxs("div",{className:"flex min-h-12 items-center gap-3 px-4 py-2.5",children:[s.jsx(It,{className:"h-4 w-28"}),s.jsx(It,{className:"ms-auto h-4 w-14"}),s.jsx(It,{className:"h-8 w-10"})]},V))})}):B&&d.length===0?s.jsx(ut,{kind:"error",description:B,action:s.jsx(fe,{variant:"primary",onClick:()=>void ee(),children:a("retryLoad")})}):d.length===0?s.jsx(ut,{kind:"empty"}):ye.length===0?s.jsx(ut,{kind:"no-results",description:a("noMatchingCommands"),action:E?s.jsx(fe,{variant:"secondary",onClick:be,children:a("clearFilters")}):void 0}):s.jsxs(Ye,{padded:!1,className:"overflow-hidden",children:[s.jsx("div",{className:"md:hidden",children:s.jsx(bC,{commands:ye,prefix:h,levels:m,expanded:T,onToggleDetails:me,actions:Q})}),s.jsx("div",{className:"hidden md:block",children:s.jsx(SC,{commands:ye,prefix:h,levels:m,expanded:T,onToggleDetails:me,actions:Q})})]}),s.jsx(yC,{command:U,prefix:h,onClose:()=>W(null),onSaved:de})]})};var ui={},Gf,rb;function AC(){return rb||(rb=1,Gf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Gf}var Vf={},Ss={},ob;function gl(){if(ob)return Ss;ob=1;let a;const i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Ss.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},Ss.getSymbolTotalCodewords=function(o){return i[o]},Ss.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},Ss.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');a=o},Ss.isKanjiModeEnabled=function(){return typeof a<"u"},Ss.toSJIS=function(o){return a(o)},Ss}var If={},cb;function sh(){return cb||(cb=1,(function(a){a.L={bit:1},a.M={bit:0},a.Q={bit:3},a.H={bit:2};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return a.L;case"m":case"medium":return a.M;case"q":case"quartile":return a.Q;case"h":case"high":return a.H;default:throw new Error("Unknown EC Level: "+r)}}a.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},a.from=function(o,d){if(a.isValid(o))return o;try{return i(o)}catch{return d}}})(If)),If}var Ff,ub;function _C(){if(ub)return Ff;ub=1;function a(){this.buffer=[],this.length=0}return a.prototype={get:function(i){const r=Math.floor(i/8);return(this.buffer[r]>>>7-i%8&1)===1},put:function(i,r){for(let o=0;o<r;o++)this.putBit((i>>>r-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),i&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Ff=a,Ff}var Kf,db;function TC(){if(db)return Kf;db=1;function a(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}return a.prototype.set=function(i,r,o,d){const f=i*this.size+r;this.data[f]=o,d&&(this.reservedBit[f]=!0)},a.prototype.get=function(i,r){return this.data[i*this.size+r]},a.prototype.xor=function(i,r,o){this.data[i*this.size+r]^=o},a.prototype.isReserved=function(i,r){return this.reservedBit[i*this.size+r]},Kf=a,Kf}var Yf={},fb;function DC(){return fb||(fb=1,(function(a){const i=gl().getSymbolSize;a.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()},a.getPositions=function(o){const d=[],f=a.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}})(Yf)),Yf}var Qf={},mb;function RC(){if(mb)return Qf;mb=1;const a=gl().getSymbolSize,i=7;return Qf.getPositions=function(o){const d=a(o);return[[0,0],[d-i,0],[0,d-i]]},Qf}var Xf={},hb;function zC(){return hb||(hb=1,(function(a){a.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};a.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},a.from=function(d){return a.isValid(d)?parseInt(d,10):void 0},a.getPenaltyN1=function(d){const f=d.size;let m=0,p=0,h=0,y=null,b=null;for(let x=0;x<f;x++){p=h=0,y=b=null;for(let w=0;w<f;w++){let C=d.get(x,w);C===y?p++:(p>=5&&(m+=i.N1+(p-5)),y=C,p=1),C=d.get(w,x),C===b?h++:(h>=5&&(m+=i.N1+(h-5)),b=C,h=1)}p>=5&&(m+=i.N1+(p-5)),h>=5&&(m+=i.N1+(h-5))}return m},a.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 y=d.get(p,h)+d.get(p,h+1)+d.get(p+1,h)+d.get(p+1,h+1);(y===4||y===0)&&m++}return m*i.N2},a.getPenaltyN3=function(d){const f=d.size;let m=0,p=0,h=0;for(let y=0;y<f;y++){p=h=0;for(let b=0;b<f;b++)p=p<<1&2047|d.get(y,b),b>=10&&(p===1488||p===93)&&m++,h=h<<1&2047|d.get(b,y),b>=10&&(h===1488||h===93)&&m++}return m*i.N3},a.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 a.Patterns.PATTERN000:return(d+f)%2===0;case a.Patterns.PATTERN001:return d%2===0;case a.Patterns.PATTERN010:return f%3===0;case a.Patterns.PATTERN011:return(d+f)%3===0;case a.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case a.Patterns.PATTERN101:return d*f%2+d*f%3===0;case a.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case a.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}a.applyMask=function(d,f){const 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))},a.getBestMask=function(d,f){const m=Object.keys(a.Patterns).length;let p=0,h=1/0;for(let y=0;y<m;y++){f(y),a.applyMask(y,d);const b=a.getPenaltyN1(d)+a.getPenaltyN2(d)+a.getPenaltyN3(d)+a.getPenaltyN4(d);a.applyMask(y,d),b<h&&(h=b,p=y)}return p}})(Xf)),Xf}var pc={},pb;function k1(){if(pb)return pc;pb=1;const a=sh(),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 pc.getBlocksCount=function(d,f){switch(f){case a.L:return i[(d-1)*4+0];case a.M:return i[(d-1)*4+1];case a.Q:return i[(d-1)*4+2];case a.H:return i[(d-1)*4+3];default:return}},pc.getTotalCodewordsCount=function(d,f){switch(f){case a.L:return r[(d-1)*4+0];case a.M:return r[(d-1)*4+1];case a.Q:return r[(d-1)*4+2];case a.H:return r[(d-1)*4+3];default:return}},pc}var Zf={},kr={},gb;function MC(){if(gb)return kr;gb=1;const a=new Uint8Array(512),i=new Uint8Array(256);return(function(){let o=1;for(let d=0;d<255;d++)a[d]=o,i[o]=d,o<<=1,o&256&&(o^=285);for(let d=255;d<512;d++)a[d]=a[d-255]})(),kr.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},kr.exp=function(o){return a[o]},kr.mul=function(o,d){return o===0||d===0?0:a[i[o]+i[d]]},kr}var xb;function OC(){return xb||(xb=1,(function(a){const i=MC();a.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},a.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},a.generateECPolynomial=function(o){let d=new Uint8Array([1]);for(let f=0;f<o;f++)d=a.mul(d,new Uint8Array([1,i.exp(f)]));return d}})(Zf)),Zf}var Jf,yb;function LC(){if(yb)return Jf;yb=1;const a=OC();function i(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(o){this.degree=o,this.genPoly=a.generateECPolynomial(this.degree)},i.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(o.length+this.degree);d.set(o);const f=a.mod(d,this.genPoly),m=this.degree-f.length;if(m>0){const p=new Uint8Array(this.degree);return p.set(f,m),p}return f},Jf=i,Jf}var $f={},Wf={},em={},bb;function j1(){return bb||(bb=1,em.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),em}var ba={},vb;function N1(){if(vb)return ba;vb=1;const a="[0-9]+",i="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
|
528
|
-
]))+`;ba.KANJI=new RegExp(r,"g"),ba.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ba.BYTE=new RegExp(o,"g"),ba.NUMERIC=new RegExp(a,"g"),ba.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+r+"$"),f=new RegExp("^"+a+"$"),m=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ba.testKanji=function(h){return d.test(h)},ba.testNumeric=function(h){return f.test(h)},ba.testAlphanumeric=function(h){return m.test(h)},ba}var Sb;function xl(){return Sb||(Sb=1,(function(a){const i=j1(),r=N1();a.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},a.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},a.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},a.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},a.MIXED={bit:-1},a.getCharCountIndicator=function(f,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]},a.getBestModeForData=function(f){return r.testNumeric(f)?a.NUMERIC:r.testAlphanumeric(f)?a.ALPHANUMERIC:r.testKanji(f)?a.KANJI:a.BYTE},a.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},a.isValid=function(f){return f&&f.bit&&f.ccBits};function o(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return a.NUMERIC;case"alphanumeric":return a.ALPHANUMERIC;case"kanji":return a.KANJI;case"byte":return a.BYTE;default:throw new Error("Unknown mode: "+d)}}a.from=function(f,m){if(a.isValid(f))return f;try{return o(f)}catch{return m}}})(Wf)),Wf}var wb;function BC(){return wb||(wb=1,(function(a){const i=gl(),r=k1(),o=sh(),d=xl(),f=j1(),m=7973,p=i.getBCHDigit(m);function h(w,C,k){for(let j=1;j<=40;j++)if(C<=a.getCapacity(j,k,w))return j}function y(w,C){return d.getCharCountIndicator(w,C)+4}function b(w,C){let k=0;return w.forEach(function(j){const N=y(j.mode,C);k+=N+j.getBitsLength()}),k}function x(w,C){for(let k=1;k<=40;k++)if(b(w,k)<=a.getCapacity(k,C,d.MIXED))return k}a.from=function(C,k){return f.isValid(C)?parseInt(C,10):k},a.getCapacity=function(C,k,j){if(!f.isValid(C))throw new Error("Invalid QR Code version");typeof j>"u"&&(j=d.BYTE);const N=i.getSymbolTotalCodewords(C),O=r.getTotalCodewordsCount(C,k),R=(N-O)*8;if(j===d.MIXED)return R;const I=R-y(j,C);switch(j){case d.NUMERIC:return Math.floor(I/10*3);case d.ALPHANUMERIC:return Math.floor(I/11*2);case d.KANJI:return Math.floor(I/13);case d.BYTE:default:return Math.floor(I/8)}},a.getBestVersionForData=function(C,k){let j;const N=o.from(k,o.M);if(Array.isArray(C)){if(C.length>1)return x(C,N);if(C.length===0)return 1;j=C[0]}else j=C;return h(j.mode,j.getLength(),N)},a.getEncodedBits=function(C){if(!f.isValid(C)||C<7)throw new Error("Invalid QR Code version");let k=C<<12;for(;i.getBCHDigit(k)-p>=0;)k^=m<<i.getBCHDigit(k)-p;return C<<12|k}})($f)),$f}var tm={},kb;function UC(){if(kb)return tm;kb=1;const a=gl(),i=1335,r=21522,o=a.getBCHDigit(i);return tm.getEncodedBits=function(f,m){const p=f.bit<<3|m;let h=p<<10;for(;a.getBCHDigit(h)-o>=0;)h^=i<<a.getBCHDigit(h)-o;return(p<<10|h)^r},tm}var nm={},am,jb;function HC(){if(jb)return am;jb=1;const a=xl();function i(r){this.mode=a.NUMERIC,this.data=r.toString()}return i.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let d,f,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))},am=i,am}var sm,Nb;function qC(){if(Nb)return sm;Nb=1;const a=xl(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(o){this.mode=a.ALPHANUMERIC,this.data=o}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let f;for(f=0;f+2<=this.data.length;f+=2){let 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)},sm=r,sm}var lm,Cb;function PC(){if(Cb)return lm;Cb=1;const a=xl();function i(r){this.mode=a.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return i.getBitsLength=function(o){return o*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){for(let o=0,d=this.data.length;o<d;o++)r.put(this.data[o],8)},lm=i,lm}var im,Eb;function GC(){if(Eb)return im;Eb=1;const a=xl(),i=gl();function r(o){this.mode=a.KANJI,this.data=o}return r.getBitsLength=function(d){return d*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let d;for(d=0;d<this.data.length;d++){let f=i.toSJIS(this.data[d]);if(f>=33088&&f<=40956)f-=33088;else if(f>=57408&&f<=60351)f-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+`
|
|
529
|
-
Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},im=r,im}var rm={exports:{}},Ab;function VC(){return Ab||(Ab=1,(function(a){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,y,b,x,w,C,k,j,N;!p.empty();){h=p.pop(),y=h.value,x=h.cost,w=r[y]||{};for(b in w)w.hasOwnProperty(b)&&(C=w[b],k=x+C,j=m[b],N=typeof m[b]>"u",(N||j>k)&&(m[b]=k,p.push(b,k),f[b]=y))}if(typeof d<"u"&&typeof m[d]>"u"){var O=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(O)}return f},extract_shortest_path_from_predecessor_list:function(r,o){for(var d=[],f=o;f;)d.push(f),r[f],f=r[f];return d.reverse(),d},find_path:function(r,o,d){var f=i.single_source_shortest_paths(r,o,d);return i.extract_shortest_path_from_predecessor_list(f,d)},PriorityQueue:{make:function(r){var o=i.PriorityQueue,d={},f;r=r||{};for(f in o)o.hasOwnProperty(f)&&(d[f]=o[f]);return d.queue=[],d.sorter=r.sorter||o.default_sorter,d},default_sorter:function(r,o){return r.cost-o.cost},push:function(r,o){var d={value:r,cost:o};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};a.exports=i})(rm)),rm.exports}var _b;function IC(){return _b||(_b=1,(function(a){const i=xl(),r=HC(),o=qC(),d=PC(),f=GC(),m=N1(),p=gl(),h=VC();function y(O){return unescape(encodeURIComponent(O)).length}function b(O,R,I){const z=[];let se;for(;(se=O.exec(I))!==null;)z.push({data:se[0],index:se.index,mode:R,length:se[0].length});return z}function x(O){const R=b(m.NUMERIC,i.NUMERIC,O),I=b(m.ALPHANUMERIC,i.ALPHANUMERIC,O);let z,se;return p.isKanjiModeEnabled()?(z=b(m.BYTE,i.BYTE,O),se=b(m.KANJI,i.KANJI,O)):(z=b(m.BYTE_KANJI,i.BYTE,O),se=[]),R.concat(I,z,se).sort(function(D,T){return D.index-T.index}).map(function(D){return{data:D.data,mode:D.mode,length:D.length}})}function w(O,R){switch(R){case i.NUMERIC:return r.getBitsLength(O);case i.ALPHANUMERIC:return o.getBitsLength(O);case i.KANJI:return f.getBitsLength(O);case i.BYTE:return d.getBitsLength(O)}}function C(O){return O.reduce(function(R,I){const z=R.length-1>=0?R[R.length-1]:null;return z&&z.mode===I.mode?(R[R.length-1].data+=I.data,R):(R.push(I),R)},[])}function k(O){const R=[];for(let I=0;I<O.length;I++){const z=O[I];switch(z.mode){case i.NUMERIC:R.push([z,{data:z.data,mode:i.ALPHANUMERIC,length:z.length},{data:z.data,mode:i.BYTE,length:z.length}]);break;case i.ALPHANUMERIC:R.push([z,{data:z.data,mode:i.BYTE,length:z.length}]);break;case i.KANJI:R.push([z,{data:z.data,mode:i.BYTE,length:y(z.data)}]);break;case i.BYTE:R.push([{data:z.data,mode:i.BYTE,length:y(z.data)}])}}return R}function j(O,R){const I={},z={start:{}};let se=["start"];for(let B=0;B<O.length;B++){const D=O[B],T=[];for(let F=0;F<D.length;F++){const U=D[F],W=""+B+F;T.push(W),I[W]={node:U,lastCount:0},z[W]={};for(let ee=0;ee<se.length;ee++){const ue=se[ee];I[ue]&&I[ue].node.mode===U.mode?(z[ue][W]=w(I[ue].lastCount+U.length,U.mode)-w(I[ue].lastCount,U.mode),I[ue].lastCount+=U.length):(I[ue]&&(I[ue].lastCount=U.length),z[ue][W]=w(U.length,U.mode)+4+i.getCharCountIndicator(U.mode,R))}}se=T}for(let B=0;B<se.length;B++)z[se[B]].end=0;return{map:z,table:I}}function N(O,R){let I;const z=i.getBestModeForData(O);if(I=i.from(R,z),I!==i.BYTE&&I.bit<z.bit)throw new Error('"'+O+'" cannot be encoded with mode '+i.toString(I)+`.
|
|
530
|
-
Suggested mode is: `+i.toString(z));switch(I===i.KANJI&&!p.isKanjiModeEnabled()&&(I=i.BYTE),I){case i.NUMERIC:return new r(O);case i.ALPHANUMERIC:return new o(O);case i.KANJI:return new f(O);case i.BYTE:return new d(O)}}a.fromArray=function(R){return R.reduce(function(I,z){return typeof z=="string"?I.push(N(z,null)):z.data&&I.push(N(z.data,z.mode)),I},[])},a.fromString=function(R,I){const z=x(R,p.isKanjiModeEnabled()),se=k(z),B=j(se,I),D=h.find_path(B.map,"start","end"),T=[];for(let F=1;F<D.length-1;F++)T.push(B.table[D[F]].node);return a.fromArray(C(T))},a.rawSplit=function(R){return a.fromArray(x(R,p.isKanjiModeEnabled()))}})(nm)),nm}var Tb;function FC(){if(Tb)return Vf;Tb=1;const a=gl(),i=sh(),r=_C(),o=TC(),d=DC(),f=RC(),m=zC(),p=k1(),h=LC(),y=BC(),b=UC(),x=xl(),w=IC();function C(B,D){const T=B.size,F=f.getPositions(D);for(let U=0;U<F.length;U++){const W=F[U][0],ee=F[U][1];for(let ue=-1;ue<=7;ue++)if(!(W+ue<=-1||T<=W+ue))for(let ie=-1;ie<=7;ie++)ee+ie<=-1||T<=ee+ie||(ue>=0&&ue<=6&&(ie===0||ie===6)||ie>=0&&ie<=6&&(ue===0||ue===6)||ue>=2&&ue<=4&&ie>=2&&ie<=4?B.set(W+ue,ee+ie,!0,!0):B.set(W+ue,ee+ie,!1,!0))}}function k(B){const D=B.size;for(let T=8;T<D-8;T++){const F=T%2===0;B.set(T,6,F,!0),B.set(6,T,F,!0)}}function j(B,D){const T=d.getPositions(D);for(let F=0;F<T.length;F++){const U=T[F][0],W=T[F][1];for(let ee=-2;ee<=2;ee++)for(let ue=-2;ue<=2;ue++)ee===-2||ee===2||ue===-2||ue===2||ee===0&&ue===0?B.set(U+ee,W+ue,!0,!0):B.set(U+ee,W+ue,!1,!0)}}function N(B,D){const T=B.size,F=y.getEncodedBits(D);let U,W,ee;for(let ue=0;ue<18;ue++)U=Math.floor(ue/3),W=ue%3+T-8-3,ee=(F>>ue&1)===1,B.set(U,W,ee,!0),B.set(W,U,ee,!0)}function O(B,D,T){const F=B.size,U=b.getEncodedBits(D,T);let W,ee;for(W=0;W<15;W++)ee=(U>>W&1)===1,W<6?B.set(W,8,ee,!0):W<8?B.set(W+1,8,ee,!0):B.set(F-15+W,8,ee,!0),W<8?B.set(8,F-W-1,ee,!0):W<9?B.set(8,15-W-1+1,ee,!0):B.set(8,15-W-1,ee,!0);B.set(F-8,8,1,!0)}function R(B,D){const T=B.size;let F=-1,U=T-1,W=7,ee=0;for(let ue=T-1;ue>0;ue-=2)for(ue===6&&ue--;;){for(let ie=0;ie<2;ie++)if(!B.isReserved(U,ue-ie)){let H=!1;ee<D.length&&(H=(D[ee]>>>W&1)===1),B.set(U,ue-ie,H),W--,W===-1&&(ee++,W=7)}if(U+=F,U<0||T<=U){U-=F,F=-F;break}}}function I(B,D,T){const F=new r;T.forEach(function(ie){F.put(ie.mode.bit,4),F.put(ie.getLength(),x.getCharCountIndicator(ie.mode,B)),ie.write(F)});const U=a.getSymbolTotalCodewords(B),W=p.getTotalCodewordsCount(B,D),ee=(U-W)*8;for(F.getLengthInBits()+4<=ee&&F.put(0,4);F.getLengthInBits()%8!==0;)F.putBit(0);const ue=(ee-F.getLengthInBits())/8;for(let ie=0;ie<ue;ie++)F.put(ie%2?17:236,8);return z(F,B,D)}function z(B,D,T){const F=a.getSymbolTotalCodewords(D),U=p.getTotalCodewordsCount(D,T),W=F-U,ee=p.getBlocksCount(D,T),ue=F%ee,ie=ee-ue,H=Math.floor(F/ee),X=Math.floor(W/ee),me=X+1,de=H-X,be=new h(de);let _=0;const J=new Array(ee),ye=new Array(ee);let Se=0;const E=new Uint8Array(B.buffer);for(let ce=0;ce<ee;ce++){const he=ce<ie?X:me;J[ce]=E.slice(_,_+he),ye[ce]=be.encode(J[ce]),_+=he,Se=Math.max(Se,he)}const Q=new Uint8Array(F);let V=0,re,te;for(re=0;re<Se;re++)for(te=0;te<ee;te++)re<J[te].length&&(Q[V++]=J[te][re]);for(re=0;re<de;re++)for(te=0;te<ee;te++)Q[V++]=ye[te][re];return Q}function se(B,D,T,F){let U;if(Array.isArray(B))U=w.fromArray(B);else if(typeof B=="string"){let H=D;if(!H){const X=w.rawSplit(B);H=y.getBestVersionForData(X,T)}U=w.fromString(B,H||40)}else throw new Error("Invalid data");const W=y.getBestVersionForData(U,T);if(!W)throw new Error("The amount of data is too big to be stored in a QR Code");if(!D)D=W;else if(D<W)throw new Error(`
|
|
531
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
532
|
-
Minimum version required to store current data is: `+W+`.
|
|
533
|
-
`);const ee=I(D,T,U),ue=a.getSymbolSize(D),ie=new o(ue);return C(ie,D),k(ie),j(ie,D),O(ie,T,0),D>=7&&N(ie,D),R(ie,ee),isNaN(F)&&(F=m.getBestMask(ie,O.bind(null,ie,T))),m.applyMask(F,ie),O(ie,T,F),{modules:ie,version:D,errorCorrectionLevel:T,maskPattern:F,segments:U}}return Vf.create=function(D,T){if(typeof D>"u"||D==="")throw new Error("No input text");let F=i.M,U,W;return typeof T<"u"&&(F=i.from(T.errorCorrectionLevel,i.M),U=y.from(T.version),W=m.from(T.maskPattern),T.toSJISFunc&&a.setToSJISFunction(T.toSJISFunc)),se(D,U,F,W)},Vf}var om={},cm={},Db;function C1(){return Db||(Db=1,(function(a){function i(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(f){return[f,f]}))),o.length===6&&o.push("F","F");const d=parseInt(o.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+o.slice(0,6).join("")}}a.getOptions=function(o){o||(o={}),o.color||(o.color={});const d=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,f=o.width&&o.width>=21?o.width:void 0,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||{}}},a.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},a.getImageWidth=function(o,d){const f=a.getScale(o,d);return Math.floor((o+d.margin*2)*f)},a.qrToImageData=function(o,d,f){const m=d.modules.size,p=d.modules.data,h=a.getScale(m,f),y=Math.floor((m+f.margin*2)*h),b=f.margin*h,x=[f.color.light,f.color.dark];for(let w=0;w<y;w++)for(let C=0;C<y;C++){let k=(w*y+C)*4,j=f.color.light;if(w>=b&&C>=b&&w<y-b&&C<y-b){const N=Math.floor((w-b)/h),O=Math.floor((C-b)/h);j=x[p[N*m+O]?1:0]}o[k++]=j.r,o[k++]=j.g,o[k++]=j.b,o[k]=j.a}}})(cm)),cm}var Rb;function KC(){return Rb||(Rb=1,(function(a){const i=C1();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")}}a.render=function(f,m,p){let h=p,y=m;typeof h>"u"&&(!m||!m.getContext)&&(h=m,m=void 0),m||(y=o()),h=i.getOptions(h);const b=i.getImageWidth(f.modules.size,h),x=y.getContext("2d"),w=x.createImageData(b,b);return i.qrToImageData(w.data,f,h),r(x,y,b),x.putImageData(w,0,0),y},a.renderToDataURL=function(f,m,p){let h=p;typeof h>"u"&&(!m||!m.getContext)&&(h=m,m=void 0),h||(h={});const y=a.render(f,m,h),b=h.type||"image/png",x=h.rendererOpts||{};return y.toDataURL(b,x.quality)}})(om)),om}var um={},zb;function YC(){if(zb)return um;zb=1;const a=C1();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,y=!1,b=0;for(let x=0;x<d.length;x++){const w=Math.floor(x%f),C=Math.floor(x/f);!w&&!y&&(y=!0),d[x]?(b++,x>0&&w>0&&d[x-1]||(p+=y?r("M",w+m,.5+C+m):r("m",h,0),h=0,y=!1),w+1<f&&d[x+1]||(p+=r("h",b),b=0)):h++}return p}return um.render=function(f,m,p){const h=a.getOptions(m),y=f.modules.size,b=f.modules.data,x=y+h.margin*2,w=h.color.light.a?"<path "+i(h.color.light,"fill")+' d="M0 0h'+x+"v"+x+'H0z"/>':"",C="<path "+i(h.color.dark,"stroke")+' d="'+o(b,y,h.margin)+'"/>',k='viewBox="0 0 '+x+" "+x+'"',N='<svg xmlns="http://www.w3.org/2000/svg" '+(h.width?'width="'+h.width+'" height="'+h.width+'" ':"")+k+' shape-rendering="crispEdges">'+w+C+`</svg>
|
|
534
|
-
`;return typeof p=="function"&&p(null,N),N},um}var Mb;function QC(){if(Mb)return ui;Mb=1;const a=AC(),i=FC(),r=KC(),o=YC();function d(f,m,p,h,y){const b=[].slice.call(arguments,1),x=b.length,w=typeof b[x-1]=="function";if(!w&&!a())throw new Error("Callback required as last argument");if(w){if(x<2)throw new Error("Too few arguments provided");x===2?(y=p,p=m,m=h=void 0):x===3&&(m.getContext&&typeof y>"u"?(y=h,h=void 0):(y=h,h=p,p=m,m=void 0))}else{if(x<1)throw new Error("Too few arguments provided");return x===1?(p=m,m=h=void 0):x===2&&!m.getContext&&(h=p,p=m,m=void 0),new Promise(function(C,k){try{const j=i.create(p,h);C(f(j,m,h))}catch(j){k(j)}})}try{const C=i.create(p,h);y(null,f(C,m,h))}catch(C){y(C)}}return ui.create=i.create,ui.toCanvas=d.bind(null,r.render),ui.toDataURL=d.bind(null,r.renderToDataURL),ui.toString=d.bind(null,function(f,m,p){return o.render(f,p)}),ui}var E1=QC();const dm=Um(E1);function XC(){return typeof window<"u"&&!!window.LevixHost}const ZC=({status:a,onRefresh:i,onStatusUpdate:r})=>{var te;const{t:o,language:d}=He(),{toast:f}=Et(),[m,p]=v.useState(!1),[h,y]=v.useState(!1),[b,x]=v.useState(null),[w,C]=v.useState("pairing"),[k,j]=v.useState(""),[N,O]=v.useState(!1),R=(a==null?void 0:a.state)||"idle",I=R==="connected",z=R==="waiting_for_qr",se=R==="starting"||R==="linking",B=R==="reconnecting",D=R==="paused",T=R==="logged_out",F=!!(a!=null&&a.linked)&&!T,U=!F,W=!!(a!=null&&a.canUnlink),ee=(a==null?void 0:a.isOnline)!==!1,ue=D||R==="disconnected"||R==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";v.useEffect(()=>{if(a!=null&&a.qr){const ce=E1.toDataURL||(dm==null?void 0:dm.toDataURL);if(typeof ce=="function"){const he=getComputedStyle(document.documentElement),oe=document.documentElement.getAttribute("data-theme")==="light",we=(oe?he.getPropertyValue("--text"):he.getPropertyValue("--bg")).trim(),qe=(oe?he.getPropertyValue("--panel"):he.getPropertyValue("--text")).trim();ce(a.qr,{width:280,margin:2,color:{dark:we,light:qe}}).then(lt=>x(lt)).catch(()=>x(null))}}else x(null)},[a==null?void 0:a.qr]),v.useEffect(()=>{if(z&&!(a!=null&&a.qr)&&!(a!=null&&a.pairingCode)){const ce=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(ce)}},[z,a==null?void 0:a.qr,a==null?void 0:a.pairingCode,i]);const ie=async(ce,he)=>{y(!0);try{const oe=await ce();oe&&typeof oe=="object"&&"session"in oe&&(r==null||r(oe.session)),f(he,"success"),await(i==null?void 0:i())}catch(oe){f(oe instanceof Error?oe.message:String(oe),"error")}finally{y(!1)}},H=async ce=>{ce&&ce.preventDefault();const he=k.replace(/\D/g,"");if(!he){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(he.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await ie(()=>Y.startSession({method:"pairing",phone:he}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},X=async()=>{await ie(()=>Y.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},me=async()=>{await ie(Y.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),C("pairing")},de=()=>{a!=null&&a.pairingCode&&(navigator.clipboard.writeText(a.pairingCode.replace(/\s+/g,"")),O(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>O(!1),2500))},be=async()=>{p(!1),await ie(Y.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},_=(te=a==null?void 0:a.user)!=null&&te.id?a.user.id.split("@")[0].split(":")[0]:null,J=XC(),ye={key:"unlink",label:o("unlink"),icon:s.jsx(Dk,{size:16}),danger:!0,onSelect:()=>p(!0)},Se={key:"restart",label:o("restart"),icon:s.jsx(cl,{size:16}),onSelect:()=>ie(Y.restartBot,o("restart"))},E={key:"reconnect",label:o("reconnect"),icon:s.jsx(Va,{size:16}),onSelect:()=>ie(Y.reconnectSession,o("reconnecting"))},Q=ce=>J?ce:[...ce,Se],V=Q(W?[ye]:[]),re=ce=>{if(ce.length===0)return null;if(ce.length===1){const he=ce[0];return s.jsx(Oe,{label:he.label,icon:he.icon,onClick:he.onSelect,disabled:h})}return s.jsx(aa,{label:o("moreActions"),children:ce.map(he=>s.jsx(st,{danger:he.danger,icon:he.icon,disabled:h,onSelect:he.onSelect,children:he.label},he.key))})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs(Ye,{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 ${I?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":z?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":se||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(Rr,{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:I?o("sessionActive"):D?o("paused"):F?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 ${I?"bg-ok/15 text-ok border-ok/30":z?"bg-warn/15 text-warn border-warn/30":se||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(R,R)})]})})]}),a!=null&&a.retryInSeconds?s.jsxs("div",{className:"rounded-xl border border-warn/30 bg-warn/10 p-3.5 flex items-center gap-3 text-warn",children:[s.jsx(al,{size:20,className:"shrink-0"}),s.jsxs("div",{className:"text-xs sm:text-sm",children:[s.jsx("span",{className:"font-bold",children:d==="ar"?"إعادة الاتصال قريباً":"Reconnecting soon"})," ","•"," ",s.jsx("span",{children:d==="ar"?`المحاولة التالية خلال ${a.retryInSeconds} ثانية`:`Next attempt in ${a.retryInSeconds}s`})]})]}):null,I&&_&&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(ws,{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:["+",_]})]})]}),s.jsx(bc,{tone:"ok",className:"shrink-0",children:d==="ar"?"متصل":"Online"})]}),s.jsxs("div",{children:[I&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(fe,{variant:"danger",icon:s.jsx(km,{size:16}),onClick:()=>ie(Y.stopSession,o("stop")),disabled:h,className:"flex-1 sm:flex-none",children:o("stop")}),re(Q([E,ye]))]}),(se||z||B)&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(fe,{variant:"danger",icon:s.jsx(km,{size:16}),onClick:()=>ie(Y.stopSession,o("stop")),disabled:h,className:"flex-1 sm:flex-none",children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"}),re(Q([]))]}),!I&&!se&&!z&&!B&&F&&s.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xl",children:[D&&s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:ee?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(fe,{variant:"primary",icon:s.jsx(Rr,{size:16}),onClick:()=>ie(Y.startSession,ue),disabled:h,className:"flex-1 sm:flex-none",children:ue}),re(V)]})]}),!I&&!se&&!z&&!B&&U&&s.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[s.jsx(js,{"aria-label":o("connection"),value:w,onChange:C,className:"w-full sm:w-fit",options:[{value:"pairing",label:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)",icon:s.jsx(Er,{size:16})},{value:"qr",label:d==="ar"?"مسح رمز QR":"QR Code Scan",icon:s.jsx(Rf,{size:16})}]}),w==="pairing"&&s.jsxs("form",{onSubmit:H,className:"flex w-full max-w-xl flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(jk,{size:17,className:"absolute top-1/2 -translate-y-1/2 start-3.5 text-muted pointer-events-none"}),s.jsx(Ke,{type:"tel",value:k,onChange:ce=>j(ce.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(fe,{type:"submit",variant:"primary",icon:s.jsx(Sm,{size:16}),disabled:h,className:"flex-1 whitespace-nowrap sm:flex-none",children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"}),re(V)]}),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."})]}),w==="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(fe,{variant:"primary",icon:s.jsx(Rf,{size:18}),onClick:X,disabled:h,className:"flex-1 whitespace-nowrap sm:flex-none",children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"}),re(V)]}),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."})]})]})]})]}),se&&s.jsxs(Ye,{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(Va,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children:R==="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."})]}),z&&s.jsx(Ye,{className:"mx-auto flex w-full max-w-2xl flex-col items-center text-center",children:a!=null&&a.pairingCode?s.jsxs("div",{className:"flex flex-col items-center w-full animate-in fade-in zoom-in-95 duration-300",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(Er,{size:26})}),s.jsx("h3",{className:"text-lg sm:text-xl font-bold text-text-main mb-1.5",children:d==="ar"?"كود الربط الرقمي مع واتساب":"WhatsApp Pairing Code"}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"أدخل هذا الكود في تطبيق واتساب على هاتفك لتأكيد الربط مباشرة.":"Enter this code into WhatsApp on your phone to complete pairing."}),s.jsxs("div",{className:"rounded-2xl border-2 border-brand-cyan/40 bg-brand-cyan/10 p-5 sm:p-6 w-full max-w-md flex flex-col items-center gap-4 shadow-lg shadow-brand-cyan/10",children:[s.jsx("div",{className:"text-xs font-bold text-brand-cyan uppercase tracking-wider",children:d==="ar"?"كود الربط المكون من 8 خانات":"8-Digit Pairing Code"}),s.jsx("div",{className:"text-3xl sm:text-4xl font-mono font-extrabold tracking-widest text-brand-cyan select-all",dir:"ltr",children:a.pairingCode.length===8?`${a.pairingCode.slice(0,4)} - ${a.pairingCode.slice(4)}`:a.pairingCode}),s.jsx(fe,{variant:"primary",icon:N?s.jsx(mi,{size:18}):s.jsx(f0,{size:18}),onClick:de,children:N?d==="ar"?"تم النسخ بنجاح!":"Copied!":d==="ar"?"نسخ كود الربط":"Copy Code"})]}),s.jsxs("div",{className:"mt-6 p-4 rounded-xl border border-line bg-panel-raised text-start w-full max-w-md",children:[s.jsx("div",{className:"text-xs font-bold text-text-main mb-3",children:d==="ar"?"خطوات الإدخال في واتساب:":"Steps to enter in WhatsApp:"}),s.jsxs("ol",{className:"text-xs text-muted space-y-2 list-decimal list-inside leading-relaxed",children:[s.jsx("li",{children:d==="ar"?"افتح تطبيق واتساب على هاتفك.":"Open WhatsApp on your phone."}),s.jsx("li",{children:d==="ar"?"اذهب إلى الإعدادات > الأجهزة المرتبطة > ربط جهاز.":"Go to Settings > Linked Devices > Link a Device."}),s.jsx("li",{children:s.jsx("strong",{className:"text-text-main",children:d==="ar"?"اضغط على «الربط باستخدام رقم الهاتف بدلاً من ذلك» أسفل الشاشة.":"Tap 'Link with phone number instead' at bottom of screen."})}),s.jsx("li",{children:d==="ar"?"اكتب هذا الكود وسيتم ربط البوت مباشرة!":"Enter the code above to connect immediately!"})]})]})]}):b?s.jsxs("div",{className:"flex flex-col items-center w-full",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(Rf,{size:26})}),s.jsx("h3",{className:"text-lg font-bold text-text-main mb-1.5",children:o("waiting_for_qr")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"افتح واتساب على هاتفك، اذهب إلى الأجهزة المرتبطة، ثم امسح هذا الرمز للربط.":"Open WhatsApp on your phone, go to Linked Devices, and scan this code to link."}),s.jsx("div",{className:"p-3 sm:p-4 bg-panel rounded-2xl shadow-xl border border-line animate-in fade-in zoom-in-95 duration-300",children:s.jsx("img",{src:b,alt:"WhatsApp QR Code",className:"w-56 h-56 sm:w-64 sm:h-64 block rounded-lg"})}),s.jsxs("div",{className:"mt-6 pt-5 border-t border-line w-full max-w-md flex flex-col items-center gap-2.5",children:[s.jsx("p",{className:"text-xs text-muted text-center",children:d==="ar"?"هل تستخدم التطبيق من نفس الهاتف ولا تستطيع مسح الرمز؟":"Using the app on the same phone and can't scan?"}),s.jsx(fe,{variant:"secondary",icon:s.jsx(Er,{size:16}),onClick:me,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(Ga,{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(fe,{variant:"secondary",onClick:()=>p(!1),children:o("cancel")}),s.jsx(fe,{variant:"danger",onClick:be,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")})]})]})},fm={antilink:"any",welcome:"any",media:"any"};function JC(a,i,r){const o=i.trim().toLowerCase();if(o&&!`${a.subject||""} ${a.jid}`.toLowerCase().includes(o))return!1;const d=!!a.antilink.enabled;if(r.antilink==="on"&&!d||r.antilink==="off"&&d)return!1;const f=!!a.welcomeEnabled;return!(r.welcome==="on"&&!f||r.welcome==="off"&&f||r.media!=="any"&&(a.mediaRestriction||"none")!==r.media)}const $C=()=>{const{t:a,language:i}=He(),{toast:r}=Et(),[o,d]=v.useState([]),[f,m]=v.useState(!0),[p,h]=v.useState(null),[y,b]=v.useState(0),[x,w]=v.useState(""),[C,k]=v.useState("name"),[j,N]=v.useState(fm),[O,R]=v.useState([]),[I,z]=v.useState("!"),se=v.useRef(new Set),[B,D]=v.useState(new Set),T=v.useCallback(async()=>{m(!0);try{const _=await Y.getGroups();_!=null&&_.groups&&d(_.groups),h(null)}catch(_){h(_.message),r(_.message,"error")}finally{m(!1)}},[r]);v.useEffect(()=>{T()},[y,T]),v.useEffect(()=>{let _=!0;return Y.getCommands().then(J=>{_&&(R(J.commands.filter(ye=>ye.chat==="group")),z(J.prefix||"!"))}).catch(()=>{}),()=>{_=!1}},[]);const F=async(_,J)=>{if(se.current.has(_))throw new Error(a("saving"));se.current.add(_),D(new Set(se.current));try{const ye=await Y.updateGroup(_,J);d(Se=>Se.map(E=>E.jid===_?ye.group:E)),r(a("savedSuccessfully"),"success")}catch(ye){throw r(ye.message,"error"),ye}finally{se.current.delete(_),D(new Set(se.current))}},U=v.useMemo(()=>{const _=o.filter(J=>JC(J,x,j));return _.sort((J,ye)=>{const Se=(J.subject||J.jid).localeCompare(ye.subject||ye.jid,i,{sensitivity:"base"});return C==="members"&&(ye.memberCount||0)-(J.memberCount||0)||Se}),_},[o,x,j,C,i]),W=`${x}|${C}|${j.antilink}|${j.welcome}|${j.media}`,{page:ee,pageCount:ue,pageItems:ie,setPage:H,total:X}=Vc(U,20,W),me=(j.antilink!=="any"?1:0)+(j.welcome!=="any"?1:0)+(j.media!=="any"?1:0),de=()=>{w(""),N(fm)},be=!f&&!p&&o.length>0;return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(ml,{icon:s.jsx(ll,{size:24}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[a("groups"),s.jsx($e,{tone:"info",children:rn(a("groupsCount"),{n:o.length})})]}),description:a("groupsSubtitle")}),be&&s.jsxs(pl,{children:[s.jsx(Ke,{type:"search",name:"group-search",autoComplete:"off",value:x,onChange:_=>w(_.target.value),placeholder:a("searchGroups"),"aria-label":a("searchGroups"),className:"min-w-48 flex-1"}),s.jsx(Lr,{label:a("sort"),value:C,onChange:k,options:[{value:"name",label:a("sortByName")},{value:"members",label:a("sortByMembers")}]}),s.jsxs(hl,{label:a("filter"),resetLabel:a("reset"),activeCount:me,onReset:()=>N(fm),children:[s.jsx(yn,{label:a("thAntiLink"),name:"group-antilink",value:j.antilink,onChange:_=>N(J=>({...J,antilink:_})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(yn,{label:a("thWelcome"),name:"group-welcome",value:j.welcome,onChange:_=>N(J=>({...J,welcome:_})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(yn,{label:a("thMedia"),name:"group-media",value:j.media,onChange:_=>N(J=>({...J,media:_})),options:[{value:"any",label:a("statusAny")},{value:"none",label:a("mediaNone")},{value:"block_all",label:a("mediaBlockAll")},{value:"custom",label:a("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(_=>s.jsxs(Ye,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(It,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(It,{className:"h-5 w-40"}),s.jsx(It,{className:"h-4 w-28"})]})]}),s.jsx(It,{className:"h-10 w-full"}),s.jsx(It,{className:"h-10 w-full"})]},_))}),!f&&p&&s.jsx(ut,{kind:"error",icon:s.jsx(Uy,{size:28}),description:p,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(cl,{size:16}),onClick:()=>b(_=>_+1),children:a("retryLoad")})}),!f&&!p&&o.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(Uy,{size:28}),title:a("noGroupsTitle"),description:a("noGroupsBody")}),!f&&!p&&o.length>0&&U.length===0&&s.jsx(ut,{kind:"no-results",action:s.jsx(fe,{variant:"secondary",onClick:de,children:a("clearFilters")})}),!f&&!p&&U.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 items-start gap-3 xl:grid-cols-2",children:ie.map(_=>s.jsx(Jv,{summary:s.jsxs("span",{className:"flex items-center gap-3",children:[s.jsx(Lk,{src:`/dashboard/api/groups/${encodeURIComponent(_.jid)}/photo`,name:_.subject||a("unnamedGroup")}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(An,{lines:2,className:"block font-bold text-text-main",children:_.subject||a("unnamedGroup")}),s.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5",children:[s.jsxs($e,{children:[_.memberCount??"—"," ",a("thMembers")]}),_.antilink.enabled&&s.jsx($e,{tone:"info",children:a("thAntiLink")}),_.antispam.enabled&&s.jsx($e,{tone:"ok",children:a("antiSpam")})]})]})]}),children:s.jsx(WC,{group:_,pending:B.has(_.jid),onSave:J=>F(_.jid,J),commands:O,prefix:I})},_.jid))}),s.jsx(vi,{page:ee,pageCount:ue,total:X,onPageChange:H})]})]})};function WC({group:a,pending:i,onSave:r,commands:o,prefix:d}){const{t:f,language:m}=He(),{permissionLabel:p}=Br(),h=Mc({linkMode:a.antilink.mode,domains:a.antilink.allowed_domains.join(`
|
|
535
|
-
`),spamWindow:a.antispam.time_window,spamLimit:a.antispam.message_count,spamAction:a.antispam.action,warningLimit:a.warn_system.max_warnings,warningAction:a.warn_system.action,rules:a.rules,welcome:a.welcome_system.messages.join(`
|
|
536
|
-
`)}),y=x=>{r(x).catch(()=>{})},b=(x,w,C)=>s.jsx(Fn,{label:x,checked:w,disabled:i,onChange:k=>y(C(k))});return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx("p",{className:"text-xs text-muted",children:f("botAdminHint")}),b(f("thAntiLink"),a.antilink.enabled,x=>({antilink:{...a.antilink,enabled:x}})),b(f("antiSpam"),a.antispam.enabled,x=>({antispam:{...a.antispam,enabled:x}})),b(f("thWelcome"),a.welcome_system.enabled,x=>({welcome_system:{...a.welcome_system,enabled:x}})),b(f("autoApprove"),a.join_requests.auto_approve_enabled,x=>({join_requests:{auto_approve_enabled:x}})),s.jsx(Fy,{title:f("thMedia"),children: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(([x,w])=>s.jsx(Fn,{label:f(w),disabled:i,checked:a.media_control.enabled&&a.media_control.blocked_types.includes(x),onChange:C=>{const k=a.media_control.enabled?a.media_control.blocked_types:[],j=C?[...new Set([...k,x])]:k.filter(N=>N!==x);y({media_control:{enabled:j.length>0,blocked_types:j}})}},x))})}),s.jsx("form",{className:"flex flex-col gap-5",onSubmit:x=>{x.preventDefault(),h.save(async w=>{await r({antilink:{...a.antilink,mode:w.linkMode,allowed_domains:w.domains.split(`
|
|
537
|
-
`).map(C=>C.trim()).filter(Boolean)},antispam:{...a.antispam,time_window:w.spamWindow,message_count:w.spamLimit,action:w.spamAction},warn_system:{max_warnings:w.warningLimit,action:w.warningAction},welcome_system:{...a.welcome_system,messages:w.welcome===a.welcome_system.messages.join(`
|
|
538
|
-
`)?a.welcome_system.messages:w.welcome.split(`
|
|
539
|
-
`).filter(Boolean)},rules:w.rules})})},children:s.jsxs("fieldset",{disabled:i,className:"flex min-w-0 flex-col gap-5",children:[s.jsxs(Fy,{title:f("groupModeration"),children:[s.jsx(Fe,{label:f("linkMode"),children:s.jsxs(Ht,{"aria-label":f("linkMode"),value:h.draft.linkMode,onChange:x=>h.setField("linkMode",x.target.value),children:[s.jsx("option",{value:"ALL",children:f("linkAll")}),s.jsx("option",{value:"WHITELIST",children:f("linkWhitelist")}),s.jsx("option",{value:"BLACKLIST",children:f("linkBlacklist")})]})}),s.jsx(Fe,{label:f("allowedDomains"),children:s.jsx(il,{"aria-label":f("allowedDomains"),dir:"ltr",value:h.draft.domains,onChange:x=>h.setField("domains",x.target.value)})}),s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Fe,{label:f("spamWindow"),children:s.jsx(Ke,{"aria-label":f("spamWindow"),type:"number",min:1,max:600,required:!0,value:h.draft.spamWindow,onChange:x=>h.setField("spamWindow",Number(x.target.value))})}),s.jsx(Fe,{label:f("spamLimit"),children:s.jsx(Ke,{"aria-label":f("spamLimit"),type:"number",min:2,max:100,required:!0,value:h.draft.spamLimit,onChange:x=>h.setField("spamLimit",Number(x.target.value))})})]}),s.jsx(Fe,{label:f("spamAction"),children:s.jsxs(Ht,{"aria-label":f("spamAction"),value:h.draft.spamAction,onChange:x=>h.setField("spamAction",x.target.value),children:[s.jsx("option",{value:"WARN",children:f("actionWarn")}),s.jsx("option",{value:"KICK",children:f("actionKick")})]})}),s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Fe,{label:f("warningLimit"),children:s.jsx(Ke,{"aria-label":f("warningLimit"),type:"number",min:1,max:50,required:!0,value:h.draft.warningLimit,onChange:x=>h.setField("warningLimit",Number(x.target.value))})}),s.jsx(Fe,{label:f("warningAction"),children:s.jsxs(Ht,{"aria-label":f("warningAction"),value:h.draft.warningAction,onChange:x=>h.setField("warningAction",x.target.value),children:[s.jsx("option",{value:"NONE",children:f("actionNone")}),s.jsx("option",{value:"KICK",children:f("actionKick")})]})})]})]}),s.jsx(Fe,{label:f("groupRules"),children:s.jsx(il,{"aria-label":f("groupRules"),dir:"auto",maxLength:4e3,value:h.draft.rules,onChange:x=>h.setField("rules",x.target.value)})}),s.jsx(Fe,{label:f("welcomeMessages"),children:s.jsx(il,{"aria-label":f("welcomeMessages"),dir:"auto",value:h.draft.welcome,onChange:x=>h.setField("welcome",x.target.value)})}),s.jsx(Oc,{dirty:h.dirty,saving:i,justSaved:h.status==="saved",error:h.error,onDiscard:h.revert,saveLabel:f("save"),discardLabel:f("discard"),unsavedLabel:f("unsavedChanges"),savedLabel:f("saved")})]})}),o.length>0&&s.jsx(Jv,{summary:f("groupCommands"),children:s.jsx("ul",{className:"flex list-none flex-col gap-3 p-0",children:o.map(x=>{var w;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:[d,x.name]}),s.jsx($e,{children:p(x.permission)}),s.jsx($e,{tone:x.enabled?"ok":"neutral",children:x.enabled?f("statusEnabled"):f("statusDisabled")})]}),s.jsx("p",{dir:"auto",className:"text-xs text-muted",children:((w=x.descriptions)==null?void 0:w[m])||x.description})]},x.key||x.name)})})})]})}var Fb;const Ob=typeof((Fb=window.LevixHost)==null?void 0:Fb.hostLog)=="function",eE=()=>{const{t:a}=He(),{toast:i}=Et(),[r,o]=v.useState(!1),[d,f]=v.useState(!1),[m,p]=v.useState(!1),h=v.useRef(!1),y=v.useRef(0),[b,x]=v.useState([]),[w,C]=v.useState("all"),[k,j]=v.useState(!0),N=v.useRef(null),[O,R]=v.useState("bot"),[I,z]=v.useState([]),se=v.useCallback(async()=>{var W;if(h.current)return;const U=y.current;try{if(O==="bot"){const ee=await Y.getLogs();if(U!==y.current)return;x(ee.logs||[])}else{const ee=((W=window.LevixHost)==null?void 0:W.hostLog(500))??"";if(U!==y.current)return;z(ee.split(`
|
|
540
|
-
`).filter(Boolean))}o(!1)}catch{U===y.current&&o(!0)}},[O]);v.useEffect(()=>{y.current+=1;let U=!1,W;const ee=async()=>{await se(),U||(W=setTimeout(ee,3e3))};return ee(),()=>{U=!0,clearTimeout(W),y.current+=1}},[se]);const B=async()=>{var U;if(!h.current){h.current=!0,p(!0),y.current+=1;try{if(O==="bot")await Y.clearLogs();else if(!JSON.parse(((U=window.LevixHost)==null?void 0:U.clearHostLogs())||"{}").ok)throw new Error("clear failed");f(!1),i(a("logsCleared"),"success")}catch{i(a("logsClearFailed"),"error")}finally{h.current=!1,p(!1),await se()}}};v.useEffect(()=>{k&&N.current&&N.current.scrollIntoView({behavior:"smooth"})},[b,I,k]);const D=b.filter(U=>w==="all"?!0:U.level===w),T=O==="bot"?D.length:I.length,F=U=>U==="error"?"border-danger/30 bg-danger/10 text-danger":U==="warn"?"border-warn/30 bg-warn/10 text-warn":"border-info/30 bg-info/10 text-info";return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ml,{icon:s.jsx(ul,{size:20}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[a("liveServerLogs"),s.jsx($e,{tone:"neutral",className:"font-mono",children:T})]}),description:a("logsSubtitle"),actions:s.jsxs(pl,{children:[Ob&&s.jsx(js,{"aria-label":a("logs"),value:O,onChange:U=>{h.current||R(U)},options:[{value:"bot",label:a("logSourceBot")},{value:"host",label:a("logSourceHost"),icon:s.jsx(Er,{size:14})}]}),O==="bot"&&s.jsx(hl,{label:a("filter"),resetLabel:a("reset"),activeCount:w==="all"?0:1,onReset:()=>C("all"),children:s.jsx(yn,{name:"log-level",label:a("allLogs"),value:w,onChange:C,options:[{value:"all",label:a("allLogs")},{value:"info",label:"INFO"},{value:"warn",label:"WARN"},{value:"error",label:"ERROR"}]})}),O==="host"&&Ob&&s.jsx(Oe,{label:a("shareLogs"),icon:s.jsx(Or,{size:18}),onClick:()=>{var U;try{(U=window.LevixHost)==null||U.shareHostLogs()}catch{}}}),s.jsx(Oe,{label:a("autoScroll"),pressed:k,icon:s.jsx(ek,{size:18,className:k?"animate-bounce":""}),onClick:()=>j(U=>!U)}),s.jsx(Oe,{label:a("clearLogs"),variant:"ghost",icon:s.jsx(In,{size:18}),disabled:m,onClick:()=>f(!0)})]})}),s.jsxs(gi,{isOpen:d,onClose:()=>{m||f(!1)},onConfirm:B,title:a("clearLogsConfirm"),confirmLabel:a("clearLogs"),cancelLabel:a("cancel"),loading:m,children:[a("clearLogsBody")," · ",a(O==="host"?"logSourceHost":"logSourceBot")]}),r&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:a("logsLoadFailed")}),s.jsxs(Ye,{padded:!1,className:"h-[65vh] overflow-y-auto bg-bg p-4 font-mono text-xs leading-relaxed text-muted shadow-2xl md:p-5",dir:"ltr",children:[O==="bot"?D.length===0?s.jsx(ut,{icon:s.jsx(ul,{size:24}),text:a("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:D.map((U,W)=>s.jsxs("div",{className:"flex items-baseline gap-2.5 rounded px-1 py-0.5 hover:bg-panel-hover/40",children:[s.jsx("span",{className:"shrink-0 select-none text-[11px] text-faint",children:U.time||new Date().toLocaleTimeString()}),s.jsx("span",{className:`inline-flex shrink-0 items-center rounded border px-1.5 font-mono text-[10px] font-bold ${F(U.level||"info")}`,children:(U.level||"info").toUpperCase()}),s.jsx("span",{className:"break-all font-mono text-text-main",children:U.msg})]},W))}):I.length===0?s.jsx(ut,{icon:s.jsx(Er,{size:24}),text:a("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:I.map((U,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:U})},W))}),s.jsx("div",{ref:N})]})]})},tE=a=>{if(!a||a.endsWith("@lid"))return null;const i=a.split("@")[0].split(":")[0].replace(/\D/g,"");return i?i.length===12?`+${i.slice(0,2)} ${i.slice(2,5)} ${i.slice(5,8)} ${i.slice(8)}`:i.length===11?`+${i.slice(0,1)} ${i.slice(1,4)} ${i.slice(4,7)} ${i.slice(7)}`:`+${i}`:null},nE=({status:a,onNavigate:i})=>{var R,I;const{t:r}=He(),{toast:o}=Et(),[d,f]=v.useState(null),[m,p]=v.useState(!0),[h,y]=v.useState(null),b=!!((R=a==null?void 0:a.user)!=null&&R.id&&h===a.user.id);v.useEffect(()=>{(a==null?void 0:a.state)!=="connected"&&y(null)},[a==null?void 0:a.state]),v.useEffect(()=>{let z=!0;return Y.getStats().then(se=>{z&&(se!=null&&se.stats)&&f(se.stats)}).catch(se=>{o(se.message,"error")}).finally(()=>{z&&p(!1)}),()=>{z=!1}},[o]);const x=z=>{const se=Math.floor(z/86400),B=Math.floor(z%86400/3600),D=Math.floor(z%3600/60);return se?`${se} ${r("uptimeDayUnit")} ${B} ${r("uptimeHourUnit")}`:B?`${B} ${r("uptimeHourUnit")} ${D} ${r("uptimeMinuteUnit")}`:`${D} ${r("uptimeMinuteUnit")}`},w=(a==null?void 0:a.state)==="connected",C=tE((I=a==null?void 0:a.user)==null?void 0:I.id),k=async()=>{try{await Y.startSession(),o(r("starting"),"info")}catch(z){o(z.message,"error")}},j=async()=>{try{await Y.stopSession(),o(r("stop"),"info")}catch(z){o(z.message,"error")}},N=[{id:"connection",title:r("connection"),desc:w?r("connected"):r(a==null?void 0:a.state,"disconnected"),icon:Rr,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:qm,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:ul,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:uv,color:"border-ok/20 bg-ok/10 text-ok"}],O=[{label:r("totalGroups"),value:(d==null?void 0:d.totalGroups)??0,icon:ll,tone:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{label:r("commandCount"),value:(d==null?void 0:d.commandCount)??0,icon:ul,tone:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{label:r("uptime"),value:x((d==null?void 0:d.uptime)||0),icon:u0,tone:"border-ok/20 bg-ok/10 text-ok"},{label:r("activeSchedules"),value:(d==null?void 0:d.activeSchedules)??0,icon:xc,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(Ye,{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:w?r("connected"):r(a==null?void 0:a.state,"disconnected")}),C&&w?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:b?C:"••• ••• ••••"}),s.jsx(Oe,{label:r(b?"hideNumber":"showNumber"),pressed:b,variant:"ghost",icon:b?s.jsx(y0,{size:18}):s.jsx(bi,{size:18}),onClick:()=>{var z;return y(b?null:((z=a==null?void 0:a.user)==null?void 0:z.id)||null)}})]}):null,s.jsx("p",{className:"mt-1 text-sm text-muted",children:r(w?"activeListening":"pausedOrLinking")})]}),s.jsx("div",{className:"absolute end-0 top-1 rtl:start-0 rtl:end-auto",children:s.jsx(Tj,{tone:w?"ok":"warn",label:r(w?"online":"offline")})})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[w?s.jsx(fe,{variant:"danger",icon:s.jsx(km,{size:16}),onClick:j,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("stop")}):s.jsx(fe,{variant:"primary",icon:s.jsx(Nk,{size:16}),onClick:k,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("start")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(Rr,{size:16}),onClick:()=>i("connection"),className:"flex-1 whitespace-nowrap sm:flex-none",children:r("connection")})]})]}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-5 lg:grid-cols-4",children:O.map(z=>{const se=z.icon;return s.jsxs(Ye,{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:z.label}),s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${z.tone}`,children:s.jsx(se,{size:18})})]}),s.jsx("div",{className:"mt-2 font-mono text-2xl font-extrabold tracking-tight text-text-main sm:text-3xl",children:m?"—":z.value})]},z.label)})}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4",children:N.map(z=>{const se=z.icon;return s.jsx(Ye,{padded:!1,className:"h-full transition-colors hover:border-brand-blue/30",children:s.jsxs(fe,{variant:"ghost",onClick:()=>i(z.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 ${z.color}`,children:s.jsx(se,{size:18})}),s.jsx(vm,{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:z.title}),s.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted sm:text-xs",children:z.desc})]})]})},z.id)})}),s.jsxs(Ye,{className:"flex items-center gap-3.5",children:[s.jsx(dk,{size:20,className:"shrink-0 text-faint"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-xs font-semibold text-muted",children:r("dataDir")}),s.jsx("div",{className:"truncate text-start font-mono text-xs text-text-main",dir:"ltr",children:(d==null?void 0:d.dataDir)||"..."})]})]})]})},yi=()=>window.LevixHost,_r=new Map;let Lb=!1;function aE(){Lb||(Lb=!0,window.__levixHostDone=(a,i)=>{const r=_r.get(a);_r.delete(a),r==null||r(i)})}function Ur(a,i,r){const o=yi(),d=o==null?void 0:o[a];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});aE();const f=crypto.randomUUID();return new Promise(m=>{var h,y,b,x,w;const p=C=>{m(C)};_r.set(f,p);try{const C=a==="pickStickerSource"?(h=o.pickStickerSource)==null?void 0:h.call(o,f):a==="pickFile"?(y=o.pickFile)==null?void 0:y.call(o,f):a==="uploadSource"?(b=o.uploadSource)==null?void 0:b.call(o,f,i[0],i[1],i[2]):a==="uploadForm"?(x=o.uploadForm)==null?void 0:x.call(o,f,i[0],i[1],i[2],i[3]):(w=o.exportFile)==null?void 0:w.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),k=JSON.parse(C||"");k.ok||(_r.delete(f),p(k))}catch{_r.delete(f),p({ok:!1,code:"UNAVAILABLE"})}})}function Cc(){var a;return typeof((a=yi())==null?void 0:a.pickStickerSource)=="function"}function Yc(){var a;return typeof((a=yi())==null?void 0:a.exportFile)=="function"}async function sE(){const a=await Ur("pickStickerSource",[]);if(!a.ok&&!a.cancelled)throw Hr(a);return a.ok&&a.token&&a.url?a:null}function lE(){try{const a=yi(),i=a!=null&&a.takePendingSticker?JSON.parse(a.takePendingSticker()):null;return i!=null&&i.ok&&i.token&&i.url&&["create","save"].includes(i.intent)?i:null}catch{return null}}function Hr(a){a.status===401&&(window.location.href="/login");const i=a.body,r=i?(()=>{try{return JSON.parse(i)}catch{return null}})():null,o=a.cancelled?"CANCELLED":a.code==="UNAVAILABLE"?"STORAGE_UNAVAILABLE":a.code;return new Bt(a.status||0,(r==null?void 0:r.error)||a.error||o||"Sticker operation failed",r||{code:o})}async function A1(a,i,r,o){const d=await Ur("uploadSource",[a,i,r]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw Hr(d);try{return JSON.parse(d.body||"")}catch{throw new Bt(d.status,"Invalid upload response",{code:"INTERNAL"})}}function Bc(){var a,i;return typeof((a=yi())==null?void 0:a.uploadForm)=="function"&&typeof((i=yi())==null?void 0:i.pickFile)=="function"}async function _1(){const a=await Ur("pickFile",[]);if(!a.ok&&!a.cancelled)throw Hr(a);return a.ok&&a.token&&a.url?a:null}async function T1(a,i,r,o,d){const f=await Ur("uploadForm",[a,JSON.stringify(i),r,o]);if(!f.ok||!f.status||f.status<200||f.status>=300)throw Hr(f);try{return f.body?JSON.parse(f.body):{}}catch{throw new Bt(f.status||0,"Invalid upload response",{code:"INTERNAL"})}}async function iE(a,i,r,o,d,f){const m=await Ur("exportFile",[a,i,r,o,d,f]);if(!m.ok)throw Hr(m);return m}const rE=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],oE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],cE=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],D1=[1,2,3,4,6,8,12];function uE(){const a=window.LevixHost;return!!(a&&typeof a.pickContact=="function")}function dE(a){let i=String(a||"").replace(/\D/g,"");return i.startsWith("00")&&(i=i.slice(2)),i.length<8||i.length>15?null:`${i}@s.whatsapp.net`}function Vn(a){const i=String(a||"").trim();return!i||i.includes("@")||/^\d{8,}$/.test(i)?null:i}function fE(a,i){return Vn(a.savedName)||Vn(a.pushName)||Vn(a.name)||Vn(a.targetLabel)||a.phone||i}function Lm(a){return String(a).padStart(2,"0")}function mE(a,i){const r=a.map(o=>i?cE[o]:oE[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 hE(a){return a===1?"كل ساعة":a===2?"كل ساعتين":a>=3&&a<=10?`كل ${a} ساعات`:`كل ${a} ساعة`}function Bb(a,i){return i==="image"?a("mediaKindImage"):i==="video"?a("mediaKindVideo"):i==="audio"?a("mediaKindAudio"):i==="document"?a("mediaKindDocument"):i}const qa=({label:a,children:i})=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[s.jsx("span",{className:"sm:w-32 shrink-0 font-bold text-muted",children:a}),s.jsx("span",{className:"min-w-0",children:i})]});function pE(a,i,r,o,d,f,m,p){const h=/^\d{1,2}:\d{2}$/.test(i),y=m||"UTC";if(a==="hourly")return!Number.isInteger(d)||!D1.includes(d)||!Number.isInteger(f)||f<0||f>59?null:p?`${`${hE(d)} عند الدقيقة ${f}`} (${y})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${y})`;if(!h)return null;const[b,x]=i.split(":").map(Number);if(b>23||x>59)return null;const w=`${Lm(b)}:${Lm(x)}`;if(a==="daily")return p?`يومياً الساعة ${w} (${y})`:`Daily at ${w} (${y})`;if(a==="weekly"){const C=[...new Set(r.filter(j=>j>=0&&j<=6))].sort((j,N)=>j-N);if(!C.length)return null;const k=mE(C,p);return p?`كل يوم ${k} الساعة ${w} (${y})`:`Every ${k} at ${w} (${y})`}return a==="monthly"?!Number.isInteger(o)||o<1||o>31?null:p?`كل شهر في اليوم ${o} الساعة ${w} (${y})`:`Every month on day ${o} at ${w} (${y})`:null}const mm={type:"any",delivery:"any",media:"any"};function Ub(a){return Vn(a.savedName)||Vn(a.pushName)||Vn(a.targetLabel)||a.targetPhone||a.phone||a.targetJid}function gE(a,i,r){const o=i.trim().toLowerCase();return!(o&&![a.message,a.targetLabel,a.savedName,a.pushName,a.phone,a.targetPhone,a.when,a.whenAr].filter(Boolean).join(" ").toLowerCase().includes(o)||r.type!=="any"&&a.type!==r.type||r.delivery==="failed"&&a.lastDeliveryStatus!=="failed"||r.delivery==="active"&&a.lastDeliveryStatus==="failed"||r.media==="with"&&!a.media||r.media==="without"&&a.media)}function xE(a,i,r){const o=[...a],d=(f,m)=>Ub(f).localeCompare(Ub(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 yE=({isConnected:a=!1,onNavigate:i})=>{const{t:r,language:o}=He(),{toast:d}=Et(),[f,m]=v.useState([]),[p,h]=v.useState("UTC"),[y,b]=v.useState(!0),[x,w]=v.useState(null),[C,k]=v.useState(0),[j,N]=v.useState(""),[O,R]=v.useState("newest"),[I,z]=v.useState(mm),[se,B]=v.useState([]),[D,T]=v.useState(!1),[F,U]=v.useState(null),[W,ee]=v.useState(""),[ue,ie]=v.useState(!1),[H,X]=v.useState(""),[me,de]=v.useState("recurring"),[be,_]=v.useState("daily"),[J,ye]=v.useState("09:00"),[Se,E]=v.useState([1]),[Q,V]=v.useState(1),[re,te]=v.useState(1),[ce,he]=v.useState(0),[oe,we]=v.useState(""),[qe,lt]=v.useState(!1),[ht,kt]=v.useState(null),[Le,xe]=v.useState(null),ze=v.useRef(null),[Ne,Pe]=v.useState(null),vt=3,ae=20*1024*1024,ne=20,ve=f.length>=vt,Te=o==="ar",jt=v.useMemo(()=>pE(be,J,Se,Q,re,ce,p,Te),[be,J,Se,Q,re,ce,p,Te]),Xt=async()=>{b(!0);try{const L=await Y.getSchedules();L!=null&&L.schedules&&(m(L.schedules),L.timezone&&h(L.timezone)),w(null)}catch(L){w(L.message),d(L.message,"error")}finally{b(!1)}},Tt=async()=>{T(!0);try{const L=await Y.getRecipients();L!=null&&L.recipients&&B(L.recipients)}catch{}finally{T(!1)}};v.useEffect(()=>{Xt(),a&&Tt()},[a,C]);const sn=v.useMemo(()=>xE(f.filter(L=>gE(L,j,I)),O,o),[f,j,I,O,o]),qt=`${j}|${O}|${I.type}|${I.delivery}|${I.media}`,{page:wi,pageCount:yl,pageItems:Ia,setPage:_s,total:Fa}=Vc(sn,20,qt),ki=(I.type!=="any"?1:0)+(I.delivery!=="any"?1:0)+(I.media!=="any"?1:0),bl=()=>{N(""),z(mm)},Rt=async L=>{try{await Y.deleteSchedule(L),d(r("savedSuccessfully"),"success"),m(Ce=>Ce.filter(it=>it.id!==L))}catch(Ce){d(Ce.message,"error")}},Ka=async L=>{if(!a){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await Y.retrySchedule(L),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),Xt()}catch(Ce){d(Ce.message,"error")}},Ts=async()=>{const L=window.LevixHost;if(!(L!=null&&L.pickContact)){d(o==="ar"?"دليل الهاتف متاح من تطبيق أندرويد فقط":"Phone book is available in the Android app","info");return}const Ce=await new Promise(Qn=>{var la;const sa=Xn=>{window.removeEventListener("levix-contact",sa);const ia=Xn.detail;if(!(ia!=null&&ia.phone)){Qn(null);return}Qn({name:String(ia.name||""),phone:String(ia.phone)})};window.addEventListener("levix-contact",sa);try{(la=L.pickContact)==null||la.call(L)}catch{window.removeEventListener("levix-contact",sa),Qn(null)}});if(!Ce)return;const it=dE(Ce.phone);if(!it){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const bn=`+${it.split("@")[0]}`,Yn=Vn(Ce.name);U({id:it,name:Yn||bn,savedName:Yn,pushName:null,phone:bn,type:"contact"})},Ya=()=>{U(null),ee(""),X(""),de("recurring"),_("daily"),ye("09:00"),E([1]),V(1),te(1),he(0),we(""),kt(null),xe(null)},ka=()=>{kt(null),xe(null)},vl=async()=>{try{const L=await _1();if(!L)return;if(L.size>ae){d(r("feedbackFileTooLarge").replace("{max}",String(ne)),"error");return}xe(L)}catch(L){d((L==null?void 0:L.message)||"Could not attach the file","error")}},le=()=>{if(!a){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(ve){d(r("maxSchedulesReached"),"warning");return}Ya(),ie(!0),se.length||Tt()},Re=L=>{E(Ce=>Ce.includes(L)?Ce.filter(it=>it!==L):[...Ce,L].sort((it,bn)=>it-bn))},tt=async()=>{if(!F){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!H.trim()&&!ht&&!Le){d(o==="ar"?"يرجى كتابة نص الرسالة أو إرفاق ملف":"Please write the message text or attach a file","warning");return}if(me==="once"&&(!oe||new Date(oe).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if(me==="recurring"&&be==="weekly"&&Se.length===0){d(r("weekdayRequired"),"warning");return}lt(!0);const L={targetJid:F.id,message:H.trim(),type:me};if(F.type==="contact"){const Ce=Vn(F.savedName)||Vn(F.name);Ce&&Ce!==F.phone&&(L.targetName=Ce)}if(me==="recurring"){const Ce={kind:be};be==="hourly"?(Ce.everyHours=re,Ce.time=`00:${Lm(ce)}`):(Ce.time=J,be==="weekly"&&(Ce.weekdays=Se),be==="monthly"&&(Ce.dayOfMonth=Q)),L.recurrence=Ce}else L.scheduledTime=new Date(oe).getTime();try{const Ce={};for(const[it,bn]of Object.entries(L))Ce[it]=it==="recurrence"?JSON.stringify(bn):String(bn);Le?await T1("/dashboard/api/schedules",Ce,Le.token,ae+1024*1024):ht?await Y.postMultipart("/schedules",Ce,ht):await Y.createSchedule(L),d(r("savedSuccessfully"),"success"),ie(!1),Ya(),Xt()}catch(Ce){d(Ce.message,"error")}finally{lt(!1)}},gt=se.filter(L=>{var it,bn,Yn;const Ce=W.toLowerCase().trim();return Ce?L.name.toLowerCase().includes(Ce)||!!((it=L.savedName)!=null&&it.toLowerCase().includes(Ce))||!!((bn=L.pushName)!=null&&bn.toLowerCase().includes(Ce))||!!((Yn=L.phone)!=null&&Yn.toLowerCase().includes(Ce)):!0}),St=(L,Ce,it=!0)=>{var la;if(L.type==="group"||L.targetKind==="group"||!!((la=L.targetJid)!=null&&la.includes("@g.us"))){const Xn=Vn(L.name)||(Vn(L.targetLabel)&&L.targetLabel!=="Group"?L.targetLabel:null)||r("groupFallback");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-brand-cyan min-w-0",children:[it&&s.jsx(ll,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${Ce} truncate`,children:Xn})]})}const Yn=L.phone||L.targetPhone||null,Qn=fE(L,r("contactFallback")),sa=!!(Yn&&Qn!==Yn);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[it&&s.jsx(cc,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${Ce} truncate block`,children:Qn}),sa&&s.jsx("span",{className:"block text-[11px] text-muted font-mono",dir:"ltr",children:Yn})]})]})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[!a&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 sm:p-5 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-warn/20 text-warn flex items-center justify-center shrink-0",children:s.jsx(al,{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(fe,{variant:"primary",className:"shrink-0",onClick:()=>i==null?void 0:i("connection"),children:o==="ar"?"الذهاب للاتصال":"Go to Connection"})]}),s.jsx(ml,{icon:s.jsx(bm,{size:24}),title:s.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:[r("schedules"),s.jsxs($e,{tone:ve?"warn":"info",children:[f.length," / ",vt," ",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(fe,{variant:"primary",size:"lg",className:"w-full sm:w-auto",icon:s.jsx(ol,{size:18}),onClick:le,disabled:ve||!a,children:a?r(ve?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"}):void 0}),!y&&!x&&f.length>0&&s.jsxs(pl,{children:[s.jsx(Ke,{type:"search",name:"schedule-search",autoComplete:"off",value:j,onChange:L=>N(L.target.value),placeholder:r("searchSchedules"),"aria-label":r("searchSchedules"),className:"min-w-48 flex-1"}),s.jsx(Lr,{label:r("sort"),value:O,onChange:R,options:[{value:"newest",label:r("sortNewest")},{value:"oldest",label:r("sortOldest")},{value:"target",label:r("thTarget")},{value:"status",label:r("thDelivery")}]}),s.jsxs(hl,{label:r("filter"),resetLabel:r("reset"),activeCount:ki,onReset:()=>z(mm),children:[s.jsx(yn,{label:r("thType"),name:"schedule-type-filter",value:I.type,onChange:L=>z(Ce=>({...Ce,type:L})),options:[{value:"any",label:r("statusAny")},{value:"recurring",label:r("typeRecurring")},{value:"once",label:r("typeOnce")}]}),s.jsx(yn,{label:r("thDelivery"),name:"schedule-delivery-filter",value:I.delivery,onChange:L=>z(Ce=>({...Ce,delivery:L})),options:[{value:"any",label:r("statusAny")},{value:"active",label:r("deliveryActive")},{value:"failed",label:r("deliveryFailed")}]}),s.jsx(yn,{label:r("thMedia"),name:"schedule-media-filter",value:I.media,onChange:L=>z(Ce=>({...Ce,media:L})),options:[{value:"any",label:r("statusAny")},{value:"with",label:r("mediaWith")},{value:"without",label:r("mediaWithout")}]})]})]}),y&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(L=>s.jsxs(Ye,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(It,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(It,{className:"h-4 w-32"}),s.jsx(It,{className:"h-3 w-24"})]})]}),s.jsx(It,{className:"h-4 w-full"}),s.jsx(It,{className:"h-6 w-28"})]},L))}),!y&&x&&s.jsx(ut,{kind:"error",icon:s.jsx(al,{size:28}),description:x,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(cl,{size:16}),onClick:()=>k(L=>L+1),children:r("retryLoad")})}),!y&&!x&&f.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(bm,{size:28}),text:r("noSchedules"),action:s.jsx(fe,{variant:"primary",icon:s.jsx(ol,{size:16}),onClick:le,disabled:!a||ve,children:r("scheduleNewMsg")})}),!y&&!x&&f.length>0&&sn.length===0&&s.jsx(ut,{kind:"no-results",action:s.jsx(fe,{variant:"secondary",onClick:bl,children:r("clearFilters")})}),!y&&!x&&sn.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:hidden",children:Ia.map(L=>s.jsxs(Ye,{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:L.targetKind==="group"||L.targetJid.includes("@g.us")?s.jsx(ll,{size:18}):s.jsx(cc,{size:18})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("bdi",{children:St({targetJid:L.targetJid,targetKind:L.targetKind,targetLabel:L.targetLabel,targetPhone:L.targetPhone,savedName:L.savedName,pushName:L.pushName,phone:L.phone},"text-sm font-bold text-text-main",!1)}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted",dir:"auto",children:Te?L.whenAr||L.when:L.when||L.cronString||"—"})]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[L.lastDeliveryStatus==="failed"&&s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Va,{size:16}),onClick:()=>{Ka(L.id)}}),s.jsx(Oe,{label:r("scheduleDetails"),variant:"ghost",icon:s.jsx(bi,{size:16}),onClick:()=>Pe(L)}),s.jsx(aa,{label:r("moreActions"),children:s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{Rt(L.id)},children:r("delete")})})]})]}),s.jsx(An,{lines:2,className:"text-sm text-text-main",children:L.media?`${L.media.fileName||""} ${L.message}`.trim():L.message||"—"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[L.media&&s.jsxs($e,{tone:"info",children:[s.jsx(Nr,{size:12}),Bb(r,L.media.kind)]}),s.jsx($e,{tone:L.type==="recurring"?"info":"neutral",children:L.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsxs(bc,{tone:L.lastDeliveryStatus==="failed"?"danger":L.status==="active"?"ok":"neutral",children:[L.lastDeliveryStatus==="failed"?s.jsx(al,{size:13}):s.jsx(ws,{size:13}),s.jsx("span",{children:L.lastDeliveryStatus==="failed"?r("deliveryFailed"):L.status==="active"?r("deliveryActive"):L.status})]})]})]},L.id))}),s.jsx(Ye,{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:Ia.map(L=>s.jsxs("tr",{onClick:()=>Pe(L),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:St({targetJid:L.targetJid,targetKind:L.targetKind,targetLabel:L.targetLabel,targetPhone:L.targetPhone,savedName:L.savedName,pushName:L.pushName,phone:L.phone},"font-semibold")})}),s.jsx("td",{className:"px-4 py-4 text-xs text-text-main sm:text-sm",children:s.jsx(An,{lines:2,children:L.media?`${L.media.fileName||""} ${L.message}`.trim():L.message||"—"})}),s.jsx("td",{className:"px-4 py-4 text-xs text-muted",children:s.jsx("span",{dir:"auto",children:Te?L.whenAr||L.when:L.when||L.cronString||"—"})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx($e,{tone:L.type==="recurring"?"info":"neutral",children:L.type==="recurring"?r("typeRecurring"):r("typeOnce")})}),s.jsx("td",{className:"px-4 py-4",children:s.jsxs(bc,{tone:L.lastDeliveryStatus==="failed"?"danger":L.status==="active"?"ok":"neutral",children:[L.lastDeliveryStatus==="failed"?s.jsx(al,{size:13}):s.jsx(ws,{size:13}),s.jsx("span",{children:L.lastDeliveryStatus==="failed"?r("deliveryFailed"):L.status==="active"?r("deliveryActive"):L.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:[L.lastDeliveryStatus==="failed"&&s.jsx(Oe,{label:r("retryDelivery"),icon:s.jsx(Va,{size:16}),onClick:()=>{Ka(L.id)}}),s.jsx(aa,{label:r("moreActions"),children:s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{Rt(L.id)},children:r("delete")})})]})})]},L.id))})]})})}),s.jsx(vi,{page:wi,pageCount:yl,total:Fa,onPageChange:_s})]}),s.jsx(an,{isOpen:ue,onClose:()=>ie(!1),title:r("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>ie(!1),children:r("cancel")}),s.jsx(fe,{variant:"primary",loading:qe,onClick:tt,disabled:qe||!F||!H.trim()&&!ht&&!Le,children:r(qe?"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:"*"})]}),F?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:F.type==="group"?s.jsx(ll,{size:16}):s.jsx(cc,{size:16})}),s.jsx("div",{className:"min-w-0",children:St(F,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx(Oe,{label:r("changeChat"),variant:"ghost",icon:s.jsx(Kn,{size:16}),onClick:()=>U(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(Pm,{size:16,className:"pointer-events-none absolute start-3 top-1/2 -translate-y-1/2 text-muted"}),s.jsx(Ke,{type:"search",value:W,onChange:L=>ee(L.target.value),placeholder:r("searchRecipients"),"aria-label":r("searchRecipients"),className:"ps-9"})]}),uE()&&s.jsx(fe,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(ak,{size:15}),onClick:Ts,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:D?s.jsx("div",{className:"flex justify-center p-4",children:s.jsx(Ga,{label:r("loading")})}):gt.length===0?s.jsx(ut,{className:"px-4 py-4",text:r("noRecipientsFound")}):gt.map(L=>s.jsxs(fe,{variant:"ghost",onClick:()=>U(L),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:L.type==="group"?s.jsx(ll,{size:14}):s.jsx(cc,{size:14})}),s.jsx("div",{className:"min-w-0",children:St(L,"text-xs font-bold text-text-main",!1)})]}),s.jsx($e,{tone:"neutral",className:"shrink-0",children:L.type==="group"?r("groupFallback"):r("contactFallback")})]},L.id))})]})]}),s.jsx(Fe,{label:r("scheduleType"),htmlFor:"schedule-type",children:s.jsxs(Ht,{id:"schedule-type",value:me,onChange:L=>de(L.target.value),children:[s.jsx("option",{value:"recurring",children:r("scheduleRecurring")}),s.jsx("option",{value:"once",children:r("scheduleOnce")})]})}),me==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsx(Fe,{label:r("repeat"),htmlFor:"repeat-kind",children:s.jsxs(Ht,{id:"repeat-kind",value:be,onChange:L=>_(L.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")})]})}),be==="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:rE.map((L,Ce)=>{const it=Se.includes(Ce);return s.jsx(fe,{size:"sm",variant:it?"primary":"secondary","aria-pressed":it,onClick:()=>Re(Ce),children:r(L)},L)})})]}),be==="monthly"&&s.jsx(Fe,{label:r("dayOfMonth"),htmlFor:"day-of-month",description:r("monthDayHint"),children:s.jsx(Ke,{id:"day-of-month",type:"number",min:1,max:31,inputMode:"numeric",value:Q,onChange:L=>V(Number(L.target.value))})}),be==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(Fe,{label:r("everyHours"),htmlFor:"every-hours",children:s.jsx(Ht,{id:"every-hours",value:re,onChange:L=>te(Number(L.target.value)),children:D1.map(L=>s.jsx("option",{value:L,children:L},L))})}),s.jsx(Fe,{label:r("atMinute"),htmlFor:"hourly-minute",children:s.jsx(Ke,{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",value:ce,onChange:L=>he(Number(L.target.value)),dir:"ltr"})})]}):s.jsx(Fe,{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(Ke,{id:"send-time",type:"time",value:J,onChange:L=>ye(L.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:jt||"—"})]})]}):s.jsx(Fe,{label:r("deliveryDateTime"),htmlFor:"one-off-time",children:s.jsx(Ke,{id:"one-off-time",type:"datetime-local",value:oe,onChange:L=>we(L.target.value),dir:"ltr"})}),s.jsx(Fe,{label:s.jsxs(s.Fragment,{children:[r("messageText")," ",!ht&&!Le&&s.jsx("span",{className:"text-danger",children:"*"})]}),htmlFor:"schedule-message",children:s.jsx(il,{id:"schedule-message",rows:3,placeholder:r("messagePlaceholder"),value:H,onChange:L=>X(L.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:[Le||ht?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(Nr,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"max-w-[220px] truncate",children:(Le==null?void 0:Le.name)??(ht==null?void 0:ht.name)}),s.jsx(Oe,{label:r("scheduleRemoveMedia"),variant:"ghost",icon:s.jsx(Kn,{size:14}),onClick:ka})]}):s.jsx(fe,{variant:"secondary",size:"sm",icon:s.jsx(Nr,{size:14,className:"text-brand-cyan"}),onClick:()=>{var L;return Bc()?void vl():(L=ze.current)==null?void 0:L.click()},children:r("scheduleAttachMedia")}),s.jsx("span",{className:"text-[11px] text-muted",children:r("scheduleMediaHint").replace("{max}",String(ne))})]}),!Bc()&&s.jsx("input",{ref:ze,type:"file",className:"sr-only",onChange:L=>{var it;const Ce=((it=L.target.files)==null?void 0:it[0])??null;if(L.target.value="",!!Ce){if(Ce.size>ae){d(r("feedbackFileTooLarge").replace("{max}",String(ne)),"error");return}kt(Ce)}}})]})]})}),s.jsx(an,{isOpen:!!Ne,onClose:()=>Pe(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(Va,{size:16}),onClick:()=>{const L=Ne.id;Pe(null),Ka(L)}}):s.jsx("span",{}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fe,{variant:"secondary",onClick:()=>Pe(null),children:r("close")}),s.jsx(aa,{label:r("moreActions"),children:s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{const L=Ne==null?void 0:Ne.id;Pe(null),L&&Rt(L)},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:St({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(Nr,{size:13,className:"text-brand-cyan shrink-0"}),s.jsxs("span",{className:"truncate",children:[Bb(r,Ne.media.kind),Ne.media.fileName?` · ${Ne.media.fileName}`:""]})]})}),s.jsx(qa,{label:r("thSchedule"),children:s.jsx("span",{dir:"auto",children:Te&&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(bc,{tone:Ne.lastDeliveryStatus==="failed"?"danger":Ne.status==="active"?"ok":"neutral",children:[Ne.lastDeliveryStatus==="failed"?s.jsx(al,{size:13}):s.jsx(ws,{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")})]})})]})},hm={messageMin:10,messageMax:2e3,attachmentMax:20*1024*1024},pm={bug:{icon:sk,labelKey:"feedbackTopicBug"},idea:{icon:xk,labelKey:"feedbackTopicIdea"},question:{icon:mv,labelKey:"feedbackTopicQuestion"},praise:{icon:mk,labelKey:"feedbackTopicPraise"},other:{icon:pi,labelKey:"feedbackTopicOther"}},bE=["bug","idea","question","praise","other"],vE=()=>{var he;const{t:a,language:i,theme:r}=He(),{toast:o}=Et(),[d,f]=v.useState(null),[m,p]=v.useState("bug"),[h,y]=v.useState(""),[b,x]=v.useState(0),[w,C]=v.useState(""),[k,j]=v.useState(null),[N,O]=v.useState(null),[R,I]=v.useState(!1),[z,se]=v.useState(null),[B,D]=v.useState(!1),[T,F]=v.useState(!1),[U,W]=v.useState(null),[ee,ue]=v.useState(!1),[ie,H]=v.useState(!1),X=v.useRef(null);v.useEffect(()=>{Y.getFeedbackMeta().then(f).catch(()=>{})},[]),v.useEffect(()=>{if(!R){se(null);return}const oe=Nm(i,r);D(!0),Y.getFeedbackDiagnosticsPreview(oe).then(we=>{we!=null&&we.diagnostics?se(we.diagnostics):se(oe)}).catch(()=>{se(oe)}).finally(()=>{D(!1)})},[R,i,r]);const me=(d==null?void 0:d.messageMin)??hm.messageMin,de=(d==null?void 0:d.messageMax)??hm.messageMax,be=(d==null?void 0:d.attachmentMax)??hm.attachmentMax,_=Math.round(be/(1024*1024)),J=h.trim(),ye=Math.max(0,me-J.length),Se=oe=>oe>=1024*1024?a("fileSizeMb").replace("{size}",(oe/(1024*1024)).toFixed(1)):a("fileSizeKb").replace("{size}",String(Math.max(1,Math.round(oe/1024)))),E=((he=d==null?void 0:d.topics)!=null&&he.length?d.topics:bE).filter(oe=>oe in pm),Q=()=>o(a("feedbackFileTooLarge").replace("{max}",String(_)),"error"),V=async()=>{try{const oe=await _1();if(!oe)return;if(oe.size>be){Q();return}O(oe)}catch(oe){o((oe==null?void 0:oe.message)||"Could not attach the file","error")}},re=async oe=>{if(oe.preventDefault(),ye>0||ee)return;ue(!0),W(N?0:null);const we=R?Nm(i,r):void 0,qe={message:J,topic:m,rating:b||null,contact:w.trim()||null,...we?{diagnostics:we}:{}};try{N?await T1("/dashboard/api/feedback",{message:qe.message,topic:qe.topic,...qe.rating?{rating:String(qe.rating)}:{},...qe.contact?{contact:qe.contact}:{},...we?{diagnostics:JSON.stringify(we)}:{}},N.token,be+1024*1024):k?await Y.sendFeedbackMultipart(qe,k,lt=>W(lt)):await Y.sendFeedback(qe),H(!0),o(a("feedbackSent"),"success")}catch(lt){o(lt==null?void 0:lt.message,"error")}finally{ue(!1),W(null)}},te=()=>{y(""),C(""),x(0),p("bug"),j(null),O(null),I(!1),se(null),F(!1),H(!1)},ce=()=>{j(null),O(null)};return ie?s.jsxs(Ye,{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(ws,{size:26})}),s.jsx("h3",{className:"mt-4 text-lg font-bold text-text-main",children:a("feedbackSent")}),s.jsx("p",{className:"mx-auto mt-2 max-w-md text-xs leading-relaxed text-muted sm:text-sm",children:a("feedbackSentDesc")}),s.jsx(fe,{className:"mt-6",onClick:te,children:a("feedbackSendAnother")})]}):s.jsx("div",{className:"flex flex-col gap-5",children:s.jsx(Ye,{children:s.jsxs("form",{onSubmit:re,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(pi,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:a("feedbackTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:a("feedbackDesc")})]})]}),s.jsx(Fe,{label:a("feedbackTopicLabel"),children:s.jsx(Ic,{"aria-label":a("feedbackTopicLabel"),value:m,onChange:p,className:"flex-wrap gap-1.5 sm:gap-2",options:E.map(oe=>{const we=pm[oe].icon;return{value:oe,label:a(pm[oe].labelKey),icon:s.jsx(we,{size:16})}})})}),s.jsxs(Fe,{label:a("feedbackMessageLabel"),htmlFor:"feedback-message",children:[s.jsx(il,{id:"feedback-message",rows:6,required:!0,maxLength:de,value:h,onChange:oe=>y(oe.target.value),placeholder:a("feedbackMessagePlaceholder")}),s.jsx("span",{className:"self-end text-[11px] tabular-nums text-muted",children:ye>0?`${ye} ${a("feedbackCharsNeeded")}`:`${h.length} / ${de}`})]}),s.jsxs(Fe,{label:a("feedbackAttach"),description:a("feedbackAttachmentHint").replace("{max}",String(_)),children:[N||k?s.jsx("span",{className:"flex",children:s.jsx(Gc,{onRemove:ce,removeLabel:a("feedbackRemoveAttachment"),className:"max-w-full",children:`${(N==null?void 0:N.name)??(k==null?void 0:k.name)} · ${Se((N==null?void 0:N.size)??(k==null?void 0:k.size)??0)}`})}):s.jsx(fe,{type:"button",variant:"secondary",icon:s.jsx(Nr,{size:16,className:"text-brand-cyan"}),className:"w-full justify-center border-dashed",onClick:()=>{var oe;return Bc()?void V():(oe=X.current)==null?void 0:oe.click()},children:a("feedbackAttach")}),!Bc()&&s.jsx("input",{ref:X,type:"file",className:"sr-only",onChange:oe=>{var qe;const we=((qe=oe.target.files)==null?void 0:qe[0])??null;if(oe.target.value="",!!we){if(we.size>be){Q();return}j(we)}}})]}),s.jsxs("fieldset",{className:"flex flex-col gap-2",children:[s.jsx("legend",{className:"text-xs sm:text-sm font-bold text-text-main mb-1",children:a("feedbackRatingLabel")}),s.jsx("div",{className:"flex items-center justify-center gap-1",children:[1,2,3,4,5].map(oe=>s.jsx(Oe,{label:`${oe} / 5`,variant:"ghost","aria-pressed":b===oe,onClick:()=>x(b===oe?0:oe),icon:s.jsx(qc,{size:22,className:oe<=b?"fill-brand-cyan text-brand-cyan":"text-muted"})},oe))})]}),s.jsx(Fe,{label:a("feedbackContactLabel"),htmlFor:"feedback-contact",children:s.jsx(Ke,{id:"feedback-contact",type:"text",maxLength:200,value:w,onChange:oe=>C(oe.target.value),placeholder:a("feedbackContactPlaceholder")})}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(zr,{id:"feedback-diagnostics-consent",checked:R,onChange:oe=>I(oe.target.checked),label:a("feedbackAttachDiagnostics")}),R&&s.jsxs("details",{open:T,onToggle:oe=>F(oe.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:a("feedbackDiagnosticsPreview")}),B?s.jsx(Ga,{className:"size-3.5 shrink-0 text-muted"}):s.jsx(rl,{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:B&&!z?s.jsx("p",{className:"text-muted",children:a("feedbackDiagnosticsLoading")}):z?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(z,null,2)}):s.jsx("p",{className:"text-muted",children:a("feedbackDiagnosticsEmpty")})})]})]}),ee&&(N||k)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:N?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((U??0)*100))}%`}})}),s.jsxs("span",{className:"text-[11px] text-muted tabular-nums",children:[a("feedbackSending"),!N&&U!==null&&U>0?` ${Math.round(U*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:[a("feedbackRuntimeLabel"),": v",d.runtime.version," · ",d.runtime.platform]}):s.jsx("span",{}),s.jsx(fe,{type:"submit",variant:"primary",disabled:ye>0,loading:ee,icon:s.jsx(pi,{size:16}),className:"w-full sm:w-auto",children:a(ee?"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(Gm,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"flex-1",children:a("feedbackWhatIsSent")}),s.jsx(rl,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsx("p",{className:"px-3 pb-3 text-xs leading-relaxed text-muted",children:a("feedbackWhatIsSentDesc")})]}),s.jsxs("p",{className:"text-xs leading-relaxed text-muted",children:[a("feedbackGithubHint")," ",s.jsxs("a",{href:"https://github.com/Abdodiab2005/levix/issues",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-semibold text-brand-cyan hover:underline",children:[a("feedbackOpenGithub"),s.jsx(uk,{size:13,"aria-hidden":!0,className:"shrink-0"})]})]})]})]})})})},SE=()=>{const{t:a}=He(),{toast:i}=Et(),[r,o]=v.useState([]),[d,f]=v.useState([]),[m,p]=v.useState(!0),[h,y]=v.useState(null),[b,x]=v.useState(null),[w,C]=v.useState(null),[k,j]=v.useState(!1),N=v.useCallback(async()=>{y(null);try{const z=await Y.getCrashReports();z&&(o(z.reports||[]),f(z.sent||[]))}catch(z){y((z==null?void 0:z.message)||"Failed to load crash reports")}finally{p(!1)}},[]);v.useEffect(()=>{N()},[N]);const O=async z=>{x(z);try{await Y.sendCrashReport(z),i(a("reportSentSuccess"),"success"),await N()}catch(se){i((se==null?void 0:se.message)||"Send failed","error"),await N()}finally{x(null)}},R=async z=>{try{await Y.deleteCrashReport(z),i(a("reportDeleteSuccess"),"success"),await N()}catch(se){i((se==null?void 0:se.message)||"Delete failed","error")}finally{C(null)}},I=async()=>{try{await Y.deleteAllCrashReports(),i(a("allReportsDeleted"),"success"),await N()}catch(z){i((z==null?void 0:z.message)||"Delete all failed","error")}finally{j(!1)}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(Ye,{className:"flex flex-col gap-5",children:[s.jsx(qn,{icon:s.jsx(Mr,{size:22}),title:a("diagnosticsTitle"),description:a("diagnosticsDesc"),actions:r.length>0?s.jsx(aa,{label:a("more"),children:s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>j(!0),children:a("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:a("pendingReports")}),r.length>0&&s.jsx($e,{tone:"info",className:"tabular-nums",children:r.length})]}),m?s.jsx(Cs,{text:a("loading")}):h?s.jsx(ut,{kind:"error",title:h,action:s.jsx(fe,{variant:"secondary",onClick:N,children:a("retry")})}):r.length===0?s.jsx(ut,{kind:"empty",icon:s.jsx(ws,{size:32,className:"text-ok"}),title:a("noPendingReports")}):s.jsx("div",{className:"flex flex-col gap-3",children:r.map(z=>{const{status:se,lastError:B,...D}=z;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($e,{tone:"neutral",children:z.category}),s.jsx("span",{className:"font-mono text-xs sm:text-sm font-bold text-text-main truncate",children:z.error.type}),s.jsx(Rc,{value:z.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(fe,{variant:"primary",size:"sm",loading:b===z.id,disabled:b!==null,onClick:()=>O(z.id),icon:s.jsx(pi,{size:14}),children:b===z.id?a("sendingReport"):a("sendReport")}),s.jsx(Oe,{label:a("deleteReport"),icon:s.jsx(In,{size:16}),variant:"ghost",onClick:()=>C(z.id)})]})]}),s.jsx("p",{className:"text-xs leading-relaxed text-muted select-text",children:z.error.message}),z.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(dl,{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:[a("reportLastError"),": "]}),s.jsx("span",{children:z.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:a("crashReportPreview")}),s.jsx(rl,{size:14,"aria-hidden":!0,className:"shrink-0 transition-transform group-open:rotate-180"})]}),s.jsx("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(D,null,2)})})]})]},z.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:a("sentReports")}),d.length>0&&s.jsx($e,{tone:"neutral",className:"tabular-nums",children:d.length})]}),d.length===0?s.jsx("p",{className:"text-xs text-muted py-2",children:a("noSentReports")}):s.jsx("div",{className:"flex flex-col gap-2",children:d.map(z=>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($e,{tone:"neutral",className:"shrink-0",children:z.category}),s.jsx("span",{className:"font-mono font-semibold text-text-main select-all",children:z.id}),s.jsx("span",{className:"text-muted truncate",children:z.type})]}),s.jsx(Rc,{value:z.sentAt,className:"text-muted shrink-0"})]},z.id))})]})]}),s.jsx(gi,{isOpen:w!==null,onClose:()=>C(null),onConfirm:()=>w&&R(w),title:a("confirmDeleteReport"),description:a("confirmDeleteReportDesc"),confirmLabel:a("deleteReport"),cancelLabel:a("cancel"),variant:"danger"}),s.jsx(gi,{isOpen:k,onClose:()=>j(!1),onConfirm:I,title:a("confirmDeleteAllReports"),description:a("confirmDeleteAllDesc"),confirmLabel:a("deleteAllReports"),cancelLabel:a("cancel"),variant:"danger"})]})},wE=["general","integrations","proxy","security","storage","feedback","diagnostics"];function Hb(){const a=window.location.hash.replace(/^#\/?/,"").split("/");return a[0]==="settings"&&a[1]&&wE.includes(a[1])?a[1]:"general"}const kE=["!","/",".","#","$","?"],jE="levix-settings";function NE(a){const i=new TextEncoder().encode(a);let r="";for(const o of i)r+=String.fromCharCode(o);return btoa(r)}const CE=()=>{var ze,Ne,Pe,vt;const{t:a,language:i,setLanguage:r}=He(),{toast:o}=Et(),[d,f]=v.useState(Hb);v.useEffect(()=>{const ae=()=>{const ne=Hb();f(ve=>ve!==ne?ne:ve)};return window.addEventListener("hashchange",ae),()=>window.removeEventListener("hashchange",ae)},[]);const m=ae=>{f(ae),window.location.hash=`settings/${ae}`},[p,h]=v.useState({}),[y,b]=v.useState({}),[x,w]=v.useState(!0),[C,k]=v.useState("!"),[j,N]=v.useState("!"),[O,R]=v.useState(!1),[I,z]=v.useState(""),[se,B]=v.useState(""),[D,T]=v.useState(""),[F,U]=v.useState(!1),[W,ee]=v.useState(!1),[ue,ie]=v.useState(!1),[H,X]=v.useState(null),me=v.useRef(null),de=async(ae,ne)=>{await Y.updateSetting(ae,ne),ae.endsWith("_api_key")||ae==="whatsapp_proxy_password"?(h(Te=>({...Te,[ae]:""})),b(Te=>({...Te,[ae]:!!String(ne||"").trim()}))):h(Te=>({...Te,[ae]:ne}))},be=async(ae,ne)=>{h(ve=>({...ve,[ae]:ne}));try{await Y.updateSetting(ae,ne),o(a("savedSuccessfully"),"success")}catch(ve){o(ve.message,"error"),await lt()}},_=Un(i),J=Un(String(p.bot_language||"auto")),ye=Un(String(p.bot_timezone||"Africa/Cairo")),Se=Un(String(p.openweathermap_api_key||"")),E=Un(String(p.youtube_api_key||"")),Q=Un(Number(p.forward_score_ttl_days||30)),V=Un(Number(p.max_fetch_bytes||524288)),re=Un(Number(p.sticker_library_limit||1e3)),te=Un(Number(p.auto_delete_keep_days||30)),ce=Mc({min:Number(p.bot_min_delay_ms??400),max:Number(p.bot_max_delay_ms??900)}),he=Mc({protocol:String(p.whatsapp_proxy_protocol||"http"),host:String(p.whatsapp_proxy_host||""),port:Number(p.whatsapp_proxy_port||0),username:String(p.whatsapp_proxy_username||""),password:String(p.whatsapp_proxy_password||"")}),oe=async()=>{var ae;ee(!0);try{const ne=await Y.exportSettings(),ve=JSON.stringify(ne,null,2),Te=`levix-settings-${((ae=ne.exportedAt)==null?void 0:ae.slice(0,10))||"export"}.json`,jt=window.LevixHost;if(jt&&typeof jt.saveExportFile=="function"){const qt=JSON.parse(jt.saveExportFile(Te,NE(ve)));if(!(qt!=null&&qt.ok))throw new Error((qt==null?void 0:qt.error)||a("exportSettingsError"));o(`${a("exportSettingsSuccess")} — ${a("exportSavedTo")} ${qt.dir}`,"success");return}const Xt=new Blob([ve],{type:"application/json"}),Tt=URL.createObjectURL(Xt),sn=document.createElement("a");sn.href=Tt,sn.download=Te,sn.click(),URL.revokeObjectURL(Tt),o(a("exportSettingsSuccess"),"success")}catch(ne){o(ne.message||a("exportSettingsError"),"error")}finally{ee(!1)}},we=async ae=>{var Te;const ne=(Te=ae.target.files)==null?void 0:Te[0];if(ae.target.value="",!ne)return;let ve;try{ve=JSON.parse(await ne.text())}catch{o(a("importSettingsError"),"error");return}if((ve==null?void 0:ve.format)!==jE){o(a("importSettingsError"),"error");return}X(ve)},qe=async()=>{var ae,ne,ve;if(H){ie(!0);try{const Te=await Y.importSettings(H),jt=[`${((ae=Te.applied)==null?void 0:ae.length)||0} ${a("importSettingsCount")}`];(ne=Te.skipped)!=null&&ne.length&&jt.push(`${a("importSkipped")}: ${Te.skipped.length}`),(ve=Te.restartNeeded)!=null&&ve.length&&jt.push(`${a("importRestartNeeded")}: ${Te.restartNeeded.join(", ")}`),o(`${a("importSuccess")} — ${jt.join(" · ")}`,"success"),X(null),await lt()}catch(Te){o(Te.message,"error")}finally{ie(!1)}}},lt=async()=>{try{const ae=await Y.getSettings();if(ae!=null&&ae.settings){const ne={},ve={};ae.settings.forEach(Te=>{Te.type==="secret"?(ve[Te.key]=!!Te.configured,ne[Te.key]=""):ne[Te.key]=Te.value}),h(ne),b(ve)}ae!=null&&ae.prefix&&(k(ae.prefix),N(ae.prefix))}catch(ae){o(ae.message,"error")}finally{w(!1)}};v.useEffect(()=>{lt()},[]);const ht=async ae=>{const ne=(ae!==void 0?ae:j).trim();if(!ne||ne.length>3){o(a("prefixValidation"),"error");return}R(!0);try{await Y.updatePrefix(ne),k(ne),N(ne),o(`${a("prefixUpdated")} (${ne})`,"success")}catch(ve){o(ve.message,"error")}finally{R(!1)}},kt=async ae=>{if(ae.preventDefault(),se!==D){o(a("passwordMatchError"),"error");return}if(se.length<8){o(a("passwordMinLength"),"error");return}U(!0);try{await Y.changePassword(I,se),o(a("passwordChangedSuccess"),"success"),z(""),B(""),T("")}catch(ne){o(ne.message,"error")}finally{U(!1)}},Le={saveLabel:a("save"),savedLabel:a("saved")},xe={saveLabel:a("save"),discardLabel:a("discard"),unsavedLabel:a("unsavedChanges"),savedLabel:a("saved")};return x?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(Ga,{className:"size-6",label:a("loading")})}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(Ic,{value:d,onChange:ae=>m(ae),"aria-label":a("settings"),className:"overflow-x-auto",options:[{value:"general",label:a("tabGeneral"),icon:s.jsx(uv,{size:17})},{value:"integrations",label:a("tabIntegrations"),icon:s.jsx(Sm,{size:17})},{value:"proxy",label:a("tabProxy"),icon:s.jsx(Tc,{size:17})},{value:"security",label:a("tabSecurity"),icon:s.jsx(Gm,{size:17})},{value:"storage",label:a("tabStorage"),icon:s.jsx(By,{size:17})},{value:"feedback",label:a("tabFeedback"),icon:s.jsx(Sk,{size:17})},{value:"diagnostics",label:a("tabDiagnostics"),icon:s.jsx(Mr,{size:17})}]}),d==="general"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs(Ye,{className:"flex flex-col gap-4 sm:gap-5",children:[s.jsx(qn,{icon:s.jsx(ul,{size:22}),title:a("prefixTitle"),description:a("prefixDesc"),actions:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted",children:[a("activePrefix"),":"]}),s.jsx($e,{tone:"info",className:"font-mono",children:C})]})}),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:a("prefixPresets")}),s.jsx("div",{className:"flex max-w-full items-center gap-2 overflow-x-auto pb-1",children:kE.map(ae=>{const ne=C===ae;return s.jsx(Oe,{label:ae,size:"md",variant:ne?"primary":"secondary",className:"shrink-0 font-mono",onClick:()=>{N(ae),ht(ae)},children:ae},ae)})})]}),s.jsx(Fe,{label:a("changePrefix"),className:"min-w-[200px] flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{type:"text",className:"h-11 w-20 text-center font-mono sm:w-24",maxLength:3,placeholder:a("prefixPlaceholder"),value:j,onChange:ae=>N(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&ht()}}),s.jsx(fe,{variant:"primary",icon:s.jsx(hi,{size:16}),onClick:()=>ht(),disabled:O||j.trim()===C,loading:O,children:a(O?"saving":"prefixSaveBtn")})]})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-xs font-semibold text-muted sm:text-sm",children:a("prefixPreview")}),s.jsx($e,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||C,"help"]})}),s.jsx($e,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||C,"lang ar"]})}),s.jsx($e,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[j||C,"sticker"]})})]})]}),s.jsxs(Ye,{className:"flex flex-col gap-4",children:[s.jsx(qn,{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(Hn,{label:a("interfaceLanguage"),description:a("interfaceLanguageDesc"),htmlFor:"panel-language",dirty:_.dirty,saving:_.status==="saving",justSaved:_.status==="saved",error:_.error,onSave:()=>_.save(async ae=>r(ae)),onRevert:_.revert,...Le,children:s.jsxs(Ht,{id:"panel-language",value:_.value,onChange:ae=>{const ne=ae.target.value;(ne==="ar"||ne==="en")&&_.setValue(ne)},children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]})}),s.jsx(Hn,{label:a("botLanguage"),description:a("botLanguageDesc"),htmlFor:"bot-language",dirty:J.dirty,saving:J.status==="saving",justSaved:J.status==="saved",error:J.error,onSave:()=>J.save(ae=>de("bot_language",ae)),onRevert:J.revert,...Le,children:s.jsxs(Ht,{id:"bot-language",value:J.value,onChange:ae=>J.setValue(ae.target.value),children:[s.jsx("option",{value:"auto",children:a("langAuto")}),s.jsx("option",{value:"ar",children:a("langAr")}),s.jsx("option",{value:"en",children:a("langEn")})]})}),s.jsx(Hn,{label:a("botTimezone"),description:a("botTimezoneDesc"),htmlFor:"bot-timezone",dirty:ye.dirty,saving:ye.status==="saving",justSaved:ye.status==="saved",error:ye.error,onSave:()=>ye.save(ae=>de("bot_timezone",ae)),onRevert:ye.revert,...Le,children:s.jsx(Ke,{id:"bot-timezone",type:"text",technical:!0,className:"font-mono",placeholder:"Africa/Cairo",value:ye.value,onChange:ae=>ye.setValue(ae.target.value)})})]}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:ae=>{ae.preventDefault(),ce.save(async ne=>{if(ne.min>ne.max)throw new Error(a("delayRangeError"));await de("bot_min_delay_ms",ne.min),await de("bot_max_delay_ms",ne.max)})},onKeyDown:ae=>{ae.key==="Escape"&&ce.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(Fe,{label:a("botMinDelay"),description:a("delaysDesc"),htmlFor:"bot-min-delay",children:s.jsx(Ke,{id:"bot-min-delay",type:"number",value:ce.draft.min,onChange:ae=>ce.setField("min",Number(ae.target.value))})}),s.jsx(Fe,{label:a("botMaxDelay"),htmlFor:"bot-max-delay",children:s.jsx(Ke,{id:"bot-max-delay",type:"number",value:ce.draft.max,onChange:ae=>ce.setField("max",Number(ae.target.value))})})]}),s.jsx(Oc,{dirty:ce.dirty,saving:ce.status==="saving",justSaved:ce.status==="saved",error:ce.error,onDiscard:ce.revert,...xe})]})]}),s.jsxs(Ye,{className:"flex flex-col gap-4",children:[s.jsx(qn,{icon:s.jsx(Or,{size:20}),title:a("shareSettingsTitle"),description:a("shareSettingsDesc")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(fe,{variant:"secondary",icon:s.jsx(Nv,{size:16}),onClick:oe,loading:W,children:a("exportAction")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(Hc,{size:16}),onClick:()=>{var ae;return(ae=me.current)==null?void 0:ae.click()},children:a("importSettings")})]}),s.jsx("input",{ref:me,type:"file",accept:"application/json,.json",className:"hidden",onChange:we})]})]}),d==="integrations"&&s.jsxs(Ye,{className:"flex flex-col gap-5",children:[s.jsx(qn,{icon:s.jsx(Sm,{size:22}),title:a("tabIntegrations"),description:a("integrationsDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[s.jsx(Hn,{label:a("weatherApiKey"),description:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command",htmlFor:"weather-api-key",dirty:Se.dirty,saving:Se.status==="saving",justSaved:Se.status==="saved",error:Se.error,onSave:()=>Se.save(async ae=>{await de("openweathermap_api_key",ae),Se.setValue("")}),onRevert:Se.revert,...Le,children:s.jsx(nl,{id:"weather-api-key",className:"font-mono",placeholder:y.openweathermap_api_key?"••••••••••••":"OpenWeatherMap API Key",value:Se.value,onChange:ae=>Se.setValue(ae.target.value)})}),s.jsx(Hn,{label:a("youtubeApiKey"),description:i==="ar"?"مطلوب لأدوات البحث ومعلومات الفيديوهات من يوتيوب":"Required for YouTube search and video tools",htmlFor:"youtube-api-key",dirty:E.dirty,saving:E.status==="saving",justSaved:E.status==="saved",error:E.error,onSave:()=>E.save(async ae=>{await de("youtube_api_key",ae),E.setValue("")}),onRevert:E.revert,...Le,children:s.jsx(nl,{id:"youtube-api-key",className:"font-mono",placeholder:y.youtube_api_key?"••••••••••••":"YouTube Data API Key",value:E.value,onChange:ae=>E.setValue(ae.target.value)})})]})]}),d==="proxy"&&s.jsxs(Ye,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(qn,{className:"min-w-0 flex-1",icon:s.jsx(Tc,{size:22}),title:a("proxyTitle"),description:a("proxyDesc")}),s.jsx(Fn,{className:"shrink-0",checked:!!p.whatsapp_proxy_enabled,onChange:ae=>be("whatsapp_proxy_enabled",ae)})]}),s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:ae=>{ae.preventDefault(),he.save(async ne=>{await de("whatsapp_proxy_protocol",ne.protocol),await de("whatsapp_proxy_host",ne.host),await de("whatsapp_proxy_port",ne.port),await de("whatsapp_proxy_username",ne.username),ne.password.trim()&&await de("whatsapp_proxy_password",ne.password),he.setDraft({...ne,password:""})})},onKeyDown:ae=>{ae.key==="Escape"&&he.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(Fe,{label:a("proxyProtocol"),htmlFor:"proxy-protocol",children:s.jsxs(Ht,{id:"proxy-protocol",value:he.draft.protocol,onChange:ae=>he.setField("protocol",ae.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(Fe,{label:a("proxyHost"),htmlFor:"proxy-host",children:s.jsx(Ke,{id:"proxy-host",type:"text",technical:!0,className:"font-mono",placeholder:"proxy.example.com",value:he.draft.host,onChange:ae=>he.setField("host",ae.target.value)})}),s.jsx(Fe,{label:a("proxyPort"),htmlFor:"proxy-port",children:s.jsx(Ke,{id:"proxy-port",type:"number",placeholder:"1080",value:he.draft.port,onChange:ae=>he.setField("port",Number(ae.target.value))})}),s.jsx(Fe,{label:a("proxyUsername"),htmlFor:"proxy-username",children:s.jsx(Ke,{id:"proxy-username",type:"text",technical:!0,className:"font-mono",value:he.draft.username,onChange:ae=>he.setField("username",ae.target.value)})}),s.jsx(Fe,{label:a("proxyPassword"),htmlFor:"proxy-password",children:s.jsx(nl,{id:"proxy-password",placeholder:y.whatsapp_proxy_password?"••••••••••••":void 0,value:he.draft.password,onChange:ae=>he.setField("password",ae.target.value)})})]}),s.jsx(Oc,{dirty:he.dirty,saving:he.status==="saving",justSaved:he.status==="saved",error:he.error,onDiscard:he.revert,...xe})]})]}),d==="security"&&s.jsx("div",{className:"flex flex-col gap-5",children:s.jsxs(Ye,{className:"flex max-w-xl flex-col gap-4",children:[s.jsx(qn,{icon:s.jsx(z0,{size:20}),title:a("changePassword")}),s.jsxs("form",{onSubmit:kt,className:"flex flex-col gap-3.5",children:[s.jsx(Fe,{label:a("currentPassword"),htmlFor:"current-password",children:s.jsx(nl,{id:"current-password",required:!0,value:I,onChange:ae=>z(ae.target.value)})}),s.jsx(Fe,{label:a("newPassword"),description:a("passwordMinLength"),htmlFor:"new-password",children:s.jsx(nl,{id:"new-password",required:!0,minLength:8,value:se,onChange:ae=>B(ae.target.value)})}),s.jsx(Fe,{label:a("confirmPassword"),htmlFor:"confirm-password",children:s.jsx(nl,{id:"confirm-password",required:!0,minLength:8,value:D,onChange:ae=>T(ae.target.value)})}),s.jsx(fe,{type:"submit",variant:"primary",className:"mt-2 w-full self-start sm:w-auto",icon:s.jsx(hi,{size:16}),disabled:F,loading:F,children:a(F?"saving":"save")})]})]})}),d==="storage"&&s.jsxs(Ye,{className:"flex flex-col gap-5",children:[s.jsx(qn,{icon:s.jsx(By,{size:22}),title:a("storageTitle"),description:a("storageDesc")}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(Hn,{label:a("forwardTtl"),description:a("forwardTtlDesc"),htmlFor:"forward-ttl",dirty:Q.dirty,saving:Q.status==="saving",justSaved:Q.status==="saved",error:Q.error,onSave:()=>Q.save(ae=>de("forward_score_ttl_days",ae)),onRevert:Q.revert,...Le,children:s.jsx(Ke,{id:"forward-ttl",type:"number",value:Q.value,onChange:ae=>Q.setValue(Number(ae.target.value))})}),s.jsx(Hn,{label:a("maxFetchBytes"),description:a("maxFetchBytesDesc"),htmlFor:"max-fetch-bytes",dirty:V.dirty,saving:V.status==="saving",justSaved:V.status==="saved",error:V.error,onSave:()=>V.save(ae=>de("max_fetch_bytes",ae)),onRevert:V.revert,...Le,children:s.jsx(Ke,{id:"max-fetch-bytes",type:"number",value:V.value,onChange:ae=>V.setValue(Number(ae.target.value))})}),s.jsx(Hn,{label:a("stickerLibraryLimit"),htmlFor:"sticker-library-limit",description:a("stickerLibraryLimitDesc"),dirty:re.dirty,saving:re.status==="saving",justSaved:re.status==="saved",error:re.error,onSave:()=>re.save(ae=>de("sticker_library_limit",ae)),onRevert:re.revert,...Le,children:s.jsx(Ke,{id:"sticker-library-limit",type:"number",min:1,max:1e5,value:re.value,onChange:ae=>re.setValue(Number(ae.target.value))})}),s.jsx(Hn,{label:a("autoDeleteKeepDays"),htmlFor:"auto-delete-keep-days",description:a("autoDeleteKeepDaysDesc"),dirty:te.dirty,saving:te.status==="saving",justSaved:te.status==="saved",error:te.error,onSave:()=>te.save(ae=>de("auto_delete_keep_days",ae)),onRevert:te.revert,...Le,children:s.jsx(Ke,{id:"auto-delete-keep-days",type:"number",min:1,max:365,value:te.value,onChange:ae=>te.setValue(Number(ae.target.value))})})]})]}),d==="feedback"&&s.jsx(vE,{}),d==="diagnostics"&&s.jsx(SE,{}),s.jsx(an,{isOpen:!!H,onClose:()=>X(null),title:a("importTitle"),footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>X(null),children:a("cancel")}),s.jsx(fe,{variant:"primary",onClick:qe,disabled:ue,loading:ue,children:a("importApply")})]}),children:H&&s.jsxs("div",{className:"flex flex-col gap-3 text-xs text-text-main sm:text-sm",children:[s.jsx("p",{className:"text-muted",children:a("importSummary")}),s.jsxs("ul",{className:"flex flex-col gap-1.5 rounded-xl border border-line bg-panel-raised p-4",children:[s.jsxs("li",{children:[a("importPrefix"),":"," ",s.jsx("span",{className:"font-mono font-bold",children:(ze=H.commands)==null?void 0:ze.prefix})]}),s.jsxs("li",{children:[Object.keys(H.settings||{}).length," ",a("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((Ne=H.commands)==null?void 0:Ne.permissions)||{}).length," ",a("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((Pe=H.commands)==null?void 0:Pe.aliases)||{}).length," ",a("importAliasesCount")]}),s.jsxs("li",{children:[(((vt=H.commands)==null?void 0:vt.disabled)||[]).length," ",a("importDisabledCount")]})]})]})})]})};function Uc(a,i){return`${[...(a||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function R1(a,i){const r=URL.createObjectURL(a),o=document.createElement("a");o.href=r,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(r),1500)}async function z1(a,i){return R1(a,i),{ok:!0,via:"browser"}}async function M1(a,i,r){const o=new File([a],i,{type:r});if(typeof navigator.share=="function"&&typeof navigator.canShare=="function"&&navigator.canShare({files:[o]}))try{return await navigator.share({files:[o]}),{ok:!0,via:"share"}}catch(f){if(f instanceof DOMException&&f.name==="AbortError")return{ok:!1,cancelled:!0}}return R1(a,i),{ok:!0,via:"browser"}}async function Qc(a,i,r,o,d,f){const m=await iE(a,i,r,o,d,f);return a==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:m.name||d,dir:m.dir||"Downloads/Levix"}}const Es={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function Xc(a,i,r,o){return{name:a||i,mime:r.type||o,blob:r}}async function Tr(a,i){if(Yc())return Qc("save",`/dashboard/api/stickers/${encodeURIComponent(a.id)}/export?format=${i}`,"GET","",Uc(a.name,i),Es[i]);const r=await Y.exportSticker(a.id,i),o=Xc(r.fileName,Uc(a.name,i),r.blob,Es[i]);return z1(o.blob,o.name)}async function O1(a,i){if(Yc())return Qc("share",`/dashboard/api/stickers/${encodeURIComponent(a.id)}/export?format=${i}`,"GET","",Uc(a.name,i),Es[i]);const r=await Y.exportSticker(a.id,i),o=Xc(r.fileName,Uc(a.name,i),r.blob,Es[i]);return M1(o.blob,o.name,o.mime)}async function EE(a,i){if(Yc())return Qc("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:a,format:i}),`stickers-${i}.zip`,Es.zip);const r=await Y.exportStickers(a,i),o=Xc(r.fileName,`stickers-${i}.zip`,r.blob,Es.zip);return z1(o.blob,o.name)}async function AE(a,i){if(Yc())return Qc("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:a,format:i}),`stickers-${i}.zip`,Es.zip);const r=await Y.exportStickers(a,i),o=Xc(r.fileName,`stickers-${i}.zip`,r.blob,Es.zip);return M1(o.blob,o.name,o.mime)}async function Bm(a){if(a.length)try{await Y.bulkStickers({action:"touch",ids:a})}catch{}}const _E=16*1024*1024,qb=200,TE=10,L1=40,Zc=60,DE=[['"','"'],["'","'"],["“","”"],["«","»"],["„","‟"],["‹","›"]],Pb=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter("en",{granularity:"grapheme"}):null;function RE(a){const i=a.trim();if(i.length<2)return i;for(const[r,o]of DE)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 zE(a){if(!Pb)return[...a].length;let i=0;for(const r of Pb.segment(a))i+=1;return i}function Dr(a){const i=RE(a).normalize("NFC").replace(/\s+/g," ").trim(),r=zE(i);return r<1?"empty":r>L1?"long":null}function ME(a){return a.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(a.name)}function OE(a){return new Promise(i=>{const r=URL.createObjectURL(a),o=new Image;o.onload=()=>{URL.revokeObjectURL(r),i({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(r),i(null)},o.src=r})}function LE(a){return new Promise(i=>{const r=URL.createObjectURL(a),o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{const d={width:o.videoWidth,height:o.videoHeight,duration:o.duration};URL.revokeObjectURL(r),o.src="",i(d)},o.onerror=()=>{URL.revokeObjectURL(r),i(null)},o.src=r})}async function BE(a,i){if(a.size<=0)return"stickerErr_NO_MEDIA";if(a.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(ME(a)){const o=await LE(a);return o?o.width>i.maxSide||o.height>i.maxSide?"stickerErr_DIMENSIONS_TOO_LARGE":Number.isFinite(o.duration)&&o.duration>i.videoSeconds+.05?"stickerErr_VIDEO_TOO_LONG":null:null}const r=await OE(a);return r&&(r.width>i.maxSide||r.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}function UE(a){return!a||a==="transparent"?"transparent":a==="#ffffff"?"white":a==="#000000"?"black":"custom"}const HE=({options:a,onChange:i,canRemoveBackground:r,name:o,onName:d,packId:f,onPack:m,packs:p})=>{var w,C,k;const{t:h}=He(),y=UE(a.background),b=((w=a.removeBackground)==null?void 0:w.tolerance)??.15,x=a.rotate??0;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{children:[s.jsx(ks,{htmlFor:"sticker-fit",children:h("fit")}),s.jsxs(Ht,{id:"sticker-fit",value:a.fit||"contain",onChange:j=>i({fit:j.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")," (",(a.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:a.zoom??1,onChange:j=>i({zoom:Number(j.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-x",children:[h("panX")," (",(a.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:a.panX??0,onChange:j=>i({panX:Number(j.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-y",children:[h("panY")," (",(a.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:a.panY??0,onChange:j=>i({panY:Number(j.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(fe,{onClick:()=>i({panX:0,panY:0,zoom:1}),children:h("resetPan")}),s.jsxs(fe,{onClick:()=>{const j=(x+90)%360;i({rotate:j})},children:[h("rotateQuarter")," (",x,"°)"]})]}),s.jsx(js,{"aria-label":h("background"),className:"max-w-full flex-wrap",value:y,onChange:j=>{i(j==="transparent"?{background:"transparent"}:j==="white"?{background:"#ffffff"}:j==="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")}]}),y==="custom"&&s.jsx("input",{type:"color","aria-label":h("customColor"),value:/^#[0-9a-f]{6}$/i.test(a.background||"")?a.background:"#3366ff",onChange:j=>i({background:j.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(zr,{checked:((C=a.removeBackground)==null?void 0:C.mode)==="plain",onChange:j=>i({removeBackground:j.target.checked?{mode:"plain",tolerance:.15}:null}),label:h("removePlainBackground"),description:h("stickerRemoveHint")}),((k=a.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")," (",b.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:b,onChange:j=>i({removeBackground:{mode:"plain",tolerance:Number(j.target.value)}}),className:"w-full accent-brand-blue"})]})]}),s.jsxs("div",{children:[s.jsx(ks,{htmlFor:"sticker-name",children:h("stickerName")}),s.jsx(Ke,{id:"sticker-name",value:o,maxLength:Zc,dir:"auto",onChange:j=>d(j.target.value),placeholder:h("stickerNamePlaceholder")})]}),s.jsxs("div",{children:[s.jsx(ks,{htmlFor:"sticker-pack",children:h("targetPack")}),s.jsxs(Ht,{id:"sticker-pack",value:f,onChange:j=>m(j.target.value),children:[s.jsx("option",{value:"",children:h("noPack")}),p.map(j=>s.jsx("option",{value:j.id,children:j.name},j.id))]})]})]})},qE=({options:a,onChange:i,kind:r,durationMs:o,limits:d,animatedOk:f})=>{const{t:m}=He();if(!(r==="video"||r==="gif"))return null;const h=o>0?o/1e3:d.videoSeconds,y=Math.min(d.videoSeconds,Math.max(0,h)),b=(x,w)=>{const C=Math.min(y,Math.max(0,x)),k=Math.min(d.stickerSeconds,Math.max(.5,w));i({trim:{start:C,duration:k}})};return s.jsxs(Ye,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx(zr,{checked:!!a.trim,onChange:x=>{x.target.checked?b(0,Math.min(d.stickerSeconds,Math.max(.5,h))):i({trim:null})},label:s.jsx("span",{className:"font-bold",children:m("trim")})}),a.trim&&s.jsxs("span",{className:"font-mono text-xs text-muted",dir:"ltr",children:[a.trim.start.toFixed(1),"s →"," ",(a.trim.start+a.trim.duration).toFixed(1),"s"]})]}),!f&&s.jsx("p",{className:"text-xs text-warn",children:m("animatedUnavailable")}),s.jsx("p",{className:"text-xs text-muted",children:m(r==="gif"?"gifTrimNote":"trimApplied")}),a.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[m("trimStart")," (",a.trim.start.toFixed(1)," ",m("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:y,step:.1,value:a.trim.start,onChange:x=>{var w;return b(Number(x.target.value),((w=a.trim)==null?void 0:w.duration)??.5)},className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-duration",children:[m("trimDuration")," (",a.trim.duration.toFixed(1)," ",m("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:a.trim.duration,onChange:x=>{var w;return b(((w=a.trim)==null?void 0:w.start)??0,Number(x.target.value))},className:"w-full accent-brand-blue"})]})]})},Vt=512;function PE(a,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,y=h?i:a,b=h?a:i,w=(o==="cover"?Vt/Math.min(y,b):Vt/Math.max(y,b))*d,C=Math.max(1,Math.round(y*w)),k=Math.max(1,Math.round(b*w)),j=Math.round((Vt-C)/2+f*Math.abs(Vt-C)/2),N=Math.round((Vt-k)/2+m*Math.abs(Vt-k)/2);return{width:C,height:k,x:j,y:N}}const GE='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function VE(a){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(a)}function IE(a){const i=/^#([0-9a-f]{6})$/i.exec(a.trim());if(!i)return"#000000";const r=Number.parseInt(i[1],16),o=r>>16&255,d=r>>8&255,f=r&255;return(.2126*o+.7152*d+.0722*f)/255>.6?"#000000":"#ffffff"}function FE(a,i,r,o,d,f){const m=Math.max(0,Math.min(f,o/2,d/2));a.beginPath(),a.moveTo(i+m,r),a.arcTo(i+o,r,i+o,r+d,m),a.arcTo(i+o,r+d,i,r+d,m),a.arcTo(i,r+d,i,r,m),a.arcTo(i,r,i+o,r,m),a.closePath(),a.fill()}function KE(a,i,r,o){const d=a==="center"?"center":a==="start"?i==="rtl"?"right":"left":i==="rtl"?"left":"right";return d==="center"?-r/2-o:d==="right"?-r-o:-o}function B1(a,i,r){const o=[];for(const d of i){if(!d.text)continue;const f=VE(d.text)?"rtl":"ltr";a.save(),a.translate(d.x,d.y),a.rotate(d.rotate*Math.PI/180),a.direction=f,a.font=`${d.fontSize}px ${GE}`,a.textAlign=d.align,a.textBaseline="middle";const m=a.measureText(d.text).width,p=d.background?d.fontSize*.4:8,h=d.background?d.fontSize*.22:6,y=m+p*2,b=d.fontSize*1.25+h*2,x=KE(d.align,f,m,p),w=-b/2;d.background&&(a.fillStyle="rgba(0, 0, 0, 0.55)",FE(a,x,w,y,b,b/2)),r===d.id&&(a.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue("--color-brand-cyan").trim(),a.lineWidth=2,a.strokeRect(x-3,w-3,y+6,b+6)),d.outline&&(a.lineJoin="round",a.miterLimit=2,a.lineWidth=Math.max(2,d.fontSize/10),a.strokeStyle=IE(d.color),a.strokeText(d.text,0,0)),a.fillStyle=d.color,a.fillText(d.text,0,0),a.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:x,top:w,right:x+y,bottom:w+b})}return o}function YE(a,i,r){for(let o=a.length-1;o>=0;o--){const d=a[o],f=i-d.cx,m=r-d.cy,p=-d.rotate*Math.PI/180,h=f*Math.cos(p)-m*Math.sin(p),y=f*Math.sin(p)+m*Math.cos(p);if(h>=d.left&&h<=d.right&&y>=d.top&&y<=d.bottom)return d.id}return null}function QE(a){const i=a.filter(d=>d.text.trim().length>0);if(!i.length)return;const r=document.createElement("canvas");r.width=512,r.height=512;const o=r.getContext("2d");if(o)return B1(o,i,null),r.toDataURL("image/png")}const XE=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function gc(a,i,r){return Math.min(r,Math.max(i,a))}const ZE=({mediaUrl:a,kind:i,width:r,height:o,options:d,layers:f,selectedId:m,onPan:p,onSelect:h,onMoveLayer:y,label:b})=>{const x=v.useRef(null),w=v.useRef(null),C=v.useRef([]),k=v.useRef(null),j=v.useRef(null),N=v.useRef(1),O=d.rotate??0,R=r>0&&o>0?PE(r,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:O}):null,I=O===90||O===270,z=R?I?R.height:R.width:0,se=R?I?R.width:R.height:0,B=R?R.x+(R.width-z)/2:0,D=R?R.y+(R.height-se)/2:0,T=d.background&&d.background!=="transparent"?d.background:null;v.useEffect(()=>{const ie=x.current;if(!ie)return;const H=()=>{const me=Math.min(ie.clientWidth,512);N.current=me>0?me/Vt:1,ie.style.setProperty("--stage-scale",String(N.current))};H();const X=new ResizeObserver(H);return X.observe(ie),()=>X.disconnect()},[]),v.useEffect(()=>{const ie=w.current;if(!ie)return;const H=window.devicePixelRatio||1;ie.width=Vt*H,ie.height=Vt*H;const X=ie.getContext("2d");X&&(X.setTransform(H,0,0,H,0,0),X.clearRect(0,0,Vt,Vt),C.current=B1(X,f,m))},[f,m]),v.useEffect(()=>{const ie=j.current,H=d.trim;if(!ie||!H||i!=="video"||!a)return;const X=H.start,me=H.start+H.duration,de=()=>{(ie.currentTime<X-.05||ie.currentTime>=me-.02)&&(ie.currentTime=X)};return ie.addEventListener("timeupdate",de),ie.addEventListener("ended",de),ie.currentTime=X,()=>{ie.removeEventListener("timeupdate",de),ie.removeEventListener("ended",de)}},[d.trim,i,a]);const F=ie=>{const H=ie.currentTarget.getBoundingClientRect();return{x:(ie.clientX-H.left)/H.width*Vt,y:(ie.clientY-H.top)/H.height*Vt}},U=ie=>{if(ie.button!==0)return;ie.currentTarget.setPointerCapture(ie.pointerId);const H=F(ie),X=YE(C.current,H.x,H.y);if(X){const me=f.find(de=>de.id===X);if(!me)return;h(X),k.current={kind:"layer",id:X,x:H.x,y:H.y,originX:me.x,originY:me.y};return}h(null),R&&(k.current={kind:"pan",x:H.x,y:H.y,panX:d.panX??0,panY:d.panY??0,placeW:R.width,placeH:R.height})},W=ie=>{const H=k.current;if(!H)return;const X=F(ie);if(H.kind==="layer"){y(H.id,gc(H.originX+(X.x-H.x),0,Vt),gc(H.originY+(X.y-H.y),0,Vt));return}const me=Math.abs(Vt-H.placeW),de=Math.abs(Vt-H.placeH),be=me<1?H.panX:gc(H.panX+(X.x-H.x)*2/me,-1,1),_=de<1?H.panY:gc(H.panY+(X.y-H.y)*2/de,-1,1);p(be,_)},ee=()=>{k.current=null},ue={position:"absolute",left:B,top:D,width:z,height:se,transform:`rotate(${O}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:x,className:"w-full",children:s.jsx("div",{className:"relative mx-auto overflow-hidden rounded-2xl border border-line",style:{width:"calc(512px * var(--stage-scale, 1))",height:"calc(512px * var(--stage-scale, 1))"},children:s.jsxs("div",{role:"img","aria-label":b,className:"absolute top-0 start-0 origin-top-left bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:32px_32px]",style:{width:Vt,height:Vt,transform:"scale(var(--stage-scale, 1))"},children:[T&&s.jsx("div",{className:"absolute inset-0",style:{background:T}}),R&&i==="video"?s.jsx("video",{ref:j,src:a,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:ue}):R&&s.jsx("img",{src:a,alt:"",draggable:!1,style:ue}),s.jsx("canvas",{ref:w,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:U,onPointerMove:W,onPointerUp:ee,onPointerCancel:ee})]})})})},JE=({layers:a,selectedId:i,onSelect:r,onChange:o,onDelete:d,onAddText:f,onAddEmoji:m})=>{const{t:p}=He(),h=a.find(y=>y.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(fe,{onClick:f,children:p("addText")}),s.jsx(fe,{onClick:()=>m("😀"),children:p("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(ks,{children:p("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:XE.map(y=>s.jsx(Oe,{label:y,variant:"secondary",onClick:()=>m(y),children:s.jsx("span",{className:"text-lg leading-none",children:y})},y))}),s.jsx(ks,{htmlFor:"emoji-free",children:p("customEmoji")}),s.jsx(Ke,{id:"emoji-free",className:"mt-1",placeholder:p("emojiInputLabel"),onKeyDown:y=>{if(y.key==="Enter"){const b=y.currentTarget.value.trim();b&&(m(b),y.currentTarget.value="")}}})]}),a.length===0&&s.jsx("p",{className:"text-xs text-muted",children:p("noLayers")}),a.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:a.map(y=>{const b=y.id===i;return s.jsx(fe,{variant:b?"secondary":"ghost","aria-pressed":b,onClick:()=>r(y.id),className:Ue("h-auto w-full justify-start",b&&"border-brand-blue bg-brand-blue/10"),children:s.jsx("span",{className:"truncate",children:y.text||p("textPlaceholder")})},y.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(ks,{htmlFor:"layer-text",children:p("textContent")}),s.jsx(Ke,{id:"layer-text",value:h.text,onChange:y=>o(h.id,{text:y.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:y=>o(h.id,{fontSize:Number(y.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:y=>o(h.id,{color:y.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx(js,{"aria-label":p("textAlignment"),value:h.align,onChange:y=>o(h.id,{align:y}),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:y=>o(h.id,{rotate:Number(y.target.value)}),className:"w-full accent-brand-blue"}),s.jsx(zr,{checked:h.outline,onChange:y=>o(h.id,{outline:y.target.checked}),label:p("textOutline")}),s.jsx(zr,{checked:h.background,onChange:y=>o(h.id,{background:y.target.checked}),label:p("textBackground")}),s.jsx(fe,{variant:"danger",onClick:()=>d(h.id),icon:s.jsx(In,{size:16}),children:p("deleteLayer")})]})]})},U1=({open:a,title:i,packs:r,onClose:o,onPick:d,onCreated:f})=>{const{t:m}=He(),{toast:p}=Et(),[h,y]=v.useState(""),[b,x]=v.useState(null),[w,C]=v.useState(!1);v.useEffect(()=>{a||(y(""),x(null))},[a]);const k=async()=>{if(Dr(h)){x(m("packNameLength"));return}C(!0),x(null);try{const N=await Y.createPack(h.trim());y(""),f(N),d(N.id),p(m("packCreated"),"success")}catch(N){p(wt(m,N),"error")}finally{C(!1)}};return s.jsx(an,{isOpen:a,onClose:o,title:i,footer:s.jsx(fe,{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(j=>s.jsxs(fe,{variant:"ghost",onClick:()=>d(j.id),className:"h-auto w-full min-w-0 justify-start px-3 py-2.5",children:[s.jsx(An,{className:"flex-1 text-start",children:j.name}),s.jsx("span",{className:"ms-2 shrink-0 font-medium text-muted",children:j.count})]},j.id))}),s.jsxs("div",{className:"flex flex-col gap-1.5 border-t border-line pt-3",children:[s.jsx(ks,{htmlFor:"new-pack-name",children:m("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ke,{id:"new-pack-name",value:h,onChange:j=>{const N=j.target.value;y(N),b&&x(Dr(N)?m("packNameLength"):null)},placeholder:m("newPackPlaceholder"),maxLength:80,dir:"auto"}),s.jsx(fe,{variant:"primary",onClick:k,disabled:w,children:m("createPack")})]}),b&&s.jsx("p",{className:"text-xs text-danger",children:b})]})]})})},$E=600;function WE(){const[a,i]=v.useState(null),[r,o]=v.useState(!1),[d,f]=v.useState(null),m=v.useRef(0);return v.useEffect(()=>()=>{m.current+=1},[]),{job:a,running:r,submitError:d,start:async y=>{const b=++m.current;f(null),i(null),o(!0);try{const{jobId:x}=await Y.createStickerJob(y);for(;m.current===b;){const w=await Y.getStickerJob(x);if(m.current!==b)return;if(i(w),w.state==="done"||w.state==="failed")break;await new Promise(C=>setTimeout(C,$E))}}catch(x){m.current===b&&f(x)}finally{m.current===b&&o(!1)}},reset:()=>{m.current+=1,i(null),f(null),o(!1)}}}const gm={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function eA(a,i){return a(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const tA=({capabilities:a,capsError:i,onRetryCaps:r,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:m,onCreated:p})=>{var we,qe,lt,ht,kt,Le,xe,ze,Ne,Pe,vt,ae;const{t:h}=He(),{toast:y}=Et(),b=WE(),[x,w]=v.useState(null),[C,k]=v.useState(null),[j,N]=v.useState("PANEL_UPLOAD"),[O,R]=v.useState(!1),[I,z]=v.useState(!1),[se,B]=v.useState(gm),[D,T]=v.useState([]),[F,U]=v.useState(null),[W,ee]=v.useState(""),[ue,ie]=v.useState(""),[H,X]=v.useState([]),[me,de]=v.useState(!1),[be,_]=v.useState(!1),J=v.useRef(null),ye=v.useRef(null),Se=v.useRef(async()=>{});v.useEffect(()=>(Y.getPacks().then(ne=>X(ne.packs)).catch(()=>{}),()=>{J.current&&URL.revokeObjectURL(J.current)}),[]);const E=ne=>{J.current&&URL.revokeObjectURL(J.current);const ve=URL.createObjectURL(ne);J.current=ve,k(ve)},Q=async(ne,ve,Te,jt,Xt)=>{if(!(a!=null&&a.webp))return;const Tt=ne instanceof File?ne:new File([ne],ve,{type:ne.type}),sn=await BE(Tt,a.limits);if(sn){y(h(sn),"error");return}R(!0),N(Te);try{const qt=jt?await A1(jt,ve,a.limits.uploadBytes):Xt?await Y.uploadExistingStickerSource(Xt):await Y.uploadStickerSource(Tt,ve);E(Tt),w(qt),B(gm),y(h("uploadReady"),"success")}catch(qt){y(wt(h,qt),"error")}finally{R(!1)}};Se.current=Q,v.useEffect(()=>{!o||!a||o===ye.current||(ye.current=o,d(),Promise.resolve(o.blob).then(ne=>Se.current(ne,o.name,o.source,o.token,o.existingId)).catch(ne=>y(wt(h,ne),"error")))},[o,a,d]);const V=()=>{b.reset(),w(null),ee(""),ie(""),T([]),U(null),B(gm),N("PANEL_UPLOAD"),J.current&&URL.revokeObjectURL(J.current),J.current=null,k(null),ye.current=null},re=()=>{if(!x)return null;const ne=W.trim();if([...ne].length>Zc)return y(h("stickerNameTooLong"),"warning"),null;const ve=QE(D);return{uploadId:x.uploadId,options:se,...ve?{overlay:ve}:{},...ne?{name:ne}:{},...ue?{packId:ue}:{},source:j}},te=()=>{const ne=re();ne&&b.start(ne)},ce=async(ne,ve)=>{ne.ok&&(ne.via==="host"?y(rn(h("stickerShareSaved"),{dir:ne.dir}),"success"):ne.via==="share"?y(h("shareDone"),"success"):y(h("downloaded"),"success"),await Bm([ve.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(fe,{onClick:r,children:h("retryLoad")})]});if(!a)return s.jsx(Cs,{text:h("loading")});if(!a.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:h("stickerErr_ENCODER_MISSING")});const he=((we=b.job)==null?void 0:we.state)==="done"?b.job.sticker:null;if(he)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:he.url,alt:he.name||h("stickerPreview"),className:"w-full h-full object-contain"})}),((qe=b.job)==null?void 0:qe.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:h("alreadyInLibrary")}),((lt=b.job)==null?void 0:lt.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:h("qualityReduced")}),((ht=b.job)==null?void 0:ht.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(Hc,{size:18}),onClick:()=>{Tr(he,"webp").then(ne=>ce(ne,he)).catch(ne=>y(wt(h,ne),"error"))}}),s.jsx(Oe,{label:h("shareSticker"),icon:s.jsx(Or,{size:18}),onClick:()=>{O1(he,"webp").then(ne=>ce(ne,he)).catch(ne=>y(wt(h,ne),"error"))}}),s.jsx(fe,{disabled:!f,title:f?void 0:h("notConnectedHint"),onClick:()=>de(!0),children:h("sendViaWhatsapp")}),s.jsx(fe,{onClick:()=>_(!0),children:h("addToPack")}),s.jsx(fe,{variant:"primary",onClick:V,children:h("createAnother")}),s.jsx(fe,{onClick:m,children:h("goToLibrary")}),s.jsxs(aa,{label:h("moreActions"),children:[s.jsx(st,{onSelect:()=>{he.animated&&y(h("firstFrameHint"),"info"),Tr(he,"png").then(ne=>ce(ne,he)).catch(ne=>y(wt(h,ne),"error"))},children:h("downloadPng")}),he.animated&&s.jsx(st,{disabled:!a.gif,title:h("gifOnlyAnimated"),onSelect:()=>{Tr(he,"gif").then(ne=>ce(ne,he)).catch(ne=>y(wt(h,ne),"error"))},children:h("downloadGif")})]})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:h("notConnectedHint")}),s.jsx(nh,{open:me,busy:!1,onClose:()=>de(!1),onPick:ne=>{Y.sendStickers({ids:[he.id],jid:ne}).then(ve=>{ve.sent>0?(y(h("stickerSent"),"success"),de(!1),p()):y(h("stickerErr_NOT_CONNECTED"),"error")}).catch(ve=>y(wt(h,ve),"error"))}}),s.jsx(U1,{open:be,title:h("addToPack"),packs:H,onClose:()=>_(!1),onCreated:ne=>X(ve=>[...ve,ne]),onPick:ne=>{Y.bulkStickers({action:"addToPack",ids:[he.id],packId:ne}).then(()=>{y(h("addedToPack"),"success"),_(!1),p()}).catch(ve=>y(wt(h,ve),"error"))}})]});const oe=b.submitError||((kt=b.job)==null?void 0:kt.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:[!x&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${I?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:ne=>{Cc()&&(ne.preventDefault(),sE().then(async ve=>{if(!ve)return;const Te=await fetch(ve.url);if(!Te.ok)throw new Error("source unavailable");await Q(await Te.blob(),ve.name,"PANEL_UPLOAD",ve.token)}).catch(ve=>y(wt(h,ve),"error")))},onDragOver:ne=>{ne.preventDefault(),z(!0)},onDragLeave:()=>z(!1),onDrop:ne=>{if(ne.preventDefault(),z(!1),Cc())return;const ve=ne.dataTransfer.files[0];ve&&Q(ve,ve.name,"PANEL_UPLOAD")},children:[s.jsx(Nv,{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:Cc(),onChange:ne=>{var Te;const ve=(Te=ne.target.files)==null?void 0:Te[0];ne.target.value="",ve&&Q(ve,ve.name,"PANEL_UPLOAD")}})]}),O&&s.jsx(Cs,{text:h("loading")}),x&&C&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:rn(h("stickerUploadInfo"),{kind:eA(h,x.kind),size:Math.max(1,Math.round(x.size/1024))})}),s.jsx(ZE,{mediaUrl:C,kind:x.kind,width:x.width,height:x.height,options:se,layers:D,selectedId:F,label:h("previewStage"),onPan:(ne,ve)=>B(Te=>({...Te,panX:ne,panY:ve})),onSelect:U,onMoveLayer:(ne,ve,Te)=>T(jt=>jt.map(Xt=>Xt.id===ne?{...Xt,x:ve,y:Te}:Xt))}),s.jsx(qE,{options:se,onChange:ne=>B(ve=>({...ve,...ne})),kind:x.kind,durationMs:x.durationMs,limits:a.limits,animatedOk:a.animated})]}),(b.running||((Le=b.job)==null?void 0:Le.state)==="queued"||((xe=b.job)==null?void 0:xe.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((((ze=b.job)==null?void 0:ze.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:cC(h,((Ne=b.job)==null?void 0:Ne.state)==="queued"?"queued":(Pe=b.job)==null?void 0:Pe.stage)})]}),oe&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:b.submitError?wt(h,b.submitError):th(h,(ae=(vt=b.job)==null?void 0:vt.error)==null?void 0:ae.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(fe,{variant:"primary",onClick:te,children:h("tryAgain")}),s.jsx(fe,{onClick:V,children:h("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[x&&s.jsx(HE,{options:se,onChange:ne=>B(ve=>({...ve,...ne})),canRemoveBackground:a.backgroundRemoval.includes("plain"),name:W,onName:ee,packId:ue,onPack:ie,packs:H}),x&&s.jsx(JE,{layers:D,selectedId:F,onSelect:U,onChange:(ne,ve)=>T(Te=>Te.map(jt=>jt.id===ne?{...jt,...ve}:jt)),onDelete:ne=>{T(ve=>ve.filter(Te=>Te.id!==ne)),U(ve=>ve===ne?null:ve)},onAddText:()=>{const ne=crypto.randomUUID();T(ve=>[...ve,{id:ne,text:h("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),U(ne)},onAddEmoji:ne=>{const ve=crypto.randomUUID();T(Te=>[...Te,{id:ve,text:ne,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),U(ve)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(fe,{variant:"primary",disabled:!x||b.running||O,onClick:te,icon:s.jsx(ol,{size:16}),children:h("createBtn")}),x&&s.jsx(fe,{onClick:V,disabled:b.running,children:h("clearLbl")})]})]})]})};let Ec=null,Ac=!1,va=null;function Gb(a){va=a}async function nA(a,i){var r;try{const o=await A1(a,i,_E),{jobId:d}=await Y.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await Y.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 Bt?o.code:void 0})}finally{Ac=!1}}function aA(){if(Ac)return Ec;const a=lE();return(a==null?void 0:a.intent)==="create"?Ec={blob:fetch(a.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:a.name||"sticker",source:"MEDIA_HUB",token:a.token}:(a==null?void 0:a.intent)==="save"&&!Ac&&(Ac=!0,nA(a.token,a.name||"sticker")),Ec}function sA(){Ec=null}const H1=({count:a,animatedSelected:i,canRemove:r,sendReason:o,exportReason:d,onSelectAll:f,selectAllLabel:m,onClear:p,onFavorite:h,onUnfavorite:y,onAdd:b,onMove:x,onRemove:w,onDownload:C,onConvert:k,onShare:j,onSend:N,onDelete:O})=>{const{t:R}=He();return a===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(Ye,{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:rn(R("nSelected"),{n:a})}),s.jsx(Oe,{label:a>1?R("downloadZip"):R("download"),icon:s.jsx(Hc,{size:16}),onClick:C,disabled:!!d}),s.jsx(Oe,{label:R("sendViaWhatsapp"),icon:s.jsx(pi,{size:16,className:"rtl:-scale-x-100"}),onClick:N,disabled:!!o}),s.jsx(Oe,{label:R("shareSticker"),icon:s.jsx(Or,{size:16}),onClick:j}),s.jsxs(aa,{label:R("moreActions"),children:[s.jsx(st,{onSelect:f,children:m}),s.jsx(st,{onSelect:p,children:R("clearSelection")}),s.jsx(Ar,{}),s.jsx(st,{onSelect:h,children:R("favorite")}),s.jsx(st,{onSelect:y,children:R("unfavorite")}),s.jsx(Ar,{}),s.jsx(st,{onSelect:b,children:R("addToPack")}),s.jsx(st,{onSelect:x,children:R("moveToPack")}),r&&s.jsx(st,{onSelect:w,children:R("removeFromPack")}),s.jsx(st,{onSelect:k,disabled:!!d,children:R("convertToImage")}),s.jsx(Ar,{}),s.jsx(st,{danger:!0,onSelect:O,children:R("delete")})]}),s.jsx(Oe,{variant:"ghost",label:R("clearSelection"),icon:s.jsx(Kn,{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:R("firstFrameHint")})]})]})})},lA=({open:a,busy:i,count:r,inUse:o,packs:d,onClose:f,onConfirm:m,onConfirmEverywhere:p})=>{const{t:h}=He();return s.jsx(an,{isOpen:a,onClose:f,title:h("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[s.jsx(fe,{onClick:f,disabled:i,children:h("cancel")}),o?s.jsx(fe,{variant:"danger",onClick:p,disabled:i,children:h("deleteEverywhere")}):s.jsx(fe,{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:rn(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((y,b)=>s.jsxs(v.Fragment,{children:[b>0&&", ",s.jsx(An,{as:"bdi",children:y.name})]},y.id))]}),s.jsx("p",{className:"text-xs text-muted",children:h("deleteEverywhereHint")})]}):s.jsx("p",{children:h("deleteConfirm")})]})})},iA="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",rA=({sticker:a,packs:i,isConnected:r,gifEnabled:o,onClose:d,onRename:f,onFavorite:m,onAddToPack:p,onRemoveFromPack:h,onDownload:y,onShare:b,onSend:x,onDelete:w,onOpenInCreate:C})=>{const{t:k}=He(),[j,N]=v.useState(""),[O,R]=v.useState("");if(v.useEffect(()=>{N((a==null?void 0:a.name)||""),R("")},[a]),!a)return null;const I=i.filter(B=>a.packIds.includes(B.id)),z=i.filter(B=>!a.packIds.includes(B.id)),se=a.animated&&o?"gif":"webp";return s.jsx(an,{isOpen:!!a,onClose:d,title:s.jsx(An,{children:a.name||k("stickerPreview")}),maxWidth:"38rem",footer:s.jsx("div",{className:"flex w-full justify-end gap-2",children:s.jsx(fe,{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 ${iA}`,children:[s.jsx("img",{src:a.url,alt:a.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(se==="gif"?"downloadGif":"downloadWebp"),icon:s.jsx(Hc,{size:16}),onClick:()=>y(se)}),s.jsx(Oe,{label:k("shareSticker"),icon:s.jsx(Or,{size:16}),onClick:b})]})]}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(fe,{variant:"primary",size:"sm",className:"h-auto min-w-0 flex-1 py-2",onClick:x,disabled:!r,title:r?void 0:k("notConnectedHint"),icon:s.jsx(pi,{size:16,className:"rtl:-scale-x-100"}),children:s.jsx("span",{className:"min-w-0 break-words",children:k("sendViaWhatsapp")})}),s.jsx(Oe,{label:a.favorite?k("unfavorite"):k("favorite"),"aria-pressed":a.favorite,onClick:()=>m(!a.favorite),icon:s.jsx(qc,{size:16,className:a.favorite?"fill-warn text-warn":void 0})}),s.jsx("span",{className:"shrink-0",children:s.jsxs(aa,{label:k("moreActions"),align:"end",children:[s.jsx(st,{onSelect:()=>y("webp"),children:k("downloadWebp")}),s.jsx(st,{title:a.animated?k("firstFrameHint"):void 0,onSelect:()=>y("png"),children:k("downloadPng")}),a.animated&&s.jsx(st,{disabled:!o,title:k("gifOnlyAnimated"),onSelect:()=>y("gif"),children:k("downloadGif")}),s.jsx(st,{onSelect:C,children:k("openInCreate")}),s.jsx(Ar,{}),s.jsx(st,{danger:!0,onSelect:w,children:k("delete")})]})})]}),a.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(Ke,{value:j,onChange:B=>N(B.target.value),maxLength:Zc,dir:"auto","aria-label":k("stickerName"),placeholder:k("stickerNamePlaceholder"),className:"min-w-0 flex-1"}),s.jsx(fe,{variant:"secondary",onClick:()=>f(j.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")}),I.length===0?s.jsx("p",{className:"text-xs text-muted",children:k("notInPack")}):s.jsx("ul",{className:"flex flex-col gap-1.5",children:I.map(B=>s.jsxs("li",{className:"flex items-center justify-between gap-2",children:[s.jsx(An,{className:"flex-1 text-sm",children:B.name}),s.jsx(Oe,{label:k("removeFromPack"),variant:"ghost",icon:s.jsx(Kn,{size:16}),onClick:()=>h(B.id)})]},B.id))}),z.length>0&&s.jsxs("div",{className:"mt-2 flex gap-2",children:[s.jsxs(Ht,{value:O,onChange:B=>R(B.target.value),"aria-label":k("addToPack"),children:[s.jsx("option",{value:"",children:k("selectPack")}),z.map(B=>s.jsx("option",{value:B.id,children:B.name},B.id))]}),s.jsx(fe,{variant:"primary",disabled:!O,onClick:()=>O&&p(O),children:k("addToPack")})]})]})]})})};function oA(a){const{t:i}=He(),{toast:r}=Et(),[o,d]=v.useState(null),[f,m]=v.useState(!1);return{phase:o,busy:f,requestDelete:b=>{b.length&&d({kind:"ask",ids:b})},run:async(b,x)=>{var w;m(!0);try{if(b.length===1&&!x){try{await Y.deleteSticker(b[0],!1),r(i("deleted"),"success"),d(null),a()}catch(N){if(N instanceof Bt&&N.code==="IN_USE"){const O=Array.isArray((w=N.data)==null?void 0:w.packs)?N.data.packs:[];d({kind:"inUse",ids:b,packs:O,otherSkipped:0})}else r(wt(i,N),"error")}return}const C=await Y.bulkStickers({action:"delete",ids:b,confirm:x}),k=C.skipped.filter(N=>N.code==="IN_USE").map(N=>N.id),j=C.skipped.length-k.length;if(!x&&k.length>0){d({kind:"inUse",ids:k,packs:[],otherSkipped:j});return}j>0?r(i("skippedOther"),"warning"):r(i("deleted"),"success"),d(null),a()}catch(C){r(wt(i,C),"error")}finally{m(!1)}},close:()=>{f||d(null)}}}function cA(a,i,r){const o=new Map(r.map(f=>[f.id,f.name])),d=new Map;for(const f of a){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 q1({items:a,packs:i,selectedIds:r,clearSelection:o,reload:d,fromPackId:f,isConnected:m,gifEnabled:p,onOpenInCreate:h,onPackCreated:y}){var de,be,_;const{t:b}=He(),{toast:x}=Et(),w=v.useRef(!1),[C,k]=v.useState(null),[j,N]=v.useState(null),[O,R]=v.useState([]),[I,z]=v.useState([]),[se,B]=v.useState(!1),D=oA(()=>{k(null),o(),d()}),T=a.find(J=>J.id===C)||null,F=r.length>qb?b("stickerExportLimit"):null,U=m?r.length>TE?b("stickerSendLimit"):null:b("notConnectedHint"),W=((de=D.phase)==null?void 0:de.kind)==="inUse"?D.phase.packs.length?D.phase.packs:cA(D.phase.ids,a,i):[],ee=J=>{J.ok&&(J.via==="host"?x(rn(b("stickerShareSaved"),{dir:J.dir}),"success"):J.via==="share"?x(b("shareDone"),"success"):x(b("downloaded"),"success"))},ue=async J=>{if(!w.current){w.current=!0;try{await J()}catch(ye){x(wt(b,ye),"error")}finally{w.current=!1}}},ie=J=>a.find(ye=>ye.id===J),H=(J,ye,Se)=>ue(async()=>{if(!J.length||J.length>qb)return;const E=J.length===1?ie(J[0]):null,Q=J.some(re=>{var te;return(te=ie(re))==null?void 0:te.animated});ye==="png"&&Q&&x(b("firstFrameHint"),"info");const V=J.length===1&&E?await(Se?O1(E,ye):Tr(E,ye)):await(Se?AE(J,ye):EE(J,ye));ee(V),V.ok&&(await Bm(J),d())}),X=(J,ye)=>ue(async()=>{if(!J.length)return;const Se=await Y.bulkStickers({action:ye?"favorite":"unfavorite",ids:J});x(Se.skipped.length?b("skippedOther"):b("saved"),Se.skipped.length?"warning":"success"),d()}),me=(J,ye,Se)=>ue(async()=>{if(!Se.length)return;const E=await Y.bulkStickers({action:J,ids:Se,packId:ye,...J==="moveToPack"&&f?{fromPackId:f}:{}}),Q=b(J==="addToPack"?"addedToPack":"movedToPack");x(E.skipped.length?b("skippedOther"):Q,E.skipped.length?"warning":"success"),N(null),d()});return{exportReason:F,sendReason:U,openDetail:J=>k(J.id),toggleFavorite:J=>void X([J.id],!J.favorite),favorite:()=>void X(r,!0),unfavorite:()=>void X(r,!1),askAdd:()=>{R(r),N("add")},askMove:()=>{R(r),N("move")},remove:()=>{!f||!r.length||ue(async()=>{const J=await Y.bulkStickers({action:"removeFromPack",ids:r,packId:f});x(J.skipped.length?b("skippedOther"):b("removedFromPack"),J.skipped.length?"warning":"success"),o(),d()})},download:()=>void H(r,"webp",!1),convert:()=>void H(r,"png",!1),share:()=>void H(r,"webp",!0),askSend:()=>{U||!r.length||z(r)},askDelete:()=>D.requestDelete(r),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(U1,{open:j!==null,title:b(j==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>N(null),onCreated:y,onPick:J=>void me(j==="move"?"moveToPack":"addToPack",J,O)}),s.jsx(nh,{open:I.length>0,busy:se,onClose:()=>z([]),onPick:J=>{ue(async()=>{B(!0);try{(await Y.sendStickers({ids:I,jid:J})).sent>0?(x(I.length>1?b("stickersSent"):b("stickerSent"),"success"),z([]),d()):x(b("stickerErr_NOT_CONNECTED"),"error")}finally{B(!1)}})}}),s.jsx(lA,{open:D.phase!==null,busy:D.busy,count:((be=D.phase)==null?void 0:be.ids.length)??0,inUse:((_=D.phase)==null?void 0:_.kind)==="inUse",packs:W,onClose:D.close,onConfirm:()=>{D.phase&&D.run(D.phase.ids,!1)},onConfirmEverywhere:()=>{D.phase&&D.run(D.phase.ids,!0)}}),s.jsx(rA,{sticker:T,packs:i,isConnected:m,gifEnabled:p,onClose:()=>k(null),onRename:J=>{if(T){if([...J.trim()].length>Zc){x(b("stickerNameTooLong"),"warning");return}ue(async()=>{await Y.updateSticker(T.id,{name:J.trim()}),x(b("renamed"),"success"),d()})}},onFavorite:J=>{T&&ue(async()=>{await Y.updateSticker(T.id,{favorite:J}),x(b("saved"),"success"),d()})},onAddToPack:J=>{T&&me("addToPack",J,[T.id])},onRemoveFromPack:J=>{T&&ue(async()=>{await Y.bulkStickers({action:"removeFromPack",ids:[T.id],packId:J}),x(b("removedFromPack"),"success"),d()})},onDownload:J=>{if(T){if(J==="gif"){ue(async()=>{const ye=await Tr(T,"gif");ee(ye),ye.ok&&(await Bm([T.id]),d())});return}H([T.id],J,!1)}},onShare:()=>{T&&H([T.id],"webp",!0)},onSend:()=>{T&&m&&z([T.id])},onDelete:()=>{T&&D.requestDelete([T.id])},onOpenInCreate:()=>{T&&(k(null),h(T))}})]})}}const uA="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:16px_16px]",P1=({sticker:a,selected:i,onToggle:r,onOpen:o,onFavorite:d})=>{const{t:f}=He(),m=a.name||f("stickerPreview");return s.jsxs("div",{className:Ue("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(fe,{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:a.thumbUrl,alt:"",loading:"lazy",draggable:!1,className:Ue("h-full w-full object-contain",uA)})}),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:Ue("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(mi,{size:14,strokeWidth:i?3:2.5,className:i?void 0:"opacity-40"})})}),a.animated&&s.jsx($e,{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:a.favorite?f("unfavorite"):f("favorite"),"aria-pressed":a.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:Ue("flex size-7 items-center justify-center rounded-lg border transition-all shadow-xs",a.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(qc,{size:14,className:a.favorite?"fill-warn text-warn":void 0})})}),s.jsx("span",{className:"sr-only",children:m})]})},dA=({items:a,total:i,page:r,pageCount:o,loading:d,error:f,emptyText:m,isFiltered:p,selected:h,onToggle:y,onOpen:b,onFavorite:x,onPageChange:w,onRetry:C,onClearFilters:k,onGoCreate:j})=>{const{t:N}=He();return s.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[d&&a.length===0?s.jsx(Cs,{text:N("loading")}):f?s.jsx(ut,{kind:"error",description:f,action:s.jsx(fe,{onClick:C,children:N("retryLoad")})}):a.length===0?p?s.jsx(ut,{kind:"no-results",description:m,action:k?s.jsx(fe,{variant:"secondary",onClick:k,children:N("reset")}):void 0}):s.jsx(ut,{kind:"empty",icon:s.jsx(Vm,{size:28,className:"text-muted"}),description:m,action:j?s.jsx(fe,{variant:"primary",onClick:j,children:N("createBtn")}):void 0}):s.jsx("div",{className:Ue("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:a.map((O,R)=>s.jsx(P1,{sticker:O,selected:h.has(O.id),onToggle:I=>y(R,I),onOpen:()=>b(O),onFavorite:()=>x(O)},O.id))}),i>0&&s.jsx(vi,{page:r,pageCount:o,total:i,onPageChange:w,className:"pt-1"})]})};function G1(a,i){const[r,o]=v.useState(new Set),d=v.useRef(null),f=v.useRef(i);return v.useEffect(()=>{f.current!==i&&(f.current=i,o(new Set),d.current=null)},[i]),{selected:r,toggle:(y,b)=>{const x=a[y];x&&o(w=>{const C=new Set(w);if(b&&d.current!=null){const k=Math.min(d.current,y),j=Math.max(d.current,y);for(let N=k;N<=j;N++){const O=a[N];O&&C.add(O)}return C}return C.has(x)?C.delete(x):C.add(x),d.current=y,C})},selectAll:()=>{o(y=>{const b=new Set(y);for(const x of a)x&&b.add(x);return b})},clear:()=>{d.current=null,o(new Set)}}}const jr=24;function fA(a){const{t:i}=He(),{toast:r}=Et(),[o,d]=v.useState(""),[f,m]=v.useState(""),[p,h]=v.useState(a==="recent"?"recent":"newest"),[y,b]=v.useState(a),[x,w]=v.useState(""),[C,k]=v.useState(1),[j,N]=v.useState(null),[O,R]=v.useState(0),[I,z]=v.useState([]),[se,B]=v.useState(!0),[D,T]=v.useState(null),F=v.useRef(0),U=`${f}|${y}|${p}|${x}`;v.useEffect(()=>{b(a)},[a]),v.useEffect(()=>{const de=setTimeout(()=>m(o),300);return()=>clearTimeout(de)},[o]);const W=v.useCallback(()=>{Y.getPacks().then(de=>z(de.packs)).catch(()=>{})},[]);v.useEffect(()=>{W()},[W]);const ee=v.useCallback(async de=>{const be=++F.current;B(!0),T(null);const _=Math.max(0,(de-1)*jr);try{const J=await Y.getStickers({q:f||void 0,sort:p,filter:y,pack:x||void 0,offset:_,limit:jr});if(be!==F.current)return;const ye=J.total,Se=Math.max(1,Math.ceil(ye/jr));if(de>Se){k(Se);return}N({page:de,filterKey:U,items:J.items}),R(ye)}catch(J){if(be!==F.current)return;const ye=wt(i,J);T({page:de,filterKey:U,message:ye}),r(ye,"error")}finally{be===F.current&&B(!1)}},[f,p,y,x,U,i,r]),ue=v.useRef(U);v.useEffect(()=>{if(ue.current!==U&&(ue.current=U,C!==1)){k(1);return}ee(C)},[U,C,ee]);const ie=v.useCallback(()=>{W(),ee(C)},[ee,W,C]),H=v.useCallback(de=>{k(Math.max(1,Math.floor(de)||1))},[]),X=(j==null?void 0:j.page)===C&&j.filterKey===U,me=(D==null?void 0:D.page)===C&&D.filterKey===U?D.message:null;return{q:o,setQ:d,sort:p,setSort:h,filter:y,setFilter:b,pack:x,setPack:w,page:C,setPage:H,pageCount:Math.max(1,Math.ceil(O/jr)),pageSize:jr,items:X?j.items:[],loadedItems:(j==null?void 0:j.items)??null,total:O,packs:I,loading:se||!X&&!me,error:me,reload:ie,loadPacks:W,lockedFilter:a!=="all"}}const xm=({preset:a,isConnected:i,gifEnabled:r,refreshKey:o,onOpenInCreate:d,onGoCreate:f})=>{const{t:m}=He(),p=fA(a),h=p.items.map(B=>B.id),y=`${p.q}|${p.filter}|${p.sort}|${p.pack}`,b=G1(h,y),x=[...b.selected],w=v.useRef({key:y,loadedItems:null,stickers:new Map});if(w.current.key!==y&&(w.current={key:y,loadedItems:p.loadedItems,stickers:new Map}),p.loadedItems&&w.current.loadedItems!==p.loadedItems){for(const B of p.loadedItems)w.current.stickers.set(B.id,B);w.current.loadedItems=p.loadedItems}const C=new Map(p.items.map(B=>[B.id,B]));for(const B of x){const D=w.current.stickers.get(B);D&&!C.has(B)&&C.set(B,D)}const k=p.pack&&p.pack!=="none"?p.pack:void 0,j=v.useRef(p.reload);j.current=p.reload,v.useEffect(()=>{o!==0&&j.current()},[o]);const N=q1({items:[...C.values()],packs:p.packs,selectedIds:x,clearSelection:b.clear,reload:p.reload,fromPackId:k,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:p.loadPacks}),O=!!(p.q||p.pack||!p.lockedFilter&&p.filter!=="all"),R=m(O?"noResults":a==="favorites"?"favoritesEmpty":a==="recent"?"recentEmpty":"emptyLibrary"),I=[...C.values()].some(B=>b.selected.has(B.id)&&B.animated),z=(p.lockedFilter||p.filter==="all"?0:1)+(p.pack?1:0),se=()=>{p.setQ(""),p.lockedFilter||p.setFilter("all"),p.setPack("")};return s.jsxs("div",{className:Ue("flex flex-col gap-3 min-w-0",x.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs(pl,{children:[s.jsx(Ke,{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(hl,{label:m("filter"),resetLabel:m("reset"),activeCount:z,onReset:()=>{p.lockedFilter||p.setFilter("all"),p.setPack("")},children:[!p.lockedFilter&&s.jsxs(Ht,{"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(Ht,{"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(Lr,{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(fe,{variant:"ghost",size:"sm",onClick:b.selectAll,children:m(p.pageCount>1?"selectCurrentPage":"selectAll")})]}),s.jsx(H1,{count:x.length,animatedSelected:I,canRemove:!!k,sendReason:x.length?N.sendReason:null,exportReason:x.length?N.exportReason:null,onSelectAll:b.selectAll,selectAllLabel:m(p.pageCount>1?"selectCurrentPage":"selectAll"),onClear:b.clear,onFavorite:N.favorite,onUnfavorite:N.unfavorite,onAdd:N.askAdd,onMove:N.askMove,onRemove:N.remove,onDownload:N.download,onConvert:N.convert,onShare:N.share,onSend:N.askSend,onDelete:N.askDelete}),s.jsx(dA,{items:p.items,total:p.total,page:p.page,pageCount:p.pageCount,loading:p.loading,error:p.error,emptyText:R,isFiltered:O,selected:b.selected,onToggle:b.toggle,onOpen:N.openDetail,onFavorite:N.toggleFavorite,onPageChange:p.setPage,onRetry:p.reload,onClearFilters:O?se:void 0,onGoCreate:a==="all"&&!O?f:void 0}),N.dialogs]})},mA=({packId:a,isConnected:i,gifEnabled:r,onBack:o,onOpenInCreate:d})=>{const{t:f}=He(),{toast:m}=Et(),[p,h]=v.useState(null),[y,b]=v.useState([]),[x,w]=v.useState([]),[C,k]=v.useState(!0),[j,N]=v.useState(null),[O,R]=v.useState(0),[I,z]=v.useState(!1),se=v.useRef(""),{page:B,pageCount:D,pageItems:T,setPage:F,total:U}=Vc(y,48,a),W=T.map(_=>_.id),ee=G1(W,a),ue=[...ee.selected];v.useEffect(()=>{if(O<0)return;let _=!0;return N(null),Promise.all([Y.getPack(a),Y.getPacks()]).then(([J,ye])=>{_&&(h(J.pack),b(J.items),w(ye.packs))}).catch(J=>{_&&N(wt(f,J))}).finally(()=>{_&&k(!1)}),()=>{_=!1}},[a,O,f]);const ie=()=>{k(y.length===0),R(_=>_+1)},H=q1({items:y,packs:x,selectedIds:ue,clearSelection:ee.clear,reload:ie,fromPackId:a,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:ie}),X=async _=>{const J=y;b(_),z(!0);try{await Y.reorderPack(a,_.map(ye=>ye.id))}catch(ye){b(J),m(wt(f,ye),"error")}finally{z(!1)}},me=(_,J)=>{const ye=_+J;if(I||ye<0||ye>=y.length)return;const Se=y.slice(),[E]=Se.splice(_,1);E&&(Se.splice(ye,0,E),X(Se))},de=_=>{const J=y.findIndex(Q=>Q.id===se.current),ye=y.findIndex(Q=>Q.id===_);if(se.current="",I||J<0||ye<0||J===ye)return;const Se=y.slice(),[E]=Se.splice(J,1);E&&(Se.splice(ye,0,E),X(Se))},be=y.some(_=>ee.selected.has(_.id)&&_.animated);return s.jsxs("div",{className:Ue("flex flex-col gap-3 min-w-0",ue.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(fe,{onClick:o,children:[s.jsx(_c,{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(An,{children:p.name})}),s.jsx("p",{className:"text-xs text-muted",children:rn(f("stickerCount"),{n:p.count})})]})]}),C&&y.length===0&&s.jsx(Cs,{text:f("loading")}),j&&y.length===0&&s.jsx(ut,{kind:"error",description:j,action:s.jsx(fe,{onClick:ie,children:f("retryLoad")})}),!C&&!j&&y.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(Ly,{size:28,className:"text-muted"}),description:f("packEmpty")}),y.length>0&&s.jsxs(s.Fragment,{children:[ue.length===0&&s.jsx("div",{children:s.jsx(fe,{variant:"ghost",size:"sm",onClick:ee.selectAll,children:f(D>1?"selectCurrentPage":"selectAll")})}),s.jsx(H1,{count:ue.length,animatedSelected:be,canRemove:!0,sendReason:ue.length?H.sendReason:null,exportReason:ue.length?H.exportReason:null,onSelectAll:ee.selectAll,selectAllLabel:f(D>1?"selectCurrentPage":"selectAll"),onClear:ee.clear,onFavorite:H.favorite,onUnfavorite:H.unfavorite,onAdd:H.askAdd,onMove:H.askMove,onRemove:H.remove,onDownload:H.download,onConvert:H.convert,onShare:H.share,onSend:H.askSend,onDelete:H.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:T.map((_,J)=>{const ye=(B-1)*48+J;return s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:Se=>Se.preventDefault(),onDrop:Se=>{Se.preventDefault(),de(_.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(P1,{sticker:_,selected:ee.selected.has(_.id),onToggle:Se=>ee.toggle(J,Se),onOpen:()=>H.openDetail(_),onFavorite:()=>H.toggleFavorite(_)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold",children:s.jsx(An,{children:_.name||f("stickerPreview")})}),s.jsx(Oe,{label:f("reorderUp"),disabled:I||ye===0,onClick:()=>me(ye,-1),children:s.jsx(lk,{size:14})}),s.jsx(Oe,{label:f("reorderDown"),disabled:I||ye===y.length-1,onClick:()=>me(ye,1),children:s.jsx(rl,{size:14})}),s.jsx(Oe,{label:f("reorderDragHint"),variant:"ghost",className:"cursor-grab",draggable:!I,onDragStart:Se=>{se.current=_.id,Se.dataTransfer.effectAllowed="move",Se.dataTransfer.setData("text/plain",_.id)},icon:s.jsx(Ly,{size:16})})]},_.id)})}),s.jsx(vi,{page:B,pageCount:D,total:U,onPageChange:F})]}),H.dialogs]})},hA=({isConnected:a,gifEnabled:i,onOpenInCreate:r})=>{const{t:o}=He(),{toast:d}=Et(),[f,m]=v.useState([]),[p,h]=v.useState(!0),[y,b]=v.useState(null),[x,w]=v.useState(""),[C,k]=v.useState(null),[j,N]=v.useState(!1),[O,R]=v.useState(null),[I,z]=v.useState(null),[se,B]=v.useState(""),[D,T]=v.useState(null),[F,U]=v.useState(!1),[W,ee]=v.useState(null),[ue,ie]=v.useState(""),H=v.useCallback(()=>{b(null),Y.getPacks().then(_=>m(_.packs)).catch(_=>b(wt(o,_))).finally(()=>h(!1))},[o]);v.useEffect(()=>{H()},[H]);const X=async()=>{if(Dr(x)){k(o("packNameLength"));return}N(!0),k(null);try{await Y.createPack(x.trim()),w(""),d(o("packCreated"),"success"),H()}catch(_){d(wt(o,_),"error")}finally{N(!1)}},me=async()=>{if(I){if(Dr(se)){d(o("packNameLength"),"warning");return}N(!0);try{await Y.updatePack(I.id,se.trim()),d(o("packRenamed"),"success"),z(null),H()}catch(_){d(wt(o,_),"error")}finally{N(!1)}}},de=async()=>{if(D){N(!0);try{await Y.deletePack(D.id,F),d(o("packDeleted"),"success"),T(null),U(!1),H()}catch(_){d(wt(o,_),"error")}finally{N(!1)}}},be=async()=>{if(W){if(!ue){d(o("noDestinationPack"),"warning");return}N(!0);try{await Y.mergePack(W.id,ue),d(o("packsMerged"),"success"),ee(null),ie(""),H()}catch(_){d(wt(o,_),"error")}finally{N(!1)}}};return O?s.jsx(mA,{packId:O,isConnected:a,gifEnabled:i,onOpenInCreate:r,onBack:()=>{R(null),H()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{value:x,onChange:_=>{const J=_.target.value;w(J),C&&k(Dr(J)?o("packNameLength"):null)},onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),X())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),dir:"auto",maxLength:L1+20,className:"min-w-0 flex-1"}),s.jsxs(fe,{variant:"primary",onClick:()=>void X(),disabled:j,icon:s.jsx(ol,{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")})]})]}),C&&s.jsx("p",{className:"text-xs text-danger",children:C}),p&&s.jsx(Cs,{text:o("loading")}),y&&!p&&s.jsx(ut,{kind:"error",description:y,action:s.jsx(fe,{onClick:H,children:o("retryLoad")})}),!p&&!y&&f.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(wm,{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(_=>s.jsxs(Ye,{className:"flex items-center gap-3",children:[s.jsxs(fe,{variant:"ghost",onClick:()=>R(_.id),className:"h-auto min-h-11 min-w-0 flex-1 justify-start gap-3 px-1","aria-label":o("openPack"),children:[_.coverUrl?s.jsx("img",{src:_.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(wm,{size:20})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(An,{lines:2,className:"font-bold text-text-main text-start",children:_.name}),s.jsx("span",{className:"block text-xs text-muted",children:rn(o("stickerCount"),{n:_.count})})]})]}),s.jsxs(aa,{label:o("moreActions"),children:[s.jsx(st,{icon:s.jsx(Y0,{size:16}),onSelect:()=>{z(_),B(_.name)},children:o("renamePack")}),s.jsx(st,{icon:s.jsx(vk,{size:16}),onSelect:()=>{ee(_),ie("")},children:o("merge")}),s.jsx(Ar,{}),s.jsx(st,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{T(_),U(!1)},children:o("deletePack")})]})]},_.id))}),s.jsx(an,{isOpen:I!==null,onClose:()=>z(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(fe,{onClick:()=>z(null),children:o("cancel")}),s.jsx(fe,{variant:"primary",onClick:()=>void me(),disabled:j,children:o("save")})]}),children:s.jsx(Ke,{value:se,onChange:_=>B(_.target.value),"aria-label":o("packName"),dir:"auto"})}),s.jsx(an,{isOpen:D!==null,onClose:()=>T(null),title:o("deletePackTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(fe,{onClick:()=>T(null),children:o("cancel")}),s.jsx(fe,{variant:"danger",onClick:()=>void de(),disabled:j,children:o("delete")})]}),children:s.jsx(yn,{name:"delete-pack-mode",value:F?"stickers":"keep",onChange:_=>U(_==="stickers"),options:[{value:"keep",label:o("deleteKeepStickers")},{value:"stickers",label:o("deletePackAndStickers")}]})}),s.jsx(an,{isOpen:W!==null,onClose:()=>ee(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(fe,{onClick:()=>ee(null),children:o("cancel")}),s.jsx(fe,{variant:"primary",onClick:()=>void be(),disabled:j||!ue,children:o("confirmMerge")})]}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-sm text-text-main",children:o("mergeConfirmBody")}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"merge-into",children:o("mergeInto")}),s.jsxs(Ht,{id:"merge-into",value:ue,onChange:_=>ie(_.target.value),children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(_=>_.id!==(W==null?void 0:W.id)).map(_=>s.jsx("option",{value:_.id,children:_.name},_.id))]})]})})]})},pA=["library","packs","favorites","create","recent"];function Vb(){const a=window.location.hash.replace(/^#/,"");if(a.startsWith("stickers/")){const i=a.slice(9);if(pA.includes(i))return i}return"library"}const gA=({isConnected:a})=>{const{t:i}=He(),{toast:r}=Et(),[o,d]=v.useState(Vb),[f,m]=v.useState(o==="create"),[p,h]=v.useState(null),[y,b]=v.useState(null),[x,w]=v.useState(0),[C,k]=v.useState(null),[j,N]=v.useState(0),O=v.useCallback(()=>{let D=!0;return b(null),Y.getStickerCapabilities().then(T=>{D&&h(T)}).catch(T=>{D&&b(wt(i,T))}),()=>{D=!1}},[i]);v.useEffect(()=>{if(!(x<0))return O()},[O,x]);const R=v.useCallback(D=>{d(D),D==="create"&&m(!0);const T=`stickers/${D}`;window.location.hash.replace(/^#/,"")!==T&&(window.location.hash=T)},[]);v.useEffect(()=>{const D=()=>d(Vb());return window.addEventListener("hashchange",D),()=>window.removeEventListener("hashchange",D)},[]),v.useEffect(()=>{o==="create"&&m(!0)},[o]),v.useEffect(()=>(Gb(D=>{if(D.type==="saved"){r(D.created?i("stickerCreated"):i("alreadyInLibrary"),D.created?"success":"info"),D.qualityReduced&&r(i("qualityReduced"),"info"),N(T=>T+1);return}r(th(i,D.code),"error")}),()=>Gb(null)),[i,r]),v.useEffect(()=>{const D=()=>{const F=aA();F&&(k(F),m(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};D();const T=()=>{document.visibilityState==="visible"&&D()};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[]);const I=v.useCallback(()=>{sA(),k(null)},[]),z=v.useCallback(async D=>{try{const T=await fetch(D.url,{credentials:"same-origin"});if(!T.ok)throw new Error(String(T.status));const F=await T.blob(),U=D.name.trim(),W=U?U.toLowerCase().endsWith(".webp")?U:`${U}.webp`:"sticker.webp";k({blob:F,name:W,source:"PANEL_UPLOAD",...Cc()?{existingId:D.id}:{}}),R("create")}catch(T){r(wt(i,T),"error")}},[R,i,r]),se=p!==null&&!p.webp,B=[{id:"library",label:i("library"),icon:s.jsx(hk,{size:16})},{id:"packs",label:i("packs"),icon:s.jsx(wm,{size:16})},{id:"favorites",label:i("favorites"),icon:s.jsx(qc,{size:16})},{id:"create",label:i("create"),icon:s.jsx(ik,{size:16})},{id:"recent",label:i("recent"),icon:s.jsx(u0,{size:16})}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6 min-w-0",children:[s.jsx(ml,{icon:s.jsx(Vm,{size:24}),title:i("stickers"),description:i("stickersDesc")}),se&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(dl,{size:20,className:"text-warn shrink-0"}),s.jsx("span",{className:"text-sm text-warn font-medium",children:i("stickerErr_ENCODER_MISSING")})]}),s.jsx("div",{className:"-mx-4 overflow-x-auto px-4 sm:mx-0 sm:px-0",children:s.jsx(Ic,{"aria-label":i("stickers"),className:"min-w-max",value:o,onChange:R,options:B.map(D=>({value:D.id,label:D.label,icon:D.icon}))})}),o==="library"&&s.jsx(xm,{preset:"all",isConnected:a,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:j,onOpenInCreate:D=>void z(D),onGoCreate:()=>R("create")}),o==="favorites"&&s.jsx(xm,{preset:"favorites",isConnected:a,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:j,onOpenInCreate:D=>void z(D),onGoCreate:()=>R("create")}),o==="recent"&&s.jsx(xm,{preset:"recent",isConnected:a,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:j,onOpenInCreate:D=>void z(D),onGoCreate:()=>R("create")}),o==="packs"&&s.jsx(hA,{isConnected:a,gifEnabled:(p==null?void 0:p.gif)===!0,onOpenInCreate:D=>void z(D)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(tA,{capabilities:p,capsError:y,onRetryCaps:()=>w(D=>D+1),incoming:C,onConsumedIncoming:I,isConnected:a,onGoLibrary:()=>R("library"),onCreated:()=>N(D=>D+1)})})]})},V1=["overview","connection","commands","ai","groups","autodelete","schedules","settings","logs","stickers"];function xA(){const a=window.location.hash.replace(/^#/,"").split("/")[0];return V1.includes(a)?a:"overview"}const yA=()=>{const{t:a}=He(),{toast:i}=Et(),[r,o]=v.useState(xA),[d,f]=v.useState(!1),{sessionStatus:m}=FN((k,j)=>{if(k==="status"){const N=j==null?void 0:j.state;i(`Connection state: ${N}`,"info")}}),[p,h]=v.useState(null),y=v.useCallback(async()=>{try{const k=await Y.getSession();k!=null&&k.session?h({...k.session,qr:k.qr??null,pairingCode:k.pairingCode??null}):k!=null&&k.status&&h(k.status)}catch{}},[]);v.useEffect(()=>{y()},[y]);const b=p||m?{state:(m==null?void 0:m.state)||(p==null?void 0:p.state)||"idle",...p||{},...m||{}}:null,x=(b==null?void 0:b.connected)===!0||(b==null?void 0:b.state)==="connected";v.useEffect(()=>{const k=b==null?void 0:b.state,N=k==="starting"||k==="linking"||k==="reconnecting"||k==="waiting_for_qr"&&!(b!=null&&b.qr)&&!(b!=null&&b.pairingCode)?2e3:15e3,O=setInterval(()=>{y()},N);return()=>clearInterval(O)},[b==null?void 0:b.state,b==null?void 0:b.qr,b==null?void 0:b.pairingCode,y]);const w=k=>{o(k),window.location.hash=k};v.useEffect(()=>{const k=()=>{const j=window.location.hash.replace(/^#/,"").split("/")[0];V1.includes(j)&&o(j)};return window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[]);const C={overview:a("overview"),connection:a("connection"),commands:a("commands"),ai:a("ai"),groups:a("groups"),autodelete:a("autoDelete"),schedules:a("schedules"),settings:a("settings"),logs:a("logs"),stickers:a("stickers")};return v.useEffect(()=>Xj(),[]),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(Jj,{currentView:r,onSelectView:w,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(Zj,{onToggleMobileMenu:()=>f(k=>!k),title:C[r]||"Dashboard",status:b}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[s.jsx(Kj,{}),s.jsxs(l1,{children:[r==="overview"&&s.jsx(nE,{status:b,onNavigate:w}),r==="connection"&&s.jsx(ZC,{status:b,onRefresh:y,onStatusUpdate:k=>h(j=>({...j||{},...k}))}),r==="ai"&&s.jsx(ZN,{}),r==="commands"&&s.jsx(EC,{}),r==="schedules"&&s.jsx(yE,{isConnected:x,onNavigate:w}),r==="groups"&&s.jsx($C,{}),r==="autodelete"&&s.jsx(hC,{}),r==="settings"&&s.jsx(CE,{}),r==="stickers"&&s.jsx(gA,{isConnected:x}),r==="logs"&&s.jsx(eE,{})]})]})]})]})},bA=()=>s.jsx(Ok,{children:s.jsx(Fj,{children:s.jsx(yA,{})})}),Ib=document.getElementById("root");Ib&&Gw.createRoot(Ib).render(s.jsx(Ow.StrictMode,{children:s.jsx(bA,{})}));
|