levix-bot 4.7.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.
Files changed (62) hide show
  1. package/README.md +21 -7
  2. package/SETUP.md +21 -2
  3. package/app.cjs +69 -23
  4. package/package.json +3 -2
  5. package/public/dashboard/assets/index-B1sOW2VX.js +561 -0
  6. package/public/dashboard/assets/index-CK8osB4o.css +2 -0
  7. package/public/dashboard/index.html +2 -2
  8. package/public/dashboard.css +50 -0
  9. package/public/dashboard.js +25 -2
  10. package/public/gateway-i18n.js +26 -0
  11. package/src/bootstrap/session-startup-policy.js +6 -6
  12. package/src/commands/group/antilink.cjs +82 -59
  13. package/src/commands/group/antispam.cjs +112 -0
  14. package/src/commands/group/clearwarns.cjs +6 -6
  15. package/src/commands/group/demote.cjs +11 -13
  16. package/src/commands/group/flagged.cjs +52 -0
  17. package/src/commands/group/kick.cjs +25 -15
  18. package/src/commands/group/media.cjs +65 -29
  19. package/src/commands/group/policy.cjs +215 -0
  20. package/src/commands/group/promote.cjs +11 -12
  21. package/src/commands/group/rules.cjs +9 -6
  22. package/src/commands/group/setwarn.cjs +17 -27
  23. package/src/commands/group/warn.cjs +13 -63
  24. package/src/commands/group.cjs +5 -2
  25. package/src/commands/md.cjs +44 -0
  26. package/src/commands/mod.cjs +101 -26
  27. package/src/commands/translate.cjs +585 -0
  28. package/src/config/ai-identity.cjs +53 -1
  29. package/src/config/ai-persona.md +32 -73
  30. package/src/config/defaults.cjs +3 -0
  31. package/src/config/secrets.cjs +71 -3
  32. package/src/config/settings.cjs +22 -1
  33. package/src/core/socket.js +27 -5
  34. package/src/db/db.cjs +66 -0
  35. package/src/db/store.cjs +264 -16
  36. package/src/diagnostics/crashReports.cjs +35 -9
  37. package/src/diagnostics/debugLog.cjs +405 -0
  38. package/src/handlers/command.handler.js +3 -1
  39. package/src/handlers/group.handler.js +32 -1
  40. package/src/handlers/message.handler.js +53 -17
  41. package/src/middleware/antispam.middleware.js +95 -48
  42. package/src/panel/feedback.cjs +32 -5
  43. package/src/panel/one-time-code.cjs +156 -0
  44. package/src/panel/password-reset.cjs +187 -91
  45. package/src/panel/recovery-email.cjs +333 -0
  46. package/src/routes/dashboard.api.esm.js +341 -29
  47. package/src/services/aiAgent.cjs +25 -3
  48. package/src/services/moderationPolicy.cjs +895 -0
  49. package/src/services/settingsTransfer.cjs +4 -2
  50. package/src/utils/linkedCreds.cjs +22 -0
  51. package/src/utils/logger.cjs +93 -34
  52. package/src/utils/markdownParser.cjs +208 -136
  53. package/src/utils/moderationAction.cjs +637 -0
  54. package/src/utils/moderationSummary.cjs +225 -0
  55. package/src/utils/permissions.cjs +70 -0
  56. package/src/utils/permissions.esm.js +48 -8
  57. package/src/utils/storage.cjs +8 -0
  58. package/src/utils/storage.esm.js +4 -0
  59. package/views/login.ejs +100 -28
  60. package/public/dashboard/assets/index-RnT7DAde.js +0 -540
  61. package/public/dashboard/assets/index-UcqCdCvG.css +0 -2
  62. package/src/commands/group/antiSpam.cjs +0 -97
@@ -1,540 +0,0 @@
1
- var Nw=Object.defineProperty;var Cw=(a,i,r)=>i in a?Nw(a,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[i]=r;var Ny=(a,i,r)=>Cw(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 h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function Hh(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var jf={exports:{}},hr={};/**
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 Cy;function Ew(){if(Cy)return hr;Cy=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(o,d,f){var h=null;if(f!==void 0&&(h=""+f),d.key!==void 0&&(h=""+d.key),"key"in d){f={};for(var m in d)m!=="key"&&(f[m]=d[m])}else f=d;return d=f.ref,{$$typeof:a,type:o,key:h,ref:d!==void 0?d:null,props:f}}return hr.Fragment=i,hr.jsx=r,hr.jsxs=r,hr}var Ey;function Aw(){return Ey||(Ey=1,jf.exports=Ew()),jf.exports}var s=Aw(),kf={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 Ay;function _w(){if(Ay)return Ge;Ay=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),N=Symbol.iterator;function C(E){return E===null||typeof E!="object"?null:(E=N&&E[N]||E["@@iterator"],typeof E=="function"?E:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function R(E,Y,V){this.props=E,this.context=Y,this.refs=_,this.updater=V||k}R.prototype.isReactComponent={},R.prototype.setState=function(E,Y){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,Y,"setState")},R.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=R.prototype;function q(E,Y,V){this.props=E,this.context=Y,this.refs=_,this.updater=V||k}var he=q.prototype=new I;he.constructor=q,j(he,R.prototype),he.isPureReactComponent=!0;var B=Array.isArray;function z(){}var T={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function X(E,Y,V){var le=V.ref;return{$$typeof:a,type:E,key:Y,ref:le!==void 0?le:null,props:V}}function re(E,Y){return X(E.type,Y,E.props)}function ae(E){return typeof E=="object"&&E!==null&&E.$$typeof===a}function de(E){var Y={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(V){return Y[V]})}var se=/\/+/g;function U(E,Y){return typeof E=="object"&&E!==null&&E.key!=null?de(""+E.key):Y.toString(36)}function D(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(z,z):(E.status="pending",E.then(function(Y){E.status==="pending"&&(E.status="fulfilled",E.value=Y)},function(Y){E.status==="pending"&&(E.status="rejected",E.reason=Y)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function $(E,Y,V,le,ee){var ue=typeof E;(ue==="undefined"||ue==="boolean")&&(E=null);var me=!1;if(E===null)me=!0;else switch(ue){case"bigint":case"string":case"number":me=!0;break;case"object":switch(E.$$typeof){case a:case i:me=!0;break;case v:return me=E._init,$(me(E._payload),Y,V,le,ee)}}if(me)return ee=ee(E),me=le===""?"."+U(E,0):le,B(ee)?(V="",me!=null&&(V=me.replace(se,"$&/")+"/"),$(ee,Y,V,"",function(qe){return qe})):ee!=null&&(ae(ee)&&(ee=re(ee,V+(ee.key==null||E&&E.key===ee.key?"":(""+ee.key).replace(se,"$&/")+"/")+me)),Y.push(ee)),1;me=0;var ce=le===""?".":le+":";if(B(E))for(var Se=0;Se<E.length;Se++)le=E[Se],ue=ce+U(le,Se),me+=$(le,Y,V,ue,ee);else if(Se=C(E),typeof Se=="function")for(E=Se.call(E),Se=0;!(le=E.next()).done;)le=le.value,ue=ce+U(le,Se++),me+=$(le,Y,V,ue,ee);else if(ue==="object"){if(typeof E.then=="function")return $(D(E),Y,V,le,ee);throw Y=String(E),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return me}function W(E,Y,V){if(E==null)return E;var le=[],ee=0;return $(E,le,"","",function(ue){return Y.call(V,ue,ee++)}),le}function ye(E){if(E._status===-1){var Y=E._result,V=Y();V.then(function(le){(E._status===0||E._status===-1)&&(E._status=1,E._result=le,V.status===void 0&&(V.status="fulfilled",V.value=le))},function(le){(E._status===0||E._status===-1)&&(E._status=2,E._result=le,V.status===void 0&&(V.status="rejected",V.reason=le))}),E._status===-1&&(E._status=0,E._result=V)}if(E._status===1)return E._result.default;throw E._result}var O=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=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(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function ie(E){var Y=T.T,V={};V.types=Y!==null?Y.types:null,T.T=V;try{var le=E(),ee=T.S;ee!==null&&ee(V,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(z,O)}catch(ue){O(ue)}finally{Y!==null&&V.types!==null&&(Y.types=V.types),T.T=Y}}function be(E){var Y=T.T;if(Y!==null){var V=Y.types;V===null?Y.types=[E]:V.indexOf(E)===-1&&V.push(E)}else ie(be.bind(null,E))}var we={map:W,forEach:function(E,Y,V){W(E,function(){Y.apply(this,arguments)},V)},count:function(E){var Y=0;return W(E,function(){Y++}),Y},toArray:function(E){return W(E,function(Y){return Y})||[]},only:function(E){if(!ae(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Ge.Activity=y,Ge.Children=we,Ge.Component=R,Ge.Fragment=r,Ge.Profiler=d,Ge.PureComponent=q,Ge.StrictMode=o,Ge.Suspense=p,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=be,Ge.cache=function(E){return function(){return E.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(E,Y,V){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var le=j({},E.props),ee=E.key;if(Y!=null)for(ue in Y.key!==void 0&&(ee=""+Y.key),Y)!F.call(Y,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&Y.ref===void 0||(le[ue]=Y[ue]);var ue=arguments.length-2;if(ue===1)le.children=V;else if(1<ue){for(var me=Array(ue),ce=0;ce<ue;ce++)me[ce]=arguments[ce+2];le.children=me}return X(E.type,ee,le)},Ge.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},Ge.createElement=function(E,Y,V){var le,ee={},ue=null;if(Y!=null)for(le in Y.key!==void 0&&(ue=""+Y.key),Y)F.call(Y,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ee[le]=Y[le]);var me=arguments.length-2;if(me===1)ee.children=V;else if(1<me){for(var ce=Array(me),Se=0;Se<me;Se++)ce[Se]=arguments[Se+2];ee.children=ce}if(E&&E.defaultProps)for(le in me=E.defaultProps,me)ee[le]===void 0&&(ee[le]=me[le]);return X(E,ue,ee)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(E){return{$$typeof:m,render:E}},Ge.isValidElement=ae,Ge.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:ye}},Ge.memo=function(E,Y){return{$$typeof:x,type:E,compare:Y===void 0?null:Y}},Ge.startTransition=ie,Ge.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ge.use=function(E){return T.H.use(E)},Ge.useActionState=function(E,Y,V){return T.H.useActionState(E,Y,V)},Ge.useCallback=function(E,Y){return T.H.useCallback(E,Y)},Ge.useContext=function(E){return T.H.useContext(E)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(E,Y){return T.H.useDeferredValue(E,Y)},Ge.useEffect=function(E,Y){return T.H.useEffect(E,Y)},Ge.useEffectEvent=function(E){return T.H.useEffectEvent(E)},Ge.useId=function(){return T.H.useId()},Ge.useImperativeHandle=function(E,Y,V){return T.H.useImperativeHandle(E,Y,V)},Ge.useInsertionEffect=function(E,Y){return T.H.useInsertionEffect(E,Y)},Ge.useLayoutEffect=function(E,Y){return T.H.useLayoutEffect(E,Y)},Ge.useMemo=function(E,Y){return T.H.useMemo(E,Y)},Ge.useOptimistic=function(E,Y){return T.H.useOptimistic(E,Y)},Ge.useReducer=function(E,Y,V){return T.H.useReducer(E,Y,V)},Ge.useRef=function(E){return T.H.useRef(E)},Ge.useState=function(E){return T.H.useState(E)},Ge.useSyncExternalStore=function(E,Y,V){return T.H.useSyncExternalStore(E,Y,V)},Ge.useTransition=function(){return T.H.useTransition()},Ge.version="19.3.0",Ge}var _y;function qh(){return _y||(_y=1,kf.exports=_w()),kf.exports}var b=qh();const Tw=Hh(b);var Nf={exports:{}},mr={},Cf={exports:{}},Ef={};/**
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 Ty;function Dw(){return Ty||(Ty=1,(function(a){function i(D,$){var W=D.length;D.push($);e:for(;0<W;){var ye=W-1>>>1,O=D[ye];if(0<d(O,$))D[ye]=$,D[W]=O,W=ye;else break e}}function r(D){return D.length===0?null:D[0]}function o(D){if(D.length===0)return null;var $=D[0],W=D.pop();if(W!==$){D[0]=W;e:for(var ye=0,O=D.length,ie=O>>>1;ye<ie;){var be=2*(ye+1)-1,we=D[be],E=be+1,Y=D[E];if(0>d(we,W))E<O&&0>d(Y,we)?(D[ye]=Y,D[E]=W,ye=E):(D[ye]=we,D[be]=W,ye=be);else if(E<O&&0>d(Y,W))D[ye]=Y,D[E]=W,ye=E;else break e}}return $}function d(D,$){var W=D.sortIndex-$.sortIndex;return W!==0?W:D.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();a.unstable_now=function(){return h.now()-m}}var p=[],x=[],v=1,y=null,w=3,N=!1,C=!1,k=!1,j=!1,_=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function q(D){for(var $=r(x);$!==null;){if($.callback===null)o(x);else if($.startTime<=D)o(x),$.sortIndex=$.expirationTime,i(p,$);else break;$=r(x)}}function he(D){if(k=!1,q(D),!C)if(r(p)!==null)C=!0,B||(B=!0,ae());else{var $=r(x);$!==null&&U(he,$.startTime-D)}}var B=!1,z=-1,T=5,F=-1;function X(){return j?!0:!(a.unstable_now()-F<T)}function re(){if(j=!1,B){var D=a.unstable_now();F=D;var $=!0;try{e:{C=!1,k&&(k=!1,R(z),z=-1),N=!0;var W=w;try{t:{for(q(D),y=r(p);y!==null&&!(y.expirationTime>D&&X());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,w=y.priorityLevel;var O=ye(y.expirationTime<=D);if(D=a.unstable_now(),typeof O=="function"){y.callback=O,q(D),$=!0;break t}y===r(p)&&o(p),q(D)}else o(p);y=r(p)}if(y!==null)$=!0;else{var ie=r(x);ie!==null&&U(he,ie.startTime-D),$=!1}}break e}finally{y=null,w=W,N=!1}$=void 0}}finally{$?ae():B=!1}}}var ae;if(typeof I=="function")ae=function(){I(re)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,se=de.port2;de.port1.onmessage=re,ae=function(){se.postMessage(null)}}else ae=function(){_(re,0)};function U(D,$){z=_(function(){D(a.unstable_now())},$)}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(D){D.callback=null},a.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<D?Math.floor(1e3/D):5},a.unstable_getCurrentPriorityLevel=function(){return w},a.unstable_next=function(D){switch(w){case 1:case 2:case 3:var $=3;break;default:$=w}var W=w;w=$;try{return D()}finally{w=W}},a.unstable_requestPaint=function(){j=!0},a.unstable_runWithPriority=function(D,$){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var W=w;w=D;try{return $()}finally{w=W}},a.unstable_scheduleCallback=function(D,$,W){var ye=a.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ye+W:ye):W=ye,D){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=W+O,D={id:v++,callback:$,priorityLevel:D,startTime:W,expirationTime:O,sortIndex:-1},W>ye?(D.sortIndex=W,i(x,D),r(p)===null&&D===r(x)&&(k?(R(z),z=-1):k=!0,U(he,W-ye))):(D.sortIndex=O,i(p,D),C||N||(C=!0,B||(B=!0,ae()))),D},a.unstable_shouldYield=X,a.unstable_wrapCallback=function(D){var $=w;return function(){var W=w;w=$;try{return D.apply(this,arguments)}finally{w=W}}}})(Ef)),Ef}var Dy;function Rw(){return Dy||(Dy=1,Cf.exports=Dw()),Cf.exports}var Af={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 Ry;function zw(){if(Ry)return nn;Ry=1;var a=qh();function i(v){var y="https://react.dev/errors/"+v;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)y+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+v+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key");function m(v,y,w){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:N==null?null:N===h?h:""+N,children:v,containerInfo:y,implementation:w}}var p=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(v,y){if(v==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,nn.browser=function(v){return{$$typeof:f,_reason:v}},nn.createPortal=function(v,y){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return m(v,y,null,w)},nn.flushSync=function(v){var y=p.T,w=o.p;try{if(p.T=null,o.p=2,v)return v()}finally{p.T=y,o.p=w,o.d.f()}},nn.preconnect=function(v,y){typeof v=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,o.d.C(v,y))},nn.prefetchDNS=function(v){typeof v=="string"&&o.d.D(v)},nn.preinit=function(v,y){if(typeof v=="string"&&y&&typeof y.as=="string"){var w=y.as,N=x(w,y.crossOrigin),C=typeof y.integrity=="string"?y.integrity:void 0,k=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;w==="style"?o.d.S(v,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:N,integrity:C,fetchPriority:k}):w==="script"&&o.d.X(v,{crossOrigin:N,integrity:C,fetchPriority:k,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},nn.preinitModule=function(v,y){if(typeof v=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var w=x(y.as,y.crossOrigin);o.d.M(v,{crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&o.d.M(v)},nn.preload=function(v,y){if(typeof v=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var w=y.as,N=x(w,y.crossOrigin);o.d.L(v,w,{crossOrigin:N,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},nn.preloadModule=function(v,y){if(typeof v=="string")if(y){var w=x(y.as,y.crossOrigin);o.d.m(v,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else o.d.m(v)},nn.requestFormReset=function(v){o.d.r(v)},nn.unstable_batchedUpdates=function(v,y){return v(y)},nn.useFormState=function(v,y,w){return p.H.useFormState(v,y,w)},nn.useFormStatus=function(){return p.H.useHostTransitionStatus()},nn.version="19.3.0",nn}var zy;function F0(){if(zy)return Af.exports;zy=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(),Af.exports=zw(),Af.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 My;function Mw(){if(My)return mr;My=1;var a=Rw(),i=qh(),r=F0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(l=c.return,l!==null){n=l;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return p(c),e;if(u===l)return p(c),t;u=u.sibling}throw Error(o(188))}if(n.return!==l.return)n=c,l=u;else{for(var 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 v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}function y(e,t,n,l,c,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,l,c,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&y(e.child,t,n,l,c,u))return!0;e=e.sibling}return!1}function 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 N(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 C(e){var t=[null,null],n=w(e);return n===null||k(t,e,n.child,{foundSelf:!1}),t}function k(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)&&k(e,t,n.child,l))return!0;n=n.sibling}return!1}function j(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var _=null,R=null;function I(e,t,n){return e===n?!0:e===t?(_=e,!0):!1}function q(e,t,n){return e===n?(R=e,!1):e===t?(R!==null&&(_=e),!0):!1}function he(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 z=Object.assign,T=Symbol.for("react.element"),F=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),re=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),U=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),ye=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),be=Symbol.for("react.legacy_hidden"),we=Symbol.for("react.memo_cache_sentinel"),E=Symbol.for("react.view_transition"),Y=Symbol.for("react.recoverable"),V=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case re:return"Fragment";case de:return"Profiler";case ae:return"StrictMode";case $:return"Suspense";case W:return"SuspenseList";case ie:return"Activity";case E:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case U:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ye:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var me=Array.isArray,ce=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qe={pending:!1,data:null,method:null,action:null},it=[],mt=-1;function wt(e){return{current:e}}function Le(e){0>mt||(e.current=it[mt],it[mt]=null,mt--)}function xe(e,t){mt++,it[mt]=e.current,e.current=t}var ze=wt(null),Ne=wt(null),Pe=wt(null),vt=wt(null);function ne(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)?Mx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mx(t),e=Ox(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Le(ze),xe(ze,e)}function te(){Le(ze),Le(Ne),Le(Pe)}function ve(e){var t=e.memoizedState;t!==null&&(li._currentValue=t.memoizedState,xe(vt,e)),t=ze.current;var n=Ox(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),li._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 Ht(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(ke){var H=ke}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(ke){H=ke}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(ke){H=ke}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ke){if(ke&&H&&typeof ke.stack=="string")return[ke.stack,H.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 J=`
46
- `+A[l].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=l&&0<=c);break}}}finally{sn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Tt(n):""}function bi(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 Ht(e.type,!1);case 11:return Ht(e.type.render,!1);case 1:return Ht(e.type,!0);case 31:return Tt("Activity");case 30:return Tt("ViewTransition");default:return""}}function xl(e){try{var t="",n=null;do t+=bi(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
- Error generating stack: `+l.message+`
48
- `+l.stack}}var Fa=Object.prototype.hasOwnProperty,Ts=a.unstable_scheduleCallback,Ka=a.unstable_cancelCallback,vi=a.unstable_shouldYield,yl=a.unstable_requestPaint,Rt=a.unstable_now,Ya=a.unstable_getCurrentPriorityLevel,Ds=a.unstable_ImmediatePriority,Qa=a.unstable_UserBlockingPriority,ka=a.unstable_NormalPriority,oe=a.unstable_LowPriority,Re=a.unstable_IdlePriority,et=a.log,Ct=a.unstable_setDisableYieldValue,fn=null,Fe=null;function L(e){if(typeof et=="function"&&Ct(e),Fe&&typeof Fe.setStrictMode=="function")try{Fe.setStrictMode(fn,e)}catch{}}var Ce=Math.clz32?Math.clz32:Yn,xt=Math.log,Sn=Math.LN2;function Yn(e){return e>>>=0,e===0?32:31-(xt(e)/Sn|0)|0}var Qn=256,la=262144,ia=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 ra(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 Si(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function im(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 H1(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 rm(){var e=ia;return ia<<=1,(ia&62914560)===0&&(ia=4194304),e}function Xc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function q1(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 J=31-Ce(n),ge=1<<J;S[J]=0,A[J]=-1;var H=G[J];if(H!==null)for(G[J]=null,J=0;J<H.length;J++){var Z=H[J];Z!==null&&(Z.lane&=-536870913)}n&=~ge}l!==0&&om(e,l,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(g&~t))}function om(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 cm(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 um(e,t){var n=t&-t;return n=(n&42)!==0?1:Zc(n),(n&(e.suspendedLanes|t))!==0?0:n}function Zc(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 Jc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function dm(){var e=Se.p;return e!==0?e:(e=window.event,e===void 0?32:yy(e.type))}function fm(e,t){var n=Se.p;try{return Se.p=e,t()}finally{Se.p=n}}var Na=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Na,hn="__reactProps$"+Na,bl="__reactContainer$"+Na,hm="__reactEvents$"+Na,P1="__reactListeners$"+Na,G1="__reactHandles$"+Na,mm="__reactResources$"+Na,ji="__reactMarker$"+Na,Hr="__reactLoad$"+Na;function qr(e){delete e[Zt],delete e[hn],delete e[P1],delete e[G1]}function Rs(e){var t;if(t=e[Zt])return t;for(var n=e.parentNode;n;){if(t=n[bl]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$x(e);e!==null;){if(n=e[Zt])return n;e=$x(e)}return t}e=n,n=e.parentNode}return null}function vl(e){if(e=e[Zt]||e[bl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ki(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Sl(e){var t=e[mm];return t||(t=e[mm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function It(e){e[ji]=!0}function pm(e){e[Hr]=void 0}var gm=new Set,xm={};function zs(e,t){wl(e,t),wl(e+"Capture",t)}function wl(e,t){for(xm[e]=t,e=0;e<t.length;e++)gm.add(t[e])}var V1=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]*$"),ym={},bm={};function I1(e){return Fa.call(bm,e)?!0:Fa.call(ym,e)?!1:V1.test(e)?bm[e]=!0:(ym[e]=!0,!1)}var rt=!1;function vm(){var e=rt;return rt=!1,e}function Pr(e,t,n){if(I1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Gr(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 Ca(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,l)}}function wn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function F1(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 $c(e){if(!e._valueTracker){var t=Sm(e)?"checked":"value";e._valueTracker=F1(e,t,""+e[t])}}function wm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Sm(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}var K1=/[\n"\\]/g;function Rn(e){return e.replace(K1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Wc(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=""+wn(t)):e.value!==""+wn(t)&&(e.value=""+wn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?g==="number"&&e.value==t?eu(e,wn(e.value)):eu(e,wn(t)):n!=null?eu(e,wn(n)):l!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+wn(S):e.removeAttribute("name")}function jm(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)){$c(e);return}n=n!=null?""+wn(n):"",t=t!=null?""+wn(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=S?e.checked:!!l,e.defaultChecked=!!l,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),$c(e)}function eu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function jl(e,t,n,l){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&l&&(e[n].defaultSelected=!0)}else{for(n=""+wn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function km(e,t,n){if(t!=null&&(t=""+wn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+wn(n):""}function Nm(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(me(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=wn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),$c(e)}function kl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Y1=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 Cm(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||Y1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Em(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&&(Cm(e,c,l),rt=!0)}else for(var u in t)t.hasOwnProperty(u)&&Cm(e,u,t[u])}function tu(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 Q1=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"]]),X1=/^[\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 Vr(e){return X1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function oa(){}var nu=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nl=null,Cl=null;function Am(e){var t=vl(e);if(t&&(e=t.stateNode)){var n=e[hn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Wc(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="'+Rn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var c=l[hn]||null;if(!c)throw Error(o(90));Wc(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&&wm(l)}break e;case"textarea":km(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&jl(e,!!n.multiple,t,!1)}}}var su=!1;function _m(e,t,n){if(su)return e(t,n);su=!0;try{var l=e(t);return l}finally{if(su=!1,(Nl!==null||Cl!==null)&&(Io(),Nl&&(t=Nl,e=Cl,Cl=Nl=null,Am(t),e)))for(t=0;t<e.length;t++)Am(e[t])}}function Ni(e,t){var n=e.stateNode;if(n===null)return null;var l=n[hn]||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 Ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lu=!1;if(Ea)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){lu=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{lu=!1}var Xa=null,iu=null,Ir=null;function Tm(){if(Ir)return Ir;var e,t=iu,n=t.length,l,c="value"in Xa?Xa.value:Xa.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 Ir=c.slice(e,1<l?1-l:void 0)}function Fr(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 Kr(){return!0}function Dm(){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)?Kr:Dm,this.isPropagationStopped=Dm,this}return z(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=Kr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kr)},persist:function(){},isPersistent:Kr}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yr=on(Za),Ei=z({},Za,{view:0,detail:0}),Z1=on(Ei),ru,ou,Ai,Qr=z({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uu,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!==Ai&&(Ai&&e.type==="mousemove"?(ru=e.screenX-Ai.screenX,ou=e.screenY-Ai.screenY):ou=ru=0,Ai=e),ru)},movementY:function(e){return"movementY"in e?e.movementY:ou}}),Rm=on(Qr),J1=z({},Qr,{dataTransfer:0}),$1=on(J1),W1=z({},Ei,{relatedTarget:0}),cu=on(W1),e2=z({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),t2=on(e2),n2=z({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),a2=on(n2),s2=z({},Za,{data:0}),zm=on(s2),l2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i2={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"},r2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=r2[e])?!!t[e]:!1}function uu(){return o2}var c2=z({},Ei,{key:function(e){if(e.key){var t=l2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?i2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uu,charCode:function(e){return e.type==="keypress"?Fr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),u2=on(c2),d2=z({},Qr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mm=on(d2),f2=z({},Za,{submitter:0}),h2=on(f2),m2=z({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uu}),p2=on(m2),g2=z({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),x2=on(g2),y2=z({},Qr,{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}),b2=on(y2),v2=z({},Za,{newState:0,oldState:0,source:0}),S2=on(v2),w2=[9,13,27,32],du=Ea&&"CompositionEvent"in window,_i=null;Ea&&"documentMode"in document&&(_i=document.documentMode);var j2=Ea&&"TextEvent"in window&&!_i,Om=Ea&&(!du||_i&&8<_i&&11>=_i),Lm=" ",Bm=!1;function Um(e,t){switch(e){case"keyup":return w2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var El=!1;function k2(e,t){switch(e){case"compositionend":return Hm(t);case"keypress":return t.which!==32?null:(Bm=!0,Lm);case"textInput":return e=t.data,e===Lm&&Bm?null:e;default:return null}}function N2(e,t){if(El)return e==="compositionend"||!du&&Um(e,t)?(e=Tm(),Ir=iu=Xa=null,El=!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 Om&&t.locale!=="ko"?null:t.data;default:return null}}var C2={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 qm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!C2[e.type]:t==="textarea"}function Pm(e,t,n,l){Nl?Cl?Cl.push(l):Cl=[l]:Nl=l,t=Zo(t,"onChange"),0<t.length&&(n=new Yr("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Ti=null,Di=null;function E2(e){Ax(e,0)}function Xr(e){var t=ki(e);if(wm(t))return e}function Gm(e,t){if(e==="change")return t}var Vm=!1;if(Ea){var fu;if(Ea){var hu="oninput"in document;if(!hu){var Im=document.createElement("div");Im.setAttribute("oninput","return;"),hu=typeof Im.oninput=="function"}fu=hu}else fu=!1;Vm=fu&&(!document.documentMode||9<document.documentMode)}function Fm(){Ti&&(Ti.detachEvent("onpropertychange",Km),Di=Ti=null)}function Km(e){if(e.propertyName==="value"&&Xr(Di)){var t=[];Pm(t,Di,e,au(e)),_m(E2,t)}}function A2(e,t,n){e==="focusin"?(Fm(),Ti=t,Di=n,Ti.attachEvent("onpropertychange",Km)):e==="focusout"&&Fm()}function _2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xr(Di)}function T2(e,t){if(e==="click")return Xr(t)}function D2(e,t){if(e==="input"||e==="change")return Xr(t)}function R2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:R2;function Ri(e,t){if(jn(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(!Fa.call(t,c)||!jn(e[c],t[c]))return!1}return!0}function mu(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 Ym(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qm(e,t){var n=Ym(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=Ym(n)}}function Xm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mu(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=mu(e.document)}return t}function pu(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 z2=Ea&&"documentMode"in document&&11>=document.documentMode,Al=null,gu=null,zi=null,xu=!1;function Jm(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xu||Al==null||Al!==mu(l)||(l=Al,"selectionStart"in l&&pu(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}),zi&&Ri(zi,l)||(zi=l,l=Zo(gu,"onSelect"),0<l.length&&(t=new Yr("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Al)))}function Ms(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _l={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},yu={},$m={};Ea&&($m=document.createElement("div").style,"AnimationEvent"in window||(delete _l.animationend.animation,delete _l.animationiteration.animation,delete _l.animationstart.animation),"TransitionEvent"in window||delete _l.transitionend.transition);function Os(e){if(yu[e])return yu[e];if(!_l[e])return e;var t=_l[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $m)return yu[e]=t[n];return e}var Wm=Os("animationend"),ep=Os("animationiteration"),tp=Os("animationstart"),M2=Os("transitionrun"),O2=Os("transitionstart"),L2=Os("transitioncancel"),np=Os("transitionend"),ap=new Map,bu="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(" ");bu.push("scrollEnd");function Zn(e,t){ap.set(e,t),zs(t,[e])}var B2=0;function Aa(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ea.identifierPrefix;var n=B2++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function sp(e){if(e==null||typeof e=="string")return e;var t=null,n=Xl;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 _a(e,t){return e=sp(e),t=sp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Zr=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)},zn=[],Tl=0,vu=0;function Jr(){for(var e=Tl,t=vu=Tl=0;t<e;){var n=zn[t];zn[t++]=null;var l=zn[t];zn[t++]=null;var c=zn[t];zn[t++]=null;var u=zn[t];if(zn[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&&lp(n,c,u)}}function $r(e,t,n,l){zn[Tl++]=e,zn[Tl++]=t,zn[Tl++]=n,zn[Tl++]=l,vu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Su(e,t,n,l){return $r(e,t,n,l),Wr(e)}function Ls(e,t){return $r(e,null,null,t),Wr(e)}function lp(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 Wr(e){if(50<tr)throw tr=0,Vo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dl={};function U2(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 U2(e,t,n,l)}function wu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ta(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 ip(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 eo(e,t,n,l,c,u){var g=0;if(l=e,typeof l=="function")wu(l)&&(g=1);else if(typeof l=="string")g=fw(e,n,ze.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ie:return e=mn(31,n,t,c),e.elementType=ie,e.lanes=u,e;case re:return Bs(n.children,c,u,t);case ae:g=8,c|=24;break;case de:return e=mn(12,n,t,c|2),e.elementType=de,e.lanes=u,e;case $:return e=mn(13,n,t,c),e.elementType=$,e.lanes=u,e;case W:return e=mn(19,n,t,c),e.elementType=W,e.lanes=u,e;case be: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 U:g=10;break e;case se:g=9;break e;case D:g=11;break e;case ye:g=14;break e;case O: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 Bs(e,t,n,l){return e=mn(7,e,l,t),e.lanes=n,e}function ju(e,t,n){return e=mn(6,e,null,t),e.lanes=n,e}function rp(e){var t=mn(18,null,null,0);return t.stateNode=e,t}function ku(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 op=new WeakMap;function Mn(e,t){if(typeof e=="object"&&e!==null){var n=op.get(e);return n!==void 0?n:(t={value:e,source:t,stack:xl(t)},op.set(e,t),t)}return{value:e,source:t,stack:xl(t)}}var Rl=[],zl=0,to=null,Mi=0,On=[],Ln=0,Ja=null,ca=1,ua="";function Da(e,t){Rl[zl++]=Mi,Rl[zl++]=to,to=e,Mi=t}function cp(e,t,n){On[Ln++]=ca,On[Ln++]=ua,On[Ln++]=Ja,Ja=e;var l=ca;e=ua;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,ca=1<<32-Ce(t)+c|n<<c|l,ua=u+e}else ca=1<<u|n<<c|l,ua=e}function no(e){e.return!==null&&(Da(e,1),cp(e,1,0))}function Nu(e){for(;e===to;)to=Rl[--zl],Rl[zl]=null,Mi=Rl[--zl],Rl[zl]=null;for(;e===Ja;)Ja=On[--Ln],On[Ln]=null,ua=On[--Ln],On[Ln]=null,ca=On[--Ln],On[Ln]=null}function up(e,t){On[Ln++]=ca,On[Ln++]=ua,On[Ln++]=Ja,ca=t.id,ua=t.overflow,Ja=e}var Ft=null,yt=null,Ye=!1,$a=null,Bn=!1,Cu=Error(o(519));function Wa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oi(Mn(t,e)),Cu}function dp(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Zt]=e,t[hn]=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<ar.length;n++)Je(ar[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),jm(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),Nm(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Rx(t.textContent,n)?(l.popover!=null&&(Je("beforetoggle",t),Je("toggle",t)),l.onScroll!=null&&Je("scroll",t),l.onScrollEnd!=null&&Je("scrollend",t),l.onClick!=null&&(t.onclick=oa),t=!0):t=!1,t||Wa(e,!0)}function ao(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:Ft=Ft.return}}function Ml(e){if(e!==Ft)return!1;if(!Ye)return ao(e),Ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||nf(e.type,e.memoizedProps)),n=!n),n&&yt&&Wa(e),ao(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));yt=Jx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));yt=Jx(e)}else t===27?(t=yt,ps(e.type)?(e=ff,ff=null,yt=e):yt=t):yt=Ft?Hn(e.stateNode.nextSibling):null;return!0}function Us(){yt=Ft=null,Ye=!1}function Eu(){var e=$a;return e!==null&&(xn===null?xn=e:xn.push.apply(xn,e),$a=null),e}function Oi(e){$a===null?$a=[e]:$a.push(e)}var Au=wt(null),Hs=null,Ra=null;function es(e,t,n){xe(Au,t._currentValue),t._currentValue=n}function za(e){e._currentValue=Au.current,Le(Au)}function so(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 _u(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),so(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),so(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),so(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 qs(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;jn(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(li):e=[li])}c=c.return}return e!==null&&_u(t,e,n,l),t.flags|=262144,e!==null}function lo(e){for(e=e.firstContext;e!==null;){if(!jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ps(e){Hs=e,Ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return fp(Hs,e)}function io(e,t){return Hs===null&&Ps(e),fp(e,t)}function fp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ra===null){if(e===null)throw Error(o(308));Ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ra=Ra.next=t;return n}var H2=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()})}},q2=a.unstable_scheduleCallback,P2=a.unstable_NormalPriority,zt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tu(){return{controller:new H2,data:new Map,refCount:0}}function Li(e){e.refCount--,e.refCount===0&&q2(P2,function(){e.controller.abort()})}function hp(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 Bi=null;function G2(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ui=null,Du=0,Gs=0,Ol=null;function V2(e,t){if(Ui===null){var n=Ui=[];Du=0,Gs=Yd(),Ol={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Du++,t.then(mp,mp),t}function mp(){if(--Du===0&&(Bi=null,Ui!==null)){Ol!==null&&(Ol.status="fulfilled");var e=Ui;Ui=null,Gs=0,Ol=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function I2(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),l}var pp=ce.S;ce.S=function(e,t){if(rx=Rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&V2(e,t),Bi!==null)for(var n=Wl;n!==null;)hp(n,Bi),n=n.next;if(n=e.types,n!==null){for(var l=Wl;l!==null;)hp(l,n),l=l.next;if(Gs!==0){l=Bi,l===null&&(l=Bi=[]);for(var c=0;c<n.length;c++){var u=n[c];l.indexOf(u)===-1&&l.push(u)}}}pp!==null&&pp(e,t)};var Vs=wt(null);function Ru(){var e=Vs.current;return e!==null?e:gt.pooledCache}function ro(e,t){t===null?xe(Vs,Vs.current):xe(Vs,t.pool)}function gp(){var e=Ru();return e===null?null:{parent:zt._currentValue,pool:e}}var Ll=Error(o(460)),zu=Error(o(474)),oo=Error(o(542)),co={then:function(){}};function xp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(oa,oa),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vp(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(oa,oa);else{if(e=gt,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,vp(e),e}throw Fs=t,Ll}}function Is(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Fs=n,Ll):n}}var Fs=null;function bp(){if(Fs===null)throw Error(o(459));var e=Fs;return Fs=null,e}function vp(e){if(e===Ll||e===oo)throw Error(o(483))}var Bl=null,Hi=0;function uo(e){var t=Hi;return Hi+=1,Bl===null&&(Bl=[]),yp(Bl,e,t)}function ts(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fo(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 Sp(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=Ta(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=ju(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===re?(P=J(P,M,K.props.children,pe,K.key),ts(P,K),P):M!==null&&(M.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===O&&Is(Ee)===M.type)?(M=c(M,K.props),ts(M,K),M.return=P,M):(M=eo(K.type,K.key,K.props,null,P.mode,pe),ts(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=ku(K,P.mode,pe),M.return=P,M):(M=c(M,K.children||[]),M.return=P,M)}function J(P,M,K,pe,Ee){return M===null||M.tag!==7?(M=Bs(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=ju(""+M,P.mode,K),M.return=P,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case F:return K=eo(M.type,M.key,M.props,null,P.mode,K),ts(K,M),K.return=P,K;case X:return M=ku(M,P.mode,K),M.return=P,M;case O:return M=Is(M),ge(P,M,K)}if(me(M)||le(M))return M=Bs(M,P.mode,K,null),M.return=P,M;if(typeof M.then=="function")return ge(P,uo(M),K);if(M.$$typeof===U)return ge(P,io(P,M),K);fo(P,M)}return null}function H(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 X:return K.key===Ee?G(P,M,K,pe):null;case O:return K=Is(K),H(P,M,K,pe)}if(me(K)||le(K))return Ee!==null?null:J(P,M,K,pe,null);if(typeof K.then=="function")return H(P,M,uo(K),pe);if(K.$$typeof===U)return H(P,M,io(P,K),pe);fo(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 X:return P=P.get(pe.key===null?K:pe.key)||null,G(M,P,pe,Ee);case O:return pe=Is(pe),Z(P,M,K,pe,Ee)}if(me(pe)||le(pe))return P=P.get(K)||null,J(M,P,pe,Ee,null);if(typeof pe.then=="function")return Z(P,M,K,uo(pe),Ee);if(pe.$$typeof===U)return Z(P,M,K,io(M,pe),Ee);fo(M,pe)}return null}function ke(P,M,K,pe){for(var Ee=null,We=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=H(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),We===null?Ee=at:We.sibling=at,We=at,Me=Lt}if(Be===K.length)return n(P,Me),Ye&&Da(P,Be),Ee;if(Me===null){for(;Be<K.length;Be++)Me=ge(P,K[Be],pe),Me!==null&&(M=u(Me,M,Be),We===null?Ee=Me:We.sibling=Me,We=Me);return Ye&&Da(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),We===null?Ee=Lt:We.sibling=Lt,We=Lt);return e&&Me.forEach(function(vs){return t(P,vs)}),Ye&&Da(P,Be),Ee}function De(P,M,K,pe){if(K==null)throw Error(o(151));for(var Ee=null,We=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 vs=H(P,Me,at.value,pe);if(vs===null){Me===null&&(Me=Lt);break}e&&Me&&vs.alternate===null&&t(P,Me),M=u(vs,M,Be),We===null?Ee=vs:We.sibling=vs,We=vs,Me=Lt}if(at.done)return n(P,Me),Ye&&Da(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),We===null?Ee=at:We.sibling=at,We=at);return Ye&&Da(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),We===null?Ee=at:We.sibling=at,We=at);return e&&Me.forEach(function(kw){return t(P,kw)}),Ye&&Da(P,Be),Ee}function Ie(P,M,K,pe){if(typeof K=="object"&&K!==null&&K.type===re&&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===re){if(M.tag===7){n(P,M.sibling),pe=c(M,K.props.children),ts(pe,K),pe.return=P,P=pe;break e}}else if(M.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===O&&Is(Ee)===M.type){n(P,M.sibling),pe=c(M,K.props),ts(pe,K),pe.return=P,P=pe;break e}n(P,M);break}else t(P,M);M=M.sibling}K.type===re?(pe=Bs(K.props.children,P.mode,pe,K.key),ts(pe,K),pe.return=P,P=pe):(pe=eo(K.type,K.key,K.props,null,P.mode,pe),ts(pe,K),pe.return=P,P=pe)}return g(P);case X: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=ku(K,P.mode,pe),pe.return=P,P=pe}return g(P);case O:return K=Is(K),Ie(P,M,K,pe)}if(me(K))return ke(P,M,K,pe);if(le(K)){if(Ee=le(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,uo(K),pe);if(K.$$typeof===U)return Ie(P,M,io(P,K),pe);fo(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=ju(K,P.mode,pe),pe.return=P,P=pe),g(P)):n(P,M)}return function(P,M,K,pe){try{Hi=0;var Ee=Ie(P,M,K,pe);return Bl=null,Ee}catch(Me){if(Me===Ll||Me===oo)throw Me;var We=mn(29,Me,null,P.mode);return We.lanes=pe,We.return=P,We}finally{}}}var Ks=Sp(!0),wp=Sp(!1),ns=!1;function Mu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ou(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 as(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ss(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=Wr(e),lp(e,null,n),t}return $r(e,l,t,n),Wr(e)}function qi(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,cm(e,n)}}function Lu(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 Bu=!1;function Pi(){if(Bu){var e=Ol;if(e!==null)throw e}}function Gi(e,t,n,l){Bu=!1;var c=e.updateQueue;ns=!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 J=e.alternate;J!==null&&(J=J.updateQueue,S=J.lastBaseUpdate,S!==g&&(S===null?J.firstBaseUpdate=G:S.next=G,J.lastBaseUpdate=A))}if(u!==null){var ge=c.baseState;g=0,J=G=A=null,S=u;do{var H=S.lane&-536870913,Z=H!==S.lane;if(Z?($e&H)===H:(l&H)===H){H!==0&&H===Gs&&(Bu=!0),J!==null&&(J=J.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ke=e,De=S;H=t;var Ie=n;switch(De.tag){case 1:if(ke=De.payload,typeof ke=="function"){ge=ke.call(Ie,ge,H);break e}ge=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=De.payload,H=typeof ke=="function"?ke.call(Ie,ge,H):ke,H==null)break e;ge=z({},ge,H);break e;case 2:ns=!0}}H=S.callback,H!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=c.callbacks,Z===null?c.callbacks=[H]:Z.push(H))}else Z={lane:H,tag:S.tag,payload:S.payload,callback:S.callback,next:null},J===null?(G=J=Z,A=ge):J=J.next=Z,g|=H;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);J===null&&(A=ge),c.baseState=A,c.firstBaseUpdate=G,c.lastBaseUpdate=J,u===null&&(c.shared.lanes=0),ds|=g,e.lanes=g,e.memoizedState=ge}}function jp(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++)jp(n[e],t)}var ls=wt(null),ho=wt(0);function Np(e,t){e=Ua,xe(ho,e),xe(ls,t),Ua=e|t.baseLanes}function Uu(){xe(ho,Ua),xe(ls,ls.current)}function Hu(){Ua=ho.current,Le(ls),Le(ho)}var $t=wt(null),ln=null;function is(e){var t=e.alternate;xe(Wt,Wt.current&1),xe($t,e),ln===null&&(t===null||ls.current!==null||t.memoizedState!==null)&&(ln=e)}function qu(e){xe(Wt,Wt.current),xe($t,e),ln===null&&(ln=e)}function Cp(e){e.tag===22?(xe(Wt,Wt.current),xe($t,e),ln===null&&(ln=e)):rs()}function rs(){xe(Wt,Wt.current),xe($t,$t.current)}function kn(e){Le($t),ln===e&&(ln=null),Le(Wt)}var Wt=wt(0);function Vi(e,t){xe($t,$t.current),xe(Wt,t)}function Pu(e){Le(Wt),Le($t),ln===e&&(ln=null)}function mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(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 Ma=0,Ve=null,pt=null,Mt=null,po=!1,Ul=!1,Ys=!1,go=0,Ii=0,Hl=null,F2=0;function Et(){throw Error(o(321))}function Gu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function Vu(e,t,n,l,c,u){return Ma=u,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?cg:ug,Ys=!1,u=n(l,c),Ys=!1,Ul&&(u=Ap(t,n,l,c)),Ep(e),u}function Ep(e){ce.H=jo;var t=pt!==null&&pt.next!==null;if(Ma=0,Mt=pt=Ve=null,po=!1,Ii=0,Hl=null,t)throw Error(o(300));e===null||Ot||(e=e.dependencies,e!==null&&lo(e)&&(Ot=!0))}function Ap(e,t,n,l){Ve=e;var c=0;do{if(Ul&&(Hl=null),Ii=0,Ul=!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)}ce.H=W2,u=t(n,l)}while(Ul);return u}function K2(){var e=ce.H,t=e.useState()[0];return t=typeof t.then=="function"?Fi(t):t,e=e.useState()[0],(pt!==null?pt.memoizedState:null)!==e&&(Ve.flags|=1024),t}function Iu(){var e=go!==0;return go=0,e}function Fu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ku(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}Ma=0,Mt=pt=Ve=null,Ul=!1,Ii=go=0,Hl=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 xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fi(e){var t=Ii;return Ii+=1,Hl===null&&(Hl=[]),e=yp(Hl,e,t),t=Ve,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?cg:ug),e}function yo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Fi(e);if(e.$$typeof===Y)return;if(e.$$typeof===U)return Jt(e)}throw Error(o(438,String(e)))}function Yu(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=xo(),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]=we;return t.index++,n}function Oa(e,t){return typeof t=="function"?t(e):t}function bo(e){var t=Dt();return Qu(t,pt,e)}function Qu(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,J=!1;do{var ge=G.lane&-536870913;if(ge!==G.lane?($e&ge)===ge:(Ma&ge)===ge){var H=G.revertLane;if(H===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ge===Gs&&(J=!0);else if((Ma&H)===H){G=G.next,H===Gs&&(J=!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|=H,ds|=H;ge=G.action,Ys&&n(u,ge),u=G.hasEagerState?G.eagerState:n(u,ge)}else H={lane:ge,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},A===null?(S=A=H,g=u):A=A.next=H,Ve.lanes|=ge,ds|=ge;G=G.next}while(G!==null&&G!==t);if(A===null?g=u:A.next=S,!jn(u,e.memoizedState)&&(Ot=!0,J&&(n=Ol,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 Xu(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);jn(u,t.memoizedState)||(Ot=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function _p(e,t,n){var l=Ve,c=Dt(),u=Ye;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var g=!jn((pt||c).memoizedState,n);if(g&&(c.memoizedState=n,Ot=!0),c=c.queue,$u(Rp.bind(null,l,c,e),[e]),e=c.getSnapshot!==t||g||Mt!==null&&(Mt.memoizedState.tag&1)!==0,ql(e?9:8,{destroy:void 0},Dp.bind(null,l,c,n,t),null),e){if(l.flags|=2048,gt===null)throw Error(o(349));u||(Ma&127)!==0||Tp(l,t,n)}return n}function Tp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t=xo(),Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Dp(e,t,n,l){t.value=n,t.getSnapshot=l,zp(t)&&Mp(e)}function Rp(e,t,n){return n(function(){zp(t)&&Mp(e)})}function zp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function Mp(e){var t=Ls(e,2);t!==null&&yn(t,e,2)}function Zu(e){var t=cn();if(typeof e=="function"){var n=e;if(e=n(),Ys){L(!0);try{n()}finally{L(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:e},t}function Op(e,t,n,l){return e.baseState=n,Qu(e,pt,typeof l=="function"?l:Oa)}function Y2(e,t,n,l,c){if(wo(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)}};ce.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,Lp(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Lp(e,t){var n=t.action,l=t.payload,c=e.state;if(t.isTransition){var u=ce.T,g={};g.types=u!==null?u.types:null,ce.T=g;try{var S=n(c,l),A=ce.S;A!==null&&A(g,S),Bp(e,t,S)}catch(G){Ju(e,t,G)}finally{u!==null&&g.types!==null&&(u.types=g.types),ce.T=u}}else try{u=n(c,l),Bp(e,t,u)}catch(G){Ju(e,t,G)}}function Bp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Up(e,t,l)},function(l){return Ju(e,t,l)}):Up(e,t,n)}function Up(e,t,n){t.status="fulfilled",t.value=n,Hp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Lp(e,n)))}function Ju(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Hp(t),t=t.next;while(t!==l)}e.action=null}function Hp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qp(e,t){return t}function Pp(e,t){if(Ye){var n=gt.formState;if(n!==null){e:{var l=Ve;if(Ye){if(yt){t:{for(var c=yt,u=Bn;c.nodeType!==8;){if(!u){c=null;break t}if(c=Hn(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){yt=Hn(c.nextSibling),l=c.data==="F!";break e}}Wa(l)}l=!1}l&&(t=n[0])}}return n=cn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:t},n.queue=l,n=ig.bind(null,Ve,l),l.dispatch=n,l=Zu(!1),u=ad.bind(null,Ve,!1,l.queue),l=cn(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,n=Y2.bind(null,Ve,c,u,n),c.dispatch=n,l.memoizedState=e,[t,n,!1]}function Gp(e){var t=Dt();return Vp(t,pt,e)}function Vp(e,t,n){if(t=Qu(e,t,qp)[0],e=bo(Oa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Fi(t)}catch(g){throw g===Ll?oo:g}else l=t;t=Dt();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(Ve.flags|=2048,ql(9,{destroy:void 0},Q2.bind(null,c,n),null)),[l,u,e]}function Q2(e,t){e.action=t}function Ip(e){var t=Dt(),n=pt;if(n!==null)return Vp(t,n,e);Dt(),t=t.memoizedState,n=Dt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function ql(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ve.updateQueue,t===null&&(t=xo(),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 Fp(){return Dt().memoizedState}function vo(e,t,n,l){var c=cn();Ve.flags|=e,c.memoizedState=ql(1|t,{destroy:void 0},n,l===void 0?null:l)}function So(e,t,n,l){var c=Dt();l=l===void 0?null:l;var u=c.memoizedState.inst;pt!==null&&l!==null&&Gu(l,pt.memoizedState.deps)?c.memoizedState=ql(t,u,n,l):(Ve.flags|=e,c.memoizedState=ql(1|t,u,n,l))}function Kp(e,t){vo(8390656,8,e,t)}function $u(e,t){So(2048,8,e,t)}function X2(e){Ve.flags|=4;var t=Ve.updateQueue;if(t===null)t=xo(),Ve.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Yp(e){var t=Dt().memoizedState;return X2({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Qp(e,t){return So(4,2,e,t)}function Xp(e,t){return So(4,4,e,t)}function Zp(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 Jp(e,t,n){n=n!=null?n.concat([e]):null,So(4,4,Zp.bind(null,t,e),n)}function Wu(){}function $p(e,t){var n=Dt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Gu(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Wp(e,t){var n=Dt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Gu(t,l[1]))return l[0];if(l=e(),Ys){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[l,t],l}function ed(e,t,n){return n===void 0||(Ma&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=cx(),Ve.lanes|=e,ds|=e,n)}function eg(e,t,n,l){return jn(n,t)?n:ls.current!==null?(e=ed(e,n,l),jn(e,t)||(Ot=!0),e):(Ma&106)===0||(Ma&1073741824)!==0&&($e&261930)===0?(Ot=!0,e.memoizedState=n):(e=cx(),Ve.lanes|=e,ds|=e,t)}function tg(e,t,n,l,c){var u=Se.p;Se.p=u!==0&&8>u?u:8;var g=ce.T,S={};S.types=g!==null?g.types:null,ce.T=S,ad(e,!1,t,n);try{var A=c(),G=ce.S;if(G!==null&&G(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var J=I2(A,l);Ki(e,t,J,An(e))}else Ki(e,t,l,An(e))}catch(ge){Ki(e,t,{then:function(){},status:"rejected",reason:ge},An())}finally{Se.p=u,g!==null&&S.types!==null&&(g.types=S.types),ce.T=g}}function Z2(){}function td(e,t,n,l){if(e.tag!==5)throw Error(o(476));var c=ng(e).queue;tg(e,c,t,qe,n===null?Z2:function(){return ag(e),n(l)})}function ng(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:Oa,lastRenderedState:qe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ag(e){var t=ng(e);t.next===null&&(t=e.alternate.memoizedState),Ki(e,t.next.queue,{},An())}function nd(){return Jt(li)}function sg(){return Dt().memoizedState}function lg(){return Dt().memoizedState}function J2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=An();e=as(n);var l=ss(t,e,n);l!==null&&(yn(l,t,n),qi(l,t,n)),t={cache:Tu()},e.payload=t;return}t=t.return}}function $2(e,t,n){var l=An();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},wo(e)?rg(t,n):(n=Su(e,t,n,l),n!==null&&(yn(n,e,l),og(n,t,l)))}function ig(e,t,n){var l=An();Ki(e,t,n,l)}function Ki(e,t,n,l){var c={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(wo(e))rg(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,jn(S,g))return $r(e,t,c,0),gt===null&&Jr(),!1}catch{}finally{}if(n=Su(e,t,c,l),n!==null)return yn(n,e,l),og(n,t,l),!0}return!1}function ad(e,t,n,l){if(l={lane:2,revertLane:Yd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wo(e)){if(t)throw Error(o(479))}else t=Su(e,n,l,2),t!==null&&yn(t,e,2)}function wo(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function rg(e,t){Ul=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function og(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,cm(e,n)}}var jo={readContext:Jt,use:yo,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et,useEffectEvent:Et},cg={readContext:Jt,use:yo,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:Kp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,vo(4194308,4,Zp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vo(4194308,4,e,t)},useInsertionEffect:function(e,t){vo(4,2,e,t)},useMemo:function(e,t){var n=cn();t=t===void 0?null:t;var l=e();if(Ys){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(Ys){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=$2.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:function(e){e=Zu(e);var t=e.queue,n=ig.bind(null,Ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Wu,useDeferredValue:function(e,t){var n=cn();return ed(n,e,t)},useTransition:function(){var e=Zu(!1);return e=tg.bind(null,Ve,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ve,c=cn();if(Ye){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),gt===null)throw Error(o(349));($e&127)!==0||Tp(l,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,Kp(Rp.bind(null,l,u,e),[e]),l.flags|=2048,ql(9,{destroy:void 0},Dp.bind(null,l,u,n,t),null),n},useId:function(){var e=cn(),t=gt.identifierPrefix;if(Ye){var n=ua,l=ca;n=(l&~(1<<32-Ce(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=go++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=F2++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:nd,useFormState:Pp,useActionState:Pp,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=ad.bind(null,Ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:Yu,useCacheRefresh:function(){return cn().memoizedState=J2.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)}}},ug={readContext:Jt,use:yo,useCallback:$p,useContext:Jt,useEffect:$u,useImperativeHandle:Jp,useInsertionEffect:Qp,useLayoutEffect:Xp,useMemo:Wp,useReducer:bo,useRef:Fp,useState:function(){return bo(Oa)},useDebugValue:Wu,useDeferredValue:function(e,t){var n=Dt();return eg(n,pt.memoizedState,e,t)},useTransition:function(){var e=bo(Oa)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Fi(e),t]},useSyncExternalStore:_p,useId:sg,useHostTransitionStatus:nd,useFormState:Gp,useActionState:Gp,useOptimistic:function(e,t){var n=Dt();return Op(n,pt,e,t)},useMemoCache:Yu,useCacheRefresh:lg,useEffectEvent:Yp},W2={readContext:Jt,use:yo,useCallback:$p,useContext:Jt,useEffect:$u,useImperativeHandle:Jp,useInsertionEffect:Qp,useLayoutEffect:Xp,useMemo:Wp,useReducer:Xu,useRef:Fp,useState:function(){return Xu(Oa)},useDebugValue:Wu,useDeferredValue:function(e,t){var n=Dt();return pt===null?ed(n,e,t):eg(n,pt.memoizedState,e,t)},useTransition:function(){var e=Xu(Oa)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:Fi(e),t]},useSyncExternalStore:_p,useId:sg,useHostTransitionStatus:nd,useFormState:Ip,useActionState:Ip,useOptimistic:function(e,t){var n=Dt();return pt!==null?Op(n,pt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Yu,useCacheRefresh:lg,useEffectEvent:Yp};function sd(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ld={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=An(),c=as(l);c.payload=t,n!=null&&(c.callback=n),t=ss(e,c,l),t!==null&&(yn(t,e,l),qi(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=An(),c=as(l);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=ss(e,c,l),t!==null&&(yn(t,e,l),qi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=An(),l=as(n);l.tag=2,t!=null&&(l.callback=t),t=ss(e,l,n),t!==null&&(yn(t,e,n),qi(t,e,n))}};function dg(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?!Ri(n,l)||!Ri(c,u):!0}function fg(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&&ld.enqueueReplaceState(t,t.state,null)}function Qs(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=z({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function hg(e){Zr(e)}function mg(e){console.error(e)}function pg(e){Zr(e)}function ko(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function gg(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 id(e,t,n){return n=as(n),n.tag=3,n.payload={element:null},n.callback=function(){ko(e,t)},n}function xg(e){return e=as(e),e.tag=3,e}function yg(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(){gg(t,n,l)}}var g=n.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){gg(t,n,l),typeof c!="function"&&(fs===null?fs=new Set([this]):fs.add(this));var S=l.stack;this.componentDidCatch(l.value,{componentStack:S!==null?S:""})})}function eS(e,t,n,l,c){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&qs(t,n,c,!0),n=$t.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ln===null?Fo():n.alternate===null&&At===0&&(At=3),n.flags&=-257,n.flags|=65536,n.lanes=c,l===co?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Id(e,l,c)),!1;case 22:return n.flags|=65536,l===co?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)),Id(e,l,c)),!1}throw Error(o(435,n.tag))}return Id(e,l,c),Fo(),!1}if(Ye)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Cu&&(e=Error(o(422),{cause:l}),Oi(Mn(e,n)))):(l!==Cu&&(t=Error(o(423),{cause:l}),Oi(Mn(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=Mn(l,n),c=id(e.stateNode,l,c),Lu(e,c),At!==4&&(At=2)),!1;var u=Error(o(520),{cause:l});if(u=Mn(u,n),er===null?er=[u]:er.push(u),At!==4&&(At=2),t===null)return!0;l=Mn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=id(n.stateNode,l,e),Lu(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"&&(fs===null||!fs.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=xg(c),yg(c,e,n,l),Lu(n,c),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var rd=Error(o(461)),Ot=!1;function qt(e,t,n,l){t.child=e===null?wp(t,null,n,l):Ks(t,e.child,n,l)}function bg(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 Ps(t),l=Vu(e,t,n,g,u,c),S=Iu(),e!==null&&!Ot?(Fu(e,t,c),La(e,t,c)):(Ye&&S&&no(t),t.flags|=1,qt(e,t,l,c),t.child)}function vg(e,t,n,l,c){if(e===null){var u=n.type;return typeof u=="function"&&!wu(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Sg(e,t,u,l,c)):(e=eo(n.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!pd(e,c)){var g=u.memoizedProps;if(n=n.compare,n=n!==null?n:Ri,n(g,l)&&e.ref===t.ref)return La(e,t,c)}return t.flags|=1,e=Ta(u,l),e.ref=t.ref,e.return=t,t.child=e}function Sg(e,t,n,l,c){if(e!==null){var u=e.memoizedProps;if(Ri(u,l)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=l=u,pd(e,c))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,La(e,t,c)}return od(e,t,n,l,c)}function wg(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 jg(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ro(t,u!==null?u.cachePool:null),u!==null?Np(t,u):Uu(),Cp(t);else return l=t.lanes=536870912,jg(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(ro(t,u.cachePool),Np(t,u),rs(),t.memoizedState=null):(e!==null&&ro(t,null),Uu(),rs());return qt(e,t,c,n),t.child}function Yi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jg(e,t,n,l,c){var u=Ru();return u=u===null?null:{parent:zt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&ro(t,null),Uu(),Cp(t),e!==null&&qs(e,t,l,!0),t.childLanes=c,null}function No(e,t){return t=Co({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function kg(e,t,n){return Ks(t,e.child,null,n),e=No(t,t.pendingProps),e.flags|=2,kn(t),t.memoizedState=null,e}function tS(e,t,n){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(l.mode==="hidden")return e=No(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Yi(null,e);if(qu(t),(e=yt)?(e=Zx(e,Bn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ja!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=rp(e),n.return=t,t.child=n,Ft=t,yt=null)):e=null,e===null)throw Wa(t);return t.lanes=536870912,null}return No(t,l)}var u=e.memoizedState;if(u!==null){var g=u.dehydrated;if(qu(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||qs(e,t,n,!1),c=(n&e.childLanes)!==0,Ot||c){if(ls.current===null){if(l=gt,l!==null&&(g=um(l,n),g!==0&&g!==u.retryLane))throw u.retryLane=g,Ls(e,g),yn(l,e,g),rd;Fo()}t=kg(e,t,n)}else e=u.treeContext,yt=Hn(g.nextSibling),Ft=t,Ye=!0,$a=null,Bn=!1,e!==null&&up(t,e),t=No(t,l),t.flags|=134221824;return t}return e=Ta(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pl(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 od(e,t,n,l,c){return Ps(t),n=Vu(e,t,n,l,void 0,c),l=Iu(),e!==null&&!Ot?(Fu(e,t,c),La(e,t,c)):(Ye&&l&&no(t),t.flags|=1,qt(e,t,n,c),t.child)}function Ng(e,t,n,l,c,u){return Ps(t),t.updateQueue=null,n=Ap(t,l,n,c),Ep(e),l=Iu(),e!==null&&!Ot?(Fu(e,t,u),La(e,t,u)):(Ye&&l&&no(t),t.flags|=1,qt(e,t,n,u),t.child)}function Cg(e,t,n,l,c){if(Ps(t),t.stateNode===null){var u=Dl,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=ld,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},Mu(t),g=n.contextType,u.context=typeof g=="object"&&g!==null?Jt(g):Dl,u.state=t.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(sd(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&&ld.enqueueReplaceState(u,u.state,null),Gi(t,l,u,c),Pi(),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=Qs(n,S);u.props=A;var G=u.context,J=n.contextType;g=Dl,typeof J=="object"&&J!==null&&(g=Jt(J));var ge=n.getDerivedStateFromProps;J=typeof ge=="function"||typeof u.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,J||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(S||G!==g)&&fg(t,u,l,g),ns=!1;var H=t.memoizedState;u.state=H,Gi(t,l,u,c),Pi(),G=t.memoizedState,S||H!==G||ns?(typeof ge=="function"&&(sd(t,n,ge,l),G=t.memoizedState),(A=ns||dg(t,n,A,l,H,G,g))?(J||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=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,Ou(e,t),g=t.memoizedProps,J=Qs(n,g),u.props=J,ge=t.pendingProps,H=u.context,G=n.contextType,A=Dl,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||H!==A)&&fg(t,u,l,A),ns=!1,H=t.memoizedState,u.state=H,Gi(t,l,u,c),Pi();var Z=t.memoizedState;g!==ge||H!==Z||ns||e!==null&&e.dependencies!==null&&lo(e.dependencies)?(typeof S=="function"&&(sd(t,n,S,l),Z=t.memoizedState),(J=ns||dg(t,n,J,l,H,Z,A)||e!==null&&e.dependencies!==null&&lo(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&&H===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Z),u.props=l,u.state=Z,u.context=A,l=J):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Pl(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=Ks(t,e.child,null,c),t.child=Ks(t,null,n,c)):qt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=La(e,t,c),e}function Eg(e,t,n,l){return Us(),t.flags|=256,qt(e,t,n,l),t.child}var cd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ud(e){return{baseLanes:e,cachePool:gp()}}function dd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=En),e}function Ag(e,t,n){var l=t.pendingProps,c=!1,u=(t.flags&128)!==0,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(Ye){if(c?is(t):rs(),(e=yt)?(e=Zx(e,Bn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ja!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=rp(e),n.return=t,t.child=n,Ft=t,yt=null)):e=null,e===null)throw Wa(t);return df(e)?t.lanes=32:t.lanes=536870912,null}return u=l.children,l=l.fallback,c?(rs(),c=t.mode,u=Co({mode:"hidden",children:u},c),l=Bs(l,c,n,null),u.return=t,l.return=t,u.sibling=l,t.child=u,l=t.child,l.memoizedState=ud(n),l.childLanes=dd(e,g,n),t.memoizedState=cd,Yi(null,l)):(is(t),fd(t,u))}var S=e.memoizedState;if(S!==null){var A=S.dehydrated;if(A!==null)return nS(e,t,u,g,l,A,S,n)}return c?(rs(),c=l.fallback,u=t.mode,S=e.child,A=S.sibling,l=Ta(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&1206910976,A!==null?c=Ta(A,c):(c=Bs(c,u,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,Yi(null,l),l=t.child,c=e.child.memoizedState,c===null?c=ud(n):(u=c.cachePool,u!==null?(S=zt._currentValue,u=u.parent!==S?{parent:S,pool:S}:u):u=gp(),c={baseLanes:c.baseLanes|n,cachePool:u}),l.memoizedState=c,l.childLanes=dd(e,g,n),t.memoizedState=cd,Yi(e.child,l)):(is(t),n=e.child,e=n.sibling,n=Ta(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 fd(e,t){return t=Co({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Co(e,t){return e=mn(22,e,null,t),e.lanes=0,e}function Eo(e,t,n){return Ks(t,e.child,null,n),e=fd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nS(e,t,n,l,c,u,g,S){if(n)return t.flags&256?(is(t),t.flags&=-257,Eo(e,t,S)):t.memoizedState!==null?(rs(),t.child=e.child,t.flags|=128,null):(rs(),u=c.fallback,g=t.mode,c=Co({mode:"visible",children:c.children},g),u=Bs(u,g,S,null),u.flags|=2,c.return=t,u.return=t,c.sibling=u,t.child=c,Ks(t,e.child,null,S),c=t.child,c.memoizedState=ud(S),c.childLanes=dd(e,l,S),t.memoizedState=cd,Yi(null,c));if(is(t),df(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,Oi({value:c,source:null,stack:null})),Eo(e,t,S)}if(Ot||qs(e,t,S,!1),l=(S&e.childLanes)!==0,Ot||l){if(ls.current!==null)return Eo(e,t,S);if(l=gt,l!==null&&(c=um(l,S),c!==0&&c!==g.retryLane))throw g.retryLane=c,Ls(e,c),yn(l,e,c),rd;return uf(u)||Fo(),Eo(e,t,S)}return uf(u)?(t.flags|=192,t.child=e.child,null):(e=g.treeContext,yt=Hn(u.nextSibling),Ft=t,Ye=!0,$a=null,Bn=!1,e!==null&&up(t,e),t=fd(t,c.children),t.flags|=134221824,t)}function _g(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),so(e.return,t,n)}function Tg(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&mo(n)===null&&(t=e),e=e.sibling}return t}function Ao(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 hd(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 md(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 Vi(t,g),null;var S=(g&2)!==0;if(S?(g=g&1|2,t.flags|=128):g&=1,Vi(t,g),c==="backwards"&&e!==null?(hd(e),qt(e,t,l,n),hd(e)):qt(e,t,l,n),l=Ye?Mi:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_g(e,n,t);else if(e.tag===19)_g(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=Tg(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null,hd(t)),Ao(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&&mo(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Ao(t,!0,n,null,u,l);break;case"together":Ao(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:n=Tg(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Ao(t,!1,c,n,u,l)}return t.child}function Dg(e,t,n){var l=t.pendingProps;return es(t,t.type,l.value),qt(e,t,l.children,n),t.child}function La(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ds|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qs(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=Ta(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ta(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&lo(e)))}function aS(e,t,n){switch(t.tag){case 3:ne(t,t.stateNode.containerInfo),es(t,zt,e.memoizedState.cache),Us();break;case 27:case 5:ve(t);break;case 4:ne(t,t.stateNode.containerInfo);break;case 10:es(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qu(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return is(t),t.flags|=128,null;l=qs(e,t,n,!1);var c=t.child.childLanes;return l||(n&c)!==0?Ag(e,t,n):(is(t),e=La(e,t,n),e!==null?e.sibling:null)}is(t);break;case 19:if(t.flags&128)return md(e,t,n);if(c=(e.flags&128)!==0,l=(n&t.childLanes)!==0,l||(qs(e,t,n,!1),l=(n&t.childLanes)!==0),c){if(l)return md(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Vi(t,Wt.current),l)break;return null;case 22:return t.lanes=0,wg(e,t,n,t.pendingProps);case 24:es(t,zt,e.memoizedState.cache)}return La(e,t,n)}function Rg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!pd(e,n)&&(t.flags&128)===0)return Ot=!1,aS(e,t,n);Ot=(e.flags&131072)!==0}else Ot=!1,Ye&&(t.flags&1048576)!==0&&cp(t,Mi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Is(t.elementType),t.type=e,typeof e=="function")wu(e)?(l=Qs(e,l),t.tag=1,t=Cg(null,t,e,l,n)):(t.tag=0,t=od(null,t,e,l,n));else{if(e!=null){var c=e.$$typeof;if(c===D){t.tag=11,t=bg(null,t,e,l,n);break e}else if(c===ye){t.tag=14,t=vg(null,t,e,l,n);break e}else if(c===U){t.tag=10,t.type=e,t=Dg(null,t,n);break e}}throw t=ue(e)||e,Error(o(306,t,""))}}return t;case 0:return od(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,c=Qs(l,t.pendingProps),Cg(e,t,l,c,n);case 3:e:{if(ne(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var u=t.memoizedState;c=u.element,Ou(e,t),Gi(t,l,null,n);var g=t.memoizedState;if(l=g.cache,es(t,zt,l),l!==u.cache&&_u(t,[zt],n,!0),Pi(),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=Eg(e,t,l,n);break e}else if(l!==c){c=Mn(Error(o(424)),t),Oi(c),t=Eg(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=Hn(e.firstChild),Ft=t,Ye=!0,$a=null,Bn=!0,n=wp(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Us(),l===c){t=La(e,t,n);break e}qt(e,t,l,n)}t=t.child}return t;case 26:return Pl(e,t),e===null?(n=ay(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ye||(t.stateNode=Lx(t.type,t.pendingProps,Pe.current,t)):t.memoizedState=ay(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Ye&&(l=t.stateNode=Wx(t.type,t.pendingProps,Pe.current),Ft=t,Bn=!0,c=yt,ps(t.type)?(ff=c,yt=Hn(l.firstChild)):yt=c),qt(e,t,t.pendingProps.children,n),Pl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((c=l=yt)&&(l=JS(l,t.type,t.pendingProps,Bn),l!==null?(t.stateNode=l,Ft=t,yt=Hn(l.firstChild),Bn=!1,c=!0):c=!1),c||Wa(t)),ve(t),c=t.type,u=t.pendingProps,g=e!==null?e.memoizedProps:null,l=u.children,nf(c,u)?l=null:g!==null&&nf(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Vu(e,t,K2,null,null,n),li._currentValue=c),Pl(e,t),qt(e,t,l,n),t.child;case 6:return e===null&&Ye&&((e=n=yt)&&(n=$S(n,t.pendingProps,Bn),n!==null?(t.stateNode=n,Ft=t,yt=null,e=!0):e=!1),e||Wa(t)),null;case 13:return Ag(e,t,n);case 4:return ne(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ks(t,null,l,n):qt(e,t,l,n),t.child;case 11:return bg(e,t,t.type,t.pendingProps,n);case 7:return l=t.pendingProps,Pl(e,t),qt(e,t,l,n),t.child;case 8:return qt(e,t,t.pendingProps.children,n),t.child;case 12:return qt(e,t,t.pendingProps.children,n),t.child;case 10:return Dg(e,t,n);case 9:return c=t.type._context,l=t.pendingProps.children,Ps(t),c=Jt(c),l=l(c),t.flags|=1,qt(e,t,l,n),t.child;case 14:return vg(e,t,t.type,t.pendingProps,n);case 15:return Sg(e,t,t.type,t.pendingProps,n);case 19:return md(e,t,n);case 31:return tS(e,t,n);case 22:return wg(e,t,n,t.pendingProps);case 24:return Ps(t),l=Jt(zt),e===null?(c=Ru(),c===null&&(c=gt,u=Tu(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:l,cache:c},Mu(t),es(t,zt,c)):((e.lanes&n)!==0&&(Ou(e,t),Gi(t,null,null,n),Pi()),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),es(t,zt,l)):(l=u.cache,es(t,zt,l),l!==c.cache&&_u(t,[zt],n,!0))),qt(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:Ye&&no(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Pl(e,t),qt(e,t,l.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Ba(e){e.flags|=4}function gd(e,t,n,l,c){var u;if((u=(e.mode&32)!==0)&&(u=n===null?ry(t,l):ry(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(hx())e.flags|=8192;else throw Fs=co,zu}else e.flags&=-16777217}function zg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!oy(t))if(hx())e.flags|=8192;else throw Fs=co,zu}function _o(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rm():536870912,e.lanes|=t,Kl|=t)}function Qi(e,t){if(!Ye)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 sS(e,t,n){var l=t.pendingProps;switch(Nu(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),za(zt),te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ml(t)?Ba(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Eu())),bt(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Ba(t),u!==null?(bt(t),zg(t,u)):(bt(t),gd(t,c,null,l,n))):u?u!==e.memoizedState?(Ba(t),bt(t),zg(t,u)):(bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ba(t),bt(t),gd(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&&Ba(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return bt(t),t.subtreeFlags&=-33554433,null}e=ze.current,Ml(t)?dp(t):(e=Wx(c,l,n),t.stateNode=e,Ba(t))}return bt(t),t.subtreeFlags&=-33554433,null;case 5:if(Te(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ba(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return bt(t),t.subtreeFlags&=-33554433,null}if(u=ze.current,Ml(t))dp(t);else{var g=lr(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[hn]=l;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=u;e:switch(tn(u,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ba(t)}}return bt(t),t.subtreeFlags&=-33554433,gd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ba(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Pe.current,Ml(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,c=Ft,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Zt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Rx(e.nodeValue,n)),e||Wa(t,!0)}else e=lr(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=Ml(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 Us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),e=!1}else n=Eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(kn(t),t):(kn(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=Ml(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 Us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),c=!1}else c=Eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(kn(t),t):(kn(t),null)}return kn(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),_o(t,t.updateQueue),bt(t),null);case 4:return te(),e===null&&Jd(t.stateNode.containerInfo),t.flags|=67108864,bt(t),null;case 10:return za(t.type),bt(t),null;case 19:if(Pu(t),l=t.memoizedState,l===null)return bt(t),null;if(c=(t.flags&128)!==0,u=l.rendering,u===null)if(c)Qi(l,!1);else{if(At!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=mo(e),u!==null){for(t.flags|=128,Qi(l,!1),e=u.updateQueue,t.updateQueue=e,_o(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ip(n,e),n=n.sibling;return Vi(t,Wt.current&1|2),Ye&&Da(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Rt()>Po&&(t.flags|=128,c=!0,Qi(l,!1),t.lanes=4194304)}else{if(!c)if(e=mo(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,_o(t,e),Qi(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!u.alternate&&!Ye)return bt(t),null}else 2*Rt()-l.renderingStartTime>Po&&n!==536870912&&(t.flags|=128,c=!0,Qi(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||Ye?Vi(t,u):(n=u,xe($t,t),xe(Wt,n),ln===null&&(ln=t)),Ye&&Da(t,l.treeForkCount),e}return bt(t),null;case 22:case 23:return kn(t),Hu(),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&&_o(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(Vs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),za(zt),bt(t),null;case 25:return null;case 30:return t.flags|=33554432,bt(t),null}throw Error(o(156,t.tag))}function lS(e,t){switch(Nu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return za(zt),te(),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(kn(t),t.alternate===null)throw Error(o(340));Us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pu(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 te(),null;case 10:return za(t.type),null;case 22:case 23:return kn(t),Hu(),e!==null&&Le(Vs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return za(zt),null;case 25:return null;default:return null}}function Mg(e,t){switch(Nu(t),t.tag){case 3:za(zt),te();break;case 26:case 27:case 5:Te(t);break;case 4:te();break;case 31:t.memoizedState!==null&&kn(t);break;case 13:kn(t);break;case 19:Pu(t);break;case 10:za(t.type);break;case 22:case 23:kn(t),Hu(),e!==null&&Le(Vs);break;case 24:za(zt)}}function Xi(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 os(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(J){ft(c,A,J)}}}l=l.next}while(l!==u)}}catch(J){ft(t,t.return,J)}}function Og(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{kp(t,n)}catch(l){ft(e,e.return,l)}}}function Lg(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ft(e,t,l)}}function da(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=Aa(e.memoizedProps,c);(c.ref===null||c.ref.name!==u)&&(c.ref=Vx(u)),l=c.ref;break;case 7:if(e.stateNode===null){var g=new _n(e);y(e.child,!1,XS,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 To(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++)Xx(e.stateNode,t[n])}function Bg(e){for(var t=e.return;t!==null&&(yd(t)&&Xx(e.stateNode,t.stateNode),!xd(t));)t=t.return}function Zi(e){for(var t=e.return;t!==null&&(yd(t)&&ZS(e.stateNode,t.stateNode),!xd(t));)t=t.return}function xd(e){return e.tag===5||e.tag===3||e.tag===27}function yd(e){return e&&e.tag===7&&e.stateNode!==null}function bd(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 vd(e,t,n){try{var l=e.stateNode;DS(l,e.type,n,t),l[hn]=t}catch(c){ft(e,e.return,c)}}function Ug(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ps(e.type)||e.tag===4}function Sd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ug(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&&ps(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 wd(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=oa)),To(e,l),rt=!0;else if(c!==4&&(c===27&&(To(e,l),l=null,ps(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(wd(e,t,n,l),e=e.sibling;e!==null;)wd(e,t,n,l),e=e.sibling}function Do(e,t,n,l){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?n.insertBefore(c,t):n.appendChild(c),To(e,l),rt=!0;else if(c!==4&&(c===27&&(To(e,l),l=null,ps(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Do(e,t,n,l),e=e.sibling;e!==null;)Do(e,t,n,l),e=e.sibling}function Hg(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[hn]=n}catch(u){ft(e,e.return,u)}}var Ro=!1,Nn=null;function qg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Ro=!0)}var fa=null;function Pg(){var e=fa;return fa=null,e}var pn=0;function Gl(e,t,n,l,c){return pn=0,Gg(e.child,t,n,l,c)}function Gg(e,t,n,l,c){for(var u=!1;e!==null;){if(e.tag===5){var g=e.stateNode;if(l!==null){var S=lf(g);l.push(S),S.view&&(u=!0)}else u||lf(g).view&&(u=!0);Ro=!0,Px(g,pn===0?t:t+"_"+pn,n),pn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||Gg(e.child,t,n,l,c)&&(u=!0));e=e.sibling}return u}function ha(e,t){for(;e!==null;)e.tag===5?Gx(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ha(e.child,t)),e=e.sibling}function zo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(zo(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=_a(t.default,t.share),t!=="none"&&(Gl(e,n,t,null,!1)||ha(e.child,!1))}e=e.sibling}}function jd(e,t){if(e.tag===30){var n=e.stateNode,l=e.memoizedProps,c=Aa(l,n),u=_a(l.default,n.paired?l.share:l.enter);u!=="none"?Gl(e,c,u,null,!1)?(zo(e),n.paired||t||Zl(e,l.onEnter)):ha(e.child,!1):zo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)jd(e,t),e=e.sibling;else zo(e)}function kd(e){if(Nn!==null&&Nn.size!==0){var t=Nn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,l=n.name;if(l!=null&&l!=="auto"){var c=t.get(l);if(c!==void 0){var u=_a(n.default,n.share);if(u!=="none"&&(Gl(e,l,u,null,!1)?(u=e.stateNode,c.paired=u,u.paired=c,Zl(e,n.onShare)):ha(e.child,!1)),t.delete(l),t.size===0)break}}}kd(e)}e=e.sibling}}}function Nd(e){if(e.tag===30){var t=e.memoizedProps,n=Aa(t,e.stateNode),l=Nn!==null?Nn.get(n):void 0,c=_a(t.default,l!==void 0?t.share:t.exit);c!=="none"&&(Gl(e,n,c,null,!1)?l!==void 0?(c=e.stateNode,l.paired=c,c.paired=l,Nn.delete(n),Zl(e,t.onShare)):Zl(e,t.onExit):ha(e.child,!1)),Nn!==null&&kd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Nd(e),e=e.sibling;else Nn!==null&&kd(e)}function Vg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Aa(t,e.stateNode);t=_a(t.default,t.update),e.flags&=-5,t!=="none"&&Gl(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Vg(e);e=e.sibling}}function Cd(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,ha(e.child,!1))}Cd(e)}e=e.sibling}}function Mo(e){if(e.tag===30)e.stateNode.paired=null,ha(e.child,!1),Cd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Mo(e),e=e.sibling;else Cd(e)}function Ig(e){for(e=e.child;e!==null;)e.tag===30?ha(e.child,!1):(e.subtreeFlags&33554432)!==0&&Ig(e),e=e.sibling}function Ed(e,t,n,l,c,u,g){for(var S=!1;t!==null;){if(t.tag===5){var A=t.stateNode;if(u!==null&&pn<u.length){var G=u[pn],J=lf(A);(G.view||J.view)&&(S=!0);var ge;if(ge=(e.flags&4)===0)if(J.clip)ge=!0;else{ge=G.rect;var H=J.rect;ge=ge.y!==H.y||ge.x!==H.x||ge.height!==H.height||ge.width!==H.width}ge&&(e.flags|=4),J.abs?J=!G.abs:(G=G.rect,J=J.rect,J=G.height!==J.height||G.width!==J.width),J&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Px(A,pn===0?n:n+"_"+pn,c),S&&(e.flags&4)!==0||(fa===null&&(fa=[]),fa.push(A,pn===0?l:l+"_"+pn,t.memoizedProps)),pn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&g?e.flags|=t.flags&32:Ed(e,t.child,n,l,c,u,g)&&(S=!0));t=t.sibling}return S}function Fg(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=e.stateNode,c=Aa(n,l),u=_a(n.default,n.update),g;g=e.memoizedState,e.memoizedState=null,l=e;var S=e.child;pn=0,c=Ed(l,S,c,c,u,g,!1),(e.flags&4)!==0&&c&&Zl(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Fg(e);e=e.sibling}}var Kt=!1,ct=!1,ma=!1,Ad=!1,Kg=typeof WeakSet=="function"?WeakSet:Set,Yt=null,pa=!1,Ji=!1,Oo=!1,_d=!1;function iS(e,t,n){if(e=e.containerInfo,ef=ii,e=Zm(e),pu(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,J=0,ge=0,H=e,Z=null;t:for(;;){for(var ke;H!==l||u!==0&&H.nodeType!==3||(A=S+u),H!==g||c!==0&&H.nodeType!==3||(G=S+c),H.nodeType===3&&(S+=H.nodeValue.length),(ke=H.firstChild)!==null;)Z=H,H=ke;for(;;){if(H===e)break t;if(Z===l&&++J===u&&(A=S),Z===g&&++ge===c&&(G=S),(ke=H.nextSibling)!==null)break;H=Z,Z=H.parentNode}H=ke}l=A===-1||G===-1?null:{start:A,end:G}}else l=null}l=l||{start:0,end:0}}else l=null;for(tf={focusedElem:e,selectionRange:l},ii=!1,n=(n&335544064)===n,Yt=t,t=n?9270:1024;Yt!==null;){if(e=Yt,n&&(l=e.deletions,l!==null))for(u=0;u<l.length;u++)n&&Nd(l[u]);if(e.alternate===null&&(e.flags&2)!==0)n&&qg(e),Lo(n);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&n&&Nd(l),Lo(n);continue}else if(l!==null&&l.memoizedState!==null){n&&qg(e),Lo(n);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Yt=l):(n&&Vg(e),Lo(n))}}Nn=null}function Lo(e){for(;Yt!==null;){var t=Yt,n=e,l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&l!==null){n=void 0,c=l.memoizedProps,l=l.memoizedState;var u=t.stateNode;try{var g=Qs(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)cf(l);else if(n===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":cf(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=Aa(l.memoizedProps,l.stateNode),c=t.memoizedProps,c=_a(c.default,c.update),c!=="none"&&Gl(l,n,c,l.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(o(163))}if(l=t.sibling,l!==null){l.return=t.return,Yt=l;break}Yt=t.return}}function Yg(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:ga(e,n),l&4&&Xi(5,n);break;case 1:if(ga(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(g){ft(n,n.return,g)}else{var c=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){ft(n,n.return,g)}}l&64&&Og(n),l&512&&da(n,n.return);break;case 3:if(ga(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&&Hg(n);case 26:case 5:ga(e,n),t===null&&l&4&&bd(n),l&512&&da(n,n.return);break;case 12:ga(e,n);break;case 31:ga(e,n),l&4&&Jg(e,n);break;case 13:ga(e,n),l&4&&$g(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=yS.bind(null,n),WS(e,n))));break;case 22:if(l=n.memoizedState!==null||Kt,!l){var u=t!==null&&t.memoizedState!==null||ct;t=Kt,c=ct,Kt=l,(ct=u)&&!c?(l=2,(n.subtreeFlags&8772)!==0&&(l|=1),Wn(e,n,l)):ga(e,n),Kt=t,ct=c}break;case 30:ga(e,n),l&512&&da(n,n.return);break;case 7:l&512&&da(n,n.return);default:ga(e,n)}}function Td(e,t){for(e=e.child;e!==null;)Qg(e,t),e=e.sibling}function Qg(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)}Dd(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?qx(S,!0):qx(e.stateNode,!1)}catch(A){ft(e,e.return,A)}break;case 22:case 23:e.memoizedState===null&&Td(e,t);break;default:Td(e,t)}}function Dd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,l=t;switch(n.tag){case 4:Qg(n,l);break e;case 22:n.memoizedState===null&&Dd(n,l);break e;default:Dd(n,l)}}e=e.sibling}}function Xg(e){var t=e.alternate;t!==null&&(e.alternate=null,Xg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qr(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 kt=null,gn=!1;function Jn(e,t,n){for(n=n.child;n!==null;)Zg(e,t,n),n=n.sibling}function Zg(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(fn,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),Zi(n);var l=kt,c=gn;ps(n.type)&&(kt=n.stateNode,gn=!1),Jn(e,t,n),ey(n.stateNode,n.type,n.memoizedProps),kt=l,gn=c;break;case 5:ct||en(n,t),Zi(n);case 6:if(n.tag===6&&Zi(n),l=kt,c=gn,kt=null,Jn(e,t,n),kt=l,gn=c,kt!==null)if(gn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(n.stateNode),rt=!0}catch(u){ft(n,t,u)}else try{kt.removeChild(n.stateNode),rt=!0}catch(u){ft(n,t,u)}break;case 18:kt!==null&&(gn?(e=kt,Hx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ri(e)):Hx(kt,n.stateNode));break;case 4:l=kt,c=gn,kt=n.stateNode.containerInfo,gn=!0,Jn(e,t,n),kt=l,gn=c;break;case 0:case 11:case 14:case 15:os(2,n,t),ct||os(4,n,t),Jn(e,t,n);break;case 1:ct||(en(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Lg(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 Jg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ri(e)}catch(n){ft(t,t.return,n)}}}function $g(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ri(e)}catch(n){ft(t,t.return,n)}}function rS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Kg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Kg),t;default:throw Error(o(435,e.tag))}}function Bo(e,t){var n=rS(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var c=bS.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(ps(A.type)){kt=A.stateNode,gn=!1;break e}break;case 5:kt=A.stateNode,gn=!1;break e;case 3:case 4:kt=A.stateNode.containerInfo,gn=!0;break e}A=A.return}if(kt===null)throw Error(o(160));Zg(g,S,u),kt=null,gn=!1,g=u.alternate,g!==null&&(g.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Wg(t,e,n),t=t.sibling}var $n=null;function Wg(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&&(os(3,e,e.return),Xi(3,e),os(5,e,e.return));break;case 1:un(t,e,n),dn(e),c&512&&(ct||l===null||en(l,l.return)),c&64&&Kt&&(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(Kt)e.stateNode=Lx(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[ji]||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,It(l),t=l;break e;case"link":if(u=iy("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=iy("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,It(l),t=l}e.stateNode=t}else Kt||gf(u,e.type,e.stateNode);else e.stateNode=ly(u,n,e.memoizedProps);else c!==n?(c===null?(t=l.stateNode,t===null||ct||t.parentNode.removeChild(t)):c.count--,n===null?Kt||gf(u,e.type,e.stateNode):ly(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&vd(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&&vd(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{kl(t,""),rt=!0}catch(J){ft(e,e.return,J)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,vd(e,t,l!==null?l.memoizedProps:t)),c&1024&&(Ad=!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(J){ft(e,e.return,J)}}break;case 3:if(rt=!1,$o=null,u=$n,$n=ir(t.containerInfo),un(t,e,n),$n=u,dn(e),c&4&&l!==null&&l.memoizedState.isDehydrated)try{ri(t.containerInfo)}catch(J){ft(e,e.return,J)}Ad&&(Ad=!1,ex(e)),rt=!1;break;case 4:c=ma,ma=Kt,l=vm(),u=$n,$n=ir(e.stateNode.containerInfo),un(t,e,n),dn(e),$n=u,rt&&Ji&&(Oo=!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,Bo(e,t)));break;case 13:un(t,e,n),dn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(qo=Rt()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Bo(e,t)));break;case 22:u=e.memoizedState!==null,g=l!==null&&l.memoizedState!==null;var S=Kt,A=ct,G=ma;Kt=S||u,ma=G||u,ct=A||g,un(t,e,n),ct=A,ma=G,Kt=S,dn(e),c&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||l===null||g||Kt||ct||(t=g||ct,n=Kt,l=ct,Kt=u||Kt,ct=t,cs(e,2),Kt=n,ct=l),!u&&ma||Td(e,u)),c&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Bo(e,n))));break;case 19:un(t,e,n),dn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Bo(e,t)));break;case 30:c&512&&(ct||l===null||en(l,l.return)),c=vm(),u=Ji,g=(n&335544064)===n,S=e.memoizedProps,Ji=g&&_a(S.default,S.update)!=="none",un(t,e,n),dn(e),g&&l!==null&&rt&&(e.flags|=4),Ji=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(Ug(l)){n=l;break}l=l.return}l=null;for(var c=e.return;c!==null;){if(yd(c)){var u=c.stateNode;l===null?l=[u]:l.push(u)}if(xd(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=Sd(e);Do(e,A,S,g);break;case 5:var G=n.stateNode;n.flags&32&&(kl(G,""),n.flags&=-33);var J=Sd(e);Do(e,J,G,g);break;case 3:case 4:var ge=n.stateNode.containerInfo,H=Sd(e);wd(e,H,ge,g);break;default:throw Error(o(161))}}catch(Z){ft(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ex(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ex(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,ii=!0,t.reset(),ii=!1),e=e.sibling}}function Vl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)tx(t,e),t=t.sibling;else Fg(t)}function tx(e,t){var n=e.alternate;if(n===null)jd(e,!1);else switch(e.tag){case 3:if(_d=pa=!1,Pg(),Vl(t,e),!pa&&!Oo){if(e=fa,e!==null)for(var l=0;l<e.length;l+=3){n=e[l];var c=e[l+1];Gx(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"})),_d=!0}fa=null;break;case 5:Vl(t,e);break;case 4:l=pa,pa=!1,Vl(t,e),pa&&(Oo=!0),pa=l;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?jd(e,!1):Vl(t,e));break;case 30:l=pa,c=Pg(),pa=!1,Vl(t,e),pa&&(e.flags|=4);var u=e.memoizedProps,g=e.stateNode;t=Aa(u,g),g=Aa(n.memoizedProps,g);var S=_a(u.default,u.update);S==="none"?t=!1:(u=n.memoizedState,n.memoizedState=null,n=e.child,pn=0,t=Ed(e,n,t,g,S,u,!0),pn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Zl(e,e.memoizedProps.onUpdate),fa=c):c!==null&&(c.push.apply(c,fa),fa=c),pa=(e.flags&32)!==0?!0:l;break;default:Vl(t,e)}}function ga(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Yg(e,t.alternate,t),t=t.sibling}function cs(e,t){for(e=e.child;e!==null;){var n=e,l=t;switch(n.tag){case 0:case 11:case 14:case 15:os(4,n,n.return),cs(n,l);break;case 1:en(n,n.return);var c=n.stateNode;typeof c.componentWillUnmount=="function"&&Lg(n,n.return,c),cs(n,l);break;case 27:(l&2)!==0&&ey(n.stateNode,n.type,n.memoizedProps);case 5:en(n,n.return),n.tag!==5&&n.tag!==27||Zi(n),cs(n,l);break;case 6:Zi(n);break;case 26:en(n,n.return),c=n.stateNode,n.memoizedState!==null||c===null||ct||c.parentNode.removeChild(c),cs(n,l);break;case 22:n.memoizedState===null&&cs(n,l);break;case 30:en(n,n.return),cs(n,l);break;case 7:en(n,n.return);default:cs(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),Xi(4,u);break;case 1:if(Wn(c,u,n),l=u,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(J){ft(l,l.return,J)}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++)jp(G[c],A)}catch(J){ft(l,l.return,J)}}S&&g&64&&Og(u),da(u,u.return);break;case 27:(n&2)!==0&&Hg(u);case 5:u.tag!==5&&u.tag!==27||Bg(u),Wn(c,u,n),S&&l===null&&g&4&&bd(u),da(u,u.return);break;case 6:Bg(u);break;case 26:A=u.stateNode,u.memoizedState!==null||A===null||Kt||gf(ir(A.ownerDocument),u.type,A),Wn(c,u,n),S&&l===null&&g&4&&bd(u),da(u,u.return);break;case 12:Wn(c,u,n);break;case 31:Wn(c,u,n),S&&g&4&&Jg(c,u);break;case 13:Wn(c,u,n),S&&g&4&&$g(c,u);break;case 22:u.memoizedState===null&&Wn(c,u,n),da(u,u.return);break;case 30:Wn(c,u,n),da(u,u.return);break;case 7:da(u,u.return);default:Wn(c,u,n)}t=t.sibling}}function Rd(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&&Li(n))}function zd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Li(e))}function Un(e,t,n,l){var c=(n&335544064)===n;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)nx(e,t,n,l),t=t.sibling;else c&&Ig(t)}function nx(e,t,n,l){var c=(n&335544064)===n;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Mo(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,n,l),u&2048&&Xi(9,t);break;case 1:Un(e,t,n,l);break;case 3:Un(e,t,n,l),c&&_d&&(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&&Li(u)));break;case 12:if(u&2048){Un(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 Un(e,t,n,l);break;case 31:Un(e,t,n,l);break;case 13:Un(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&&Mo(S),g._visibility&2?Un(e,t,n,l):$i(e,t)):(c&&S!==null&&S.memoizedState!==null&&Mo(t),g._visibility&2?Un(e,t,n,l):(g._visibility|=2,Il(e,t,n,l,(t.subtreeFlags&10256)!==0||!1))),u&2048&&Rd(S,t);break;case 24:Un(e,t,n,l),u&2048&&zd(t.alternate,t);break;case 30:c&&(u=t.alternate,u!==null&&(ha(u.child,!0),ha(t.child,!0))),Un(e,t,n,l);break;default:Un(e,t,n,l)}}function Il(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:Il(u,g,S,A,c),Xi(8,g);break;case 23:break;case 22:var J=g.stateNode;g.memoizedState!==null?J._visibility&2?Il(u,g,S,A,c):$i(u,g):(J._visibility|=2,Il(u,g,S,A,c)),c&&G&2048&&Rd(g.alternate,g);break;case 24:Il(u,g,S,A,c),c&&G&2048&&zd(g.alternate,g);break;default:Il(u,g,S,A,c)}t=t.sibling}}function $i(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:$i(n,l),c&2048&&Rd(l.alternate,l);break;case 24:$i(n,l),c&2048&&zd(l.alternate,l);break;default:$i(n,l)}t=t.sibling}}var Xs=8192;function Zs(e,t,n){if(e.subtreeFlags&Xs)for(e=e.child;e!==null;)ax(e,t,n),e=e.sibling}function ax(e,t,n){switch(e.tag){case 26:Zs(e,t,n),e.flags&Xs&&(e.memoizedState!==null?hw(n,$n,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&uy(n,e)));break;case 5:Zs(e,t,n),e.flags&Xs&&(e=e.stateNode,(t&335544128)===t&&uy(n,e));break;case 3:case 4:var l=$n;$n=ir(e.stateNode.containerInfo),Zs(e,t,n),$n=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Xs,Xs=16777216,Zs(e,t,n),Xs=l):Zs(e,t,n));break;case 30:if((e.flags&Xs)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var c=e.stateNode;c.paired=null,Nn===null&&(Nn=new Map),Nn.set(l,c)}Zs(e,t,n);break;default:Zs(e,t,n)}}function sx(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 Wi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Yt=l,ix(l,e)}sx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lx(e),e=e.sibling}function lx(e){switch(e.tag){case 0:case 11:case 15:Wi(e),e.flags&2048&&os(9,e,e.return);break;case 3:Wi(e);break;case 12:Wi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uo(e)):Wi(e);break;default:Wi(e)}}function Uo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Yt=l,ix(l,e)}sx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:os(8,t,t.return),Uo(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Uo(t));break;default:Uo(t)}e=e.sibling}}function ix(e,t){for(;Yt!==null;){var n=Yt;switch(n.tag){case 0:case 11:case 15:os(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:Li(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Yt=l;else e:for(n=e;Yt!==null;){l=Yt;var c=l.sibling,u=l.return;if(Xg(l),l===n){Yt=null;break e}if(c!==null){c.return=u,Yt=c;break e}Yt=u}}}var oS={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}},cS=typeof WeakMap=="function"?WeakMap:Map,ot=0,gt=null,Ze=null,$e=0,dt=0,Cn=null,us=!1,Fl=!1,Md=!1,Ua=0,At=0,ds=0,Js=0,Ho=0,En=0,Kl=0,er=null,xn=null,Od=!1,qo=0,rx=0,Po=1/0,Go=null,fs=null,Nt=0,ea=null,$s=null,xa=0,Ld=0,Bd=null,ox=null,Yl=null,Ql=null,Xl=null,tr=0,Vo=null;function An(){return(ot&2)!==0&&$e!==0?$e&-$e:ce.T!==null?Yd():dm()}function cx(){if(En===0)if(($e&536870912)===0||Ye){var e=la;la<<=1,(la&3932160)===0&&(la=262144),En=e}else En=536870912;return e=$t.current,e!==null&&(e.flags|=32),En}function Zl(e,t){if(t!=null){var n=e.stateNode,l=n.ref;l===null&&(l=n.ref=Vx(Aa(e.memoizedProps,n))),Ql===null&&(Ql=[]),Ql.push(t.bind(null,l))}}function yn(e,t,n){(e===gt&&(dt===2||dt===9)||e.cancelPendingCommit!==null)&&(Jl(e,0),hs(e,$e,En,!1)),wi(e,n),((ot&2)===0||e!==gt)&&(e===gt&&((ot&2)===0&&(Js|=n),At===4&&hs(e,$e,En,!1)),ya(e))}function ux(e,t,n){if((ot&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Si(e,t),c=l?fS(e,t):Hd(e,t,!0),u=l;do{if(c===0){Fl&&!l&&hs(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!uS(n)){c=Hd(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=er;var A=S.current.memoizedState.isDehydrated;if(A&&(Jl(S,g).flags|=256),g=Hd(S,g,!1),g!==2&&g!==6){if(Md&&!A){S.errorRecoveryDisabledLanes|=u,Js|=u,c=4;break e}u=xn,xn=c,u!==null&&(xn===null?xn=u:xn.push.apply(xn,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Jl(e,0),hs(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:hs(l,t,En,!us);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=qo+300-Rt(),10<c)){if(hs(l,t,En,!us),ra(l,0,!0)!==0)break e;xa=t,l.timeoutHandle=sf(dx.bind(null,l,n,xn,Go,Od,t,En,Js,Kl,us,u,"Throttled",-0,0),c);break e}dx(l,n,xn,Go,Od,t,En,Js,Kl,us,u,null,-0,0)}}break}while(!0);ya(e)}function dx(e,t,n,l,c,u,g,S,A,G,J,ge,H,Z){e.timeoutHandle=-1;var ke=t.subtreeFlags,De=(u&335544064)===u;if(ge=null,(De||ke&8192||(ke&16785408)===16785408)&&(ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oa},Nn=null,ax(t,u,ge),De&&(ke=ge,De=e.containerInfo,De=(De.nodeType===9?De:De.ownerDocument).__reactViewTransition,De!=null&&(ke.count++,ke.waitingForViewTransition=!0,ke=cr.bind(ke),De.finished.then(ke,ke))),ke=(u&62914560)===u?qo-Rt():(u&4194048)===u?rx-Rt():0,ke=mw(ge,ke),ke!==null)){xa=u,e.cancelPendingCommit=ke(bx.bind(null,e,t,u,n,l,c,g,S,A,G,J,ge,null,H,Z)),hs(e,u,g,!G);return}bx(e,t,u,n,l,c,g,S,A,G,J,ge)}function uS(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(!jn(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 hs(e,t,n,l){t=im(e,t),t&=~Ho,t&=~Js,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&&om(e,n,t)}function Io(){return(ot&6)===0?(nr(0),!1):!0}function Ud(){if(Ze!==null){if(dt===0)var e=Ze.return;else e=Ze,Ra=Hs=null,Ku(e),Bl=null,Hi=0,e=Ze;for(;e!==null;)Mg(e.alternate,e),e=e.return;Ze=null}}function Jl(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,MS(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xa=0,Ud(),gt=e,Ze=n=Ta(e.current,null),$e=t,dt=0,Cn=null,us=!1,Fl=Si(e,t),Md=!1,Kl=En=Ho=Js=ds=At=0,xn=er=null,Od=!1,Ua=im(e,t),Jr(),n}function fx(e,t){Ve=null,ce.H=jo,t===Ll||t===oo?(t=bp(),dt=3):t===zu?(t=bp(),dt=4):dt=t===rd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Cn=t,Ze===null&&(At=1,ko(e,Mn(t,e.current)))}function hx(){var e=$t.current;return e===null?!0:($e&4194048)===$e?ln===null:($e&62914560)===$e||($e&536870912)!==0?e===ln:!1}function mx(){var e=ce.H;return ce.H=jo,e===null?jo:e}function px(){var e=ce.A;return ce.A=oS,e}function Fo(){At=4,us||($e&4194048)!==$e&&$t.current!==null||(Fl=!0),(ds&134217727)===0&&(Js&134217727)===0||gt===null||hs(gt,$e,En,!1)}function Hd(e,t,n){var l=ot;ot|=2;var c=mx(),u=px();(gt!==e||$e!==t)&&(Go=null,Jl(e,t)),t=!1;var g=At;e:do try{if(dt!==0&&Ze!==null){var S=Ze,A=Cn;switch(dt){case 8:Ud(),g=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var G=dt;if(dt=0,Cn=null,$l(e,S,A,G),n&&Fl){g=0;break e}break;default:G=dt,dt=0,Cn=null,$l(e,S,A,G)}}dS(),g=At;break}catch(J){fx(e,J)}while(!0);return t&&e.shellSuspendCounter++,Ra=Hs=null,ot=l,ce.H=c,ce.A=u,Ze===null&&(gt=null,$e=0,Jr()),g}function dS(){for(;Ze!==null;)gx(Ze)}function fS(e,t){var n=ot;ot|=2;var l=mx(),c=px();gt!==e||$e!==t?(Go=null,Po=Rt()+500,Jl(e,t)):Fl=Si(e,t);e:do try{if(dt!==0&&Ze!==null){t=Ze;var u=Cn;t:switch(dt){case 1:dt=0,Cn=null,$l(e,t,u,1);break;case 2:case 9:if(xp(u)){dt=0,Cn=null,xx(t);break}t=function(){dt!==2&&dt!==9||gt!==e||(dt=7),ya(e)},u.then(t,t);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:xp(u)?(dt=0,Cn=null,xx(t)):(dt=0,Cn=null,$l(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?oy(g):S.stateNode.complete){dt=0,Cn=null;var A=S.sibling;if(A!==null)Ze=A;else{var G=S.return;G!==null?(Ze=G,Ko(G)):Ze=null}break t}}dt=0,Cn=null,$l(e,t,u,5);break;case 6:dt=0,Cn=null,$l(e,t,u,6);break;case 8:Ud(),At=6;break e;default:throw Error(o(462))}}hS();break}catch(J){fx(e,J)}while(!0);return Ra=Hs=null,ce.H=l,ce.A=c,ot=n,Ze!==null?0:(gt=null,$e=0,Jr(),At)}function hS(){for(;Ze!==null&&!vi();)gx(Ze)}function gx(e){var t=Rg(e.alternate,e,Ua);e.memoizedProps=e.pendingProps,t===null?Ko(e):Ze=t}function xx(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ng(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Ng(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Ku(t);var l=t;l===Ft&&(Ye?(ao(l),l.tag===5&&l.stateNode!=null&&(yt=l.stateNode)):(ao(l),Ye=!0));default:Mg(n,t),t=Ze=ip(t,Ua),t=Rg(n,t,Ua)}e.memoizedProps=e.pendingProps,t===null?Ko(e):Ze=t}function $l(e,t,n,l){Ra=Hs=null,Ku(t),Bl=null,Hi=0;var c=t.return;try{if(eS(e,c,t,n,$e)){At=1,ko(e,Mn(n,e.current)),Ze=null;return}}catch(u){if(c!==null)throw Ze=c,u;At=1,ko(e,Mn(n,e.current)),Ze=null;return}t.flags&32768?(Ye||l===1?e=!0:Fl||($e&536870912)!==0?e=!1:(us=e=!0,(l===2||l===9||l===3||l===6)&&(l=$t.current,l!==null&&l.tag===13&&(l.flags|=16384))),yx(t,e)):Ko(t)}function Ko(e){var t=e;do{if((t.flags&32768)!==0){yx(t,us);return}e=t.return;var n=sS(t.alternate,t,Ua);if(n!==null){Ze=n;return}if(t=t.sibling,t!==null){Ze=t;return}Ze=t=e}while(t!==null);At===0&&(At=5)}function yx(e,t){do{var n=lS(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);At=6,Ze=null}function bx(e,t,n,l,c,u,g,S,A,G,J,ge){e.cancelPendingCommit=null;do Yo();while(Nt!==0);if((ot&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===gt&&(Ze=gt=null,$e=0),$s=t,ea=e,xa=n,Bd=c,ox=l,mS(e,t,n,g,S,A,ge)}}function mS(e,t,n,l,c,u,g){var S=t.lanes|t.childLanes;if(Ld=S,S|=vu,q1(e,n,S,l,c,u),Ql=null,(n&335544064)===n?(Xl=G2(e),l=10262):(Xl=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,vS(ka,function(){return Vd(),null})):(e.callbackNode=null,e.callbackPriority=0),Ro=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=ce.T,ce.T=null,c=Se.p,Se.p=2,u=ot,ot|=4;try{iS(e,t,n)}finally{ot=u,Se.p=c,ce.T=l}}Nt=1,Ro?Yl=qS(g,e.containerInfo,Xl,qd,Pd,gS,Gd,Vd,pS):(qd(),Pd(),Gd())}function pS(e){if(Nt!==0){var t=ea.onRecoverableError;t(e,{componentStack:null})}}function gS(){Nt===3&&(Nt=0,tx($s,ea),Nt=4)}function qd(){if(Nt===1){Nt=0;var e=ea,t=$s,n=xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=ce.T,ce.T=null;var c=Se.p;Se.p=2;var u=ot;ot|=4;try{Ji=Oo=!1,Wg(t,e,n),n=tf;var g=Zm(e.containerInfo),S=n.focusedElem,A=n.selectionRange;if(g!==S&&S&&S.ownerDocument&&Xm(S.ownerDocument.documentElement,S)){if(A!==null&&pu(S)){var G=A.start,J=A.end;if(J===void 0&&(J=G),"selectionStart"in S)S.selectionStart=G,S.selectionEnd=Math.min(J,S.value.length);else{var ge=S.ownerDocument||document,H=ge&&ge.defaultView||window;if(H.getSelection){var Z=H.getSelection(),ke=S.textContent.length,De=Math.min(A.start,ke),Ie=A.end===void 0?De:Math.min(A.end,ke);!Z.extend&&De>Ie&&(g=Ie,Ie=De,De=g);var P=Qm(S,De),M=Qm(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}}ii=!!ef,tf=ef=null}finally{ot=u,Se.p=c,ce.T=l}}e.current=t,Nt=2}}function Pd(){if(Nt===2){Nt=0;var e=ea,t=$s,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=ce.T,ce.T=null;var l=Se.p;Se.p=2;var c=ot;ot|=4;try{Yg(e,t.alternate,t)}finally{ot=c,Se.p=l,ce.T=n}}Nt=3}}function Gd(){if(Nt===4||Nt===3){Nt=0;var e=Yl;Yl=null,yl();var t=ea,n=$s,l=xa,c=ox,u=(l&335544064)===l?10262:10256;if((n.subtreeFlags&u)!==0||(n.flags&u)!==0?Nt=5:(Nt=0,$s=ea=null,vx(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(fs=null),Jc(l),n=n.stateNode,Fe&&typeof Fe.onCommitFiberRoot=="function")try{Fe.onCommitFiberRoot(fn,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=ce.T,u=Se.p,Se.p=2,ce.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{ce.T=n,Se.p=u}}if(c=Ql,g=Xl,Xl=null,c!==null&&(Ql=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);(xa&3)!==0&&Yo(),ya(t),u=t.pendingLanes,(l&261930)!==0&&(u&42)!==0?t===Vo?tr++:(tr=0,Vo=t):(tr=0,Vo=null),nr(0)}}function vx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Li(t)))}function Yo(){return Yl!==null&&(Yl.skipTransition(),Yl=null),qd(),Pd(),Gd(),Vd()}function Vd(){if(Nt!==5)return!1;var e=ea,t=Ld;Ld=0;var n=Jc(xa),l=ce.T,c=Se.p;try{Se.p=32>n?32:n,ce.T=null,n=Bd,Bd=null;var u=ea,g=xa;if(Nt=0,$s=ea=null,xa=0,(ot&6)!==0)throw Error(o(331));var S=ot;if(ot|=4,lx(u.current),nx(u,u.current,g,n),ot=S,nr(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot=="function")try{Fe.onPostCommitFiberRoot(fn,u)}catch{}return!0}finally{Se.p=c,ce.T=l,vx(e,t)}}function Sx(e,t,n){t=Mn(n,t),t=id(e.stateNode,t,2),e=ss(e,t,2),e!==null&&(wi(e,2),ya(e))}function ft(e,t,n){if(e.tag===3)Sx(e,e,n);else for(;t!==null;){if(t.tag===3){Sx(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(fs===null||!fs.has(l))){e=Mn(n,e),n=xg(2),l=ss(t,n,2),l!==null&&(yg(n,l,t,e),wi(l,2),ya(l));break}}t=t.return}}function Id(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new cS;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)||(Md=!0,c.add(n),e=xS.bind(null,e,t,n),t.then(e,e))}function xS(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,gt===e&&($e&n)===n&&((At===4||At===3&&($e&62914560)===$e&&300>Rt()-qo)&&(ot&2)===0?Jl(e,0):Ho|=n,Kl===$e&&(Kl=0)),ya(e)}function wx(e,t){t===0&&(t=rm()),e=Ls(e,t),e!==null&&(wi(e,t),ya(e))}function yS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wx(e,n)}function bS(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),wx(e,n)}function vS(e,t){return Ts(e,t)}var Wl=null,ei=null,Fd=!1,Qo=!1,Kd=!1,ms=0;function ya(e){e!==ei&&e.next===null&&(ei===null?Wl=ei=e:ei=ei.next=e),Qo=!0,Fd||(Fd=!0,wS())}function nr(e,t){if(!Kd&&Qo){Kd=!0;do for(var n=!1,l=Wl;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,Cx(l,u))}else u=$e,u=ra(l,l===gt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Si(l,u)||(n=!0,Cx(l,u));l=l.next}while(n);Kd=!1}}function SS(){jx()}function jx(){Qo=Fd=!1;var e=0;ms!==0&&zS()&&(e=ms);for(var t=Rt(),n=null,l=Wl;l!==null;){var c=l.next,u=kx(l,t);u===0?(l.next=null,n===null?Wl=c:n.next=c,c===null&&(ei=n)):(n=l,(e!==0||(u&3)!==0)&&(Qo=!0)),l=c}Nt!==0&&Nt!==5||nr(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]=H1(S,t)):A<=t&&(e.expiredLanes|=S),u&=~S}if(t=gt,n=$e,n=ra(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&&Ka(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Si(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Ka(l),Jc(n)){case 2:case 8:n=Qa;break;case 32:n=ka;break;case 268435456:n=Re;break;default:n=ka}return l=Nx.bind(null,e),n=Ts(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Ka(l),e.callbackPriority=2,e.callbackNode=null,2}function Nx(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Yo()&&e.callbackNode!==n)return null;var l=$e;return l=ra(e,e===gt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(ux(e,l,t),kx(e,Rt()),e.callbackNode!=null&&e.callbackNode===n?Nx.bind(null,e):null)}function Cx(e,t){if(Yo())return null;ux(e,t,!0)}function wS(){OS(function(){(ot&6)!==0?Ts(Ds,SS):jx()})}function Yd(){if(ms===0){var e=Gs;e===0&&(e=Qn,Qn<<=1,(Qn&261888)===0&&(Qn=256)),ms=e}return ms}function Ex(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Vr(e)}function jS(e,t,n,l,c){if(t==="submit"&&n&&n.stateNode===c){var u=Ex((c[hn]||null).action),g=l.submitter;g&&(t=(t=g[hn]||null)?Ex(t.formAction):g.getAttribute("formAction"),t!==null&&(u=t,g=null));var S=new Yr("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);td(n,{pending:!0,data:A,method:c.method,action:u},null,A)}}else typeof u=="function"&&(S.preventDefault(),A=new FormData(c,g),td(n,{pending:!0,data:A,method:c.method,action:u},u,A))},currentTarget:c}]})}}for(var Qd=0;Qd<bu.length;Qd++){var Xd=bu[Qd],kS=Xd.toLowerCase(),NS=Xd[0].toUpperCase()+Xd.slice(1);Zn(kS,"on"+NS)}Zn(Wm,"onAnimationEnd"),Zn(ep,"onAnimationIteration"),Zn(tp,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(M2,"onTransitionRun"),Zn(O2,"onTransitionStart"),Zn(L2,"onTransitionCancel"),Zn(np,"onTransitionEnd"),wl("onMouseEnter",["mouseout","mouseover"]),wl("onMouseLeave",["mouseout","mouseover"]),wl("onPointerEnter",["pointerout","pointerover"]),wl("onPointerLeave",["pointerout","pointerover"]),zs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zs("onBeforeInput",["compositionend","keypress","textInput","paste"]),zs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ar="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(" "),CS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ar));function Ax(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],c=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var 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(J){Zr(J)}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(J){Zr(J)}c.currentTarget=null,u=A}}}}function Je(e,t){var n=t[hm];n===void 0&&(n=t[hm]=new Set);var l=e+"__bubble";n.has(l)||(_x(t,e,2,!1),n.add(l))}function Zd(e,t,n){var l=0;t&&(l|=4),_x(n,e,l,t)}var Xo="_reactListening"+Math.random().toString(36).slice(2);function Jd(e){if(!e[Xo]){e[Xo]=!0,gm.forEach(function(n){n!=="selectionchange"&&(CS.has(n)||Zd(n,!1,e),Zd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xo]||(t[Xo]=!0,Zd("selectionchange",!1,t))}}function _x(e,t,n,l){switch(yy(t)){case 2:var c=yw;break;case 8:c=bw;break;default:c=yf}n=c.bind(null,t,n,e),c=void 0,!lu||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 $d(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=Rs(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}_m(function(){var G=u,J=au(n),ge=[];e:{var H=ap.get(e);if(H!==void 0){var Z=Yr,ke=e;switch(e){case"keypress":if(Fr(n)===0)break e;case"keydown":case"keyup":Z=u2;break;case"focusin":ke="focus",Z=cu;break;case"focusout":ke="blur",Z=cu;break;case"beforeblur":case"afterblur":Z=cu;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=Rm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=$1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=p2;break;case Wm:case ep:case tp:Z=t2;break;case np:Z=x2;break;case"scroll":case"scrollend":Z=Z1;break;case"wheel":Z=b2;break;case"copy":case"cut":case"paste":Z=a2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=Mm;break;case"submit":Z=h2;break;case"toggle":case"beforetoggle":Z=S2}var De=(t&4)!==0,Ie=!De&&(e==="scroll"||e==="scrollend"),P=De?H!==null?H+"Capture":null:H;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=Ni(M,P),pe!=null&&De.push(sr(M,pe,K))),Ie)break;M=M.return}0<De.length&&(H=new Z(H,ke,null,n,J),ge.push({event:H,listeners:De}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",Z&&n!==nu&&(ke=n.relatedTarget||n.fromElement)&&(Rs(ke)||ke[bl]))break e;(H||Z)&&(ke=J.window===J?J:(Z=J.ownerDocument)?Z.defaultView||Z.parentWindow:window,H?(Z=n.relatedTarget||n.toElement,H=G,Z=Z?Rs(Z):null,Z!==null&&(Ie=f(Z),De=Z.tag,Z!==Ie||De!==5&&De!==27&&De!==6)&&(Z=null)):(H=null,Z=G),H!==Z&&(De=Rm,pe="onMouseLeave",P="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(De=Mm,pe="onPointerLeave",P="onPointerEnter",M="pointer"),Ie=H==null?ke:ki(H),K=Z==null?ke:ki(Z),ke=new De(pe,M+"leave",H,n,J),ke.target=Ie,ke.relatedTarget=K,pe=null,Rs(J)===G&&(De=new De(P,M+"enter",Z,n,J),De.target=K,De.relatedTarget=Ie,pe=De),Ie=pe,De=H&&Z?B(H,Z,ES):null,H!==null&&Tx(ge,ke,H,De,!1),Z!==null&&Ie!==null&&Tx(ge,Ie,Z,De,!0)))}e:{if(H=G?ki(G):window,Z=H.nodeName&&H.nodeName.toLowerCase(),Z==="select"||Z==="input"&&H.type==="file")var Ee=Gm;else if(qm(H))if(Vm)Ee=D2;else{Ee=_2;var We=A2}else Z=H.nodeName,!Z||Z.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?G&&tu(G.elementType)&&(Ee=Gm):Ee=T2;if(Ee&&(Ee=Ee(e,G))){Pm(ge,Ee,n,J);break e}We&&We(e,H,G)}switch(We=G?ki(G):window,e){case"focusin":(qm(We)||We.contentEditable==="true")&&(Al=We,gu=G,zi=null);break;case"focusout":zi=gu=Al=null;break;case"mousedown":xu=!0;break;case"contextmenu":case"mouseup":case"dragend":xu=!1,Jm(ge,n,J);break;case"selectionchange":if(z2)break;case"keydown":case"keyup":Jm(ge,n,J)}var Me;if(du)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 El?Um(e,n)&&(Be="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Be="onCompositionStart");Be&&(Om&&n.locale!=="ko"&&(El||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&El&&(Me=Tm()):(Xa=J,iu="value"in Xa?Xa.value:Xa.textContent,El=!0)),We=Zo(G,Be),0<We.length&&(Be=new zm(Be,e,null,n,J),ge.push({event:Be,listeners:We}),Me?Be.data=Me:(Me=Hm(n),Me!==null&&(Be.data=Me)))),(Me=j2?k2(e,n):N2(e,n))&&(Be=Zo(G,"onBeforeInput"),0<Be.length&&(We=new zm("onBeforeInput","beforeinput",null,n,J),ge.push({event:We,listeners:Be}),We.data=Me)),jS(ge,e,G,n,J)}Ax(ge,t)})}function sr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zo(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=Ni(e,n),c!=null&&l.unshift(sr(e,c,u)),c=Ni(e,t),c!=null&&l.push(sr(e,c,u))),e.tag===3)return l;e=e.return}return[]}function ES(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tx(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=Ni(n,u),G!=null&&g.unshift(sr(n,G,A))):c||(G=Ni(n,u),G!=null&&g.push(sr(n,G,A)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var AS=/\r\n?/g,_S=/\u0000|\uFFFD/g;function Dx(e){return(typeof e=="string"?e:""+e).replace(AS,`
49
- `).replace(_S,"")}function Rx(e,t){return t=Dx(t),Dx(e)===t}function ht(e,t,n,l,c,u){switch(n){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||kl(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&kl(e,""+l);else return;break;case"className":Gr(e,"class",l);break;case"tabIndex":Gr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Gr(e,n,l);break;case"style":Em(e,l,u);return;case"data":if(t!=="object"){Gr(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=Vr(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"&&ht(e,t,"name",c.name,c,null),ht(e,t,"formEncType",c.formEncType,c,null),ht(e,t,"formMethod",c.formMethod,c,null),ht(e,t,"formTarget",c.formTarget,c,null)):(ht(e,t,"encType",c.encType,c,null),ht(e,t,"method",c.method,c,null),ht(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Vr(l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=oa);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=Vr(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),Pr(e,"popover",l);break;case"xlinkActuate":Ca(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ca(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ca(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ca(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ca(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ca(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Pr(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=Q1.get(n)||n,Pr(e,n,l);else return}rt=!0}function Wd(e,t,n,l,c,u){switch(n){case"style":Em(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")kl(e,l);else if(typeof l=="number"||typeof l=="bigint")kl(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=oa);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!xm.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[hn]||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,""):Pr(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:ht(e,t,u,g,n,null)}}c&&ht(e,t,"srcSet",n.srcSet,n,null),l&&ht(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 J=n[l];if(J!=null)switch(l){case"name":c=J;break;case"type":g=J;break;case"checked":A=J;break;case"defaultChecked":G=J;break;case"value":u=J;break;case"defaultValue":S=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,t));break;default:ht(e,t,l,J,n,null)}}jm(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:ht(e,t,c,S,n,null)}t=u,n=g,e.multiple=!!l,t!=null?jl(e,!!l,t,!1):n!=null&&jl(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:ht(e,t,g,S,n,null)}Nm(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:ht(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<ar.length;l++)Je(ar[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:ht(e,t,G,l,n,null)}return;default:if(tu(t)){for(J in n)n.hasOwnProperty(J)&&(l=n[J],l!==void 0&&Wd(e,t,J,l,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(l=n[S],l!=null&&ht(e,t,S,l,n,null))}var TS={};function DS(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,J=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)||ht(e,t,Z,null,l,ge)}}for(var H in l){var Z=l[H];if(ge=n[H],l.hasOwnProperty(H)&&(Z!=null||ge!=null))switch(H){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),J=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&&ht(e,t,H,Z,l,ge)}}Wc(e,g,S,A,G,J,u,c);return;case"select":Z=g=S=H=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)||ht(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),H=u;break;case"defaultValue":u!==A&&(rt=!0),S=u;break;case"multiple":u!==A&&(rt=!0),g=u;default:u!==A&&ht(e,t,c,u,l,A)}t=S,n=g,l=Z,H!=null?jl(e,!!n,H,!1):!!l!=!!n&&(t!=null?jl(e,!!n,t,!0):jl(e,!!n,n?[]:"",!1));return;case"textarea":Z=H=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:ht(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),H=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&&ht(e,t,g,c,l,u)}km(e,H,Z);return;case"option":for(var ke in n)if(H=n[ke],n.hasOwnProperty(ke)&&H!=null&&!l.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:ht(e,t,ke,null,l,H)}for(A in l)if(H=l[A],Z=n[A],l.hasOwnProperty(A)&&H!==Z&&(H!=null||Z!=null))switch(A){case"selected":H!==Z&&(rt=!0),e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:ht(e,t,A,H,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)H=n[De],n.hasOwnProperty(De)&&H!=null&&!l.hasOwnProperty(De)&&ht(e,t,De,null,l,H);for(G in l)if(H=l[G],Z=n[G],l.hasOwnProperty(G)&&H!==Z&&(H!=null||Z!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(o(137,t));break;default:ht(e,t,G,H,l,Z)}return;default:if(tu(t)){for(var Ie in n)H=n[Ie],n.hasOwnProperty(Ie)&&H!==void 0&&!l.hasOwnProperty(Ie)&&Wd(e,t,Ie,void 0,l,H);for(J in l)H=l[J],Z=n[J],!l.hasOwnProperty(J)||H===Z||H===void 0&&Z===void 0||Wd(e,t,J,H,l,Z);return}}for(var P in n)H=n[P],n.hasOwnProperty(P)&&H!=null&&!l.hasOwnProperty(P)&&ht(e,t,P,null,l,H);for(ge in l)H=l[ge],Z=n[ge],!l.hasOwnProperty(ge)||H===Z||H==null&&Z==null||ht(e,t,ge,H,l,Z)}function zx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RS(){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&&zx(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 J=A.transferSize,ge=A.initiatorType;J&&zx(ge)&&(A=A.responseEnd,g+=J*(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 ef=null,tf=null;function lr(e){return e.nodeType===9?e:e.ownerDocument}function Mx(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 Ox(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 Lx(e,t,n,l){return n=lr(n).createElement(e),n[Zt]=l,n[hn]=t,tn(n,e,t),It(n),n}function nf(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 af=null;function zS(){var e=window.event;return e&&e.type==="popstate"?e===af?!1:(af=e,!0):(af=null,!1)}var sf=typeof setTimeout=="function"?setTimeout:void 0,MS=typeof clearTimeout=="function"?clearTimeout:void 0,Bx=typeof Promise=="function"?Promise:void 0,Ux=typeof requestAnimationFrame=="function"?requestAnimationFrame:sf,OS=typeof queueMicrotask=="function"?queueMicrotask:typeof Bx<"u"?function(e){return Bx.resolve(null).then(e).catch(LS)}:sf;function LS(e){setTimeout(function(){throw e})}function ps(e){return e==="head"}function Hx(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),ri(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")hf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,hf(n);for(var u=n.firstChild;u;){var g=u.nextSibling,S=u.nodeName;u[ji]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=g}}else n==="body"&&hf(e.ownerDocument.body);n=c}while(n);ri(t)}function qx(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 Px(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 Gx(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 BS(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 lf(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return BS(t,n,e)}function US(e){return e.documentElement.clientHeight}function HS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function qS(e,t,n,l,c,u,g,S,A){var G=t.nodeType===9?t:t.ownerDocument;try{var J=G.startViewTransition({update:function(){var H=G.defaultView,Z=H.navigation&&H.navigation.transition,ke=G.fonts.status;l();var De=[];if(ke==="loaded"&&(US(G),G.fonts.status==="loading"&&De.push(G.fonts.ready)),ke=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<H.innerHeight&&pe.left<H.innerWidth){if(P+=cy(K),P>Wo){De.length=ke;break}K=new Promise(HS.bind(K)),De.push(K)}}}if(0<De.length)return H=Promise.race([Promise.all(De),new Promise(function(Ee){return setTimeout(Ee,500)})]).then(c,c),(Z?Promise.allSettled([Z.finished,H]):H).then(u,u);if(c(),Z)return Z.finished.then(u,u);u()},types:n});G.__reactViewTransition=J;var ge=[];return J.ready.then(function(){for(var H=G.documentElement.getAnimations({subtree:!0}),Z=0;Z<H.length;Z++){var ke=H[Z],De=ke.effect,Ie=De.pseudoElement;if(Ie!=null&&Ie.startsWith("::view-transition")){ge.push(ke),ke=De.getKeyframes();for(var P=Ie=void 0,M=!0,K=0;K<ke.length;K++){var pe=ke[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(ke),M=getComputedStyle(De.target,De.pseudoElement),M.width!==Ie||M.height!==P)&&(M=ke[0],M.width=Ie,M.height=P,M=ke[ke.length-1],M.width=Ie,M.height=P,De.setKeyframes(ke))}}g()},function(H){G.__reactViewTransition===J&&(G.__reactViewTransition=null);try{if(typeof H=="object"&&H!==null)switch(H.name){case"InvalidStateError":(H.message==="View transition was skipped because document visibility state is hidden."||H.message==="Skipping view transition because document visibility state has become hidden."||H.message==="Skipping view transition because viewport size changed."||H.message==="Transition was aborted because of invalid state")&&(H=null)}H!==null&&A(H)}finally{l(),c(),g()}}),J.finished.finally(function(){for(var H=0;H<ge.length;H++)ge[H].cancel();G.__reactViewTransition===J&&(G.__reactViewTransition=null),S()}),J}catch{return l(),c(),g(),null}}function Ws(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Ws.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:z({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Ws.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},Ws.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vx(e){return{name:e,group:new Ws("group",e),imagePair:new Ws("image-pair",e),old:new Ws("old",e),new:new Ws("new",e)}}function _n(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}_n.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(Fx(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=ti(n),u.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:S,cleanup:c}),y(this._fragmentFiber.child,!1,PS,e,S,l)}this._eventListeners=u}};function PS(e,t,n,l){return j(e).addEventListener(t,n,l),!1}_n.prototype.removeEventListener=function(e,t,n){var l=this._eventListeners;if(l!==null&&(t=Fx(l,e,t,n),t!==-1)){var c=l[t];n=c.attachedListener;var u=c.cleanup;c=ti(c.optionsOrUseCapture),y(this._fragmentFiber.child,!1,GS,e,n,c),l.splice(t,1),u!==null&&u()}};function GS(e,t,n,l){return j(e).removeEventListener(t,n,l),!1}function ti(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Ix(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Fx(e,t,n,l){if(e.length===0)return-1;l=Ix(l);for(var c=0;c<e.length;c++){var u=e[c];if(u.type===t&&u.listener===n&&Ix(u.optionsOrUseCapture)===l)return c}return-1}_n.prototype.dispatchEvent=function(e){var t=w(this._fragmentFiber);if(t===null)return!0;t=j(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var c=0;c<n.length;c++){var u=n[c];l.addEventListener(u.type,u.attachedListener,ti(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,ti(u.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},_n.prototype.focus=function(e){y(this._fragmentFiber.child,!0,Kx,e,void 0,void 0)};function Kx(e,t){return e.tag===6?!1:(e=j(e),ew(e,t))}_n.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,rf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Kx(t[n],e);n--);};function rf(e,t){return t.push(e),!1}_n.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=j(e),e=lr(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,VS,e,void 0,void 0))};function VS(e,t){return e.tag===6?!1:(e=j(e),e===t||e.contains(t)?(t.blur(),!0):!1)}_n.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,IS,e,void 0,void 0)};function IS(e,t){return e.tag===6||(e=j(e),t.observe(e)),!1}_n.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,FS,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 FS(e,t){return e.tag===6||(e=j(e),t.unobserve(e)),!1}var ta=[],of=!1;function KS(e,t,n){ta.push({fragmentInstance:e,observer:t,instance:n}),of||(of=!0,tw(function(){of=!1;var l=ta;ta=[];for(var c=0;c<l.length;c++){var u=l[c];u.observer.unobserve(u.instance)}}))}_n.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,YS,e,void 0,void 0),e};function YS(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=j(e),t.push.apply(t,e.getClientRects());return!1}_n.prototype.getRootNode=function(e){var t=w(this._fragmentFiber);return t===null?this:j(t).getRootNode(e)},_n.prototype.compareDocumentPosition=function(e){var t=w(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];y(this._fragmentFiber.child,!1,rf,n,void 0,void 0);var l=j(t);if(n.length===0){if(n=l,N(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=C(t)[1],n===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=j(n).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=j(n[0]),c=j(n[n.length-1]);var u=N(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||QS(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function QS(e,t,n,l,c){var u=Rs(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,he),t===null?t=!1:(y(t,!0,I,u,n),u=_,_=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===l)&&(t=B(l,u,he),t===null?t=!1:(y(t,!0,q,u,l),u=_,R=_=null,t=u!==null)),t):!1}function Yx(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)}_n.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];y(this._fragmentFiber.child,!1,rf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var l=C(this._fragmentFiber);if(l=n?l[1]||l[0]||w(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=j(l),Yx(e,n);return}if(l=j(l),l.nodeType!==9){if(l.nodeType===11){n="host"in l?l.host:null,n!==null&&n.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=n?t.length-1:0;l!==(n?-1:t.length);){var c=t[l];c.tag===6?(c=j(c),Yx(c,n)):j(c).scrollIntoView(e),l+=n?-1:1}};function XS(e,t){return e=j(e),Qx(e,t),!1}function Qx(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Xx(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,ti(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)}),Qx(e,t))}function ZS(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,ti(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){typeof u.rootMargin=="string"?KS(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cf(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":cf(n),qr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function JS(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[ji])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Hn(e.nextSibling),e===null)break}return null}function $S(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Hn(e.nextSibling),e===null))return null;return e}function Zx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Hn(e.nextSibling),e===null))return null;return e}function uf(e){return e.data==="$?"||e.data==="$~"}function df(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function WS(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Hn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ff=null;function Jx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Hn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function $x(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 ew(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 tw(e){Ux(function(){Ux(function(t){return e(t)})})}function Wx(e,t,n){switch(t=lr(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 ey(e,t,n){for(var l in n){var c=n[l];n.hasOwnProperty(l)&&c!=null&&ht(e,t,l,null,TS,c)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===oa&&(e.onclick=null),qr(e)}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qr(e)}var qn=new Map,ty=new Set;function ir(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ha=Se.d;Se.d={f:nw,r:aw,D:sw,C:lw,L:iw,m:rw,X:cw,S:ow,M:uw};function nw(){var e=Ha.f(),t=Io();return e||t}function aw(e){var t=vl(e);t!==null&&t.tag===5&&t.type==="form"?ag(t):Ha.r(e)}var ni=typeof document>"u"?null:document;function ny(e,t,n){var l=ni;if(l&&typeof t=="string"&&t){var c=Rn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),ty.has(c)||(ty.add(c),e={rel:e,crossOrigin:n,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),tn(t,"link",e),It(t),l.head.appendChild(t)))}}function sw(e){Ha.D(e),ny("dns-prefetch",e,null)}function lw(e,t){Ha.C(e,t),ny("preconnect",e,t)}function iw(e,t,n){Ha.L(e,t,n);var l=ni;if(l&&e&&t){var c='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+Rn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+Rn(n.imageSizes)+'"]')):c+='[href="'+Rn(e)+'"]';var u=c;switch(t){case"style":u=ai(e);break;case"script":u=si(e)}if(!(qn.has(u)||(e=z({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),qn.set(u,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(rr(u))||t==="script"&&l.querySelector(or(u))))){var g=l.createElement("link");tn(g,"link",e),t==="style"&&(g[Hr]=!0,g.onload=g.onerror=function(){pm(g)}),It(g),l.head.appendChild(g)}}}function rw(e,t){Ha.m(e,t);var n=ni;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Rn(l)+'"][href="'+Rn(e)+'"]',u=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=si(e)}if(!qn.has(u)&&(e=z({rel:"modulepreload",href:e},t),qn.set(u,e),n.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(or(u)))return}l=n.createElement("link"),tn(l,"link",e),It(l),n.head.appendChild(l)}}}function ow(e,t,n){Ha.S(e,t,n);var l=ni;if(l&&e){var c=Sl(l).hoistableStyles,u=ai(e);t=t||"default";var g=c.get(u);if(!g){var S={loading:0,preload:null};if(g=l.querySelector(rr(u)))S.loading=5;else{e=z({rel:"stylesheet",href:e,"data-precedence":t},n),(n=qn.get(u))&&mf(e,n);var A=g=l.createElement("link");It(A),tn(A,"link",e),A._p=new Promise(function(G,J){A.onload=G,A.onerror=J}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Jo(g,t,l)}g={type:"stylesheet",instance:g,count:1,state:S},c.set(u,g)}}}function cw(e,t){Ha.X(e,t);var n=ni;if(n&&e){var l=Sl(n).hoistableScripts,c=si(e),u=l.get(c);u||(u=n.querySelector(or(c)),u||(e=z({src:e,async:!0},t),(t=qn.get(c))&&pf(e,t),u=n.createElement("script"),It(u),tn(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function uw(e,t){Ha.M(e,t);var n=ni;if(n&&e){var l=Sl(n).hoistableScripts,c=si(e),u=l.get(c);u||(u=n.querySelector(or(c)),u||(e=z({src:e,async:!0,type:"module"},t),(t=qn.get(c))&&pf(e,t),u=n.createElement("script"),It(u),tn(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function ay(e,t,n,l){var c=(c=Pe.current)?ir(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=ai(n.href),t=Sl(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=ai(n.href);var u=Sl(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(rr(e)))?u._p||(g.instance=u,g.state.loading=5):(u=qn.get(e),u||(u={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},qn.set(e,u)),dw(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=si(n),t=Sl(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 ai(e){return'href="'+Rn(e)+'"'}function rr(e){return'link[rel="stylesheet"]['+e+"]"}function sy(e){return z({},e,{"data-precedence":e.precedence,precedence:null})}function dw(e,t,n,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Hr]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Hr]=!0,t.onload=t.onerror=pm.bind(null,t),tn(t,"link",n),It(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function si(e){return'[src="'+Rn(e)+'"]'}function or(e){return"script[async]"+e}function ly(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Rn(n.href)+'"]');if(l)return t.instance=l,It(l),l;var c=z({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),It(l),tn(l,"style",c),Jo(l,n.precedence,e),t.instance=l;case"stylesheet":c=ai(n.href);var u=e.querySelector(rr(c));if(u)return t.state.loading|=4,t.instance=u,It(u),u;l=sy(n),(c=qn.get(c))&&mf(l,c),u=(e.ownerDocument||e).createElement("link"),It(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,Jo(u,n.precedence,e),t.instance=u;case"script":return u=si(n.src),(c=e.querySelector(or(u)))?(t.instance=c,It(c),c):(l=n,(c=qn.get(u))&&(l=z({},n),pf(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),It(c),tn(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Jo(l,n.precedence,e));return t.instance}function Jo(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 mf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function pf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $o=null;function iy(e,t,n){if($o===null){var l=new Map,c=$o=new Map;c.set(n,l)}else c=$o,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[ji]||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 gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function fw(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 ry(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function oy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function cy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function uy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=cy(t),e.suspenseyImages.push(t)),e=pw.bind(e),t.decode().then(e,e))}function hw(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=ai(l.href),u=t.querySelector(rr(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,It(u);return}u=t.ownerDocument||t,l=sy(l),(c=qn.get(c))&&mf(l,c),u=u.createElement("link"),It(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=cr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wo=0;function mw(e,t){return e.stylesheets&&e.count===0&&tc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&tc(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Wo===0&&(Wo=62500*RS());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tc(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Wo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function dy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)tc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function cr(){this.count--,dy(this)}function pw(){this.imgCount--,dy(this)}var ec=null;function tc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ec=new Map,t.forEach(gw,e),ec=null,cr.call(e))}function gw(e,t){if(!(t.state.loading&4)){var n=ec.get(e);if(n)var l=n.get(null);else{n=new Map,ec.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=cr.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 li={$$typeof:U,Provider:null,Consumer:null,_currentValue:qe,_currentValue2:qe,_threadCount:0};function xw(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=Xc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.hiddenUpdates=Xc(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 fy(e,t,n,l,c,u,g,S,A,G,J,ge){return e=new xw(e,t,n,g,A,G,J,ge,S),t=1,u===!0&&(t|=24),u=mn(3,null,null,t),e.current=u,u.stateNode=e,t=Tu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},Mu(u),e}function hy(e){return e?(e=Dl,e):Dl}function my(e,t,n,l,c,u){c=hy(c),l.context===null?l.context=c:l.pendingContext=c,l=as(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=ss(e,l,t),n!==null&&(yn(n,e,t),qi(n,e,t))}function py(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xf(e,t){py(e,t),(e=e.alternate)&&py(e,t)}function gy(e){if(e.tag===13||e.tag===31){var t=Ls(e,67108864);t!==null&&yn(t,e,67108864),xf(e,67108864)}}function xy(e){if(e.tag===13||e.tag===31){var t=An();t=Zc(t);var n=Ls(e,t);n!==null&&yn(n,e,t),xf(e,t)}}var ii=!0;function yw(e,t,n,l){var c=ce.T;ce.T=null;var u=Se.p;try{Se.p=2,yf(e,t,n,l)}finally{Se.p=u,ce.T=c}}function bw(e,t,n,l){var c=ce.T;ce.T=null;var u=Se.p;try{Se.p=8,yf(e,t,n,l)}finally{Se.p=u,ce.T=c}}function yf(e,t,n,l){if(ii){var c=bf(l);if(c===null)$d(e,t,l,nc,n),by(e,l);else if(Sw(c,e,t,n,l))l.stopPropagation();else if(by(e,l),t&4&&-1<vw.indexOf(e)){for(;c!==null;){var u=vl(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}ya(u),(ot&6)===0&&(Po=Rt()+500,nr(0))}}break;case 31:case 13:S=Ls(u,2),S!==null&&yn(S,u,2),Io(),xf(u,2)}if(u=bf(l),u===null&&$d(e,t,l,nc,n),u===c)break;c=u}c!==null&&l.stopPropagation()}else $d(e,t,l,null,n)}}function bf(e){return e=au(e),vf(e)}var nc=null;function vf(e){if(nc=null,e=Rs(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(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 nc=e,null}function yy(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(Ya()){case Ds:return 2;case Qa:return 8;case ka:case oe:return 32;case Re:return 268435456;default:return 32}default:return 32}}var Sf=!1,gs=null,xs=null,ys=null,ur=new Map,dr=new Map,bs=[],vw="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 by(e,t){switch(e){case"focusin":case"focusout":gs=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":ys=null;break;case"pointerover":case"pointerout":ur.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dr.delete(t.pointerId)}}function fr(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=vl(t),t!==null&&gy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Sw(e,t,n,l,c){switch(t){case"focusin":return gs=fr(gs,e,t,n,l,c),!0;case"dragenter":return xs=fr(xs,e,t,n,l,c),!0;case"mouseover":return ys=fr(ys,e,t,n,l,c),!0;case"pointerover":var u=c.pointerId;return ur.set(u,fr(ur.get(u)||null,e,t,n,l,c)),!0;case"gotpointercapture":return u=c.pointerId,dr.set(u,fr(dr.get(u)||null,e,t,n,l,c)),!0}return!1}function vy(e){var t=Rs(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,fm(e.priority,function(){xy(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,fm(e.priority,function(){xy(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 ac(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bf(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);nu=l,n.target.dispatchEvent(l),nu=null}else return t=vl(n),t!==null&&gy(t),e.blockedOn=n,!1;t.shift()}return!0}function Sy(e,t,n){ac(e)&&n.delete(t)}function ww(){Sf=!1,gs!==null&&ac(gs)&&(gs=null),xs!==null&&ac(xs)&&(xs=null),ys!==null&&ac(ys)&&(ys=null),ur.forEach(Sy),dr.forEach(Sy)}function sc(e,t){e.blockedOn===t&&(e.blockedOn=null,Sf||(Sf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,ww)))}var lc=null;function wy(e){lc!==e&&(lc=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){lc===e&&(lc=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(vf(l||n)===null)continue;break}var u=vl(n);u!==null&&(e.splice(t,3),t-=3,td(u,{pending:!0,data:c,method:n.method,action:l},l,c))}}))}function ri(e){function t(A){return sc(A,e)}gs!==null&&sc(gs,e),xs!==null&&sc(xs,e),ys!==null&&sc(ys,e),ur.forEach(t),dr.forEach(t);for(var n=0;n<bs.length;n++){var l=bs[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<bs.length&&(n=bs[0],n.blockedOn===null);)vy(n),n.blockedOn===null&&bs.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[hn]||null;if(typeof u=="function")g||wy(n);else if(g){var S=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[hn]||null)S=g.formAction;else if(vf(c)!==null)continue}else S=g.action;typeof S=="function"?n[l+1]=S:(n.splice(l,3),l-=3),wy(n)}}}function jy(){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 wf(e){this._internalRoot=e}ic.prototype.render=wf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=An();my(n,l,e,t,null,null)},ic.prototype.unmount=wf.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),Io(),t[bl]=null}};function ic(e){this._internalRoot=e}ic.prototype.unstable_scheduleHydration=function(e){if(e){var t=dm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<bs.length&&t!==0&&t<bs[n].priority;n++);bs.splice(n,0,e),n===0&&vy(e)}};var ky=i.version;if(ky!=="19.3.0")throw Error(o(527,ky,"19.3.0"));Se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var jw={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{fn=rc.inject(jw),Fe=rc}catch{}}return mr.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",c=hg,u=mg,g=pg;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=fy(e,1,!1,null,null,n,l,null,c,u,g,jy),e[bl]=t.current,Jd(e),new wf(t)},mr.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,c="",u=hg,g=mg,S=pg,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=fy(e,1,!0,t,n??null,l,c,A,u,g,S,jy),t.context=hy(null),n=t.current,l=An(),l=Zc(l),c=as(l),c.callback=null,ss(n,c,l),n=l,t.current.lanes=n,wi(t,n),ya(t),e[bl]=t.current,Jd(e),new ic(t)},mr.version="19.3.0",mr}var Oy;function Ow(){if(Oy)return Nf.exports;Oy=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(),Nf.exports=Mw(),Nf.exports}var Lw=Ow();const Bw=Hh(Lw);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 el(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 Uw(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 Ly(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:Uw(r.headers.get("Content-Disposition")),animated:r.headers.get("X-Levix-Animated")==="1"}}const Q={get:a=>el(a,{method:"GET"}),post:(a,i)=>el(a,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(a,i)=>el(a,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(a,i)=>el(a,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:a=>el(a,{method:"DELETE"}),getStats:()=>Q.get("/stats"),getSession:()=>Q.get("/bot/session"),startSession:a=>Q.post("/bot/session/start",a),reconnectSession:()=>Q.post("/bot/session/reconnect"),stopSession:()=>Q.post("/bot/session/stop"),unlinkSession:()=>Q.post("/bot/logout"),restartBot:()=>Q.post("/bot/restart"),getSettings:()=>Q.get("/settings"),updateSetting:(a,i)=>Q.patch("/settings",{key:a,value:i}),updatePrefix:a=>Q.patch("/settings",{key:"prefix",value:a}),exportSettings:()=>Q.get("/settings/export"),importSettings:a=>Q.post("/settings/import",a),getCommands:()=>Q.get("/commands"),updateCommand:(a,i)=>Q.patch(`/commands/${encodeURIComponent(a)}`,i),postMultipart:(a,i,r)=>new Promise((o,d)=>{const f=new FormData;for(const[m,p]of Object.entries(i))p!=null&&p!==""&&f.set(m,p);f.set("file",r);const h=new XMLHttpRequest;h.open("POST",`/dashboard/api${a}`),h.responseType="json",h.onload=()=>{const m=h.response&&typeof h.response=="object"?h.response:null;if(h.status===401){window.location.href="/login",d(new Bt(401,"Session expired"));return}h.status>=200&&h.status<300?o(m):d(new Bt(h.status,(m==null?void 0:m.error)||(m==null?void 0:m.message)||`HTTP ${h.status}: Request failed`,m))},h.onerror=()=>d(new Bt(0,"Network error")),h.send(f)}),getSchedules:()=>Q.get("/schedules"),createSchedule:a=>Q.post("/schedules",a),deleteSchedule:a=>Q.delete(`/schedules/${encodeURIComponent(a)}`),retrySchedule:a=>Q.post(`/schedules/${encodeURIComponent(a)}/retry`),getGroups:()=>Q.get("/groups"),updateGroup:(a,i)=>Q.patch(`/groups/${encodeURIComponent(a)}`,i),getPersona:()=>Q.get("/ai/persona"),updatePersona:a=>Q.put("/ai/persona",{body:a}),getMemoryFiles:()=>Q.get("/ai/memory"),getMemoryFile:a=>Q.get(`/ai/memory/${encodeURIComponent(a)}`),updateMemoryFile:(a,i)=>Q.put(`/ai/memory/${encodeURIComponent(a)}`,{content:i}),deleteMemoryFile:a=>Q.delete(`/ai/memory/${encodeURIComponent(a)}`),getAiConversations:()=>Q.get("/ai/conversations"),getAiConversation:a=>Q.get(`/ai/conversations/${encodeURIComponent(a)}`),getRecipients:()=>Q.get("/recipients"),fetchAiModels:a=>Q.post("/ai/models",a||{}),changePassword:(a,i)=>Q.post("/security/password",{current:a,next:i}),getFeedbackMeta:()=>Q.get("/feedback/meta"),getFeedbackDiagnosticsPreview:a=>Q.post("/feedback/diagnostics-preview",{client:a}),sendFeedback:a=>Q.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 h=new XMLHttpRequest;h.open("POST","/dashboard/api/feedback"),h.responseType="json",h.upload.onprogress=m=>{m.lengthComputable&&r&&r(m.loaded/m.total)},h.onload=()=>{const m=h.response&&typeof h.response=="object"?h.response:null;if(h.status===401){window.location.href="/login",d(new Bt(401,"Session expired"));return}h.status>=200&&h.status<300?o(m??{success:!0}):d(new Bt(h.status,(m==null?void 0:m.error)||(m==null?void 0:m.message)||`HTTP ${h.status}: Request failed`,m))},h.onerror=()=>d(new Bt(0,"Network error")),h.send(f)}),getCrashReports:()=>Q.get("/crash-reports"),submitCrashReport:a=>Q.post("/crash-reports",a),sendCrashReport:a=>Q.post(`/crash-reports/${encodeURIComponent(a)}/send`),deleteCrashReport:a=>Q.delete(`/crash-reports/${encodeURIComponent(a)}`),deleteAllCrashReports:()=>Q.delete("/crash-reports"),getLogs:()=>Q.get("/logs"),getStickerCapabilities:()=>Q.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()),Q.get(`/stickers?${i.toString()}`)},uploadStickerSource:(a,i)=>{const r={};return i&&(r["X-Filename"]=encodeURIComponent(i)),el("/stickers/uploads",{method:"POST",body:a,headers:r})},uploadExistingStickerSource:a=>el(`/stickers/${encodeURIComponent(a)}/uploads`,{method:"POST"}),createStickerJob:a=>Q.post("/stickers/jobs",a),getStickerJob:a=>Q.get(`/stickers/jobs/${encodeURIComponent(a)}`),exportSticker:(a,i)=>Ly(`/stickers/${encodeURIComponent(a)}/export?format=${i}`),exportStickers:(a,i)=>Ly("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a,format:i})}),updateSticker:(a,i)=>Q.patch(`/stickers/${encodeURIComponent(a)}`,i),deleteSticker:(a,i)=>Q.delete(`/stickers/${encodeURIComponent(a)}${i?"?confirm=1":""}`),bulkStickers:a=>Q.post("/stickers/bulk",a),sendStickers:a=>Q.post("/stickers/send",a),getPacks:()=>Q.get("/sticker-packs"),createPack:a=>Q.post("/sticker-packs",{name:a}),getPack:a=>Q.get(`/sticker-packs/${encodeURIComponent(a)}`),updatePack:(a,i)=>Q.patch(`/sticker-packs/${encodeURIComponent(a)}`,{name:i}),deletePack:(a,i)=>Q.delete(`/sticker-packs/${encodeURIComponent(a)}${i?"?deleteStickers=1":""}`),reorderPack:(a,i)=>Q.put(`/sticker-packs/${encodeURIComponent(a)}/order`,{ids:i}),mergePack:(a,i)=>Q.post(`/sticker-packs/${encodeURIComponent(a)}/merge`,{intoPackId:i}),listAutoDeleteRules:()=>Q.get("/auto-delete/rules"),createAutoDeleteRule:a=>Q.post("/auto-delete/rules",a),updateAutoDeleteRule:(a,i)=>Q.patch(`/auto-delete/rules/${a}`,i),deleteAutoDeleteRule:a=>Q.delete(`/auto-delete/rules/${a}`),resetAutoDeleteRule:a=>Q.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 Q.get(`/auto-delete/log${r?`?${r}`:""}`)},clearAutoDeleteLog:a=>Q.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 Hw=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 qw(a,i,r=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Hw(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 Pw=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 Gw=a=>{const i=Pw(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 xh=(...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 tl={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 _f(a){return a!=null}function Vw(a,i={}){var w,N;const r=i.attributeNames??{},o=C=>r[C]??C,d=a.size??a.width??tl.width,f=a.size??a.height??tl.height,h=((w=a.aliases)==null?void 0:w.filter(C=>typeof C=="string"&&C.trim()!=="").map(C=>`lucide-${C}`))??[],m=[...a.name?[`lucide-${a.name}`]:[],...h],p=((N=i.className)==null?void 0:N.split(" ").filter(Boolean))??[],x=i.includeDefaultClasses===!1?xh(...p):xh("lucide",...m,...p),v=i.absoluteStrokeWidth?Number(i.strokeWidth??tl["stroke-width"])*Number(a.size??a.width??tl.width)/Number(i.size??i.width??tl.width):i.strokeWidth??tl["stroke-width"];return["svg",{...Object.entries(tl).reduce((C,[k,j])=>(C[o(k)]=j,C),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&_f(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&_f(i.width)&&{[o("width")]:i.width},..."height"in i&&_f(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:v,...x&&{[o("class")]:x},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},a.node.map(C=>{const[k,j,_]=C,R=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...j}:j;return _?[k,R,_]:[k,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 Iw(a,i={}){return Vw(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 Fw=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},Kw=b.createContext({}),Yw=()=>b.useContext(Kw),Qw=b.forwardRef(({color:a,size:i,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:h,className:m="",children:p,iconNode:x=[],icon:v={node:x,aliases:[],size:24},...y},w)=>{const{size:N=24,strokeWidth:C=2,absoluteStrokeWidth:k=!1,nonScalingStroke:j=!1,color:_="currentColor",className:R=""}=Yw()??{},I=!!p||Fw(y),[q,he,B=[]]=Iw(v,{color:a??_,width:r??i??N,height:o??i??N,strokeWidth:d??C,absoluteStrokeWidth:f??k,nonScalingStroke:h??j,className:xh(R,m),hasA11yProp:I,attributes:y});return b.createElement(q,{ref:w,...he},[...B.map(([z,T])=>b.createElement(z,T)),...Array.isArray(p)?p:[p]])});/**
95
- * @license lucide-react v1.46.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */function je(a,i=[],r=[]){const o=typeof a=="string"?qw(a,i,r):a,d=b.forwardRef(({className:f,...h},m)=>b.createElement(Qw,{ref:m,icon:o,className:f,...h}));return o.name&&(d.displayName=Gw(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 K0={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};K0.node;const Xw=je(K0);/**
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 Y0={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};Y0.node;const Zw=je(Y0);/**
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 Q0={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};Q0.node;const Jw=je(Q0);/**
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 X0={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"}]]};X0.node;const $w=je(X0);/**
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 Z0={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"}]]};Z0.node;const Ww=je(Z0);/**
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 J0={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"}]]};J0.node;const Ph=je(J0);/**
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 $0={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"}]]};$0.node;const ej=je($0);/**
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 W0={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"}]]};W0.node;const yh=je(W0);/**
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 eb={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};eb.node;const di=je(eb);/**
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 tb={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};tb.node;const fi=je(tb);/**
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 nb={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};nb.node;const Ec=je(nb);/**
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 ab={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};ab.node;const bh=je(ab);/**
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 sb={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};sb.node;const tj=je(sb);/**
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 lb={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"]};lb.node;const sl=je(lb);/**
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 ib={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"]};ib.node;const js=je(ib);/**
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 rb={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"]};rb.node;const nj=je(rb);/**
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 ob={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"]};ob.node;const aj=je(ob);/**
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 cb={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};cb.node;const ub=je(cb);/**
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 db={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"}]]};db.node;const fb=je(db);/**
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 hb={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"}]]};hb.node;const sj=je(hb);/**
200
- * @license lucide-react v1.46.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const mb={name:"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"}]]};mb.node;const Lc=je(mb);/**
205
- * @license lucide-react v1.46.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const pb={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"]};pb.node;const lj=je(pb);/**
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 gb={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"}]]};gb.node;const ij=je(gb);/**
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 xb={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"}]]};xb.node;const rj=je(xb);/**
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 yb={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"}]]};yb.node;const zr=je(yb);/**
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 bb={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"}]]};bb.node;const Mr=je(bb);/**
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 vb={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"}]]};vb.node;const oj=je(vb);/**
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 Sb={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"]};Sb.node;const cj=je(Sb);/**
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 wb={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"}]]};wb.node;const Ac=je(wb);/**
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 jb={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"}]]};jb.node;const By=je(jb);/**
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 kb={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};kb.node;const Uy=je(kb);/**
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 Nb={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"}]]};Nb.node;const uj=je(Nb);/**
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 Cb={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"}]]};Cb.node;const dj=je(Cb);/**
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 Eb={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"}]]};Eb.node;const fj=je(Eb);/**
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 Ab={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"}]]};Ab.node;const vh=je(Ab);/**
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 _b={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};_b.node;const hj=je(_b);/**
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 Tb={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"}]]};Tb.node;const mj=je(Tb);/**
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 Db={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"}]]};Db.node;const Rb=je(Db);/**
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 zb={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"}]]};zb.node;const pj=je(zb);/**
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 Mb={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};Mb.node;const gj=je(Mb);/**
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 Ob={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"}]]};Ob.node;const xj=je(Ob);/**
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 Lb={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"}]]};Lb.node;const yj=je(Lb);/**
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 Bb={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"}]]};Bb.node;const gc=je(Bb);/**
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 Ub={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"}]]};Ub.node;const xc=je(Ub);/**
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 Hb={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"}]]};Hb.node;const qb=je(Hb);/**
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 Pb={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"}]]};Pb.node;const bj=je(Pb);/**
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 Gb={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"}]]};Gb.node;const Sh=je(Gb);/**
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 Vb={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"}]]};Vb.node;const wr=je(Vb);/**
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 Ib={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"]};Ib.node;const vj=je(Ib);/**
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 Fb={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"}]]};Fb.node;const Kb=je(Fb);/**
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 Yb={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"}]]};Yb.node;const Sj=je(Yb);/**
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 Qb={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"}]]};Qb.node;const wj=je(Qb);/**
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 Xb={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Xb.node;const rl=je(Xb);/**
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 Zb={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"}]]};Zb.node;const Tf=je(Zb);/**
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 Jb={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"}]]};Jb.node;const Tr=je(Jb);/**
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 $b={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"}]]};$b.node;const Ia=je($b);/**
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 Wb={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"]};Wb.node;const jj=je(Wb);/**
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 ev={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"}]]};ev.node;const ol=je(ev);/**
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 tv={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"}]]};tv.node;const hi=je(tv);/**
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 nv={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};nv.node;const Gh=je(nv);/**
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 av={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"}]]};av.node;const mi=je(av);/**
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 sv={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"}]]};sv.node;const kj=je(sv);/**
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 lv={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"}]]};lv.node;const Or=je(lv);/**
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 iv={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"}]]};iv.node;const Hy=je(iv);/**
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 rv={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"}]]};rv.node;const Vh=je(rv);/**
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 ov={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"]};ov.node;const cv=je(ov);/**
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 uv={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"}]]};uv.node;const kr=je(uv);/**
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 dv={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"]};dv.node;const fv=je(dv);/**
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 hv={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};hv.node;const wh=je(hv);/**
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 mv={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"}]]};mv.node;const Bc=je(mv);/**
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 pv={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"}]]};pv.node;const Ih=je(pv);/**
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 gv={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"}]]};gv.node;const Nj=je(gv);/**
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 xv={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"}]]};xv.node;const Cj=je(xv);/**
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 yv={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};yv.node;const cl=je(yv);/**
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 bv={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"]};bv.node;const In=je(bv);/**
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 vv={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"]};vv.node;const ul=je(vv);/**
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 Sv={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"}]]};Sv.node;const Ej=je(Sv);/**
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 wv={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"}]]};wv.node;const Aj=je(wv);/**
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 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 kv=je(jv);/**
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 Nv={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"}]]};Nv.node;const oc=je(Nv);/**
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 Cv={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"}]]};Cv.node;const il=je(Cv);/**
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 Ev={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"}]]};Ev.node;const _j=je(Ev);/**
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 Av={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"}]]};Av.node;const Tj=je(Av);/**
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 _v={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"}]]};_v.node;const Tv=je(_v);/**
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 Dv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Dv.node;const Fn=je(Dv);/**
525
- * @license lucide-react v1.46.0 - ISC
526
- *
527
- * This source code is licensed under the ISC license.
528
- * See the LICENSE file in the root directory of this source tree.
529
- */const Rv={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"}]]};Rv.node;const Dj=je(Rv),Df={ar:{overview:"نظرة عامة",stickers:"استوديو الملصقات",connection:"حالة الاتصال",control:"التحكم والإدارة",commands:"كتالوج الأوامر",ai:"الذكاء الاصطناعي",groups:"المجموعات",roles:"الأدوار والمشرفين",schedules:"الرسائل المجدولة",notes:"الملاحظات والقوائم",settings:"الإعدادات العامة",logs:"السجلات المباشرة",connected:"متصل بالواتساب",disconnected:"غير متصل",starting:"جارٍ إنشاء الاتصال...",waiting_for_qr:"بانتظار مسح رمز الـ QR",linking:"جارٍ ربط الجلسة...",reconnecting:"جارٍ إعادة الاتصال...",retry_exhausted:"استُنفذت محاولات الاتصال",logged_out:"تم تسجيل الخروج من الهاتف",idle:"الجلسة خاملة",paused:"متوقف مؤقتاً",resume:"استئناف الجلسة",connectSession:"الاتصال",start:"بدء الاتصال",stop:"إيقاف مؤقت",reconnect:"إعادة الاتصال",unlink:"إلغاء الربط (Unlink)",restart:"إعادة تشغيل البوت",save:"حفظ التغييرات",saving:"جارٍ الحفظ...",discard:"تجاهل",unsavedChanges:"تغييرات غير محفوظة",toggleOn:"مفعل",toggleOff:"معطل",cancel:"إلغاء",delete:"حذف",edit:"تعديل",add:"إضافة",refresh:"تحديث",logout:"تسجيل الخروج",backToApp:"العودة للتطبيق",close:"إغلاق",copy:"نسخ",copied:"تم النسخ!",filter:"تصفية",sort:"ترتيب",more:"المزيد",reset:"إعادة التعيين",autoScroll:"تمرير تلقائي",dismiss:"إخفاء",openNavigation:"فتح القائمة",closeNavigation:"إغلاق القائمة",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:{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 or JID",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."}},Fh=b.createContext(null),Rj=({children:a})=>{const[i,r]=b.useState(()=>document.documentElement.lang==="ar"?"ar":"en"),[o,d]=b.useState(()=>document.documentElement.getAttribute("data-theme")==="light"?"light":"dark"),f=i==="ar"?"rtl":"ltr";b.useEffect(()=>{const v=y=>{const w=y.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",v),()=>window.removeEventListener("levix-ui-prefs",v)},[]);const h=(v,y,w)=>{var C;const N=window.LevixHost;(C=N==null?void 0:N.setUiPrefs)==null||C.call(N,v,y,w)},m=v=>{v!==i&&(r(v),document.documentElement.lang=v,document.documentElement.dir=v==="ar"?"rtl":"ltr",localStorage.setItem("levix_lang",v),h(v,o,"language"))},p=v=>{v!==o&&(d(v),document.documentElement.setAttribute("data-theme",v),localStorage.setItem("levix_theme",v),h(i,v,"theme"))},x=b.useMemo(()=>(v,y)=>(Df[i]||Df.en)[v]??Df.en[v]??y??String(v),[i]);return s.jsx(Fh.Provider,{value:{language:i,theme:o,direction:f,setLanguage:m,setTheme:p,t:x},children:a})},He=()=>{const a=b.useContext(Fh);if(!a)throw new Error("useI18n must be used within an I18nProvider");return a};function zv(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=zv(a[i]))&&(o&&(o+=" "),o+=r)}else for(r in a)a[r]&&(o&&(o+=" "),o+=r);return o}function zj(){for(var a,i,r=0,o="",d=arguments.length;r<d;r++)(a=arguments[r])&&(i=zv(a))&&(o&&(o+=" "),o+=i);return o}const Mj=(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},Oj=(a,i)=>({classGroupId:a,validator:i}),Mv=(a=new Map,i=null,r)=>({nextPart:a,validators:i,classGroupId:r}),_c="-",qy=[],Lj="arbitrary..",Bj=a=>{const i=Hj(a),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return Uj(h);const m=h.split(_c),p=m[0]===""&&m.length>1?1:0;return Ov(m,p,i)},getConflictingClassGroupIds:(h,m)=>{if(m){const p=o[h],x=r[h];return p?x?Mj(x,p):p:x||qy}return r[h]||qy}}},Ov=(a,i,r)=>{if(a.length-i===0)return r.classGroupId;const d=a[i],f=r.nextPart.get(d);if(f){const x=Ov(a,i+1,f);if(x)return x}const h=r.validators;if(h===null)return;const m=i===0?a.join(_c):a.slice(i).join(_c),p=h.length;for(let x=0;x<p;x++){const v=h[x];if(v.validator(m))return v.classGroupId}},Uj=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?Lj+o:void 0})(),Hj=a=>{const{theme:i,classGroups:r}=a;return qj(r,i)},qj=(a,i)=>{const r=Mv();for(const o in a){const d=a[o];Kh(d,r,o,i)}return r},Kh=(a,i,r,o)=>{const d=a.length;for(let f=0;f<d;f++){const h=a[f];Pj(h,i,r,o)}},Pj=(a,i,r,o)=>{if(typeof a=="string"){Gj(a,i,r);return}if(typeof a=="function"){Vj(a,i,r,o);return}Ij(a,i,r,o)},Gj=(a,i,r)=>{const o=a===""?i:Lv(i,a);o.classGroupId=r},Vj=(a,i,r,o)=>{if(Fj(a)){Kh(a(o),i,r,o);return}i.validators===null&&(i.validators=[]),i.validators.push(Oj(r,a))},Ij=(a,i,r,o)=>{const d=Object.entries(a),f=d.length;for(let h=0;h<f;h++){const[m,p]=d[h];Kh(p,Lv(i,m),r,o)}},Lv=(a,i)=>{let r=a;const o=i.split(_c),d=o.length;for(let f=0;f<d;f++){const h=o[f];let m=r.nextPart.get(h);m||(m=Mv(),r.nextPart.set(h,m)),r=m}return r},Fj=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,Kj=a=>{if(a<1)return{get:()=>{},set:()=>{}};let i=0,r=Object.create(null),o=Object.create(null);const d=(f,h)=>{r[f]=h,i++,i>a&&(i=0,o=r,r=Object.create(null))};return{get(f){let h=r[f];if(h!==void 0)return h;if((h=o[f])!==void 0)return d(f,h),h},set(f,h){f in r?r[f]=h:d(f,h)}}},jh="!",Py=":",Yj=[],Gy=(a,i,r,o,d)=>({modifiers:a,hasImportantModifier:i,baseClassName:r,maybePostfixModifierPosition:o,isExternal:d}),Qj=a=>{const{prefix:i,experimentalParseClassName:r}=a;let o=d=>{const f=[];let h=0,m=0,p=0,x;const v=d.length;for(let k=0;k<v;k++){const j=d[k];if(h===0&&m===0){if(j===Py){f.push(d.slice(p,k)),p=k+1;continue}if(j==="/"){x=k;continue}}j==="["?h++:j==="]"?h--:j==="("?m++:j===")"&&m--}const y=f.length===0?d:d.slice(p);let w=y,N=!1;y.endsWith(jh)?(w=y.slice(0,-1),N=!0):y.startsWith(jh)&&(w=y.slice(1),N=!0);const C=x&&x>p?x-p:void 0;return Gy(f,N,w,C)};if(i){const d=i+Py,f=o;o=h=>h.startsWith(d)?f(h.slice(d.length)):Gy(Yj,!1,h,void 0,!0)}if(r){const d=o;o=f=>r({className:f,parseClassName:d})}return o},Xj=a=>{const i=new Map;return a.orderSensitiveModifiers.forEach((r,o)=>{i.set(r,1e6+o)}),r=>{const o=[];let d=[];for(let f=0;f<r.length;f++){const h=r[f],m=h[0]==="[",p=i.has(h);m||p?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(h)):d.push(h)}return d.length>0&&(d.sort(),o.push(...d)),o}},Zj=a=>({cache:Kj(a.cacheSize),parseClassName:Qj(a),sortModifiers:Xj(a),postfixLookupClassGroupIds:Jj(a),...Bj(a)}),Jj=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},$j=/\s+/,Wj=(a,i)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:h}=i,m=[],p=a.trim().split($j);let x="";for(let v=p.length-1;v>=0;v-=1){const y=p[v],{isExternal:w,modifiers:N,hasImportantModifier:C,baseClassName:k,maybePostfixModifierPosition:j}=r(y);if(w){x=y+(x.length>0?" "+x:x);continue}let _=!!j,R;if(_){const z=k.substring(0,j);R=o(z);const T=R&&h[R]?o(k):void 0;T&&T!==R&&(R=T,_=!1)}else R=o(k);if(!R){if(!_){x=y+(x.length>0?" "+x:x);continue}if(R=o(k),!R){x=y+(x.length>0?" "+x:x);continue}_=!1}const I=N.length===0?"":N.length===1?N[0]:f(N).join(":"),q=C?I+jh:I,he=q+R;if(m.indexOf(he)>-1)continue;m.push(he);const B=d(R,_);for(let z=0;z<B.length;++z){const T=B[z];m.push(q+T)}x=y+(x.length>0?" "+x:x)}return x},ek=(...a)=>{let i=0,r,o,d="";for(;i<a.length;)(r=a[i++])&&(o=Bv(r))&&(d&&(d+=" "),d+=o);return d},Bv=a=>{if(typeof a=="string")return a;let i,r="";for(let o=0;o<a.length;o++)a[o]&&(i=Bv(a[o]))&&(r&&(r+=" "),r+=i);return r},tk=(a,...i)=>{let r,o,d,f;const h=p=>{const x=i.reduce((v,y)=>y(v),a());return r=Zj(x),o=r.cache.get,d=r.cache.set,f=m,m(p)},m=p=>{const x=o(p);if(x)return x;const v=Wj(p,r);return d(p,v),v};return f=h,(...p)=>f(ek(...p))},nk=[],Pt=a=>{const i=r=>r[a]||nk;return i.isThemeGetter=!0,i.themeKey=a,i},Uv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ak=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lk=/\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$/,ik=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,rk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ok=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=a=>ak.test(a),Qe=a=>!!a&&!Number.isNaN(Number(a)),ba=a=>!!a&&Number.isInteger(Number(a)),Rf=a=>a.endsWith("%")&&Qe(a.slice(0,-1)),qa=a=>sk.test(a),qv=()=>!0,ck=a=>lk.test(a)&&!ik.test(a),Yh=()=>!1,uk=a=>rk.test(a),dk=a=>ok.test(a),fk=a=>!Ae(a)&&!_e(a),hk=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)),mk=a=>_s(a,Vv,Yh),Ae=a=>Uv.test(a),nl=a=>_s(a,Iv,ck),Vy=a=>_s(a,wk,Qe),pk=a=>_s(a,Kv,qv),gk=a=>_s(a,Fv,Yh),Iy=a=>_s(a,Pv,Yh),xk=a=>_s(a,Gv,dk),cc=a=>_s(a,Yv,uk),_e=a=>Hv.test(a),pr=a=>dl(a,Iv),yk=a=>dl(a,Fv),Fy=a=>dl(a,Pv),bk=a=>dl(a,Vv),vk=a=>dl(a,Gv),uc=a=>dl(a,Yv,!0),Sk=a=>dl(a,Kv,!0),_s=(a,i,r)=>{const o=Uv.exec(a);return o?o[1]?i(o[1]):r(o[2]):!1},dl=(a,i,r=!1)=>{const o=Hv.exec(a);return o?o[1]?i(o[1]):r:!1},Pv=a=>a==="position"||a==="percentage",Gv=a=>a==="image"||a==="url",Vv=a=>a==="length"||a==="size"||a==="bg-size",Iv=a=>a==="length",wk=a=>a==="number",Fv=a=>a==="family-name",Kv=a=>a==="number"||a==="weight",Yv=a=>a==="shadow",jk=()=>{const a=Pt("color"),i=Pt("font"),r=Pt("text"),o=Pt("font-weight"),d=Pt("tracking"),f=Pt("leading"),h=Pt("breakpoint"),m=Pt("container"),p=Pt("spacing"),x=Pt("radius"),v=Pt("shadow"),y=Pt("inset-shadow"),w=Pt("text-shadow"),N=Pt("drop-shadow"),C=Pt("blur"),k=Pt("perspective"),j=Pt("aspect"),_=Pt("ease"),R=Pt("animate"),I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],he=()=>[...q(),_e,Ae],B=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],T=()=>[_e,Ae,p],F=()=>[Ss,"full","auto",...T()],X=()=>[ba,"none","subgrid",_e,Ae],re=()=>["auto",{span:["full",ba,_e,Ae]},ba,_e,Ae],ae=()=>[ba,"auto",_e,Ae],de=()=>["auto","min","max","fr",_e,Ae],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...T()],$=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],W=()=>[m,Ss,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ye=()=>[Ss,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],O=()=>[a,_e,Ae],ie=()=>[...q(),Fy,Iy,{position:[_e,Ae]}],be=()=>["no-repeat",{repeat:["","x","y","space","round"]}],we=()=>["auto","cover","contain",bk,mk,{size:[_e,Ae]}],E=()=>[Rf,pr,nl],Y=()=>["","none","full",x,_e,Ae],V=()=>["",Qe,pr,nl],le=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Qe,Rf,Fy,Iy],me=()=>["","none",C,_e,Ae],ce=()=>["none",Qe,_e,Ae],Se=()=>["none",Qe,_e,Ae],qe=()=>[Qe,_e,Ae],it=()=>[Ss,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qa],breakpoint:[qa],color:[qv],container:[qa],"drop-shadow":[qa],ease:["in","out","in-out"],font:[fk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qa],shadow:[qa],spacing:["px",Qe],text:[qa],"text-shadow":[qa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,Ae,_e,j]}],container:["container"],"container-type":[{"@container":["","normal","size",_e,Ae]}],"container-named":[hk],columns:[{columns:[Qe,"auto",Ae,_e,m]}],"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:he()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],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:[ba,"auto",_e,Ae]}],basis:[{basis:[Ss,"full","auto",m,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Ss,"auto","initial","none",Ae]}],grow:[{grow:["",Qe,_e,Ae]}],shrink:[{shrink:["",Qe,_e,Ae]}],order:[{order:[ba,"first","last","none",_e,Ae]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],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:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[m,"screen",...$()]}],"min-w":[{"min-w":[m,"screen","none",...$()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[h]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh","none",...$()]}],"font-size":[{text:["base",r,pr,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Sk,pk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Rf,Ae]}],"font-family":[{font:[yk,gk,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":[Qe,"none",_e,Vy]}],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:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",_e,nl]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Qe,"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:[ba,_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:ie()}],"bg-repeat":[{bg:be()}],"bg-size":[{bg:we()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ba,_e,Ae],radial:["",_e,Ae],conic:["",ba,_e,Ae]},vk,xk]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:E()}],"gradient-via-pos":[{via:E()}],"gradient-to-pos":[{to:E()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border: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:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,_e,Ae]}],"outline-w":[{outline:["",Qe,pr,nl]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","inner","none",v,uc,cc]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",y,uc,cc]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Qe,nl]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",w,uc,cc]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Qe,_e,Ae]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[_e,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":q()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:be()}],"mask-size":[{mask:we()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Ae]}],filter:[{filter:["","none",_e,Ae]}],blur:[{blur:me()}],brightness:[{brightness:[Qe,_e,Ae]}],contrast:[{contrast:[Qe,_e,Ae]}],"drop-shadow":[{"drop-shadow":["","none",N,uc,cc]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",Qe,_e,Ae]}],"hue-rotate":[{"hue-rotate":[Qe,_e,Ae]}],invert:[{invert:["",Qe,_e,Ae]}],saturate:[{saturate:[Qe,_e,Ae]}],sepia:[{sepia:["",Qe,_e,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Ae]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,_e,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,_e,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,_e,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,_e,Ae]}],"backdrop-invert":[{"backdrop-invert":["",Qe,_e,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,_e,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,_e,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,_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:[Qe,"initial",_e,Ae]}],ease:[{ease:["linear","initial",_,_e,Ae]}],delay:[{delay:[Qe,_e,Ae]}],animate:[{animate:["none",R,_e,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,_e,Ae]}],"perspective-origin":[{"perspective-origin":he()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"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:he()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],zoom:[{zoom:[ba,_e,Ae]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"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",...O()]}],"stroke-w":[{stroke:[Qe,pr,nl,Vy]}],stroke:[{stroke:["none",...O()]}],"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"]}},kk=tk(jk);function Ue(...a){return kk(zj(a))}const Nk={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 nt({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",Nk[a],i),...o,children:r})}function Nr({dot:a=!1,pulse:i=!1,children:r,...o}){return s.jsxs(nt,{...o,children:[a&&s.jsx("span",{className:Ue("size-2 shrink-0 rounded-full bg-current",i&&"pulse-dot")}),r]})}const ui={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=b.forwardRef(function({variant:i="secondary",size:r="md",loading:o=!1,icon:d,className:f,type:h="button",disabled:m,children:p,...x},v){return s.jsxs("button",{ref:v,type:h,disabled:m||o,"aria-busy":o||void 0,className:Ue(ui.base,ui.variant[i],ui.size[r],f),...x,children:[o?s.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 rounded-full border-2 border-current border-t-transparent animate-spin"}):d&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:d}),p]})}),Oe=b.forwardRef(function({label:i,icon:r,children:o,variant:d="secondary",size:f="sm",loading:h=!1,pressed:m,className:p,type:x="button",disabled:v,...y},w){const N=r??o;return s.jsx("button",{ref:w,type:x,title:i,"aria-label":i,...m===void 0?{}:{"aria-pressed":m},disabled:v||h,"aria-busy":h||void 0,className:Ue(ui.base,ui.variant[d],ui.icon[f],m&&"border-brand-blue/40 bg-brand-blue/15 text-brand-blue",p),...y,children:h?s.jsx("span",{"aria-hidden":!0,className:"size-4 rounded-full border-2 border-current border-t-transparent animate-spin"}):s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:N})})}),Ke=b.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})});function na({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 fl({className:a,...i}){return s.jsx(Ke,{className:a,children:s.jsx(na,{...i})})}const Uc="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 st({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 Xe=b.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(Uc,r&&"text-start",i),...d})}),Tc=b.forwardRef(function({className:i,...r},o){return s.jsx("textarea",{ref:o,className:Ue(Uc,"h-auto min-h-24 resize-y py-3 leading-relaxed",i),...r})}),Qt=b.forwardRef(function({className:i,...r},o){return s.jsx("select",{ref:o,className:Ue(Uc,"pe-8",i),...r})}),Dr=b.forwardRef(function({label:i,description:r,className:o,id:d,...f},h){const m=b.useId(),p=d??m;return s.jsxs("label",{htmlFor:p,className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{ref:h,id:p,type:"checkbox",className: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 vn({label:a,name:i,value:r,onChange:o,options:d,orientation:f="vertical",className:h}){return s.jsxs("div",{role:"radiogroup","aria-label":a,className:Ue("flex gap-1",f==="horizontal"?"flex-row flex-wrap":"flex-col",h),children:[a&&s.jsx("p",{className:"mb-1 w-full text-xs font-bold text-text-main",children:a}),d.map(m=>s.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2.5",children:[s.jsx("input",{type:"radio",name:i,value:m.value,checked:r===m.value,onChange:()=>o(m.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:m.label}),m.description&&s.jsx("span",{className:"block text-xs text-muted",children:m.description})]})]},m.value))]})}const bn=b.forwardRef(function({checked:i,onChange:r,disabled:o,id:d,label:f,description:h,className:m,...p},x){const v=b.useId(),y=d||v,w=!!(f||h);return s.jsxs("div",{className:Ue(w?"flex items-center justify-between gap-4":"inline-flex",m),children:[w&&s.jsxs("div",{className:"min-w-0 flex-1",children:[f&&s.jsx("label",{htmlFor:y,className:"block cursor-pointer text-sm font-semibold text-text-main",children:f}),h&&s.jsx("p",{className:"mt-0.5 text-xs text-muted",children:h})]}),s.jsx("button",{ref:x,type:"button",role:"switch","aria-checked":i,id:y,...p,disabled:o,onClick:()=>r(!i),className:Ue("relative inline-flex h-11 w-[52px] 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-1.5 before:h-8 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-2.5 size-6 rounded-full bg-white shadow transition-[inset-inline-start] duration-200",i?"start-[26px]":"start-[2px]")})})]})});function Hc({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(Fn,{size:14}),disabled:f,onMouseDown:h=>h.preventDefault(),onClick:r})]})}function Ck(a){return a.split(/[,،\n\r]+/)}const Ek=b.forwardRef(function({value:i,onChange:r,max:o,maxLength:d,prepare:f,onReject:h,removeLabel:m,countLabel:p,chipDir:x="auto",className:v,disabled:y,id:w,placeholder:N,"aria-label":C,"aria-invalid":k,"aria-describedby":j,..._},R){const I=b.useId(),q=w??I,[he,B]=b.useState(""),z=(F,X)=>{const re=F.trim();if(!re)return{next:X,reason:null};let ae=re;if(f){const de=f(re);if("error"in de)return{next:X,reason:de.error};if(ae=de.value,!ae)return{next:X,reason:"empty"}}else if(d!==void 0&&ae.length>d)return{next:X,reason:"long"};return X.includes(ae)?{next:X,reason:"duplicate"}:o!==void 0&&X.length>=o?{next:X,reason:"max"}:{next:[...X,ae],reason:null}},T=F=>{const X=Ck(F);let re=i,ae=null,de=!1;for(const se of X){if(!se.trim())continue;de=!0;const U=z(se,re);re=U.next,U.reason&&(ae=U.reason)}!de&&F.trim()&&(ae="empty"),re!==i&&r(re),h==null||h(ae),B("")};return s.jsxs("div",{className:Ue("flex flex-col gap-1.5",v),children:[s.jsxs("div",{className:Ue(Uc,"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(Hc,{dir:x,disabled:y,removeLabel:m(F),onRemove:y?void 0:()=>{r(i.filter(X=>X!==F)),h==null||h(null)},children:F},F)),s.jsx(Xe,{..._,ref:R,id:q,value:he,disabled:y,placeholder:i.length===0?N:void 0,"aria-label":C,"aria-invalid":k,"aria-describedby":j,className:"min-h-10 min-w-24 flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0",onChange:F=>{const X=F.target.value;if(/[,،\n\r]/.test(X)){T(X);return}B(X)},onKeyDown:F=>{if(!F.nativeEvent.isComposing){if(F.key==="Enter"||F.key===","||F.key==="،"){F.preventDefault(),T(he);return}F.key==="Backspace"&&he.length===0&&i.length>0&&(F.preventDefault(),r(i.slice(0,-1)),h==null||h(null))}},onPaste:F=>{const X=F.clipboardData.getData("text");/[,،\n\r]/.test(X)&&(F.preventDefault(),T(`${he}${X}`))},onBlur:()=>{he.trim()&&T(he)}})]}),p&&s.jsx("p",{className:"text-xs text-muted tabular-nums",children:p})]})});var Qh=F0();const Ak='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function _k(a){return[...a.querySelectorAll(Ak)].filter(i=>!(i.tabIndex<0||i.closest("[aria-hidden='true']")))}function Qv(a,i,r){const o=b.useRef(r);o.current=r,b.useLayoutEffect(()=>{if(!i)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,f=a.current;f&&(!(document.activeElement instanceof Node)||!f.contains(document.activeElement))&&f.focus();const h=p=>{var C;if(p.key==="Escape"){if(p.defaultPrevented)return;const k=a.current;if(k){const j=document.querySelectorAll("[data-overlay]"),_=j.item(j.length-1);if(_&&_!==k)return}p.preventDefault(),p.stopImmediatePropagation(),(C=o.current)==null||C.call(o);return}if(p.key!=="Tab"||!a.current)return;const x=document.activeElement;if(x instanceof Element&&x.closest("[data-overlay='popover']"))return;if(a.current.dataset.overlay==="dialog"&&x instanceof Element){const k=x.closest("[data-overlay]");if(k&&k!==a.current)return}const v=_k(a.current);if(v.length===0){p.preventDefault(),a.current.focus();return}const y=v[0],w=v[v.length-1],N=x instanceof Node&&a.current.contains(x);p.shiftKey&&(!N||x===y)?(p.preventDefault(),w==null||w.focus()):!p.shiftKey&&(!N||x===w)&&(p.preventDefault(),y==null||y.focus())};document.addEventListener("keydown",h);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var p;document.removeEventListener("keydown",h),document.body.style.overflow=m,(p=d==null?void 0:d.focus)==null||p.call(d)}},[i,a])}function an({isOpen:a,onClose:i,title:r,children:o,footer:d,maxWidth:f,description:h,className:m}){const{t:p}=He(),x=b.useRef(null),v=b.useId(),y=b.useId();if(Qv(x,a,i),!a)return null;const w={paddingBottom:"max(1rem, env(safe-area-inset-bottom))"};return Qh.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":p("close")}),s.jsxs("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":v,"aria-describedby":h?y: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",m),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:v,className:"min-w-0 text-base font-bold text-text-main md:text-lg",children:r}),s.jsx(Oe,{label:p("close"),icon:s.jsx(Fn,{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:[h&&s.jsx("p",{id:y,className:"mb-3 text-sm text-muted",children:h}),o]}),d&&s.jsx("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-line bg-panel-raised/50 p-4 pb-[max(1rem,env(safe-area-inset-bottom))]",style:w,children:d})]})]}),document.body)}function Rr({isOpen:a,onClose:i,onConfirm:r,title:o,description:d,confirmLabel:f,cancelLabel:h,variant:m="danger",loading:p=!1,children:x,maxWidth:v}){return s.jsx(an,{isOpen:a,onClose:i,title:o,description:d,maxWidth:v,footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:i,disabled:p,children:h}),s.jsx(fe,{variant:m==="danger"?"danger":"primary",onClick:r,loading:p,children:f})]}),children:x})}function Va({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 Es({text:a}){return s.jsx("div",{className:"flex flex-col items-center justify-center gap-2 py-16",children:s.jsx(Va,{className:"size-6",label:a})})}function Vt({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:h}){const{t:m}=He(),p=a==="empty"?m("emptyRecords"):a==="no-results"?m("emptyMatches"):a==="error"?m("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",h),children:[i&&s.jsx("div",{className:"text-muted",children:i}),(r||p)&&s.jsx("p",{className:"text-base font-bold text-text-main",children:r??p}),(o||d)&&s.jsx("p",{className:"max-w-md text-sm text-muted",children:d??o}),f]})}const Ky="(max-width: 639px)";function Tk(){const[a,i]=b.useState(()=>typeof window<"u"?window.matchMedia(Ky).matches:!1);return b.useEffect(()=>{const r=window.matchMedia(Ky),o=()=>i(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),a}function Dk(a,i,r,o){const h=window.innerWidth,m=window.innerHeight;let p=a.bottom+6;p+i.height>m-8&&a.top-i.height-6>=8&&(p=a.top-i.height-6),p=Math.max(8,Math.min(p,m-8-i.height));const x=r==="center"?a.left+a.width/2-i.width/2:r==="start"?o==="rtl"?a.right-i.width:a.left:o==="rtl"?a.left:a.right-i.width,v=Math.max(8,Math.min(x,h-8-i.width));return{top:p,left:v}}function Xv({open:a,defaultOpen:i=!1,onOpenChange:r,trigger:o,children:d,align:f="end",label:h,haspopup:m="dialog",className:p,badge:x}){const{t:v}=He(),[y,w]=b.useState(i),N=a??y,C=b.useCallback(X=>{a===void 0&&w(X),r==null||r(X)},[r,a]),k=Tk(),j=b.useRef(null),_=b.useRef(null),R=b.useId(),[I,q]=b.useState(null),he=b.useRef(C);he.current=C;const B=b.useCallback(()=>{const X=j.current,re=_.current;if(!X||!re)return;const ae=document.documentElement.dir==="rtl"?"rtl":"ltr";q(Dk(X.getBoundingClientRect(),re.getBoundingClientRect(),f,ae))},[f]);b.useLayoutEffect(()=>{if(!N||k)return;B();const X=_.current,re=X?new ResizeObserver(()=>B()):null;return X&&re&&re.observe(X),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{re==null||re.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[N,k,B]),b.useEffect(()=>{if(!N)return;const X=ae=>{var se,U;const de=ae.target;de instanceof Node&&((se=j.current)!=null&&se.contains(de)||(U=_.current)!=null&&U.contains(de)||he.current(!1))},re=ae=>{ae.key==="Escape"&&(ae.preventDefault(),ae.stopPropagation(),he.current(!1))};return document.addEventListener("pointerdown",X,!0),document.addEventListener("keydown",re,!0),()=>{document.removeEventListener("pointerdown",X,!0),document.removeEventListener("keydown",re,!0)}},[N]),Qv(_,N&&k,()=>C(!1));const z=b.isValidElement(o)?o.props:{},T=b.isValidElement(o)?b.cloneElement(o,{onClick:X=>{var re;(re=z.onClick)==null||re.call(z,X),X.defaultPrevented||C(!N)},"aria-expanded":N,"aria-haspopup":m,"aria-controls":R}):o,F=s.jsxs("div",{ref:_,id:R,role:m==="menu"?"presentation":"dialog",...m==="menu"||!h?{}:{"aria-label":h},tabIndex:-1,"data-overlay":"popover",className:Ue("z-[70] border border-line bg-panel-solid text-text-main shadow-2xl outline-none",p,k?"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:k?{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:[k&&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:v("close"),icon:s.jsx(Fn,{size:16}),variant:"ghost",className:"absolute end-0",onClick:()=>C(!1)})]}),d]});return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:j,className:"relative inline-flex",children:[T,x]}),N&&Qh.createPortal(k?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":v("close"),onClick:()=>C(!1)}),F]}):F,document.body)]})}function hl({label:a,resetLabel:i,activeCount:r=0,onReset:o,children:d}){const[f,h]=b.useState(!1),m=r>0?`${a} (${r})`:a;return s.jsxs(Xv,{open:f,onOpenChange:h,align:"end",label:a,haspopup:"dialog",className:"w-[min(20rem,calc(100vw-1rem))] p-3",badge:r>0?s.jsx(nt,{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:m,icon:s.jsx(cj,{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 Rk({label:a,content:i,children:r,className:o}){const[d,f]=b.useState(!1),[h,m]=b.useState(null),p=b.useRef(null),x=b.useRef(null),v=b.useRef(!1),y=b.useId();return b.useLayoutEffect(()=>{if(!d)return;const w=()=>{var I,q;const N=(I=p.current)==null?void 0:I.getBoundingClientRect(),C=(q=x.current)==null?void 0:q.getBoundingClientRect();if(!N||!C)return;const k=8,j=Math.max(k,Math.min(N.left+N.width/2-C.width/2,window.innerWidth-k-C.width)),_=N.top>=C.height+k+6?N.top-C.height-6:N.bottom+6,R=Math.max(k,Math.min(_,window.innerHeight-k-C.height));m({top:R,left:j})};return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,!0)}},[d]),b.useEffect(()=>{if(!d)return;const w=C=>{var k,j;C.target instanceof Node&&!((k=p.current)!=null&&k.contains(C.target))&&!((j=x.current)!=null&&j.contains(C.target))&&f(!1)},N=C=>{C.key==="Escape"&&f(!1)};return document.addEventListener("pointerdown",w),document.addEventListener("keydown",N),()=>{document.removeEventListener("pointerdown",w),document.removeEventListener("keydown",N)}},[d]),s.jsxs(s.Fragment,{children:[s.jsx(Oe,{ref:p,label:a,title:"",icon:r,variant:"ghost",className:o,"aria-describedby":d?y:void 0,onPointerDown:w=>{v.current=w.pointerType==="touch"},onPointerEnter:w=>{w.pointerType==="mouse"&&f(!0)},onPointerLeave:w=>{w.pointerType==="mouse"&&document.activeElement!==p.current&&f(!1)},onFocus:()=>{v.current||f(!0)},onBlur:()=>{v.current=!1,f(!1)},onClick:()=>{v.current&&f(w=>!w)}}),d&&Qh.createPortal(s.jsx("div",{ref:x,id:y,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:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0,visibility:h?"visible":"hidden"},children:i}),document.body)]})}const Xh=b.createContext(()=>{});function Zh({trigger:a,label:i,align:r="end",children:o}){const[d,f]=b.useState(!1);return s.jsx(Xh.Provider,{value:()=>f(!1),children:s.jsx(Xv,{open:d,onOpenChange:f,trigger:a,label:i,align:r,haspopup:"menu",className:"min-w-52 p-1",children:s.jsx(zk,{label:i,children:o})})})}function zk({label:a,children:i}){const r=b.useRef(null),o=b.useContext(Xh);b.useEffect(()=>{var f,h;(h=(f=r.current)==null?void 0:f.querySelector("[role='menuitem']:not([disabled])"))==null||h.focus()},[]);const d=f=>{var x,v,y;const h=[...((x=r.current)==null?void 0:x.querySelectorAll("[role='menuitem']:not([disabled])"))??[]];if(h.length===0)return;const m=h.indexOf(document.activeElement),p=w=>{var N;f.preventDefault(),(N=h[(w+h.length)%h.length])==null||N.focus()};f.key==="ArrowDown"?p(m+1):f.key==="ArrowUp"?p(m<=0?h.length-1:m-1):f.key==="Home"?(f.preventDefault(),(v=h[0])==null||v.focus()):f.key==="End"?(f.preventDefault(),(y=h[h.length-1])==null||y.focus()):f.key==="Escape"&&(f.preventDefault(),o())};return s.jsx("div",{ref:r,role:"menu","aria-label":a,"aria-orientation":"vertical",onKeyDown:d,className:"flex flex-col gap-0.5",children:i})}function lt({icon:a,danger:i=!1,checked:r=!1,onSelect:o,className:d,type:f="button",children:h,onClick:m,...p}){const x=b.useContext(Xh);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:v=>{m==null||m(v),!v.defaultPrevented&&(o==null||o(),f!=="submit"&&x())},...p,children:[a&&s.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:a}),s.jsx("span",{className:"min-w-0 flex-1",children:h}),r&&s.jsx(di,{size:16,className:"shrink-0 text-brand-cyan"})]})}function Cr(){return s.jsx("hr",{className:"my-1 border-0 border-t border-line"})}function Mk({children:a}){return s.jsx("div",{className:"px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-faint",children:a})}function sa({label:a,align:i="end",id:r,children:o}){return s.jsx(Zh,{label:a,align:i,trigger:s.jsx(Oe,{id:r,label:a,icon:s.jsx(lj,{size:18})}),children:o})}function xi({page:a,pageCount:i,total:r,onPageChange:o,label:d,className:f}){const{t:h,direction:m}=He(),p=Math.max(1,i),x=Math.min(Math.max(1,a),p),v=m==="rtl"?s.jsx(bh,{size:18}):s.jsx(Ec,{size:18}),y=m==="rtl"?s.jsx(Ec,{size:18}):s.jsx(bh,{size:18});return s.jsxs("nav",{"aria-label":d??h("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:h("resultCount").replace("{n}",String(r))}),i>1&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Oe,{label:h("previousPage"),icon:v,disabled:x<=1,onClick:()=>o(x-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:h("pageOf").replace("{page}",String(x)).replace("{count}",String(p))}),s.jsx(Oe,{label:h("nextPage"),icon:y,disabled:x>=p,onClick:()=>o(x+1)})]})]})}function qc(a,i=20,r){const o=Math.max(1,Math.floor(i)||20),d=a.length,f=Math.max(1,Math.ceil(d/o)),[h,m]=b.useState({page:1,resetKey:r}),p=Object.is(h.resetKey,r)?Math.min(h.page,f):1;b.useEffect(()=>{(!Object.is(h.resetKey,r)||h.page!==p)&&m({page:p,resetKey:r})},[p,r,h]);const x=v=>{m({page:Math.min(Math.max(1,Math.floor(v)||1),f),resetKey:r})};return{page:p,pageCount:f,pageItems:a.slice((p-1)*o,p*o),setPage:x,total:d}}const al=b.forwardRef(function({className:i,dir:r="ltr",spellCheck:o=!1,autoCapitalize:d="off",autoCorrect:f="off",disabled:h,...m},p){const{t:x}=He(),[v,y]=b.useState(!1),w=b.useRef(null),N=b.useRef(null);return b.useLayoutEffect(()=>{const C=N.current,k=w.current;!C||!k||(k.focus({preventScroll:!0}),k.setSelectionRange(C.start,C.end),N.current=null)}),s.jsxs("span",{dir:r,className:"grid w-full min-w-0 items-center",children:[s.jsx(Xe,{...m,ref:C=>{w.current=C,typeof p=="function"?p(C):p&&(p.current=C)},type:v?"text":"password",dir:r,spellCheck:o,autoCapitalize:d,autoCorrect:f,disabled:h,className:Ue("col-start-1 row-start-1 pe-12 text-start",i)}),s.jsx(Oe,{label:x(v?"hideSecret":"showSecret"),icon:v?s.jsx(rj,{size:18}):s.jsx(zr,{size:18}),pressed:v,variant:"ghost",disabled:h,className:"col-start-1 row-start-1 me-0.5 justify-self-end",onMouseDown:C=>C.preventDefault(),onClick:()=>{const C=w.current;C&&(N.current={start:C.selectionStart??C.value.length,end:C.selectionEnd??C.value.length}),y(k=>!k)}})]})}),dc=new Set;let gr=null;function Ok(a){return dc.add(a),gr===null&&(gr=window.setInterval(()=>{for(const i of dc)i()},3e4)),()=>{dc.delete(a),dc.size===0&&gr!==null&&(window.clearInterval(gr),gr=null)}}function Zv(a){return a==="ar"?"ar":"en"}function Lk(a){const i=a instanceof Date?a.getTime():typeof a=="number"?a:Date.parse(a);return Number.isFinite(i)?i:null}const zf=[{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 Bk(a,i,r){const o=a-i,d=Math.abs(o),f=new Intl.RelativeTimeFormat(Zv(r),{numeric:"auto"}),h=zf.find(p=>d>=p.ms)??zf[zf.length-1],m=Math.round(o/h.ms);return f.format(m,h.unit)}function Dc({value:a,className:i}){const{language:r}=He(),[o,d]=b.useState(()=>Date.now());b.useEffect(()=>Ok(()=>d(Date.now())),[]);const f=Lk(a);if(f===null)return null;const h=Zv(r),m=new Intl.DateTimeFormat(h,{dateStyle:"medium",timeStyle:"short"}).format(f);return s.jsx("time",{dateTime:new Date(f).toISOString(),title:m,className:Ue("whitespace-nowrap",i),children:Bk(f,o,r)})}const Uk=1500;function Jv(a){return a instanceof Error&&a.message?a.message:typeof a=="string"&&a?a:""}function Rc(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 $v(a,i){b.useEffect(()=>{if(a!=="saved")return;const r=window.setTimeout(()=>{i(o=>o==="saved"?"idle":o)},Uk);return()=>window.clearTimeout(r)},[a,i])}function Tn(a){const[i,r]=b.useState(a),[o,d]=b.useState("idle"),[f,h]=b.useState(null),m=b.useRef(a);b.useEffect(()=>{o!=="saving"&&(Rc(a,m.current)||(m.current=a,r(a)))},[a,o]),$v(o,d);const p=!Rc(i,a),x=b.useCallback(async y=>{if(!(!p||o==="saving")){d("saving"),h(null);try{await y(i),d("saved")}catch(w){d("idle"),h(Jv(w)||null)}}},[p,o,i]),v=b.useCallback(()=>{r(a),h(null),d("idle")},[a]);return{value:i,setValue:r,dirty:p,status:o,error:f,save:x,revert:v}}function kh(a){const[i,r]=b.useState(a),[o,d]=b.useState("idle"),[f,h]=b.useState(null),m=b.useRef(a);b.useEffect(()=>{o!=="saving"&&(Rc(a,m.current)||(m.current=a,r(a)))},[a,o]),$v(o,d);const p=!Rc(i,a),x=b.useCallback((w,N)=>{r(C=>({...C,[w]:N}))},[]),v=b.useCallback(async w=>{if(!(!p||o==="saving")){d("saving"),h(null);try{await w(i),d("saved")}catch(N){d("idle"),h(Jv(N)||null)}}},[p,o,i]),y=b.useCallback(()=>{r(a),h(null),d("idle")},[a]);return{draft:i,setDraft:r,setField:x,dirty:p,status:o,error:f,save:v,revert:y}}function Dn({label:a,description:i,error:r,htmlFor:o,className:d,dirty:f,saving:h,justSaved:m,onSave:p,onRevert:x,saveLabel:v,savedLabel:y,actions:w,children:N}){const C=j=>{var R;const _=(R=j.target)==null?void 0:R.tagName;j.key==="Enter"&&_==="INPUT"&&!j.nativeEvent.isComposing&&(j.preventDefault(),f&&!h&&p()),j.key==="Escape"&&(j.preventDefault(),x())},k=b.isValidElement(N)?b.cloneElement(N,{onKeyDown:j=>{var _,R;(R=(_=N.props).onKeyDown)==null||R.call(_,j),C(j)}}):N;return s.jsx(st,{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:k}),w,s.jsx(Oe,{type:"button",label:m?y??v:v,icon:m?s.jsx(di,{size:16}):s.jsx(hi,{size:16}),loading:h,disabled:!f&&!m||h,onClick:()=>{f&&!h&&p()},className:m?"text-ok":void 0})]})})}function Nh({dirty:a,saving:i,justSaved:r,error:o,onDiscard:d,saveLabel:f,discardLabel:h,unsavedLabel:m,savedLabel:p,className:x}){return s.jsxs("div",{className:Ue("flex flex-wrap items-center gap-2",x),children:[s.jsx("div",{className:"min-w-0 flex-1",children:o?s.jsx("p",{role:"alert",className:"text-xs text-danger",children:o}):a?s.jsx("p",{className:"text-xs text-warn",children:m}):r&&p?s.jsx("p",{className:"text-xs text-ok",children:p}):null}),s.jsx(fe,{type:"button",variant:"ghost",disabled:!a||i,onClick:d,children:h}),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(h=>h.value===i))==null?void 0:f.label;return s.jsx(Zh,{label:a,trigger:s.jsx(Oe,{label:d?`${a}: ${d}`:a,icon:s.jsx($w,{size:18})}),children:r.map(h=>s.jsx(lt,{checked:h.value===i,onSelect:()=>o(h.value),children:h.label},h.value))})}function Ns({value:a,onChange:i,options:r,"aria-label":o,className:d}){return s.jsx("div",{role:"tablist","aria-label":o,className:Ue("inline-flex rounded-xl border border-line bg-panel-raised p-1",d),children:r.map(f=>{const h=f.value===a;return s.jsxs("button",{type:"button",role:"tab","aria-selected":h,onClick:()=>i(f.value),className:Ue("inline-flex min-h-10 items-center justify-center gap-1.5 rounded-lg px-3 text-xs font-semibold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50",h?"bg-brand-blue text-white":"text-muted hover:text-text-main"),children:[f.icon,f.label]},f.value)})})}function Pc({value:a,onChange:i,options:r,"aria-label":o,className:d}){const f=b.useRef(null);return b.useEffect(()=>{var h,m;(m=(h=f.current)==null?void 0:h.scrollIntoView)==null||m.call(h,{block:"nearest",inline:"nearest"})},[a]),s.jsx("div",{role:"tablist","aria-label":o,className:Ue("flex items-center gap-1 sm:gap-2",d),children:r.map(h=>{const m=h.value===a,p=!!h.icon&&!m;return s.jsxs("button",{ref:m?f:void 0,type:"button",role:"tab","aria-selected":m,title:p&&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",p?"px-2.5 sm:px-4":"px-4",m?"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(p&&"sr-only sm:not-sr-only"),children:h.label})]},h.value)})})}const ml=b.forwardRef(function({className:i,...r},o){return s.jsx("div",{ref:o,className:Ue("flex flex-wrap items-center gap-2",i),...r})}),Hk={1:"line-clamp-1",2:"line-clamp-2",3:"line-clamp-3"},Kn=b.forwardRef(function({as:i="span",lines:r,title:o,className:d,children:f,dir:h,...m},p){const x={...m,dir:h??"auto",title:o??(r!==void 0&&typeof f=="string"?f:void 0),className:Ue("min-w-0 whitespace-normal break-words",r!==void 0&&Hk[r],d),children:f};return i==="p"?s.jsx("p",{ref:p,...x}):i==="bdi"?s.jsx("bdi",{ref:p,...x}):i==="strong"?s.jsx("strong",{ref:p,...x}):i==="em"?s.jsx("em",{ref:p,...x}):s.jsx("span",{ref:p,...x})}),Wv=b.createContext(null),qk=({children:a})=>{const{t:i}=He(),[r,o]=b.useState([]),d=b.useCallback(h=>{o(m=>m.filter(p=>p.id!==h))},[]),f=b.useCallback((h,m="info",p=4e3)=>{const x=Math.random().toString(36).slice(2,9);o(v=>[...v,{id:x,message:h,type:m,duration:p}]),setTimeout(()=>d(x),p)},[d]);return s.jsxs(Wv.Provider,{value:{toast:f},children:[a,s.jsx("div",{className:"fixed bottom-5 end-5 z-50 flex flex-col gap-2.5 max-w-sm w-full px-4 pointer-events-none","aria-live":"polite",children:r.map(h=>s.jsxs("div",{className:`pointer-events-auto flex items-center gap-3 rounded-xl border bg-panel-raised/95 px-4 py-3 text-xs text-text-main shadow-xl backdrop-blur-md md:text-sm ${h.type==="success"?"border-ok/35":h.type==="error"?"border-danger/35":h.type==="warning"?"border-warn/35":"border-line"}`,children:[h.type==="success"&&s.jsx(js,{size:18,className:"shrink-0 text-ok"}),h.type==="error"&&s.jsx(aj,{size:18,className:"shrink-0 text-danger"}),h.type==="warning"&&s.jsx(ul,{size:18,className:"shrink-0 text-warn"}),h.type==="info"&&s.jsx(fj,{size:18,className:"shrink-0 text-info"}),s.jsx("span",{className:"flex-1 font-medium",children:h.message}),s.jsx(Oe,{variant:"ghost",label:i("dismiss"),icon:s.jsx(Fn,{size:16}),onClick:()=>d(h.id)})]},h.id))})]})},_t=()=>{const a=b.useContext(Wv);if(!a)throw new Error("useToast must be used within a ToastProvider");return a};let Yy=!1;const Pk=()=>{const{t:a}=He(),{toast:i}=_t(),[r,o]=b.useState(!1),[d,f]=b.useState(!1),[h,m]=b.useState(!1);if(b.useEffect(()=>{typeof window>"u"||window.LevixHost||Yy||(Yy=!0,Q.getCrashReports().then(v=>{v!=null&&v.reports&&v.reports.length>0&&o(!0)}).catch(()=>{}))},[]),!r)return null;const p=()=>{o(!1),window.location.hash="settings/diagnostics"},x=async()=>{m(!0);try{await Q.deleteAllCrashReports(),i(a("allReportsDeleted"),"success"),o(!1)}catch(v){i((v==null?void 0:v.message)||"Delete failed","error")}finally{m(!1),f(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-4",children:s.jsx(Ke,{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(ul,{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:p,icon:s.jsx(Tv,{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(Rr,{isOpen:d,onClose:()=>f(!1),onConfirm:x,loading:h,title:a("confirmDeleteAllReports"),description:a("confirmDeleteAllDesc"),confirmLabel:a("deleteAllReports"),cancelLabel:a("cancel"),variant:"danger"})]})};function Ch(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},h=window.LevixHost;if(h&&typeof h.getDiagnostics=="function")try{const m=h.getDiagnostics();if(m){const p=JSON.parse(m);if(p&&typeof p=="object"){const x=["nativeApp","android","device","abi","webview","connectivity","memory","storage"];for(const v of x)typeof p[v]=="string"&&(f[v]=p[v])}}}catch{}return f}const Gk=3,Vk=20;let Qy=0;const Xy=new Set;let Eh=!1;const yc=[];function Ah(){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);yc.push({at:new Date().toISOString(),kind:"nav",name:i}),yc.length>Vk&&yc.shift()}catch{}}if(typeof window<"u")try{window.addEventListener("beforeunload",()=>{Eh=!0}),window.addEventListener("pagehide",()=>{Eh=!0}),Zy(Ah()),window.addEventListener("hashchange",()=>{Zy(Ah())})}catch{}function _h(a,i,r){try{if(Eh||Qy>=Gk)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(`
530
- `).map(p=>p.trim().slice(0,200)).filter(Boolean).slice(0,20));else if(typeof i=="string")d=i;else if(i&&typeof i=="object"){const p=i;typeof p.message=="string"&&(d=p.message),typeof p.name=="string"&&(o=r||p.name),typeof p.stack=="string"&&(f=p.stack.split(`
531
- `).map(x=>x.trim().slice(0,200)).filter(Boolean).slice(0,20))}o=o.slice(0,120),d=d.slice(0,300);const h=`${o}|${d}`;if(Xy.has(h))return;Xy.add(h),Qy++;const m={category:a,error:{type:o,message:d,stack:f},screen:Ah(),breadcrumbs:[...yc],device:Ch()};Q.submitCrashReport(m).catch(()=>{})}catch{}}function Ik(){if(typeof window>"u")return()=>{};const a=r=>{try{_h("web-error",r.error||r.message)}catch{}},i=r=>{try{_h("web-rejection",r.reason)}catch{}};return window.addEventListener("error",a),window.addEventListener("unhandledrejection",i),()=>{window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",i)}}class e1 extends b.Component{constructor(i){super(i),this.state={hasError:!1,error:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,r){try{_h("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(Ke,{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(ul,{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(Ia,{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(Tv,{size:16}),className:"w-full sm:w-auto",children:o("errorBoundaryGoDiagnostics")})]})]})})}return this.props.children}}Ny(e1,"contextType",Fh);const Fk=({onToggleMobileMenu:a,title:i,status:r})=>{const{language:o,setLanguage:d,theme:f,setTheme:h,t:m}=He(),p=()=>{h(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:m("openNavigation"),icon:s.jsx(gj,{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(Zh,{label:m("chooseLanguage"),trigger:s.jsx(Oe,{id:"btn-header-lang",label:m("chooseLanguage"),icon:s.jsx(Ac,{size:18,className:"text-brand-cyan"})}),children:[s.jsx(Mk,{children:m("chooseLanguage")}),s.jsx(lt,{checked:o==="ar",onSelect:()=>d("ar"),children:"العربية"}),s.jsx(lt,{checked:o==="en",onSelect:()=>d("en"),children:"English"})]}),s.jsx(Oe,{id:"btn-header-theme",label:m(f==="dark"?"lightMode":"darkMode"),icon:f==="dark"?s.jsx(Nj,{size:18,className:"text-brand-cyan"}):s.jsx(bj,{size:18,className:"text-brand-cyan"}),onClick:p})]})]})},Kk=({currentView:a,onSelectView:i,isOpenMobile:r,onCloseMobile:o})=>{var p;const{t:d}=He(),f=typeof((p=window.LevixHost)==null?void 0:p.closePanel)=="function",h=window.__BRAND__||{name:"Levix",tagline:"Private control room",version:"",developer:"Abdelrhman Diab",studio:"Leviro",developerSite:"https://github.com/Abdodiab2005",studioSite:"https://leviro.net"},m=[{id:"overview",label:d("overview"),icon:hj},{id:"connection",label:d("connection"),icon:Tr},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:cl},{id:"ai",label:d("ai"),icon:Ph},{id:"groups",label:d("groups"),icon:il},{id:"autodelete",label:d("autoDelete"),icon:xc},{id:"schedules",label:d("schedules"),icon:yh},{id:"stickers",label:d("stickers"),icon:Ih},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:kj},{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(Dj,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-base font-extrabold leading-tight tracking-tight text-text-main",children:h.name}),s.jsx("div",{className:"mt-0.5 truncate text-xs leading-none text-muted",children:h.tagline})]})]}),s.jsx(Oe,{className:"md:hidden",label:d("closeNavigation"),icon:s.jsx(Fn,{size:18}),onClick:o})]}),s.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-3",children:m.map(x=>{if(x.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:x.labelCategory},`cat-${x.labelCategory}`);if(!x.icon||!x.id)return null;const v=x.icon,y=a===x.id;return s.jsx(fe,{variant:y?"primary":"ghost",className:"w-full justify-start",icon:s.jsx(v,{size:20}),onClick:()=>{i(x.id),o()},children:s.jsx("span",{className:"truncate",children:x.label})},x.id)})}),s.jsxs("div",{className:"flex flex-col gap-1 border-t border-line p-3",children:[f&&s.jsx(fe,{variant:"ghost",className:"w-full justify-start",icon:s.jsx(Jw,{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(pj,{size:20,className:"rtl:-scale-x-100"}),children:s.jsx("span",{className:"truncate",children:d("logout")})})})]}),s.jsxs("div",{className:"flex flex-col gap-2.5 border-t border-line p-4 text-xs text-faint",children:[s.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted",children:[s.jsx("span",{className:"font-mono",children:h.version?`v${h.version}`:""}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Vh,{size:14,className:"text-brand-cyan"})," Local-first"]})]}),s.jsxs("div",{className:"truncate text-[11px] text-muted",children:["© ",h.copyrightYear||2026," ",s.jsx("a",{href:h.developerSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:h.developer})," ","(",s.jsx("a",{href:h.studioSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:h.studio}),")"]})]})]})]})},ja=Object.create(null);ja.open="0";ja.close="1";ja.ping="2";ja.pong="3";ja.message="4";ja.upgrade="5";ja.noop="6";const bc=Object.create(null);Object.keys(ja).forEach(a=>{bc[ja[a]]=a});const Th={type:"error",data:"parser error"},t1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",n1=typeof ArrayBuffer=="function",a1=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,Jh=({type:a,data:i},r,o)=>t1&&i instanceof Blob?r?o(i):Jy(i,o):n1&&(i instanceof ArrayBuffer||a1(i))?r?o(i):Jy(new Blob([i]),o):o(ja[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 Mf;function Yk(a,i){if(t1&&a.data instanceof Blob)return a.data.arrayBuffer().then($y).then(i);if(n1&&(a.data instanceof ArrayBuffer||a1(a.data)))return i($y(a.data));Jh(a,!1,r=>{Mf||(Mf=new TextEncoder),i(Mf.encode(r))})}const Wy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<Wy.length;a++)jr[Wy.charCodeAt(a)]=a;const Qk=a=>{let i=a.length*.75,r=a.length,o,d=0,f,h,m,p;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const x=new ArrayBuffer(i),v=new Uint8Array(x);for(o=0;o<r;o+=4)f=jr[a.charCodeAt(o)],h=jr[a.charCodeAt(o+1)],m=jr[a.charCodeAt(o+2)],p=jr[a.charCodeAt(o+3)],v[d++]=f<<2|h>>4,v[d++]=(h&15)<<4|m>>2,v[d++]=(m&3)<<6|p&63;return x},Xk=typeof ArrayBuffer=="function",$h=(a,i)=>{if(typeof a!="string")return{type:"message",data:s1(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:Zk(a.substring(1),i)}:bc[r]?a.length>1?{type:bc[r],data:a.substring(1)}:{type:bc[r]}:Th},Zk=(a,i)=>{if(Xk){const r=Qk(a);return s1(r,i)}else return{base64:!0,data:a}},s1=(a,i)=>{switch(i){case"blob":return a instanceof Blob?a:new Blob([a]);case"arraybuffer":default:return a instanceof ArrayBuffer?a:a.buffer}},l1="",Jk=(a,i)=>{const r=a.length,o=new Array(r);let d=0;a.forEach((f,h)=>{Jh(f,!1,m=>{o[h]=m,++d===r&&i(o.join(l1))})})},$k=(a,i)=>{const r=a.split(l1),o=[];for(let d=0;d<r.length;d++){const f=$h(r[d],i);if(o.push(f),f.type==="error")break}return o};function Wk(){return new TransformStream({transform(a,i){Yk(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 Of;function fc(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 eN(a,i){Of||(Of=new TextDecoder);const r=[];let o=0,d=-1,f=!1;return new TransformStream({transform(h,m){for(r.push(h);;){if(o===0){if(fc(r)<1)break;const p=hc(r,1);f=(p[0]&128)===128,d=p[0]&127,d<126?o=3:d===126?o=1:o=2}else if(o===1){if(fc(r)<2)break;const p=hc(r,2);d=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),o=3}else if(o===2){if(fc(r)<8)break;const p=hc(r,8),x=new DataView(p.buffer,p.byteOffset,p.length),v=x.getUint32(0);if(v>Math.pow(2,21)-1){m.enqueue(Th);break}d=v*Math.pow(2,32)+x.getUint32(4),o=3}else{if(fc(r)<d)break;const p=hc(r,d);m.enqueue($h(f?p:Of.decode(p),i)),o=0}if(d===0||d>a){m.enqueue(Th);break}}}})}const i1=4;function Ut(a){if(a)return tN(a)}function tN(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 Gc=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")(),nN="arraybuffer";function r1(a,...i){return i.reduce((r,o)=>(a.hasOwnProperty(o)&&(r[o]=a[o]),r),{})}const aN=Pn.setTimeout,sN=Pn.clearTimeout;function Vc(a,i){i.useNativeTimers?(a.setTimeoutFn=aN.bind(Pn),a.clearTimeoutFn=sN.bind(Pn)):(a.setTimeoutFn=Pn.setTimeout.bind(Pn),a.clearTimeoutFn=Pn.clearTimeout.bind(Pn))}const lN=1.33;function iN(a){return typeof a=="string"?rN(a):Math.ceil((a.byteLength||a.size)*lN)}function rN(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 o1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function oN(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function cN(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 uN extends Error{constructor(i,r,o){super(i),this.description=r,this.context=o,this.type="TransportError"}}class Wh extends Ut{constructor(i){super(),this.writable=!1,Vc(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 uN(i,r,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=$h(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=oN(i);return r.length?"?"+r:""}}class dN extends Wh{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)};$k(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,Jk(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]=o1()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let c1=!1;try{c1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const fN=c1;function hN(){}class mN extends dN{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||o!==i.port}}doWrite(i,r){const o=this.request({method:"POST",data:i});o.on("success",r),o.on("error",(d,f)=>{this.onError("xhr post error",d,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,o)=>{this.onError("xhr poll error",r,o)}),this.pollXhr=i}}class wa extends Ut{constructor(i,r,o){super(),this.createRequest=i,Vc(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=r1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(r);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let d in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(d)&&o.setRequestHeader(d,this._opts.extraHeaders[d])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var d;o.readyState===3&&((d=this._opts.cookieJar)===null||d===void 0||d.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(d){this.setTimeoutFn(()=>{this._onError(d)},0);return}typeof document<"u"&&(this._index=wa.requestsCount++,wa.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hN,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete wa.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}wa.requestsCount=0;wa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",e0);else if(typeof addEventListener=="function"){const a="onpagehide"in Pn?"pagehide":"unload";addEventListener(a,e0,!1)}}function e0(){for(let a in wa.requests)wa.requests.hasOwnProperty(a)&&wa.requests[a].abort()}const pN=(function(){const a=u1({xdomain:!1});return a&&a.responseType!==null})();class gN extends mN{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=pN&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new wa(u1,this.uri(),i)}}function u1(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||fN))return new XMLHttpRequest}catch{}if(!i)try{return new Pn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const d1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xN extends Wh{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,o=d1?{}:r1(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;Jh(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Gc(()=>{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]=o1()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const Lf=Pn.WebSocket||Pn.MozWebSocket;class yN extends xN{createSocket(i,r,o){return d1?new Lf(i,r,o):r?new Lf(i,r):new Lf(i)}doWrite(i,r){this.ws.send(r)}}class bN extends Wh{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=eN(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(r).getReader(),d=Wk();d.readable.pipeTo(i.writable),this._writer=d.writable.getWriter();const f=()=>{o.read().then(({done:m,value:p})=>{m||(this.onPacket(p),f())}).catch(m=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const o=i[r],d=r===i.length-1;this._writer.write(o).then(()=>{d&&Gc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const vN={websocket:yN,webtransport:bN,polling:gN},SN=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wN=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Dh(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=SN.exec(a||""),f={},h=14;for(;h--;)f[wN[h]]=d[h]||"";return r!=-1&&o!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=jN(f,f.path),f.queryKey=kN(f,f.query),f}function jN(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 kN(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(r[d]=f)}),r}const Rh=typeof addEventListener=="function"&&typeof removeEventListener=="function",vc=[];Rh&&addEventListener("offline",()=>{vc.forEach(a=>a())},!1);class Cs extends Ut{constructor(i,r){if(super(),this.binaryType=nN,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=Dh(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=Dh(r.host).host);Vc(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=cN(this.opts.query)),Rh&&(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"})},vc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=i1,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&&Cs.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",Cs.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+=iN(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,Gc(()=>{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(Cs.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(),Rh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=vc.indexOf(this._offlineEventListener);o!==-1&&vc.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}Cs.protocol=i1;class NN extends Cs{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;Cs.priorWebsocketSuccess=!1;const d=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",y=>{if(!o)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Cs.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(v(),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,v(),r.close(),r=null)}const h=y=>{const w=new Error("probe error: "+y);w.transport=r.name,f(),this.emitReserved("upgradeError",w)};function m(){h("transport closed")}function p(){h("socket closed")}function x(y){r&&y.name!==r.name&&f()}const v=()=>{r.removeListener("open",d),r.removeListener("error",h),r.removeListener("close",m),this.off("close",p),this.off("upgrading",x)};r.once("open",d),r.once("error",h),r.once("close",m),this.once("close",p),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let o=0;o<i.length;o++)~this.transports.indexOf(i[o])&&r.push(i[o]);return r}}let CN=class extends NN{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=>vN[f]).filter(f=>!!f)),super(o?d:i,d)}};function EN(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=Dh(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 AN=typeof ArrayBuffer=="function",_N=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,f1=Object.prototype.toString,TN=typeof Blob=="function"||typeof Blob<"u"&&f1.call(Blob)==="[object BlobConstructor]",DN=typeof File=="function"||typeof File<"u"&&f1.call(File)==="[object FileConstructor]";function em(a){return AN&&(a instanceof ArrayBuffer||_N(a))||TN&&a instanceof Blob||DN&&a instanceof File}function Sc(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,o=a.length;r<o;r++)if(Sc(a[r]))return!0;return!1}if(em(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return Sc(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&Sc(a[r]))return!0;return!1}function RN(a){const i=[],r=a.data,o=a;return o.data=wc(r,i),o.attachments=i.length,{packet:o,buffers:i}}function wc(a,i,r){if(!a)return a;if(em(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]=wc(a[d],i);return o}else if(typeof a=="object"&&!(a instanceof Date)){if(a.toJSON&&typeof a.toJSON=="function"&&!r)return wc(a.toJSON(),i,!0);const o={};for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=wc(a[d],i));return o}return a}function zN(a,i){return a.data=zh(a.data,i),delete a.attachments,a}function zh(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]=zh(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=zh(a[r],i));return a}const MN=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var tt;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(tt||(tt={}));class ON{constructor(i){this.replacer=i}encode(i){return(i.type===tt.EVENT||i.type===tt.ACK)&&Sc(i)?this.encodeAsBinary({type:i.type===tt.EVENT?tt.BINARY_EVENT:tt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===tt.BINARY_EVENT||i.type===tt.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=RN(i),o=this.encodeAsString(r.packet),d=r.buffers;return d.unshift(o),d}}class tm 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===tt.BINARY_EVENT;o||r.type===tt.BINARY_ACK?(r.type=o?tt.EVENT:tt.ACK,this.reconstructor=new LN(r)):super.emitReserved("decoded",r)}else if(em(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const o={type:Number(i.charAt(0))};if(tt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===tt.BINARY_EVENT||o.type===tt.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const h=i.substring(f,r);if(h!=Number(h)||i.charAt(r)!=="-")throw new Error("Illegal attachments");const m=Number(h);if(!BN(m)||m<1)throw new Error("Illegal attachments");if(m>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=m}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););o.nsp=i.substring(f,r)}else o.nsp="/";const d=i.charAt(r+1);if(d!==""&&Number(d)==d){const f=r+1;for(;++r;){const h=i.charAt(r);if(h==null||Number(h)!=h){--r;break}if(r===i.length)break}o.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(tm.isPayloadValid(o.type,f))o.data=f;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.opts.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case tt.CONNECT:return t0(r);case tt.DISCONNECT:return r===void 0;case tt.CONNECT_ERROR:return typeof r=="string"||t0(r);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&MN.indexOf(r[0])===-1);case tt.ACK:case tt.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class LN{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=zN(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const BN=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a};function t0(a){return Object.prototype.toString.call(a)==="[object Object]"}const UN=Object.freeze(Object.defineProperty({__proto__:null,Decoder:tm,Encoder:ON,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function aa(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const HN=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class h1 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=[aa(i,"open",this.onopen.bind(this)),aa(i,"packet",this.onpacket.bind(this)),aa(i,"error",this.onerror.bind(this)),aa(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(HN.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const h={type:tt.EVENT,data:r};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const v=this.ids++,y=r.pop();this._registerAckCallback(v,y),h.id=v}const m=(d=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||d===void 0?void 0:d.writable,p=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(p?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,r){var o;const d=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(d===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);r.call(this,new Error("operation has timed out"))},d),h=(...m)=>{this.io.clearTimeoutFn(f),r.apply(this,m)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...r){return new Promise((o,d)=>{const f=(h,m)=>h?d(h):o(m);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((d,...f)=>(this._queue[0],d!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(d)):(this._queue.shift(),r&&r(null,...f)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:tt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(o=>String(o.id)===i)){const o=this.acks[i];delete this.acks[i],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case tt.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tt.EVENT:case tt.BINARY_EVENT:this.onevent(i);break;case tt.ACK:case tt.BINARY_ACK:this.onack(i);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const o=new Error(i.data.message);o.data=i.data.data,this.emitReserved("connect_error",o);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const o of r)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let o=!1;return function(...d){o||(o=!0,r.packet({type:tt.ACK,id:i,data:d}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let o=0;o<r.length;o++)if(i===r[o])return r.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let o=0;o<r.length;o++)if(i===r[o])return r.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const o of r)o.apply(this,i.data)}}}function yi(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}yi.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};yi.prototype.reset=function(){this.attempts=0};yi.prototype.setMin=function(a){this.ms=a};yi.prototype.setMax=function(a){this.max=a};yi.prototype.setJitter=function(a){this.jitter=a};class Mh 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,Vc(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 yi({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||UN;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 CN(this.uri,this.opts);const r=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const d=aa(r,"open",function(){o.onopen(),i&&i()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),i?i(m):this.maybeReconnectOnOpen()},h=aa(r,"error",f);if(this._timeout!==!1){const m=this._timeout,p=this.setTimeoutFn(()=>{d(),f(new Error("timeout")),r.close()},m);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(d),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(aa(i,"ping",this.onping.bind(this)),aa(i,"data",this.ondata.bind(this)),aa(i,"error",this.onerror.bind(this)),aa(i,"close",this.onclose.bind(this)),aa(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){Gc(()=>{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 h1(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 xr={};function jc(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=EN(a,i.path||"/socket.io"),o=r.source,d=r.id,f=r.path,h=xr[d]&&f in xr[d].nsps,m=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let p;return m?p=new Mh(o,i):(xr[d]||(xr[d]=new Mh(o,i)),p=xr[d]),r.query&&!i.query&&(i.query=r.queryKey),p.socket(r.path,i)}Object.assign(jc,{Manager:Mh,Socket:h1,io:jc,connect:jc});let Bf=null;function n0(){return Bf||(Bf=jc(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),Bf}function qN(a){const[i,r]=b.useState(!1),[o,d]=b.useState(null);return b.useEffect(()=>{const f=n0(),h=()=>r(!0),m=()=>r(!1),p=j=>{d(_=>({..._,...j,state:(j==null?void 0:j.state)||(_==null?void 0:_.state)||"idle"})),a==null||a("session",j)},x=j=>{d(_=>({..._,state:(j==null?void 0:j.state)||(_==null?void 0:_.state)||"idle",status:(j==null?void 0:j.status)||(_==null?void 0:_.status)})),a==null||a("status_update",j)},v=j=>{d(_=>({..._,...j})),a==null||a("status",j)},y=j=>{d(_=>({..._,state:"waiting_for_qr",qr:j})),a==null||a("qr",j)},w=j=>{const _=typeof j=="object"&&j&&"code"in j?String(j.code):String(j||"");d(R=>({...R,state:"waiting_for_qr",pairingCode:_})),a==null||a("pairing_code",_)},N=()=>{d(j=>j?{...j,qr:null}:null),a==null||a("qr_cleared",{})},C=()=>{d(j=>j?{...j,pairingCode:null}:null),a==null||a("pairing_code_cleared",{})},k=(j,..._)=>{a==null||a(j,_[0])};return f.on("connect",h),f.on("disconnect",m),f.on("session",p),f.on("status_update",x),f.on("status",v),f.on("qr",y),f.on("pairing_code",w),f.on("pairing-code",w),f.on("qr_cleared",N),f.on("pairing_code_cleared",C),f.onAny(k),r(f.connected),()=>{f.off("connect",h),f.off("disconnect",m),f.off("session",p),f.off("status_update",x),f.off("status",v),f.off("qr",y),f.off("pairing_code",w),f.off("pairing-code",w),f.off("qr_cleared",N),f.off("pairing_code_cleared",C),f.offAny(k)}},[a]),{isConnected:i,sessionStatus:o,socket:n0()}}const PN=[{key:"text",icon:Ej,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:zr,labelKey:"capVision",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.vision},{key:"audioInput",icon:Tj,labelKey:"capAudio",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.audioInput},{key:"stt",icon:qb,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:_j,labelKey:"capVideo",supportedDescKey:"capSupportedDesc",unsupportedDescKey:"capUnsupportedDesc",getValue:a=>a==null?void 0:a.videoInput}];function GN(a,i){return i==="unknown"||!i||a==null?"unknown":a?"supported":"unsupported"}function VN({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:PN.map(f=>{const h=f.getValue(a),m=GN(h,i),p=f.icon,x=r(m==="supported"?"supported":m==="unsupported"?"unsupported":"sourceUnknown"),v=`${r(f.labelKey)}: ${x}`,y=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:[m==="supported"&&s.jsx(di,{size:13,strokeWidth:2.5,className:"text-ok shrink-0"}),m==="unsupported"&&s.jsx(Fn,{size:13,strokeWidth:2.5,className:"text-danger shrink-0"}),m==="unknown"&&s.jsx("span",{className:"font-mono text-faint shrink-0",children:"?"}),s.jsx("span",{children:v})]}),s.jsx("span",{className:"text-[11px] text-muted",children:r(m==="supported"?f.supportedDescKey:m==="unsupported"?f.unsupportedDescKey:"capUnknownDesc")})]});return s.jsx(Rk,{label:v,content:y,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(p,{size:18,className:m==="supported"?"text-ok":m==="unsupported"?"text-muted/60":"text-muted/40"}),m==="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(di,{size:9,strokeWidth:3})}),m==="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(Fn,{size:9,strokeWidth:3})}),m==="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(nt,{tone:o,children:d})]})}const ll=[{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 IN(a){const i=a.ai_provider||"gemini";return ll.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")))})||ll[0]}const FN=()=>{var Rt,Ya,Ds,Qa,ka;const{t:a,language:i}=He(),{toast:r}=_t(),[o,d]=b.useState({}),[f,h]=b.useState({}),[m,p]=b.useState(!0),[x,v]=b.useState({}),[y,w]=b.useState(!1),[N,C]=b.useState(!1),[k,j]=b.useState(!1),[_,R]=b.useState(""),[I,q]=b.useState(!1),[he,B]=b.useState([]),[z,T]=b.useState(null),[F,X]=b.useState(""),[re,ae]=b.useState(!1),[de,se]=b.useState(!1),[U,D]=b.useState([]),[$,W]=b.useState(null),[ye,O]=b.useState(null),[ie,be]=b.useState(!1),we=IN(o),E=kh({presetId:we.id,apiKey:"",baseUrl:we.baseUrlSetting?String(o[we.baseUrlSetting]||we.defaultBaseUrl):"",model:String(o[we.modelSetting]||we.defaultModel)}),Y=Tn(String(o.ai_stt_provider||"auto")),V=Tn(String(o.bot_language||"auto")),le=ll.find(oe=>oe.id===E.draft.presetId)||we,ee=async()=>{try{const oe=await Q.getSettings();if(oe!=null&&oe.settings){const Re={},et={};oe.settings.forEach(Ct=>{Re[Ct.key]=Ct.value,Ct.type==="secret"&&(et[Ct.key]=!!Ct.configured,Re[Ct.key]="")}),d(Re),h(et)}}catch(oe){r(oe.message,"error")}finally{p(!1)}};b.useEffect(()=>{ee()},[]);const ue=async(oe,Re,et=!1)=>{d(Ct=>({...Ct,[oe]:Re}));try{await Q.updateSetting(oe,Re),et||r(a("savedSuccessfully"),"success")}catch(Ct){r(Ct.message,"error")}},me=async(oe,Re)=>{await Q.updateSetting(oe,Re),oe.endsWith("_api_key")?(d(et=>({...et,[oe]:""})),h(et=>({...et,[oe]:!!Re}))):d(et=>({...et,[oe]:Re}))},ce=oe=>{const Re=ll.find(Ct=>Ct.id===oe);if(!Re)return;const et=ll.find(Ct=>Ct.id===E.draft.presetId)||we;E.setDraft({presetId:Re.id,apiKey:Re.keySetting===et.keySetting?E.draft.apiKey:"",baseUrl:Re.defaultBaseUrl,model:Re.defaultModel})},Se=async(oe=!1,Re=!1)=>{w(!0);const et=String(E.draft.apiKey||"").trim(),Ct=!!f[le.keySetting];try{const fn={provider:le.provider,refresh:oe,cacheOnly:Re};et&&(fn.apiKey=et),le.baseUrlSetting&&E.draft.baseUrl&&(fn.baseUrl=E.draft.baseUrl);const Fe=await Q.fetchAiModels(fn);Fe&&(Fe.success||Fe.fallback)?(v(L=>{var Ce;return{...L,[le.id]:{live:!!Fe.live,requiresApiKey:!!Fe.requiresApiKey,fallback:!!Fe.fallback,models:Fe.models||[],cached:!!Fe.cached,error:Fe.success||(Ce=Fe.error)==null?void 0:Ce.message}}}),!Fe.live&&Fe.requiresApiKey&&oe?r(a("connectKeyFirstPrompt"),"info"):!Fe.success&&Fe.error&&r(Fe.error.message||"Failed to discover models","error")):Fe&&!Fe.success&&Fe.error&&(v(L=>{var Ce;return{...L,[le.id]:{live:!1,requiresApiKey:!(Ct||et),fallback:!0,models:Fe.models||[],error:(Ce=Fe.error)==null?void 0:Ce.message}}}),r(Fe.error.message||"Failed to discover models","error"))}catch(fn){Re||r(fn.message||"Failed to fetch models","error")}finally{w(!1)}};b.useEffect(()=>{m||Se(!1,!0)},[le.id,m]);const qe=((Rt=x[le.id])==null?void 0:Rt.models)||[],it=!!((Ya=x[le.id])!=null&&Ya.live),mt=!!(((Ds=x[le.id])==null?void 0:Ds.requiresApiKey)??!f[le.keySetting]),wt=o[we.modelSetting]||we.defaultModel,Le=E.draft.model||le.defaultModel,xe=oe=>qe.find(Re=>Re.id.toLowerCase()===oe.toLowerCase())||{id:oe,displayName:oe,provider:le.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(wt),Pe=!!Ne.capabilities.vision,vt=!!Ne.capabilities.stt,ne=Ne.capabilitySource==="provider"||Ne.capabilitySource==="seed",te=o.ai_auto_detect_capabilities!==!1,ve=ne&&te&&!Pe,Te=ne&&te&&!vt;b.useEffect(()=>{m||(ve&&o.ai_vision_enabled&&ue("ai_vision_enabled",!1,!0),Te&&o.ai_stt_enabled&&ue("ai_stt_enabled",!1,!0))},[wt,ve,Te,m]);const jt=async()=>{j(!0),q(!0);try{const oe=await Q.getPersona(),Re=oe==null?void 0:oe.persona;R(typeof Re=="string"?Re:(Re==null?void 0:Re.body)||"")}catch(oe){r(oe.message,"error")}finally{q(!1)}},Xt=async()=>{try{await Q.updatePersona(_),r(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),j(!1)}catch(oe){r(oe.message,"error")}},Tt=async()=>{try{const oe=await Q.getMemoryFiles(),Re=((oe==null?void 0:oe.scopes)||[]).map(et=>({scope:et.scope,label:et.label,entries:et.entries??0}));B(Re.some(et=>et.scope==="global")?Re:[{scope:"global",label:"Global memory",entries:0},...Re])}catch(oe){B([{scope:"global",label:"Global memory",entries:0}]),r(oe.message,"error")}},sn=async oe=>{T(oe),X(""),ae(!0);try{const Re=await Q.getMemoryFile(oe);X((Re==null?void 0:Re.content)||"")}catch(Re){r(Re.message,"error")}finally{ae(!1)}},Ht=async()=>{T("global"),ae(!0),await Tt();try{const oe=await Q.getMemoryFile("global");X((oe==null?void 0:oe.content)||"")}catch(oe){r(oe.message,"error")}finally{ae(!1)}},bi=async()=>{if(z)try{await Q.updateMemoryFile(z,F),r(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),Tt(),T(null)}catch(oe){r(oe.message,"error")}},xl=async()=>{se(!0),W(null),O(null),be(!0);try{const oe=await Q.getAiConversations();D((oe==null?void 0:oe.conversations)||[])}catch(oe){r(oe.message,"error")}finally{be(!1)}},Fa=async oe=>{W(oe),O(null),be(!0);try{const Re=await Q.getAiConversation(oe);O(Re||null)}catch(Re){r(Re.message,"error")}finally{be(!1)}},Ts=oe=>oe?new Date(oe).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—",Ka={saveLabel:a("save"),savedLabel:a("saved")},vi={saveLabel:a("save"),discardLabel:a("discard"),unsavedLabel:a("unsavedChanges"),savedLabel:a("saved")};if(m)return s.jsx(Es,{text:a("starting")});const yl=!!o.ai_agent;return s.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[s.jsx(fl,{icon:s.jsx(Ph,{size:20}),title:a("aiTitle"),description:a("aiSubtitle")}),s.jsx(Ke,{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(yl?"toggleOn":"toggleOff")}),s.jsx(bn,{checked:yl,onChange:oe=>ue("ai_agent",oe),"aria-label":a("aiAgentEnabled")})]})]})}),s.jsxs(Ke,{className:"flex flex-col gap-3",children:[s.jsx(na,{icon:s.jsx(fv,{size:18}),title:a("aiProvider")}),s.jsx(Ns,{"aria-label":a("aiProvider"),value:E.draft.presetId,onChange:oe=>ce(oe),options:ll.map(oe=>({value:oe.id,label:oe.name})),className:"flex w-full flex-wrap gap-1 p-1 [&>*]:min-w-[110px] [&>*]:flex-1"}),s.jsx("p",{className:"text-xs text-muted",children:a(le.descKey)}),mt&&s.jsx("p",{className:"text-xs text-warn",children:a("connectKeyFirstPrompt")}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:oe=>{oe.preventDefault(),E.save(async Re=>{const et=ll.find(Ct=>Ct.id===Re.presetId)||le;await me("ai_provider",et.provider),et.baseUrlSetting&&await me(et.baseUrlSetting,Re.baseUrl),await me(et.modelSetting,Re.model),Re.apiKey.trim()&&await me(et.keySetting,Re.apiKey.trim()),E.setDraft({...Re,apiKey:""})})},onKeyDown:oe=>{oe.key==="Escape"&&E.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[s.jsx(st,{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[le.keySetting]&&s.jsxs(nt,{tone:"ok",children:[s.jsx(js,{size:11}),a("saved")]})]}),children:s.jsx(al,{id:"input-api-key",className:"font-mono",value:E.draft.apiKey,onChange:oe=>E.setField("apiKey",oe.target.value),placeholder:f[le.keySetting]?"••••••••••••":a("enterApiKey")})}),le.baseUrlSetting&&s.jsx(st,{className:"min-w-0",label:a("baseUrl"),htmlFor:"input-base-url",children:s.jsx(Xe,{id:"input-base-url",technical:!0,className:"font-mono",value:E.draft.baseUrl,onChange:oe=>E.setField("baseUrl",oe.target.value),placeholder:le.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(nt,{tone:it?"ok":"info",children:a(it?"sourceLive":"sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fe,{type:"button",variant:"ghost",size:"sm",onClick:()=>C(!N),children:a(N?"modelListToggle":"modelCustomToggle")}),s.jsx(Oe,{type:"button",variant:"ghost",label:a("refreshModels"),icon:s.jsx(Ia,{size:16}),onClick:()=>Se(!0),loading:y})]})]}),((Qa=x[le.id])==null?void 0:Qa.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(sl,{size:15,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 break-words",children:(ka=x[le.id])==null?void 0:ka.error})]}),s.jsx(fe,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Ia,{size:14}),onClick:()=>Se(!0),loading:y,children:a("retry")})]}),y?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(Va,{label:a("fetchingModels")})}):N?s.jsx(Xe,{id:"input-model-name",technical:!0,className:"font-mono",value:E.draft.model,onChange:oe=>E.setField("model",oe.target.value),placeholder:le.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(mt?"connectKeyFirstPrompt":"noModelsFound")}),s.jsx(fe,{type:"button",variant:"ghost",size:"sm",icon:s.jsx(Ia,{size:14}),onClick:()=>Se(!0),loading:y,children:a("retry")})]}):s.jsxs(Qt,{id:"input-model-name",dir:"ltr",className:"font-mono text-start",value:Le,onChange:oe=>E.setField("model",oe.target.value),children:[s.jsx("optgroup",{label:a(it?"modelsAvailableLive":"modelsRecommendedSeed"),children:qe.map(oe=>s.jsxs("option",{value:oe.id,dir:"ltr",children:[oe.displayName&&oe.displayName!==oe.id?oe.displayName:oe.id,oe.recommended?" ★":""]},oe.id))}),!qe.some(oe=>oe.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(Nh,{dirty:E.dirty,saving:E.status==="saving",justSaved:E.status==="saved",error:E.error,onDiscard:E.revert,...vi})]}),s.jsx(VN,{capabilities:ze.capabilities,capabilitySource:ze.capabilitySource})]}),s.jsxs(Ke,{className:"flex flex-col gap-3",children:[s.jsx(na,{title:a("capabilities")}),s.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.jsxs("div",{className:"py-2",children:[s.jsx(bn,{checked:ve?!1:!!o.ai_vision_enabled,disabled:ve,onChange:oe=>{ve||ue("ai_vision_enabled",oe)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(zr,{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(ul,{size:13,className:"shrink-0"}),s.jsx("span",{children:a("visionUnsupportedNotice")})]})]}),s.jsxs("div",{className:"py-2",children:[s.jsx(bn,{checked:Te?!1:!!(o.ai_stt_enabled??!0),disabled:Te,onChange:oe=>{Te||ue("ai_stt_enabled",oe)},label:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(qb,{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(ul,{size:13,className:"shrink-0"}),s.jsx("span",{children:a("sttUnsupportedNotice")})]})]}),s.jsx("div",{className:"py-2",children:s.jsx(Dn,{label:a("aiStt"),description:a("sttDesc"),htmlFor:"ai-stt-provider",dirty:Y.dirty,saving:Y.status==="saving",justSaved:Y.status==="saved",error:Y.error,onSave:()=>Y.save(oe=>me("ai_stt_provider",oe)),onRevert:Y.revert,...Ka,children:s.jsxs(Qt,{id:"ai-stt-provider","aria-label":a("aiStt"),value:Y.value,disabled:Te,onChange:oe=>Y.setValue(oe.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(Dn,{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(oe=>me("bot_language",oe)),onRevert:V.revert,...Ka,children:s.jsxs(Qt,{id:"ai-bot-language","aria-label":a("botLanguage"),value:V.value,onChange:oe=>V.setValue(oe.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(Ke,{className:"flex flex-wrap gap-2",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(sj,{size:16}),onClick:Ht,title:a("memoryDesc"),children:a("manageMemory")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(jj,{size:16}),onClick:xl,title:a("aiInspectorDesc"),children:a("openInspector")})]}),s.jsx(an,{isOpen:k,onClose:()=>j(!1),title:a("personaPrompt"),maxWidth:"750px",footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>j(!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(Va,{className:"size-6",label:a("starting")})}):s.jsx(Tc,{className:"font-mono",rows:12,value:_,onChange:oe=>R(oe.target.value)})}),s.jsx(an,{isOpen:!!z,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:bi,disabled:re,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:he.length===0?s.jsx(ut,{kind:"empty",text:a("noMemoryFiles"),className:"py-6"}):he.map(oe=>{const Re=oe.scope==="global",et=z===oe.scope;return s.jsxs(fe,{variant:et?"primary":"secondary","aria-pressed":et,onClick:()=>sn(oe.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(Ac,{size:14,className:"shrink-0"}):s.jsx(gc,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:Re?a("memoryGlobalScope"):oe.scope})]}),s.jsxs("span",{className:"block text-start text-[10px] opacity-80",children:[a(Re?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",a("memoryEntriesCount").replace("{n}",String(oe.entries))]})]},oe.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")}),re?s.jsx("div",{className:"flex min-h-[340px] items-center justify-center",children:s.jsx(Va,{className:"size-6",label:a("starting")})}):s.jsx(Tc,{className:"min-h-[340px] flex-1 font-mono",rows:12,value:F,onChange:oe=>X(oe.target.value),placeholder:a("memoryEditorPlaceholder")})]})]})}),s.jsx(an,{isOpen:de,onClose:()=>se(!1),title:a("aiInspector"),maxWidth:"750px",footer:s.jsx(fe,{variant:"secondary",onClick:()=>se(!1),children:a("cancel")}),children:ie?s.jsx("div",{className:"flex min-h-[280px] items-center justify-center",children:s.jsx(Va,{className:"size-6",label:a("starting")})}):$?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(Ec,{size:16,className:"rtl:rotate-180"}),onClick:()=>W(null),children:a("backToList")}),s.jsx("span",{className:"truncate font-mono text-[10px] text-muted",dir:"ltr",children:$})]}),(ye==null?void 0:ye.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:[(ye==null?void 0:ye.messages.length)===0&&s.jsx(ut,{kind:"empty",text:a("noConversations"),className:"py-6"}),ye==null?void 0:ye.messages.map((oe,Re)=>s.jsxs("div",{className:`rounded-xl border p-2.5 text-xs ${oe.kind==="tool"||oe.kind==="toolResult"?"border-line bg-panel font-mono text-muted":oe.role==="model"?"border-brand-blue/25 bg-brand-blue/10 text-text-main":"border-line bg-panel-raised text-text-main"}`,children:[oe.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:oe.text}),oe.kind==="media"&&s.jsxs("span",{children:["📎 ",oe.mimeType||a("convMedia")]}),oe.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",oe.name]}),oe.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",oe.name]})]},Re))]})]}):U.length===0?s.jsx(ut,{kind:"empty",icon:s.jsx(gc,{size:20}),text:a("noConversations"),className:"py-8"}):s.jsx("div",{className:"flex flex-col gap-1.5",children:U.map(oe=>s.jsxs(fe,{variant:"secondary",onClick:()=>Fa(oe.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(gc,{size:14,className:"shrink-0 text-brand-blue"}),s.jsx("span",{className:"truncate font-mono",dir:"ltr",children:oe.chatId})]}),s.jsxs("span",{className:"block text-start text-[10px] text-muted",children:[a("convTurns").replace("{n}",String(oe.turns))," ·"," ",Ts(oe.updatedAt)]})]},oe.chatId))})})]})},Gn={rules:100,keywords:50,keywordChars:100,nameChars:60,senders:200,phoneMin:8,phoneMax:15},KN=/[\u064B-\u065F\u0670\u0640]/g,YN=/[\u0622\u0623\u0625\u0671]/g,QN=/\u0649/g,Uf={enabled:"any",chatScope:"any",senders:"any"};function Oh(a){let i=String(a??"");return i=i.normalize("NFKC"),i=i.replace(KN,""),i=i.replace(YN,"ا"),i=i.replace(QN,"ي"),i=i.toLowerCase(),i=i.replace(/\s+/g," ").trim(),i}function XN(a){const i=String(a??"").normalize("NFC").replace(/\s+/g," ").trim();return i?i.length>Gn.keywordChars?{error:"long"}:Oh(i)?{value:i}:{error:"empty"}:{error:"empty"}}class ci extends Error{constructor(i){super(i),this.reason=i,this.name="SenderInputError"}}function ZN(a){var d;const i=String(a??"").trim();if(!i)throw new ci("invalid");const r=i.toLowerCase();if(r.endsWith("@g.us")||r.endsWith("@broadcast")||r.endsWith("@newsletter"))throw new ci("group");if(i.includes("@")){if(r.includes("@lid")){const f=(d=i.split("@")[0])==null?void 0:d.split(":")[0];if(!f)throw new ci("invalid");return`${f}@lid`}if(i.includes(":")){const f=i.split(":")[0],h=i.split("@")[1];if(!f||!h)throw new ci("invalid");return`${f}@${h}`}return i}const o=i.replace(/\D/g,"");if(o.length>=Gn.phoneMin&&o.length<=Gn.phoneMax)return`${o}@s.whatsapp.net`;throw new ci("invalid")}function pi(a){var r;const i=(r=a.name)==null?void 0:r.trim();return i||a.keywords[0]||""}function zc(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 Lh(a,i){return a&&(i!=null&&i.has(a))?"auto":"ltr"}function JN(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 $N(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 WN(a,i,r){const o=Oh(i);return!(o&&!Oh(`${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 eC(a,i,r){const o=[...a],d=(f,h)=>pi(f).localeCompare(pi(h),r,{sensitivity:"base"});return i==="name"?o.sort(d):i==="deleted"?o.sort((f,h)=>h.deletedCount-f.deletedCount||d(f,h)):i==="last"?o.sort((f,h)=>(h.lastDeletedAt??-1)-(f.lastDeletedAt??-1)||d(f,h)):o.sort((f,h)=>h.createdAt-f.createdAt||h.id-f.id),o}function tC(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 Hf=20;function a0(a,i){return a instanceof Bt&&a.message?a.message:i}const nC=({rules:a,names:i,ruleId:r,onRuleIdChange:o})=>{const{t:d}=He(),{toast:f}=_t(),[h,m]=b.useState([]),[p,x]=b.useState(0),[v,y]=b.useState(1),[w,N]=b.useState(!0),[C,k]=b.useState(null),[j,_]=b.useState(0),[R,I]=b.useState(null),[q,he]=b.useState(!1),B=b.useRef(0),z=`${r}|${j}`,[T,F]=b.useState(z);T!==z&&(F(z),y(1)),b.useEffect(()=>{const U=++B.current;N(!0),k(null),Q.listAutoDeleteLog({ruleId:r||void 0,limit:Hf,offset:(v-1)*Hf}).then(D=>{B.current===U&&(m(D.log),x(D.total))}).catch(D=>{if(B.current!==U)return;const $=a0(D,d("copiesLoadFailed"));k($),f($,"error")}).finally(()=>{B.current===U&&N(!1)})},[r,j,v,d,f]);const X=async()=>{he(!0);try{await Q.clearAutoDeleteLog(R==="rule"?r:void 0),f(d("copiesCleared"),"success"),I(null),_(U=>U+1)}catch(U){f(a0(U,d("copiesLoadFailed")),"error")}finally{he(!1)}},re=b.useCallback(U=>{if(!U)return d("mediaText");const $={image:"mediaImage",video:"mediaVideo",audio:"mediaAudio",sticker:"mediaSticker",document:"mediaDocument"}[U];return $?d($):U},[d]),ae=a.find(U=>String(U.id)===r),de=Math.max(1,Math.ceil(p/Hf)),se=Math.min(v,de);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(ml,{children:[s.jsx(hl,{label:d("filter"),resetLabel:d("reset"),activeCount:r?1:0,onReset:()=>o(""),children:s.jsx(st,{label:d("filterByRule"),children:s.jsxs(Qt,{"aria-label":d("filterByRule"),value:r,onChange:U=>o(U.target.value),children:[s.jsx("option",{value:"",children:d("allRules")}),a.map(U=>s.jsx("option",{value:String(U.id),children:pi(U)},U.id))]})})}),s.jsx("span",{className:"ms-auto",children:s.jsxs(sa,{label:d("more"),children:[r&&s.jsx(lt,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>I("rule"),children:d("clearCopiesForRule")}),s.jsx(lt,{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(U=>s.jsxs(Ke,{className:"flex flex-col gap-3",children:[s.jsx(Vt,{className:"h-4 w-40"}),s.jsx(Vt,{className:"h-12 w-full"}),s.jsx(Vt,{className:"h-5 w-24"})]},U))}),!w&&C&&s.jsx(ut,{kind:"error",icon:s.jsx(ol,{size:28}),description:C,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(ol,{size:16}),onClick:()=>_(U=>U+1),children:d("retryLoad")})}),!w&&!C&&h.length===0&&r&&s.jsx(ut,{kind:"no-results",description:d("noCopiesForRule"),action:s.jsx(fe,{variant:"secondary",onClick:()=>o(""),children:d("clearFilters")})}),!w&&!C&&h.length===0&&!r&&s.jsx(ut,{kind:"empty",title:d("noCopiesTitle"),description:d("noCopiesBody")}),!w&&!C&&h.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col gap-3",children:h.map(U=>{const D=zc(U.chatJid,i)||"—",$=zc(U.sender,i)||"—",W=U.mode==="revoke"?d("modeRevoke"):U.mode==="deleteForMe"?d("modeForMe"):U.mode;return s.jsxs(Ke,{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:Lh(U.chatJid,i),className:"truncate text-sm font-semibold",children:D})]}),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:Lh(U.sender,i),className:"truncate text-sm",children:$})]}),s.jsx(Dc,{value:U.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:U.text||"—"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(nt,{children:re(U.mediaType)}),s.jsx(nt,{tone:U.mode==="revoke"?"info":"neutral",children:W})]})]},U.id)})}),s.jsx(xi,{page:se,pageCount:de,total:p,onPageChange:y})]}),s.jsx(Rr,{isOpen:R!==null,onClose:()=>I(null),onConfirm:()=>void X(),title:d("clearCopiesTitle"),description:R==="rule"?rn(d("clearCopiesRuleBody"),{name:ae?pi(ae):""}):d("clearCopiesBody"),confirmLabel:d("clearCopies"),cancelLabel:d("cancel"),loading:q})]})},aC={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 m1(a){return a?aC[a]??null:null}function nm(a,i){const r=m1(i);return a(r||"stickerErr_INTERNAL")}function St(a,i){return i instanceof Bt?nm(a,i.code):a("stickerErr_INTERNAL")}function sC(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 am=({open:a,busy:i=!1,onClose:r,onPick:o,title:d,includeGroups:f=!0,selectedIds:h,emptyText:m})=>{const{t:p}=He(),[x,v]=b.useState([]),[y,w]=b.useState(""),[N,C]=b.useState(!1),[k,j]=b.useState(null);b.useEffect(()=>{if(!a)return;let R=!1;return C(!0),j(null),Q.getRecipients().then(I=>{R||v(I.recipients)}).catch(I=>{R||(I instanceof Bt&&!m1(I.code)?j(I.message||p("recipientsLoadFailed")):j(St(p,I)))}).finally(()=>{R||C(!1)}),()=>{R=!0}},[a,p]);const _=b.useMemo(()=>{const R=f?x:x.filter(q=>q.type==="contact"),I=y.trim().toLowerCase();return I?R.filter(q=>q.name.toLowerCase().includes(I)||(q.phone||"").toLowerCase().includes(I)):R},[f,x,y]);return s.jsx(an,{isOpen:a,onClose:r,title:d??p("sendViaWhatsapp"),footer:s.jsx(fe,{onClick:r,disabled:i,children:p("cancel")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Gh,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Xe,{type:"search",value:y,onChange:R=>w(R.target.value),placeholder:p("searchRecipients"),"aria-label":p("searchRecipients"),className:"ps-9"})]}),N&&s.jsx(Es,{text:p("loading")}),k&&s.jsx("p",{className:"text-sm text-danger",role:"alert",children:k}),!N&&!k&&_.length===0&&s.jsx("p",{className:"text-sm text-muted",children:m??p("noRecipients")}),s.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto",children:_.map(R=>{const I=(h==null?void 0:h.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(nt,{tone:"info",children:p("contactAdded")})]}),s.jsxs("span",{className:"block w-full text-[11px] font-medium text-muted",children:[R.type==="group"?p("recipientGroup"):p("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:p("sending")})]})})},lC=["contains","word","exact"],iC=["all","groups","private"],rC=({open:a,rule:i,names:r,onClose:o,onSaved:d})=>{const{t:f}=He(),h=b.useRef(i);h.current=i;const m=(i==null?void 0:i.id)??null,[p,x]=b.useState(""),[v,y]=b.useState([]),[w,N]=b.useState("contains"),[C,k]=b.useState("all"),[j,_]=b.useState("everyone"),[R,I]=b.useState([]),[q,he]=b.useState(!1),[B,z]=b.useState(!0),[T,F]=b.useState(!1),[X,re]=b.useState(""),[ae,de]=b.useState(!1),[se,U]=b.useState(!1),[D,$]=b.useState(null),[W,ye]=b.useState(null),[O,ie]=b.useState(null),[be,we]=b.useState(null);b.useEffect(()=>{if(!a)return;const ee=h.current;((ee==null?void 0:ee.id)??null)===m&&(x((ee==null?void 0:ee.name)??""),y((ee==null?void 0:ee.keywords)??[]),N((ee==null?void 0:ee.match)??"contains"),k((ee==null?void 0:ee.chatScope)??"all"),_((ee==null?void 0:ee.senders.mode)??"everyone"),I((ee==null?void 0:ee.senders.list)??[]),he((ee==null?void 0:ee.includeOwn)??!1),z((ee==null?void 0:ee.forEveryone)??!0),F((ee==null?void 0:ee.keepCopy)??!1),re(""),de(!1),U(!1),$(null),ye(null),ie(null),we(null))},[a,m]);const E=f(w==="word"?"matchWordHint":w==="exact"?"matchExactHint":"matchContainsHint"),Y=ee=>{ie(ee==="long"?f("keywordTooLong"):ee==="max"?f("keywordsMax"):ee==="empty"?f("keywordEmpty"):ee==="duplicate"?f("keywordDuplicate"):null)},V=ee=>{try{const ue=ZN(ee);if(R.includes(ue)){re(""),we(null);return}if(R.length>=Gn.senders){we(f("tooManySenders"));return}I(me=>me.includes(ue)?me:[...me,ue]),re(""),we(null)}catch(ue){we(ue instanceof ci&&ue.reason==="group"?f("groupSenderRejected"):f("invalidPhone"))}},le=async ee=>{var ce;ee.preventDefault();const ue={name:p,keywords:v,match:w,chatScope:C,sendersMode:j,senders:R,includeOwn:q,forEveryone:B,keepCopy:T},me=JN(ue);if(ye(me.name?f("nameTooLong"):null),ie(me.keywords==="required"?f("keywordsRequired"):me.keywords==="max"?f("keywordsMax"):null),we(me.senders==="required"?f("sendersRequired"):me.senders==="max"?f("tooManySenders"):null),!(me.name||me.keywords||me.senders)){U(!0),$(null);try{const Se=$N(ue,(ce=h.current)==null?void 0:ce.enabled),qe=h.current?await Q.updateAutoDeleteRule(h.current.id,Se):await Q.createAutoDeleteRule(Se);d(qe.rule)}catch(Se){const qe=Se instanceof Bt&&Se.message?Se.message:f("ruleSaveFailed");$(qe)}finally{U(!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:se,children:f("cancel")}),s.jsx(fe,{variant:"primary",type:"submit",form:"auto-delete-rule-form",loading:se,children:f("saveRule")})]}),children:s.jsxs("form",{id:"auto-delete-rule-form",className:"flex flex-col gap-4",onSubmit:ee=>void le(ee),children:[D&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:D}),s.jsx(st,{label:f("ruleName"),htmlFor:"ad-rule-name",error:W,children:s.jsx(Xe,{id:"ad-rule-name",name:"rule-name",dir:"auto",value:p,"aria-invalid":W?!0:void 0,placeholder:f("ruleNamePlaceholder"),onChange:ee=>{x(ee.target.value),W&&ee.target.value.trim().length<=Gn.nameChars&&ye(null)},onBlur:()=>{p.trim().length>Gn.nameChars&&ye(f("nameTooLong"))}})}),s.jsx(st,{label:f("keywordsLabel"),error:O,children:s.jsx(Ek,{id:"ad-keywords",value:v,onChange:y,max:Gn.keywords,prepare:XN,onReject:Y,removeLabel:ee=>rn(f("removeKeyword"),{word:ee}),countLabel:rn(f("keywordCount"),{n:v.length,max:Gn.keywords}),placeholder:f("keywordsPlaceholder"),"aria-label":f("keywordsLabel"),"aria-invalid":O?!0:void 0,disabled:se})}),s.jsx(st,{label:f("matchMode"),description:E,children:s.jsx(Ns,{"aria-label":f("matchMode"),className:"flex w-full flex-wrap",value:w,onChange:N,options:lC.map(ee=>({value:ee,label:f(ee==="contains"?"matchContains":ee==="word"?"matchWord":"matchExact")}))})}),s.jsx(st,{label:f("chatScopeLabel"),children:s.jsx(Ns,{"aria-label":f("chatScopeLabel"),className:"flex w-full flex-wrap",value:C,onChange:k,options:iC.map(ee=>({value:ee,label:f(ee==="all"?"chatsAll":ee==="groups"?"chatsGroups":"chatsPrivate")}))})}),s.jsxs(st,{label:f("filterSender"),error:j==="selected"?be:null,children:[s.jsx(Ns,{"aria-label":f("filterSender"),className:"flex w-full flex-wrap",value:j,onChange:_,options:[{value:"everyone",label:f("sendersEveryone")},{value:"selected",label:f("sendersSelected")}]}),j==="selected"&&s.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:f("sendersHelp")}),R.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:R.map(ee=>s.jsx(Hc,{dir:Lh(ee,r),removeLabel:rn(f("removeContact"),{name:zc(ee,r)}),onRemove:()=>I(ue=>ue.filter(me=>me!==ee)),children:zc(ee,r)},ee))}),s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[s.jsx(Xe,{type:"tel",inputMode:"tel",name:"phone",autoComplete:"tel",dir:"ltr",value:X,placeholder:f("phonePlaceholder"),"aria-label":f("phonePlaceholder"),className:"min-w-0 flex-1",onChange:ee=>re(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),V(X))}}),s.jsx(fe,{type:"button",variant:"secondary",onClick:()=>V(X),children:f("addPhone")})]}),s.jsx(fe,{type:"button",variant:"secondary",onClick:()=>de(!0),children:f("selectContacts")})]})]}),s.jsx(bn,{checked:q,onChange:he,label:f("includeOwn"),description:f("includeOwnHint")}),s.jsx(bn,{checked:B,onChange:z,label:f("forEveryone"),description:f("forEveryoneHint")}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(bn,{checked:T,onChange:F,label:f("keepCopy"),description:f("keepCopyHint")}),s.jsx("p",{className:"text-xs text-faint",children:f("keepCopyPrivacy")})]})]})}),s.jsx(am,{open:ae,onClose:()=>de(!1),title:f("selectContacts"),includeGroups:!1,selectedIds:R,emptyText:f("noContacts"),onPick:ee=>V(ee)})]})},s0=4,oC={contains:"matchContains",word:"matchWord",exact:"matchExact"};function yr(a,i){return a instanceof Bt&&a.message?a.message:i}const cC=()=>{const{t:a,language:i}=He(),{toast:r}=_t(),[o,d]=b.useState("rules"),[f,h]=b.useState([]),[m,p]=b.useState(()=>new Map),[x,v]=b.useState(!0),[y,w]=b.useState(null),[N,C]=b.useState(0),[k,j]=b.useState(""),[_,R]=b.useState("newest"),[I,q]=b.useState(Uf),[he,B]=b.useState(!1),[z,T]=b.useState(null),[F,X]=b.useState(null),[re,ae]=b.useState(!1),[de,se]=b.useState(""),U=b.useRef(new Set),D=b.useRef(new Map),$=b.useRef(0),W=b.useRef(!0),ye=b.useRef(0),O=b.useMemo(()=>new Intl.NumberFormat(i),[i]),ie=b.useCallback(xe=>{h(ze=>xe.map(Ne=>{if(!U.current.has(Ne.id))return Ne;const Pe=ze.find(vt=>vt.id===Ne.id);return Pe?{...Ne,enabled:Pe.enabled}:Ne}))},[]);b.useEffect(()=>{const xe=++$.current;return v(!0),Q.listAutoDeleteRules().then(ze=>{!W.current||$.current!==xe||(ie(ze.rules),w(null))}).catch(ze=>{if(!W.current||$.current!==xe)return;const Ne=yr(ze,a("rulesLoadFailed"));w(Ne),r(Ne,"error")}).finally(()=>{W.current&&$.current===xe&&v(!1)}),()=>{$.current+=1}},[N,a,r,ie]),b.useEffect(()=>(W.current=!0,()=>{W.current=!1}),[]);const be=b.useCallback(async()=>{const xe=++$.current,ze=ye.current;try{const Ne=await Q.listAutoDeleteRules();if(!W.current||$.current!==xe||ye.current!==ze)return;ie(Ne.rules),w(null)}catch{}},[ie]);b.useEffect(()=>{if(x)return;const xe=()=>{document.visibilityState!=="hidden"&&be()};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)}},[x,be]),b.useEffect(()=>{let xe=!1;return Q.getRecipients().then(ze=>{if(xe)return;const Ne=new Map;for(const Pe of ze.recipients)Pe.name&&Ne.set(Pe.id,Pe.name);p(Ne)}).catch(ze=>{xe||r(yr(ze,a("recipientsLoadFailed")),"error")}),()=>{xe=!0}},[a,r]);const we=b.useMemo(()=>eC(f.filter(xe=>WN(xe,k,I)),_,i),[f,k,I,_,i]),E=`${k}|${_}|${I.enabled}|${I.chatScope}|${I.senders}`,{page:Y,pageCount:V,pageItems:le,setPage:ee,total:ue}=qc(we,20,E),me=()=>{j(""),q(Uf)},ce=z?f.find(xe=>xe.id===z.id)??z:null,Se=()=>{if(f.length>=Gn.rules){r(a("rulesLimit"),"warning");return}T(null),B(!0)},qe=async(xe,ze)=>{ye.current+=1;const Ne=xe.enabled,Pe=(D.current.get(xe.id)??0)+1;D.current.set(xe.id,Pe),U.current.add(xe.id),h(vt=>vt.map(ne=>ne.id===xe.id?{...ne,enabled:ze}:ne));try{const vt=await Q.updateAutoDeleteRule(xe.id,{enabled:ze});if(D.current.get(xe.id)!==Pe)return;h(ne=>ne.map(te=>te.id===xe.id?vt.rule:te))}catch(vt){D.current.get(xe.id)===Pe&&(h(ne=>ne.map(te=>te.id===xe.id?{...te,enabled:Ne}:te)),r(yr(vt,a("toggleFailed")),"error"))}finally{ye.current+=1,D.current.get(xe.id)===Pe&&U.current.delete(xe.id)}},it=async xe=>{ye.current+=1;try{const ze=await Q.resetAutoDeleteRule(xe.id);h(Ne=>Ne.map(Pe=>Pe.id===xe.id?ze.rule:Pe)),r(a("counterReset"),"success")}catch(ze){r(yr(ze,a("toggleFailed")),"error")}finally{ye.current+=1}},mt=async()=>{if(F){ye.current+=1,ae(!0);try{await Q.deleteAutoDeleteRule(F.id),h(xe=>xe.filter(ze=>ze.id!==F.id)),de===String(F.id)&&se(""),r(a("ruleDeleted"),"success"),X(null)}catch(xe){r(yr(xe,a("toggleFailed")),"error")}finally{ye.current+=1,ae(!1)}}},wt=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(fl,{icon:s.jsx(xc,{size:24}),title:a("autoDelete"),description:a("autoDeleteSubtitle"),actions:s.jsx(fe,{variant:"primary",icon:s.jsx(rl,{size:16}),onClick:Se,children:a("newRule")})}),s.jsx(Pc,{"aria-label":a("autoDelete"),className:"overflow-x-auto",value:o,onChange:d,options:[{value:"rules",label:a("rulesTab")},{value:"copies",label:a("copiesTab")}]}),o==="rules"&&s.jsxs("div",{className:"flex flex-col gap-3",children:[!x&&!y&&f.length>0&&s.jsxs(ml,{children:[s.jsx(Xe,{type:"search",name:"q",autoComplete:"off",value:k,onChange:xe=>j(xe.target.value),placeholder:a("searchRules"),"aria-label":a("searchRules"),className:"min-w-48 flex-1"}),s.jsx(Lr,{label:a("sort"),value:_,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:tC(I),onReset:()=>q(Uf),children:[s.jsx(vn,{label:a("filterStatus"),name:"ad-status",value:I.enabled,onChange:xe=>q(ze=>({...ze,enabled:xe})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(vn,{label:a("filterChat"),name:"ad-scope",value:I.chatScope,onChange:xe=>q(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(vn,{label:a("filterSender"),name:"ad-senders",value:I.senders,onChange:xe=>q(ze=>({...ze,senders:xe})),options:[{value:"any",label:a("statusAny")},{value:"everyone",label:a("sendersEveryone")},{value:"selected",label:a("sendersSelected")}]})]})]}),x&&s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2","aria-busy":"true",children:["s1","s2","s3","s4"].map(xe=>s.jsxs(Ke,{className:"flex flex-col gap-3",children:[s.jsx(Vt,{className:"h-5 w-40"}),s.jsx(Vt,{className:"h-6 w-full"}),s.jsx(Vt,{className:"h-8 w-24"})]},xe))}),!x&&y&&f.length===0&&s.jsx(ut,{kind:"error",icon:s.jsx(xc,{size:28}),description:y,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(ol,{size:16}),onClick:()=>C(xe=>xe+1),children:a("retryLoad")})}),!x&&!y&&f.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(xc,{size:28}),title:a("noRulesTitle"),description:a("noRulesBody"),action:s.jsx(fe,{variant:"primary",icon:s.jsx(rl,{size:16}),onClick:Se,children:a("newRule")})}),!x&&!y&&f.length>0&&we.length===0&&s.jsx(ut,{kind:"no-results",action:s.jsx(fe,{variant:"secondary",onClick:me,children:a("clearFilters")})}),!x&&!y&&we.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:le.map(xe=>{const ze=pi(xe),Ne=Math.max(0,xe.keywords.length-s0);return s.jsxs(Ke,{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(bn,{checked:xe.enabled,"aria-label":a("ruleEnabled"),onChange:Pe=>void qe(xe,Pe)}),s.jsxs(sa,{label:a("more"),children:[s.jsx(lt,{icon:s.jsx(Kb,{size:16}),onSelect:()=>{T(xe),B(!0)},children:a("edit")}),s.jsx(lt,{icon:s.jsx(ol,{size:16}),onSelect:()=>void it(xe),children:a("resetCounter")}),xe.keepCopy&&s.jsx(lt,{icon:s.jsx(zr,{size:16}),onSelect:()=>{se(String(xe.id)),d("copies")},children:a("viewCopies")}),s.jsx(lt,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>X(xe),children:a("delete")})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[xe.keywords.slice(0,s0).map(Pe=>s.jsx(Hc,{children:Pe},Pe)),Ne>0&&s.jsx(nt,{children:rn(a("moreKeywords"),{n:Ne})})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(nt,{children:a(oC[xe.match])}),s.jsx(nt,{children:wt(xe)}),s.jsx(nt,{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:O.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(Dc,{value:xe.lastDeletedAt})]}):a("neverDeleted")})]})]},xe.id)})}),s.jsx(xi,{page:Y,pageCount:V,total:ue,onPageChange:ee})]})]}),o==="copies"&&s.jsx(nC,{rules:f,names:m,ruleId:de,onRuleIdChange:se}),s.jsx(rC,{open:he,rule:ce,names:m,onClose:()=>B(!1),onSaved:xe=>{ye.current+=1,h(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(Rr,{isOpen:F!==null,onClose:()=>X(null),onConfirm:()=>void mt(),title:a("deleteRuleTitle"),description:s.jsx("span",{dir:"auto",children:rn(a("deleteRuleBody"),{name:F?pi(F):""})}),confirmLabel:a("delete"),cancelLabel:a("cancel"),loading:re})]})},uC=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/;function Ga(a){return a.key??a.name}function p1(a){return`cmd-details-${Ga(a).replace(/[^a-zA-Z0-9_-]+/g,"-")}`}const dC={MEMBERS:"permMembers",ALL:"permMembers",ADMINS_ONLY:"permAdminsOnly",ADMINS_OWNER:"permAdminsOwner",OWNER_ONLY:"permOwnerOnly"},fC={all:"scopeAll",group:"scopeGroup",private:"scopePrivate"};function Ic(){const{t:a,language:i}=He(),r=m=>{const p=dC[m];return p?a(p):m},o=m=>{const p=fC[m];return p?a(p):m},d=m=>{var p;return((p=m.descriptions)==null?void 0:p[i])||m.description||""},f=m=>{var p;return((p=m.usages)==null?void 0:p[i])||m.usage||""};return{t:a,language:i,permissionLabel:r,scopeLabel:o,describe:d,usageOf:f,usageLines:(m,p)=>f(m).split(`
532
- `).map(x=>x.trim()).filter(Boolean).map(x=>`${p}${x}`)}}function sm({alias:a,prefix:i,onRemove:r,removeLabel:o}){const{t:d,language:f}=He(),h=uC.test(a),m=h!==(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]}),m&&s.jsx("span",{className:"font-sans text-[9px] font-bold uppercase tracking-wide text-brand-cyan/80",children:h?"AR":"EN"}),r&&s.jsx(Oe,{variant:"ghost",label:o??d("delete"),icon:s.jsx(Fn,{size:14}),onMouseDown:p=>p.preventDefault(),onClick:r})]})}function hC({command:a,prefix:i,onClose:r,onSaved:o}){const{t:d}=He(),{toast:f}=_t(),[h,m]=b.useState([]),[p,x]=b.useState(""),[v,y]=b.useState(!1);b.useEffect(()=>{a&&(m(Array.isArray(a.aliases)?[...a.aliases]:[]),x(""),y(!1))},[a]);const w=()=>{const k=p.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(k){if(h.includes(k)){f(d("aliasAlreadyAdded"),"warning");return}m([...h,k]),x("")}},N=k=>{m(h.filter(j=>j!==k))},C=async()=>{if(a){y(!0);try{await Q.updateCommand(a.name,{aliases:h}),o(a,h),f(d("savedSuccessfully"),"success"),r()}catch(k){f(k.message,"error")}finally{y(!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:C,loading:v,children:d(v?"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:h.length>0?h.map(k=>s.jsx(sm,{alias:k,prefix:i,removeLabel:d("delete"),onRemove:()=>N(k)},k)):s.jsx("span",{className:"px-1 text-xs text-faint",children:d("noAliases")})})]}),s.jsx(st,{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(Cj,{size:16,className:"pointer-events-none absolute start-3 top-3 text-muted"}),s.jsx(Xe,{id:"new-alias-input",type:"text",value:p,onChange:k=>x(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),w())},placeholder:d("newAliasPlaceholder"),className:"ps-10"})]}),s.jsx(fe,{variant:"secondary",icon:s.jsx(rl,{size:16}),onClick:w,className:"shrink-0",children:d("add")})]})})]})})}function g1({command:a,levels:i,actions:r}){const{t:o,permissionLabel:d}=Ic(),f=Tn(a.permission);return a.permissionLocked?s.jsxs(nt,{tone:"neutral",children:[s.jsx(Rb,{size:12,"aria-hidden":!0}),d(a.permission)]}):s.jsx(Dn,{dirty:f.dirty,saving:f.status==="saving",justSaved:f.status==="saved",error:f.error,onSave:()=>f.save(h=>r.onSavePermission(a,h)),onRevert:f.revert,saveLabel:o("save"),savedLabel:o("saved"),children:s.jsx(Qt,{"aria-label":`${o("thRequiredRole")}: ${a.name}`,value:f.value,onChange:h=>f.setValue(h.target.value),children:i.map(h=>s.jsx("option",{value:h,children:d(h)},h))})})}function br({label:a,children:i}){return s.jsxs("section",{className:"flex min-w-0 flex-col gap-1.5",children:[s.jsx("p",{className:"text-xs font-bold text-muted",children:a}),i]})}function x1({command:a,prefix:i,levels:r,actions:o}){var y;const{t:d,describe:f,scopeLabel:h,permissionLabel:m,usageLines:p}=Ic(),x=f(a),v=p(a,i);return s.jsxs("div",{className:"flex flex-col gap-4",children:[x&&s.jsx("p",{dir:"auto",className:"min-w-0 break-words text-sm text-muted",children:x}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(br,{label:d("thAliases"),children:s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[(y=a.aliases)!=null&&y.length?a.aliases.map(w=>s.jsx(sm,{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(vj,{size:16}),onClick:()=>o.onEditAliases(a)})]})}),s.jsxs(br,{label:d("thRequiredRole"),children:[s.jsx(g1,{command:a,levels:r,actions:o}),a.permissionLocked&&s.jsx("p",{className:"text-xs text-muted",children:d("permissionLockedReason")})]}),s.jsx(br,{label:d("thScope"),children:s.jsx("div",{children:s.jsx(nt,{tone:"info",children:h(a.chat)})})}),s.jsxs(br,{label:d("thStatus"),children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx(nt,{tone:a.enabled?"ok":"neutral",children:a.enabled?d("statusEnabled"):d("statusDisabled")}),a.overridden&&s.jsx(nt,{tone:"info",children:d("overridden")})]}),s.jsxs("p",{className:"text-xs text-muted",children:[d("defaultLabel"),": ",m(a.defaultPermission)]})]})]}),v.length>0&&s.jsx(br,{label:d("usage"),children:s.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:v.map(w=>s.jsxs("li",{className:"flex items-center gap-1.5",children:[s.jsx("code",{dir:"ltr",title:w,className:"min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border border-line bg-panel-raised px-1.5 py-0.5 font-mono text-[11px] text-muted",children:w}),s.jsx(Oe,{label:d("copyCommand"),icon:s.jsx(fb,{size:16}),onClick:()=>o.onCopy(w)})]},w))})})]})}function mC({commands:a,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:h}=He();return s.jsx("ul",{className:"divide-y divide-line/50",children:a.map(m=>{const p=Ga(m),x=o===p,v=p1(m);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,m.name]}),s.jsx(bn,{checked:m.enabled,"aria-label":`${h("thStatus")}: ${i}${m.name}`,onChange:y=>f.onToggleEnabled(m,y)}),s.jsx(Oe,{size:"md",variant:"ghost",label:h(x?"hideDetails":"details"),"aria-expanded":x,"aria-controls":v,icon:s.jsx(fi,{size:18,className:Ue("transition-transform",x&&"rotate-180")}),onClick:()=>d(p)})]}),x&&s.jsx("div",{id:v,className:"border-t border-line/40 bg-panel-raised/40 px-4 py-4",children:s.jsx(x1,{command:m,prefix:i,levels:r,actions:f})})]},p)})})}const l0=2;function pC({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-l0;return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[r.slice(0,l0).map(d=>s.jsx(sm,{alias:d,prefix:i},d)),o>0&&s.jsxs(nt,{tone:"neutral",children:["+",o]})]})}function gC({commands:a,prefix:i,levels:r,expanded:o,onToggleDetails:d,actions:f}){const{t:h}=He(),{describe:m}=Ic();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:h("thCommand")}),s.jsx("th",{className:"px-3 py-3 text-start",children:h("thDescription")}),s.jsx("th",{className:"hidden px-3 py-3 text-start lg:table-cell lg:w-[16%]",children:h("thAliases")}),s.jsx("th",{className:"hidden px-3 py-3 text-start sm:table-cell sm:w-[26%] md:table-cell",children:h("thRequiredRole")}),s.jsx("th",{className:"w-[72px] px-3 py-3 text-center",children:h("thStatus")}),s.jsx("th",{className:"w-14 px-3 py-3 text-end",children:s.jsx("span",{className:"sr-only",children:h("details")})})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:a.map(p=>{const x=Ga(p),v=o===x,y=p1(p);return s.jsxs(b.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,p.name]})}),s.jsx("td",{className:"min-w-0 px-3 py-2.5",children:s.jsx(Kn,{as:"p",lines:1,className:"text-xs text-text-main md:text-sm",children:m(p)})}),s.jsx("td",{className:"hidden min-w-0 px-3 py-2.5 lg:table-cell",children:s.jsx(pC,{command:p,prefix:i})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(g1,{command:p,levels:r,actions:f})}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx("div",{className:"flex justify-center",children:s.jsx(bn,{checked:p.enabled,"aria-label":`${h("thStatus")}: ${i}${p.name}`,onChange:w=>f.onToggleEnabled(p,w)})})}),s.jsx("td",{className:"px-3 py-2.5 text-end",children:s.jsx(Oe,{size:"md",variant:"ghost",label:h(v?"hideDetails":"details"),"aria-expanded":v,"aria-controls":y,icon:s.jsx(fi,{size:18,className:Ue("transition-transform",v&&"rotate-180")}),onClick:()=>d(x)})})]}),v&&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(x1,{command:p,prefix:i,levels:r,actions:f})})})]},x)})})]})})}const i0={status:"all",scope:"all",permission:"all"};function xC(a){let i=0;return a.status!=="all"&&(i+=1),a.scope!=="all"&&(i+=1),a.permission!=="all"&&(i+=1),i}function yC(a,i,r){var o,d,f,h;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,(h=a.usages)==null?void 0:h.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 bC(a,i,r){const o=(f,h)=>r.compare(f.name,h.name),d=[...a];return i==="status"?d.sort((f,h)=>f.enabled===h.enabled?o(f,h):f.enabled?-1:1):d.sort(o),d}const vC=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],SC=["s1","s2","s3","s4","s5"],wC=()=>{const{t:a,language:i}=He(),{toast:r}=_t(),{permissionLabel:o}=Ic(),[d,f]=b.useState([]),[h,m]=b.useState(vC),[p,x]=b.useState("!"),[v,y]=b.useState(!1),[w,N]=b.useState("!"),[C,k]=b.useState(""),[j,_]=b.useState(i0),[R,I]=b.useState("name"),[q,he]=b.useState(!0),[B,z]=b.useState(null),[T,F]=b.useState(null),[X,re]=b.useState(null),ae=b.useCallback(async()=>{he(!0);try{const V=await Q.getCommands();V!=null&&V.commands&&f(V.commands),V!=null&&V.prefix&&(x(V.prefix),N(V.prefix)),Array.isArray(V==null?void 0:V.levels)&&V.levels.length&&m(V.levels),z(null)}catch(V){z((V==null?void 0:V.message)||a("loadError")),r(V.message,"error")}finally{he(!1)}},[a,r]);b.useEffect(()=>{ae()},[ae]);const de=async()=>{const V=w.trim();if(!V||V.length>3){r(a("prefixValidation"),"error");return}try{await Q.updatePrefix(V),x(V),y(!1),r(`${a("prefixUpdated")} (${V})`,"success")}catch(le){r(le.message,"error")}},se=async(V,le)=>{f(ee=>ee.map(ue=>Ga(ue)===Ga(V)?{...ue,enabled:le,overridden:!0}:ue));try{await Q.updateCommand(V.name,{enabled:le}),r(a(le?"commandEnabled":"commandDisabled").replace("{name}",V.name),"success")}catch(ee){r(ee.message,"error"),ae()}},U=async(V,le)=>{await Q.updateCommand(V.name,{permission:le}),f(ee=>ee.map(ue=>Ga(ue)===Ga(V)?{...ue,permission:le,overridden:!0}:ue))},D=async V=>{try{await navigator.clipboard.writeText(V),r(a("copied"),"success")}catch{r(a("copyFailed"),"error")}},$=V=>{F(le=>le===V?null:V)},W=(V,le)=>{f(ee=>ee.map(ue=>Ga(ue)===Ga(V)?{...ue,aliases:le}:ue))},ye=()=>{k(""),_(i0)},O=b.useMemo(()=>new Intl.Collator(i),[i]),ie=C.trim().toLowerCase(),be=b.useMemo(()=>bC(d.filter(V=>yC(V,ie,j)),R,O),[d,ie,j,R,O]),we=xC(j),E=ie.length>0||we>0,Y={onToggleEnabled:(V,le)=>void se(V,le),onEditAliases:V=>re(V),onSavePermission:U,onCopy:V=>void D(V)};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(fl,{icon:s.jsx(cl,{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"),":"]}),v?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx(Xe,{type:"text",technical:!0,maxLength:3,value:w,onChange:V=>N(V.target.value),className:"w-14 text-center font-mono",onKeyDown:V=>{V.key==="Enter"&&de(),V.key==="Escape"&&y(!1)}}),s.jsx(fe,{variant:"primary",size:"sm",onClick:de,children:a("save")}),s.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>y(!1),children:a("cancel")})]}):s.jsx(fe,{variant:"ghost",size:"sm",title:a("editPrefixHint"),onClick:()=>{N(p),y(!0)},children:s.jsx("span",{dir:"ltr",className:"font-mono",children:p})})]})}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs(ml,{children:[s.jsxs("div",{className:"relative min-w-48 flex-1",children:[s.jsx(Gh,{size:18,className:"pointer-events-none absolute start-3.5 top-3 text-muted"}),s.jsx(Xe,{type:"search",value:C,onChange:V=>k(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:we,onReset:ye,children:[s.jsx(vn,{label:a("filterStatus"),name:"cmd-status",value:j.status,onChange:V=>_(le=>({...le,status:V})),options:[{value:"all",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(vn,{label:a("filterScope"),name:"cmd-scope",value:j.scope,onChange:V=>_(le=>({...le,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(vn,{label:a("filterPermission"),name:"cmd-permission",value:j.permission,onChange:V=>_(le=>({...le,permission:V})),options:[{value:"all",label:a("statusAny")},...h.map(V=>({value:V,label:o(V)})),{value:"overridden",label:a("overriddenOnly")},{value:"locked",label:a("lockedOnly")}]})]})]}),!q&&!B&&s.jsx("p",{"aria-live":"polite",className:"text-xs text-muted",children:rn(a("resultCountOf"),{n:be.length,total:d.length})})]}),q?s.jsx(Ke,{padded:!1,className:"overflow-hidden",children:s.jsx("div",{className:"divide-y divide-line/40","aria-busy":"true",children:SC.map(V=>s.jsxs("div",{className:"flex min-h-12 items-center gap-3 px-4 py-2.5",children:[s.jsx(Vt,{className:"h-4 w-28"}),s.jsx(Vt,{className:"ms-auto h-4 w-14"}),s.jsx(Vt,{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 ae(),children:a("retryLoad")})}):d.length===0?s.jsx(ut,{kind:"empty"}):be.length===0?s.jsx(ut,{kind:"no-results",description:a("noMatchingCommands"),action:E?s.jsx(fe,{variant:"secondary",onClick:ye,children:a("clearFilters")}):void 0}):s.jsxs(Ke,{padded:!1,className:"overflow-hidden",children:[s.jsx("div",{className:"md:hidden",children:s.jsx(mC,{commands:be,prefix:p,levels:h,expanded:T,onToggleDetails:$,actions:Y})}),s.jsx("div",{className:"hidden md:block",children:s.jsx(gC,{commands:be,prefix:p,levels:h,expanded:T,onToggleDetails:$,actions:Y})})]}),s.jsx(hC,{command:X,prefix:p,onClose:()=>re(null),onSaved:W})]})};var oi={},qf,r0;function jC(){return r0||(r0=1,qf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),qf}var Pf={},ws={},o0;function pl(){if(o0)return ws;o0=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 ws.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},ws.getSymbolTotalCodewords=function(o){return i[o]},ws.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},ws.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');a=o},ws.isKanjiModeEnabled=function(){return typeof a<"u"},ws.toSJIS=function(o){return a(o)},ws}var Gf={},c0;function lm(){return c0||(c0=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}}})(Gf)),Gf}var Vf,u0;function kC(){if(u0)return Vf;u0=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++}},Vf=a,Vf}var If,d0;function NC(){if(d0)return If;d0=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]},If=a,If}var Ff={},f0;function CC(){return f0||(f0=1,(function(a){const i=pl().getSymbolSize;a.getRowColCoords=function(o){if(o===1)return[];const d=Math.floor(o/7)+2,f=i(o),h=f===145?26:Math.ceil((f-13)/(2*d-2))*2,m=[f-7];for(let p=1;p<d-1;p++)m[p]=m[p-1]-h;return m.push(6),m.reverse()},a.getPositions=function(o){const d=[],f=a.getRowColCoords(o),h=f.length;for(let m=0;m<h;m++)for(let p=0;p<h;p++)m===0&&p===0||m===0&&p===h-1||m===h-1&&p===0||d.push([f[m],f[p]]);return d}})(Ff)),Ff}var Kf={},h0;function EC(){if(h0)return Kf;h0=1;const a=pl().getSymbolSize,i=7;return Kf.getPositions=function(o){const d=a(o);return[[0,0],[d-i,0],[0,d-i]]},Kf}var Yf={},m0;function AC(){return m0||(m0=1,(function(a){a.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};a.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},a.from=function(d){return a.isValid(d)?parseInt(d,10):void 0},a.getPenaltyN1=function(d){const f=d.size;let h=0,m=0,p=0,x=null,v=null;for(let y=0;y<f;y++){m=p=0,x=v=null;for(let w=0;w<f;w++){let N=d.get(y,w);N===x?m++:(m>=5&&(h+=i.N1+(m-5)),x=N,m=1),N=d.get(w,y),N===v?p++:(p>=5&&(h+=i.N1+(p-5)),v=N,p=1)}m>=5&&(h+=i.N1+(m-5)),p>=5&&(h+=i.N1+(p-5))}return h},a.getPenaltyN2=function(d){const f=d.size;let h=0;for(let m=0;m<f-1;m++)for(let p=0;p<f-1;p++){const x=d.get(m,p)+d.get(m,p+1)+d.get(m+1,p)+d.get(m+1,p+1);(x===4||x===0)&&h++}return h*i.N2},a.getPenaltyN3=function(d){const f=d.size;let h=0,m=0,p=0;for(let x=0;x<f;x++){m=p=0;for(let v=0;v<f;v++)m=m<<1&2047|d.get(x,v),v>=10&&(m===1488||m===93)&&h++,p=p<<1&2047|d.get(v,x),v>=10&&(p===1488||p===93)&&h++}return h*i.N3},a.getPenaltyN4=function(d){let f=0;const h=d.data.length;for(let p=0;p<h;p++)f+=d.data[p];return Math.abs(Math.ceil(f*100/h/5)-10)*i.N4};function r(o,d,f){switch(o){case a.Patterns.PATTERN000:return(d+f)%2===0;case a.Patterns.PATTERN001:return d%2===0;case a.Patterns.PATTERN010:return f%3===0;case a.Patterns.PATTERN011:return(d+f)%3===0;case a.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case a.Patterns.PATTERN101:return d*f%2+d*f%3===0;case a.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case a.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}a.applyMask=function(d,f){const h=f.size;for(let m=0;m<h;m++)for(let p=0;p<h;p++)f.isReserved(p,m)||f.xor(p,m,r(d,p,m))},a.getBestMask=function(d,f){const h=Object.keys(a.Patterns).length;let m=0,p=1/0;for(let x=0;x<h;x++){f(x),a.applyMask(x,d);const v=a.getPenaltyN1(d)+a.getPenaltyN2(d)+a.getPenaltyN3(d)+a.getPenaltyN4(d);a.applyMask(x,d),v<p&&(p=v,m=x)}return m}})(Yf)),Yf}var mc={},p0;function y1(){if(p0)return mc;p0=1;const a=lm(),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 mc.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}},mc.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}},mc}var Qf={},vr={},g0;function _C(){if(g0)return vr;g0=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]})(),vr.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},vr.exp=function(o){return a[o]},vr.mul=function(o,d){return o===0||d===0?0:a[i[o]+i[d]]},vr}var x0;function TC(){return x0||(x0=1,(function(a){const i=_C();a.mul=function(o,d){const f=new Uint8Array(o.length+d.length-1);for(let h=0;h<o.length;h++)for(let m=0;m<d.length;m++)f[h+m]^=i.mul(o[h],d[m]);return f},a.mod=function(o,d){let f=new Uint8Array(o);for(;f.length-d.length>=0;){const h=f[0];for(let p=0;p<d.length;p++)f[p]^=i.mul(d[p],h);let m=0;for(;m<f.length&&f[m]===0;)m++;f=f.slice(m)}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}})(Qf)),Qf}var Xf,y0;function DC(){if(y0)return Xf;y0=1;const a=TC();function i(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(o){this.degree=o,this.genPoly=a.generateECPolynomial(this.degree)},i.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(o.length+this.degree);d.set(o);const f=a.mod(d,this.genPoly),h=this.degree-f.length;if(h>0){const m=new Uint8Array(this.degree);return m.set(f,h),m}return f},Xf=i,Xf}var Zf={},Jf={},$f={},b0;function b1(){return b0||(b0=1,$f.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),$f}var va={},v0;function v1(){if(v0)return va;v0=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
533
- ]))+`;va.KANJI=new RegExp(r,"g"),va.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),va.BYTE=new RegExp(o,"g"),va.NUMERIC=new RegExp(a,"g"),va.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+r+"$"),f=new RegExp("^"+a+"$"),h=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return va.testKanji=function(p){return d.test(p)},va.testNumeric=function(p){return f.test(p)},va.testAlphanumeric=function(p){return h.test(p)},va}var S0;function gl(){return S0||(S0=1,(function(a){const i=b1(),r=v1();a.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},a.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},a.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},a.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},a.MIXED={bit:-1},a.getCharCountIndicator=function(f,h){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!i.isValid(h))throw new Error("Invalid version: "+h);return h>=1&&h<10?f.ccBits[0]:h<27?f.ccBits[1]:f.ccBits[2]},a.getBestModeForData=function(f){return r.testNumeric(f)?a.NUMERIC:r.testAlphanumeric(f)?a.ALPHANUMERIC:r.testKanji(f)?a.KANJI:a.BYTE},a.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},a.isValid=function(f){return f&&f.bit&&f.ccBits};function o(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return a.NUMERIC;case"alphanumeric":return a.ALPHANUMERIC;case"kanji":return a.KANJI;case"byte":return a.BYTE;default:throw new Error("Unknown mode: "+d)}}a.from=function(f,h){if(a.isValid(f))return f;try{return o(f)}catch{return h}}})(Jf)),Jf}var w0;function RC(){return w0||(w0=1,(function(a){const i=pl(),r=y1(),o=lm(),d=gl(),f=b1(),h=7973,m=i.getBCHDigit(h);function p(w,N,C){for(let k=1;k<=40;k++)if(N<=a.getCapacity(k,C,w))return k}function x(w,N){return d.getCharCountIndicator(w,N)+4}function v(w,N){let C=0;return w.forEach(function(k){const j=x(k.mode,N);C+=j+k.getBitsLength()}),C}function y(w,N){for(let C=1;C<=40;C++)if(v(w,C)<=a.getCapacity(C,N,d.MIXED))return C}a.from=function(N,C){return f.isValid(N)?parseInt(N,10):C},a.getCapacity=function(N,C,k){if(!f.isValid(N))throw new Error("Invalid QR Code version");typeof k>"u"&&(k=d.BYTE);const j=i.getSymbolTotalCodewords(N),_=r.getTotalCodewordsCount(N,C),R=(j-_)*8;if(k===d.MIXED)return R;const I=R-x(k,N);switch(k){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(N,C){let k;const j=o.from(C,o.M);if(Array.isArray(N)){if(N.length>1)return y(N,j);if(N.length===0)return 1;k=N[0]}else k=N;return p(k.mode,k.getLength(),j)},a.getEncodedBits=function(N){if(!f.isValid(N)||N<7)throw new Error("Invalid QR Code version");let C=N<<12;for(;i.getBCHDigit(C)-m>=0;)C^=h<<i.getBCHDigit(C)-m;return N<<12|C}})(Zf)),Zf}var Wf={},j0;function zC(){if(j0)return Wf;j0=1;const a=pl(),i=1335,r=21522,o=a.getBCHDigit(i);return Wf.getEncodedBits=function(f,h){const m=f.bit<<3|h;let p=m<<10;for(;a.getBCHDigit(p)-o>=0;)p^=i<<a.getBCHDigit(p)-o;return(m<<10|p)^r},Wf}var eh={},th,k0;function MC(){if(k0)return th;k0=1;const a=gl();function i(r){this.mode=a.NUMERIC,this.data=r.toString()}return i.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let d,f,h;for(d=0;d+3<=this.data.length;d+=3)f=this.data.substr(d,3),h=parseInt(f,10),o.put(h,10);const m=this.data.length-d;m>0&&(f=this.data.substr(d),h=parseInt(f,10),o.put(h,m*3+1))},th=i,th}var nh,N0;function OC(){if(N0)return nh;N0=1;const a=gl(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(o){this.mode=a.ALPHANUMERIC,this.data=o}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let f;for(f=0;f+2<=this.data.length;f+=2){let h=i.indexOf(this.data[f])*45;h+=i.indexOf(this.data[f+1]),d.put(h,11)}this.data.length%2&&d.put(i.indexOf(this.data[f]),6)},nh=r,nh}var ah,C0;function LC(){if(C0)return ah;C0=1;const a=gl();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)},ah=i,ah}var sh,E0;function BC(){if(E0)return sh;E0=1;const a=gl(),i=pl();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]+`
534
- Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},sh=r,sh}var lh={exports:{}},A0;function UC(){return A0||(A0=1,(function(a){var i={single_source_shortest_paths:function(r,o,d){var f={},h={};h[o]=0;var m=i.PriorityQueue.make();m.push(o,0);for(var p,x,v,y,w,N,C,k,j;!m.empty();){p=m.pop(),x=p.value,y=p.cost,w=r[x]||{};for(v in w)w.hasOwnProperty(v)&&(N=w[v],C=y+N,k=h[v],j=typeof h[v]>"u",(j||k>C)&&(h[v]=C,m.push(v,C),f[v]=x))}if(typeof d<"u"&&typeof h[d]>"u"){var _=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(_)}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})(lh)),lh.exports}var _0;function HC(){return _0||(_0=1,(function(a){const i=gl(),r=MC(),o=OC(),d=LC(),f=BC(),h=v1(),m=pl(),p=UC();function x(_){return unescape(encodeURIComponent(_)).length}function v(_,R,I){const q=[];let he;for(;(he=_.exec(I))!==null;)q.push({data:he[0],index:he.index,mode:R,length:he[0].length});return q}function y(_){const R=v(h.NUMERIC,i.NUMERIC,_),I=v(h.ALPHANUMERIC,i.ALPHANUMERIC,_);let q,he;return m.isKanjiModeEnabled()?(q=v(h.BYTE,i.BYTE,_),he=v(h.KANJI,i.KANJI,_)):(q=v(h.BYTE_KANJI,i.BYTE,_),he=[]),R.concat(I,q,he).sort(function(z,T){return z.index-T.index}).map(function(z){return{data:z.data,mode:z.mode,length:z.length}})}function w(_,R){switch(R){case i.NUMERIC:return r.getBitsLength(_);case i.ALPHANUMERIC:return o.getBitsLength(_);case i.KANJI:return f.getBitsLength(_);case i.BYTE:return d.getBitsLength(_)}}function N(_){return _.reduce(function(R,I){const q=R.length-1>=0?R[R.length-1]:null;return q&&q.mode===I.mode?(R[R.length-1].data+=I.data,R):(R.push(I),R)},[])}function C(_){const R=[];for(let I=0;I<_.length;I++){const q=_[I];switch(q.mode){case i.NUMERIC:R.push([q,{data:q.data,mode:i.ALPHANUMERIC,length:q.length},{data:q.data,mode:i.BYTE,length:q.length}]);break;case i.ALPHANUMERIC:R.push([q,{data:q.data,mode:i.BYTE,length:q.length}]);break;case i.KANJI:R.push([q,{data:q.data,mode:i.BYTE,length:x(q.data)}]);break;case i.BYTE:R.push([{data:q.data,mode:i.BYTE,length:x(q.data)}])}}return R}function k(_,R){const I={},q={start:{}};let he=["start"];for(let B=0;B<_.length;B++){const z=_[B],T=[];for(let F=0;F<z.length;F++){const X=z[F],re=""+B+F;T.push(re),I[re]={node:X,lastCount:0},q[re]={};for(let ae=0;ae<he.length;ae++){const de=he[ae];I[de]&&I[de].node.mode===X.mode?(q[de][re]=w(I[de].lastCount+X.length,X.mode)-w(I[de].lastCount,X.mode),I[de].lastCount+=X.length):(I[de]&&(I[de].lastCount=X.length),q[de][re]=w(X.length,X.mode)+4+i.getCharCountIndicator(X.mode,R))}}he=T}for(let B=0;B<he.length;B++)q[he[B]].end=0;return{map:q,table:I}}function j(_,R){let I;const q=i.getBestModeForData(_);if(I=i.from(R,q),I!==i.BYTE&&I.bit<q.bit)throw new Error('"'+_+'" cannot be encoded with mode '+i.toString(I)+`.
535
- Suggested mode is: `+i.toString(q));switch(I===i.KANJI&&!m.isKanjiModeEnabled()&&(I=i.BYTE),I){case i.NUMERIC:return new r(_);case i.ALPHANUMERIC:return new o(_);case i.KANJI:return new f(_);case i.BYTE:return new d(_)}}a.fromArray=function(R){return R.reduce(function(I,q){return typeof q=="string"?I.push(j(q,null)):q.data&&I.push(j(q.data,q.mode)),I},[])},a.fromString=function(R,I){const q=y(R,m.isKanjiModeEnabled()),he=C(q),B=k(he,I),z=p.find_path(B.map,"start","end"),T=[];for(let F=1;F<z.length-1;F++)T.push(B.table[z[F]].node);return a.fromArray(N(T))},a.rawSplit=function(R){return a.fromArray(y(R,m.isKanjiModeEnabled()))}})(eh)),eh}var T0;function qC(){if(T0)return Pf;T0=1;const a=pl(),i=lm(),r=kC(),o=NC(),d=CC(),f=EC(),h=AC(),m=y1(),p=DC(),x=RC(),v=zC(),y=gl(),w=HC();function N(B,z){const T=B.size,F=f.getPositions(z);for(let X=0;X<F.length;X++){const re=F[X][0],ae=F[X][1];for(let de=-1;de<=7;de++)if(!(re+de<=-1||T<=re+de))for(let se=-1;se<=7;se++)ae+se<=-1||T<=ae+se||(de>=0&&de<=6&&(se===0||se===6)||se>=0&&se<=6&&(de===0||de===6)||de>=2&&de<=4&&se>=2&&se<=4?B.set(re+de,ae+se,!0,!0):B.set(re+de,ae+se,!1,!0))}}function C(B){const z=B.size;for(let T=8;T<z-8;T++){const F=T%2===0;B.set(T,6,F,!0),B.set(6,T,F,!0)}}function k(B,z){const T=d.getPositions(z);for(let F=0;F<T.length;F++){const X=T[F][0],re=T[F][1];for(let ae=-2;ae<=2;ae++)for(let de=-2;de<=2;de++)ae===-2||ae===2||de===-2||de===2||ae===0&&de===0?B.set(X+ae,re+de,!0,!0):B.set(X+ae,re+de,!1,!0)}}function j(B,z){const T=B.size,F=x.getEncodedBits(z);let X,re,ae;for(let de=0;de<18;de++)X=Math.floor(de/3),re=de%3+T-8-3,ae=(F>>de&1)===1,B.set(X,re,ae,!0),B.set(re,X,ae,!0)}function _(B,z,T){const F=B.size,X=v.getEncodedBits(z,T);let re,ae;for(re=0;re<15;re++)ae=(X>>re&1)===1,re<6?B.set(re,8,ae,!0):re<8?B.set(re+1,8,ae,!0):B.set(F-15+re,8,ae,!0),re<8?B.set(8,F-re-1,ae,!0):re<9?B.set(8,15-re-1+1,ae,!0):B.set(8,15-re-1,ae,!0);B.set(F-8,8,1,!0)}function R(B,z){const T=B.size;let F=-1,X=T-1,re=7,ae=0;for(let de=T-1;de>0;de-=2)for(de===6&&de--;;){for(let se=0;se<2;se++)if(!B.isReserved(X,de-se)){let U=!1;ae<z.length&&(U=(z[ae]>>>re&1)===1),B.set(X,de-se,U),re--,re===-1&&(ae++,re=7)}if(X+=F,X<0||T<=X){X-=F,F=-F;break}}}function I(B,z,T){const F=new r;T.forEach(function(se){F.put(se.mode.bit,4),F.put(se.getLength(),y.getCharCountIndicator(se.mode,B)),se.write(F)});const X=a.getSymbolTotalCodewords(B),re=m.getTotalCodewordsCount(B,z),ae=(X-re)*8;for(F.getLengthInBits()+4<=ae&&F.put(0,4);F.getLengthInBits()%8!==0;)F.putBit(0);const de=(ae-F.getLengthInBits())/8;for(let se=0;se<de;se++)F.put(se%2?17:236,8);return q(F,B,z)}function q(B,z,T){const F=a.getSymbolTotalCodewords(z),X=m.getTotalCodewordsCount(z,T),re=F-X,ae=m.getBlocksCount(z,T),de=F%ae,se=ae-de,U=Math.floor(F/ae),D=Math.floor(re/ae),$=D+1,W=U-D,ye=new p(W);let O=0;const ie=new Array(ae),be=new Array(ae);let we=0;const E=new Uint8Array(B.buffer);for(let ue=0;ue<ae;ue++){const me=ue<se?D:$;ie[ue]=E.slice(O,O+me),be[ue]=ye.encode(ie[ue]),O+=me,we=Math.max(we,me)}const Y=new Uint8Array(F);let V=0,le,ee;for(le=0;le<we;le++)for(ee=0;ee<ae;ee++)le<ie[ee].length&&(Y[V++]=ie[ee][le]);for(le=0;le<W;le++)for(ee=0;ee<ae;ee++)Y[V++]=be[ee][le];return Y}function he(B,z,T,F){let X;if(Array.isArray(B))X=w.fromArray(B);else if(typeof B=="string"){let U=z;if(!U){const D=w.rawSplit(B);U=x.getBestVersionForData(D,T)}X=w.fromString(B,U||40)}else throw new Error("Invalid data");const re=x.getBestVersionForData(X,T);if(!re)throw new Error("The amount of data is too big to be stored in a QR Code");if(!z)z=re;else if(z<re)throw new Error(`
536
- The chosen QR Code version cannot contain this amount of data.
537
- Minimum version required to store current data is: `+re+`.
538
- `);const ae=I(z,T,X),de=a.getSymbolSize(z),se=new o(de);return N(se,z),C(se),k(se,z),_(se,T,0),z>=7&&j(se,z),R(se,ae),isNaN(F)&&(F=h.getBestMask(se,_.bind(null,se,T))),h.applyMask(F,se),_(se,T,F),{modules:se,version:z,errorCorrectionLevel:T,maskPattern:F,segments:X}}return Pf.create=function(z,T){if(typeof z>"u"||z==="")throw new Error("No input text");let F=i.M,X,re;return typeof T<"u"&&(F=i.from(T.errorCorrectionLevel,i.M),X=x.from(T.version),re=h.from(T.maskPattern),T.toSJISFunc&&a.setToSJISFunction(T.toSJISFunc)),he(z,X,F,re)},Pf}var ih={},rh={},D0;function S1(){return D0||(D0=1,(function(a){function i(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(f){return[f,f]}))),o.length===6&&o.push("F","F");const d=parseInt(o.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+o.slice(0,6).join("")}}a.getOptions=function(o){o||(o={}),o.color||(o.color={});const d=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,f=o.width&&o.width>=21?o.width:void 0,h=o.scale||4;return{width:f,scale:f?4:h,margin:d,color:{dark:i(o.color.dark||"#000000ff"),light:i(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},a.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},a.getImageWidth=function(o,d){const f=a.getScale(o,d);return Math.floor((o+d.margin*2)*f)},a.qrToImageData=function(o,d,f){const h=d.modules.size,m=d.modules.data,p=a.getScale(h,f),x=Math.floor((h+f.margin*2)*p),v=f.margin*p,y=[f.color.light,f.color.dark];for(let w=0;w<x;w++)for(let N=0;N<x;N++){let C=(w*x+N)*4,k=f.color.light;if(w>=v&&N>=v&&w<x-v&&N<x-v){const j=Math.floor((w-v)/p),_=Math.floor((N-v)/p);k=y[m[j*h+_]?1:0]}o[C++]=k.r,o[C++]=k.g,o[C++]=k.b,o[C]=k.a}}})(rh)),rh}var R0;function PC(){return R0||(R0=1,(function(a){const i=S1();function r(d,f,h){d.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=h,f.width=h,f.style.height=h+"px",f.style.width=h+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}a.render=function(f,h,m){let p=m,x=h;typeof p>"u"&&(!h||!h.getContext)&&(p=h,h=void 0),h||(x=o()),p=i.getOptions(p);const v=i.getImageWidth(f.modules.size,p),y=x.getContext("2d"),w=y.createImageData(v,v);return i.qrToImageData(w.data,f,p),r(y,x,v),y.putImageData(w,0,0),x},a.renderToDataURL=function(f,h,m){let p=m;typeof p>"u"&&(!h||!h.getContext)&&(p=h,h=void 0),p||(p={});const x=a.render(f,h,p),v=p.type||"image/png",y=p.rendererOpts||{};return x.toDataURL(v,y.quality)}})(ih)),ih}var oh={},z0;function GC(){if(z0)return oh;z0=1;const a=S1();function i(d,f){const h=d.a/255,m=f+'="'+d.hex+'"';return h<1?m+" "+f+'-opacity="'+h.toFixed(2).slice(1)+'"':m}function r(d,f,h){let m=d+f;return typeof h<"u"&&(m+=" "+h),m}function o(d,f,h){let m="",p=0,x=!1,v=0;for(let y=0;y<d.length;y++){const w=Math.floor(y%f),N=Math.floor(y/f);!w&&!x&&(x=!0),d[y]?(v++,y>0&&w>0&&d[y-1]||(m+=x?r("M",w+h,.5+N+h):r("m",p,0),p=0,x=!1),w+1<f&&d[y+1]||(m+=r("h",v),v=0)):p++}return m}return oh.render=function(f,h,m){const p=a.getOptions(h),x=f.modules.size,v=f.modules.data,y=x+p.margin*2,w=p.color.light.a?"<path "+i(p.color.light,"fill")+' d="M0 0h'+y+"v"+y+'H0z"/>':"",N="<path "+i(p.color.dark,"stroke")+' d="'+o(v,x,p.margin)+'"/>',C='viewBox="0 0 '+y+" "+y+'"',j='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+C+' shape-rendering="crispEdges">'+w+N+`</svg>
539
- `;return typeof m=="function"&&m(null,j),j},oh}var M0;function VC(){if(M0)return oi;M0=1;const a=jC(),i=qC(),r=PC(),o=GC();function d(f,h,m,p,x){const v=[].slice.call(arguments,1),y=v.length,w=typeof v[y-1]=="function";if(!w&&!a())throw new Error("Callback required as last argument");if(w){if(y<2)throw new Error("Too few arguments provided");y===2?(x=m,m=h,h=p=void 0):y===3&&(h.getContext&&typeof x>"u"?(x=p,p=void 0):(x=p,p=m,m=h,h=void 0))}else{if(y<1)throw new Error("Too few arguments provided");return y===1?(m=h,h=p=void 0):y===2&&!h.getContext&&(p=m,m=h,h=void 0),new Promise(function(N,C){try{const k=i.create(m,p);N(f(k,h,p))}catch(k){C(k)}})}try{const N=i.create(m,p);x(null,f(N,h,p))}catch(N){x(N)}}return oi.create=i.create,oi.toCanvas=d.bind(null,r.render),oi.toDataURL=d.bind(null,r.renderToDataURL),oi.toString=d.bind(null,function(f,h,m){return o.render(f,m)}),oi}var w1=VC();const ch=Hh(w1);function IC(){return typeof window<"u"&&!!window.LevixHost}const FC=({status:a,onRefresh:i,onStatusUpdate:r})=>{var ee;const{t:o,language:d}=He(),{toast:f}=_t(),[h,m]=b.useState(!1),[p,x]=b.useState(!1),[v,y]=b.useState(null),[w,N]=b.useState("pairing"),[C,k]=b.useState(""),[j,_]=b.useState(!1),R=(a==null?void 0:a.state)||"idle",I=R==="connected",q=R==="waiting_for_qr",he=R==="starting"||R==="linking",B=R==="reconnecting",z=R==="paused",T=R==="logged_out",F=!!(a!=null&&a.linked)&&!T,X=!F,re=!!(a!=null&&a.canUnlink),ae=(a==null?void 0:a.isOnline)!==!1,de=z||R==="disconnected"||R==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";b.useEffect(()=>{if(a!=null&&a.qr){const ue=w1.toDataURL||(ch==null?void 0:ch.toDataURL);if(typeof ue=="function"){const me=getComputedStyle(document.documentElement),ce=document.documentElement.getAttribute("data-theme")==="light",Se=(ce?me.getPropertyValue("--text"):me.getPropertyValue("--bg")).trim(),qe=(ce?me.getPropertyValue("--panel"):me.getPropertyValue("--text")).trim();ue(a.qr,{width:280,margin:2,color:{dark:Se,light:qe}}).then(it=>y(it)).catch(()=>y(null))}}else y(null)},[a==null?void 0:a.qr]),b.useEffect(()=>{if(q&&!(a!=null&&a.qr)&&!(a!=null&&a.pairingCode)){const ue=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(ue)}},[q,a==null?void 0:a.qr,a==null?void 0:a.pairingCode,i]);const se=async(ue,me)=>{x(!0);try{const ce=await ue();ce&&typeof ce=="object"&&"session"in ce&&(r==null||r(ce.session)),f(me,"success"),await(i==null?void 0:i())}catch(ce){f(ce instanceof Error?ce.message:String(ce),"error")}finally{x(!1)}},U=async ue=>{ue&&ue.preventDefault();const me=C.replace(/\D/g,"");if(!me){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(me.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await se(()=>Q.startSession({method:"pairing",phone:me}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},D=async()=>{await se(()=>Q.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},$=async()=>{await se(Q.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),N("pairing")},W=()=>{a!=null&&a.pairingCode&&(navigator.clipboard.writeText(a.pairingCode.replace(/\s+/g,"")),_(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>_(!1),2500))},ye=async()=>{m(!1),await se(Q.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},O=(ee=a==null?void 0:a.user)!=null&&ee.id?a.user.id.split("@")[0].split(":")[0]:null,ie=IC(),be={key:"unlink",label:o("unlink"),icon:s.jsx(Aj,{size:16}),danger:!0,onSelect:()=>m(!0)},we={key:"restart",label:o("restart"),icon:s.jsx(ol,{size:16}),onSelect:()=>se(Q.restartBot,o("restart"))},E={key:"reconnect",label:o("reconnect"),icon:s.jsx(Ia,{size:16}),onSelect:()=>se(Q.reconnectSession,o("reconnecting"))},Y=ue=>ie?ue:[...ue,we],V=Y(re?[be]:[]),le=ue=>{if(ue.length===0)return null;if(ue.length===1){const me=ue[0];return s.jsx(Oe,{label:me.label,icon:me.icon,onClick:me.onSelect,disabled:p})}return s.jsx(sa,{label:o("moreActions"),children:ue.map(me=>s.jsx(lt,{danger:me.danger,icon:me.icon,disabled:p,onSelect:me.onSelect,children:me.label},me.key))})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs(Ke,{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":q?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":he||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(Tr,{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"):z?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":q?"bg-warn/15 text-warn border-warn/30":he||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(sl,{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&&O&&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(js,{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:["+",O]})]})]}),s.jsx(Nr,{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(wh,{size:16}),onClick:()=>se(Q.stopSession,o("stop")),disabled:p,className:"flex-1 sm:flex-none",children:o("stop")}),le(Y([E,be]))]}),(he||q||B)&&s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s.jsx(fe,{variant:"danger",icon:s.jsx(wh,{size:16}),onClick:()=>se(Q.stopSession,o("stop")),disabled:p,className:"flex-1 sm:flex-none",children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"}),le(Y([]))]}),!I&&!he&&!q&&!B&&F&&s.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xl",children:[z&&s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:ae?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(Tr,{size:16}),onClick:()=>se(Q.startSession,de),disabled:p,className:"flex-1 sm:flex-none",children:de}),le(V)]})]}),!I&&!he&&!q&&!B&&X&&s.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[s.jsx(Ns,{"aria-label":o("connection"),value:w,onChange:N,className:"w-full sm:w-fit",options:[{value:"pairing",label:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)",icon:s.jsx(kr,{size:16})},{value:"qr",label:d==="ar"?"مسح رمز QR":"QR Code Scan",icon:s.jsx(Tf,{size:16})}]}),w==="pairing"&&s.jsxs("form",{onSubmit:U,className:"flex w-full max-w-xl flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Sj,{size:17,className:"absolute top-1/2 -translate-y-1/2 start-3.5 text-muted pointer-events-none"}),s.jsx(Xe,{type:"tel",value:C,onChange:ue=>k(ue.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(vh,{size:16}),disabled:p,className:"flex-1 whitespace-nowrap sm:flex-none",children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"}),le(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(Tf,{size:18}),onClick:D,disabled:p,className:"flex-1 whitespace-nowrap sm:flex-none",children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"}),le(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."})]})]})]})]}),he&&s.jsxs(Ke,{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-blue/15 text-brand-blue flex items-center justify-center mb-4 border border-brand-blue/30",children:s.jsx(Ia,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children: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."})]}),q&&s.jsx(Ke,{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(kr,{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:j?s.jsx(di,{size:18}):s.jsx(fb,{size:18}),onClick:W,children:j?d==="ar"?"تم النسخ بنجاح!":"Copied!":d==="ar"?"نسخ كود الربط":"Copy Code"})]}),s.jsxs("div",{className:"mt-6 p-4 rounded-xl border border-line bg-panel-raised text-start w-full max-w-md",children:[s.jsx("div",{className:"text-xs font-bold text-text-main mb-3",children:d==="ar"?"خطوات الإدخال في واتساب:":"Steps to enter in WhatsApp:"}),s.jsxs("ol",{className:"text-xs text-muted space-y-2 list-decimal list-inside leading-relaxed",children:[s.jsx("li",{children:d==="ar"?"افتح تطبيق واتساب على هاتفك.":"Open WhatsApp on your phone."}),s.jsx("li",{children:d==="ar"?"اذهب إلى الإعدادات > الأجهزة المرتبطة > ربط جهاز.":"Go to Settings > Linked Devices > Link a Device."}),s.jsx("li",{children:s.jsx("strong",{className:"text-text-main",children:d==="ar"?"اضغط على «الربط باستخدام رقم الهاتف بدلاً من ذلك» أسفل الشاشة.":"Tap 'Link with phone number instead' at bottom of screen."})}),s.jsx("li",{children:d==="ar"?"اكتب هذا الكود وسيتم ربط البوت مباشرة!":"Enter the code above to connect immediately!"})]})]})]}):v?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(Tf,{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:v,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(kr,{size:16}),onClick:$,disabled:p,className:"w-full",children:d==="ar"?"الربط برقم الهاتف (كود الربط الرقمي) بدلاً من QR":"Link with Phone Pairing Code Instead"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[s.jsx(Va,{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:h,onClose:()=>m(!1),title:o("unlink"),footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>m(!1),children:o("cancel")}),s.jsx(fe,{variant:"danger",onClick:ye,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")})]})]})},uh={antilink:"any",welcome:"any",media:"any"};function KC(a,i,r){const o=i.trim().toLowerCase();if(o&&!`${a.subject||""} ${a.jid}`.toLowerCase().includes(o))return!1;const d=!!a.antilink;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 YC=()=>{const{t:a,language:i}=He(),{toast:r}=_t(),[o,d]=b.useState([]),[f,h]=b.useState(!0),[m,p]=b.useState(null),[x,v]=b.useState(0),[y,w]=b.useState(""),[N,C]=b.useState("name"),[k,j]=b.useState(uh),_=D=>{var ye,O;const $=D.jid||D.id||"",W=typeof D.antilink=="boolean"?D.antilink:!!(D.antilinkEnabled??((ye=D.antilink)==null?void 0:ye.enabled));return{...D,jid:$,subject:D.subject||"",memberCount:D.memberCount??D.participants??0,antilink:W,antilinkEnabled:W,welcomeEnabled:!!(D.welcomeEnabled??((O=D.welcome_system)==null?void 0:O.enabled)),mediaRestriction:D.mediaRestriction||"none"}},R=async()=>{h(!0);try{const D=await Q.getGroups();D!=null&&D.groups&&d(D.groups.map(_)),p(null)}catch(D){p(D.message),r(D.message,"error")}finally{h(!1)}};b.useEffect(()=>{R()},[x]);const I=async(D,$)=>{d(W=>W.map(ye=>ye.jid===D?{...ye,...$}:ye));try{await Q.updateGroup(D,$),r(a("savedSuccessfully"),"success")}catch(W){r(W.message,"error"),R()}},q=async(D,$)=>{await Q.updateGroup(D,{mediaRestriction:$}),d(W=>W.map(ye=>ye.jid===D?{...ye,mediaRestriction:$}:ye))},he=b.useMemo(()=>{const D=o.filter($=>KC($,y,k));return D.sort(($,W)=>{const ye=($.subject||$.jid).localeCompare(W.subject||W.jid,i,{sensitivity:"base"});return N==="members"&&(W.memberCount||0)-($.memberCount||0)||ye}),D},[o,y,k,N,i]),B=`${y}|${N}|${k.antilink}|${k.welcome}|${k.media}`,{page:z,pageCount:T,pageItems:F,setPage:X,total:re}=qc(he,20,B),ae=(k.antilink!=="any"?1:0)+(k.welcome!=="any"?1:0)+(k.media!=="any"?1:0),de=()=>{w(""),j(uh)},se=(D,$)=>s.jsx(QC,{jid:D,value:$,noneLabel:a("mediaNone"),blockLabel:a("mediaBlockAll"),ariaLabel:a("thMedia"),saveLabel:a("save"),savedLabel:a("saved"),onSave:q}),U=!f&&!m&&o.length>0;return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(fl,{icon:s.jsx(il,{size:24}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[a("groups"),s.jsx(nt,{tone:"info",children:rn(a("groupsCount"),{n:o.length})})]}),description:a("groupsSubtitle")}),U&&s.jsxs(ml,{children:[s.jsx(Xe,{type:"search",name:"group-search",autoComplete:"off",value:y,onChange:D=>w(D.target.value),placeholder:a("searchGroups"),"aria-label":a("searchGroups"),className:"min-w-48 flex-1"}),s.jsx(Lr,{label:a("sort"),value:N,onChange:C,options:[{value:"name",label:a("sortByName")},{value:"members",label:a("sortByMembers")}]}),s.jsxs(hl,{label:a("filter"),resetLabel:a("reset"),activeCount:ae,onReset:()=>j(uh),children:[s.jsx(vn,{label:a("thAntiLink"),name:"group-antilink",value:k.antilink,onChange:D=>j($=>({...$,antilink:D})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(vn,{label:a("thWelcome"),name:"group-welcome",value:k.welcome,onChange:D=>j($=>({...$,welcome:D})),options:[{value:"any",label:a("statusAny")},{value:"on",label:a("statusEnabled")},{value:"off",label:a("statusDisabled")}]}),s.jsx(vn,{label:a("thMedia"),name:"group-media",value:k.media,onChange:D=>j($=>({...$,media:D})),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(D=>s.jsxs(Ke,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Vt,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Vt,{className:"h-5 w-40"}),s.jsx(Vt,{className:"h-4 w-28"})]})]}),s.jsx(Vt,{className:"h-10 w-full"}),s.jsx(Vt,{className:"h-10 w-full"})]},D))}),!f&&m&&s.jsx(ut,{kind:"error",icon:s.jsx(Hy,{size:28}),description:m,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(ol,{size:16}),onClick:()=>v(D=>D+1),children:a("retryLoad")})}),!f&&!m&&o.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(Hy,{size:28}),title:a("noGroupsTitle"),description:a("noGroupsBody")}),!f&&!m&&o.length>0&&he.length===0&&s.jsx(ut,{kind:"no-results",action:s.jsx(fe,{variant:"secondary",onClick:de,children:a("clearFilters")})}),!f&&!m&&he.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:hidden",children:F.map(D=>{var $;return s.jsxs(Ke,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex 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-sm font-bold text-brand-cyan",children:(D.subject||"G").charAt(0).toUpperCase()}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(Kn,{lines:2,className:"font-bold text-text-main",children:D.subject||a("unnamedGroup")}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[s.jsx("bdi",{dir:"ltr",className:"select-all rounded border border-line bg-panel-raised px-1.5 py-0.5 font-mono text-[11px] text-muted",children:(($=D.jid)==null?void 0:$.split("@")[0])||D.jid}),s.jsx(nt,{tone:"neutral",children:D.memberCount||"—"})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-3 border-t border-line/50 pt-3",children:[s.jsx(bn,{label:a("thAntiLink"),checked:!!D.antilink,onChange:W=>I(D.jid,{antilink:W})}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-sm font-semibold text-text-main",children:a("thMedia")}),se(D.jid,D.mediaRestriction||"none")]}),s.jsx(bn,{label:a("thWelcome"),checked:!!D.welcomeEnabled,onChange:W=>I(D.jid,{welcomeEnabled:W})})]})]},D.jid)})}),s.jsx(Ke,{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:"border-b border-line bg-panel-raised text-xs font-bold uppercase tracking-wider text-muted",children:[s.jsx("th",{className:"w-[26%] px-4 py-4 text-start",children:a("thGroupName")}),s.jsx("th",{className:"w-[22%] px-4 py-4 text-start",children:a("thGroupJid")}),s.jsx("th",{className:"w-[8%] px-4 py-4 text-start",children:a("thMembers")}),s.jsx("th",{className:"w-[13%] px-4 py-4 text-center",children:a("thAntiLink")}),s.jsx("th",{className:"w-[18%] px-4 py-4 text-start",children:a("thMedia")}),s.jsx("th",{className:"w-[13%] px-4 py-4 text-center",children:a("thWelcome")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:F.map(D=>{var $;return s.jsxs("tr",{className:"transition-colors hover:bg-panel-hover/50",children:[s.jsx("td",{className:"px-4 py-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-brand-blue/10 text-sm font-bold text-brand-cyan",children:(D.subject||"G").charAt(0).toUpperCase()}),s.jsx(Kn,{lines:1,className:"font-bold text-text-main",children:D.subject||a("unnamedGroup")})]})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx("bdi",{dir:"ltr",className:"block select-all truncate rounded border border-line bg-panel-raised px-2 py-1 font-mono text-xs text-muted",children:(($=D.jid)==null?void 0:$.split("@")[0])||D.jid})}),s.jsx("td",{className:"px-4 py-4",children:s.jsx(nt,{tone:"neutral",children:D.memberCount||"—"})}),s.jsx("td",{className:"px-4 py-4 text-center",children:s.jsx(bn,{"aria-label":a("thAntiLink"),checked:!!D.antilink,onChange:W=>I(D.jid,{antilink:W})})}),s.jsx("td",{className:"px-4 py-4",children:se(D.jid,D.mediaRestriction||"none")}),s.jsx("td",{className:"px-4 py-4 text-center",children:s.jsx(bn,{"aria-label":a("thWelcome"),checked:!!D.welcomeEnabled,onChange:W=>I(D.jid,{welcomeEnabled:W})})})]},D.jid)})})]})})}),s.jsx(xi,{page:z,pageCount:T,total:re,onPageChange:X})]})]})};function QC({jid:a,value:i,noneLabel:r,blockLabel:o,ariaLabel:d,saveLabel:f,savedLabel:h,onSave:m}){const p=Tn(i);return s.jsx(Dn,{dirty:p.dirty,saving:p.status==="saving",justSaved:p.status==="saved",error:p.error,onSave:()=>p.save(x=>m(a,x)),onRevert:p.revert,saveLabel:f,savedLabel:h,children:s.jsxs(Qt,{"aria-label":d,value:p.value,onChange:x=>p.setValue(x.target.value),children:[s.jsx("option",{value:"none",children:r}),s.jsx("option",{value:"block_all",children:o})]})})}var I0;const dh=typeof((I0=window.LevixHost)==null?void 0:I0.hostLog)=="function",XC=({socket:a})=>{const{t:i}=He(),[r,o]=b.useState([]),[d,f]=b.useState("all"),[h,m]=b.useState(!0),p=b.useRef(null),[x,v]=b.useState("bot"),[y,w]=b.useState([]);b.useEffect(()=>{x==="bot"&&Q.getLogs().then(_=>{_!=null&&_.logs&&o(_.logs)}).catch(()=>{})},[x]),b.useEffect(()=>{if(x!=="bot"||!a)return;const _=R=>{o(I=>[...I.slice(-400),R])};return a.on("log",_),()=>{a.off("log",_)}},[a,x]);const N=b.useCallback(()=>{var _;try{const R=((_=window.LevixHost)==null?void 0:_.hostLog(500))??"";w(R?R.split(`
540
- `).filter(Boolean):[])}catch{w([])}},[]);b.useEffect(()=>{if(x!=="host"||!dh)return;N();const _=setInterval(N,3e3);return()=>clearInterval(_)},[x,N]),b.useEffect(()=>{h&&p.current&&p.current.scrollIntoView({behavior:"smooth"})},[r,y,h]);const C=r.filter(_=>d==="all"?!0:_.level===d),k=x==="bot"?C.length:y.length,j=_=>_==="error"?"border-danger/30 bg-danger/10 text-danger":_==="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(fl,{icon:s.jsx(cl,{size:20}),title:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[i("liveServerLogs"),s.jsx(nt,{tone:"neutral",className:"font-mono",children:k})]}),description:i("logsSubtitle"),actions:s.jsxs(ml,{children:[dh&&s.jsx(Ns,{"aria-label":i("logs"),value:x,onChange:v,options:[{value:"bot",label:i("logSourceBot")},{value:"host",label:i("logSourceHost"),icon:s.jsx(kr,{size:14})}]}),x==="bot"&&s.jsx(hl,{label:i("filter"),resetLabel:i("reset"),activeCount:d==="all"?0:1,onReset:()=>f("all"),children:s.jsx(vn,{name:"log-level",label:i("allLogs"),value:d,onChange:f,options:[{value:"all",label:i("allLogs")},{value:"info",label:"INFO"},{value:"warn",label:"WARN"},{value:"error",label:"ERROR"}]})}),x==="host"&&dh&&s.jsx(Oe,{label:i("shareLogs"),icon:s.jsx(Or,{size:18}),onClick:()=>{var _;try{(_=window.LevixHost)==null||_.shareHostLogs()}catch{}}}),s.jsx(Oe,{label:i("autoScroll"),pressed:h,icon:s.jsx(Zw,{size:18,className:h?"animate-bounce":""}),onClick:()=>m(_=>!_)}),s.jsx(Oe,{label:i("clearLogs"),variant:"ghost",icon:s.jsx(In,{size:18}),onClick:()=>{x==="bot"?o([]):w([])}})]})}),s.jsxs(Ke,{padded:!1,className:"h-[65vh] overflow-y-auto bg-bg p-4 font-mono text-xs leading-relaxed text-muted shadow-2xl md:p-5",dir:"ltr",children:[x==="bot"?C.length===0?s.jsx(ut,{icon:s.jsx(cl,{size:24}),text:i("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:C.map((_,R)=>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:_.time||new Date().toLocaleTimeString()}),s.jsx("span",{className:`inline-flex shrink-0 items-center rounded border px-1.5 font-mono text-[10px] font-bold ${j(_.level||"info")}`,children:(_.level||"info").toUpperCase()}),s.jsx("span",{className:"break-all font-mono text-text-main",children:_.msg})]},R))}):y.length===0?s.jsx(ut,{icon:s.jsx(kr,{size:24}),text:i("noLogs")}):s.jsx("div",{className:"flex flex-col gap-1.5",children:y.map((_,R)=>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:_})},R))}),s.jsx("div",{ref:p})]})]})},ZC=a=>{if(!a)return null;const i=a.split("@")[0].split(":")[0].replace(/\D/g,"");return i?i.length===12?`+${i.slice(0,2)} ${i.slice(2,5)} ${i.slice(5,8)} ${i.slice(8)}`:i.length===11?`+${i.slice(0,1)} ${i.slice(1,4)} ${i.slice(4,7)} ${i.slice(7)}`:`+${i}`:null},JC=({status:a,onNavigate:i})=>{var k;const{t:r}=He(),{toast:o}=_t(),[d,f]=b.useState(null),[h,m]=b.useState(!0);b.useEffect(()=>{let j=!0;return Q.getStats().then(_=>{j&&(_!=null&&_.stats)&&f(_.stats)}).catch(_=>{o(_.message,"error")}).finally(()=>{j&&m(!1)}),()=>{j=!1}},[o]);const p=j=>{const _=Math.floor(j/86400),R=Math.floor(j%86400/3600),I=Math.floor(j%3600/60);return _?`${_} ${r("uptimeDayUnit")} ${R} ${r("uptimeHourUnit")}`:R?`${R} ${r("uptimeHourUnit")} ${I} ${r("uptimeMinuteUnit")}`:`${I} ${r("uptimeMinuteUnit")}`},x=(a==null?void 0:a.state)==="connected",v=ZC((k=a==null?void 0:a.user)==null?void 0:k.id),y=async()=>{try{await Q.startSession(),o(r("starting"),"info")}catch(j){o(j.message,"error")}},w=async()=>{try{await Q.stopSession(),o(r("stop"),"info")}catch(j){o(j.message,"error")}},N=[{id:"connection",title:r("connection"),desc:x?r("connected"):r(a==null?void 0:a.state,"disconnected"),icon:Tr,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:Ph,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:cl,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:cv,color:"border-ok/20 bg-ok/10 text-ok"}],C=[{label:r("totalGroups"),value:(d==null?void 0:d.totalGroups)??0,icon:il,tone:"border-brand-blue/20 bg-brand-blue/10 text-brand-blue"},{label:r("commandCount"),value:(d==null?void 0:d.commandCount)??0,icon:cl,tone:"border-brand-cyan/20 bg-brand-cyan/10 text-brand-cyan"},{label:r("uptime"),value:p((d==null?void 0:d.uptime)||0),icon:ub,tone:"border-ok/20 bg-ok/10 text-ok"},{label:r("activeSchedules"),value:(d==null?void 0:d.activeSchedules)??0,icon:gc,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(Ke,{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:`flex size-11 shrink-0 items-center justify-center rounded-xl border ${x?"border-ok/30 bg-ok/10 text-ok":"border-warn/30 bg-warn/10 text-warn"}`,children:s.jsx(Xw,{size:22})}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx("h2",{className:"text-base font-extrabold tracking-tight text-text-main sm:text-lg",children:x?r("connected"):r(a==null?void 0:a.state,"disconnected")}),s.jsx(Nr,{tone:x?"ok":"warn",dot:!0,pulse:!0,children:r(x?"online":"offline")})]}),s.jsx("p",{className:"text-sm text-muted",children:x?v?s.jsx("bdi",{dir:"ltr",children:v}):r("activeListening"):r("pausedOrLinking")})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[x?s.jsx(fe,{variant:"danger",icon:s.jsx(wh,{size:16}),onClick:w,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("stop")}):s.jsx(fe,{variant:"primary",icon:s.jsx(wj,{size:16}),onClick:y,className:"flex-1 whitespace-nowrap sm:flex-none",children:r("start")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(Tr,{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:C.map(j=>{const _=j.icon;return s.jsxs(Ke,{children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:"line-clamp-2 text-[11px] font-bold uppercase tracking-wider text-muted sm:text-xs",children:j.label}),s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${j.tone}`,children:s.jsx(_,{size:18})})]}),s.jsx("div",{className:"mt-2 font-mono text-2xl font-extrabold tracking-tight text-text-main sm:text-3xl",children:h?"—":j.value})]},j.label)})}),s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4",children:N.map(j=>{const _=j.icon;return s.jsx(Ke,{padded:!1,className:"h-full transition-colors hover:border-brand-blue/30",children:s.jsxs(fe,{variant:"ghost",onClick:()=>i(j.id),className:"h-full w-full flex-col items-stretch justify-between gap-3 rounded-2xl p-4 text-start sm:gap-4 sm:p-5",children:[s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("div",{className:`flex size-10 shrink-0 items-center justify-center rounded-xl border ${j.color}`,children:s.jsx(_,{size:18})}),s.jsx(bh,{size:16,className:"shrink-0 text-faint rtl:-scale-x-100","aria-hidden":!0})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-bold text-text-main sm:text-sm",children:j.title}),s.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted sm:text-xs",children:j.desc})]})]})},j.id)})}),s.jsxs(Ke,{className:"flex items-center gap-3.5",children:[s.jsx(oj,{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)||"..."})]})]})]})},gi=()=>window.LevixHost,Er=new Map;let O0=!1;function $C(){O0||(O0=!0,window.__levixHostDone=(a,i)=>{const r=Er.get(a);Er.delete(a),r==null||r(i)})}function Br(a,i,r){const o=gi(),d=o==null?void 0:o[a];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});$C();const f=crypto.randomUUID();return new Promise(h=>{var p,x,v,y,w;const m=N=>{h(N)};Er.set(f,m);try{const N=a==="pickStickerSource"?(p=o.pickStickerSource)==null?void 0:p.call(o,f):a==="pickFile"?(x=o.pickFile)==null?void 0:x.call(o,f):a==="uploadSource"?(v=o.uploadSource)==null?void 0:v.call(o,f,i[0],i[1],i[2]):a==="uploadForm"?(y=o.uploadForm)==null?void 0:y.call(o,f,i[0],i[1],i[2],i[3]):(w=o.exportFile)==null?void 0:w.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),C=JSON.parse(N||"");C.ok||(Er.delete(f),m(C))}catch{Er.delete(f),m({ok:!1,code:"UNAVAILABLE"})}})}function kc(){var a;return typeof((a=gi())==null?void 0:a.pickStickerSource)=="function"}function Fc(){var a;return typeof((a=gi())==null?void 0:a.exportFile)=="function"}async function WC(){const a=await Br("pickStickerSource",[]);if(!a.ok&&!a.cancelled)throw Ur(a);return a.ok&&a.token&&a.url?a:null}function eE(){try{const a=gi(),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 Ur(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 j1(a,i,r,o){const d=await Br("uploadSource",[a,i,r]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw Ur(d);try{return JSON.parse(d.body||"")}catch{throw new Bt(d.status,"Invalid upload response",{code:"INTERNAL"})}}function Mc(){var a,i;return typeof((a=gi())==null?void 0:a.uploadForm)=="function"&&typeof((i=gi())==null?void 0:i.pickFile)=="function"}async function k1(){const a=await Br("pickFile",[]);if(!a.ok&&!a.cancelled)throw Ur(a);return a.ok&&a.token&&a.url?a:null}async function N1(a,i,r,o,d){const f=await Br("uploadForm",[a,JSON.stringify(i),r,o]);if(!f.ok||!f.status||f.status<200||f.status>=300)throw Ur(f);try{return f.body?JSON.parse(f.body):{}}catch{throw new Bt(f.status||0,"Invalid upload response",{code:"INTERNAL"})}}async function tE(a,i,r,o,d,f){const h=await Br("exportFile",[a,i,r,o,d,f]);if(!h.ok)throw Ur(h);return h}const nE=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],aE=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],sE=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],C1=[1,2,3,4,6,8,12];function lE(){const a=window.LevixHost;return!!(a&&typeof a.pickContact=="function")}function iE(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 rE(a,i){return Vn(a.savedName)||Vn(a.pushName)||Vn(a.name)||Vn(a.targetLabel)||a.phone||i}function Bh(a){return String(a).padStart(2,"0")}function oE(a,i){const r=a.map(o=>i?sE[o]:aE[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 cE(a){return a===1?"كل ساعة":a===2?"كل ساعتين":a>=3&&a<=10?`كل ${a} ساعات`:`كل ${a} ساعة`}function L0(a,i){return i==="image"?a("mediaKindImage"):i==="video"?a("mediaKindVideo"):i==="audio"?a("mediaKindAudio"):i==="document"?a("mediaKindDocument"):i}const Pa=({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 uE(a,i,r,o,d,f,h,m){const p=/^\d{1,2}:\d{2}$/.test(i),x=h||"UTC";if(a==="hourly")return!Number.isInteger(d)||!C1.includes(d)||!Number.isInteger(f)||f<0||f>59?null:m?`${`${cE(d)} عند الدقيقة ${f}`} (${x})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${x})`;if(!p)return null;const[v,y]=i.split(":").map(Number);if(v>23||y>59)return null;const w=`${Bh(v)}:${Bh(y)}`;if(a==="daily")return m?`يومياً الساعة ${w} (${x})`:`Daily at ${w} (${x})`;if(a==="weekly"){const N=[...new Set(r.filter(k=>k>=0&&k<=6))].sort((k,j)=>k-j);if(!N.length)return null;const C=oE(N,m);return m?`كل يوم ${C} الساعة ${w} (${x})`:`Every ${C} at ${w} (${x})`}return a==="monthly"?!Number.isInteger(o)||o<1||o>31?null:m?`كل شهر في اليوم ${o} الساعة ${w} (${x})`:`Every month on day ${o} at ${w} (${x})`:null}const fh={type:"any",delivery:"any",media:"any"};function B0(a){return Vn(a.savedName)||Vn(a.pushName)||Vn(a.targetLabel)||a.targetPhone||a.phone||a.targetJid}function dE(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 fE(a,i,r){const o=[...a],d=(f,h)=>B0(f).localeCompare(B0(h),r,{sensitivity:"base"});if(i==="oldest")o.sort((f,h)=>(f.createdAt??0)-(h.createdAt??0)||d(f,h));else if(i==="target")o.sort(d);else if(i==="status"){const f=h=>h.lastDeliveryStatus==="failed"?0:1;o.sort((h,m)=>f(h)-f(m)||(m.createdAt??0)-(h.createdAt??0)||d(h,m))}else o.sort((f,h)=>(h.createdAt??0)-(f.createdAt??0)||d(f,h));return o}const hE=({isConnected:a=!1,onNavigate:i})=>{const{t:r,language:o}=He(),{toast:d}=_t(),[f,h]=b.useState([]),[m,p]=b.useState("UTC"),[x,v]=b.useState(!0),[y,w]=b.useState(null),[N,C]=b.useState(0),[k,j]=b.useState(""),[_,R]=b.useState("newest"),[I,q]=b.useState(fh),[he,B]=b.useState([]),[z,T]=b.useState(!1),[F,X]=b.useState(null),[re,ae]=b.useState(""),[de,se]=b.useState(!1),[U,D]=b.useState(""),[$,W]=b.useState("recurring"),[ye,O]=b.useState("daily"),[ie,be]=b.useState("09:00"),[we,E]=b.useState([1]),[Y,V]=b.useState(1),[le,ee]=b.useState(1),[ue,me]=b.useState(0),[ce,Se]=b.useState(""),[qe,it]=b.useState(!1),[mt,wt]=b.useState(null),[Le,xe]=b.useState(null),ze=b.useRef(null),[Ne,Pe]=b.useState(null),vt=3,ne=20*1024*1024,te=20,ve=f.length>=vt,Te=o==="ar",jt=b.useMemo(()=>uE(ye,ie,we,Y,le,ue,m,Te),[ye,ie,we,Y,le,ue,m,Te]),Xt=async()=>{v(!0);try{const L=await Q.getSchedules();L!=null&&L.schedules&&(h(L.schedules),L.timezone&&p(L.timezone)),w(null)}catch(L){w(L.message),d(L.message,"error")}finally{v(!1)}},Tt=async()=>{T(!0);try{const L=await Q.getRecipients();L!=null&&L.recipients&&B(L.recipients)}catch{}finally{T(!1)}};b.useEffect(()=>{Xt(),a&&Tt()},[a,N]);const sn=b.useMemo(()=>fE(f.filter(L=>dE(L,k,I)),_,o),[f,k,I,_,o]),Ht=`${k}|${_}|${I.type}|${I.delivery}|${I.media}`,{page:bi,pageCount:xl,pageItems:Fa,setPage:Ts,total:Ka}=qc(sn,20,Ht),vi=(I.type!=="any"?1:0)+(I.delivery!=="any"?1:0)+(I.media!=="any"?1:0),yl=()=>{j(""),q(fh)},Rt=async L=>{try{await Q.deleteSchedule(L),d(r("savedSuccessfully"),"success"),h(Ce=>Ce.filter(xt=>xt.id!==L))}catch(Ce){d(Ce.message,"error")}},Ya=async L=>{if(!a){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await Q.retrySchedule(L),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),Xt()}catch(Ce){d(Ce.message,"error")}},Ds=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 ia;const la=Xn=>{window.removeEventListener("levix-contact",la);const ra=Xn.detail;if(!(ra!=null&&ra.phone)){Qn(null);return}Qn({name:String(ra.name||""),phone:String(ra.phone)})};window.addEventListener("levix-contact",la);try{(ia=L.pickContact)==null||ia.call(L)}catch{window.removeEventListener("levix-contact",la),Qn(null)}});if(!Ce)return;const xt=iE(Ce.phone);if(!xt){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const Sn=`+${xt.split("@")[0]}`,Yn=Vn(Ce.name);X({id:xt,name:Yn||Sn,savedName:Yn,pushName:null,phone:Sn,type:"contact"})},Qa=()=>{X(null),ae(""),D(""),W("recurring"),O("daily"),be("09:00"),E([1]),V(1),ee(1),me(0),Se(""),wt(null),xe(null)},ka=()=>{wt(null),xe(null)},oe=async()=>{try{const L=await k1();if(!L)return;if(L.size>ne){d(r("feedbackFileTooLarge").replace("{max}",String(te)),"error");return}xe(L)}catch(L){d((L==null?void 0:L.message)||"Could not attach the file","error")}},Re=()=>{if(!a){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(ve){d(r("maxSchedulesReached"),"warning");return}Qa(),se(!0),he.length||Tt()},et=L=>{E(Ce=>Ce.includes(L)?Ce.filter(xt=>xt!==L):[...Ce,L].sort((xt,Sn)=>xt-Sn))},Ct=async()=>{if(!F){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!U.trim()&&!mt&&!Le){d(o==="ar"?"يرجى كتابة نص الرسالة أو إرفاق ملف":"Please write the message text or attach a file","warning");return}if($==="once"&&(!ce||new Date(ce).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if($==="recurring"&&ye==="weekly"&&we.length===0){d(r("weekdayRequired"),"warning");return}it(!0);const L={targetJid:F.id,message:U.trim(),type:$};if(F.type==="contact"){const Ce=Vn(F.savedName)||Vn(F.name);Ce&&Ce!==F.phone&&(L.targetName=Ce)}if($==="recurring"){const Ce={kind:ye};ye==="hourly"?(Ce.everyHours=le,Ce.time=`00:${Bh(ue)}`):(Ce.time=ie,ye==="weekly"&&(Ce.weekdays=we),ye==="monthly"&&(Ce.dayOfMonth=Y)),L.recurrence=Ce}else L.scheduledTime=new Date(ce).getTime();try{const Ce={};for(const[xt,Sn]of Object.entries(L))Ce[xt]=xt==="recurrence"?JSON.stringify(Sn):String(Sn);Le?await N1("/dashboard/api/schedules",Ce,Le.token,ne+1024*1024):mt?await Q.postMultipart("/schedules",Ce,mt):await Q.createSchedule(L),d(r("savedSuccessfully"),"success"),se(!1),Qa(),Xt()}catch(Ce){d(Ce.message,"error")}finally{it(!1)}},fn=he.filter(L=>{var xt,Sn,Yn;const Ce=re.toLowerCase().trim();return Ce?L.name.toLowerCase().includes(Ce)||!!((xt=L.savedName)!=null&&xt.toLowerCase().includes(Ce))||!!((Sn=L.pushName)!=null&&Sn.toLowerCase().includes(Ce))||!!((Yn=L.phone)!=null&&Yn.toLowerCase().includes(Ce)):!0}),Fe=(L,Ce,xt=!0)=>{var ia;if(L.type==="group"||L.targetKind==="group"||!!((ia=L.targetJid)!=null&&ia.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:[xt&&s.jsx(il,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${Ce} truncate`,children:Xn})]})}const Yn=L.phone||L.targetPhone||null,Qn=rE(L,r("contactFallback")),la=!!(Yn&&Qn!==Yn);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[xt&&s.jsx(oc,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${Ce} truncate block`,children:Qn}),la&&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(sl,{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(fl,{icon:s.jsx(yh,{size:24}),title:s.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:[r("schedules"),s.jsxs(nt,{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:m})," ","· ",r("headerSubtitle")]}),actions:s.jsx(fe,{variant:"primary",size:"lg",className:"w-full sm:w-auto",icon:s.jsx(rl,{size:18}),onClick:Re,disabled:ve||!a,children:a?r(ve?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"})}),!x&&!y&&f.length>0&&s.jsxs(ml,{children:[s.jsx(Xe,{type:"search",name:"schedule-search",autoComplete:"off",value:k,onChange:L=>j(L.target.value),placeholder:r("searchSchedules"),"aria-label":r("searchSchedules"),className:"min-w-48 flex-1"}),s.jsx(Lr,{label:r("sort"),value:_,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:vi,onReset:()=>q(fh),children:[s.jsx(vn,{label:r("thType"),name:"schedule-type-filter",value:I.type,onChange:L=>q(Ce=>({...Ce,type:L})),options:[{value:"any",label:r("statusAny")},{value:"recurring",label:r("typeRecurring")},{value:"once",label:r("typeOnce")}]}),s.jsx(vn,{label:r("thDelivery"),name:"schedule-delivery-filter",value:I.delivery,onChange:L=>q(Ce=>({...Ce,delivery:L})),options:[{value:"any",label:r("statusAny")},{value:"active",label:r("deliveryActive")},{value:"failed",label:r("deliveryFailed")}]}),s.jsx(vn,{label:r("thMedia"),name:"schedule-media-filter",value:I.media,onChange:L=>q(Ce=>({...Ce,media:L})),options:[{value:"any",label:r("statusAny")},{value:"with",label:r("mediaWith")},{value:"without",label:r("mediaWithout")}]})]})]}),x&&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(Ke,{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Vt,{className:"size-10 rounded-xl"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s.jsx(Vt,{className:"h-4 w-32"}),s.jsx(Vt,{className:"h-3 w-24"})]})]}),s.jsx(Vt,{className:"h-4 w-full"}),s.jsx(Vt,{className:"h-6 w-28"})]},L))}),!x&&y&&s.jsx(ut,{kind:"error",icon:s.jsx(sl,{size:28}),description:y,action:s.jsx(fe,{variant:"secondary",icon:s.jsx(ol,{size:16}),onClick:()=>C(L=>L+1),children:r("retryLoad")})}),!x&&!y&&f.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(yh,{size:28}),text:r("noSchedules"),action:s.jsx(fe,{variant:"primary",icon:s.jsx(rl,{size:16}),onClick:Re,disabled:!a||ve,children:r("scheduleNewMsg")})}),!x&&!y&&f.length>0&&sn.length===0&&s.jsx(ut,{kind:"no-results",action:s.jsx(fe,{variant:"secondary",onClick:yl,children:r("clearFilters")})}),!x&&!y&&sn.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 gap-3 md:hidden",children:Fa.map(L=>s.jsxs(Ke,{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(il,{size:18}):s.jsx(oc,{size:18})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("bdi",{children:Fe({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(Ia,{size:16}),onClick:()=>{Ya(L.id)}}),s.jsx(Oe,{label:r("scheduleDetails"),variant:"ghost",icon:s.jsx(zr,{size:16}),onClick:()=>Pe(L)}),s.jsx(sa,{label:r("moreActions"),children:s.jsx(lt,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{Rt(L.id)},children:r("delete")})})]})]}),s.jsx(Kn,{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(nt,{tone:"info",children:[s.jsx(wr,{size:12}),L0(r,L.media.kind)]}),s.jsx(nt,{tone:L.type==="recurring"?"info":"neutral",children:L.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsxs(Nr,{tone:L.lastDeliveryStatus==="failed"?"danger":L.status==="active"?"ok":"neutral",children:[L.lastDeliveryStatus==="failed"?s.jsx(sl,{size:13}):s.jsx(js,{size:13}),s.jsx("span",{children:L.lastDeliveryStatus==="failed"?r("deliveryFailed"):L.status==="active"?r("deliveryActive"):L.status})]})]})]},L.id))}),s.jsx(Ke,{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:Fa.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:Fe({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(Kn,{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(nt,{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(Nr,{tone:L.lastDeliveryStatus==="failed"?"danger":L.status==="active"?"ok":"neutral",children:[L.lastDeliveryStatus==="failed"?s.jsx(sl,{size:13}):s.jsx(js,{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(Ia,{size:16}),onClick:()=>{Ya(L.id)}}),s.jsx(sa,{label:r("moreActions"),children:s.jsx(lt,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{Rt(L.id)},children:r("delete")})})]})})]},L.id))})]})})}),s.jsx(xi,{page:bi,pageCount:xl,total:Ka,onPageChange:Ts})]}),s.jsx(an,{isOpen:de,onClose:()=>se(!1),title:r("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>se(!1),children:r("cancel")}),s.jsx(fe,{variant:"primary",loading:qe,onClick:Ct,disabled:qe||!F||!U.trim()&&!mt&&!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(il,{size:16}):s.jsx(oc,{size:16})}),s.jsx("div",{className:"min-w-0",children:Fe(F,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx(Oe,{label:r("changeChat"),variant:"ghost",icon:s.jsx(Fn,{size:16}),onClick:()=>X(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(Gh,{size:16,className:"pointer-events-none absolute start-3 top-1/2 -translate-y-1/2 text-muted"}),s.jsx(Xe,{type:"search",value:re,onChange:L=>ae(L.target.value),placeholder:r("searchRecipients"),"aria-label":r("searchRecipients"),className:"ps-9"})]}),lE()&&s.jsx(fe,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(Ww,{size:15}),onClick:Ds,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:z?s.jsx("div",{className:"flex justify-center p-4",children:s.jsx(Va,{label:r("loading")})}):fn.length===0?s.jsx(ut,{className:"px-4 py-4",text:r("noRecipientsFound")}):fn.map(L=>s.jsxs(fe,{variant:"ghost",onClick:()=>X(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(il,{size:14}):s.jsx(oc,{size:14})}),s.jsx("div",{className:"min-w-0",children:Fe(L,"text-xs font-bold text-text-main",!1)})]}),s.jsx(nt,{tone:"neutral",className:"shrink-0",children:L.type==="group"?r("groupFallback"):r("contactFallback")})]},L.id))})]})]}),s.jsx(st,{label:r("scheduleType"),htmlFor:"schedule-type",children:s.jsxs(Qt,{id:"schedule-type",value:$,onChange:L=>W(L.target.value),children:[s.jsx("option",{value:"recurring",children:r("scheduleRecurring")}),s.jsx("option",{value:"once",children:r("scheduleOnce")})]})}),$==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsx(st,{label:r("repeat"),htmlFor:"repeat-kind",children:s.jsxs(Qt,{id:"repeat-kind",value:ye,onChange:L=>O(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")})]})}),ye==="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:nE.map((L,Ce)=>{const xt=we.includes(Ce);return s.jsx(fe,{size:"sm",variant:xt?"primary":"secondary","aria-pressed":xt,onClick:()=>et(Ce),children:r(L)},L)})})]}),ye==="monthly"&&s.jsx(st,{label:r("dayOfMonth"),htmlFor:"day-of-month",description:r("monthDayHint"),children:s.jsx(Xe,{id:"day-of-month",type:"number",min:1,max:31,inputMode:"numeric",value:Y,onChange:L=>V(Number(L.target.value))})}),ye==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[s.jsx(st,{label:r("everyHours"),htmlFor:"every-hours",children:s.jsx(Qt,{id:"every-hours",value:le,onChange:L=>ee(Number(L.target.value)),children:C1.map(L=>s.jsx("option",{value:L,children:L},L))})}),s.jsx(st,{label:r("atMinute"),htmlFor:"hourly-minute",children:s.jsx(Xe,{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",value:ue,onChange:L=>me(Number(L.target.value)),dir:"ltr"})})]}):s.jsx(st,{label:s.jsxs(s.Fragment,{children:[r("sendTime"),s.jsxs("span",{className:"ms-1.5 font-semibold text-muted",children:["(",m,")"]})]}),htmlFor:"send-time",children:s.jsx(Xe,{id:"send-time",type:"time",value:ie,onChange:L=>be(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(st,{label:r("deliveryDateTime"),htmlFor:"one-off-time",children:s.jsx(Xe,{id:"one-off-time",type:"datetime-local",value:ce,onChange:L=>Se(L.target.value),dir:"ltr"})}),s.jsx(st,{label:s.jsxs(s.Fragment,{children:[r("messageText")," ",!mt&&!Le&&s.jsx("span",{className:"text-danger",children:"*"})]}),htmlFor:"schedule-message",children:s.jsx(Tc,{id:"schedule-message",rows:3,placeholder:r("messagePlaceholder"),value:U,onChange:L=>D(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||mt?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(wr,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"max-w-[220px] truncate",children:(Le==null?void 0:Le.name)??(mt==null?void 0:mt.name)}),s.jsx(Oe,{label:r("scheduleRemoveMedia"),variant:"ghost",icon:s.jsx(Fn,{size:14}),onClick:ka})]}):s.jsx(fe,{variant:"secondary",size:"sm",icon:s.jsx(wr,{size:14,className:"text-brand-cyan"}),onClick:()=>{var L;return Mc()?void oe():(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(te))})]}),!Mc()&&s.jsx("input",{ref:ze,type:"file",className:"sr-only",onChange:L=>{var xt;const Ce=((xt=L.target.files)==null?void 0:xt[0])??null;if(L.target.value="",!!Ce){if(Ce.size>ne){d(r("feedbackFileTooLarge").replace("{max}",String(te)),"error");return}wt(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(Ia,{size:16}),onClick:()=>{const L=Ne.id;Pe(null),Ya(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(sa,{label:r("moreActions"),children:s.jsx(lt,{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(Pa,{label:r("thTarget"),children:s.jsx("bdi",{children:Fe({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(Pa,{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(Pa,{label:r("detailMedia"),children:s.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[s.jsx(wr,{size:13,className:"text-brand-cyan shrink-0"}),s.jsxs("span",{className:"truncate",children:[L0(r,Ne.media.kind),Ne.media.fileName?` · ${Ne.media.fileName}`:""]})]})}),s.jsx(Pa,{label:r("thSchedule"),children:s.jsx("span",{dir:"auto",children:Te&&Ne.whenAr||Ne.when})}),s.jsx(Pa,{label:r("thType"),children:Ne.type==="recurring"?r("typeRecurring"):r("typeOnce")}),s.jsx(Pa,{label:r("thDelivery"),children:s.jsxs(Nr,{tone:Ne.lastDeliveryStatus==="failed"?"danger":Ne.status==="active"?"ok":"neutral",children:[Ne.lastDeliveryStatus==="failed"?s.jsx(sl,{size:13}):s.jsx(js,{size:13}),s.jsx("span",{children:Ne.lastDeliveryStatus==="failed"?r("deliveryFailed"):Ne.status==="active"?r("deliveryActive"):Ne.status})]})}),Ne.lastRunAt&&s.jsx(Pa,{label:r("detailLastRun"),children:new Date(Ne.lastRunAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")}),Ne.lastError&&s.jsx(Pa,{label:r("detailError"),children:s.jsx("span",{className:"text-danger break-words",dir:"auto",children:Ne.lastError})}),Ne.createdAt&&s.jsx(Pa,{label:r("detailCreated"),children:new Date(Ne.createdAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")})]})})]})},hh={messageMin:10,messageMax:2e3,attachmentMax:20*1024*1024},mh={bug:{icon:ej,labelKey:"feedbackTopicBug"},idea:{icon:mj,labelKey:"feedbackTopicIdea"},question:{icon:fv,labelKey:"feedbackTopicQuestion"},praise:{icon:uj,labelKey:"feedbackTopicPraise"},other:{icon:mi,labelKey:"feedbackTopicOther"}},mE=["bug","idea","question","praise","other"],pE=()=>{var me;const{t:a,language:i,theme:r}=He(),{toast:o}=_t(),[d,f]=b.useState(null),[h,m]=b.useState("bug"),[p,x]=b.useState(""),[v,y]=b.useState(0),[w,N]=b.useState(""),[C,k]=b.useState(null),[j,_]=b.useState(null),[R,I]=b.useState(!1),[q,he]=b.useState(null),[B,z]=b.useState(!1),[T,F]=b.useState(!1),[X,re]=b.useState(null),[ae,de]=b.useState(!1),[se,U]=b.useState(!1),D=b.useRef(null);b.useEffect(()=>{Q.getFeedbackMeta().then(f).catch(()=>{})},[]),b.useEffect(()=>{if(!R){he(null);return}const ce=Ch(i,r);z(!0),Q.getFeedbackDiagnosticsPreview(ce).then(Se=>{Se!=null&&Se.diagnostics?he(Se.diagnostics):he(ce)}).catch(()=>{he(ce)}).finally(()=>{z(!1)})},[R,i,r]);const $=(d==null?void 0:d.messageMin)??hh.messageMin,W=(d==null?void 0:d.messageMax)??hh.messageMax,ye=(d==null?void 0:d.attachmentMax)??hh.attachmentMax,O=Math.round(ye/(1024*1024)),ie=p.trim(),be=Math.max(0,$-ie.length),we=ce=>ce>=1024*1024?a("fileSizeMb").replace("{size}",(ce/(1024*1024)).toFixed(1)):a("fileSizeKb").replace("{size}",String(Math.max(1,Math.round(ce/1024)))),E=((me=d==null?void 0:d.topics)!=null&&me.length?d.topics:mE).filter(ce=>ce in mh),Y=()=>o(a("feedbackFileTooLarge").replace("{max}",String(O)),"error"),V=async()=>{try{const ce=await k1();if(!ce)return;if(ce.size>ye){Y();return}_(ce)}catch(ce){o((ce==null?void 0:ce.message)||"Could not attach the file","error")}},le=async ce=>{if(ce.preventDefault(),be>0||ae)return;de(!0),re(j?0:null);const Se=R?Ch(i,r):void 0,qe={message:ie,topic:h,rating:v||null,contact:w.trim()||null,...Se?{diagnostics:Se}:{}};try{j?await N1("/dashboard/api/feedback",{message:qe.message,topic:qe.topic,...qe.rating?{rating:String(qe.rating)}:{},...qe.contact?{contact:qe.contact}:{},...Se?{diagnostics:JSON.stringify(Se)}:{}},j.token,ye+1024*1024):C?await Q.sendFeedbackMultipart(qe,C,it=>re(it)):await Q.sendFeedback(qe),U(!0),o(a("feedbackSent"),"success")}catch(it){o(it==null?void 0:it.message,"error")}finally{de(!1),re(null)}},ee=()=>{x(""),N(""),y(0),m("bug"),k(null),_(null),I(!1),he(null),F(!1),U(!1)},ue=()=>{k(null),_(null)};return se?s.jsxs(Ke,{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(js,{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:ee,children:a("feedbackSendAnother")})]}):s.jsx("div",{className:"flex flex-col gap-5",children:s.jsx(Ke,{children:s.jsxs("form",{onSubmit:le,className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-10 h-10 sm:w-11 sm:h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(mi,{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(st,{label:a("feedbackTopicLabel"),children:s.jsx(Pc,{"aria-label":a("feedbackTopicLabel"),value:h,onChange:m,className:"flex-wrap gap-1.5 sm:gap-2",options:E.map(ce=>{const Se=mh[ce].icon;return{value:ce,label:a(mh[ce].labelKey),icon:s.jsx(Se,{size:16})}})})}),s.jsxs(st,{label:a("feedbackMessageLabel"),htmlFor:"feedback-message",children:[s.jsx(Tc,{id:"feedback-message",rows:6,required:!0,maxLength:W,value:p,onChange:ce=>x(ce.target.value),placeholder:a("feedbackMessagePlaceholder")}),s.jsx("span",{className:"self-end text-[11px] tabular-nums text-muted",children:be>0?`${be} ${a("feedbackCharsNeeded")}`:`${p.length} / ${W}`})]}),s.jsxs(st,{label:a("feedbackAttach"),description:a("feedbackAttachmentHint").replace("{max}",String(O)),children:[j||C?s.jsx("span",{className:"flex",children:s.jsx(Hc,{onRemove:ue,removeLabel:a("feedbackRemoveAttachment"),className:"max-w-full",children:`${(j==null?void 0:j.name)??(C==null?void 0:C.name)} · ${we((j==null?void 0:j.size)??(C==null?void 0:C.size)??0)}`})}):s.jsx(fe,{type:"button",variant:"secondary",icon:s.jsx(wr,{size:16,className:"text-brand-cyan"}),className:"w-full justify-center border-dashed",onClick:()=>{var ce;return Mc()?void V():(ce=D.current)==null?void 0:ce.click()},children:a("feedbackAttach")}),!Mc()&&s.jsx("input",{ref:D,type:"file",className:"sr-only",onChange:ce=>{var qe;const Se=((qe=ce.target.files)==null?void 0:qe[0])??null;if(ce.target.value="",!!Se){if(Se.size>ye){Y();return}k(Se)}}})]}),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(ce=>s.jsx(Oe,{label:`${ce} / 5`,variant:"ghost","aria-pressed":v===ce,onClick:()=>y(v===ce?0:ce),icon:s.jsx(Bc,{size:22,className:ce<=v?"fill-brand-cyan text-brand-cyan":"text-muted"})},ce))})]}),s.jsx(st,{label:a("feedbackContactLabel"),htmlFor:"feedback-contact",children:s.jsx(Xe,{id:"feedback-contact",type:"text",maxLength:200,value:w,onChange:ce=>N(ce.target.value),placeholder:a("feedbackContactPlaceholder")})}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(Dr,{id:"feedback-diagnostics-consent",checked:R,onChange:ce=>I(ce.target.checked),label:a("feedbackAttachDiagnostics")}),R&&s.jsxs("details",{open:T,onToggle:ce=>F(ce.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(Va,{className:"size-3.5 shrink-0 text-muted"}):s.jsx(fi,{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&&!q?s.jsx("p",{className:"text-muted",children:a("feedbackDiagnosticsLoading")}):q?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(q,null,2)}):s.jsx("p",{className:"text-muted",children:a("feedbackDiagnosticsEmpty")})})]})]}),ae&&(j||C)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:j?s.jsx("div",{className:"h-full w-1/3 rounded-full bg-brand-blue animate-pulse"}):s.jsx("div",{className:"h-full rounded-full bg-brand-blue transition-[width]",style:{width:`${Math.max(4,Math.round((X??0)*100))}%`}})}),s.jsxs("span",{className:"text-[11px] text-muted tabular-nums",children:[a("feedbackSending"),!j&&X!==null&&X>0?` ${Math.round(X*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:be>0,loading:ae,icon:s.jsx(mi,{size:16}),className:"w-full sm:w-auto",children:a(ae?"feedbackSending":"feedbackSendBtn")})]}),s.jsxs("details",{className:"group rounded-xl border border-line bg-panel-raised",children:[s.jsxs("summary",{className:"flex min-h-10 cursor-pointer list-none items-center gap-2 px-3 py-2 text-xs font-semibold text-muted select-none hover:text-text-main [&::-webkit-details-marker]:hidden",children:[s.jsx(Vh,{size:14,className:"shrink-0 text-brand-cyan"}),s.jsx("span",{className:"flex-1",children:a("feedbackWhatIsSent")}),s.jsx(fi,{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(ij,{size:13,"aria-hidden":!0,className:"shrink-0"})]})]})]})]})})})},gE=()=>{const{t:a}=He(),{toast:i}=_t(),[r,o]=b.useState([]),[d,f]=b.useState([]),[h,m]=b.useState(!0),[p,x]=b.useState(null),[v,y]=b.useState(null),[w,N]=b.useState(null),[C,k]=b.useState(!1),j=b.useCallback(async()=>{x(null);try{const q=await Q.getCrashReports();q&&(o(q.reports||[]),f(q.sent||[]))}catch(q){x((q==null?void 0:q.message)||"Failed to load crash reports")}finally{m(!1)}},[]);b.useEffect(()=>{j()},[j]);const _=async q=>{y(q);try{await Q.sendCrashReport(q),i(a("reportSentSuccess"),"success"),await j()}catch(he){i((he==null?void 0:he.message)||"Send failed","error"),await j()}finally{y(null)}},R=async q=>{try{await Q.deleteCrashReport(q),i(a("reportDeleteSuccess"),"success"),await j()}catch(he){i((he==null?void 0:he.message)||"Delete failed","error")}finally{N(null)}},I=async()=>{try{await Q.deleteAllCrashReports(),i(a("allReportsDeleted"),"success"),await j()}catch(q){i((q==null?void 0:q.message)||"Delete all failed","error")}finally{k(!1)}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(Ke,{className:"flex flex-col gap-5",children:[s.jsx(na,{icon:s.jsx(Mr,{size:22}),title:a("diagnosticsTitle"),description:a("diagnosticsDesc"),actions:r.length>0?s.jsx(sa,{label:a("more"),children:s.jsx(lt,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>k(!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(nt,{tone:"info",className:"tabular-nums",children:r.length})]}),h?s.jsx(Es,{text:a("loading")}):p?s.jsx(ut,{kind:"error",title:p,action:s.jsx(fe,{variant:"secondary",onClick:j,children:a("retry")})}):r.length===0?s.jsx(ut,{kind:"empty",icon:s.jsx(js,{size:32,className:"text-ok"}),title:a("noPendingReports")}):s.jsx("div",{className:"flex flex-col gap-3",children:r.map(q=>{const{status:he,lastError:B,...z}=q;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(nt,{tone:"neutral",children:q.category}),s.jsx("span",{className:"font-mono text-xs sm:text-sm font-bold text-text-main truncate",children:q.error.type}),s.jsx(Dc,{value:q.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:v===q.id,disabled:v!==null,onClick:()=>_(q.id),icon:s.jsx(mi,{size:14}),children:v===q.id?a("sendingReport"):a("sendReport")}),s.jsx(Oe,{label:a("deleteReport"),icon:s.jsx(In,{size:16}),variant:"ghost",onClick:()=>N(q.id)})]})]}),s.jsx("p",{className:"text-xs leading-relaxed text-muted select-text",children:q.error.message}),q.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(ul,{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:q.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(fi,{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(z,null,2)})})]})]},q.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(nt,{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(q=>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(nt,{tone:"neutral",className:"shrink-0",children:q.category}),s.jsx("span",{className:"font-mono font-semibold text-text-main select-all",children:q.id}),s.jsx("span",{className:"text-muted truncate",children:q.type})]}),s.jsx(Dc,{value:q.sentAt,className:"text-muted shrink-0"})]},q.id))})]})]}),s.jsx(Rr,{isOpen:w!==null,onClose:()=>N(null),onConfirm:()=>w&&R(w),title:a("confirmDeleteReport"),description:a("confirmDeleteReportDesc"),confirmLabel:a("deleteReport"),cancelLabel:a("cancel"),variant:"danger"}),s.jsx(Rr,{isOpen:C,onClose:()=>k(!1),onConfirm:I,title:a("confirmDeleteAllReports"),description:a("confirmDeleteAllDesc"),confirmLabel:a("deleteAllReports"),cancelLabel:a("cancel"),variant:"danger"})]})},xE=["general","integrations","proxy","security","storage","feedback","diagnostics"];function U0(){const a=window.location.hash.replace(/^#\/?/,"").split("/");return a[0]==="settings"&&a[1]&&xE.includes(a[1])?a[1]:"general"}const yE=["!","/",".","#","$","?"],bE="levix-settings";function vE(a){const i=new TextEncoder().encode(a);let r="";for(const o of i)r+=String.fromCharCode(o);return btoa(r)}const SE=()=>{var ze,Ne,Pe,vt;const{t:a,language:i,setLanguage:r}=He(),{toast:o}=_t(),[d,f]=b.useState(U0);b.useEffect(()=>{const ne=()=>{const te=U0();f(ve=>ve!==te?te:ve)};return window.addEventListener("hashchange",ne),()=>window.removeEventListener("hashchange",ne)},[]);const h=ne=>{f(ne),window.location.hash=`settings/${ne}`},[m,p]=b.useState({}),[x,v]=b.useState({}),[y,w]=b.useState(!0),[N,C]=b.useState("!"),[k,j]=b.useState("!"),[_,R]=b.useState(!1),[I,q]=b.useState(""),[he,B]=b.useState(""),[z,T]=b.useState(""),[F,X]=b.useState(!1),[re,ae]=b.useState(!1),[de,se]=b.useState(!1),[U,D]=b.useState(null),$=b.useRef(null),W=async(ne,te)=>{await Q.updateSetting(ne,te),ne.endsWith("_api_key")||ne==="whatsapp_proxy_password"?(p(Te=>({...Te,[ne]:""})),v(Te=>({...Te,[ne]:!!String(te||"").trim()}))):p(Te=>({...Te,[ne]:te}))},ye=async(ne,te)=>{p(ve=>({...ve,[ne]:te}));try{await Q.updateSetting(ne,te),o(a("savedSuccessfully"),"success")}catch(ve){o(ve.message,"error"),await it()}},O=Tn(i),ie=Tn(String(m.bot_language||"auto")),be=Tn(String(m.bot_timezone||"Africa/Cairo")),we=Tn(String(m.openweathermap_api_key||"")),E=Tn(String(m.youtube_api_key||"")),Y=Tn(Number(m.forward_score_ttl_days||30)),V=Tn(Number(m.max_fetch_bytes||524288)),le=Tn(Number(m.sticker_library_limit||1e3)),ee=Tn(Number(m.auto_delete_keep_days||30)),ue=kh({min:Number(m.bot_min_delay_ms??400),max:Number(m.bot_max_delay_ms??900)}),me=kh({protocol:String(m.whatsapp_proxy_protocol||"http"),host:String(m.whatsapp_proxy_host||""),port:Number(m.whatsapp_proxy_port||0),username:String(m.whatsapp_proxy_username||""),password:String(m.whatsapp_proxy_password||"")}),ce=async()=>{var ne;ae(!0);try{const te=await Q.exportSettings(),ve=JSON.stringify(te,null,2),Te=`levix-settings-${((ne=te.exportedAt)==null?void 0:ne.slice(0,10))||"export"}.json`,jt=window.LevixHost;if(jt&&typeof jt.saveExportFile=="function"){const Ht=JSON.parse(jt.saveExportFile(Te,vE(ve)));if(!(Ht!=null&&Ht.ok))throw new Error((Ht==null?void 0:Ht.error)||a("exportSettingsError"));o(`${a("exportSettingsSuccess")} — ${a("exportSavedTo")} ${Ht.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(te){o(te.message||a("exportSettingsError"),"error")}finally{ae(!1)}},Se=async ne=>{var Te;const te=(Te=ne.target.files)==null?void 0:Te[0];if(ne.target.value="",!te)return;let ve;try{ve=JSON.parse(await te.text())}catch{o(a("importSettingsError"),"error");return}if((ve==null?void 0:ve.format)!==bE){o(a("importSettingsError"),"error");return}D(ve)},qe=async()=>{var ne,te,ve;if(U){se(!0);try{const Te=await Q.importSettings(U),jt=[`${((ne=Te.applied)==null?void 0:ne.length)||0} ${a("importSettingsCount")}`];(te=Te.skipped)!=null&&te.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"),D(null),await it()}catch(Te){o(Te.message,"error")}finally{se(!1)}}},it=async()=>{try{const ne=await Q.getSettings();if(ne!=null&&ne.settings){const te={},ve={};ne.settings.forEach(Te=>{Te.type==="secret"?(ve[Te.key]=!!Te.configured,te[Te.key]=""):te[Te.key]=Te.value}),p(te),v(ve)}ne!=null&&ne.prefix&&(C(ne.prefix),j(ne.prefix))}catch(ne){o(ne.message,"error")}finally{w(!1)}};b.useEffect(()=>{it()},[]);const mt=async ne=>{const te=(ne!==void 0?ne:k).trim();if(!te||te.length>3){o(a("prefixValidation"),"error");return}R(!0);try{await Q.updatePrefix(te),C(te),j(te),o(`${a("prefixUpdated")} (${te})`,"success")}catch(ve){o(ve.message,"error")}finally{R(!1)}},wt=async ne=>{if(ne.preventDefault(),he!==z){o(a("passwordMatchError"),"error");return}if(he.length<8){o(a("passwordMinLength"),"error");return}X(!0);try{await Q.changePassword(I,he),o(a("passwordChangedSuccess"),"success"),q(""),B(""),T("")}catch(te){o(te.message,"error")}finally{X(!1)}},Le={saveLabel:a("save"),savedLabel:a("saved")},xe={saveLabel:a("save"),discardLabel:a("discard"),unsavedLabel:a("unsavedChanges"),savedLabel:a("saved")};return y?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(Va,{className:"size-6",label:a("loading")})}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsx(Pc,{value:d,onChange:ne=>h(ne),"aria-label":a("settings"),className:"overflow-x-auto",options:[{value:"general",label:a("tabGeneral"),icon:s.jsx(cv,{size:17})},{value:"integrations",label:a("tabIntegrations"),icon:s.jsx(vh,{size:17})},{value:"proxy",label:a("tabProxy"),icon:s.jsx(Ac,{size:17})},{value:"security",label:a("tabSecurity"),icon:s.jsx(Vh,{size:17})},{value:"storage",label:a("tabStorage"),icon:s.jsx(Uy,{size:17})},{value:"feedback",label:a("tabFeedback"),icon:s.jsx(yj,{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(Ke,{className:"flex flex-col gap-4 sm:gap-5",children:[s.jsx(na,{icon:s.jsx(cl,{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(nt,{tone:"info",className:"font-mono",children:N})]})}),s.jsxs("div",{className:"flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-semibold text-muted",children:a("prefixPresets")}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:yE.map(ne=>{const te=N===ne;return s.jsx(Oe,{label:ne,size:"md",variant:te?"primary":"secondary",className:"font-mono",onClick:()=>{j(ne),mt(ne)},children:ne},ne)})})]}),s.jsx(st,{label:a("changePrefix"),className:"min-w-[200px] flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{type:"text",className:"h-11 w-20 text-center font-mono sm:w-24",maxLength:3,placeholder:a("prefixPlaceholder"),value:k,onChange:ne=>j(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&mt()}}),s.jsx(fe,{variant:"primary",icon:s.jsx(hi,{size:16}),onClick:()=>mt(),disabled:_||k.trim()===N,loading:_,children:a(_?"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(nt,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[k||N,"help"]})}),s.jsx(nt,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[k||N,"lang ar"]})}),s.jsx(nt,{tone:"info",className:"font-mono",children:s.jsxs("code",{children:[k||N,"sticker"]})})]})]}),s.jsxs(Ke,{className:"flex flex-col gap-4",children:[s.jsx(na,{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(Dn,{label:a("interfaceLanguage"),description:a("interfaceLanguageDesc"),htmlFor:"panel-language",dirty:O.dirty,saving:O.status==="saving",justSaved:O.status==="saved",error:O.error,onSave:()=>O.save(async ne=>r(ne)),onRevert:O.revert,...Le,children:s.jsxs(Qt,{id:"panel-language",value:O.value,onChange:ne=>{const te=ne.target.value;(te==="ar"||te==="en")&&O.setValue(te)},children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]})}),s.jsx(Dn,{label:a("botLanguage"),description:a("botLanguageDesc"),htmlFor:"bot-language",dirty:ie.dirty,saving:ie.status==="saving",justSaved:ie.status==="saved",error:ie.error,onSave:()=>ie.save(ne=>W("bot_language",ne)),onRevert:ie.revert,...Le,children:s.jsxs(Qt,{id:"bot-language",value:ie.value,onChange:ne=>ie.setValue(ne.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(Dn,{label:a("botTimezone"),description:a("botTimezoneDesc"),htmlFor:"bot-timezone",dirty:be.dirty,saving:be.status==="saving",justSaved:be.status==="saved",error:be.error,onSave:()=>be.save(ne=>W("bot_timezone",ne)),onRevert:be.revert,...Le,children:s.jsx(Xe,{id:"bot-timezone",type:"text",technical:!0,className:"font-mono",placeholder:"Africa/Cairo",value:be.value,onChange:ne=>be.setValue(ne.target.value)})})]}),s.jsxs("form",{className:"flex flex-col gap-3",onSubmit:ne=>{ne.preventDefault(),ue.save(async te=>{if(te.min>te.max)throw new Error(a("delayRangeError"));await W("bot_min_delay_ms",te.min),await W("bot_max_delay_ms",te.max)})},onKeyDown:ne=>{ne.key==="Escape"&&ue.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[s.jsx(st,{label:a("botMinDelay"),description:a("delaysDesc"),htmlFor:"bot-min-delay",children:s.jsx(Xe,{id:"bot-min-delay",type:"number",value:ue.draft.min,onChange:ne=>ue.setField("min",Number(ne.target.value))})}),s.jsx(st,{label:a("botMaxDelay"),htmlFor:"bot-max-delay",children:s.jsx(Xe,{id:"bot-max-delay",type:"number",value:ue.draft.max,onChange:ne=>ue.setField("max",Number(ne.target.value))})})]}),s.jsx(Nh,{dirty:ue.dirty,saving:ue.status==="saving",justSaved:ue.status==="saved",error:ue.error,onDiscard:ue.revert,...xe})]})]}),s.jsxs(Ke,{className:"flex flex-col gap-4",children:[s.jsx(na,{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(kv,{size:16}),onClick:ce,loading:re,children:a("exportAction")}),s.jsx(fe,{variant:"secondary",icon:s.jsx(Lc,{size:16}),onClick:()=>{var ne;return(ne=$.current)==null?void 0:ne.click()},children:a("importSettings")})]}),s.jsx("input",{ref:$,type:"file",accept:"application/json,.json",className:"hidden",onChange:Se})]})]}),d==="integrations"&&s.jsxs(Ke,{className:"flex flex-col gap-5",children:[s.jsx(na,{icon:s.jsx(vh,{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(Dn,{label:a("weatherApiKey"),description:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command",htmlFor:"weather-api-key",dirty:we.dirty,saving:we.status==="saving",justSaved:we.status==="saved",error:we.error,onSave:()=>we.save(async ne=>{await W("openweathermap_api_key",ne),we.setValue("")}),onRevert:we.revert,...Le,children:s.jsx(al,{id:"weather-api-key",className:"font-mono",placeholder:x.openweathermap_api_key?"••••••••••••":"OpenWeatherMap API Key",value:we.value,onChange:ne=>we.setValue(ne.target.value)})}),s.jsx(Dn,{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 ne=>{await W("youtube_api_key",ne),E.setValue("")}),onRevert:E.revert,...Le,children:s.jsx(al,{id:"youtube-api-key",className:"font-mono",placeholder:x.youtube_api_key?"••••••••••••":"YouTube Data API Key",value:E.value,onChange:ne=>E.setValue(ne.target.value)})})]})]}),d==="proxy"&&s.jsxs(Ke,{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(na,{className:"min-w-0 flex-1",icon:s.jsx(Ac,{size:22}),title:a("proxyTitle"),description:a("proxyDesc")}),s.jsx(bn,{className:"shrink-0",checked:!!m.whatsapp_proxy_enabled,onChange:ne=>ye("whatsapp_proxy_enabled",ne)})]}),s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:ne=>{ne.preventDefault(),me.save(async te=>{await W("whatsapp_proxy_protocol",te.protocol),await W("whatsapp_proxy_host",te.host),await W("whatsapp_proxy_port",te.port),await W("whatsapp_proxy_username",te.username),te.password.trim()&&await W("whatsapp_proxy_password",te.password),me.setDraft({...te,password:""})})},onKeyDown:ne=>{ne.key==="Escape"&&me.revert()},children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(st,{label:a("proxyProtocol"),htmlFor:"proxy-protocol",children:s.jsxs(Qt,{id:"proxy-protocol",value:me.draft.protocol,onChange:ne=>me.setField("protocol",ne.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(st,{label:a("proxyHost"),htmlFor:"proxy-host",children:s.jsx(Xe,{id:"proxy-host",type:"text",technical:!0,className:"font-mono",placeholder:"proxy.example.com",value:me.draft.host,onChange:ne=>me.setField("host",ne.target.value)})}),s.jsx(st,{label:a("proxyPort"),htmlFor:"proxy-port",children:s.jsx(Xe,{id:"proxy-port",type:"number",placeholder:"1080",value:me.draft.port,onChange:ne=>me.setField("port",Number(ne.target.value))})}),s.jsx(st,{label:a("proxyUsername"),htmlFor:"proxy-username",children:s.jsx(Xe,{id:"proxy-username",type:"text",technical:!0,className:"font-mono",value:me.draft.username,onChange:ne=>me.setField("username",ne.target.value)})}),s.jsx(st,{label:a("proxyPassword"),htmlFor:"proxy-password",children:s.jsx(al,{id:"proxy-password",placeholder:x.whatsapp_proxy_password?"••••••••••••":void 0,value:me.draft.password,onChange:ne=>me.setField("password",ne.target.value)})})]}),s.jsx(Nh,{dirty:me.dirty,saving:me.status==="saving",justSaved:me.status==="saved",error:me.error,onDiscard:me.revert,...xe})]})]}),d==="security"&&s.jsx("div",{className:"flex flex-col gap-5",children:s.jsxs(Ke,{className:"flex max-w-xl flex-col gap-4",children:[s.jsx(na,{icon:s.jsx(Rb,{size:20}),title:a("changePassword")}),s.jsxs("form",{onSubmit:wt,className:"flex flex-col gap-3.5",children:[s.jsx(st,{label:a("currentPassword"),htmlFor:"current-password",children:s.jsx(al,{id:"current-password",required:!0,value:I,onChange:ne=>q(ne.target.value)})}),s.jsx(st,{label:a("newPassword"),description:a("passwordMinLength"),htmlFor:"new-password",children:s.jsx(al,{id:"new-password",required:!0,minLength:8,value:he,onChange:ne=>B(ne.target.value)})}),s.jsx(st,{label:a("confirmPassword"),htmlFor:"confirm-password",children:s.jsx(al,{id:"confirm-password",required:!0,minLength:8,value:z,onChange:ne=>T(ne.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(Ke,{className:"flex flex-col gap-5",children:[s.jsx(na,{icon:s.jsx(Uy,{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(Dn,{label:a("forwardTtl"),description:a("forwardTtlDesc"),htmlFor:"forward-ttl",dirty:Y.dirty,saving:Y.status==="saving",justSaved:Y.status==="saved",error:Y.error,onSave:()=>Y.save(ne=>W("forward_score_ttl_days",ne)),onRevert:Y.revert,...Le,children:s.jsx(Xe,{id:"forward-ttl",type:"number",value:Y.value,onChange:ne=>Y.setValue(Number(ne.target.value))})}),s.jsx(Dn,{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(ne=>W("max_fetch_bytes",ne)),onRevert:V.revert,...Le,children:s.jsx(Xe,{id:"max-fetch-bytes",type:"number",value:V.value,onChange:ne=>V.setValue(Number(ne.target.value))})}),s.jsx(Dn,{label:a("stickerLibraryLimit"),htmlFor:"sticker-library-limit",description:a("stickerLibraryLimitDesc"),dirty:le.dirty,saving:le.status==="saving",justSaved:le.status==="saved",error:le.error,onSave:()=>le.save(ne=>W("sticker_library_limit",ne)),onRevert:le.revert,...Le,children:s.jsx(Xe,{id:"sticker-library-limit",type:"number",min:1,max:1e5,value:le.value,onChange:ne=>le.setValue(Number(ne.target.value))})}),s.jsx(Dn,{label:a("autoDeleteKeepDays"),htmlFor:"auto-delete-keep-days",description:a("autoDeleteKeepDaysDesc"),dirty:ee.dirty,saving:ee.status==="saving",justSaved:ee.status==="saved",error:ee.error,onSave:()=>ee.save(ne=>W("auto_delete_keep_days",ne)),onRevert:ee.revert,...Le,children:s.jsx(Xe,{id:"auto-delete-keep-days",type:"number",min:1,max:365,value:ee.value,onChange:ne=>ee.setValue(Number(ne.target.value))})})]})]}),d==="feedback"&&s.jsx(pE,{}),d==="diagnostics"&&s.jsx(gE,{}),s.jsx(an,{isOpen:!!U,onClose:()=>D(null),title:a("importTitle"),footer:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"secondary",onClick:()=>D(null),children:a("cancel")}),s.jsx(fe,{variant:"primary",onClick:qe,disabled:de,loading:de,children:a("importApply")})]}),children:U&&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=U.commands)==null?void 0:ze.prefix})]}),s.jsxs("li",{children:[Object.keys(U.settings||{}).length," ",a("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((Ne=U.commands)==null?void 0:Ne.permissions)||{}).length," ",a("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((Pe=U.commands)==null?void 0:Pe.aliases)||{}).length," ",a("importAliasesCount")]}),s.jsxs("li",{children:[(((vt=U.commands)==null?void 0:vt.disabled)||[]).length," ",a("importDisabledCount")]})]})]})})]})};function Oc(a,i){return`${[...(a||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function E1(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 A1(a,i){return E1(a,i),{ok:!0,via:"browser"}}async function _1(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 E1(a,i),{ok:!0,via:"browser"}}async function Kc(a,i,r,o,d,f){const h=await tE(a,i,r,o,d,f);return a==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:h.name||d,dir:h.dir||"Downloads/Levix"}}const As={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function Yc(a,i,r,o){return{name:a||i,mime:r.type||o,blob:r}}async function Ar(a,i){if(Fc())return Kc("save",`/dashboard/api/stickers/${encodeURIComponent(a.id)}/export?format=${i}`,"GET","",Oc(a.name,i),As[i]);const r=await Q.exportSticker(a.id,i),o=Yc(r.fileName,Oc(a.name,i),r.blob,As[i]);return A1(o.blob,o.name)}async function T1(a,i){if(Fc())return Kc("share",`/dashboard/api/stickers/${encodeURIComponent(a.id)}/export?format=${i}`,"GET","",Oc(a.name,i),As[i]);const r=await Q.exportSticker(a.id,i),o=Yc(r.fileName,Oc(a.name,i),r.blob,As[i]);return _1(o.blob,o.name,o.mime)}async function wE(a,i){if(Fc())return Kc("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:a,format:i}),`stickers-${i}.zip`,As.zip);const r=await Q.exportStickers(a,i),o=Yc(r.fileName,`stickers-${i}.zip`,r.blob,As.zip);return A1(o.blob,o.name)}async function jE(a,i){if(Fc())return Kc("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:a,format:i}),`stickers-${i}.zip`,As.zip);const r=await Q.exportStickers(a,i),o=Yc(r.fileName,`stickers-${i}.zip`,r.blob,As.zip);return _1(o.blob,o.name,o.mime)}async function Uh(a){if(a.length)try{await Q.bulkStickers({action:"touch",ids:a})}catch{}}const kE=16*1024*1024,H0=200,NE=10,D1=40,Qc=60,CE=[['"','"'],["'","'"],["“","”"],["«","»"],["„","‟"],["‹","›"]],q0=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter("en",{granularity:"grapheme"}):null;function EE(a){const i=a.trim();if(i.length<2)return i;for(const[r,o]of CE)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 AE(a){if(!q0)return[...a].length;let i=0;for(const r of q0.segment(a))i+=1;return i}function _r(a){const i=EE(a).normalize("NFC").replace(/\s+/g," ").trim(),r=AE(i);return r<1?"empty":r>D1?"long":null}function _E(a){return a.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(a.name)}function TE(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 DE(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 RE(a,i){if(a.size<=0)return"stickerErr_NO_MEDIA";if(a.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(_E(a)){const o=await DE(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 TE(a);return r&&(r.width>i.maxSide||r.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}function zE(a){return!a||a==="transparent"?"transparent":a==="#ffffff"?"white":a==="#000000"?"black":"custom"}const ME=({options:a,onChange:i,canRemoveBackground:r,name:o,onName:d,packId:f,onPack:h,packs:m})=>{var w,N,C;const{t:p}=He(),x=zE(a.background),v=((w=a.removeBackground)==null?void 0:w.tolerance)??.15,y=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:p("fit")}),s.jsxs(Qt,{id:"sticker-fit",value:a.fit||"contain",onChange:k=>i({fit:k.target.value==="cover"?"cover":"contain"}),children:[s.jsx("option",{value:"contain",children:p("contain")}),s.jsx("option",{value:"cover",children:p("cover")})]})]}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-zoom",children:[p("zoom")," (",(a.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:a.zoom??1,onChange:k=>i({zoom:Number(k.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-x",children:[p("panX")," (",(a.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:a.panX??0,onChange:k=>i({panX:Number(k.target.value)}),className:"w-full accent-brand-blue"}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-y",children:[p("panY")," (",(a.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:a.panY??0,onChange:k=>i({panY:Number(k.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:p("resetPan")}),s.jsxs(fe,{onClick:()=>{const k=(y+90)%360;i({rotate:k})},children:[p("rotateQuarter")," (",y,"°)"]})]}),s.jsx(Ns,{"aria-label":p("background"),className:"max-w-full flex-wrap",value:x,onChange:k=>{i(k==="transparent"?{background:"transparent"}:k==="white"?{background:"#ffffff"}:k==="black"?{background:"#000000"}:{background:"#3366ff"})},options:[{value:"transparent",label:p("transparent")},{value:"white",label:p("white")},{value:"black",label:p("black")},{value:"custom",label:p("customColor")}]}),x==="custom"&&s.jsx("input",{type:"color","aria-label":p("customColor"),value:/^#[0-9a-f]{6}$/i.test(a.background||"")?a.background:"#3366ff",onChange:k=>i({background:k.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(Dr,{checked:((N=a.removeBackground)==null?void 0:N.mode)==="plain",onChange:k=>i({removeBackground:k.target.checked?{mode:"plain",tolerance:.15}:null}),label:p("removePlainBackground"),description:p("stickerRemoveHint")}),((C=a.removeBackground)==null?void 0:C.mode)==="plain"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-tolerance",children:[p("tolerance")," (",v.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:v,onChange:k=>i({removeBackground:{mode:"plain",tolerance:Number(k.target.value)}}),className:"w-full accent-brand-blue"})]})]}),s.jsxs("div",{children:[s.jsx(ks,{htmlFor:"sticker-name",children:p("stickerName")}),s.jsx(Xe,{id:"sticker-name",value:o,maxLength:Qc,dir:"auto",onChange:k=>d(k.target.value),placeholder:p("stickerNamePlaceholder")})]}),s.jsxs("div",{children:[s.jsx(ks,{htmlFor:"sticker-pack",children:p("targetPack")}),s.jsxs(Qt,{id:"sticker-pack",value:f,onChange:k=>h(k.target.value),children:[s.jsx("option",{value:"",children:p("noPack")}),m.map(k=>s.jsx("option",{value:k.id,children:k.name},k.id))]})]})]})},OE=({options:a,onChange:i,kind:r,durationMs:o,limits:d,animatedOk:f})=>{const{t:h}=He();if(!(r==="video"||r==="gif"))return null;const p=o>0?o/1e3:d.videoSeconds,x=Math.min(d.videoSeconds,Math.max(0,p)),v=(y,w)=>{const N=Math.min(x,Math.max(0,y)),C=Math.min(d.stickerSeconds,Math.max(.5,w));i({trim:{start:N,duration:C}})};return s.jsxs(Ke,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx(Dr,{checked:!!a.trim,onChange:y=>{y.target.checked?v(0,Math.min(d.stickerSeconds,Math.max(.5,p))):i({trim:null})},label:s.jsx("span",{className:"font-bold",children:h("trim")})}),a.trim&&s.jsxs("span",{className:"font-mono text-xs text-muted",dir:"ltr",children:[a.trim.start.toFixed(1),"s →"," ",(a.trim.start+a.trim.duration).toFixed(1),"s"]})]}),!f&&s.jsx("p",{className:"text-xs text-warn",children:h("animatedUnavailable")}),s.jsx("p",{className:"text-xs text-muted",children:h(r==="gif"?"gifTrimNote":"trimApplied")}),a.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[h("trimStart")," (",a.trim.start.toFixed(1)," ",h("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:x,step:.1,value:a.trim.start,onChange:y=>{var w;return v(Number(y.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:[h("trimDuration")," (",a.trim.duration.toFixed(1)," ",h("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:a.trim.duration,onChange:y=>{var w;return v(((w=a.trim)==null?void 0:w.start)??0,Number(y.target.value))},className:"w-full accent-brand-blue"})]})]})},Gt=512;function LE(a,i,r){const o=r.fit||"contain",d=r.zoom??1,f=r.panX??0,h=r.panY??0,m=r.rotate??0,p=m===90||m===270,x=p?i:a,v=p?a:i,w=(o==="cover"?Gt/Math.min(x,v):Gt/Math.max(x,v))*d,N=Math.max(1,Math.round(x*w)),C=Math.max(1,Math.round(v*w)),k=Math.round((Gt-N)/2+f*Math.abs(Gt-N)/2),j=Math.round((Gt-C)/2+h*Math.abs(Gt-C)/2);return{width:N,height:C,x:k,y:j}}const BE='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function UE(a){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(a)}function HE(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 qE(a,i,r,o,d,f){const h=Math.max(0,Math.min(f,o/2,d/2));a.beginPath(),a.moveTo(i+h,r),a.arcTo(i+o,r,i+o,r+d,h),a.arcTo(i+o,r+d,i,r+d,h),a.arcTo(i,r+d,i,r,h),a.arcTo(i,r,i+o,r,h),a.closePath(),a.fill()}function PE(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 R1(a,i,r){const o=[];for(const d of i){if(!d.text)continue;const f=UE(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 ${BE}`,a.textAlign=d.align,a.textBaseline="middle";const h=a.measureText(d.text).width,m=d.background?d.fontSize*.4:8,p=d.background?d.fontSize*.22:6,x=h+m*2,v=d.fontSize*1.25+p*2,y=PE(d.align,f,h,m),w=-v/2;d.background&&(a.fillStyle="rgba(0, 0, 0, 0.55)",qE(a,y,w,x,v,v/2)),r===d.id&&(a.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue("--color-brand-cyan").trim(),a.lineWidth=2,a.strokeRect(y-3,w-3,x+6,v+6)),d.outline&&(a.lineJoin="round",a.miterLimit=2,a.lineWidth=Math.max(2,d.fontSize/10),a.strokeStyle=HE(d.color),a.strokeText(d.text,0,0)),a.fillStyle=d.color,a.fillText(d.text,0,0),a.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:y,top:w,right:y+x,bottom:w+v})}return o}function GE(a,i,r){for(let o=a.length-1;o>=0;o--){const d=a[o],f=i-d.cx,h=r-d.cy,m=-d.rotate*Math.PI/180,p=f*Math.cos(m)-h*Math.sin(m),x=f*Math.sin(m)+h*Math.cos(m);if(p>=d.left&&p<=d.right&&x>=d.top&&x<=d.bottom)return d.id}return null}function VE(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 R1(o,i,null),r.toDataURL("image/png")}const IE=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function pc(a,i,r){return Math.min(r,Math.max(i,a))}const FE=({mediaUrl:a,kind:i,width:r,height:o,options:d,layers:f,selectedId:h,onPan:m,onSelect:p,onMoveLayer:x,label:v})=>{const y=b.useRef(null),w=b.useRef(null),N=b.useRef([]),C=b.useRef(null),k=b.useRef(null),j=b.useRef(1),_=d.rotate??0,R=r>0&&o>0?LE(r,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:_}):null,I=_===90||_===270,q=R?I?R.height:R.width:0,he=R?I?R.width:R.height:0,B=R?R.x+(R.width-q)/2:0,z=R?R.y+(R.height-he)/2:0,T=d.background&&d.background!=="transparent"?d.background:null;b.useEffect(()=>{const se=y.current;if(!se)return;const U=()=>{const $=Math.min(se.clientWidth,512);j.current=$>0?$/Gt:1,se.style.setProperty("--stage-scale",String(j.current))};U();const D=new ResizeObserver(U);return D.observe(se),()=>D.disconnect()},[]),b.useEffect(()=>{const se=w.current;if(!se)return;const U=window.devicePixelRatio||1;se.width=Gt*U,se.height=Gt*U;const D=se.getContext("2d");D&&(D.setTransform(U,0,0,U,0,0),D.clearRect(0,0,Gt,Gt),N.current=R1(D,f,h))},[f,h]),b.useEffect(()=>{const se=k.current,U=d.trim;if(!se||!U||i!=="video"||!a)return;const D=U.start,$=U.start+U.duration,W=()=>{(se.currentTime<D-.05||se.currentTime>=$-.02)&&(se.currentTime=D)};return se.addEventListener("timeupdate",W),se.addEventListener("ended",W),se.currentTime=D,()=>{se.removeEventListener("timeupdate",W),se.removeEventListener("ended",W)}},[d.trim,i,a]);const F=se=>{const U=se.currentTarget.getBoundingClientRect();return{x:(se.clientX-U.left)/U.width*Gt,y:(se.clientY-U.top)/U.height*Gt}},X=se=>{if(se.button!==0)return;se.currentTarget.setPointerCapture(se.pointerId);const U=F(se),D=GE(N.current,U.x,U.y);if(D){const $=f.find(W=>W.id===D);if(!$)return;p(D),C.current={kind:"layer",id:D,x:U.x,y:U.y,originX:$.x,originY:$.y};return}p(null),R&&(C.current={kind:"pan",x:U.x,y:U.y,panX:d.panX??0,panY:d.panY??0,placeW:R.width,placeH:R.height})},re=se=>{const U=C.current;if(!U)return;const D=F(se);if(U.kind==="layer"){x(U.id,pc(U.originX+(D.x-U.x),0,Gt),pc(U.originY+(D.y-U.y),0,Gt));return}const $=Math.abs(Gt-U.placeW),W=Math.abs(Gt-U.placeH),ye=$<1?U.panX:pc(U.panX+(D.x-U.x)*2/$,-1,1),O=W<1?U.panY:pc(U.panY+(D.y-U.y)*2/W,-1,1);m(ye,O)},ae=()=>{C.current=null},de={position:"absolute",left:B,top:z,width:q,height:he,transform:`rotate(${_}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:y,className:"w-full",children:s.jsx("div",{className:"relative mx-auto overflow-hidden rounded-2xl border border-line",style:{width:"calc(512px * var(--stage-scale, 1))",height:"calc(512px * var(--stage-scale, 1))"},children:s.jsxs("div",{role:"img","aria-label":v,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:Gt,height:Gt,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:k,src:a,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:de}):R&&s.jsx("img",{src:a,alt:"",draggable:!1,style:de}),s.jsx("canvas",{ref:w,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:X,onPointerMove:re,onPointerUp:ae,onPointerCancel:ae})]})})})},KE=({layers:a,selectedId:i,onSelect:r,onChange:o,onDelete:d,onAddText:f,onAddEmoji:h})=>{const{t:m}=He(),p=a.find(x=>x.id===i)||null;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(fe,{onClick:f,children:m("addText")}),s.jsx(fe,{onClick:()=>h("😀"),children:m("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(ks,{children:m("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:IE.map(x=>s.jsx(Oe,{label:x,variant:"secondary",onClick:()=>h(x),children:s.jsx("span",{className:"text-lg leading-none",children:x})},x))}),s.jsx(ks,{htmlFor:"emoji-free",children:m("customEmoji")}),s.jsx(Xe,{id:"emoji-free",className:"mt-1",placeholder:m("emojiInputLabel"),onKeyDown:x=>{if(x.key==="Enter"){const v=x.currentTarget.value.trim();v&&(h(v),x.currentTarget.value="")}}})]}),a.length===0&&s.jsx("p",{className:"text-xs text-muted",children:m("noLayers")}),a.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:a.map(x=>{const v=x.id===i;return s.jsx(fe,{variant:v?"secondary":"ghost","aria-pressed":v,onClick:()=>r(x.id),className:Ue("h-auto w-full justify-start",v&&"border-brand-blue bg-brand-blue/10"),children:s.jsx("span",{className:"truncate",children:x.text||m("textPlaceholder")})},x.id)})}),p&&s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-line p-3",children:[s.jsx("p",{className:"text-xs font-bold",children:m("layerSelected")}),s.jsx(ks,{htmlFor:"layer-text",children:m("textContent")}),s.jsx(Xe,{id:"layer-text",value:p.text,onChange:x=>o(p.id,{text:x.target.value})}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-size",children:m("textSize")}),s.jsx("input",{id:"layer-size",type:"range",min:16,max:200,value:p.fontSize,onChange:x=>o(p.id,{fontSize:Number(x.target.value)}),className:"w-full accent-brand-blue"}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-color",children:m("textColor")}),s.jsx("input",{id:"layer-color",type:"color",value:/^#[0-9a-f]{6}$/i.test(p.color)?p.color:"#ffffff",onChange:x=>o(p.id,{color:x.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx(Ns,{"aria-label":m("textAlignment"),value:p.align,onChange:x=>o(p.id,{align:x}),options:[{value:"start",label:m("stickerAlignmentStart")},{value:"center",label:m("stickerAlignmentCenter")},{value:"end",label:m("stickerAlignmentEnd")}]}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-rotate",children:m("layerRotation")}),s.jsx("input",{id:"layer-rotate",type:"range",min:-180,max:180,value:p.rotate,onChange:x=>o(p.id,{rotate:Number(x.target.value)}),className:"w-full accent-brand-blue"}),s.jsx(Dr,{checked:p.outline,onChange:x=>o(p.id,{outline:x.target.checked}),label:m("textOutline")}),s.jsx(Dr,{checked:p.background,onChange:x=>o(p.id,{background:x.target.checked}),label:m("textBackground")}),s.jsx(fe,{variant:"danger",onClick:()=>d(p.id),icon:s.jsx(In,{size:16}),children:m("deleteLayer")})]})]})},z1=({open:a,title:i,packs:r,onClose:o,onPick:d,onCreated:f})=>{const{t:h}=He(),{toast:m}=_t(),[p,x]=b.useState(""),[v,y]=b.useState(null),[w,N]=b.useState(!1);b.useEffect(()=>{a||(x(""),y(null))},[a]);const C=async()=>{if(_r(p)){y(h("packNameLength"));return}N(!0),y(null);try{const j=await Q.createPack(p.trim());x(""),f(j),d(j.id),m(h("packCreated"),"success")}catch(j){m(St(h,j),"error")}finally{N(!1)}};return s.jsx(an,{isOpen:a,onClose:o,title:i,footer:s.jsx(fe,{onClick:o,children:h("close")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[r.length===0?s.jsx("p",{className:"text-sm text-muted",children:h("noPacks")}):s.jsx("div",{className:"flex max-h-64 flex-col gap-1.5 overflow-y-auto",children:r.map(k=>s.jsxs(fe,{variant:"ghost",onClick:()=>d(k.id),className:"h-auto w-full min-w-0 justify-start px-3 py-2.5",children:[s.jsx(Kn,{className:"flex-1 text-start",children:k.name}),s.jsx("span",{className:"ms-2 shrink-0 font-medium text-muted",children:k.count})]},k.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:h("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Xe,{id:"new-pack-name",value:p,onChange:k=>{const j=k.target.value;x(j),v&&y(_r(j)?h("packNameLength"):null)},placeholder:h("newPackPlaceholder"),maxLength:80,dir:"auto"}),s.jsx(fe,{variant:"primary",onClick:C,disabled:w,children:h("createPack")})]}),v&&s.jsx("p",{className:"text-xs text-danger",children:v})]})]})})},YE=600;function QE(){const[a,i]=b.useState(null),[r,o]=b.useState(!1),[d,f]=b.useState(null),h=b.useRef(0);return b.useEffect(()=>()=>{h.current+=1},[]),{job:a,running:r,submitError:d,start:async x=>{const v=++h.current;f(null),i(null),o(!0);try{const{jobId:y}=await Q.createStickerJob(x);for(;h.current===v;){const w=await Q.getStickerJob(y);if(h.current!==v)return;if(i(w),w.state==="done"||w.state==="failed")break;await new Promise(N=>setTimeout(N,YE))}}catch(y){h.current===v&&f(y)}finally{h.current===v&&o(!1)}},reset:()=>{h.current+=1,i(null),f(null),o(!1)}}}const ph={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function XE(a,i){return a(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const ZE=({capabilities:a,capsError:i,onRetryCaps:r,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:h,onCreated:m})=>{var Se,qe,it,mt,wt,Le,xe,ze,Ne,Pe,vt,ne;const{t:p}=He(),{toast:x}=_t(),v=QE(),[y,w]=b.useState(null),[N,C]=b.useState(null),[k,j]=b.useState("PANEL_UPLOAD"),[_,R]=b.useState(!1),[I,q]=b.useState(!1),[he,B]=b.useState(ph),[z,T]=b.useState([]),[F,X]=b.useState(null),[re,ae]=b.useState(""),[de,se]=b.useState(""),[U,D]=b.useState([]),[$,W]=b.useState(!1),[ye,O]=b.useState(!1),ie=b.useRef(null),be=b.useRef(null),we=b.useRef(async()=>{});b.useEffect(()=>(Q.getPacks().then(te=>D(te.packs)).catch(()=>{}),()=>{ie.current&&URL.revokeObjectURL(ie.current)}),[]);const E=te=>{ie.current&&URL.revokeObjectURL(ie.current);const ve=URL.createObjectURL(te);ie.current=ve,C(ve)},Y=async(te,ve,Te,jt,Xt)=>{if(!(a!=null&&a.webp))return;const Tt=te instanceof File?te:new File([te],ve,{type:te.type}),sn=await RE(Tt,a.limits);if(sn){x(p(sn),"error");return}R(!0),j(Te);try{const Ht=jt?await j1(jt,ve,a.limits.uploadBytes):Xt?await Q.uploadExistingStickerSource(Xt):await Q.uploadStickerSource(Tt,ve);E(Tt),w(Ht),B(ph),x(p("uploadReady"),"success")}catch(Ht){x(St(p,Ht),"error")}finally{R(!1)}};we.current=Y,b.useEffect(()=>{!o||!a||o===be.current||(be.current=o,d(),Promise.resolve(o.blob).then(te=>we.current(te,o.name,o.source,o.token,o.existingId)).catch(te=>x(St(p,te),"error")))},[o,a,d]);const V=()=>{v.reset(),w(null),ae(""),se(""),T([]),X(null),B(ph),j("PANEL_UPLOAD"),ie.current&&URL.revokeObjectURL(ie.current),ie.current=null,C(null),be.current=null},le=()=>{if(!y)return null;const te=re.trim();if([...te].length>Qc)return x(p("stickerNameTooLong"),"warning"),null;const ve=VE(z);return{uploadId:y.uploadId,options:he,...ve?{overlay:ve}:{},...te?{name:te}:{},...de?{packId:de}:{},source:k}},ee=()=>{const te=le();te&&v.start(te)},ue=async(te,ve)=>{te.ok&&(te.via==="host"?x(rn(p("stickerShareSaved"),{dir:te.dir}),"success"):te.via==="share"?x(p("shareDone"),"success"):x(p("downloaded"),"success"),await Uh([ve.id]),m())};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:p("retryLoad")})]});if(!a)return s.jsx(Es,{text:p("loading")});if(!a.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:p("stickerErr_ENCODER_MISSING")});const me=((Se=v.job)==null?void 0:Se.state)==="done"?v.job.sticker:null;if(me)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:me.url,alt:me.name||p("stickerPreview"),className:"w-full h-full object-contain"})}),((qe=v.job)==null?void 0:qe.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:p("alreadyInLibrary")}),((it=v.job)==null?void 0:it.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:p("qualityReduced")}),((mt=v.job)==null?void 0:mt.created)!==!1&&s.jsx("p",{className:"text-sm text-ok",children:p("stickerCreated")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Oe,{label:p("downloadWebp"),icon:s.jsx(Lc,{size:18}),onClick:()=>{Ar(me,"webp").then(te=>ue(te,me)).catch(te=>x(St(p,te),"error"))}}),s.jsx(Oe,{label:p("shareSticker"),icon:s.jsx(Or,{size:18}),onClick:()=>{T1(me,"webp").then(te=>ue(te,me)).catch(te=>x(St(p,te),"error"))}}),s.jsx(fe,{disabled:!f,title:f?void 0:p("notConnectedHint"),onClick:()=>W(!0),children:p("sendViaWhatsapp")}),s.jsx(fe,{onClick:()=>O(!0),children:p("addToPack")}),s.jsx(fe,{variant:"primary",onClick:V,children:p("createAnother")}),s.jsx(fe,{onClick:h,children:p("goToLibrary")}),s.jsxs(sa,{label:p("moreActions"),children:[s.jsx(lt,{onSelect:()=>{me.animated&&x(p("firstFrameHint"),"info"),Ar(me,"png").then(te=>ue(te,me)).catch(te=>x(St(p,te),"error"))},children:p("downloadPng")}),me.animated&&s.jsx(lt,{disabled:!a.gif,title:p("gifOnlyAnimated"),onSelect:()=>{Ar(me,"gif").then(te=>ue(te,me)).catch(te=>x(St(p,te),"error"))},children:p("downloadGif")})]})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:p("notConnectedHint")}),s.jsx(am,{open:$,busy:!1,onClose:()=>W(!1),onPick:te=>{Q.sendStickers({ids:[me.id],jid:te}).then(ve=>{ve.sent>0?(x(p("stickerSent"),"success"),W(!1),m()):x(p("stickerErr_NOT_CONNECTED"),"error")}).catch(ve=>x(St(p,ve),"error"))}}),s.jsx(z1,{open:ye,title:p("addToPack"),packs:U,onClose:()=>O(!1),onCreated:te=>D(ve=>[...ve,te]),onPick:te=>{Q.bulkStickers({action:"addToPack",ids:[me.id],packId:te}).then(()=>{x(p("addedToPack"),"success"),O(!1),m()}).catch(ve=>x(St(p,ve),"error"))}})]});const ce=v.submitError||((wt=v.job)==null?void 0:wt.state)==="failed";return s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_320px] gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3",children:[!y&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${I?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:te=>{kc()&&(te.preventDefault(),WC().then(async ve=>{if(!ve)return;const Te=await fetch(ve.url);if(!Te.ok)throw new Error("source unavailable");await Y(await Te.blob(),ve.name,"PANEL_UPLOAD",ve.token)}).catch(ve=>x(St(p,ve),"error")))},onDragOver:te=>{te.preventDefault(),q(!0)},onDragLeave:()=>q(!1),onDrop:te=>{if(te.preventDefault(),q(!1),kc())return;const ve=te.dataTransfer.files[0];ve&&Y(ve,ve.name,"PANEL_UPLOAD")},children:[s.jsx(kv,{size:28,className:"text-muted"}),s.jsx("span",{className:"text-sm font-bold text-text-main",children:p("stickerDrag")}),s.jsx("span",{className:"text-xs text-muted",children:p("uploadHint")}),s.jsx("input",{type:"file",accept:"image/*,video/*,.webp,.gif",className:"sr-only",disabled:kc(),onChange:te=>{var Te;const ve=(Te=te.target.files)==null?void 0:Te[0];te.target.value="",ve&&Y(ve,ve.name,"PANEL_UPLOAD")}})]}),_&&s.jsx(Es,{text:p("loading")}),y&&N&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:rn(p("stickerUploadInfo"),{kind:XE(p,y.kind),size:Math.max(1,Math.round(y.size/1024))})}),s.jsx(FE,{mediaUrl:N,kind:y.kind,width:y.width,height:y.height,options:he,layers:z,selectedId:F,label:p("previewStage"),onPan:(te,ve)=>B(Te=>({...Te,panX:te,panY:ve})),onSelect:X,onMoveLayer:(te,ve,Te)=>T(jt=>jt.map(Xt=>Xt.id===te?{...Xt,x:ve,y:Te}:Xt))}),s.jsx(OE,{options:he,onChange:te=>B(ve=>({...ve,...te})),kind:y.kind,durationMs:y.durationMs,limits:a.limits,animatedOk:a.animated})]}),(v.running||((Le=v.job)==null?void 0:Le.state)==="queued"||((xe=v.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=v.job)==null?void 0:ze.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:sC(p,((Ne=v.job)==null?void 0:Ne.state)==="queued"?"queued":(Pe=v.job)==null?void 0:Pe.stage)})]}),ce&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:v.submitError?St(p,v.submitError):nm(p,(ne=(vt=v.job)==null?void 0:vt.error)==null?void 0:ne.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(fe,{variant:"primary",onClick:ee,children:p("tryAgain")}),s.jsx(fe,{onClick:V,children:p("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[y&&s.jsx(ME,{options:he,onChange:te=>B(ve=>({...ve,...te})),canRemoveBackground:a.backgroundRemoval.includes("plain"),name:re,onName:ae,packId:de,onPack:se,packs:U}),y&&s.jsx(KE,{layers:z,selectedId:F,onSelect:X,onChange:(te,ve)=>T(Te=>Te.map(jt=>jt.id===te?{...jt,...ve}:jt)),onDelete:te=>{T(ve=>ve.filter(Te=>Te.id!==te)),X(ve=>ve===te?null:ve)},onAddText:()=>{const te=crypto.randomUUID();T(ve=>[...ve,{id:te,text:p("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),X(te)},onAddEmoji:te=>{const ve=crypto.randomUUID();T(Te=>[...Te,{id:ve,text:te,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),X(ve)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(fe,{variant:"primary",disabled:!y||v.running||_,onClick:ee,icon:s.jsx(rl,{size:16}),children:p("createBtn")}),y&&s.jsx(fe,{onClick:V,disabled:v.running,children:p("clearLbl")})]})]})]})};let Nc=null,Cc=!1,Sa=null;function P0(a){Sa=a}async function JE(a,i){var r;try{const o=await j1(a,i,kE),{jobId:d}=await Q.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await Q.getStickerJob(d);if(f.state==="done"){Sa==null||Sa({type:"saved",created:f.created!==!1,qualityReduced:f.qualityReduced===!0});return}if(f.state==="failed"){Sa==null||Sa({type:"error",code:(r=f.error)==null?void 0:r.code});return}await new Promise(h=>setTimeout(h,600))}}catch(o){Sa==null||Sa({type:"error",code:o instanceof Bt?o.code:void 0})}finally{Cc=!1}}function $E(){if(Cc)return Nc;const a=eE();return(a==null?void 0:a.intent)==="create"?Nc={blob:fetch(a.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:a.name||"sticker",source:"MEDIA_HUB",token:a.token}:(a==null?void 0:a.intent)==="save"&&!Cc&&(Cc=!0,JE(a.token,a.name||"sticker")),Nc}function WE(){Nc=null}const M1=({count:a,animatedSelected:i,canRemove:r,sendReason:o,exportReason:d,onSelectAll:f,selectAllLabel:h,onClear:m,onFavorite:p,onUnfavorite:x,onAdd:v,onMove:y,onRemove:w,onDownload:N,onConvert:C,onShare:k,onSend:j,onDelete:_})=>{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(Ke,{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(Lc,{size:16}),onClick:N,disabled:!!d}),s.jsx(Oe,{label:R("sendViaWhatsapp"),icon:s.jsx(mi,{size:16,className:"rtl:-scale-x-100"}),onClick:j,disabled:!!o}),s.jsx(Oe,{label:R("shareSticker"),icon:s.jsx(Or,{size:16}),onClick:k}),s.jsxs(sa,{label:R("moreActions"),children:[s.jsx(lt,{onSelect:f,children:h}),s.jsx(lt,{onSelect:m,children:R("clearSelection")}),s.jsx(Cr,{}),s.jsx(lt,{onSelect:p,children:R("favorite")}),s.jsx(lt,{onSelect:x,children:R("unfavorite")}),s.jsx(Cr,{}),s.jsx(lt,{onSelect:v,children:R("addToPack")}),s.jsx(lt,{onSelect:y,children:R("moveToPack")}),r&&s.jsx(lt,{onSelect:w,children:R("removeFromPack")}),s.jsx(lt,{onSelect:C,disabled:!!d,children:R("convertToImage")}),s.jsx(Cr,{}),s.jsx(lt,{danger:!0,onSelect:_,children:R("delete")})]}),s.jsx(Oe,{variant:"ghost",label:R("clearSelection"),icon:s.jsx(Fn,{size:16}),onClick:m})]}),(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")})]})]})})},e4=({open:a,busy:i,count:r,inUse:o,packs:d,onClose:f,onConfirm:h,onConfirmEverywhere:m})=>{const{t:p}=He();return s.jsx(an,{isOpen:a,onClose:f,title:p("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[s.jsx(fe,{onClick:f,disabled:i,children:p("cancel")}),o?s.jsx(fe,{variant:"danger",onClick:m,disabled:i,children:p("deleteEverywhere")}):s.jsx(fe,{variant:"danger",onClick:h,disabled:i,children:p("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2 text-sm text-text-main",children:[s.jsx("p",{children:rn(p("nSelected"),{n:r})}),o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:p(r===1?"inUseBody":"inUseBulkBody")}),d.length>0&&s.jsxs("p",{children:[p("inUsePacksLabel"),":"," ",d.map((x,v)=>s.jsxs(b.Fragment,{children:[v>0&&", ",s.jsx(Kn,{as:"bdi",children:x.name})]},x.id))]}),s.jsx("p",{className:"text-xs text-muted",children:p("deleteEverywhereHint")})]}):s.jsx("p",{children:p("deleteConfirm")})]})})},t4="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:20px_20px]",n4=({sticker:a,packs:i,isConnected:r,gifEnabled:o,onClose:d,onRename:f,onFavorite:h,onAddToPack:m,onRemoveFromPack:p,onDownload:x,onShare:v,onSend:y,onDelete:w,onOpenInCreate:N})=>{const{t:C}=He(),[k,j]=b.useState(""),[_,R]=b.useState("");if(b.useEffect(()=>{j((a==null?void 0:a.name)||""),R("")},[a]),!a)return null;const I=i.filter(B=>a.packIds.includes(B.id)),q=i.filter(B=>!a.packIds.includes(B.id)),he=a.animated&&o?"gif":"webp";return s.jsx(an,{isOpen:!!a,onClose:d,title:s.jsx(Kn,{children:a.name||C("stickerPreview")}),maxWidth:"38rem",footer:s.jsx("div",{className:"flex w-full justify-end gap-2",children:s.jsx(fe,{onClick:d,children:C("close")})}),children:s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[s.jsx("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 ${t4}`,children:s.jsx("img",{src:a.url,alt:a.name||C("stickerPreview"),className:"h-full w-full object-contain"})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(fe,{variant:"primary",onClick:y,disabled:!r,title:r?void 0:C("notConnectedHint"),icon:s.jsx(mi,{size:16,className:"rtl:-scale-x-100"}),children:C("sendViaWhatsapp")}),s.jsx(Oe,{label:a.favorite?C("unfavorite"):C("favorite"),"aria-pressed":a.favorite,onClick:()=>h(!a.favorite),icon:s.jsx(Bc,{size:16,className:a.favorite?"fill-warn text-warn":void 0})}),s.jsx(Oe,{label:C(he==="gif"?"downloadGif":"downloadWebp"),icon:s.jsx(Lc,{size:16}),onClick:()=>x(he)}),s.jsx(Oe,{label:C("shareSticker"),icon:s.jsx(Or,{size:16}),onClick:v}),s.jsx("span",{className:"ms-auto",children:s.jsxs(sa,{label:C("moreActions"),align:"end",children:[s.jsx(lt,{onSelect:()=>x("webp"),children:C("downloadWebp")}),s.jsx(lt,{title:a.animated?C("firstFrameHint"):void 0,onSelect:()=>x("png"),children:C("downloadPng")}),a.animated&&s.jsx(lt,{disabled:!o,title:C("gifOnlyAnimated"),onSelect:()=>x("gif"),children:C("downloadGif")}),s.jsx(lt,{onSelect:N,children:C("openInCreate")}),s.jsx(Cr,{}),s.jsx(lt,{danger:!0,onSelect:w,children:C("delete")})]})})]}),a.animated&&s.jsx("p",{className:"text-xs text-muted",children:C("firstFrameHint")}),!r&&s.jsx("p",{className:"text-xs text-muted",children:C("notConnectedHint")}),s.jsxs("div",{className:"flex gap-2 min-w-0",children:[s.jsx(Xe,{value:k,onChange:B=>j(B.target.value),maxLength:Qc,dir:"auto","aria-label":C("stickerName"),placeholder:C("stickerNamePlaceholder"),className:"min-w-0 flex-1"}),s.jsx(fe,{variant:"secondary",onClick:()=>f(k.trim()),children:C("rename")})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-bold text-text-main",children:C("inUsePacksLabel")}),I.length===0?s.jsx("p",{className:"text-xs text-muted",children:C("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(Kn,{className:"flex-1 text-sm",children:B.name}),s.jsx(Oe,{label:C("removeFromPack"),variant:"ghost",icon:s.jsx(Fn,{size:16}),onClick:()=>p(B.id)})]},B.id))}),q.length>0&&s.jsxs("div",{className:"mt-2 flex gap-2",children:[s.jsxs(Qt,{value:_,onChange:B=>R(B.target.value),"aria-label":C("addToPack"),children:[s.jsx("option",{value:"",children:C("selectPack")}),q.map(B=>s.jsx("option",{value:B.id,children:B.name},B.id))]}),s.jsx(fe,{variant:"primary",disabled:!_,onClick:()=>_&&m(_),children:C("addToPack")})]})]})]})})};function a4(a){const{t:i}=He(),{toast:r}=_t(),[o,d]=b.useState(null),[f,h]=b.useState(!1);return{phase:o,busy:f,requestDelete:v=>{v.length&&d({kind:"ask",ids:v})},run:async(v,y)=>{var w;h(!0);try{if(v.length===1&&!y){try{await Q.deleteSticker(v[0],!1),r(i("deleted"),"success"),d(null),a()}catch(j){if(j instanceof Bt&&j.code==="IN_USE"){const _=Array.isArray((w=j.data)==null?void 0:w.packs)?j.data.packs:[];d({kind:"inUse",ids:v,packs:_,otherSkipped:0})}else r(St(i,j),"error")}return}const N=await Q.bulkStickers({action:"delete",ids:v,confirm:y}),C=N.skipped.filter(j=>j.code==="IN_USE").map(j=>j.id),k=N.skipped.length-C.length;if(!y&&C.length>0){d({kind:"inUse",ids:C,packs:[],otherSkipped:k});return}k>0?r(i("skippedOther"),"warning"):r(i("deleted"),"success"),d(null),a()}catch(N){r(St(i,N),"error")}finally{h(!1)}},close:()=>{f||d(null)}}}function s4(a,i,r){const o=new Map(r.map(f=>[f.id,f.name])),d=new Map;for(const f of a){const h=i.find(m=>m.id===f);for(const m of(h==null?void 0:h.packIds)??[])d.set(m,o.get(m)||m)}return[...d].map(([f,h])=>({id:f,name:h}))}function O1({items:a,packs:i,selectedIds:r,clearSelection:o,reload:d,fromPackId:f,isConnected:h,gifEnabled:m,onOpenInCreate:p,onPackCreated:x}){var W,ye,O;const{t:v}=He(),{toast:y}=_t(),w=b.useRef(!1),[N,C]=b.useState(null),[k,j]=b.useState(null),[_,R]=b.useState([]),[I,q]=b.useState([]),[he,B]=b.useState(!1),z=a4(()=>{C(null),o(),d()}),T=a.find(ie=>ie.id===N)||null,F=r.length>H0?v("stickerExportLimit"):null,X=h?r.length>NE?v("stickerSendLimit"):null:v("notConnectedHint"),re=((W=z.phase)==null?void 0:W.kind)==="inUse"?z.phase.packs.length?z.phase.packs:s4(z.phase.ids,a,i):[],ae=ie=>{ie.ok&&(ie.via==="host"?y(rn(v("stickerShareSaved"),{dir:ie.dir}),"success"):ie.via==="share"?y(v("shareDone"),"success"):y(v("downloaded"),"success"))},de=async ie=>{if(!w.current){w.current=!0;try{await ie()}catch(be){y(St(v,be),"error")}finally{w.current=!1}}},se=ie=>a.find(be=>be.id===ie),U=(ie,be,we)=>de(async()=>{if(!ie.length||ie.length>H0)return;const E=ie.length===1?se(ie[0]):null,Y=ie.some(le=>{var ee;return(ee=se(le))==null?void 0:ee.animated});be==="png"&&Y&&y(v("firstFrameHint"),"info");const V=ie.length===1&&E?await(we?T1(E,be):Ar(E,be)):await(we?jE(ie,be):wE(ie,be));ae(V),V.ok&&(await Uh(ie),d())}),D=(ie,be)=>de(async()=>{if(!ie.length)return;const we=await Q.bulkStickers({action:be?"favorite":"unfavorite",ids:ie});y(we.skipped.length?v("skippedOther"):v("saved"),we.skipped.length?"warning":"success"),d()}),$=(ie,be,we)=>de(async()=>{if(!we.length)return;const E=await Q.bulkStickers({action:ie,ids:we,packId:be,...ie==="moveToPack"&&f?{fromPackId:f}:{}}),Y=v(ie==="addToPack"?"addedToPack":"movedToPack");y(E.skipped.length?v("skippedOther"):Y,E.skipped.length?"warning":"success"),j(null),d()});return{exportReason:F,sendReason:X,openDetail:ie=>C(ie.id),toggleFavorite:ie=>void D([ie.id],!ie.favorite),favorite:()=>void D(r,!0),unfavorite:()=>void D(r,!1),askAdd:()=>{R(r),j("add")},askMove:()=>{R(r),j("move")},remove:()=>{!f||!r.length||de(async()=>{const ie=await Q.bulkStickers({action:"removeFromPack",ids:r,packId:f});y(ie.skipped.length?v("skippedOther"):v("removedFromPack"),ie.skipped.length?"warning":"success"),o(),d()})},download:()=>void U(r,"webp",!1),convert:()=>void U(r,"png",!1),share:()=>void U(r,"webp",!0),askSend:()=>{X||!r.length||q(r)},askDelete:()=>z.requestDelete(r),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(z1,{open:k!==null,title:v(k==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>j(null),onCreated:x,onPick:ie=>void $(k==="move"?"moveToPack":"addToPack",ie,_)}),s.jsx(am,{open:I.length>0,busy:he,onClose:()=>q([]),onPick:ie=>{de(async()=>{B(!0);try{(await Q.sendStickers({ids:I,jid:ie})).sent>0?(y(I.length>1?v("stickersSent"):v("stickerSent"),"success"),q([]),d()):y(v("stickerErr_NOT_CONNECTED"),"error")}finally{B(!1)}})}}),s.jsx(e4,{open:z.phase!==null,busy:z.busy,count:((ye=z.phase)==null?void 0:ye.ids.length)??0,inUse:((O=z.phase)==null?void 0:O.kind)==="inUse",packs:re,onClose:z.close,onConfirm:()=>{z.phase&&z.run(z.phase.ids,!1)},onConfirmEverywhere:()=>{z.phase&&z.run(z.phase.ids,!0)}}),s.jsx(n4,{sticker:T,packs:i,isConnected:h,gifEnabled:m,onClose:()=>C(null),onRename:ie=>{if(T){if([...ie.trim()].length>Qc){y(v("stickerNameTooLong"),"warning");return}de(async()=>{await Q.updateSticker(T.id,{name:ie.trim()}),y(v("renamed"),"success"),d()})}},onFavorite:ie=>{T&&de(async()=>{await Q.updateSticker(T.id,{favorite:ie}),y(v("saved"),"success"),d()})},onAddToPack:ie=>{T&&$("addToPack",ie,[T.id])},onRemoveFromPack:ie=>{T&&de(async()=>{await Q.bulkStickers({action:"removeFromPack",ids:[T.id],packId:ie}),y(v("removedFromPack"),"success"),d()})},onDownload:ie=>{if(T){if(ie==="gif"){de(async()=>{const be=await Ar(T,"gif");ae(be),be.ok&&(await Uh([T.id]),d())});return}U([T.id],ie,!1)}},onShare:()=>{T&&U([T.id],"webp",!0)},onSend:()=>{T&&h&&q([T.id])},onDelete:()=>{T&&z.requestDelete([T.id])},onOpenInCreate:()=>{T&&(C(null),p(T))}})]})}}const l4="bg-[repeating-conic-gradient(var(--panel-raised)_0%_25%,var(--bg)_0%_50%)] bg-[length:16px_16px]",L1=({sticker:a,selected:i,onToggle:r,onOpen:o,onFavorite:d})=>{const{t:f}=He(),h=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",l4)})}),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:m=>r(m.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(di,{size:14,strokeWidth:i?3:2.5,className:i?void 0:"opacity-40"})})}),a.animated&&s.jsx(nt,{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(Bc,{size:14,className:a.favorite?"fill-warn text-warn":void 0})})}),s.jsx("span",{className:"sr-only",children:h})]})},i4=({items:a,total:i,page:r,pageCount:o,loading:d,error:f,emptyText:h,isFiltered:m,selected:p,onToggle:x,onOpen:v,onFavorite:y,onPageChange:w,onRetry:N,onClearFilters:C,onGoCreate:k})=>{const{t:j}=He();return s.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[d&&a.length===0?s.jsx(Es,{text:j("loading")}):f?s.jsx(ut,{kind:"error",description:f,action:s.jsx(fe,{onClick:N,children:j("retryLoad")})}):a.length===0?m?s.jsx(ut,{kind:"no-results",description:h,action:C?s.jsx(fe,{variant:"secondary",onClick:C,children:j("reset")}):void 0}):s.jsx(ut,{kind:"empty",icon:s.jsx(Ih,{size:28,className:"text-muted"}),description:h,action:k?s.jsx(fe,{variant:"primary",onClick:k,children:j("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((_,R)=>s.jsx(L1,{sticker:_,selected:p.has(_.id),onToggle:I=>x(R,I),onOpen:()=>v(_),onFavorite:()=>y(_)},_.id))}),i>0&&s.jsx(xi,{page:r,pageCount:o,total:i,onPageChange:w,className:"pt-1"})]})};function B1(a,i){const[r,o]=b.useState(new Set),d=b.useRef(null),f=b.useRef(i);return b.useEffect(()=>{f.current!==i&&(f.current=i,o(new Set),d.current=null)},[i]),{selected:r,toggle:(x,v)=>{const y=a[x];y&&o(w=>{const N=new Set(w);if(v&&d.current!=null){const C=Math.min(d.current,x),k=Math.max(d.current,x);for(let j=C;j<=k;j++){const _=a[j];_&&N.add(_)}return N}return N.has(y)?N.delete(y):N.add(y),d.current=x,N})},selectAll:()=>{o(x=>{const v=new Set(x);for(const y of a)y&&v.add(y);return v})},clear:()=>{d.current=null,o(new Set)}}}const Sr=24;function r4(a){const{t:i}=He(),{toast:r}=_t(),[o,d]=b.useState(""),[f,h]=b.useState(""),[m,p]=b.useState(a==="recent"?"recent":"newest"),[x,v]=b.useState(a),[y,w]=b.useState(""),[N,C]=b.useState(1),[k,j]=b.useState(null),[_,R]=b.useState(0),[I,q]=b.useState([]),[he,B]=b.useState(!0),[z,T]=b.useState(null),F=b.useRef(0),X=`${f}|${x}|${m}|${y}`;b.useEffect(()=>{v(a)},[a]),b.useEffect(()=>{const W=setTimeout(()=>h(o),300);return()=>clearTimeout(W)},[o]);const re=b.useCallback(()=>{Q.getPacks().then(W=>q(W.packs)).catch(()=>{})},[]);b.useEffect(()=>{re()},[re]);const ae=b.useCallback(async W=>{const ye=++F.current;B(!0),T(null);const O=Math.max(0,(W-1)*Sr);try{const ie=await Q.getStickers({q:f||void 0,sort:m,filter:x,pack:y||void 0,offset:O,limit:Sr});if(ye!==F.current)return;const be=ie.total,we=Math.max(1,Math.ceil(be/Sr));if(W>we){C(we);return}j({page:W,filterKey:X,items:ie.items}),R(be)}catch(ie){if(ye!==F.current)return;const be=St(i,ie);T({page:W,filterKey:X,message:be}),r(be,"error")}finally{ye===F.current&&B(!1)}},[f,m,x,y,X,i,r]),de=b.useRef(X);b.useEffect(()=>{if(de.current!==X&&(de.current=X,N!==1)){C(1);return}ae(N)},[X,N,ae]);const se=b.useCallback(()=>{re(),ae(N)},[ae,re,N]),U=b.useCallback(W=>{C(Math.max(1,Math.floor(W)||1))},[]),D=(k==null?void 0:k.page)===N&&k.filterKey===X,$=(z==null?void 0:z.page)===N&&z.filterKey===X?z.message:null;return{q:o,setQ:d,sort:m,setSort:p,filter:x,setFilter:v,pack:y,setPack:w,page:N,setPage:U,pageCount:Math.max(1,Math.ceil(_/Sr)),pageSize:Sr,items:D?k.items:[],loadedItems:(k==null?void 0:k.items)??null,total:_,packs:I,loading:he||!D&&!$,error:$,reload:se,loadPacks:re,lockedFilter:a!=="all"}}const gh=({preset:a,isConnected:i,gifEnabled:r,refreshKey:o,onOpenInCreate:d,onGoCreate:f})=>{const{t:h}=He(),m=r4(a),p=m.items.map(B=>B.id),x=`${m.q}|${m.filter}|${m.sort}|${m.pack}`,v=B1(p,x),y=[...v.selected],w=b.useRef({key:x,loadedItems:null,stickers:new Map});if(w.current.key!==x&&(w.current={key:x,loadedItems:m.loadedItems,stickers:new Map}),m.loadedItems&&w.current.loadedItems!==m.loadedItems){for(const B of m.loadedItems)w.current.stickers.set(B.id,B);w.current.loadedItems=m.loadedItems}const N=new Map(m.items.map(B=>[B.id,B]));for(const B of y){const z=w.current.stickers.get(B);z&&!N.has(B)&&N.set(B,z)}const C=m.pack&&m.pack!=="none"?m.pack:void 0,k=b.useRef(m.reload);k.current=m.reload,b.useEffect(()=>{o!==0&&k.current()},[o]);const j=O1({items:[...N.values()],packs:m.packs,selectedIds:y,clearSelection:v.clear,reload:m.reload,fromPackId:C,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:m.loadPacks}),_=!!(m.q||m.pack||!m.lockedFilter&&m.filter!=="all"),R=h(_?"noResults":a==="favorites"?"favoritesEmpty":a==="recent"?"recentEmpty":"emptyLibrary"),I=[...N.values()].some(B=>v.selected.has(B.id)&&B.animated),q=(m.lockedFilter||m.filter==="all"?0:1)+(m.pack?1:0),he=()=>{m.setQ(""),m.lockedFilter||m.setFilter("all"),m.setPack("")};return s.jsxs("div",{className:Ue("flex flex-col gap-3 min-w-0",y.length>0&&"pb-16 sm:pb-0"),children:[s.jsxs(ml,{children:[s.jsx(Xe,{type:"search",value:m.q,onChange:B=>m.setQ(B.target.value),placeholder:h("searchStickers"),"aria-label":h("searchStickers"),className:"min-w-48 flex-1"}),s.jsxs(hl,{label:h("filter"),resetLabel:h("reset"),activeCount:q,onReset:()=>{m.lockedFilter||m.setFilter("all"),m.setPack("")},children:[!m.lockedFilter&&s.jsxs(Qt,{"aria-label":h("filterBy"),value:m.filter,onChange:B=>m.setFilter(B.target.value),children:[s.jsx("option",{value:"all",children:h("allStickers")}),s.jsx("option",{value:"favorites",children:h("favorites")}),s.jsx("option",{value:"recent",children:h("recent")}),s.jsx("option",{value:"animated",children:h("animated")}),s.jsx("option",{value:"static",children:h("static")})]}),s.jsxs(Qt,{"aria-label":h("packFilter"),value:m.pack,onChange:B=>m.setPack(B.target.value),children:[s.jsx("option",{value:"",children:h("anyPack")}),s.jsx("option",{value:"none",children:h("noPack")}),m.packs.map(B=>s.jsx("option",{value:B.id,children:B.name},B.id))]})]}),s.jsx(Lr,{label:h("sort"),value:m.sort,onChange:B=>m.setSort(B),options:[{value:"newest",label:h("sortNewest")},{value:"oldest",label:h("sortOldest")},{value:"name",label:h("sortName")},{value:"recent",label:h("sortRecent")}]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2 px-0.5 text-xs text-muted",children:[s.jsx("span",{children:h("resultCount").replace("{n}",String(m.total))}),m.items.length>0&&s.jsx(fe,{variant:"ghost",size:"sm",onClick:v.selectAll,children:h(m.pageCount>1?"selectCurrentPage":"selectAll")})]}),s.jsx(M1,{count:y.length,animatedSelected:I,canRemove:!!C,sendReason:y.length?j.sendReason:null,exportReason:y.length?j.exportReason:null,onSelectAll:v.selectAll,selectAllLabel:h(m.pageCount>1?"selectCurrentPage":"selectAll"),onClear:v.clear,onFavorite:j.favorite,onUnfavorite:j.unfavorite,onAdd:j.askAdd,onMove:j.askMove,onRemove:j.remove,onDownload:j.download,onConvert:j.convert,onShare:j.share,onSend:j.askSend,onDelete:j.askDelete}),s.jsx(i4,{items:m.items,total:m.total,page:m.page,pageCount:m.pageCount,loading:m.loading,error:m.error,emptyText:R,isFiltered:_,selected:v.selected,onToggle:v.toggle,onOpen:j.openDetail,onFavorite:j.toggleFavorite,onPageChange:m.setPage,onRetry:m.reload,onClearFilters:_?he:void 0,onGoCreate:a==="all"&&!_?f:void 0}),j.dialogs]})},o4=({packId:a,isConnected:i,gifEnabled:r,onBack:o,onOpenInCreate:d})=>{const{t:f}=He(),{toast:h}=_t(),[m,p]=b.useState(null),[x,v]=b.useState([]),[y,w]=b.useState([]),[N,C]=b.useState(!0),[k,j]=b.useState(null),[_,R]=b.useState(0),[I,q]=b.useState(!1),he=b.useRef(""),{page:B,pageCount:z,pageItems:T,setPage:F,total:X}=qc(x,48,a),re=T.map(O=>O.id),ae=B1(re,a),de=[...ae.selected];b.useEffect(()=>{if(_<0)return;let O=!0;return j(null),Promise.all([Q.getPack(a),Q.getPacks()]).then(([ie,be])=>{O&&(p(ie.pack),v(ie.items),w(be.packs))}).catch(ie=>{O&&j(St(f,ie))}).finally(()=>{O&&C(!1)}),()=>{O=!1}},[a,_,f]);const se=()=>{C(x.length===0),R(O=>O+1)},U=O1({items:x,packs:y,selectedIds:de,clearSelection:ae.clear,reload:se,fromPackId:a,isConnected:i,gifEnabled:r,onOpenInCreate:d,onPackCreated:se}),D=async O=>{const ie=x;v(O),q(!0);try{await Q.reorderPack(a,O.map(be=>be.id))}catch(be){v(ie),h(St(f,be),"error")}finally{q(!1)}},$=(O,ie)=>{const be=O+ie;if(I||be<0||be>=x.length)return;const we=x.slice(),[E]=we.splice(O,1);E&&(we.splice(be,0,E),D(we))},W=O=>{const ie=x.findIndex(Y=>Y.id===he.current),be=x.findIndex(Y=>Y.id===O);if(he.current="",I||ie<0||be<0||ie===be)return;const we=x.slice(),[E]=we.splice(ie,1);E&&(we.splice(be,0,E),D(we))},ye=x.some(O=>ae.selected.has(O.id)&&O.animated);return s.jsxs("div",{className:Ue("flex flex-col gap-3 min-w-0",de.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(Ec,{size:16,className:"rtl:-scale-x-100"}),f("backToPacks")]}),m&&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(Kn,{children:m.name})}),s.jsx("p",{className:"text-xs text-muted",children:rn(f("stickerCount"),{n:m.count})})]})]}),N&&x.length===0&&s.jsx(Es,{text:f("loading")}),k&&x.length===0&&s.jsx(ut,{kind:"error",description:k,action:s.jsx(fe,{onClick:se,children:f("retryLoad")})}),!N&&!k&&x.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(By,{size:28,className:"text-muted"}),description:f("packEmpty")}),x.length>0&&s.jsxs(s.Fragment,{children:[de.length===0&&s.jsx("div",{children:s.jsx(fe,{variant:"ghost",size:"sm",onClick:ae.selectAll,children:f(z>1?"selectCurrentPage":"selectAll")})}),s.jsx(M1,{count:de.length,animatedSelected:ye,canRemove:!0,sendReason:de.length?U.sendReason:null,exportReason:de.length?U.exportReason:null,onSelectAll:ae.selectAll,selectAllLabel:f(z>1?"selectCurrentPage":"selectAll"),onClear:ae.clear,onFavorite:U.favorite,onUnfavorite:U.unfavorite,onAdd:U.askAdd,onMove:U.askMove,onRemove:U.remove,onDownload:U.download,onConvert:U.convert,onShare:U.share,onSend:U.askSend,onDelete:U.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:T.map((O,ie)=>{const be=(B-1)*48+ie;return s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:we=>we.preventDefault(),onDrop:we=>{we.preventDefault(),W(O.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(L1,{sticker:O,selected:ae.selected.has(O.id),onToggle:we=>ae.toggle(ie,we),onOpen:()=>U.openDetail(O),onFavorite:()=>U.toggleFavorite(O)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold",children:s.jsx(Kn,{children:O.name||f("stickerPreview")})}),s.jsx(Oe,{label:f("reorderUp"),disabled:I||be===0,onClick:()=>$(be,-1),children:s.jsx(tj,{size:14})}),s.jsx(Oe,{label:f("reorderDown"),disabled:I||be===x.length-1,onClick:()=>$(be,1),children:s.jsx(fi,{size:14})}),s.jsx(Oe,{label:f("reorderDragHint"),variant:"ghost",className:"cursor-grab",draggable:!I,onDragStart:we=>{he.current=O.id,we.dataTransfer.effectAllowed="move",we.dataTransfer.setData("text/plain",O.id)},icon:s.jsx(By,{size:16})})]},O.id)})}),s.jsx(xi,{page:B,pageCount:z,total:X,onPageChange:F})]}),U.dialogs]})},c4=({isConnected:a,gifEnabled:i,onOpenInCreate:r})=>{const{t:o}=He(),{toast:d}=_t(),[f,h]=b.useState([]),[m,p]=b.useState(!0),[x,v]=b.useState(null),[y,w]=b.useState(""),[N,C]=b.useState(null),[k,j]=b.useState(!1),[_,R]=b.useState(null),[I,q]=b.useState(null),[he,B]=b.useState(""),[z,T]=b.useState(null),[F,X]=b.useState(!1),[re,ae]=b.useState(null),[de,se]=b.useState(""),U=b.useCallback(()=>{v(null),Q.getPacks().then(O=>h(O.packs)).catch(O=>v(St(o,O))).finally(()=>p(!1))},[o]);b.useEffect(()=>{U()},[U]);const D=async()=>{if(_r(y)){C(o("packNameLength"));return}j(!0),C(null);try{await Q.createPack(y.trim()),w(""),d(o("packCreated"),"success"),U()}catch(O){d(St(o,O),"error")}finally{j(!1)}},$=async()=>{if(I){if(_r(he)){d(o("packNameLength"),"warning");return}j(!0);try{await Q.updatePack(I.id,he.trim()),d(o("packRenamed"),"success"),q(null),U()}catch(O){d(St(o,O),"error")}finally{j(!1)}}},W=async()=>{if(z){j(!0);try{await Q.deletePack(z.id,F),d(o("packDeleted"),"success"),T(null),X(!1),U()}catch(O){d(St(o,O),"error")}finally{j(!1)}}},ye=async()=>{if(re){if(!de){d(o("noDestinationPack"),"warning");return}j(!0);try{await Q.mergePack(re.id,de),d(o("packsMerged"),"success"),ae(null),se(""),U()}catch(O){d(St(o,O),"error")}finally{j(!1)}}};return _?s.jsx(o4,{packId:_,isConnected:a,gifEnabled:i,onOpenInCreate:r,onBack:()=>{R(null),U()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{value:y,onChange:O=>{const ie=O.target.value;w(ie),N&&C(_r(ie)?o("packNameLength"):null)},onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),D())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),dir:"auto",maxLength:D1+20,className:"min-w-0 flex-1"}),s.jsxs(fe,{variant:"primary",onClick:()=>void D(),disabled:k,icon:s.jsx(rl,{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")})]})]}),N&&s.jsx("p",{className:"text-xs text-danger",children:N}),m&&s.jsx(Es,{text:o("loading")}),x&&!m&&s.jsx(ut,{kind:"error",description:x,action:s.jsx(fe,{onClick:U,children:o("retryLoad")})}),!m&&!x&&f.length===0&&s.jsx(ut,{kind:"empty",icon:s.jsx(Sh,{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(O=>s.jsxs(Ke,{className:"flex items-center gap-3",children:[s.jsxs(fe,{variant:"ghost",onClick:()=>R(O.id),className:"h-auto min-h-11 min-w-0 flex-1 justify-start gap-3 px-1","aria-label":o("openPack"),children:[O.coverUrl?s.jsx("img",{src:O.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(Sh,{size:20})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx(Kn,{lines:2,className:"font-bold text-text-main text-start",children:O.name}),s.jsx("span",{className:"block text-xs text-muted",children:rn(o("stickerCount"),{n:O.count})})]})]}),s.jsxs(sa,{label:o("moreActions"),children:[s.jsx(lt,{icon:s.jsx(Kb,{size:16}),onSelect:()=>{q(O),B(O.name)},children:o("renamePack")}),s.jsx(lt,{icon:s.jsx(xj,{size:16}),onSelect:()=>{ae(O),se("")},children:o("merge")}),s.jsx(Cr,{}),s.jsx(lt,{danger:!0,icon:s.jsx(In,{size:16}),onSelect:()=>{T(O),X(!1)},children:o("deletePack")})]})]},O.id))}),s.jsx(an,{isOpen:I!==null,onClose:()=>q(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(fe,{onClick:()=>q(null),children:o("cancel")}),s.jsx(fe,{variant:"primary",onClick:()=>void $(),disabled:k,children:o("save")})]}),children:s.jsx(Xe,{value:he,onChange:O=>B(O.target.value),"aria-label":o("packName"),dir:"auto"})}),s.jsx(an,{isOpen:z!==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 W(),disabled:k,children:o("delete")})]}),children:s.jsx(vn,{name:"delete-pack-mode",value:F?"stickers":"keep",onChange:O=>X(O==="stickers"),options:[{value:"keep",label:o("deleteKeepStickers")},{value:"stickers",label:o("deletePackAndStickers")}]})}),s.jsx(an,{isOpen:re!==null,onClose:()=>ae(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex w-full justify-end gap-2",children:[s.jsx(fe,{onClick:()=>ae(null),children:o("cancel")}),s.jsx(fe,{variant:"primary",onClick:()=>void ye(),disabled:k||!de,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(Qt,{id:"merge-into",value:de,onChange:O=>se(O.target.value),children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(O=>O.id!==(re==null?void 0:re.id)).map(O=>s.jsx("option",{value:O.id,children:O.name},O.id))]})]})})]})},u4=["library","packs","favorites","create","recent"];function G0(){const a=window.location.hash.replace(/^#/,"");if(a.startsWith("stickers/")){const i=a.slice(9);if(u4.includes(i))return i}return"library"}const d4=({isConnected:a})=>{const{t:i}=He(),{toast:r}=_t(),[o,d]=b.useState(G0),[f,h]=b.useState(o==="create"),[m,p]=b.useState(null),[x,v]=b.useState(null),[y,w]=b.useState(0),[N,C]=b.useState(null),[k,j]=b.useState(0),_=b.useCallback(()=>{let z=!0;return v(null),Q.getStickerCapabilities().then(T=>{z&&p(T)}).catch(T=>{z&&v(St(i,T))}),()=>{z=!1}},[i]);b.useEffect(()=>{if(!(y<0))return _()},[_,y]);const R=b.useCallback(z=>{d(z),z==="create"&&h(!0);const T=`stickers/${z}`;window.location.hash.replace(/^#/,"")!==T&&(window.location.hash=T)},[]);b.useEffect(()=>{const z=()=>d(G0());return window.addEventListener("hashchange",z),()=>window.removeEventListener("hashchange",z)},[]),b.useEffect(()=>{o==="create"&&h(!0)},[o]),b.useEffect(()=>(P0(z=>{if(z.type==="saved"){r(z.created?i("stickerCreated"):i("alreadyInLibrary"),z.created?"success":"info"),z.qualityReduced&&r(i("qualityReduced"),"info"),j(T=>T+1);return}r(nm(i,z.code),"error")}),()=>P0(null)),[i,r]),b.useEffect(()=>{const z=()=>{const F=$E();F&&(C(F),h(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};z();const T=()=>{document.visibilityState==="visible"&&z()};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[]);const I=b.useCallback(()=>{WE(),C(null)},[]),q=b.useCallback(async z=>{try{const T=await fetch(z.url,{credentials:"same-origin"});if(!T.ok)throw new Error(String(T.status));const F=await T.blob(),X=z.name.trim(),re=X?X.toLowerCase().endsWith(".webp")?X:`${X}.webp`:"sticker.webp";C({blob:F,name:re,source:"PANEL_UPLOAD",...kc()?{existingId:z.id}:{}}),R("create")}catch(T){r(St(i,T),"error")}},[R,i,r]),he=m!==null&&!m.webp,B=[{id:"library",label:i("library"),icon:s.jsx(dj,{size:16})},{id:"packs",label:i("packs"),icon:s.jsx(Sh,{size:16})},{id:"favorites",label:i("favorites"),icon:s.jsx(Bc,{size:16})},{id:"create",label:i("create"),icon:s.jsx(nj,{size:16})},{id:"recent",label:i("recent"),icon:s.jsx(ub,{size:16})}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6 min-w-0",children:[s.jsx(fl,{icon:s.jsx(Ih,{size:24}),title:i("stickers"),description:i("stickersDesc")}),he&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(ul,{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(Pc,{"aria-label":i("stickers"),className:"min-w-max",value:o,onChange:R,options:B.map(z=>({value:z.id,label:z.label,icon:z.icon}))})}),o==="library"&&s.jsx(gh,{preset:"all",isConnected:a,gifEnabled:(m==null?void 0:m.gif)===!0,refreshKey:k,onOpenInCreate:z=>void q(z),onGoCreate:()=>R("create")}),o==="favorites"&&s.jsx(gh,{preset:"favorites",isConnected:a,gifEnabled:(m==null?void 0:m.gif)===!0,refreshKey:k,onOpenInCreate:z=>void q(z),onGoCreate:()=>R("create")}),o==="recent"&&s.jsx(gh,{preset:"recent",isConnected:a,gifEnabled:(m==null?void 0:m.gif)===!0,refreshKey:k,onOpenInCreate:z=>void q(z),onGoCreate:()=>R("create")}),o==="packs"&&s.jsx(c4,{isConnected:a,gifEnabled:(m==null?void 0:m.gif)===!0,onOpenInCreate:z=>void q(z)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(ZE,{capabilities:m,capsError:x,onRetryCaps:()=>w(z=>z+1),incoming:N,onConsumedIncoming:I,isConnected:a,onGoLibrary:()=>R("library"),onCreated:()=>j(z=>z+1)})})]})},U1=["overview","connection","commands","ai","groups","autodelete","schedules","settings","logs","stickers"];function f4(){const a=window.location.hash.replace(/^#/,"").split("/")[0];return U1.includes(a)?a:"overview"}const h4=()=>{const{t:a}=He(),{toast:i}=_t(),[r,o]=b.useState(f4),[d,f]=b.useState(!1),{sessionStatus:h,socket:m}=qN((k,j)=>{if(k==="status"){const _=j==null?void 0:j.state;i(`Connection state: ${_}`,"info")}}),[p,x]=b.useState(null),v=b.useCallback(async()=>{try{const k=await Q.getSession();k!=null&&k.session?x({...k.session,qr:k.qr??null,pairingCode:k.pairingCode??null}):k!=null&&k.status&&x(k.status)}catch{}},[]);b.useEffect(()=>{v()},[v]);const y=p||h?{state:(h==null?void 0:h.state)||(p==null?void 0:p.state)||"idle",...p||{},...h||{}}:null,w=(y==null?void 0:y.connected)===!0||(y==null?void 0:y.state)==="connected";b.useEffect(()=>{const k=y==null?void 0:y.state,_=k==="starting"||k==="linking"||k==="reconnecting"||k==="waiting_for_qr"&&!(y!=null&&y.qr)&&!(y!=null&&y.pairingCode)?2e3:15e3,R=setInterval(()=>{v()},_);return()=>clearInterval(R)},[y==null?void 0:y.state,y==null?void 0:y.qr,y==null?void 0:y.pairingCode,v]);const N=k=>{o(k),window.location.hash=k};b.useEffect(()=>{const k=()=>{const j=window.location.hash.replace(/^#/,"").split("/")[0];U1.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 b.useEffect(()=>Ik(),[]),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(Kk,{currentView:r,onSelectView:N,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(Fk,{onToggleMobileMenu:()=>f(k=>!k),title:C[r]||"Dashboard",status:y}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[s.jsx(Pk,{}),s.jsxs(e1,{children:[r==="overview"&&s.jsx(JC,{status:y,onNavigate:N}),r==="connection"&&s.jsx(FC,{status:y,onRefresh:v,onStatusUpdate:k=>x(j=>({...j||{},...k}))}),r==="ai"&&s.jsx(FN,{}),r==="commands"&&s.jsx(wC,{}),r==="schedules"&&s.jsx(hE,{isConnected:w,onNavigate:N}),r==="groups"&&s.jsx(YC,{}),r==="autodelete"&&s.jsx(cC,{}),r==="settings"&&s.jsx(SE,{}),r==="stickers"&&s.jsx(d4,{isConnected:w}),r==="logs"&&s.jsx(XC,{socket:m})]})]})]})]})},m4=()=>s.jsx(Rj,{children:s.jsx(qk,{children:s.jsx(h4,{})})}),V0=document.getElementById("root");V0&&Bw.createRoot(V0).render(s.jsx(Tw.StrictMode,{children:s.jsx(m4,{})}));