levix-bot 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +1 -0
  2. package/package.json +1 -1
  3. package/public/dashboard/assets/index-5P8GnKLg.css +2 -0
  4. package/public/dashboard/assets/index-DXzno3X6.js +515 -0
  5. package/public/dashboard/index.html +2 -2
  6. package/public/dashboard.css +32 -0
  7. package/src/bootstrap/panel.js +16 -4
  8. package/src/commands/autoschedule.cjs +1 -1
  9. package/src/commands/blacklist.cjs +1 -1
  10. package/src/commands/calc.cjs +9 -9
  11. package/src/commands/gemini.cjs +26 -26
  12. package/src/commands/group/add.cjs +2 -2
  13. package/src/commands/group/demote.cjs +2 -2
  14. package/src/commands/group/members.cjs +2 -2
  15. package/src/commands/group/rules.cjs +1 -1
  16. package/src/commands/group/setname.cjs +3 -3
  17. package/src/commands/group/setpp.cjs +3 -3
  18. package/src/commands/group/setrules.cjs +1 -1
  19. package/src/commands/group/tagadmins.cjs +1 -1
  20. package/src/commands/group.cjs +1 -1
  21. package/src/commands/lang.cjs +3 -3
  22. package/src/commands/listschedules.cjs +1 -1
  23. package/src/commands/loop.cjs +3 -3
  24. package/src/commands/memory.cjs +18 -18
  25. package/src/commands/notes.cjs +1 -1
  26. package/src/commands/pack.cjs +159 -0
  27. package/src/commands/packs.cjs +47 -0
  28. package/src/commands/perm.cjs +2 -2
  29. package/src/commands/poll.cjs +3 -3
  30. package/src/commands/rand.cjs +2 -2
  31. package/src/commands/restart.cjs +4 -4
  32. package/src/commands/schedule.cjs +1 -1
  33. package/src/commands/send.cjs +3 -20
  34. package/src/commands/status.cjs +2 -2
  35. package/src/commands/sticker.cjs +77 -232
  36. package/src/commands/stickers.cjs +100 -0
  37. package/src/commands/stopbot.cjs +5 -5
  38. package/src/commands/stt.cjs +1 -1
  39. package/src/commands/toimage.cjs +88 -0
  40. package/src/commands/tts.cjs +2 -2
  41. package/src/config/defaults.cjs +5 -0
  42. package/src/config/settings.cjs +10 -0
  43. package/src/core/events.js +15 -1
  44. package/src/core/session.js +7 -0
  45. package/src/db/db.cjs +381 -0
  46. package/src/db/store.cjs +729 -21
  47. package/src/handlers/command.handler.js +5 -1
  48. package/src/panel/password-reset.cjs +1 -1
  49. package/src/routes/dashboard.api.esm.js +43 -10
  50. package/src/routes/stickers.api.esm.js +570 -0
  51. package/src/services/aiAgent.cjs +2 -2
  52. package/src/services/aiProviders.cjs +1 -1
  53. package/src/services/aiTools.cjs +27 -27
  54. package/src/stickers/errors.cjs +239 -0
  55. package/src/stickers/ffmpeg.cjs +133 -0
  56. package/src/stickers/jobs.cjs +183 -0
  57. package/src/stickers/library.cjs +712 -0
  58. package/src/stickers/limits.cjs +60 -0
  59. package/src/stickers/media.cjs +748 -0
  60. package/src/stickers/options.cjs +128 -0
  61. package/src/stickers/owner.cjs +103 -0
  62. package/src/stickers/studio.cjs +473 -0
  63. package/src/stickers/uploads.cjs +263 -0
  64. package/src/stickers/webp.cjs +231 -0
  65. package/src/stickers/zip.cjs +107 -0
  66. package/src/utils/memory.cjs +7 -7
  67. package/src/utils/messageContent.cjs +30 -4
  68. package/src/utils/recurrence.cjs +189 -30
  69. package/src/utils/stickerBot.cjs +84 -0
  70. package/src/utils/storage.cjs +3 -0
  71. package/src/utils/storage.esm.js +3 -0
  72. package/views/login.ejs +39 -3
  73. package/views/setup.ejs +21 -0
  74. package/public/dashboard/assets/index-BCXZoPGP.js +0 -446
  75. package/public/dashboard/assets/index-LvfJ8ybs.css +0 -2
@@ -0,0 +1,515 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function c(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=c(d);fetch(d.href,f)}})();function xf(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ud={exports:{}},hi={};/**
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 lg;function A2(){if(lg)return hi;lg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(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 p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:l,type:o,key:h,ref:d!==void 0?d:null,props:f}}return hi.Fragment=i,hi.jsx=c,hi.jsxs=c,hi}var sg;function z2(){return sg||(sg=1,ud.exports=A2()),ud.exports}var s=z2(),dd={exports:{}},Me={};/**
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 ig;function O2(){if(ig)return Me;ig=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),c=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"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),N=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),O=Symbol.iterator;function C(v){return v===null||typeof v!="object"?null:(v=O&&v[O]||v["@@iterator"],typeof v=="function"?v:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,M={};function q(v,T,ne){this.props=v,this.context=T,this.refs=M,this.updater=ne||E}q.prototype.isReactComponent={},q.prototype.setState=function(v,T){if(typeof v!="object"&&typeof v!="function"&&v!=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,v,T,"setState")},q.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function te(){}te.prototype=q.prototype;function Z(v,T,ne){this.props=v,this.context=T,this.refs=M,this.updater=ne||E}var ie=Z.prototype=new te;ie.constructor=Z,A(ie,q.prototype),ie.isPureReactComponent=!0;var J=Array.isArray;function _(){}var j={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function Q(v,T,ne){var le=ne.ref;return{$$typeof:l,type:v,key:T,ref:le!==void 0?le:null,props:ne}}function se(v,T){return Q(v.type,T,v.props)}function ce(v){return typeof v=="object"&&v!==null&&v.$$typeof===l}function oe(v){var T={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(ne){return T[ne]})}var F=/\/+/g;function Y(v,T){return typeof v=="object"&&v!==null&&v.key!=null?oe(""+v.key):T.toString(36)}function G(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status=="string"?v.then(_,_):(v.status="pending",v.then(function(T){v.status==="pending"&&(v.status="fulfilled",v.value=T)},function(T){v.status==="pending"&&(v.status="rejected",v.reason=T)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function X(v,T,ne,le,ve){var xe=typeof v;(xe==="undefined"||xe==="boolean")&&(v=null);var we=!1;if(v===null)we=!0;else switch(xe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(v.$$typeof){case l:case i:we=!0;break;case y:return we=v._init,X(we(v._payload),T,ne,le,ve)}}if(we)return ve=ve(v),we=le===""?"."+Y(v,0):le,J(ve)?(ne="",we!=null&&(ne=we.replace(F,"$&/")+"/"),X(ve,T,ne,"",function(dt){return dt})):ve!=null&&(ce(ve)&&(ve=se(ve,ne+(ve.key==null||v&&v.key===ve.key?"":(""+ve.key).replace(F,"$&/")+"/")+we)),T.push(ve)),1;we=0;var fe=le===""?".":le+":";if(J(v))for(var pe=0;pe<v.length;pe++)le=v[pe],xe=fe+Y(le,pe),we+=X(le,T,ne,xe,ve);else if(pe=C(v),typeof pe=="function")for(v=pe.call(v),pe=0;!(le=v.next()).done;)le=le.value,xe=fe+Y(le,pe++),we+=X(le,T,ne,xe,ve);else if(xe==="object"){if(typeof v.then=="function")return X(G(v),T,ne,le,ve);throw T=String(v),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return we}function ue(v,T,ne){if(v==null)return v;var le=[],ve=0;return X(v,le,"","",function(xe){return T.call(ne,xe,ve++)}),le}function je(v){if(v._status===-1){var T=v._result,ne=T();ne.then(function(le){(v._status===0||v._status===-1)&&(v._status=1,v._result=le,ne.status===void 0&&(ne.status="fulfilled",ne.value=le))},function(le){(v._status===0||v._status===-1)&&(v._status=2,v._result=le,ne.status===void 0&&(ne.status="rejected",ne.reason=le))}),v._status===-1&&(v._status=0,v._result=ne)}if(v._status===1)return v._result.default;throw v._result}var H=typeof reportError=="function"?reportError:function(v){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v=="object"&&v!==null&&typeof v.message=="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",v);return}console.error(v)};function re(v){var T=j.T,ne={};ne.types=T!==null?T.types:null,j.T=ne;try{var le=v(),ve=j.S;ve!==null&&ve(ne,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(_,H)}catch(xe){H(xe)}finally{T!==null&&ne.types!==null&&(T.types=ne.types),j.T=T}}function Ae(v){var T=j.T;if(T!==null){var ne=T.types;ne===null?T.types=[v]:ne.indexOf(v)===-1&&ne.push(v)}else re(Ae.bind(null,v))}var ke={map:ue,forEach:function(v,T,ne){ue(v,function(){T.apply(this,arguments)},ne)},count:function(v){var T=0;return ue(v,function(){T++}),T},toArray:function(v){return ue(v,function(T){return T})||[]},only:function(v){if(!ce(v))throw Error("React.Children.only expected to receive a single React element child.");return v}};return Me.Activity=b,Me.Children=ke,Me.Component=q,Me.Fragment=c,Me.Profiler=d,Me.PureComponent=Z,Me.StrictMode=o,Me.Suspense=x,Me.ViewTransition=S,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Me.__COMPILER_RUNTIME={__proto__:null,c:function(v){return j.H.useMemoCache(v)}},Me.addTransitionType=Ae,Me.cache=function(v){return function(){return v.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(v,T,ne){if(v==null)throw Error("The argument must be a React element, but you passed "+v+".");var le=A({},v.props),ve=v.key;if(T!=null)for(xe in T.key!==void 0&&(ve=""+T.key),T)!I.call(T,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&T.ref===void 0||(le[xe]=T[xe]);var xe=arguments.length-2;if(xe===1)le.children=ne;else if(1<xe){for(var we=Array(xe),fe=0;fe<xe;fe++)we[fe]=arguments[fe+2];le.children=we}return Q(v.type,ve,le)},Me.createContext=function(v){return v={$$typeof:h,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null},v.Provider=v,v.Consumer={$$typeof:f,_context:v},v},Me.createElement=function(v,T,ne){var le,ve={},xe=null;if(T!=null)for(le in T.key!==void 0&&(xe=""+T.key),T)I.call(T,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ve[le]=T[le]);var we=arguments.length-2;if(we===1)ve.children=ne;else if(1<we){for(var fe=Array(we),pe=0;pe<we;pe++)fe[pe]=arguments[pe+2];ve.children=fe}if(v&&v.defaultProps)for(le in we=v.defaultProps,we)ve[le]===void 0&&(ve[le]=we[le]);return Q(v,xe,ve)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(v){return{$$typeof:p,render:v}},Me.isValidElement=ce,Me.lazy=function(v){return{$$typeof:y,_payload:{_status:-1,_result:v},_init:je}},Me.memo=function(v,T){return{$$typeof:N,type:v,compare:T===void 0?null:T}},Me.startTransition=re,Me.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Me.use=function(v){return j.H.use(v)},Me.useActionState=function(v,T,ne){return j.H.useActionState(v,T,ne)},Me.useCallback=function(v,T){return j.H.useCallback(v,T)},Me.useContext=function(v){return j.H.useContext(v)},Me.useDebugValue=function(){},Me.useDeferredValue=function(v,T){return j.H.useDeferredValue(v,T)},Me.useEffect=function(v,T){return j.H.useEffect(v,T)},Me.useEffectEvent=function(v){return j.H.useEffectEvent(v)},Me.useId=function(){return j.H.useId()},Me.useImperativeHandle=function(v,T,ne){return j.H.useImperativeHandle(v,T,ne)},Me.useInsertionEffect=function(v,T){return j.H.useInsertionEffect(v,T)},Me.useLayoutEffect=function(v,T){return j.H.useLayoutEffect(v,T)},Me.useMemo=function(v,T){return j.H.useMemo(v,T)},Me.useOptimistic=function(v,T){return j.H.useOptimistic(v,T)},Me.useReducer=function(v,T,ne){return j.H.useReducer(v,T,ne)},Me.useRef=function(v){return j.H.useRef(v)},Me.useState=function(v){return j.H.useState(v)},Me.useSyncExternalStore=function(v,T,ne){return j.H.useSyncExternalStore(v,T,ne)},Me.useTransition=function(){return j.H.useTransition()},Me.version="19.3.0",Me}var rg;function gf(){return rg||(rg=1,dd.exports=O2()),dd.exports}var w=gf();const yi=xf(w);var fd={exports:{}},pi={},md={exports:{}},hd={};/**
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 og;function M2(){return og||(og=1,(function(l){function i(G,X){var ue=G.length;G.push(X);e:for(;0<ue;){var je=ue-1>>>1,H=G[je];if(0<d(H,X))G[je]=X,G[ue]=H,ue=je;else break e}}function c(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var X=G[0],ue=G.pop();if(ue!==X){G[0]=ue;e:for(var je=0,H=G.length,re=H>>>1;je<re;){var Ae=2*(je+1)-1,ke=G[Ae],v=Ae+1,T=G[v];if(0>d(ke,ue))v<H&&0>d(T,ke)?(G[je]=T,G[v]=ue,je=v):(G[je]=ke,G[Ae]=ue,je=Ae);else if(v<H&&0>d(T,ue))G[je]=T,G[v]=ue,je=v;else break e}}return X}function d(G,X){var ue=G.sortIndex-X.sortIndex;return ue!==0?ue:G.id-X.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var h=Date,p=h.now();l.unstable_now=function(){return h.now()-p}}var x=[],N=[],y=1,b=null,S=3,O=!1,C=!1,E=!1,A=!1,M=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;function Z(G){for(var X=c(N);X!==null;){if(X.callback===null)o(N);else if(X.startTime<=G)o(N),X.sortIndex=X.expirationTime,i(x,X);else break;X=c(N)}}function ie(G){if(E=!1,Z(G),!C)if(c(x)!==null)C=!0,J||(J=!0,ce());else{var X=c(N);X!==null&&Y(ie,X.startTime-G)}}var J=!1,_=-1,j=5,I=-1;function Q(){return A?!0:!(l.unstable_now()-I<j)}function se(){if(A=!1,J){var G=l.unstable_now();I=G;var X=!0;try{e:{C=!1,E&&(E=!1,q(_),_=-1),O=!0;var ue=S;try{t:{for(Z(G),b=c(x);b!==null&&!(b.expirationTime>G&&Q());){var je=b.callback;if(typeof je=="function"){b.callback=null,S=b.priorityLevel;var H=je(b.expirationTime<=G);if(G=l.unstable_now(),typeof H=="function"){b.callback=H,Z(G),X=!0;break t}b===c(x)&&o(x),Z(G)}else o(x);b=c(x)}if(b!==null)X=!0;else{var re=c(N);re!==null&&Y(ie,re.startTime-G),X=!1}}break e}finally{b=null,S=ue,O=!1}X=void 0}}finally{X?ce():J=!1}}}var ce;if(typeof te=="function")ce=function(){te(se)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,F=oe.port2;oe.port1.onmessage=se,ce=function(){F.postMessage(null)}}else ce=function(){M(se,0)};function Y(G,X){_=M(function(){G(l.unstable_now())},X)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(G){G.callback=null},l.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<G?Math.floor(1e3/G):5},l.unstable_getCurrentPriorityLevel=function(){return S},l.unstable_next=function(G){switch(S){case 1:case 2:case 3:var X=3;break;default:X=S}var ue=S;S=X;try{return G()}finally{S=ue}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(G,X){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ue=S;S=G;try{return X()}finally{S=ue}},l.unstable_scheduleCallback=function(G,X,ue){var je=l.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?je+ue:je):ue=je,G){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=ue+H,G={id:y++,callback:X,priorityLevel:G,startTime:ue,expirationTime:H,sortIndex:-1},ue>je?(G.sortIndex=ue,i(N,G),c(x)===null&&G===c(N)&&(E?(q(_),_=-1):E=!0,Y(ie,ue-je))):(G.sortIndex=H,i(x,G),C||O||(C=!0,J||(J=!0,ce()))),G},l.unstable_shouldYield=Q,l.unstable_wrapCallback=function(G){var X=S;return function(){var ue=S;S=X;try{return G.apply(this,arguments)}finally{S=ue}}}})(hd)),hd}var cg;function D2(){return cg||(cg=1,md.exports=M2()),md.exports}var pd={exports:{}},qt={};/**
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 ug;function R2(){if(ug)return qt;ug=1;var l=gf();function i(y){var b="https://react.dev/errors/"+y;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)b+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+y+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var o={d:{f:c,r:function(){throw Error(i(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key");function p(y,b,S){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:O==null?null:O===h?h:""+O,children:y,containerInfo:b,implementation:S}}var x=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function N(y,b){if(y==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,qt.browser=function(y){return{$$typeof:f,_reason:y}},qt.createPortal=function(y,b){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(i(299));return p(y,b,null,S)},qt.flushSync=function(y){var b=x.T,S=o.p;try{if(x.T=null,o.p=2,y)return y()}finally{x.T=b,o.p=S,o.d.f()}},qt.preconnect=function(y,b){typeof y=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,o.d.C(y,b))},qt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},qt.preinit=function(y,b){if(typeof y=="string"&&b&&typeof b.as=="string"){var S=b.as,O=N(S,b.crossOrigin),C=typeof b.integrity=="string"?b.integrity:void 0,E=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;S==="style"?o.d.S(y,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:O,integrity:C,fetchPriority:E}):S==="script"&&o.d.X(y,{crossOrigin:O,integrity:C,fetchPriority:E,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},qt.preinitModule=function(y,b){if(typeof y=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var S=N(b.as,b.crossOrigin);o.d.M(y,{crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&o.d.M(y)},qt.preload=function(y,b){if(typeof y=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var S=b.as,O=N(S,b.crossOrigin);o.d.L(y,S,{crossOrigin:O,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},qt.preloadModule=function(y,b){if(typeof y=="string")if(b){var S=N(b.as,b.crossOrigin);o.d.m(y,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else o.d.m(y)},qt.requestFormReset=function(y){o.d.r(y)},qt.unstable_batchedUpdates=function(y,b){return y(b)},qt.useFormState=function(y,b,S){return x.H.useFormState(y,b,S)},qt.useFormStatus=function(){return x.H.useHostTransitionStatus()},qt.version="19.3.0",qt}var dg;function L2(){if(dg)return pd.exports;dg=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),pd.exports=R2(),pd.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 fg;function U2(){if(fg)return pi;fg=1;var l=D2(),i=gf(),c=L2();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 p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(f(e)!==e)throw Error(o(188))}function N(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,a=t;;){var r=n.return;if(r===null)break;var u=r.alternate;if(u===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===u.child){for(u=r.child;u;){if(u===n)return x(r),e;if(u===a)return x(r),t;u=u.sibling}throw Error(o(188))}if(n.return!==a.return)n=r,a=u;else{for(var m=!1,g=r.child;g;){if(g===n){m=!0,n=r,a=u;break}if(g===a){m=!0,a=r,n=u;break}g=g.sibling}if(!m){for(g=u.child;g;){if(g===n){m=!0,n=u,a=r;break}if(g===a){m=!0,a=u,n=r;break}g=g.sibling}if(!m)throw Error(o(189))}}if(n.alternate!==a)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function b(e,t,n,a,r,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,r,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&b(e.child,t,n,a,r,u))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function O(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=S(e);return n===null||E(t,e,n.child,{foundSelf:!1}),t}function E(e,t,n,a){for(;n!==null;){if(n===t)a.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(a.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&E(e,t,n.child,a))return!0;n=n.sibling}return!1}function A(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 M=null,q=null;function te(e,t,n){return e===n?!0:e===t?(M=e,!0):!1}function Z(e,t,n){return e===n?(q=e,!1):e===t?(q!==null&&(M=e),!0):!1}function ie(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 J(e,t,n){for(var a=0,r=e;r;r=n(r))a++;r=0;for(var u=t;u;u=n(u))r++;for(;0<a-r;)e=n(e),a--;for(;0<r-a;)t=n(t),r--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var _=Object.assign,j=Symbol.for("react.element"),I=Symbol.for("react.transitional.element"),Q=Symbol.for("react.portal"),se=Symbol.for("react.fragment"),ce=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),Ae=Symbol.for("react.legacy_hidden"),ke=Symbol.for("react.memo_cache_sentinel"),v=Symbol.for("react.view_transition"),T=Symbol.for("react.recoverable"),ne=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var ve=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case se:return"Fragment";case oe:return"Profiler";case ce:return"StrictMode";case X:return"Suspense";case ue:return"SuspenseList";case re:return"Activity";case v:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Q:return"Portal";case Y:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case je:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var we=Array.isArray,fe=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,dt={pending:!1,data:null,method:null,action:null},ee=[],De=-1;function Be(e){return{current:e}}function Re(e){0>De||(e.current=ee[De],ee[De]=null,De--)}function ze(e,t){De++,ee[De]=e.current,e.current=t}var xt=Be(null),ae=Be(null),_e=Be(null),Ve=Be(null);function Ct(e,t){switch(ze(_e,t),ze(ae,e),ze(xt,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=hx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Re(xt),ze(xt,e)}function de(){Re(xt),Re(ae),Re(_e)}function Ne(e){var t=e.memoizedState;t!==null&&(us._currentValue=t.memoizedState,ze(Ve,e)),t=xt.current;var n=hx(t,e.type);t!==n&&(ze(ae,e),ze(xt,n))}function Je(e){ae.current===e&&(Re(xt),Re(ae)),Ve.current===e&&(Re(Ve),us._currentValue=dt)}var yt,Pt;function gt(e){if(yt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yt=t&&t[1]||"",Pt=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+yt+e+Pt}var Xn=!1;function zn(e,t){if(!e||Xn)return"";Xn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(he){var D=he}Reflect.construct(e,[],W)}else{try{W.call()}catch(he){D=he}W=!1;try{var B=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),W=!0,new e}finally{W&&(B!==void 0?Object.defineProperty(e.prototype,"props",B):delete e.prototype.props)}}}else{try{throw Error()}catch(he){D=he}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(he){if(he&&D&&typeof he.stack=="string")return[he.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),m=u[0],g=u[1];if(m&&g){var k=m.split(`
44
+ `),L=g.split(`
45
+ `);for(r=a=0;a<k.length&&!k[a].includes("DetermineComponentFrameRoot");)a++;for(;r<L.length&&!L[r].includes("DetermineComponentFrameRoot");)r++;if(a===k.length||r===L.length)for(a=k.length-1,r=L.length-1;1<=a&&0<=r&&k[a]!==L[r];)r--;for(;1<=a&&0<=r;a--,r--)if(k[a]!==L[r]){if(a!==1||r!==1)do if(a--,r--,0>r||k[a]!==L[r]){var V=`
46
+ `+k[a].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=a&&0<=r);break}}}finally{Xn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?gt(n):""}function zi(e,t){switch(e.tag){case 26:case 27:case 5:return gt(e.type);case 16:return gt("Lazy");case 13:return e.child!==t&&t!==null?gt("Suspense Fallback"):gt("Suspense");case 19:return gt("SuspenseList");case 0:case 15:return zn(e.type,!1);case 11:return zn(e.type.render,!1);case 1:return zn(e.type,!0);case 31:return gt("Activity");case 30:return gt("ViewTransition");default:return""}}function P(e){try{var t="",n=null;do t+=zi(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var Te=Object.prototype.hasOwnProperty,it=l.unstable_scheduleCallback,ct=l.unstable_cancelCallback,Qe=l.unstable_shouldYield,ha=l.unstable_requestPaint,$e=l.unstable_now,Uy=l.unstable_getCurrentPriorityLevel,Lf=l.unstable_ImmediatePriority,Uf=l.unstable_UserBlockingPriority,Oi=l.unstable_NormalPriority,By=l.unstable_LowPriority,Bf=l.unstable_IdlePriority,Hy=l.log,qy=l.unstable_setDisableYieldValue,Ns=null,nn=null;function pa(e){if(typeof Hy=="function"&&qy(e),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(Ns,e)}catch{}}var an=Math.clz32?Math.clz32:Vy,Gy=Math.log,Py=Math.LN2;function Vy(e){return e>>>=0,e===0?32:31-(Gy(e)/Py|0)|0}var Mi=256,Di=262144,Ri=4194304;function Xa(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 Li(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,u=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~u,a!==0?r=Xa(a):(m&=g,m!==0?r=Xa(m):n||(n=g&~e,n!==0&&(r=Xa(n))))):(g=a&~u,g!==0?r=Xa(g):m!==0?r=Xa(m):n||(n=a&~e,n!==0&&(r=Xa(n)))),r===0?0:t!==0&&t!==r&&(t&u)===0&&(u=r&-r,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:r}function Ss(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Hf(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-an(n),r=1<<a;t|=e[a],n&=~r}return t}function Yy(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 qf(){var e=Ri;return Ri<<=1,(Ri&62914560)===0&&(Ri=4194304),e}function Uo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function js(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Iy(e,t,n,a,r,u){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,k=e.expirationTimes,L=e.hiddenUpdates;for(n=m&~n;0<n;){var V=31-an(n),W=1<<V;g[V]=0,k[V]=-1;var D=L[V];if(D!==null)for(L[V]=null,V=0;V<D.length;V++){var B=D[V];B!==null&&(B.lane&=-536870913)}n&=~W}a!==0&&Gf(e,a,0),u!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=u&~(m&~t))}function Gf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-an(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Pf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-an(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function Vf(e,t){var n=t&-t;return n=(n&42)!==0?1:Bo(n),(n&(e.suspendedLanes|t))!==0?0:n}function Bo(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 Ho(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yf(){var e=pe.p;return e!==0?e:(e=window.event,e===void 0?32:Jx(e.type))}function If(e,t){var n=pe.p;try{return pe.p=e,t()}finally{pe.p=n}}var Fn=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Fn,Ft="__reactProps$"+Fn,wl="__reactContainer$"+Fn,Kf="__reactEvents$"+Fn,Ky="__reactListeners$"+Fn,Qy="__reactHandles$"+Fn,Qf="__reactResources$"+Fn,ws="__reactMarker$"+Fn,Ui="__reactLoad$"+Fn;function Bi(e){delete e[Dt],delete e[Ft],delete e[Ky],delete e[Qy]}function Fa(e){var t;if(t=e[Dt])return t;for(var n=e.parentNode;n;){if(t=n[wl]||n[Dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zx(e);e!==null;){if(n=e[Dt])return n;e=zx(e)}return t}e=n,n=e.parentNode}return null}function kl(e){if(e=e[Dt]||e[wl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ks(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function _l(e){var t=e[Qf];return t||(t=e[Qf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[ws]=!0}function Xf(e){e[Ui]=void 0}var Ff=new Set,Zf={};function Za(e,t){El(e,t),El(e+"Capture",t)}function El(e,t){for(Zf[e]=t,e=0;e<t.length;e++)Ff.add(t[e])}var Xy=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]*$"),Jf={},$f={};function Fy(e){return Te.call($f,e)?!0:Te.call(Jf,e)?!1:Xy.test(e)?$f[e]=!0:(Jf[e]=!0,!1)}var Fe=!1;function Wf(){var e=Fe;return Fe=!1,e}function Hi(e,t,n){if(Fy(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function qi(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 Zn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,a)}}function ln(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function em(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zy(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(m){n=""+m,u.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qo(e){if(!e._valueTracker){var t=em(e)?"checked":"value";e._valueTracker=Zy(e,t,""+e[t])}}function tm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=em(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}var Jy=/[\n"\\]/g;function mn(e){return e.replace(Jy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Go(e,t,n,a,r,u,m,g){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ln(t)):e.value!==""+ln(t)&&(e.value=""+ln(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Po(e,ln(e.value)):Po(e,ln(t)):n!=null?Po(e,ln(n)):a!=null&&e.removeAttribute("value"),r==null&&u!=null&&(e.defaultChecked=!!u),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+ln(g):e.removeAttribute("name")}function nm(e,t,n,a,r,u,m,g){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)){qo(e);return}n=n!=null?""+ln(n):"",t=t!=null?""+ln(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),qo(e)}function Po(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Cl(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+ln(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function am(e,t,n){if(t!=null&&(t=""+ln(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ln(n):""}function lm(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(o(92));if(we(a)){if(1<a.length)throw Error(o(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=ln(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),qo(e)}function Tl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $y=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 sm(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||$y.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function im(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="",Fe=!0);for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&(sm(e,r,a),Fe=!0)}else for(var u in t)t.hasOwnProperty(u)&&sm(e,u,t[u])}function Vo(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 Wy=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"]]),e1=/^[\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 Gi(e){return e1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function On(){}var Yo=null;function Io(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Al=null,zl=null;function rm(e){var t=kl(e);if(t&&(e=t.stateNode)){var n=e[Ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(Go(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+mn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[Ft]||null;if(!r)throw Error(o(90));Go(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&tm(a)}break e;case"textarea":am(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Cl(e,!!n.multiple,t,!1)}}}var Ko=!1;function om(e,t,n){if(Ko)return e(t,n);Ko=!0;try{var a=e(t);return a}finally{if(Ko=!1,(Al!==null||zl!==null)&&(Gr(),Al&&(t=Al,e=zl,zl=Al=null,rm(t),e)))for(t=0;t<e.length;t++)rm(e[t])}}function _s(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Ft]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qo=!1;if(Jn)try{var Es={};Object.defineProperty(Es,"passive",{get:function(){Qo=!0}}),window.addEventListener("test",Es,Es),window.removeEventListener("test",Es,Es)}catch{Qo=!1}var xa=null,Xo=null,Pi=null;function cm(){if(Pi)return Pi;var e,t=Xo,n=t.length,a,r="value"in xa?xa.value:xa.textContent,u=r.length;for(e=0;e<n&&t[e]===r[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===r[u-a];a++);return Pi=r.slice(e,1<a?1-a:void 0)}function Vi(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 Yi(){return!0}function um(){return!1}function It(e){function t(n,a,r,u,m){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=u,this.target=m,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(u):u[g]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Yi:um,this.isPropagationStopped=um,this}return _(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=Yi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yi)},persist:function(){},isPersistent:Yi}),t}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ii=It(ga),Cs=_({},ga,{view:0,detail:0}),t1=It(Cs),Fo,Zo,Ts,Ki=_({},Cs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$o,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!==Ts&&(Ts&&e.type==="mousemove"?(Fo=e.screenX-Ts.screenX,Zo=e.screenY-Ts.screenY):Zo=Fo=0,Ts=e),Fo)},movementY:function(e){return"movementY"in e?e.movementY:Zo}}),dm=It(Ki),n1=_({},Ki,{dataTransfer:0}),a1=It(n1),l1=_({},Cs,{relatedTarget:0}),Jo=It(l1),s1=_({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),i1=It(s1),r1=_({},ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),o1=It(r1),c1=_({},ga,{data:0}),fm=It(c1),u1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d1={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"},f1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function m1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=f1[e])?!!t[e]:!1}function $o(){return m1}var h1=_({},Cs,{key:function(e){if(e.key){var t=u1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?d1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$o,charCode:function(e){return e.type==="keypress"?Vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),p1=It(h1),x1=_({},Ki,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mm=It(x1),g1=_({},ga,{submitter:0}),b1=It(g1),y1=_({},Cs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$o}),v1=It(y1),N1=_({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),S1=It(N1),j1=_({},Ki,{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}),w1=It(j1),k1=_({},ga,{newState:0,oldState:0,source:0}),_1=It(k1),E1=[9,13,27,32],Wo=Jn&&"CompositionEvent"in window,As=null;Jn&&"documentMode"in document&&(As=document.documentMode);var C1=Jn&&"TextEvent"in window&&!As,hm=Jn&&(!Wo||As&&8<As&&11>=As),pm=" ",xm=!1;function gm(e,t){switch(e){case"keyup":return E1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ol=!1;function T1(e,t){switch(e){case"compositionend":return bm(t);case"keypress":return t.which!==32?null:(xm=!0,pm);case"textInput":return e=t.data,e===pm&&xm?null:e;default:return null}}function A1(e,t){if(Ol)return e==="compositionend"||!Wo&&gm(e,t)?(e=cm(),Pi=Xo=xa=null,Ol=!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 hm&&t.locale!=="ko"?null:t.data;default:return null}}var z1={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 ym(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!z1[e.type]:t==="textarea"}function vm(e,t,n,a){Al?zl?zl.push(a):zl=[a]:Al=a,t=Qr(t,"onChange"),0<t.length&&(n=new Ii("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var zs=null,Os=null;function O1(e){rx(e,0)}function Qi(e){var t=ks(e);if(tm(t))return e}function Nm(e,t){if(e==="change")return t}var Sm=!1;if(Jn){var ec;if(Jn){var tc="oninput"in document;if(!tc){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),tc=typeof jm.oninput=="function"}ec=tc}else ec=!1;Sm=ec&&(!document.documentMode||9<document.documentMode)}function wm(){zs&&(zs.detachEvent("onpropertychange",km),Os=zs=null)}function km(e){if(e.propertyName==="value"&&Qi(Os)){var t=[];vm(t,Os,e,Io(e)),om(O1,t)}}function M1(e,t,n){e==="focusin"?(wm(),zs=t,Os=n,zs.attachEvent("onpropertychange",km)):e==="focusout"&&wm()}function D1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qi(Os)}function R1(e,t){if(e==="click")return Qi(t)}function L1(e,t){if(e==="input"||e==="change")return Qi(t)}function U1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:U1;function Ms(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Te.call(t,r)||!sn(e[r],t[r]))return!1}return!0}function nc(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 _m(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Em(e,t){var n=_m(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_m(n)}}function Cm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=nc(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=nc(e.document)}return t}function ac(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 B1=Jn&&"documentMode"in document&&11>=document.documentMode,Ml=null,lc=null,Ds=null,sc=!1;function Am(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sc||Ml==null||Ml!==nc(a)||(a=Ml,"selectionStart"in a&&ac(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ds&&Ms(Ds,a)||(Ds=a,a=Qr(lc,"onSelect"),0<a.length&&(t=new Ii("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ml)))}function Ja(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Dl={animationend:Ja("Animation","AnimationEnd"),animationiteration:Ja("Animation","AnimationIteration"),animationstart:Ja("Animation","AnimationStart"),transitionrun:Ja("Transition","TransitionRun"),transitionstart:Ja("Transition","TransitionStart"),transitioncancel:Ja("Transition","TransitionCancel"),transitionend:Ja("Transition","TransitionEnd")},ic={},zm={};Jn&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function $a(e){if(ic[e])return ic[e];if(!Dl[e])return e;var t=Dl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zm)return ic[e]=t[n];return e}var Om=$a("animationend"),Mm=$a("animationiteration"),Dm=$a("animationstart"),H1=$a("transitionrun"),q1=$a("transitionstart"),G1=$a("transitioncancel"),Rm=$a("transitionend"),Lm=new Map,rc="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(" ");rc.push("scrollEnd");function wn(e,t){Lm.set(e,t),Za(t,[e])}var P1=0;function $n(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Cn.identifierPrefix;var n=P1++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Um(e){if(e==null||typeof e=="string")return e;var t=null,n=es;if(n!==null)for(var a=0;a<n.length;a++){var r=e[n[a]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Wn(e,t){return e=Um(e),t=Um(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Xi=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)},hn=[],Rl=0,oc=0;function Fi(){for(var e=Rl,t=oc=Rl=0;t<e;){var n=hn[t];hn[t++]=null;var a=hn[t];hn[t++]=null;var r=hn[t];hn[t++]=null;var u=hn[t];if(hn[t++]=null,a!==null&&r!==null){var m=a.pending;m===null?r.next=r:(r.next=m.next,m.next=r),a.pending=r}u!==0&&Bm(n,r,u)}}function Zi(e,t,n,a){hn[Rl++]=e,hn[Rl++]=t,hn[Rl++]=n,hn[Rl++]=a,oc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function cc(e,t,n,a){return Zi(e,t,n,a),Ji(e)}function Wa(e,t){return Zi(e,null,null,t),Ji(e)}function Bm(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,u=e.return;u!==null;)u.childLanes|=n,a=u.alternate,a!==null&&(a.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(r=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,r&&t!==null&&(r=31-an(n),e=u.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),u):null}function Ji(e){if(50<ni)throw ni=0,qr=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ll={};function V1(e,t,n,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(e,t,n,a){return new V1(e,t,n,a)}function uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ea(e,t){var n=e.alternate;return n===null?(n=Zt(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 Hm(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 $i(e,t,n,a,r,u){var m=0;if(a=e,typeof a=="function")uc(a)&&(m=1);else if(typeof a=="string")m=g2(e,n,xt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case re:return e=Zt(31,n,t,r),e.elementType=re,e.lanes=u,e;case se:return el(n.children,r,u,t);case ce:m=8,r|=24;break;case oe:return e=Zt(12,n,t,r|2),e.elementType=oe,e.lanes=u,e;case X:return e=Zt(13,n,t,r),e.elementType=X,e.lanes=u,e;case ue:return e=Zt(19,n,t,r),e.elementType=ue,e.lanes=u,e;case Ae:case v:return e=r|32,e=Zt(30,n,t,e),e.elementType=v,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Y:m=10;break e;case F:m=9;break e;case G:m=11;break e;case je:m=14;break e;case H:m=16,a=null;break e}m=29,n=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=Zt(m,n,t,r),t.elementType=e,t.type=a,t.lanes=u,t}function el(e,t,n,a){return e=Zt(7,e,a,t),e.lanes=n,e}function dc(e,t,n){return e=Zt(6,e,null,t),e.lanes=n,e}function qm(e){var t=Zt(18,null,null,0);return t.stateNode=e,t}function fc(e,t,n){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gm=new WeakMap;function pn(e,t){if(typeof e=="object"&&e!==null){var n=Gm.get(e);return n!==void 0?n:(t={value:e,source:t,stack:P(t)},Gm.set(e,t),t)}return{value:e,source:t,stack:P(t)}}var Ul=[],Bl=0,Wi=null,Rs=0,xn=[],gn=0,ba=null,Mn=1,Dn="";function ta(e,t){Ul[Bl++]=Rs,Ul[Bl++]=Wi,Wi=e,Rs=t}function Pm(e,t,n){xn[gn++]=Mn,xn[gn++]=Dn,xn[gn++]=ba,ba=e;var a=Mn;e=Dn;var r=32-an(a)-1;a&=~(1<<r),n+=1;var u=32-an(t)+r;if(30<u){var m=r-r%5;u=(a&(1<<m)-1).toString(32),a>>=m,r-=m,Mn=1<<32-an(t)+r|n<<r|a,Dn=u+e}else Mn=1<<u|n<<r|a,Dn=e}function er(e){e.return!==null&&(ta(e,1),Pm(e,1,0))}function mc(e){for(;e===Wi;)Wi=Ul[--Bl],Ul[Bl]=null,Rs=Ul[--Bl],Ul[Bl]=null;for(;e===ba;)ba=xn[--gn],xn[gn]=null,Dn=xn[--gn],xn[gn]=null,Mn=xn[--gn],xn[gn]=null}function Vm(e,t){xn[gn++]=Mn,xn[gn++]=Dn,xn[gn++]=ba,Mn=t.id,Dn=t.overflow,ba=e}var At=null,rt=null,He=!1,ya=null,bn=!1,hc=Error(o(519));function va(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ls(pn(t,e)),hc}function Ym(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Dt]=e,t[Ft]=a,n){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(n=0;n<li.length;n++)Pe(li[n],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),nm(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),lm(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||dx(t.textContent,n)?(a.popover!=null&&(Pe("beforetoggle",t),Pe("toggle",t)),a.onScroll!=null&&Pe("scroll",t),a.onScrollEnd!=null&&Pe("scrollend",t),a.onClick!=null&&(t.onclick=On),t=!0):t=!1,t||va(e,!0)}function tr(e){for(At=e.return;At;)switch(At.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:At=At.return}}function Hl(e){if(e!==At)return!1;if(!He)return tr(e),He=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yu(e.type,e.memoizedProps)),n=!n),n&&rt&&va(e),tr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));rt=Ax(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));rt=Ax(e)}else t===27?(t=rt,La(e.type)?(e=Wu,Wu=null,rt=e):rt=t):rt=At?vn(e.stateNode.nextSibling):null;return!0}function tl(){rt=At=null,He=!1}function pc(){var e=ya;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),ya=null),e}function Ls(e){ya===null?ya=[e]:ya.push(e)}var xc=Be(null),nl=null,na=null;function Na(e,t,n){ze(xc,t._currentValue),t._currentValue=n}function aa(e){e._currentValue=xc.current,Re(xc)}function nr(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function gc(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var u=r.dependencies;if(u!==null){var m=r.child;u=u.firstContext;e:for(;u!==null;){var g=u;u=r;for(var k=0;k<t.length;k++)if(g.context===t[k]){u.lanes|=n,g=u.alternate,g!==null&&(g.lanes|=n),nr(u.return,n,e),a||(m=null);break e}u=g.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(o(341));m.lanes|=n,u=m.alternate,u!==null&&(u.lanes|=n),nr(m,n,e),m=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=n,m=r.alternate,m!==null&&(m.lanes|=n),nr(r.return,n,e),m=r.child,m=m!==null?m.sibling:null):m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===e){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function al(e,t,n,a){e=null;for(var r=t,u=!1;r!==null;){if(!u){if((r.flags&524288)!==0)u=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(o(387));if(m=m.memoizedProps,m!==null){var g=r.type;sn(r.pendingProps.value,m.value)||(e!==null?e.push(g):e=[g])}}else if(r===Ve.current){if(m=r.alternate,m===null)throw Error(o(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(us):e=[us])}r=r.return}return e!==null&&gc(t,e,n,a),t.flags|=262144,e!==null}function ar(e){for(e=e.firstContext;e!==null;){if(!sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ll(e){nl=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return Im(nl,e)}function lr(e,t){return nl===null&&ll(e),Im(e,t)}function Im(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},na===null){if(e===null)throw Error(o(308));na=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else na=na.next=t;return n}var Y1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},I1=l.unstable_scheduleCallback,K1=l.unstable_NormalPriority,vt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bc(){return{controller:new Y1,data:new Map,refCount:0}}function Us(e){e.refCount--,e.refCount===0&&I1(K1,function(){e.controller.abort()})}function Km(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var a=t[e];n.indexOf(a)===-1&&n.push(a)}}}var Bs=null;function Q1(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Hs=null,yc=0,sl=0,ql=null;function X1(e,t){if(Hs===null){var n=Hs=[];yc=0,sl=Ru(),ql={status:"pending",value:void 0,then:function(a){n.push(a)}}}return yc++,t.then(Qm,Qm),t}function Qm(){if(--yc===0&&(Bs=null,Hs!==null)){ql!==null&&(ql.status="fulfilled");var e=Hs;Hs=null,sl=0,ql=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function F1(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var Xm=fe.S;fe.S=function(e,t){if(qp=$e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&X1(e,t),Bs!==null)for(var n=ls;n!==null;)Km(n,Bs),n=n.next;if(n=e.types,n!==null){for(var a=ls;a!==null;)Km(a,n),a=a.next;if(sl!==0){a=Bs,a===null&&(a=Bs=[]);for(var r=0;r<n.length;r++){var u=n[r];a.indexOf(u)===-1&&a.push(u)}}}Xm!==null&&Xm(e,t)};var il=Be(null);function vc(){var e=il.current;return e!==null?e:st.pooledCache}function sr(e,t){t===null?ze(il,il.current):ze(il,t.pool)}function Fm(){var e=vc();return e===null?null:{parent:vt._currentValue,pool:e}}var Gl=Error(o(460)),Nc=Error(o(474)),ir=Error(o(542)),rr={then:function(){}};function Zm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Jm(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(On,On),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wm(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(On,On);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wm(e),e}throw ol=t,Gl}}function rl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ol=n,Gl):n}}var ol=null;function $m(){if(ol===null)throw Error(o(459));var e=ol;return ol=null,e}function Wm(e){if(e===Gl||e===ir)throw Error(o(483))}var Pl=null,qs=0;function or(e){var t=qs;return qs+=1,Pl===null&&(Pl=[]),Jm(Pl,e,t)}function Sa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function cr(e,t){throw t.$$typeof===j?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function eh(e){function t(R,z){if(e){var U=R.deletions;U===null?(R.deletions=[z],R.flags|=16):U.push(z)}}function n(R,z){if(!e)return null;for(;z!==null;)t(R,z),z=z.sibling;return null}function a(R){for(var z=new Map;R!==null;)R.key===null?z.set(R.index,R):z.set(R.key,R),R=R.sibling;return z}function r(R,z){return R=ea(R,z),R.index=0,R.sibling=null,R}function u(R,z,U){return R.index=U,e?(U=R.alternate,U!==null?(U=U.index,U<z?(R.flags|=2,z):U):(R.flags|=134217730,z)):(R.flags|=1048576,z)}function m(R){return e&&R.alternate===null&&(R.flags|=134217730),R}function g(R,z,U,$){return z===null||z.tag!==6?(z=dc(U,R.mode,$),z.return=R,z):(z=r(z,U),z.return=R,z)}function k(R,z,U,$){var ge=U.type;return ge===se?(R=V(R,z,U.props.children,$,U.key),Sa(R,U),R):z!==null&&(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===H&&rl(ge)===z.type)?(z=r(z,U.props),Sa(z,U),z.return=R,z):(z=$i(U.type,U.key,U.props,null,R.mode,$),Sa(z,U),z.return=R,z)}function L(R,z,U,$){return z===null||z.tag!==4||z.stateNode.containerInfo!==U.containerInfo||z.stateNode.implementation!==U.implementation?(z=fc(U,R.mode,$),z.return=R,z):(z=r(z,U.children||[]),z.return=R,z)}function V(R,z,U,$,ge){return z===null||z.tag!==7?(z=el(U,R.mode,$,ge),z.return=R,z):(z=r(z,U),z.return=R,z)}function W(R,z,U){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=dc(""+z,R.mode,U),z.return=R,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case I:return U=$i(z.type,z.key,z.props,null,R.mode,U),Sa(U,z),U.return=R,U;case Q:return z=fc(z,R.mode,U),z.return=R,z;case H:return z=rl(z),W(R,z,U)}if(we(z)||le(z))return z=el(z,R.mode,U,null),z.return=R,z;if(typeof z.then=="function")return W(R,or(z),U);if(z.$$typeof===Y)return W(R,lr(R,z),U);cr(R,z)}return null}function D(R,z,U,$){var ge=z!==null?z.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ge!==null?null:g(R,z,""+U,$);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case I:return U.key===ge?k(R,z,U,$):null;case Q:return U.key===ge?L(R,z,U,$):null;case H:return U=rl(U),D(R,z,U,$)}if(we(U)||le(U))return ge!==null?null:V(R,z,U,$,null);if(typeof U.then=="function")return D(R,z,or(U),$);if(U.$$typeof===Y)return D(R,z,lr(R,U),$);cr(R,U)}return null}function B(R,z,U,$,ge){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return R=R.get(U)||null,g(z,R,""+$,ge);if(typeof $=="object"&&$!==null){switch($.$$typeof){case I:return R=R.get($.key===null?U:$.key)||null,k(z,R,$,ge);case Q:return R=R.get($.key===null?U:$.key)||null,L(z,R,$,ge);case H:return $=rl($),B(R,z,U,$,ge)}if(we($)||le($))return R=R.get(U)||null,V(z,R,$,ge,null);if(typeof $.then=="function")return B(R,z,U,or($),ge);if($.$$typeof===Y)return B(R,z,U,lr(z,$),ge);cr(z,$)}return null}function he(R,z,U,$){for(var ge=null,Ie=null,Ee=z,Oe=z=0,jt=null;Ee!==null&&Oe<U.length;Oe++){Ee.index>Oe?(jt=Ee,Ee=null):jt=Ee.sibling;var Xe=D(R,Ee,U[Oe],$);if(Xe===null){Ee===null&&(Ee=jt);break}e&&Ee&&Xe.alternate===null&&t(R,Ee),z=u(Xe,z,Oe),Ie===null?ge=Xe:Ie.sibling=Xe,Ie=Xe,Ee=jt}if(Oe===U.length)return n(R,Ee),He&&ta(R,Oe),ge;if(Ee===null){for(;Oe<U.length;Oe++)Ee=W(R,U[Oe],$),Ee!==null&&(z=u(Ee,z,Oe),Ie===null?ge=Ee:Ie.sibling=Ee,Ie=Ee);return He&&ta(R,Oe),ge}for(Ee=a(Ee);Oe<U.length;Oe++)jt=B(Ee,R,Oe,U[Oe],$),jt!==null&&(e&&(Xe=jt.alternate,Xe!==null&&Ee.delete(Xe.key===null?Oe:Xe.key)),z=u(jt,z,Oe),Ie===null?ge=jt:Ie.sibling=jt,Ie=jt);return e&&Ee.forEach(function(Ga){return t(R,Ga)}),He&&ta(R,Oe),ge}function Se(R,z,U,$){if(U==null)throw Error(o(151));for(var ge=null,Ie=null,Ee=z,Oe=z=0,jt=null,Xe=U.next();Ee!==null&&!Xe.done;Oe++,Xe=U.next()){Ee.index>Oe?(jt=Ee,Ee=null):jt=Ee.sibling;var Ga=D(R,Ee,Xe.value,$);if(Ga===null){Ee===null&&(Ee=jt);break}e&&Ee&&Ga.alternate===null&&t(R,Ee),z=u(Ga,z,Oe),Ie===null?ge=Ga:Ie.sibling=Ga,Ie=Ga,Ee=jt}if(Xe.done)return n(R,Ee),He&&ta(R,Oe),ge;if(Ee===null){for(;!Xe.done;Oe++,Xe=U.next())Xe=W(R,Xe.value,$),Xe!==null&&(z=u(Xe,z,Oe),Ie===null?ge=Xe:Ie.sibling=Xe,Ie=Xe);return He&&ta(R,Oe),ge}for(Ee=a(Ee);!Xe.done;Oe++,Xe=U.next())Xe=B(Ee,R,Oe,Xe.value,$),Xe!==null&&(e&&(jt=Xe.alternate,jt!==null&&Ee.delete(jt.key===null?Oe:jt.key)),z=u(Xe,z,Oe),Ie===null?ge=Xe:Ie.sibling=Xe,Ie=Xe);return e&&Ee.forEach(function(T2){return t(R,T2)}),He&&ta(R,Oe),ge}function Ue(R,z,U,$){if(typeof U=="object"&&U!==null&&U.type===se&&U.key===null&&U.props.ref===void 0&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case I:e:{for(var ge=U.key;z!==null;){if(z.key===ge){if(ge=U.type,ge===se){if(z.tag===7){n(R,z.sibling),$=r(z,U.props.children),Sa($,U),$.return=R,R=$;break e}}else if(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===H&&rl(ge)===z.type){n(R,z.sibling),$=r(z,U.props),Sa($,U),$.return=R,R=$;break e}n(R,z);break}else t(R,z);z=z.sibling}U.type===se?($=el(U.props.children,R.mode,$,U.key),Sa($,U),$.return=R,R=$):($=$i(U.type,U.key,U.props,null,R.mode,$),Sa($,U),$.return=R,R=$)}return m(R);case Q:e:{for(ge=U.key;z!==null;){if(z.key===ge)if(z.tag===4&&z.stateNode.containerInfo===U.containerInfo&&z.stateNode.implementation===U.implementation){n(R,z.sibling),$=r(z,U.children||[]),$.return=R,R=$;break e}else{n(R,z);break}else t(R,z);z=z.sibling}$=fc(U,R.mode,$),$.return=R,R=$}return m(R);case H:return U=rl(U),Ue(R,z,U,$)}if(we(U))return he(R,z,U,$);if(le(U)){if(ge=le(U),typeof ge!="function")throw Error(o(150));return U=ge.call(U),Se(R,z,U,$)}if(typeof U.then=="function")return Ue(R,z,or(U),$);if(U.$$typeof===Y)return Ue(R,z,lr(R,U),$);cr(R,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,z!==null&&z.tag===6?(n(R,z.sibling),$=r(z,U),$.return=R,R=$):(n(R,z),$=dc(U,R.mode,$),$.return=R,R=$),m(R)):n(R,z)}return function(R,z,U,$){try{qs=0;var ge=Ue(R,z,U,$);return Pl=null,ge}catch(Ee){if(Ee===Gl||Ee===ir)throw Ee;var Ie=Zt(29,Ee,null,R.mode);return Ie.lanes=$,Ie.return=R,Ie}finally{}}}var cl=eh(!0),th=eh(!1),ja=!1;function Sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jc(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 wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ka(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ze&2)!==0){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=Ji(e),Bm(e,null,n),t}return Zi(e,a,t,n),Ji(e)}function Gs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Pf(e,n)}}function wc(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?r=u=m:u=u.next=m,n=n.next}while(n!==null);u===null?r=u=t:u=u.next=t}else r=u=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var kc=!1;function Ps(){if(kc){var e=ql;if(e!==null)throw e}}function Vs(e,t,n,a){kc=!1;var r=e.updateQueue;ja=!1;var u=r.firstBaseUpdate,m=r.lastBaseUpdate,g=r.shared.pending;if(g!==null){r.shared.pending=null;var k=g,L=k.next;k.next=null,m===null?u=L:m.next=L,m=k;var V=e.alternate;V!==null&&(V=V.updateQueue,g=V.lastBaseUpdate,g!==m&&(g===null?V.firstBaseUpdate=L:g.next=L,V.lastBaseUpdate=k))}if(u!==null){var W=r.baseState;m=0,V=L=k=null,g=u;do{var D=g.lane&-536870913,B=D!==g.lane;if(B?(Ye&D)===D:(a&D)===D){D!==0&&D===sl&&(kc=!0),V!==null&&(V=V.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var he=e,Se=g;D=t;var Ue=n;switch(Se.tag){case 1:if(he=Se.payload,typeof he=="function"){W=he.call(Ue,W,D);break e}W=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Se.payload,D=typeof he=="function"?he.call(Ue,W,D):he,D==null)break e;W=_({},W,D);break e;case 2:ja=!0}}D=g.callback,D!==null&&(e.flags|=64,B&&(e.flags|=8192),B=r.callbacks,B===null?r.callbacks=[D]:B.push(D))}else B={lane:D,tag:g.tag,payload:g.payload,callback:g.callback,next:null},V===null?(L=V=B,k=W):V=V.next=B,m|=D;if(g=g.next,g===null){if(g=r.shared.pending,g===null)break;B=g,g=B.next,B.next=null,r.lastBaseUpdate=B,r.shared.pending=null}}while(!0);V===null&&(k=W),r.baseState=k,r.firstBaseUpdate=L,r.lastBaseUpdate=V,u===null&&(r.shared.lanes=0),Oa|=m,e.lanes=m,e.memoizedState=W}}function nh(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function ah(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)nh(n[e],t)}var _a=Be(null),ur=Be(0);function lh(e,t){e=oa,ze(ur,e),ze(_a,t),oa=e|t.baseLanes}function _c(){ze(ur,oa),ze(_a,_a.current)}function Ec(){oa=ur.current,Re(_a),Re(ur)}var Lt=Be(null),Vt=null;function Ea(e){var t=e.alternate;ze(Ut,Ut.current&1),ze(Lt,e),Vt===null&&(t===null||_a.current!==null||t.memoizedState!==null)&&(Vt=e)}function Cc(e){ze(Ut,Ut.current),ze(Lt,e),Vt===null&&(Vt=e)}function sh(e){e.tag===22?(ze(Ut,Ut.current),ze(Lt,e),Vt===null&&(Vt=e)):Ca()}function Ca(){ze(Ut,Ut.current),ze(Lt,Lt.current)}function rn(e){Re(Lt),Vt===e&&(Vt=null),Re(Ut)}var Ut=Be(0);function Ys(e,t){ze(Lt,Lt.current),ze(Ut,t)}function Tc(e){Re(Ut),Re(Lt),Vt===e&&(Vt=null)}function dr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ju(n)||$u(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 la=0,Le=null,lt=null,Nt=null,fr=!1,Vl=!1,ul=!1,mr=0,Is=0,Yl=null,Z1=0;function ht(){throw Error(o(321))}function Ac(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function zc(e,t,n,a,r,u){return la=u,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?Ph:Vh,ul=!1,u=n(a,r),ul=!1,Vl&&(u=rh(t,n,a,r)),ih(e),u}function ih(e){fe.H=vr;var t=lt!==null&&lt.next!==null;if(la=0,Nt=lt=Le=null,fr=!1,Is=0,Yl=null,t)throw Error(o(300));e===null||St||(e=e.dependencies,e!==null&&ar(e)&&(St=!0))}function rh(e,t,n,a){Le=e;var r=0;do{if(Vl&&(Yl=null),Is=0,Vl=!1,25<=r)throw Error(o(301));if(r+=1,Nt=lt=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}fe.H=lv,u=t(n,a)}while(Vl);return u}function J1(){var e=fe.H,t=e.useState()[0];return t=typeof t.then=="function"?Ks(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Le.flags|=1024),t}function Oc(){var e=mr!==0;return mr=0,e}function Mc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Dc(e){if(fr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fr=!1}la=0,Nt=lt=Le=null,Vl=!1,Is=mr=0,Yl=null}function Kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Le.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function bt(){if(lt===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Nt===null?Le.memoizedState:Nt.next;if(t!==null)Nt=t,lt=e;else{if(e===null)throw Le.alternate===null?Error(o(467)):Error(o(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Nt===null?Le.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function hr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(e){var t=Is;return Is+=1,Yl===null&&(Yl=[]),e=Jm(Yl,e,t),t=Le,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?Ph:Vh),e}function pr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ks(e);if(e.$$typeof===T)return;if(e.$$typeof===Y)return Rt(e)}throw Error(o(438,String(e)))}function Rc(e){var t=null,n=Le.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Le.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=hr(),Le.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=ke;return t.index++,n}function sa(e,t){return typeof t=="function"?t(e):t}function xr(e){var t=bt();return Lc(t,lt,e)}function Lc(e,t,n){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=n;var r=e.baseQueue,u=a.pending;if(u!==null){if(r!==null){var m=r.next;r.next=u.next,u.next=m}t.baseQueue=r=u,a.pending=null}if(u=e.baseState,r===null)e.memoizedState=u;else{t=r.next;var g=m=null,k=null,L=t,V=!1;do{var W=L.lane&-536870913;if(W!==L.lane?(Ye&W)===W:(la&W)===W){var D=L.revertLane;if(D===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),W===sl&&(V=!0);else if((la&D)===D){L=L.next,D===sl&&(V=!0);continue}else W={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},k===null?(g=k=W,m=u):k=k.next=W,Le.lanes|=D,Oa|=D;W=L.action,ul&&n(u,W),u=L.hasEagerState?L.eagerState:n(u,W)}else D={lane:W,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},k===null?(g=k=D,m=u):k=k.next=D,Le.lanes|=W,Oa|=W;L=L.next}while(L!==null&&L!==t);if(k===null?m=u:k.next=g,!sn(u,e.memoizedState)&&(St=!0,V&&(n=ql,n!==null)))throw n;e.memoizedState=u,e.baseState=m,e.baseQueue=k,a.lastRenderedState=u}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Uc(e){var t=bt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,u=t.memoizedState;if(r!==null){n.pending=null;var m=r=r.next;do u=e(u,m.action),m=m.next;while(m!==r);sn(u,t.memoizedState)||(St=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,a]}function oh(e,t,n){var a=Le,r=bt(),u=He;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var m=!sn((lt||r).memoizedState,n);if(m&&(r.memoizedState=n,St=!0),r=r.queue,qc(dh.bind(null,a,r,e),[e]),e=r.getSnapshot!==t||m||Nt!==null&&(Nt.memoizedState.tag&1)!==0,Il(e?9:8,{destroy:void 0},uh.bind(null,a,r,n,t),null),e){if(a.flags|=2048,st===null)throw Error(o(349));u||(la&127)!==0||ch(a,t,n)}return n}function ch(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Le.updateQueue,t===null?(t=hr(),Le.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function uh(e,t,n,a){t.value=n,t.getSnapshot=a,fh(t)&&mh(e)}function dh(e,t,n){return n(function(){fh(t)&&mh(e)})}function fh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function mh(e){var t=Wa(e,2);t!==null&&en(t,e,2)}function Bc(e){var t=Kt();if(typeof e=="function"){var n=e;if(e=n(),ul){pa(!0);try{n()}finally{pa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},t}function hh(e,t,n,a){return e.baseState=n,Lc(e,lt,typeof a=="function"?a:sa)}function $1(e,t,n,a,r){if(yr(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){u.listeners.push(m)}};fe.T!==null?n(!0):u.isTransition=!1,a(u),n=t.pending,n===null?(u.next=t.pending=u,ph(t,u)):(u.next=n.next,t.pending=n.next=u)}}function ph(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var u=fe.T,m={};m.types=u!==null?u.types:null,fe.T=m;try{var g=n(r,a),k=fe.S;k!==null&&k(m,g),xh(e,t,g)}catch(L){Hc(e,t,L)}finally{u!==null&&m.types!==null&&(u.types=m.types),fe.T=u}}else try{u=n(r,a),xh(e,t,u)}catch(L){Hc(e,t,L)}}function xh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){gh(e,t,a)},function(a){return Hc(e,t,a)}):gh(e,t,n)}function gh(e,t,n){t.status="fulfilled",t.value=n,bh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ph(e,n)))}function Hc(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,bh(t),t=t.next;while(t!==a)}e.action=null}function bh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function yh(e,t){return t}function vh(e,t){if(He){var n=st.formState;if(n!==null){e:{var a=Le;if(He){if(rt){t:{for(var r=rt,u=bn;r.nodeType!==8;){if(!u){r=null;break t}if(r=vn(r.nextSibling),r===null){r=null;break t}}u=r.data,r=u==="F!"||u==="F"?r:null}if(r){rt=vn(r.nextSibling),a=r.data==="F!";break e}}va(a)}a=!1}a&&(t=n[0])}}return n=Kt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yh,lastRenderedState:t},n.queue=a,n=Hh.bind(null,Le,a),a.dispatch=n,a=Bc(!1),u=Ic.bind(null,Le,!1,a.queue),a=Kt(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=$1.bind(null,Le,r,u,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function Nh(e){var t=bt();return Sh(t,lt,e)}function Sh(e,t,n){if(t=Lc(e,t,yh)[0],e=xr(sa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ks(t)}catch(m){throw m===Gl?ir:m}else a=t;t=bt();var r=t.queue,u=r.dispatch;return n!==t.memoizedState&&(Le.flags|=2048,Il(9,{destroy:void 0},W1.bind(null,r,n),null)),[a,u,e]}function W1(e,t){e.action=t}function jh(e){var t=bt(),n=lt;if(n!==null)return Sh(t,n,e);bt(),t=t.memoizedState,n=bt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Il(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Le.updateQueue,t===null&&(t=hr(),Le.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function wh(){return bt().memoizedState}function gr(e,t,n,a){var r=Kt();Le.flags|=e,r.memoizedState=Il(1|t,{destroy:void 0},n,a===void 0?null:a)}function br(e,t,n,a){var r=bt();a=a===void 0?null:a;var u=r.memoizedState.inst;lt!==null&&a!==null&&Ac(a,lt.memoizedState.deps)?r.memoizedState=Il(t,u,n,a):(Le.flags|=e,r.memoizedState=Il(1|t,u,n,a))}function kh(e,t){gr(8390656,8,e,t)}function qc(e,t){br(2048,8,e,t)}function ev(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=hr(),Le.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _h(e){var t=bt().memoizedState;return ev({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Eh(e,t){return br(4,2,e,t)}function Ch(e,t){return br(4,4,e,t)}function Th(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 Ah(e,t,n){n=n!=null?n.concat([e]):null,br(4,4,Th.bind(null,t,e),n)}function Gc(){}function zh(e,t){var n=bt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Ac(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Oh(e,t){var n=bt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Ac(t,a[1]))return a[0];if(a=e(),ul){pa(!0);try{e()}finally{pa(!1)}}return n.memoizedState=[a,t],a}function Pc(e,t,n){return n===void 0||(la&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Pp(),Le.lanes|=e,Oa|=e,n)}function Mh(e,t,n,a){return sn(n,t)?n:_a.current!==null?(e=Pc(e,n,a),sn(e,t)||(St=!0),e):(la&106)===0||(la&1073741824)!==0&&(Ye&261930)===0?(St=!0,e.memoizedState=n):(e=Pp(),Le.lanes|=e,Oa|=e,t)}function Dh(e,t,n,a,r){var u=pe.p;pe.p=u!==0&&8>u?u:8;var m=fe.T,g={};g.types=m!==null?m.types:null,fe.T=g,Ic(e,!1,t,n);try{var k=r(),L=fe.S;if(L!==null&&L(g,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var V=F1(k,a);Qs(e,t,V,dn(e))}else Qs(e,t,a,dn(e))}catch(W){Qs(e,t,{then:function(){},status:"rejected",reason:W},dn())}finally{pe.p=u,m!==null&&g.types!==null&&(m.types=g.types),fe.T=m}}function tv(){}function Vc(e,t,n,a){if(e.tag!==5)throw Error(o(476));var r=Rh(e).queue;Dh(e,r,t,dt,n===null?tv:function(){return Lh(e),n(a)})}function Rh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:dt,baseState:dt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:dt},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Lh(e){var t=Rh(e);t.next===null&&(t=e.alternate.memoizedState),Qs(e,t.next.queue,{},dn())}function Yc(){return Rt(us)}function Uh(){return bt().memoizedState}function Bh(){return bt().memoizedState}function nv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=dn();e=wa(n);var a=ka(t,e,n);a!==null&&(en(a,t,n),Gs(a,t,n)),t={cache:bc()},e.payload=t;return}t=t.return}}function av(e,t,n){var a=dn();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},yr(e)?qh(t,n):(n=cc(e,t,n,a),n!==null&&(en(n,e,a),Gh(n,t,a)))}function Hh(e,t,n){var a=dn();Qs(e,t,n,a)}function Qs(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(yr(e))qh(t,r);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var m=t.lastRenderedState,g=u(m,n);if(r.hasEagerState=!0,r.eagerState=g,sn(g,m))return Zi(e,t,r,0),st===null&&Fi(),!1}catch{}finally{}if(n=cc(e,t,r,a),n!==null)return en(n,e,a),Gh(n,t,a),!0}return!1}function Ic(e,t,n,a){if(a={lane:2,revertLane:Ru(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},yr(e)){if(t)throw Error(o(479))}else t=cc(e,n,a,2),t!==null&&en(t,e,2)}function yr(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function qh(e,t){Vl=fr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gh(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Pf(e,n)}}var vr={readContext:Rt,use:pr,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht,useEffectEvent:ht},Ph={readContext:Rt,use:pr,useCallback:function(e,t){return Kt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:kh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,gr(4194308,4,Th.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gr(4194308,4,e,t)},useInsertionEffect:function(e,t){gr(4,2,e,t)},useMemo:function(e,t){var n=Kt();t=t===void 0?null:t;var a=e();if(ul){pa(!0);try{e()}finally{pa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Kt();if(n!==void 0){var r=n(t);if(ul){pa(!0);try{n(t)}finally{pa(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=av.bind(null,Le,e),[a.memoizedState,e]},useRef:function(e){var t=Kt();return e={current:e},t.memoizedState=e},useState:function(e){e=Bc(e);var t=e.queue,n=Hh.bind(null,Le,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gc,useDeferredValue:function(e,t){var n=Kt();return Pc(n,e,t)},useTransition:function(){var e=Bc(!1);return e=Dh.bind(null,Le,e.queue,!0,!1),Kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Le,r=Kt();if(He){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),st===null)throw Error(o(349));(Ye&127)!==0||ch(a,t,n)}r.memoizedState=n;var u={value:n,getSnapshot:t};return r.queue=u,kh(dh.bind(null,a,u,e),[e]),a.flags|=2048,Il(9,{destroy:void 0},uh.bind(null,a,u,n,t),null),n},useId:function(){var e=Kt(),t=st.identifierPrefix;if(He){var n=Dn,a=Mn;n=(a&~(1<<32-an(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=mr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Z1++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yc,useFormState:vh,useActionState:vh,useOptimistic:function(e){var t=Kt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ic.bind(null,Le,!0,n),n.dispatch=t,[e,t]},useMemoCache:Rc,useCacheRefresh:function(){return Kt().memoizedState=nv.bind(null,Le)},useEffectEvent:function(e){var t=Kt(),n={impl:e};return t.memoizedState=n,function(){if((Ze&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Vh={readContext:Rt,use:pr,useCallback:zh,useContext:Rt,useEffect:qc,useImperativeHandle:Ah,useInsertionEffect:Eh,useLayoutEffect:Ch,useMemo:Oh,useReducer:xr,useRef:wh,useState:function(){return xr(sa)},useDebugValue:Gc,useDeferredValue:function(e,t){var n=bt();return Mh(n,lt.memoizedState,e,t)},useTransition:function(){var e=xr(sa)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:oh,useId:Uh,useHostTransitionStatus:Yc,useFormState:Nh,useActionState:Nh,useOptimistic:function(e,t){var n=bt();return hh(n,lt,e,t)},useMemoCache:Rc,useCacheRefresh:Bh,useEffectEvent:_h},lv={readContext:Rt,use:pr,useCallback:zh,useContext:Rt,useEffect:qc,useImperativeHandle:Ah,useInsertionEffect:Eh,useLayoutEffect:Ch,useMemo:Oh,useReducer:Uc,useRef:wh,useState:function(){return Uc(sa)},useDebugValue:Gc,useDeferredValue:function(e,t){var n=bt();return lt===null?Pc(n,e,t):Mh(n,lt.memoizedState,e,t)},useTransition:function(){var e=Uc(sa)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:oh,useId:Uh,useHostTransitionStatus:Yc,useFormState:jh,useActionState:jh,useOptimistic:function(e,t){var n=bt();return lt!==null?hh(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Rc,useCacheRefresh:Bh,useEffectEvent:_h};function Kc(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:_({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qc={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=dn(),r=wa(a);r.payload=t,n!=null&&(r.callback=n),t=ka(e,r,a),t!==null&&(en(t,e,a),Gs(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=dn(),r=wa(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=ka(e,r,a),t!==null&&(en(t,e,a),Gs(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=dn(),a=wa(n);a.tag=2,t!=null&&(a.callback=t),t=ka(e,a,n),t!==null&&(en(t,e,n),Gs(t,e,n))}};function Yh(e,t,n,a,r,u,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,m):t.prototype&&t.prototype.isPureReactComponent?!Ms(n,a)||!Ms(r,u):!0}function Ih(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Qc.enqueueReplaceState(t,t.state,null)}function dl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=_({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function Kh(e){Xi(e)}function Qh(e){console.error(e)}function Xh(e){Xi(e)}function Nr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Fh(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Xc(e,t,n){return n=wa(n),n.tag=3,n.payload={element:null},n.callback=function(){Nr(e,t)},n}function Zh(e){return e=wa(e),e.tag=3,e}function Jh(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var u=a.value;e.payload=function(){return r(u)},e.callback=function(){Fh(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Fh(t,n,a),typeof r!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function sv(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&al(t,n,r,!0),n=Lt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Vt===null?Pr():n.alternate===null&&pt===0&&(pt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===rr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Ou(e,a,r)),!1;case 22:return n.flags|=65536,a===rr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Ou(e,a,r)),!1}throw Error(o(435,n.tag))}return Ou(e,a,r),Pr(),!1}if(He)return t=Lt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==hc&&(e=Error(o(422),{cause:a}),Ls(pn(e,n)))):(a!==hc&&(t=Error(o(423),{cause:a}),Ls(pn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=pn(a,n),r=Xc(e.stateNode,a,r),wc(e,r),pt!==4&&(pt=2)),!1;var u=Error(o(520),{cause:a});if(u=pn(u,n),ti===null?ti=[u]:ti.push(u),pt!==4&&(pt=2),t===null)return!0;a=pn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Xc(n.stateNode,a,e),wc(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"&&(Ma===null||!Ma.has(u))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Zh(r),Jh(r,e,n,a),wc(n,r),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Fc=Error(o(461)),St=!1;function kt(e,t,n,a){t.child=e===null?th(t,null,n,a):cl(t,e.child,n,a)}function $h(e,t,n,a,r){n=n.render;var u=t.ref;if("ref"in a){var m={};for(var g in a)g!=="ref"&&(m[g]=a[g])}else m=a;return ll(t),a=zc(e,t,n,m,u,r),g=Oc(),e!==null&&!St?(Mc(e,t,r),ia(e,t,r)):(He&&g&&er(t),t.flags|=1,kt(e,t,a,r),t.child)}function Wh(e,t,n,a,r){if(e===null){var u=n.type;return typeof u=="function"&&!uc(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,ep(e,t,u,a,r)):(e=$i(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!au(e,r)){var m=u.memoizedProps;if(n=n.compare,n=n!==null?n:Ms,n(m,a)&&e.ref===t.ref)return ia(e,t,r)}return t.flags|=1,e=ea(u,a),e.ref=t.ref,e.return=t,t.child=e}function ep(e,t,n,a,r){if(e!==null){var u=e.memoizedProps;if(Ms(u,a)&&e.ref===t.ref)if(St=!1,t.pendingProps=a=u,au(e,r))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,ia(e,t,r)}return Zc(e,t,n,a,r)}function tp(e,t,n,a){var r=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(a=t.child=e.child,r=0;a!==null;)r=r|a.lanes|a.childLanes,a=a.sibling;a=r&~u}else a=0,t.child=null;return np(e,t,u,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&sr(t,u!==null?u.cachePool:null),u!==null?lh(t,u):_c(),sh(t);else return a=t.lanes=536870912,np(e,t,u!==null?u.baseLanes|n:n,n,a)}else u!==null?(sr(t,u.cachePool),lh(t,u),Ca(),t.memoizedState=null):(e!==null&&sr(t,null),_c(),Ca());return kt(e,t,r,n),t.child}function Xs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function np(e,t,n,a,r){var u=vc();return u=u===null?null:{parent:vt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&sr(t,null),_c(),sh(t),e!==null&&al(e,t,a,!0),t.childLanes=r,null}function Sr(e,t){return t=jr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ap(e,t,n){return cl(t,e.child,null,n),e=Sr(t,t.pendingProps),e.flags|=2,rn(t),t.memoizedState=null,e}function iv(e,t,n){var a=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(a.mode==="hidden")return e=Sr(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Xs(null,e);if(Cc(t),(e=rt)?(e=Tx(e,bn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ba!==null?{id:Mn,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},n=qm(e),n.return=t,t.child=n,At=t,rt=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return Sr(t,a)}var u=e.memoizedState;if(u!==null){var m=u.dehydrated;if(Cc(t),r)if(t.flags&256)t.flags&=-257,t=ap(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(St||al(e,t,n,!1),r=(n&e.childLanes)!==0,St||r){if(_a.current===null){if(a=st,a!==null&&(m=Vf(a,n),m!==0&&m!==u.retryLane))throw u.retryLane=m,Wa(e,m),en(a,e,m),Fc;Pr()}t=ap(e,t,n)}else e=u.treeContext,rt=vn(m.nextSibling),At=t,He=!0,ya=null,bn=!1,e!==null&&Vm(t,e),t=Sr(t,a),t.flags|=134221824;return t}return e=ea(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kl(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 Zc(e,t,n,a,r){return ll(t),n=zc(e,t,n,a,void 0,r),a=Oc(),e!==null&&!St?(Mc(e,t,r),ia(e,t,r)):(He&&a&&er(t),t.flags|=1,kt(e,t,n,r),t.child)}function lp(e,t,n,a,r,u){return ll(t),t.updateQueue=null,n=rh(t,a,n,r),ih(e),a=Oc(),e!==null&&!St?(Mc(e,t,u),ia(e,t,u)):(He&&a&&er(t),t.flags|=1,kt(e,t,n,u),t.child)}function sp(e,t,n,a,r){if(ll(t),t.stateNode===null){var u=Ll,m=n.contextType;typeof m=="object"&&m!==null&&(u=Rt(m)),u=new n(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Qc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Sc(t),m=n.contextType,u.context=typeof m=="object"&&m!==null?Rt(m):Ll,u.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Kc(t,n,m,a),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(m=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),m!==u.state&&Qc.enqueueReplaceState(u,u.state,null),Vs(t,a,u,r),Ps(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var g=t.memoizedProps,k=dl(n,g);u.props=k;var L=u.context,V=n.contextType;m=Ll,typeof V=="object"&&V!==null&&(m=Rt(V));var W=n.getDerivedStateFromProps;V=typeof W=="function"||typeof u.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,V||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g||L!==m)&&Ih(t,u,a,m),ja=!1;var D=t.memoizedState;u.state=D,Vs(t,a,u,r),Ps(),L=t.memoizedState,g||D!==L||ja?(typeof W=="function"&&(Kc(t,n,W,a),L=t.memoizedState),(k=ja||Yh(t,n,k,a,D,L,m))?(V||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=a,t.memoizedState=L),u.props=a,u.state=L,u.context=m,a=k):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,jc(e,t),m=t.memoizedProps,V=dl(n,m),u.props=V,W=t.pendingProps,D=u.context,L=n.contextType,k=Ll,typeof L=="object"&&L!==null&&(k=Rt(L)),g=n.getDerivedStateFromProps,(L=typeof g=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==W||D!==k)&&Ih(t,u,a,k),ja=!1,D=t.memoizedState,u.state=D,Vs(t,a,u,r),Ps();var B=t.memoizedState;m!==W||D!==B||ja||e!==null&&e.dependencies!==null&&ar(e.dependencies)?(typeof g=="function"&&(Kc(t,n,g,a),B=t.memoizedState),(V=ja||Yh(t,n,V,a,D,B,k)||e!==null&&e.dependencies!==null&&ar(e.dependencies))?(L||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,B,k),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,B,k)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=B),u.props=a,u.state=B,u.context=k,a=V):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Kl(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=cl(t,e.child,null,r),t.child=cl(t,null,n,r)):kt(e,t,n,r),t.memoizedState=u.state,e=t.child):e=ia(e,t,r),e}function ip(e,t,n,a){return tl(),t.flags|=256,kt(e,t,n,a),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Fm()}}function Wc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=un),e}function rp(e,t,n){var a=t.pendingProps,r=!1,u=(t.flags&128)!==0,m;if((m=u)||(m=e!==null&&e.memoizedState===null?!1:(Ut.current&2)!==0),m&&(r=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(r?Ea(t):Ca(),(e=rt)?(e=Tx(e,bn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ba!==null?{id:Mn,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},n=qm(e),n.return=t,t.child=n,At=t,rt=null)):e=null,e===null)throw va(t);return $u(e)?t.lanes=32:t.lanes=536870912,null}return u=a.children,a=a.fallback,r?(Ca(),r=t.mode,u=jr({mode:"hidden",children:u},r),a=el(a,r,n,null),u.return=t,a.return=t,u.sibling=a,t.child=u,a=t.child,a.memoizedState=$c(n),a.childLanes=Wc(e,m,n),t.memoizedState=Jc,Xs(null,a)):(Ea(t),eu(t,u))}var g=e.memoizedState;if(g!==null){var k=g.dehydrated;if(k!==null)return rv(e,t,u,m,a,k,g,n)}return r?(Ca(),r=a.fallback,u=t.mode,g=e.child,k=g.sibling,a=ea(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&1206910976,k!==null?r=ea(k,r):(r=el(r,u,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,Xs(null,a),a=t.child,r=e.child.memoizedState,r===null?r=$c(n):(u=r.cachePool,u!==null?(g=vt._currentValue,u=u.parent!==g?{parent:g,pool:g}:u):u=Fm(),r={baseLanes:r.baseLanes|n,cachePool:u}),a.memoizedState=r,a.childLanes=Wc(e,m,n),t.memoizedState=Jc,Xs(e.child,a)):(Ea(t),n=e.child,e=n.sibling,n=ea(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function eu(e,t){return t=jr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function jr(e,t){return e=Zt(22,e,null,t),e.lanes=0,e}function wr(e,t,n){return cl(t,e.child,null,n),e=eu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rv(e,t,n,a,r,u,m,g){if(n)return t.flags&256?(Ea(t),t.flags&=-257,wr(e,t,g)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,null):(Ca(),u=r.fallback,m=t.mode,r=jr({mode:"visible",children:r.children},m),u=el(u,m,g,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,cl(t,e.child,null,g),r=t.child,r.memoizedState=$c(g),r.childLanes=Wc(e,a,g),t.memoizedState=Jc,Xs(null,r));if(Ea(t),$u(u)){if(a=u.nextSibling&&u.nextSibling.dataset,a)var k=a.dgst;return a=k,a!==""&&(r=Error(o(419)),r.stack="",r.digest=a,Ls({value:r,source:null,stack:null})),wr(e,t,g)}if(St||al(e,t,g,!1),a=(g&e.childLanes)!==0,St||a){if(_a.current!==null)return wr(e,t,g);if(a=st,a!==null&&(r=Vf(a,g),r!==0&&r!==m.retryLane))throw m.retryLane=r,Wa(e,r),en(a,e,r),Fc;return Ju(u)||Pr(),wr(e,t,g)}return Ju(u)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,rt=vn(u.nextSibling),At=t,He=!0,ya=null,bn=!1,e!==null&&Vm(t,e),t=eu(t,r.children),t.flags|=134221824,t)}function op(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),nr(e.return,t,n)}function cp(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&dr(n)===null&&(t=e),e=e.sibling}return t}function kr(e,t,n,a,r,u){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r,treeForkCount:u}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=r,m.treeForkCount=u)}function tu(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 nu(e,t,n){var a=t.pendingProps,r=a.revealOrder,u=a.tail;a=a.children;var m=Ut.current;if(t.flags&128)return Ys(t,m),null;var g=(m&2)!==0;if(g?(m=m&1|2,t.flags|=128):m&=1,Ys(t,m),r==="backwards"&&e!==null?(tu(e),kt(e,t,a,n),tu(e)):kt(e,t,a,n),a=He?Rs:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&op(e,n,t);else if(e.tag===19)op(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(r){case"backwards":n=cp(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,tu(t)),kr(t,!0,r,null,u,a);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&dr(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}kr(t,!0,n,null,u,a);break;case"together":kr(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=cp(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),kr(t,!1,r,n,u,a)}return t.child}function up(e,t,n){var a=t.pendingProps;return Na(t,t.type,a.value),kt(e,t,a.children,n),t.child}function ia(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Oa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(al(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=ea(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ea(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function au(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ar(e)))}function ov(e,t,n){switch(t.tag){case 3:Ct(t,t.stateNode.containerInfo),Na(t,vt,e.memoizedState.cache),tl();break;case 27:case 5:Ne(t);break;case 4:Ct(t,t.stateNode.containerInfo);break;case 10:Na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cc(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return Ea(t),t.flags|=128,null;a=al(e,t,n,!1);var r=t.child.childLanes;return a||(n&r)!==0?rp(e,t,n):(Ea(t),e=ia(e,t,n),e!==null?e.sibling:null)}Ea(t);break;case 19:if(t.flags&128)return nu(e,t,n);if(r=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||(al(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return nu(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ys(t,Ut.current),a)break;return null;case 22:return t.lanes=0,tp(e,t,n,t.pendingProps);case 24:Na(t,vt,e.memoizedState.cache)}return ia(e,t,n)}function dp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!au(e,n)&&(t.flags&128)===0)return St=!1,ov(e,t,n);St=(e.flags&131072)!==0}else St=!1,He&&(t.flags&1048576)!==0&&Pm(t,Rs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=rl(t.elementType),t.type=e,typeof e=="function")uc(e)?(a=dl(e,a),t.tag=1,t=sp(null,t,e,a,n)):(t.tag=0,t=Zc(null,t,e,a,n));else{if(e!=null){var r=e.$$typeof;if(r===G){t.tag=11,t=$h(null,t,e,a,n);break e}else if(r===je){t.tag=14,t=Wh(null,t,e,a,n);break e}else if(r===Y){t.tag=10,t.type=e,t=up(null,t,n);break e}}throw t=xe(e)||e,Error(o(306,t,""))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=dl(a,t.pendingProps),sp(e,t,a,r,n);case 3:e:{if(Ct(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var u=t.memoizedState;r=u.element,jc(e,t),Vs(t,a,null,n);var m=t.memoizedState;if(a=m.cache,Na(t,vt,a),a!==u.cache&&gc(t,[vt],n,!0),Ps(),a=m.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=ip(e,t,a,n);break e}else if(a!==r){r=pn(Error(o(424)),t),Ls(r),t=ip(e,t,a,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(rt=vn(e.firstChild),At=t,He=!0,ya=null,bn=!0,n=th(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(tl(),a===r){t=ia(e,t,n);break e}kt(e,t,a,n)}t=t.child}return t;case 26:return Kl(e,t),e===null?(n=Lx(t.type,null,t.pendingProps,null))?t.memoizedState=n:He||(t.stateNode=px(t.type,t.pendingProps,_e.current,t)):t.memoizedState=Lx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&He&&(a=t.stateNode=Ox(t.type,t.pendingProps,_e.current),At=t,bn=!0,r=rt,La(t.type)?(Wu=r,rt=vn(a.firstChild)):rt=r),kt(e,t,t.pendingProps.children,n),Kl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((r=a=rt)&&(a=n2(a,t.type,t.pendingProps,bn),a!==null?(t.stateNode=a,At=t,rt=vn(a.firstChild),bn=!1,r=!0):r=!1),r||va(t)),Ne(t),r=t.type,u=t.pendingProps,m=e!==null?e.memoizedProps:null,a=u.children,Yu(r,u)?a=null:m!==null&&Yu(r,m)&&(t.flags|=32),t.memoizedState!==null&&(r=zc(e,t,J1,null,null,n),us._currentValue=r),Kl(e,t),kt(e,t,a,n),t.child;case 6:return e===null&&He&&((e=n=rt)&&(n=a2(n,t.pendingProps,bn),n!==null?(t.stateNode=n,At=t,rt=null,e=!0):e=!1),e||va(t)),null;case 13:return rp(e,t,n);case 4:return Ct(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=cl(t,null,a,n):kt(e,t,a,n),t.child;case 11:return $h(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,Kl(e,t),kt(e,t,a,n),t.child;case 8:return kt(e,t,t.pendingProps.children,n),t.child;case 12:return kt(e,t,t.pendingProps.children,n),t.child;case 10:return up(e,t,n);case 9:return r=t.type._context,a=t.pendingProps.children,ll(t),r=Rt(r),a=a(r),t.flags|=1,kt(e,t,a,n),t.child;case 14:return Wh(e,t,t.type,t.pendingProps,n);case 15:return ep(e,t,t.type,t.pendingProps,n);case 19:return nu(e,t,n);case 31:return iv(e,t,n);case 22:return tp(e,t,n,t.pendingProps);case 24:return ll(t),a=Rt(vt),e===null?(r=vc(),r===null&&(r=st,u=bc(),r.pooledCache=u,u.refCount++,u!==null&&(r.pooledCacheLanes|=n),r=u),t.memoizedState={parent:a,cache:r},Sc(t),Na(t,vt,r)):((e.lanes&n)!==0&&(jc(e,t),Vs(t,null,null,n),Ps()),r=e.memoizedState,u=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Na(t,vt,a)):(a=u.cache,Na(t,vt,a),a!==r.cache&&gc(t,[vt],n,!0))),kt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),a=t.pendingProps,a.name!=null&&a.name!=="auto"?t.flags|=e===null?18882560:18874368:He&&er(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Kl(e,t),kt(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ra(e){e.flags|=4}function lu(e,t,n,a,r){var u;if((u=(e.mode&32)!==0)&&(u=n===null?qx(t,a):qx(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),u){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Kp())e.flags|=8192;else throw ol=rr,Nc}else e.flags&=-16777217}function fp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gx(t))if(Kp())e.flags|=8192;else throw ol=rr,Nc}function _r(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qf():536870912,e.lanes|=t,Jl|=t)}function Fs(e,t){if(!He)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.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 ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&1206910976,a|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function cv(e,t,n){var a=t.pendingProps;switch(mc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return ot(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),aa(vt),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?ra(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pc())),ot(t),null;case 26:var r=t.type,u=t.memoizedState;return e===null?(ra(t),u!==null?(ot(t),fp(t,u)):(ot(t),lu(t,r,null,a,n))):u?u!==e.memoizedState?(ra(t),ot(t),fp(t,u)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ra(t),ot(t),lu(t,r,e,a,n)),null;case 27:if(Je(t),n=_e.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ra(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return ot(t),t.subtreeFlags&=-33554433,null}e=xt.current,Hl(t)?Ym(t):(e=Ox(r,a,n),t.stateNode=e,ra(t))}return ot(t),t.subtreeFlags&=-33554433,null;case 5:if(Je(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ra(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return ot(t),t.subtreeFlags&=-33554433,null}if(u=xt.current,Hl(t))Ym(t);else{var m=ii(_e.current);switch(u){case 1:u=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:u=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":u=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":u=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":u=m.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?m.createElement(r,{is:a.is}):m.createElement(r)}}u[Dt]=t,u[Ft]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)u.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=u;e:switch(Ht(u,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ra(t)}}return ot(t),t.subtreeFlags&=-33554433,lu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ra(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=_e.current,Hl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=At,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||dx(e.nodeValue,n)),e||va(t,!0)}else e=ii(e).createTextNode(a),e[Dt]=t,t.stateNode=e}return ot(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Hl(t),n!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Dt]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else n=pc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(rn(t),t):(rn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return ot(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Hl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(o(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));r[Dt]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),r=!1}else r=pc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(rn(t),t):(rn(t),null)}return rn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_r(t,t.updateQueue),ot(t),null);case 4:return de(),e===null&&Hu(t.stateNode.containerInfo),t.flags|=67108864,ot(t),null;case 10:return aa(t.type),ot(t),null;case 19:if(Tc(t),a=t.memoizedState,a===null)return ot(t),null;if(r=(t.flags&128)!==0,u=a.rendering,u===null)if(r)Fs(a,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=dr(e),u!==null){for(t.flags|=128,Fs(a,!1),e=u.updateQueue,t.updateQueue=e,_r(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Hm(n,e),n=n.sibling;return Ys(t,Ut.current&1|2),He&&ta(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&$e()>Br&&(t.flags|=128,r=!0,Fs(a,!1),t.lanes=4194304)}else{if(!r)if(e=dr(u),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,_r(t,e),Fs(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!u.alternate&&!He)return ot(t),null}else 2*$e()-a.renderingStartTime>Br&&n!==536870912&&(t.flags|=128,r=!0,Fs(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=$e(),e.sibling=null,u=Ut.current,u=r?u&1|2:u&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||He?Ys(t,u):(n=u,ze(Lt,t),ze(Ut,n),Vt===null&&(Vt=t)),He&&ta(t,a.treeForkCount),e}return ot(t),null;case 22:case 23:return rn(t),Ec(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),n=t.updateQueue,n!==null&&_r(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Re(il),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),aa(vt),ot(t),null;case 25:return null;case 30:return t.flags|=33554432,ot(t),null}throw Error(o(156,t.tag))}function uv(e,t){switch(mc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(vt),de(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Je(t),null;case 31:if(t.memoizedState!==null){if(rn(t),t.alternate===null)throw Error(o(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(rn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Tc(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 de(),null;case 10:return aa(t.type),null;case 22:case 23:return rn(t),Ec(),e!==null&&Re(il),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(vt),null;case 25:return null;default:return null}}function mp(e,t){switch(mc(t),t.tag){case 3:aa(vt),de();break;case 26:case 27:case 5:Je(t);break;case 4:de();break;case 31:t.memoizedState!==null&&rn(t);break;case 13:rn(t);break;case 19:Tc(t);break;case 10:aa(t.type);break;case 22:case 23:rn(t),Ec(),e!==null&&Re(il);break;case 24:aa(vt)}}function Zs(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var u=n.create,m=n.inst;a=u(),m.destroy=a}n=n.next}while(n!==r)}}catch(g){tt(t,t.return,g)}}function Ta(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var u=r.next;a=u;do{if((a.tag&e)===e){var m=a.inst,g=m.destroy;if(g!==void 0){m.destroy=void 0,r=t;var k=n,L=g;try{L()}catch(V){tt(r,k,V)}}}a=a.next}while(a!==u)}}catch(V){tt(t,t.return,V)}}function hp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ah(t,n)}catch(a){tt(e,e.return,a)}}}function pp(e,t,n){n.props=dl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){tt(e,t,a)}}function Rn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var r=e.stateNode,u=$n(e.memoizedProps,r);(r.ref===null||r.ref.name!==u)&&(r.ref=Sx(u)),a=r.ref;break;case 7:if(e.stateNode===null){var m=new fn(e);b(e.child,!1,e2,m,void 0,void 0),e.stateNode=m}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(g){tt(e,t,g)}}function Bt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){tt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){tt(e,t,r)}else n.current=null}function Er(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++)Cx(e.stateNode,t[n])}function xp(e){for(var t=e.return;t!==null&&(iu(t)&&Cx(e.stateNode,t.stateNode),!su(t));)t=t.return}function Js(e){for(var t=e.return;t!==null&&(iu(t)&&t2(e.stateNode,t.stateNode),!su(t));)t=t.return}function su(e){return e.tag===5||e.tag===3||e.tag===27}function iu(e){return e&&e.tag===7&&e.stateNode!==null}function ru(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){tt(e,e.return,r)}}function ou(e,t,n){try{var a=e.stateNode;Lv(a,e.type,n,t),a[Ft]=t}catch(r){tt(e,e.return,r)}}function gp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function cu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gp(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&&La(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 uu(e,t,n,a){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(r,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(r),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=On)),Er(e,a),Fe=!0;else if(r!==4&&(r===27&&(Er(e,a),a=null,La(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(uu(e,t,n,a),e=e.sibling;e!==null;)uu(e,t,n,a),e=e.sibling}function Cr(e,t,n,a){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),Er(e,a),Fe=!0;else if(r!==4&&(r===27&&(Er(e,a),a=null,La(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Cr(e,t,n,a),e=e.sibling;e!==null;)Cr(e,t,n,a),e=e.sibling}function bp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Ht(t,a,n),t[Dt]=e,t[Ft]=n}catch(u){tt(e,e.return,u)}}var Tr=!1,on=null;function yp(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Tr=!0)}var Ln=null;function vp(){var e=Ln;return Ln=null,e}var Jt=0;function Ql(e,t,n,a,r){return Jt=0,Np(e.child,t,n,a,r)}function Np(e,t,n,a,r){for(var u=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(a!==null){var g=Qu(m);a.push(g),g.view&&(u=!0)}else u||Qu(m).view&&(u=!0);Tr=!0,vx(m,Jt===0?t:t+"_"+Jt,n),Jt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||Np(e.child,t,n,a,r)&&(u=!0));e=e.sibling}return u}function Un(e,t){for(;e!==null;)e.tag===5?Nx(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Un(e.child,t)),e=e.sibling}function Ar(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ar(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=Wn(t.default,t.share),t!=="none"&&(Ql(e,n,t,null,!1)||Un(e.child,!1))}e=e.sibling}}function du(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,r=$n(a,n),u=Wn(a.default,n.paired?a.share:a.enter);u!=="none"?Ql(e,r,u,null,!1)?(Ar(e),n.paired||t||ts(e,a.onEnter)):Un(e.child,!1):Ar(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)du(e,t),e=e.sibling;else Ar(e)}function fu(e){if(on!==null&&on.size!==0){var t=on;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,a=n.name;if(a!=null&&a!=="auto"){var r=t.get(a);if(r!==void 0){var u=Wn(n.default,n.share);if(u!=="none"&&(Ql(e,a,u,null,!1)?(u=e.stateNode,r.paired=u,u.paired=r,ts(e,n.onShare)):Un(e.child,!1)),t.delete(a),t.size===0)break}}}fu(e)}e=e.sibling}}}function mu(e){if(e.tag===30){var t=e.memoizedProps,n=$n(t,e.stateNode),a=on!==null?on.get(n):void 0,r=Wn(t.default,a!==void 0?t.share:t.exit);r!=="none"&&(Ql(e,n,r,null,!1)?a!==void 0?(r=e.stateNode,a.paired=r,r.paired=a,on.delete(n),ts(e,t.onShare)):ts(e,t.onExit):Un(e.child,!1)),on!==null&&fu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)mu(e),e=e.sibling;else on!==null&&fu(e)}function Sp(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=$n(t,e.stateNode);t=Wn(t.default,t.update),e.flags&=-5,t!=="none"&&Ql(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Sp(e);e=e.sibling}}function hu(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,Un(e.child,!1))}hu(e)}e=e.sibling}}function zr(e){if(e.tag===30)e.stateNode.paired=null,Un(e.child,!1),hu(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)zr(e),e=e.sibling;else hu(e)}function jp(e){for(e=e.child;e!==null;)e.tag===30?Un(e.child,!1):(e.subtreeFlags&33554432)!==0&&jp(e),e=e.sibling}function pu(e,t,n,a,r,u,m){for(var g=!1;t!==null;){if(t.tag===5){var k=t.stateNode;if(u!==null&&Jt<u.length){var L=u[Jt],V=Qu(k);(L.view||V.view)&&(g=!0);var W;if(W=(e.flags&4)===0)if(V.clip)W=!0;else{W=L.rect;var D=V.rect;W=W.y!==D.y||W.x!==D.x||W.height!==D.height||W.width!==D.width}W&&(e.flags|=4),V.abs?V=!L.abs:(L=L.rect,V=V.rect,V=L.height!==V.height||L.width!==V.width),V&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&vx(k,Jt===0?n:n+"_"+Jt,r),g&&(e.flags&4)!==0||(Ln===null&&(Ln=[]),Ln.push(k,Jt===0?a:a+"_"+Jt,t.memoizedProps)),Jt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:pu(e,t.child,n,a,r,u,m)&&(g=!0));t=t.sibling}return g}function wp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,r=$n(n,a),u=Wn(n.default,n.update),m;m=e.memoizedState,e.memoizedState=null,a=e;var g=e.child;Jt=0,r=pu(a,g,r,r,u,m,!1),(e.flags&4)!==0&&r&&ts(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&wp(e);e=e.sibling}}var zt=!1,We=!1,Bn=!1,xu=!1,kp=typeof WeakSet=="function"?WeakSet:Set,Ot=null,Hn=!1,$s=!1,Or=!1,gu=!1;function dv(e,t,n){if(e=e.containerInfo,Pu=ds,e=Tm(e),ac(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var u=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var g=0,k=-1,L=-1,V=0,W=0,D=e,B=null;t:for(;;){for(var he;D!==a||u!==0&&D.nodeType!==3||(k=g+u),D!==m||r!==0&&D.nodeType!==3||(L=g+r),D.nodeType===3&&(g+=D.nodeValue.length),(he=D.firstChild)!==null;)B=D,D=he;for(;;){if(D===e)break t;if(B===a&&++V===u&&(k=g),B===m&&++W===r&&(L=g),(he=D.nextSibling)!==null)break;D=B,B=D.parentNode}D=he}a=k===-1||L===-1?null:{start:k,end:L}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vu={focusedElem:e,selectionRange:a},ds=!1,n=(n&335544064)===n,Ot=t,t=n?9270:1024;Ot!==null;){if(e=Ot,n&&(a=e.deletions,a!==null))for(u=0;u<a.length;u++)n&&mu(a[u]);if(e.alternate===null&&(e.flags&2)!==0)n&&yp(e),Mr(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&mu(a),Mr(n);continue}else if(a!==null&&a.memoizedState!==null){n&&yp(e),Mr(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,Ot=a):(n&&Sp(e),Mr(n))}}on=null}function Mr(e){for(;Ot!==null;){var t=Ot,n=e,a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&a!==null){n=void 0,r=a.memoizedProps,a=a.memoizedState;var u=t.stateNode;try{var m=dl(t.type,r);n=u.getSnapshotBeforeUpdate(m,a),u.__reactInternalSnapshotBeforeUpdate=n}catch(g){tt(t,t.return,g)}}break;case 3:if((r&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)Zu(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Zu(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&a!==null&&(n=$n(a.memoizedProps,a.stateNode),r=t.memoizedProps,r=Wn(r.default,r.update),r!=="none"&&Ql(a,n,r,a.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(o(163))}if(a=t.sibling,a!==null){a.return=t.return,Ot=a;break}Ot=t.return}}function _p(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:qn(e,n),a&4&&Zs(5,n);break;case 1:if(qn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){tt(n,n.return,m)}else{var r=dl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){tt(n,n.return,m)}}a&64&&hp(n),a&512&&Rn(n,n.return);break;case 3:if(qn(e,n),a&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{ah(e,t)}catch(m){tt(n,n.return,m)}}break;case 27:t===null&&a&4&&bp(n);case 26:case 5:qn(e,n),t===null&&a&4&&ru(n),a&512&&Rn(n,n.return);break;case 12:qn(e,n);break;case 31:qn(e,n),a&4&&Ap(e,n);break;case 13:qn(e,n),a&4&&zp(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=jv.bind(null,n),l2(e,n))));break;case 22:if(a=n.memoizedState!==null||zt,!a){var u=t!==null&&t.memoizedState!==null||We;t=zt,r=We,zt=a,(We=u)&&!r?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),En(e,n,a)):qn(e,n),zt=t,We=r}break;case 30:qn(e,n),a&512&&Rn(n,n.return);break;case 7:a&512&&Rn(n,n.return);default:qn(e,n)}}function bu(e,t){for(e=e.child;e!==null;)Ep(e,t),e=e.sibling}function Ep(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var a=n.style;typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"}else{var r=e.stateNode,u=e.memoizedProps.style,m=u!=null&&u.hasOwnProperty("display")?u.display:null;r.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(k){tt(e,e.return,k)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Fe=!0}catch(k){tt(e,e.return,k)}break;case 18:try{var g=e.stateNode;t?yx(g,!0):yx(e.stateNode,!1)}catch(k){tt(e,e.return,k)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:Ep(n,a);break e;case 22:n.memoizedState===null&&yu(n,a);break e;default:yu(n,a)}}e=e.sibling}}function Cp(e){var t=e.alternate;t!==null&&(e.alternate=null,Cp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Bi(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 ft=null,$t=!1;function kn(e,t,n){for(n=n.child;n!==null;)Tp(e,t,n),n=n.sibling}function Tp(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(Ns,n)}catch{}switch(n.tag){case 26:We||Bt(n,t),kn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!We&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:We||Bt(n,t),Js(n);var a=ft,r=$t;La(n.type)&&(ft=n.stateNode,$t=!1),kn(e,t,n),Mx(n.stateNode,n.type,n.memoizedProps),ft=a,$t=r;break;case 5:We||Bt(n,t),Js(n);case 6:if(n.tag===6&&Js(n),a=ft,r=$t,ft=null,kn(e,t,n),ft=a,$t=r,ft!==null)if($t)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode),Fe=!0}catch(u){tt(n,t,u)}else try{ft.removeChild(n.stateNode),Fe=!0}catch(u){tt(n,t,u)}break;case 18:ft!==null&&($t?(e=ft,bx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),fs(e)):bx(ft,n.stateNode));break;case 4:a=ft,r=$t,ft=n.stateNode.containerInfo,$t=!0,kn(e,t,n),ft=a,$t=r;break;case 0:case 11:case 14:case 15:Ta(2,n,t),We||Ta(4,n,t),kn(e,t,n);break;case 1:We||(Bt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&pp(n,t,a)),kn(e,t,n);break;case 21:kn(e,t,n);break;case 22:We=(a=We)||n.memoizedState!==null,kn(e,t,n),We=a;break;case 30:Bt(n,t),kn(e,t,n);break;case 7:We||Bt(n,t),kn(e,t,n);break;default:kn(e,t,n)}}function Ap(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fs(e)}catch(n){tt(t,t.return,n)}}}function zp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fs(e)}catch(n){tt(t,t.return,n)}}function fv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kp),t;default:throw Error(o(435,e.tag))}}function Dr(e,t){var n=fv(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var r=wv.bind(null,e,a);a.then(r,r)}})}function Qt(e,t,n){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var u=a[r],m=e,g=t,k=g;e:for(;k!==null;){switch(k.tag){case 27:if(La(k.type)){ft=k.stateNode,$t=!1;break e}break;case 5:ft=k.stateNode,$t=!1;break e;case 3:case 4:ft=k.stateNode.containerInfo,$t=!0;break e}k=k.return}if(ft===null)throw Error(o(160));Tp(m,g,u),ft=null,$t=!1,m=u.alternate,m!==null&&(m.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Op(t,e,n),t=t.sibling}var _n=null;function Op(e,t,n){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var u=0;u<a.length;u++){var m=a[u];m.ref.impl=m.nextImpl}Qt(t,e,n),Xt(e),r&4&&(Ta(3,e,e.return),Zs(3,e),Ta(5,e,e.return));break;case 1:Qt(t,e,n),Xt(e),r&512&&(We||a===null||Bt(a,a.return)),r&64&&zt&&(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,Qt(t,e,n),Xt(e),r&512&&(We||a===null||Bt(a,a.return)),r&4)if(r=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(zt)e.stateNode=px(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=u.ownerDocument||u;t:switch(t){case"title":a=r.getElementsByTagName("title")[0],(!a||a[ws]||a[Dt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(t),r.head.insertBefore(a,r.querySelector("head > title"))),Ht(a,t,n),a[Dt]=e,Tt(a),t=a;break e;case"link":if(u=Hx("link","href",r).get(t+(n.href||""))){for(m=0;m<u.length;m++)if(a=u[m],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){u.splice(m,1);break t}}a=r.createElement(t),Ht(a,t,n),r.head.appendChild(a);break;case"meta":if(u=Hx("meta","content",r).get(t+(n.content||""))){for(m=0;m<u.length;m++)if(a=u[m],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){u.splice(m,1);break t}}a=r.createElement(t),Ht(a,t,n),r.head.appendChild(a);break;default:throw Error(o(468,t))}a[Dt]=e,Tt(a),t=a}e.stateNode=t}else zt||ad(u,e.type,e.stateNode);else e.stateNode=Bx(u,n,e.memoizedProps);else r!==n?(r===null?(t=a.stateNode,t===null||We||t.parentNode.removeChild(t)):r.count--,n===null?zt||ad(u,e.type,e.stateNode):Bx(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&ou(e,e.memoizedProps,a.memoizedProps);break;case 27:Qt(t,e,n),Xt(e),r&512&&(We||a===null||Bt(a,a.return)),a!==null&&r&4&&ou(e,e.memoizedProps,a.memoizedProps);break;case 5:if(u=Bn,Bn=!1,Qt(t,e,n),Bn=u,Xt(e),r&512&&(We||a===null||Bt(a,a.return)),e.flags&32){t=e.stateNode;try{Tl(t,""),Fe=!0}catch(V){tt(e,e.return,V)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,ou(e,t,a!==null?a.memoizedProps:t)),r&1024&&(xu=!0);break;case 6:if(Qt(t,e,n),Xt(e),r&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Fe=!0}catch(V){tt(e,e.return,V)}}break;case 3:if(Fe=!1,Fr=null,u=_n,_n=ri(t.containerInfo),Qt(t,e,n),_n=u,Xt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{fs(t.containerInfo)}catch(V){tt(e,e.return,V)}xu&&(xu=!1,Mp(e)),Fe=!1;break;case 4:r=Bn,Bn=zt,a=Wf(),u=_n,_n=ri(e.stateNode.containerInfo),Qt(t,e,n),Xt(e),_n=u,Fe&&$s&&(Or=!0),Fe=a,Bn=r;break;case 12:Qt(t,e,n),Xt(e);break;case 31:Qt(t,e,n),Xt(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Dr(e,t)));break;case 13:Qt(t,e,n),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ur=$e()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Dr(e,t)));break;case 22:u=e.memoizedState!==null,m=a!==null&&a.memoizedState!==null;var g=zt,k=We,L=Bn;zt=g||u,Bn=L||u,We=k||m,Qt(t,e,n),We=k,Bn=L,zt=g,Xt(e),r&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||a===null||m||zt||We||(t=m||We,n=zt,a=We,zt=u||zt,We=t,Aa(e,2),zt=n,We=a),!u&&Bn||bu(e,u)),r&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Dr(e,n))));break;case 19:Qt(t,e,n),Xt(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Dr(e,t)));break;case 30:r&512&&(We||a===null||Bt(a,a.return)),r=Wf(),u=$s,m=(n&335544064)===n,g=e.memoizedProps,$s=m&&Wn(g.default,g.update)!=="none",Qt(t,e,n),Xt(e),m&&a!==null&&Fe&&(e.flags|=4),$s=u,Fe=r;break;case 21:break;case 7:r&512&&(We||a===null||Bt(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:Qt(t,e,n),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(gp(a)){n=a;break}a=a.return}a=null;for(var r=e.return;r!==null;){if(iu(r)){var u=r.stateNode;a===null?a=[u]:a.push(u)}if(su(r))break;r=r.return}var m=a;if(n==null)throw Error(o(160));switch(n.tag){case 27:var g=n.stateNode,k=cu(e);Cr(e,k,g,m);break;case 5:var L=n.stateNode;n.flags&32&&(Tl(L,""),n.flags&=-33);var V=cu(e);Cr(e,V,L,m);break;case 3:case 4:var W=n.stateNode.containerInfo,D=cu(e);uu(e,D,W,m);break;default:throw Error(o(161))}}catch(B){tt(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,ds=!0,t.reset(),ds=!1),e=e.sibling}}function Xl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Dp(t,e),t=t.sibling;else wp(t)}function Dp(e,t){var n=e.alternate;if(n===null)du(e,!1);else switch(e.tag){case 3:if(gu=Hn=!1,vp(),Xl(t,e),!Hn&&!Or){if(e=Ln,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var r=e[a+1];Nx(n,e[a+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}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"})),gu=!0}Ln=null;break;case 5:Xl(t,e);break;case 4:a=Hn,Hn=!1,Xl(t,e),Hn&&(Or=!0),Hn=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?du(e,!1):Xl(t,e));break;case 30:a=Hn,r=vp(),Hn=!1,Xl(t,e),Hn&&(e.flags|=4);var u=e.memoizedProps,m=e.stateNode;t=$n(u,m),m=$n(n.memoizedProps,m);var g=Wn(u.default,u.update);g==="none"?t=!1:(u=n.memoizedState,n.memoizedState=null,n=e.child,Jt=0,t=pu(e,n,t,m,g,u,!0),Jt!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ts(e,e.memoizedProps.onUpdate),Ln=r):r!==null&&(r.push.apply(r,Ln),Ln=r),Hn=(e.flags&32)!==0?!0:a;break;default:Xl(t,e)}}function qn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_p(e,t.alternate,t),t=t.sibling}function Aa(e,t){for(e=e.child;e!==null;){var n=e,a=t;switch(n.tag){case 0:case 11:case 14:case 15:Ta(4,n,n.return),Aa(n,a);break;case 1:Bt(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&pp(n,n.return,r),Aa(n,a);break;case 27:(a&2)!==0&&Mx(n.stateNode,n.type,n.memoizedProps);case 5:Bt(n,n.return),n.tag!==5&&n.tag!==27||Js(n),Aa(n,a);break;case 6:Js(n);break;case 26:Bt(n,n.return),r=n.stateNode,n.memoizedState!==null||r===null||We||r.parentNode.removeChild(r),Aa(n,a);break;case 22:n.memoizedState===null&&Aa(n,a);break;case 30:Bt(n,n.return),Aa(n,a);break;case 7:Bt(n,n.return);default:Aa(n,a)}e=e.sibling}}function En(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,r=e,u=t,m=u.flags,g=(n&1)!==0;switch(u.tag){case 0:case 11:case 15:En(r,u,n),Zs(4,u);break;case 1:if(En(r,u,n),a=u,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(V){tt(a,a.return,V)}if(a=u,r=a.updateQueue,r!==null){var k=a.stateNode;try{var L=r.shared.hiddenCallbacks;if(L!==null)for(r.shared.hiddenCallbacks=null,r=0;r<L.length;r++)nh(L[r],k)}catch(V){tt(a,a.return,V)}}g&&m&64&&hp(u),Rn(u,u.return);break;case 27:(n&2)!==0&&bp(u);case 5:u.tag!==5&&u.tag!==27||xp(u),En(r,u,n),g&&a===null&&m&4&&ru(u),Rn(u,u.return);break;case 6:xp(u);break;case 26:k=u.stateNode,u.memoizedState!==null||k===null||zt||ad(ri(k.ownerDocument),u.type,k),En(r,u,n),g&&a===null&&m&4&&ru(u),Rn(u,u.return);break;case 12:En(r,u,n);break;case 31:En(r,u,n),g&&m&4&&Ap(r,u);break;case 13:En(r,u,n),g&&m&4&&zp(r,u);break;case 22:u.memoizedState===null&&En(r,u,n),Rn(u,u.return);break;case 30:En(r,u,n),Rn(u,u.return);break;case 7:Rn(u,u.return);default:En(r,u,n)}t=t.sibling}}function vu(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&&Us(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e))}function yn(e,t,n,a){var r=(n&335544064)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Rp(e,t,n,a),t=t.sibling;else r&&jp(t)}function Rp(e,t,n,a){var r=(n&335544064)===n;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&zr(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:yn(e,t,n,a),u&2048&&Zs(9,t);break;case 1:yn(e,t,n,a);break;case 3:yn(e,t,n,a),r&&gu&&(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&&Us(u)));break;case 12:if(u&2048){yn(e,t,n,a),u=t.stateNode;try{var m=t.memoizedProps,g=m.id,k=m.onPostCommit;typeof k=="function"&&k(g,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(L){tt(t,t.return,L)}}else yn(e,t,n,a);break;case 31:yn(e,t,n,a);break;case 13:yn(e,t,n,a);break;case 23:break;case 22:m=t.stateNode,g=t.alternate,t.memoizedState!==null?(r&&g!==null&&g.memoizedState===null&&zr(g),m._visibility&2?yn(e,t,n,a):Ws(e,t)):(r&&g!==null&&g.memoizedState!==null&&zr(t),m._visibility&2?yn(e,t,n,a):(m._visibility|=2,Fl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),u&2048&&vu(g,t);break;case 24:yn(e,t,n,a),u&2048&&Nu(t.alternate,t);break;case 30:r&&(u=t.alternate,u!==null&&(Un(u.child,!0),Un(t.child,!0))),yn(e,t,n,a);break;default:yn(e,t,n,a)}}function Fl(e,t,n,a,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,m=t,g=n,k=a,L=m.flags;switch(m.tag){case 0:case 11:case 15:Fl(u,m,g,k,r),Zs(8,m);break;case 23:break;case 22:var V=m.stateNode;m.memoizedState!==null?V._visibility&2?Fl(u,m,g,k,r):Ws(u,m):(V._visibility|=2,Fl(u,m,g,k,r)),r&&L&2048&&vu(m.alternate,m);break;case 24:Fl(u,m,g,k,r),r&&L&2048&&Nu(m.alternate,m);break;default:Fl(u,m,g,k,r)}t=t.sibling}}function Ws(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:Ws(n,a),r&2048&&vu(a.alternate,a);break;case 24:Ws(n,a),r&2048&&Nu(a.alternate,a);break;default:Ws(n,a)}t=t.sibling}}var fl=8192;function ml(e,t,n){if(e.subtreeFlags&fl)for(e=e.child;e!==null;)Lp(e,t,n),e=e.sibling}function Lp(e,t,n){switch(e.tag){case 26:ml(e,t,n),e.flags&fl&&(e.memoizedState!==null?b2(n,_n,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Vx(n,e)));break;case 5:ml(e,t,n),e.flags&fl&&(e=e.stateNode,(t&335544128)===t&&Vx(n,e));break;case 3:case 4:var a=_n;_n=ri(e.stateNode.containerInfo),ml(e,t,n),_n=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fl,fl=16777216,ml(e,t,n),fl=a):ml(e,t,n));break;case 30:if((e.flags&fl)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var r=e.stateNode;r.paired=null,on===null&&(on=new Map),on.set(a,r)}ml(e,t,n);break;default:ml(e,t,n)}}function Up(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 ei(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ot=a,Hp(a,e)}Up(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bp(e),e=e.sibling}function Bp(e){switch(e.tag){case 0:case 11:case 15:ei(e),e.flags&2048&&Ta(9,e,e.return);break;case 3:ei(e);break;case 12:ei(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rr(e)):ei(e);break;default:ei(e)}}function Rr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ot=a,Hp(a,e)}Up(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ta(8,t,t.return),Rr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Rr(t));break;default:Rr(t)}e=e.sibling}}function Hp(e,t){for(;Ot!==null;){var n=Ot;switch(n.tag){case 0:case 11:case 15:Ta(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Us(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Ot=a;else e:for(n=e;Ot!==null;){a=Ot;var r=a.sibling,u=a.return;if(Cp(a),a===n){Ot=null;break e}if(r!==null){r.return=u,Ot=r;break e}Ot=u}}}var mv={getCacheForType:function(e){var t=Rt(vt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Rt(vt).controller.signal}},hv=typeof WeakMap=="function"?WeakMap:Map,Ze=0,st=null,Ge=null,Ye=0,et=0,cn=null,za=!1,Zl=!1,Su=!1,oa=0,pt=0,Oa=0,hl=0,Lr=0,un=0,Jl=0,ti=null,Wt=null,ju=!1,Ur=0,qp=0,Br=1/0,Hr=null,Ma=null,mt=0,Cn=null,pl=null,Gn=0,wu=0,ku=null,Gp=null,$l=null,Wl=null,es=null,ni=0,qr=null;function dn(){return(Ze&2)!==0&&Ye!==0?Ye&-Ye:fe.T!==null?Ru():Yf()}function Pp(){if(un===0)if((Ye&536870912)===0||He){var e=Di;Di<<=1,(Di&3932160)===0&&(Di=262144),un=e}else un=536870912;return e=Lt.current,e!==null&&(e.flags|=32),un}function ts(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=Sx($n(e.memoizedProps,n))),Wl===null&&(Wl=[]),Wl.push(t.bind(null,a))}}function en(e,t,n){(e===st&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(ns(e,0),Da(e,Ye,un,!1)),js(e,n),((Ze&2)===0||e!==st)&&(e===st&&((Ze&2)===0&&(hl|=n),pt===4&&Da(e,Ye,un,!1)),Pn(e))}function Vp(e,t,n){if((Ze&6)!==0)throw Error(o(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ss(e,t),r=a?gv(e,t):Eu(e,t,!0),u=a;do{if(r===0){Zl&&!a&&Da(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!pv(n)){r=Eu(e,t,!1),u=!1;continue}if(r===2){if(u=t,e.errorRecoveryDisabledLanes&u)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var g=e;r=ti;var k=g.current.memoizedState.isDehydrated;if(k&&(ns(g,m).flags|=256),m=Eu(g,m,!1),m!==2&&m!==6){if(Su&&!k){g.errorRecoveryDisabledLanes|=u,hl|=u,r=4;break e}u=Wt,Wt=r,u!==null&&(Wt===null?Wt=u:Wt.push.apply(Wt,u))}r=m}if(u=!1,r!==2)continue}}if(r===1){ns(e,0),Da(e,t,0,!0);break}e:{switch(a=e,u=r,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Da(a,t,un,!za);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(r=Ur+300-$e(),10<r)){if(Da(a,t,un,!za),Li(a,0,!0)!==0)break e;Gn=t,a.timeoutHandle=Ku(Yp.bind(null,a,n,Wt,Hr,ju,t,un,hl,Jl,za,u,"Throttled",-0,0),r);break e}Yp(a,n,Wt,Hr,ju,t,un,hl,Jl,za,u,null,-0,0)}}break}while(!0);Pn(e)}function Yp(e,t,n,a,r,u,m,g,k,L,V,W,D,B){e.timeoutHandle=-1;var he=t.subtreeFlags,Se=(u&335544064)===u;if(W=null,(Se||he&8192||(he&16785408)===16785408)&&(W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:On},on=null,Lp(t,u,W),Se&&(he=W,Se=e.containerInfo,Se=(Se.nodeType===9?Se:Se.ownerDocument).__reactViewTransition,Se!=null&&(he.count++,he.waitingForViewTransition=!0,he=ui.bind(he),Se.finished.then(he,he))),he=(u&62914560)===u?Ur-$e():(u&4194048)===u?qp-$e():0,he=y2(W,he),he!==null)){Gn=u,e.cancelPendingCommit=he($p.bind(null,e,t,u,n,a,r,m,g,k,L,V,W,null,D,B)),Da(e,u,m,!L);return}$p(e,t,u,n,a,r,m,g,k,L,V,W)}function pv(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 a=0;a<n.length;a++){var r=n[a],u=r.getSnapshot;r=r.value;try{if(!sn(u(),r))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 Da(e,t,n,a){t=Hf(e,t),t&=~Lr,t&=~hl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var u=31-an(r),m=1<<u;a[u]=-1,r&=~m}n!==0&&Gf(e,n,t)}function Gr(){return(Ze&6)===0?(ai(0),!1):!0}function _u(){if(Ge!==null){if(et===0)var e=Ge.return;else e=Ge,na=nl=null,Dc(e),Pl=null,qs=0,e=Ge;for(;e!==null;)mp(e.alternate,e),e=e.return;Ge=null}}function ns(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Hv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Gn=0,_u(),st=e,Ge=n=ea(e.current,null),Ye=t,et=0,cn=null,za=!1,Zl=Ss(e,t),Su=!1,Jl=un=Lr=hl=Oa=pt=0,Wt=ti=null,ju=!1,oa=Hf(e,t),Fi(),n}function Ip(e,t){Le=null,fe.H=vr,t===Gl||t===ir?(t=$m(),et=3):t===Nc?(t=$m(),et=4):et=t===Fc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cn=t,Ge===null&&(pt=1,Nr(e,pn(t,e.current)))}function Kp(){var e=Lt.current;return e===null?!0:(Ye&4194048)===Ye?Vt===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===Vt:!1}function Qp(){var e=fe.H;return fe.H=vr,e===null?vr:e}function Xp(){var e=fe.A;return fe.A=mv,e}function Pr(){pt=4,za||(Ye&4194048)!==Ye&&Lt.current!==null||(Zl=!0),(Oa&134217727)===0&&(hl&134217727)===0||st===null||Da(st,Ye,un,!1)}function Eu(e,t,n){var a=Ze;Ze|=2;var r=Qp(),u=Xp();(st!==e||Ye!==t)&&(Hr=null,ns(e,t)),t=!1;var m=pt;e:do try{if(et!==0&&Ge!==null){var g=Ge,k=cn;switch(et){case 8:_u(),m=6;break e;case 3:case 2:case 9:case 6:Lt.current===null&&(t=!0);var L=et;if(et=0,cn=null,as(e,g,k,L),n&&Zl){m=0;break e}break;default:L=et,et=0,cn=null,as(e,g,k,L)}}xv(),m=pt;break}catch(V){Ip(e,V)}while(!0);return t&&e.shellSuspendCounter++,na=nl=null,Ze=a,fe.H=r,fe.A=u,Ge===null&&(st=null,Ye=0,Fi()),m}function xv(){for(;Ge!==null;)Fp(Ge)}function gv(e,t){var n=Ze;Ze|=2;var a=Qp(),r=Xp();st!==e||Ye!==t?(Hr=null,Br=$e()+500,ns(e,t)):Zl=Ss(e,t);e:do try{if(et!==0&&Ge!==null){t=Ge;var u=cn;t:switch(et){case 1:et=0,cn=null,as(e,t,u,1);break;case 2:case 9:if(Zm(u)){et=0,cn=null,Zp(t);break}t=function(){et!==2&&et!==9||st!==e||(et=7),Pn(e)},u.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Zm(u)?(et=0,cn=null,Zp(t)):(et=0,cn=null,as(e,t,u,7));break;case 5:var m=null;switch(Ge.tag){case 26:m=Ge.memoizedState;case 5:case 27:var g=Ge;if(m?Gx(m):g.stateNode.complete){et=0,cn=null;var k=g.sibling;if(k!==null)Ge=k;else{var L=g.return;L!==null?(Ge=L,Vr(L)):Ge=null}break t}}et=0,cn=null,as(e,t,u,5);break;case 6:et=0,cn=null,as(e,t,u,6);break;case 8:_u(),pt=6;break e;default:throw Error(o(462))}}bv();break}catch(V){Ip(e,V)}while(!0);return na=nl=null,fe.H=a,fe.A=r,Ze=n,Ge!==null?0:(st=null,Ye=0,Fi(),pt)}function bv(){for(;Ge!==null&&!Qe();)Fp(Ge)}function Fp(e){var t=dp(e.alternate,e,oa);e.memoizedProps=e.pendingProps,t===null?Vr(e):Ge=t}function Zp(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lp(n,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=lp(n,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Dc(t);var a=t;a===At&&(He?(tr(a),a.tag===5&&a.stateNode!=null&&(rt=a.stateNode)):(tr(a),He=!0));default:mp(n,t),t=Ge=Hm(t,oa),t=dp(n,t,oa)}e.memoizedProps=e.pendingProps,t===null?Vr(e):Ge=t}function as(e,t,n,a){na=nl=null,Dc(t),Pl=null,qs=0;var r=t.return;try{if(sv(e,r,t,n,Ye)){pt=1,Nr(e,pn(n,e.current)),Ge=null;return}}catch(u){if(r!==null)throw Ge=r,u;pt=1,Nr(e,pn(n,e.current)),Ge=null;return}t.flags&32768?(He||a===1?e=!0:Zl||(Ye&536870912)!==0?e=!1:(za=e=!0,(a===2||a===9||a===3||a===6)&&(a=Lt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Jp(t,e)):Vr(t)}function Vr(e){var t=e;do{if((t.flags&32768)!==0){Jp(t,za);return}e=t.return;var n=cv(t.alternate,t,oa);if(n!==null){Ge=n;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);pt===0&&(pt=5)}function Jp(e,t){do{var n=uv(e.alternate,e);if(n!==null){n.flags&=32767,Ge=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=n}while(e!==null);pt=6,Ge=null}function $p(e,t,n,a,r,u,m,g,k,L,V,W){e.cancelPendingCommit=null;do Yr();while(mt!==0);if((Ze&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===st&&(Ge=st=null,Ye=0),pl=t,Cn=e,Gn=n,ku=r,Gp=a,yv(e,t,n,m,g,k,W)}}function yv(e,t,n,a,r,u,m){var g=t.lanes|t.childLanes;if(wu=g,g|=oc,Iy(e,n,g,a,r,u),Wl=null,(n&335544064)===n?(es=Q1(e),a=10262):(es=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,kv(Oi,function(){return zu(),null})):(e.callbackNode=null,e.callbackPriority=0),Tr=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null,r=pe.p,pe.p=2,u=Ze,Ze|=4;try{dv(e,t,n)}finally{Ze=u,pe.p=r,fe.T=a}}mt=1,Tr?$l=Iv(m,e.containerInfo,es,Cu,Tu,Nv,Au,zu,vv):(Cu(),Tu(),Au())}function vv(e){if(mt!==0){var t=Cn.onRecoverableError;t(e,{componentStack:null})}}function Nv(){mt===3&&(mt=0,Dp(pl,Cn),mt=4)}function Cu(){if(mt===1){mt=0;var e=Cn,t=pl,n=Gn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null;var r=pe.p;pe.p=2;var u=Ze;Ze|=4;try{$s=Or=!1,Op(t,e,n),n=Vu;var m=Tm(e.containerInfo),g=n.focusedElem,k=n.selectionRange;if(m!==g&&g&&g.ownerDocument&&Cm(g.ownerDocument.documentElement,g)){if(k!==null&&ac(g)){var L=k.start,V=k.end;if(V===void 0&&(V=L),"selectionStart"in g)g.selectionStart=L,g.selectionEnd=Math.min(V,g.value.length);else{var W=g.ownerDocument||document,D=W&&W.defaultView||window;if(D.getSelection){var B=D.getSelection(),he=g.textContent.length,Se=Math.min(k.start,he),Ue=k.end===void 0?Se:Math.min(k.end,he);!B.extend&&Se>Ue&&(m=Ue,Ue=Se,Se=m);var R=Em(g,Se),z=Em(g,Ue);if(R&&z&&(B.rangeCount!==1||B.anchorNode!==R.node||B.anchorOffset!==R.offset||B.focusNode!==z.node||B.focusOffset!==z.offset)){var U=W.createRange();U.setStart(R.node,R.offset),B.removeAllRanges(),Se>Ue?(B.addRange(U),B.extend(z.node,z.offset)):(U.setEnd(z.node,z.offset),B.addRange(U))}}}}for(W=[],B=g;B=B.parentNode;)B.nodeType===1&&W.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<W.length;g++){var $=W[g];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}ds=!!Pu,Vu=Pu=null}finally{Ze=u,pe.p=r,fe.T=a}}e.current=t,mt=2}}function Tu(){if(mt===2){mt=0;var e=Cn,t=pl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=fe.T,fe.T=null;var a=pe.p;pe.p=2;var r=Ze;Ze|=4;try{_p(e,t.alternate,t)}finally{Ze=r,pe.p=a,fe.T=n}}mt=3}}function Au(){if(mt===4||mt===3){mt=0;var e=$l;$l=null,ha();var t=Cn,n=pl,a=Gn,r=Gp,u=(a&335544064)===a?10262:10256;if((n.subtreeFlags&u)!==0||(n.flags&u)!==0?mt=5:(mt=0,pl=Cn=null,Wp(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(Ma=null),Ho(a),n=n.stateNode,nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(Ns,n,void 0,(n.current.flags&128)===128)}catch{}if(r!==null){n=fe.T,u=pe.p,pe.p=2,fe.T=null;try{for(var m=t.onRecoverableError,g=0;g<r.length;g++){var k=r[g];m(k.value,{componentStack:k.stack})}}finally{fe.T=n,pe.p=u}}if(r=Wl,m=es,es=null,r!==null&&(Wl=null,m===null&&(m=[]),e!==null))for(k=0;k<r.length;k++)n=(0,r[k])(m),n!==void 0&&e.finished.finally(n);(Gn&3)!==0&&Yr(),Pn(t),u=t.pendingLanes,(a&261930)!==0&&(u&42)!==0?t===qr?ni++:(ni=0,qr=t):(ni=0,qr=null),ai(0)}}function Wp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Us(t)))}function Yr(){return $l!==null&&($l.skipTransition(),$l=null),Cu(),Tu(),Au(),zu()}function zu(){if(mt!==5)return!1;var e=Cn,t=wu;wu=0;var n=Ho(Gn),a=fe.T,r=pe.p;try{pe.p=32>n?32:n,fe.T=null,n=ku,ku=null;var u=Cn,m=Gn;if(mt=0,pl=Cn=null,Gn=0,(Ze&6)!==0)throw Error(o(331));var g=Ze;if(Ze|=4,Bp(u.current),Rp(u,u.current,m,n),Ze=g,ai(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Ns,u)}catch{}return!0}finally{pe.p=r,fe.T=a,Wp(e,t)}}function ex(e,t,n){t=pn(n,t),t=Xc(e.stateNode,t,2),e=ka(e,t,2),e!==null&&(js(e,2),Pn(e))}function tt(e,t,n){if(e.tag===3)ex(e,e,n);else for(;t!==null;){if(t.tag===3){ex(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ma===null||!Ma.has(a))){e=pn(n,e),n=Zh(2),a=ka(t,n,2),a!==null&&(Jh(n,a,t,e),js(a,2),Pn(a));break}}t=t.return}}function Ou(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new hv;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(Su=!0,r.add(n),e=Sv.bind(null,e,t,n),t.then(e,e))}function Sv(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,st===e&&(Ye&n)===n&&((pt===4||pt===3&&(Ye&62914560)===Ye&&300>$e()-Ur)&&(Ze&2)===0?ns(e,0):Lr|=n,Jl===Ye&&(Jl=0)),Pn(e)}function tx(e,t){t===0&&(t=qf()),e=Wa(e,t),e!==null&&(js(e,t),Pn(e))}function jv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tx(e,n)}function wv(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),tx(e,n)}function kv(e,t){return it(e,t)}var ls=null,ss=null,Mu=!1,Ir=!1,Du=!1,Ra=0;function Pn(e){e!==ss&&e.next===null&&(ss===null?ls=ss=e:ss=ss.next=e),Ir=!0,Mu||(Mu=!0,Ev())}function ai(e,t){if(!Du&&Ir){Du=!0;do for(var n=!1,a=ls;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var u=0;else{var m=a.suspendedLanes,g=a.pingedLanes;u=(1<<31-an(42|e)+1)-1,u&=r&~(m&~g),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,sx(a,u))}else u=Ye,u=Li(a,a===st?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ss(a,u)||(n=!0,sx(a,u));a=a.next}while(n);Du=!1}}function _v(){nx()}function nx(){Ir=Mu=!1;var e=0;Ra!==0&&Bv()&&(e=Ra);for(var t=$e(),n=null,a=ls;a!==null;){var r=a.next,u=ax(a,t);u===0?(a.next=null,n===null?ls=r:n.next=r,r===null&&(ss=n)):(n=a,(e!==0||(u&3)!==0)&&(Ir=!0)),a=r}mt!==0&&mt!==5||ai(e),Ra!==0&&(Ra=0)}function ax(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var m=31-an(u),g=1<<m,k=r[m];k===-1?((g&n)===0||(g&a)!==0)&&(r[m]=Yy(g,t)):k<=t&&(e.expiredLanes|=g),u&=~g}if(t=st,n=Ye,n=Li(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&ct(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ss(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&ct(a),Ho(n)){case 2:case 8:n=Uf;break;case 32:n=Oi;break;case 268435456:n=Bf;break;default:n=Oi}return a=lx.bind(null,e),n=it(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&ct(a),e.callbackPriority=2,e.callbackNode=null,2}function lx(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Yr()&&e.callbackNode!==n)return null;var a=Ye;return a=Li(e,e===st?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Vp(e,a,t),ax(e,$e()),e.callbackNode!=null&&e.callbackNode===n?lx.bind(null,e):null)}function sx(e,t){if(Yr())return null;Vp(e,t,!0)}function Ev(){qv(function(){(Ze&6)!==0?it(Lf,_v):nx()})}function Ru(){if(Ra===0){var e=sl;e===0&&(e=Mi,Mi<<=1,(Mi&261888)===0&&(Mi=256)),Ra=e}return Ra}function ix(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Gi(e)}function Cv(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var u=ix((r[Ft]||null).action),m=a.submitter;m&&(t=(t=m[Ft]||null)?ix(t.formAction):m.getAttribute("formAction"),t!==null&&(u=t,m=null));var g=new Ii("action","action",null,a,r);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ra!==0){var k=new FormData(r,m);Vc(n,{pending:!0,data:k,method:r.method,action:u},null,k)}}else typeof u=="function"&&(g.preventDefault(),k=new FormData(r,m),Vc(n,{pending:!0,data:k,method:r.method,action:u},u,k))},currentTarget:r}]})}}for(var Lu=0;Lu<rc.length;Lu++){var Uu=rc[Lu],Tv=Uu.toLowerCase(),Av=Uu[0].toUpperCase()+Uu.slice(1);wn(Tv,"on"+Av)}wn(Om,"onAnimationEnd"),wn(Mm,"onAnimationIteration"),wn(Dm,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(H1,"onTransitionRun"),wn(q1,"onTransitionStart"),wn(G1,"onTransitionCancel"),wn(Rm,"onTransitionEnd"),El("onMouseEnter",["mouseout","mouseover"]),El("onMouseLeave",["mouseout","mouseover"]),El("onPointerEnter",["pointerout","pointerover"]),El("onPointerLeave",["pointerout","pointerover"]),Za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Za("onBeforeInput",["compositionend","keypress","textInput","paste"]),Za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var li="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(" "),zv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(li));function rx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var m=a.length-1;0<=m;m--){var g=a[m],k=g.instance,L=g.currentTarget;if(g=g.listener,k!==u&&r.isPropagationStopped())break e;u=g,r.currentTarget=L;try{u(r)}catch(V){Xi(V)}r.currentTarget=null,u=k}else for(m=0;m<a.length;m++){if(g=a[m],k=g.instance,L=g.currentTarget,g=g.listener,k!==u&&r.isPropagationStopped())break e;u=g,r.currentTarget=L;try{u(r)}catch(V){Xi(V)}r.currentTarget=null,u=k}}}}function Pe(e,t){var n=t[Kf];n===void 0&&(n=t[Kf]=new Set);var a=e+"__bubble";n.has(a)||(ox(t,e,2,!1),n.add(a))}function Bu(e,t,n){var a=0;t&&(a|=4),ox(n,e,a,t)}var Kr="_reactListening"+Math.random().toString(36).slice(2);function Hu(e){if(!e[Kr]){e[Kr]=!0,Ff.forEach(function(n){n!=="selectionchange"&&(zv.has(n)||Bu(n,!1,e),Bu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kr]||(t[Kr]=!0,Bu("selectionchange",!1,t))}}function ox(e,t,n,a){switch(Jx(t)){case 2:var r=j2;break;case 8:r=w2;break;default:r=sd}n=r.bind(null,t,n,e),r=void 0,!Qo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function qu(e,t,n,a,r){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var g=a.stateNode.containerInfo;if(g===r)break;if(m===4)for(m=a.return;m!==null;){var k=m.tag;if((k===3||k===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;g!==null;){if(m=Fa(g),m===null)return;if(k=m.tag,k===5||k===6||k===26||k===27){a=u=m;continue e}g=g.parentNode}}a=a.return}om(function(){var L=u,V=Io(n),W=[];e:{var D=Lm.get(e);if(D!==void 0){var B=Ii,he=e;switch(e){case"keypress":if(Vi(n)===0)break e;case"keydown":case"keyup":B=p1;break;case"focusin":he="focus",B=Jo;break;case"focusout":he="blur",B=Jo;break;case"beforeblur":case"afterblur":B=Jo;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":B=dm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=a1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=v1;break;case Om:case Mm:case Dm:B=i1;break;case Rm:B=S1;break;case"scroll":case"scrollend":B=t1;break;case"wheel":B=w1;break;case"copy":case"cut":case"paste":B=o1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=mm;break;case"submit":B=b1;break;case"toggle":case"beforetoggle":B=_1}var Se=(t&4)!==0,Ue=!Se&&(e==="scroll"||e==="scrollend"),R=Se?D!==null?D+"Capture":null:D;Se=[];for(var z=L,U;z!==null;){var $=z;if(U=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||U===null||R===null||($=_s(z,R),$!=null&&Se.push(si(z,$,U))),Ue)break;z=z.return}0<Se.length&&(D=new B(D,he,null,n,V),W.push({event:D,listeners:Se}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",B&&n!==Yo&&(he=n.relatedTarget||n.fromElement)&&(Fa(he)||he[wl]))break e;(D||B)&&(he=V.window===V?V:(B=V.ownerDocument)?B.defaultView||B.parentWindow:window,D?(B=n.relatedTarget||n.toElement,D=L,B=B?Fa(B):null,B!==null&&(Ue=f(B),Se=B.tag,B!==Ue||Se!==5&&Se!==27&&Se!==6)&&(B=null)):(D=null,B=L),D!==B&&(Se=dm,$="onMouseLeave",R="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Se=mm,$="onPointerLeave",R="onPointerEnter",z="pointer"),Ue=D==null?he:ks(D),U=B==null?he:ks(B),he=new Se($,z+"leave",D,n,V),he.target=Ue,he.relatedTarget=U,$=null,Fa(V)===L&&(Se=new Se(R,z+"enter",B,n,V),Se.target=U,Se.relatedTarget=Ue,$=Se),Ue=$,Se=D&&B?J(D,B,Ov):null,D!==null&&cx(W,he,D,Se,!1),B!==null&&Ue!==null&&cx(W,Ue,B,Se,!0)))}e:{if(D=L?ks(L):window,B=D.nodeName&&D.nodeName.toLowerCase(),B==="select"||B==="input"&&D.type==="file")var ge=Nm;else if(ym(D))if(Sm)ge=L1;else{ge=D1;var Ie=M1}else B=D.nodeName,!B||B.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?L&&Vo(L.elementType)&&(ge=Nm):ge=R1;if(ge&&(ge=ge(e,L))){vm(W,ge,n,V);break e}Ie&&Ie(e,D,L)}switch(Ie=L?ks(L):window,e){case"focusin":(ym(Ie)||Ie.contentEditable==="true")&&(Ml=Ie,lc=L,Ds=null);break;case"focusout":Ds=lc=Ml=null;break;case"mousedown":sc=!0;break;case"contextmenu":case"mouseup":case"dragend":sc=!1,Am(W,n,V);break;case"selectionchange":if(B1)break;case"keydown":case"keyup":Am(W,n,V)}var Ee;if(Wo)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Ol?gm(e,n)&&(Oe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Oe="onCompositionStart");Oe&&(hm&&n.locale!=="ko"&&(Ol||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ol&&(Ee=cm()):(xa=V,Xo="value"in xa?xa.value:xa.textContent,Ol=!0)),Ie=Qr(L,Oe),0<Ie.length&&(Oe=new fm(Oe,e,null,n,V),W.push({event:Oe,listeners:Ie}),Ee?Oe.data=Ee:(Ee=bm(n),Ee!==null&&(Oe.data=Ee)))),(Ee=C1?T1(e,n):A1(e,n))&&(Oe=Qr(L,"onBeforeInput"),0<Oe.length&&(Ie=new fm("onBeforeInput","beforeinput",null,n,V),W.push({event:Ie,listeners:Oe}),Ie.data=Ee)),Cv(W,e,L,n,V)}rx(W,t)})}function si(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qr(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,u=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||u===null||(r=_s(e,n),r!=null&&a.unshift(si(e,r,u)),r=_s(e,t),r!=null&&a.push(si(e,r,u))),e.tag===3)return a;e=e.return}return[]}function Ov(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cx(e,t,n,a,r){for(var u=t._reactName,m=[];n!==null&&n!==a;){var g=n,k=g.alternate,L=g.stateNode;if(g=g.tag,k!==null&&k===a)break;g!==5&&g!==26&&g!==27||L===null||(k=L,r?(L=_s(n,u),L!=null&&m.unshift(si(n,L,k))):r||(L=_s(n,u),L!=null&&m.push(si(n,L,k)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Mv=/\r\n?/g,Dv=/\u0000|\uFFFD/g;function ux(e){return(typeof e=="string"?e:""+e).replace(Mv,`
49
+ `).replace(Dv,"")}function dx(e,t){return t=ux(t),ux(e)===t}function nt(e,t,n,a,r,u){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||Tl(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&Tl(e,""+a);else return;break;case"className":qi(e,"class",a);break;case"tabIndex":qi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":qi(e,n,a);break;case"style":im(e,a,u);return;case"data":if(t!=="object"){qi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Gi(a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="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"&&nt(e,t,"name",r.name,r,null),nt(e,t,"formEncType",r.formEncType,r,null),nt(e,t,"formMethod",r.formMethod,r,null),nt(e,t,"formTarget",r.formTarget,r,null)):(nt(e,t,"encType",r.encType,r,null),nt(e,t,"method",r.method,r,null),nt(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Gi(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=On);return;case"onScroll":a!=null&&Pe("scroll",e);return;case"onScrollEnd":a!=null&&Pe("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Gi(a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),Hi(e,"popover",a);break;case"xlinkActuate":Zn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Zn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Zn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Zn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Zn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Zn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Hi(e,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=Wy.get(n)||n,Hi(e,n,a);else return}Fe=!0}function Gu(e,t,n,a,r,u){switch(n){case"style":im(e,a,u);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")Tl(e,a);else if(typeof a=="number"||typeof a=="bigint")Tl(e,""+a);else return;break;case"onScroll":a!=null&&Pe("scroll",e);return;case"onScrollEnd":a!=null&&Pe("scrollend",e);return;case"onClick":a!=null&&(e.onclick=On);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Zf.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),u=n.slice(2,r?n.length-7:void 0),t=e[Ft]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(u,t,r),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(u,a,r);break e}Fe=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):Hi(e,n,a)}return}Fe=!0}function Ht(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var a=!1,r=!1,u;for(u in n)if(n.hasOwnProperty(u)){var m=n[u];if(m!=null)switch(u){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:nt(e,t,u,m,n,null)}}r&&nt(e,t,"srcSet",n.srcSet,n,null),a&&nt(e,t,"src",n.src,n,null);return;case"input":Pe("invalid",e);var g=u=m=r=null,k=null,L=null;for(a in n)if(n.hasOwnProperty(a)){var V=n[a];if(V!=null)switch(a){case"name":r=V;break;case"type":m=V;break;case"checked":k=V;break;case"defaultChecked":L=V;break;case"value":u=V;break;case"defaultValue":g=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:nt(e,t,a,V,n,null)}}nm(e,u,g,k,L,m,r,!1);return;case"select":Pe("invalid",e),a=m=u=null;for(r in n)if(n.hasOwnProperty(r)&&(g=n[r],g!=null))switch(r){case"value":u=g;break;case"defaultValue":m=g;break;case"multiple":a=g;default:nt(e,t,r,g,n,null)}t=u,n=m,e.multiple=!!a,t!=null?Cl(e,!!a,t,!1):n!=null&&Cl(e,!!a,n,!0);return;case"textarea":Pe("invalid",e),u=r=a=null;for(m in n)if(n.hasOwnProperty(m)&&(g=n[m],g!=null))switch(m){case"value":a=g;break;case"defaultValue":r=g;break;case"children":u=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:nt(e,t,m,g,n,null)}lm(e,a,r,u);return;case"option":for(k in n)if(n.hasOwnProperty(k)&&(a=n[k],a!=null))switch(k){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:nt(e,t,k,a,n,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(a=0;a<li.length;a++)Pe(li[a],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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(L in n)if(n.hasOwnProperty(L)&&(a=n[L],a!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:nt(e,t,L,a,n,null)}return;default:if(Vo(t)){for(V in n)n.hasOwnProperty(V)&&(a=n[V],a!==void 0&&Gu(e,t,V,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&nt(e,t,g,a,n,null))}var Rv={};function Lv(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,u=null,m=null,g=null,k=null,L=null,V=null;for(B in n){var W=n[B];if(n.hasOwnProperty(B)&&W!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":k=W;default:a.hasOwnProperty(B)||nt(e,t,B,null,a,W)}}for(var D in a){var B=a[D];if(W=n[D],a.hasOwnProperty(D)&&(B!=null||W!=null))switch(D){case"type":B!==W&&(Fe=!0),u=B;break;case"name":B!==W&&(Fe=!0),r=B;break;case"checked":B!==W&&(Fe=!0),L=B;break;case"defaultChecked":B!==W&&(Fe=!0),V=B;break;case"value":B!==W&&(Fe=!0),m=B;break;case"defaultValue":B!==W&&(Fe=!0),g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:B!==W&&nt(e,t,D,B,a,W)}}Go(e,m,g,k,L,V,u,r);return;case"select":B=m=g=D=null;for(u in n)if(k=n[u],n.hasOwnProperty(u)&&k!=null)switch(u){case"value":break;case"multiple":B=k;default:a.hasOwnProperty(u)||nt(e,t,u,null,a,k)}for(r in a)if(u=a[r],k=n[r],a.hasOwnProperty(r)&&(u!=null||k!=null))switch(r){case"value":u!==k&&(Fe=!0),D=u;break;case"defaultValue":u!==k&&(Fe=!0),g=u;break;case"multiple":u!==k&&(Fe=!0),m=u;default:u!==k&&nt(e,t,r,u,a,k)}t=g,n=m,a=B,D!=null?Cl(e,!!n,D,!1):!!a!=!!n&&(t!=null?Cl(e,!!n,t,!0):Cl(e,!!n,n?[]:"",!1));return;case"textarea":B=D=null;for(g in n)if(r=n[g],n.hasOwnProperty(g)&&r!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:nt(e,t,g,null,a,r)}for(m in a)if(r=a[m],u=n[m],a.hasOwnProperty(m)&&(r!=null||u!=null))switch(m){case"value":r!==u&&(Fe=!0),D=r;break;case"defaultValue":r!==u&&(Fe=!0),B=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(o(91));break;default:r!==u&&nt(e,t,m,r,a,u)}am(e,D,B);return;case"option":for(var he in n)if(D=n[he],n.hasOwnProperty(he)&&D!=null&&!a.hasOwnProperty(he))switch(he){case"selected":e.selected=!1;break;default:nt(e,t,he,null,a,D)}for(k in a)if(D=a[k],B=n[k],a.hasOwnProperty(k)&&D!==B&&(D!=null||B!=null))switch(k){case"selected":D!==B&&(Fe=!0),e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:nt(e,t,k,D,a,B)}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 Se in n)D=n[Se],n.hasOwnProperty(Se)&&D!=null&&!a.hasOwnProperty(Se)&&nt(e,t,Se,null,a,D);for(L in a)if(D=a[L],B=n[L],a.hasOwnProperty(L)&&D!==B&&(D!=null||B!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(o(137,t));break;default:nt(e,t,L,D,a,B)}return;default:if(Vo(t)){for(var Ue in n)D=n[Ue],n.hasOwnProperty(Ue)&&D!==void 0&&!a.hasOwnProperty(Ue)&&Gu(e,t,Ue,void 0,a,D);for(V in a)D=a[V],B=n[V],!a.hasOwnProperty(V)||D===B||D===void 0&&B===void 0||Gu(e,t,V,D,a,B);return}}for(var R in n)D=n[R],n.hasOwnProperty(R)&&D!=null&&!a.hasOwnProperty(R)&&nt(e,t,R,null,a,D);for(W in a)D=a[W],B=n[W],!a.hasOwnProperty(W)||D===B||D==null&&B==null||nt(e,t,W,D,a,B)}function fx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Uv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var r=n[a],u=r.transferSize,m=r.initiatorType,g=r.duration;if(u&&g&&fx(m)){for(m=0,g=r.responseEnd,a+=1;a<n.length;a++){var k=n[a],L=k.startTime;if(L>g)break;var V=k.transferSize,W=k.initiatorType;V&&fx(W)&&(k=k.responseEnd,m+=V*(k<g?1:(g-L)/(k-L)))}if(--a,t+=8*(u+m)/(r.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 Pu=null,Vu=null;function ii(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 hx(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 px(e,t,n,a){return n=ii(n).createElement(e),n[Dt]=a,n[Ft]=t,Ht(n,e,t),Tt(n),n}function Yu(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 Iu=null;function Bv(){var e=window.event;return e&&e.type==="popstate"?e===Iu?!1:(Iu=e,!0):(Iu=null,!1)}var Ku=typeof setTimeout=="function"?setTimeout:void 0,Hv=typeof clearTimeout=="function"?clearTimeout:void 0,xx=typeof Promise=="function"?Promise:void 0,gx=typeof requestAnimationFrame=="function"?requestAnimationFrame:Ku,qv=typeof queueMicrotask=="function"?queueMicrotask:typeof xx<"u"?function(e){return xx.resolve(null).then(e).catch(Gv)}:Ku;function Gv(e){setTimeout(function(){throw e})}function La(e){return e==="head"}function bx(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(r),fs(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")ed(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ed(n);for(var u=n.firstChild;u;){var m=u.nextSibling,g=u.nodeName;u[ws]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=m}}else n==="body"&&ed(e.ownerDocument.body);n=r}while(n);fs(t)}function yx(e,t){var n=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function vx(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 a=1;else for(var r=a=0;r<t.length;r++){var u=t[r];0<u.width&&0<u.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Nx(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 Pv(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 Qu(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return Pv(t,n,e)}function Vv(e){return e.documentElement.clientHeight}function Yv(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Iv(e,t,n,a,r,u,m,g,k){var L=t.nodeType===9?t:t.ownerDocument;try{var V=L.startViewTransition({update:function(){var D=L.defaultView,B=D.navigation&&D.navigation.transition,he=L.fonts.status;a();var Se=[];if(he==="loaded"&&(Vv(L),L.fonts.status==="loading"&&Se.push(L.fonts.ready)),he=Se.length,e!==null)for(var Ue=e.suspenseyImages,R=0,z=0;z<Ue.length;z++){var U=Ue[z];if(!U.complete){var $=U.getBoundingClientRect();if(0<$.bottom&&0<$.right&&$.top<D.innerHeight&&$.left<D.innerWidth){if(R+=Px(U),R>Zr){Se.length=he;break}U=new Promise(Yv.bind(U)),Se.push(U)}}}if(0<Se.length)return D=Promise.race([Promise.all(Se),new Promise(function(ge){return setTimeout(ge,500)})]).then(r,r),(B?Promise.allSettled([B.finished,D]):D).then(u,u);if(r(),B)return B.finished.then(u,u);u()},types:n});L.__reactViewTransition=V;var W=[];return V.ready.then(function(){for(var D=L.documentElement.getAnimations({subtree:!0}),B=0;B<D.length;B++){var he=D[B],Se=he.effect,Ue=Se.pseudoElement;if(Ue!=null&&Ue.startsWith("::view-transition")){W.push(he),he=Se.getKeyframes();for(var R=Ue=void 0,z=!0,U=0;U<he.length;U++){var $=he[U],ge=$.width;if(Ue===void 0)Ue=ge;else if(Ue!==ge){z=!1;break}if(ge=$.height,R===void 0)R=ge;else if(R!==ge){z=!1;break}delete $.width,delete $.height,$.transform==="none"&&delete $.transform}z&&Ue!==void 0&&R!==void 0&&(Se.setKeyframes(he),z=getComputedStyle(Se.target,Se.pseudoElement),z.width!==Ue||z.height!==R)&&(z=he[0],z.width=Ue,z.height=R,z=he[he.length-1],z.width=Ue,z.height=R,Se.setKeyframes(he))}}m()},function(D){L.__reactViewTransition===V&&(L.__reactViewTransition=null);try{if(typeof D=="object"&&D!==null)switch(D.name){case"InvalidStateError":(D.message==="View transition was skipped because document visibility state is hidden."||D.message==="Skipping view transition because document visibility state has become hidden."||D.message==="Skipping view transition because viewport size changed."||D.message==="Transition was aborted because of invalid state")&&(D=null)}D!==null&&k(D)}finally{a(),r(),m()}}),V.finished.finally(function(){for(var D=0;D<W.length;D++)W[D].cancel();L.__reactViewTransition===V&&(L.__reactViewTransition=null),g()}),V}catch{return a(),r(),m(),null}}function xl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}xl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:_({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},xl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],r=0;r<n.length;r++){var u=n[r].effect;u!==null&&u.target===e&&u.pseudoElement===t&&a.push(n[r])}return a},xl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Sx(e){return{name:e,group:new xl("group",e),imagePair:new xl("image-pair",e),old:new xl("old",e),new:new xl("new",e)}}function fn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}fn.prototype.addEventListener=function(e,t,n){var a=null,r=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(wx(u,e,t,n)===-1){var m=this,g=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(g=function(k){m.removeEventListener(e,t,n),typeof t=="function"?t.call(this,k):t.handleEvent(k)}),a!==null&&(r=m.removeEventListener.bind(m,e,t,n),a.addEventListener("abort",r,{once:!0}),r=a.removeEventListener.bind(a,"abort",r)),a=is(n),u.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:g,cleanup:r}),b(this._fragmentFiber.child,!1,Kv,e,g,a)}this._eventListeners=u}};function Kv(e,t,n,a){return A(e).addEventListener(t,n,a),!1}fn.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=wx(a,e,t,n),t!==-1)){var r=a[t];n=r.attachedListener;var u=r.cleanup;r=is(r.optionsOrUseCapture),b(this._fragmentFiber.child,!1,Qv,e,n,r),a.splice(t,1),u!==null&&u()}};function Qv(e,t,n,a){return A(e).removeEventListener(t,n,a),!1}function is(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function jx(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function wx(e,t,n,a){if(e.length===0)return-1;a=jx(a);for(var r=0;r<e.length;r++){var u=e[r];if(u.type===t&&u.listener===n&&jx(u.optionsOrUseCapture)===a)return r}return-1}fn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=A(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var a=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var u=n[r];a.addEventListener(u.type,u.attachedListener,is(u.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(r=0;r<n.length;r++)u=n[r],a.removeEventListener(u.type,u.attachedListener,is(u.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},fn.prototype.focus=function(e){b(this._fragmentFiber.child,!0,kx,e,void 0,void 0)};function kx(e,t){return e.tag===6?!1:(e=A(e),s2(e,t))}fn.prototype.focusLast=function(e){var t=[];b(this._fragmentFiber.child,!0,Xu,t,void 0,void 0);for(var n=t.length-1;0<=n&&!kx(t[n],e);n--);};function Xu(e,t){return t.push(e),!1}fn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=A(e),e=ii(e).activeElement,e!==null&&b(this._fragmentFiber.child,!1,Xv,e,void 0,void 0))};function Xv(e,t){return e.tag===6?!1:(e=A(e),e===t||e.contains(t)?(t.blur(),!0):!1)}fn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),b(this._fragmentFiber.child,!1,Fv,e,void 0,void 0)};function Fv(e,t){return e.tag===6||(e=A(e),t.observe(e)),!1}fn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),b(this._fragmentFiber.child,!1,Zv,e,void 0,void 0);for(var n=t=0;n<Tn.length;n++){var a=Tn[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):Tn[t++]=a}Tn.length=t}};function Zv(e,t){return e.tag===6||(e=A(e),t.unobserve(e)),!1}var Tn=[],Fu=!1;function Jv(e,t,n){Tn.push({fragmentInstance:e,observer:t,instance:n}),Fu||(Fu=!0,i2(function(){Fu=!1;var a=Tn;Tn=[];for(var r=0;r<a.length;r++){var u=a[r];u.observer.unobserve(u.instance)}}))}fn.prototype.getClientRects=function(){var e=[];return b(this._fragmentFiber.child,!1,$v,e,void 0,void 0),e};function $v(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=A(e),t.push.apply(t,e.getClientRects());return!1}fn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:A(t).getRootNode(e)},fn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];b(this._fragmentFiber.child,!1,Xu,n,void 0,void 0);var a=A(t);if(n.length===0){if(n=a,O(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 r=a=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=C(t)[1],n===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=A(n).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=A(n[0]),r=A(n[n.length-1]);var u=O(this._fragmentFiber)?t.parentElement:a;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),g=r.compareDocumentPosition(e),k=m&Node.DOCUMENT_POSITION_CONTAINED_BY||g&Node.DOCUMENT_POSITION_CONTAINED_BY;return g=a&&u&&m&Node.DOCUMENT_POSITION_FOLLOWING&&g&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||u&&r===e||k||g?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!u&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Wv(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Wv(e,t,n,a,r){var u=Fa(r);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=r.ownerDocument,r===u||r===u.documentElement||r===u.body;e:{for(u=t,t=S(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===n)&&(t=J(n,u,ie),t===null?t=!1:(b(t,!0,te,u,n),u=M,M=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===a)&&(t=J(a,u,ie),t===null?t=!1:(b(t,!0,Z,u,a),u=M,q=M=null,t=u!==null)),t):!1}function _x(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)}fn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];b(this._fragmentFiber.child,!1,Xu,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=C(this._fragmentFiber);if(a=n?a[1]||a[0]||S(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=A(a),_x(e,n);return}if(a=A(a),a.nodeType!==9){if(a.nodeType===11){n="host"in a?a.host:null,n!==null&&n.scrollIntoView(e);return}a.scrollIntoView(e)}}for(a=n?t.length-1:0;a!==(n?-1:t.length);){var r=t[a];r.tag===6?(r=A(r),_x(r,n)):A(r).scrollIntoView(e),a+=n?-1:1}};function e2(e,t){return e=A(e),Ex(e,t),!1}function Ex(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Cx(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a];e.addEventListener(r.type,r.attachedListener,is(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){for(var m=0,g=0;g<Tn.length;g++){var k=Tn[g];(k.fragmentInstance!==t||k.observer!==u||k.instance!==e)&&(Tn[m++]=k)}Tn.length=m,u.observe(e)}),Ex(e,t))}function t2(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a];e.removeEventListener(r.type,r.attachedListener,is(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){typeof u.rootMargin=="string"?Jv(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Zu(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":Zu(n),Bi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function n2(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[ws])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!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=vn(e.nextSibling),e===null)break}return null}function a2(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=vn(e.nextSibling),e===null))return null;return e}function Tx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=vn(e.nextSibling),e===null))return null;return e}function Ju(e){return e.data==="$?"||e.data==="$~"}function $u(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function l2(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function vn(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 Wu=null;function Ax(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return vn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function zx(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 s2(e,t){function n(){a=!0}if(e.ownerDocument.activeElement===e)return!0;var a=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return a}function i2(e){gx(function(){gx(function(t){return e(t)})})}function Ox(e,t,n){switch(t=ii(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 Mx(e,t,n){for(var a in n){var r=n[a];n.hasOwnProperty(a)&&r!=null&&nt(e,t,a,null,Rv,r)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===On&&(e.onclick=null),Bi(e)}function ed(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Bi(e)}var Nn=new Map,Dx=new Set;function ri(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 ca=pe.d;pe.d={f:r2,r:o2,D:c2,C:u2,L:d2,m:f2,X:h2,S:m2,M:p2};function r2(){var e=ca.f(),t=Gr();return e||t}function o2(e){var t=kl(e);t!==null&&t.tag===5&&t.type==="form"?Lh(t):ca.r(e)}var rs=typeof document>"u"?null:document;function Rx(e,t,n){var a=rs;if(a&&typeof t=="string"&&t){var r=mn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Dx.has(r)||(Dx.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),Ht(t,"link",e),Tt(t),a.head.appendChild(t)))}}function c2(e){ca.D(e),Rx("dns-prefetch",e,null)}function u2(e,t){ca.C(e,t),Rx("preconnect",e,t)}function d2(e,t,n){ca.L(e,t,n);var a=rs;if(a&&e&&t){var r='link[rel="preload"][as="'+mn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+mn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+mn(n.imageSizes)+'"]')):r+='[href="'+mn(e)+'"]';var u=r;switch(t){case"style":u=os(e);break;case"script":u=cs(e)}if(!(Nn.has(u)||(e=_({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Nn.set(u,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(oi(u))||t==="script"&&a.querySelector(ci(u))))){var m=a.createElement("link");Ht(m,"link",e),t==="style"&&(m[Ui]=!0,m.onload=m.onerror=function(){Xf(m)}),Tt(m),a.head.appendChild(m)}}}function f2(e,t){ca.m(e,t);var n=rs;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+mn(a)+'"][href="'+mn(e)+'"]',u=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=cs(e)}if(!Nn.has(u)&&(e=_({rel:"modulepreload",href:e},t),Nn.set(u,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ci(u)))return}a=n.createElement("link"),Ht(a,"link",e),Tt(a),n.head.appendChild(a)}}}function m2(e,t,n){ca.S(e,t,n);var a=rs;if(a&&e){var r=_l(a).hoistableStyles,u=os(e);t=t||"default";var m=r.get(u);if(!m){var g={loading:0,preload:null};if(m=a.querySelector(oi(u)))g.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Nn.get(u))&&td(e,n);var k=m=a.createElement("link");Tt(k),Ht(k,"link",e),k._p=new Promise(function(L,V){k.onload=L,k.onerror=V}),k.addEventListener("load",function(){g.loading|=1}),k.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Xr(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:g},r.set(u,m)}}}function h2(e,t){ca.X(e,t);var n=rs;if(n&&e){var a=_l(n).hoistableScripts,r=cs(e),u=a.get(r);u||(u=n.querySelector(ci(r)),u||(e=_({src:e,async:!0},t),(t=Nn.get(r))&&nd(e,t),u=n.createElement("script"),Tt(u),Ht(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(r,u))}}function p2(e,t){ca.M(e,t);var n=rs;if(n&&e){var a=_l(n).hoistableScripts,r=cs(e),u=a.get(r);u||(u=n.querySelector(ci(r)),u||(e=_({src:e,async:!0,type:"module"},t),(t=Nn.get(r))&&nd(e,t),u=n.createElement("script"),Tt(u),Ht(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(r,u))}}function Lx(e,t,n,a){var r=(r=_e.current)?ri(r):null;if(!r)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=os(n.href),t=_l(r).hoistableStyles,a=t.get(n),a||(a={type:"style",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=os(n.href);var u=_l(r).hoistableStyles,m=u.get(e);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,m),(u=r.querySelector(oi(e)))?u._p||(m.instance=u,m.state.loading=5):(u=Nn.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},Nn.set(e,u)),x2(r,e,u,m.state))),t&&a===null)throw Error(o(528,""));return m}if(t&&a!==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=cs(n),t=_l(r).hoistableScripts,a=t.get(n),a||(a={type:"script",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function os(e){return'href="'+mn(e)+'"'}function oi(e){return'link[rel="stylesheet"]['+e+"]"}function Ux(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function x2(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ui]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Ui]=!0,t.onload=t.onerror=Xf.bind(null,t),Ht(t,"link",n),Tt(t),e.head.appendChild(t);a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2})}function cs(e){return'[src="'+mn(e)+'"]'}function ci(e){return"script[async]"+e}function Bx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+mn(n.href)+'"]');if(a)return t.instance=a,Tt(a),a;var r=_({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Tt(a),Ht(a,"style",r),Xr(a,n.precedence,e),t.instance=a;case"stylesheet":r=os(n.href);var u=e.querySelector(oi(r));if(u)return t.state.loading|=4,t.instance=u,Tt(u),u;a=Ux(n),(r=Nn.get(r))&&td(a,r),u=(e.ownerDocument||e).createElement("link"),Tt(u);var m=u;return m._p=new Promise(function(g,k){m.onload=g,m.onerror=k}),Ht(u,"link",a),t.state.loading|=4,Xr(u,n.precedence,e),t.instance=u;case"script":return u=cs(n.src),(r=e.querySelector(ci(u)))?(t.instance=r,Tt(r),r):(a=n,(r=Nn.get(u))&&(a=_({},n),nd(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Tt(r),Ht(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Xr(a,n.precedence,e));return t.instance}function Xr(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,u=r,m=0;m<a.length;m++){var g=a[m];if(g.dataset.precedence===t)u=g;else if(u!==r)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function td(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fr=null;function Hx(e,t,n){if(Fr===null){var a=new Map,r=Fr=new Map;r.set(n,a)}else r=Fr,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var u=n[r];if(!(u[ws]||u[Dt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var m=u.getAttribute(t)||"";m=e+m;var g=a.get(m);g?g.push(u):a.set(m,[u])}}return a}function ad(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function g2(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 qx(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Gx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Px(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Vx(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Px(t),e.suspenseyImages.push(t)),e=v2.bind(e),t.decode().then(e,e))}function b2(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=os(a.href),u=t.querySelector(oi(r));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ui.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Tt(u);return}u=t.ownerDocument||t,a=Ux(a),(r=Nn.get(r))&&td(a,r),u=u.createElement("link"),Tt(u);var m=u;m._p=new Promise(function(g,k){m.onload=g,m.onerror=k}),Ht(u,"link",a),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=ui.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Zr=0;function y2(e,t){return e.stylesheets&&e.count===0&&$r(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&$r(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Zr===0&&(Zr=62500*Uv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$r(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Zr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function Yx(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)$r(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ui(){this.count--,Yx(this)}function v2(){this.imgCount--,Yx(this)}var Jr=null;function $r(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jr=new Map,t.forEach(N2,e),Jr=null,ui.call(e))}function N2(e,t){if(!(t.state.loading&4)){var n=Jr.get(e);if(n)var a=n.get(null);else{n=new Map,Jr.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<r.length;u++){var m=r[u];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}r=t.instance,m=r.getAttribute("data-precedence"),u=n.get(m)||a,u===a&&n.set(null,r),n.set(m,r),this.count++,a=ui.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),u?u.parentNode.insertBefore(r,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var us={$$typeof:Y,Provider:null,Consumer:null,_currentValue:dt,_currentValue2:dt,_threadCount:0};function S2(e,t,n,a,r,u,m,g,k){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=Uo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uo(0),this.hiddenUpdates=Uo(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=u,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.transitionTypes=null,this.incompleteTransitions=new Map}function Ix(e,t,n,a,r,u,m,g,k,L,V,W){return e=new S2(e,t,n,m,k,L,V,W,g),t=1,u===!0&&(t|=24),u=Zt(3,null,null,t),e.current=u,u.stateNode=e,t=bc(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:n,cache:t},Sc(u),e}function Kx(e){return e?(e=Ll,e):Ll}function Qx(e,t,n,a,r,u){r=Kx(r),a.context===null?a.context=r:a.pendingContext=r,a=wa(t),a.payload={element:n},u=u===void 0?null:u,u!==null&&(a.callback=u),n=ka(e,a,t),n!==null&&(en(n,e,t),Gs(n,e,t))}function Xx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ld(e,t){Xx(e,t),(e=e.alternate)&&Xx(e,t)}function Fx(e){if(e.tag===13||e.tag===31){var t=Wa(e,67108864);t!==null&&en(t,e,67108864),ld(e,67108864)}}function Zx(e){if(e.tag===13||e.tag===31){var t=dn();t=Bo(t);var n=Wa(e,t);n!==null&&en(n,e,t),ld(e,t)}}var ds=!0;function j2(e,t,n,a){var r=fe.T;fe.T=null;var u=pe.p;try{pe.p=2,sd(e,t,n,a)}finally{pe.p=u,fe.T=r}}function w2(e,t,n,a){var r=fe.T;fe.T=null;var u=pe.p;try{pe.p=8,sd(e,t,n,a)}finally{pe.p=u,fe.T=r}}function sd(e,t,n,a){if(ds){var r=id(a);if(r===null)qu(e,t,a,Wr,n),$x(e,a);else if(_2(r,e,t,n,a))a.stopPropagation();else if($x(e,a),t&4&&-1<k2.indexOf(e)){for(;r!==null;){var u=kl(r);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var m=Xa(u.pendingLanes);if(m!==0){var g=u;for(g.pendingLanes|=2,g.entangledLanes|=2;m;){var k=1<<31-an(m);g.entanglements[1]|=k,m&=~k}Pn(u),(Ze&6)===0&&(Br=$e()+500,ai(0))}}break;case 31:case 13:g=Wa(u,2),g!==null&&en(g,u,2),Gr(),ld(u,2)}if(u=id(a),u===null&&qu(e,t,a,Wr,n),u===r)break;r=u}r!==null&&a.stopPropagation()}else qu(e,t,a,null,n)}}function id(e){return e=Io(e),rd(e)}var Wr=null;function rd(e){if(Wr=null,e=Fa(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=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Wr=e,null}function Jx(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(Uy()){case Lf:return 2;case Uf:return 8;case Oi:case By:return 32;case Bf:return 268435456;default:return 32}default:return 32}}var od=!1,Ua=null,Ba=null,Ha=null,di=new Map,fi=new Map,qa=[],k2="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 $x(e,t){switch(e){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fi.delete(t.pointerId)}}function mi(e,t,n,a,r,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:u,targetContainers:[r]},t!==null&&(t=kl(t),t!==null&&Fx(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function _2(e,t,n,a,r){switch(t){case"focusin":return Ua=mi(Ua,e,t,n,a,r),!0;case"dragenter":return Ba=mi(Ba,e,t,n,a,r),!0;case"mouseover":return Ha=mi(Ha,e,t,n,a,r),!0;case"pointerover":var u=r.pointerId;return di.set(u,mi(di.get(u)||null,e,t,n,a,r)),!0;case"gotpointercapture":return u=r.pointerId,fi.set(u,mi(fi.get(u)||null,e,t,n,a,r)),!0}return!1}function Wx(e){var t=Fa(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,If(e.priority,function(){Zx(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,If(e.priority,function(){Zx(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 eo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=id(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Yo=a,n.target.dispatchEvent(a),Yo=null}else return t=kl(n),t!==null&&Fx(t),e.blockedOn=n,!1;t.shift()}return!0}function eg(e,t,n){eo(e)&&n.delete(t)}function E2(){od=!1,Ua!==null&&eo(Ua)&&(Ua=null),Ba!==null&&eo(Ba)&&(Ba=null),Ha!==null&&eo(Ha)&&(Ha=null),di.forEach(eg),fi.forEach(eg)}function to(e,t){e.blockedOn===t&&(e.blockedOn=null,od||(od=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,E2)))}var no=null;function tg(e){no!==e&&(no=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){no===e&&(no=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(rd(a||n)===null)continue;break}var u=kl(n);u!==null&&(e.splice(t,3),t-=3,Vc(u,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function fs(e){function t(k){return to(k,e)}Ua!==null&&to(Ua,e),Ba!==null&&to(Ba,e),Ha!==null&&to(Ha,e),di.forEach(t),fi.forEach(t);for(var n=0;n<qa.length;n++){var a=qa[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<qa.length&&(n=qa[0],n.blockedOn===null);)Wx(n),n.blockedOn===null&&qa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],u=n[a+1],m=r[Ft]||null;if(typeof u=="function")m||tg(n);else if(m){var g=null;if(u&&u.hasAttribute("formAction")){if(r=u,m=u[Ft]||null)g=m.formAction;else if(rd(r)!==null)continue}else g=m.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),tg(n)}}}function ng(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),a||setTimeout(n,20)}function n(){if(!a&&!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 a=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function cd(e){this._internalRoot=e}ao.prototype.render=cd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,a=dn();Qx(n,a,e,t,null,null)},ao.prototype.unmount=cd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qx(e.current,2,null,e,null,null),Gr(),t[wl]=null}};function ao(e){this._internalRoot=e}ao.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qa.length&&t!==0&&t<qa[n].priority;n++);qa.splice(n,0,e),n===0&&Wx(e)}};var ag=i.version;if(ag!=="19.3.0")throw Error(o(527,ag,"19.3.0"));pe.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=N(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var C2={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lo.isDisabled&&lo.supportsFiber)try{Ns=lo.inject(C2),nn=lo}catch{}}return pi.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,a="",r=Kh,u=Qh,m=Xh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Ix(e,1,!1,null,null,n,a,null,r,u,m,ng),e[wl]=t.current,Hu(e),new cd(t)},pi.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var a=!1,r="",u=Kh,m=Qh,g=Xh,k=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=Ix(e,1,!0,t,n??null,a,r,k,u,m,g,ng),t.context=Kx(null),n=t.current,a=dn(),a=Bo(a),r=wa(a),r.callback=null,ka(n,r,a),n=a,t.current.lanes=n,js(t,n),Pn(t),e[wl]=t.current,Hu(e),new ao(t)},pi.version="19.3.0",pi}var mg;function B2(){if(mg)return fd.exports;mg=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),fd.exports=U2(),fd.exports}var H2=B2();const q2=xf(H2);class ma extends Error{constructor(i,c,o){super(c),this.status=i,this.data=o,this.name="ApiError"}get code(){var i;return(i=this.data)==null?void 0:i.code}}async function gl(l,i={}){const c=l.startsWith("/dashboard/api")?l:`/dashboard/api${l.startsWith("/")?l:`/${l}`}`,o={...i.body instanceof Blob?{}:{"Content-Type":"application/json"},...i.headers},d=await fetch(c,{...i,headers:o});if(d.status===401)throw window.location.href="/login",new ma(401,"Session expired, redirecting to login...");const f=await d.json().catch(()=>null);if(!d.ok)throw new ma(d.status,(f==null?void 0:f.error)||(f==null?void 0:f.message)||`HTTP ${d.status}: Request failed`,f);return f}function G2(l){if(!l)return null;const i=/filename\*=UTF-8''([^;]+)/i.exec(l);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}const c=/filename="([^"]*)"/.exec(l);return(c==null?void 0:c[1])||null}async function hg(l,i={}){const c=await fetch(`/dashboard/api${l}`,i);if(c.status===401)throw window.location.href="/login",new ma(401,"Session expired");if(!c.ok){const o=await c.json().catch(()=>null);throw new ma(c.status,(o==null?void 0:o.error)||"Sticker operation failed",o)}return{blob:await c.blob(),fileName:G2(c.headers.get("Content-Disposition")),animated:c.headers.get("X-Levix-Animated")==="1"}}const K={get:l=>gl(l,{method:"GET"}),post:(l,i)=>gl(l,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(l,i)=>gl(l,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(l,i)=>gl(l,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:l=>gl(l,{method:"DELETE"}),getStats:()=>K.get("/stats"),getSession:()=>K.get("/bot/session"),startSession:l=>K.post("/bot/session/start",l),reconnectSession:()=>K.post("/bot/session/reconnect"),stopSession:()=>K.post("/bot/session/stop"),unlinkSession:()=>K.post("/bot/logout"),restartBot:()=>K.post("/bot/restart"),getSettings:()=>K.get("/settings"),updateSetting:(l,i)=>K.patch("/settings",{key:l,value:i}),updatePrefix:l=>K.patch("/settings",{key:"prefix",value:l}),exportSettings:()=>K.get("/settings/export"),importSettings:l=>K.post("/settings/import",l),getCommands:()=>K.get("/commands"),updateCommand:(l,i)=>K.patch(`/commands/${encodeURIComponent(l)}`,i),getSchedules:()=>K.get("/schedules"),createSchedule:l=>K.post("/schedules",l),deleteSchedule:l=>K.delete(`/schedules/${encodeURIComponent(l)}`),retrySchedule:l=>K.post(`/schedules/${encodeURIComponent(l)}/retry`),getGroups:()=>K.get("/groups"),updateGroup:(l,i)=>K.patch(`/groups/${encodeURIComponent(l)}`,i),getPersona:()=>K.get("/ai/persona"),updatePersona:l=>K.put("/ai/persona",{body:l}),getMemoryFiles:()=>K.get("/ai/memory"),getMemoryFile:l=>K.get(`/ai/memory/${encodeURIComponent(l)}`),updateMemoryFile:(l,i)=>K.put(`/ai/memory/${encodeURIComponent(l)}`,{content:i}),deleteMemoryFile:l=>K.delete(`/ai/memory/${encodeURIComponent(l)}`),getAiConversations:()=>K.get("/ai/conversations"),getAiConversation:l=>K.get(`/ai/conversations/${encodeURIComponent(l)}`),getRecipients:()=>K.get("/recipients"),fetchAiModels:l=>K.post("/ai/models",l||{}),changePassword:(l,i)=>K.post("/security/password",{current:l,next:i}),getFeedbackMeta:()=>K.get("/feedback/meta"),sendFeedback:l=>K.post("/feedback",l),getLogs:()=>K.get("/logs"),getStickerCapabilities:()=>K.get("/stickers/capabilities"),getStickers:l=>{const i=new URLSearchParams;return l.q&&i.set("q",l.q),l.sort&&i.set("sort",l.sort),l.filter&&i.set("filter",l.filter),l.pack&&i.set("pack",l.pack),l.offset!==void 0&&i.set("offset",l.offset.toString()),l.limit!==void 0&&i.set("limit",l.limit.toString()),K.get(`/stickers?${i.toString()}`)},uploadStickerSource:(l,i)=>{const c={};return i&&(c["X-Filename"]=encodeURIComponent(i)),gl("/stickers/uploads",{method:"POST",body:l,headers:c})},uploadExistingStickerSource:l=>gl(`/stickers/${encodeURIComponent(l)}/uploads`,{method:"POST"}),createStickerJob:l=>K.post("/stickers/jobs",l),getStickerJob:l=>K.get(`/stickers/jobs/${encodeURIComponent(l)}`),exportSticker:(l,i)=>hg(`/stickers/${encodeURIComponent(l)}/export?format=${i}`),exportStickers:(l,i)=>hg("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:l,format:i})}),updateSticker:(l,i)=>K.patch(`/stickers/${encodeURIComponent(l)}`,i),deleteSticker:(l,i)=>K.delete(`/stickers/${encodeURIComponent(l)}${i?"?confirm=1":""}`),bulkStickers:l=>K.post("/stickers/bulk",l),sendStickers:l=>K.post("/stickers/send",l),getPacks:()=>K.get("/sticker-packs"),createPack:l=>K.post("/sticker-packs",{name:l}),getPack:l=>K.get(`/sticker-packs/${encodeURIComponent(l)}`),updatePack:(l,i)=>K.patch(`/sticker-packs/${encodeURIComponent(l)}`,{name:i}),deletePack:(l,i)=>K.delete(`/sticker-packs/${encodeURIComponent(l)}${i?"?deleteStickers=1":""}`),reorderPack:(l,i)=>K.put(`/sticker-packs/${encodeURIComponent(l)}/order`,{ids:i}),mergePack:(l,i)=>K.post(`/sticker-packs/${encodeURIComponent(l)}/merge`,{intoPackId:i})};/**
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 P2=l=>l==null?void 0:l.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 V2(l,i,c=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:P2(l),size:24,node:i,...c.length>0?{aliases:c}:{}}}/**
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 Y2=l=>{let i="",c=!1;for(const o of l){if(o==="-"||o==="_"||o<=" "){c=i.length>0;continue}i.length===0?i+=o.toLowerCase():i+=c?o.toUpperCase():o,c=!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 I2=l=>{const i=Y2(l);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 tf=(...l)=>l.filter((i,c,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===c).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 bl={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 xd(l){return l!=null}function K2(l,i={}){var S,O;const c=i.attributeNames??{},o=C=>c[C]??C,d=l.size??l.width??bl.width,f=l.size??l.height??bl.height,h=((S=l.aliases)==null?void 0:S.filter(C=>typeof C=="string"&&C.trim()!=="").map(C=>`lucide-${C}`))??[],p=[...l.name?[`lucide-${l.name}`]:[],...h],x=((O=i.className)==null?void 0:O.split(" ").filter(Boolean))??[],N=i.includeDefaultClasses===!1?tf(...x):tf("lucide",...p,...x),y=i.absoluteStrokeWidth?Number(i.strokeWidth??bl["stroke-width"])*Number(l.size??l.width??bl.width)/Number(i.size??i.width??bl.width):i.strokeWidth??bl["stroke-width"];return["svg",{...Object.entries(bl).reduce((C,[E,A])=>(C[o(E)]=A,C),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&xd(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&xd(i.width)&&{[o("width")]:i.width},..."height"in i&&xd(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:y,...N&&{[o("class")]:N},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},l.node.map(C=>{const[E,A,M]=C,q=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...A}:A;return M?[E,q,M]:[E,q]})]}/**
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 Q2(l,i={}){return K2(l,{...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 X2=l=>{for(const i in l)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},F2=w.createContext({}),Z2=()=>w.useContext(F2),J2=w.forwardRef(({color:l,size:i,width:c,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:h,className:p="",children:x,iconNode:N=[],icon:y={node:N,aliases:[],size:24},...b},S)=>{const{size:O=24,strokeWidth:C=2,absoluteStrokeWidth:E=!1,nonScalingStroke:A=!1,color:M="currentColor",className:q=""}=Z2()??{},te=!!x||X2(b),[Z,ie,J=[]]=Q2(y,{color:l??M,width:c??i??O,height:o??i??O,strokeWidth:d??C,absoluteStrokeWidth:f??E,nonScalingStroke:h??A,className:tf(q,p),hasA11yProp:te,attributes:b});return w.createElement(Z,{ref:S,...ie},[...J.map(([_,j])=>w.createElement(_,j)),...Array.isArray(x)?x:[x]])});/**
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 me(l,i=[],c=[]){const o=typeof l=="string"?V2(l,i,c):l,d=w.forwardRef(({className:f,...h},p)=>w.createElement(J2,{ref:p,icon:o,className:f,...h}));return o.name&&(d.displayName=I2(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 fb={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"}]]};fb.node;const $2=me(fb);/**
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 mb={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};mb.node;const W2=me(mb);/**
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 hb={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};hb.node;const eN=me(hb);/**
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 pb={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};pb.node;const tN=me(pb);/**
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 xb={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"}]]};xb.node;const nN=me(xb);/**
125
+ * @license lucide-react v1.46.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const gb={name:"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"}]]};gb.node;const bf=me(gb);/**
130
+ * @license lucide-react v1.46.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const bb={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"}]]};bb.node;const aN=me(bb);/**
135
+ * @license lucide-react v1.46.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const yb={name:"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"}]]};yb.node;const nf=me(yb);/**
140
+ * @license lucide-react v1.46.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const vb={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};vb.node;const _i=me(vb);/**
145
+ * @license lucide-react v1.46.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Nb={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Nb.node;const lN=me(Nb);/**
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 Sb={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};Sb.node;const sN=me(Sb);/**
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 jb={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};jb.node;const iN=me(jb);/**
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 wb={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};wb.node;const rN=me(wb);/**
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 kb={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};kb.node;const jo=me(kb);/**
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 _b={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"]};_b.node;const Ai=me(_b);/**
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 Eb={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"]};Eb.node;const oN=me(Eb);/**
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 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 cN=me(Cb);/**
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 Tb={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"}]]};Tb.node;const uN=me(Tb);/**
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 Ab={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"}]]};Ab.node;const dN=me(Ab);/**
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 zb={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"}]]};zb.node;const yf=me(zb);/**
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 Ob={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"}]]};Ob.node;const fN=me(Ob);/**
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 Mb={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"}]]};Mb.node;const ms=me(Mb);/**
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 Db={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"}]]};Db.node;const da=me(Db);/**
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 Rb={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"}]]};Rb.node;const mo=me(Rb);/**
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 Lb={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"}]]};Lb.node;const mN=me(Lb);/**
225
+ * @license lucide-react v1.46.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const Ub={name:"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"]};Ub.node;const hN=me(Ub);/**
230
+ * @license lucide-react v1.46.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const Bb={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"}]]};Bb.node;const Ei=me(Bb);/**
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 Hb={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"}]]};Hb.node;const pg=me(Hb);/**
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 qb={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"}]]};qb.node;const xg=me(qb);/**
245
+ * @license lucide-react v1.46.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const Gb={name:"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"}]]};Gb.node;const pN=me(Gb);/**
250
+ * @license lucide-react v1.46.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const Pb={name:"heart-off",size:24,node:[["path",{d:"M10.5 4.893a5.5 5.5 0 0 1 1.091.931.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 1.872-1.002 3.356-2.187 4.655",key:"1inpfl"}],["path",{d:"m16.967 16.967-3.459 3.346a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5a5.5 5.5 0 0 1 2.747-4.761",key:"vbc6x7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};Pb.node;const xN=me(Pb);/**
255
+ * @license lucide-react v1.46.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const Vb={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};Vb.node;const gN=me(Vb);/**
260
+ * @license lucide-react v1.46.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const Yb={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};Yb.node;const bN=me(Yb);/**
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 Ib={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"}]]};Ib.node;const yN=me(Ib);/**
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 Kb={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"}]]};Kb.node;const af=me(Kb);/**
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 Qb={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"}]]};Qb.node;const vN=me(Qb);/**
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 Xb={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"}]]};Xb.node;const NN=me(Xb);/**
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 Fb={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"}]]};Fb.node;const SN=me(Fb);/**
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 jN=me(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 Jb={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};Jb.node;const wN=me(Jb);/**
300
+ * @license lucide-react v1.46.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const $b={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"}]]};$b.node;const kN=me($b);/**
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 Wb={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"}]]};Wb.node;const _N=me(Wb);/**
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 e0={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"}]]};e0.node;const lf=me(e0);/**
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 t0={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"}]]};t0.node;const gd=me(t0);/**
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 n0={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"}]]};n0.node;const EN=me(n0);/**
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 a0={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"}]]};a0.node;const gg=me(a0);/**
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 l0={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"]};l0.node;const CN=me(l0);/**
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 s0={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"}]]};s0.node;const TN=me(s0);/**
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 i0={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"}]]};i0.node;const AN=me(i0);/**
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 r0={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"}]]};r0.node;const zN=me(r0);/**
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 o0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};o0.node;const Co=me(o0);/**
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 c0={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"}]]};c0.node;const bd=me(c0);/**
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 u0={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"}]]};u0.node;const Ci=me(u0);/**
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 d0={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"}]]};d0.node;const wo=me(d0);/**
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 f0={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"]};f0.node;const ON=me(f0);/**
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 m0={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"}]]};m0.node;const so=me(m0);/**
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 h0={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"}]]};h0.node;const ko=me(h0);/**
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 p0={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};p0.node;const vf=me(p0);/**
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 x0={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"}]]};x0.node;const Ti=me(x0);/**
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 g0={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"}]]};g0.node;const MN=me(g0);/**
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 b0={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"}]]};b0.node;const To=me(b0);/**
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 y0={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"}]]};y0.node;const DN=me(y0);/**
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 v0={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"}]]};v0.node;const Nf=me(v0);/**
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 N0={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"]};N0.node;const S0=me(N0);/**
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 j0={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"}]]};j0.node;const Ni=me(j0);/**
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 w0={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"]};w0.node;const sf=me(w0);/**
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 k0={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};k0.node;const rf=me(k0);/**
435
+ * @license lucide-react v1.46.0 - ISC
436
+ *
437
+ * This source code is licensed under the ISC license.
438
+ * See the LICENSE file in the root directory of this source tree.
439
+ */const _0={name:"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"}]]};_0.node;const Sf=me(_0);/**
440
+ * @license lucide-react v1.46.0 - ISC
441
+ *
442
+ * This source code is licensed under the ISC license.
443
+ * See the LICENSE file in the root directory of this source tree.
444
+ */const E0={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"}]]};E0.node;const jf=me(E0);/**
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 C0={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"}]]};C0.node;const RN=me(C0);/**
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 T0={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"}]]};T0.node;const LN=me(T0);/**
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 A0={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};A0.node;const xs=me(A0);/**
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 z0={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"]};z0.node;const bs=me(z0);/**
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 O0={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"]};O0.node;const Si=me(O0);/**
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 M0={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"}]]};M0.node;const yd=me(M0);/**
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 D0={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"}]]};D0.node;const R0=me(D0);/**
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 L0={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"}]]};L0.node;const vd=me(L0);/**
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 U0={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"}]]};U0.node;const ps=me(U0);/**
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 B0={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"}]]};B0.node;const UN=me(B0);/**
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 H0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};H0.node;const ys=me(H0);/**
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 q0={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"}]]};q0.node;const BN=me(q0),Nd={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:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",edit:"تعديل",add:"إضافة",refresh:"تحديث",logout:"تسجيل الخروج",backToApp:"العودة للتطبيق",close:"إغلاق",copy:"نسخ",copied:"تم النسخ!",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:"مدة التشغيل",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",baseUrl:"Base URL",maxToolSteps:"الحد الأقصى لخطوات الأدوات",googleSearch:"أداة بحث جوجل المدمجة (Google Search)",personaPrompt:"توجيه شخصية البوت (AI Persona)",personaDesc:"تعديل التوجيه الأساسي الذي يحدد أسلوب وشخصية مساعدك الذكي",editPersona:"تعديل توجيه الشخصية",memoryFiles:"الذاكرة طويلة المدى",memoryDesc:"ذاكرة البوت الدائمة: تشترك جميع المحادثات في الذاكرة العامة، ولكل محادثة ملف خاص. يقرأ البوت المعلومات المحفوظة وأي نص حر تكتبه.",manageMemory:"إدارة ملفات الذاكرة",memoryGlobalScope:"الذاكرة العامة",memoryGlobalScopeHint:"تُضاف إلى سياق جميع المحادثات",memoryChatScopeHint:"تُضاف إلى سياق هذه المحادثة فقط",memoryEntriesCount:"{n} معلومة محفوظة",memoryProseHint:"يقرأ البوت محتوى الملف كله: الأسطر التي تبدأ بـ `-` معلومات منفصلة يمكنه إضافتها أو حذفها، ويقرأ أي نص حر كما كُتب.",memoryEditorPlaceholder:"اكتب هنا ما تريد أن يتذكره البوت دائمًا…",aiInspector:"معاينة محادثات الذكاء الاصطناعي",aiInspectorDesc:"نظرة للقراءة فقط على السياق المخزّن لكل محادثة: الردود، الوسائط، واستخدام الأدوات.",openInspector:"فتح المعاينة",noConversations:"لا توجد محادثات محفوظة بعد.",convTurns:"{n} جزء",backToList:"رجوع للقائمة",convTruncated:"يقتصر العرض على آخر 200 جزء.",convMedia:"ملف وسائط",capabilities:"القدرات والميزات المتقدمة",modelsAvailableLive:"نماذج متاحة لحسابك (تم التحقق عبر API)",modelsRecommendedSeed:"نماذج مقترحة / معروفة (دليل النماذج)",connectKeyFirstPrompt:"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك",refreshModels:"تحديث قائمة النماذج",refreshing:"جارٍ التحديث...",fetchModels:"فحص النماذج المتاحة",fetchingModels:"جارٍ فحص النماذج...",capVision:"الرؤية",capStt:"الصوت",capAudio:"إدخال الصوت",capText:"نص",capPdf:"PDF",capVideo:"فيديو",supported:"مدعوم",unsupported:"غير مدعوم",sourceLive:"حسابك",sourceSeed:"مقترح",sourceUnknown:"غير معروف",visionUnsupportedNotice:"النموذج المختار لا يدعم معالجة الصور والرؤية (Vision)، تم تعطيل الميزة تلقائياً.",sttUnsupportedNotice:"النموذج المختار لا يدعم تحويل وفهم الصوت (STT)، تم تعطيل الميزة تلقائياً.",aiSttEnabled:"تفعيل تحويل وفهم الصوت (STT)",aiSttEnabledDesc:"تفريغ الرسائل الصوتية وفهم الملفات الصوتية عبر النموذج المختار",providerGemini:"Google Gemini",providerGeminiDesc:"الافتراضي، يدعم البحث والملفات والصور والصوتيات محلياً",providerGroq:"Groq Cloud",providerGroqDesc:"فائق السرعة لنماذج Llama 3 و Mixtral مع دعم Vision",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"لنماذج GPT-4o أو أي خادم متوافق مع API OpenAI",providerOllama:"Ollama (محلي)",providerOllamaDesc:"تشغيل النماذج محلياً على جهازك مجاناً بدون إنترنت",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"لنماذج Claude 3.5 Sonnet الذكية والمتقدمة",scanQrHint:"افتح تطبيق واتساب على هاتفك > الأجهزة المرتبطة > ربط جهاز، وامسح الرمز أدناه.",pairingCode:"رمز الربط (Pairing Code)",reconnectingSoon:"إعادة الاتصال قريباً...",nextAttemptIn:"المحاولة القادمة خلال",seconds:"ثوانٍ",tabGeneral:"عام والبادئة",tabAI:"الذكاء الاصطناعي",tabSecurity:"الأمان والوصول",tabProxy:"بروكسي واتساب",tabStorage:"التخزين والوسائط",tabLogs:"سجلات النظام",prefixTitle:"بادئة أوامر البوت (Command Prefix)",prefixDesc:"الرمز أو الحرف الذي تبدأ به جميع الأوامر الموجهة للبوت في واتساب (مثل !help أو /ping)",prefixPlaceholder:"مثال: !",prefixPresets:"بادئات شائعة سريعة:",prefixPreview:"معاينة حية لشكل الأوامر:",prefixSaveBtn:"حفظ البادئة الجديدة",prefixUpdated:"تم تحديث بادئة الأوامر بنجاح!",prefixValidation:"يجب أن تكون البادئة من رمز واحد إلى 3 رموز",activePrefix:"البادئة الحالية",changePrefix:"تعديل البادئة",prefix:"بادئة الأوامر (Prefix)",botTimezone:"المنطقة الزمنية (Timezone)",botTimezoneDesc:"المنطقة الزمنية المعتمدة لحساب أوقات الصلاة والمهام المجدولة (مثل Africa/Cairo)",botMinDelay:"الحد الأدنى للتأخير البشري (ms)",botMaxDelay:"الحد الأقصى للتأخير البشري (ms)",delaysDesc:"فترة انتظار قصيرة قبل إرسال الردود ليبدو سلوك البوت طبيعياً وبشرياً",shareSettingsTitle:"مشاركة الإعدادات",shareSettingsDesc:"صدّر إعداداتك في ملف JSON يشاركه أصدقاؤك، أو استورد ملف صديقك. المفاتيح السرية (مفاتيح الـ API وكلمات المرور) لا تُصدَّر أبداً ولا تُستبدل بالاستيراد.",exportSettings:"تصدير الإعدادات",exportSettingsDesc:"ملف JSON يتضمن الإعدادات غير السرية التي غيّرتها",exportSettingsSuccess:"تم تصدير الإعدادات",exportSavedTo:"حُفظ في",exportSettingsError:"تعذر تصدير الإعدادات",importSettings:"استيراد من ملف",importSettingsError:"ملف غير صالح — يجب أن يكون ملفًا صادرًا من إعدادات Levix",importTitle:"استيراد الإعدادات",importSummary:"سيُطبّق على هذا الجهاز:",importSettingsCount:"إعداد",importPermissionsCount:"صلاحية أمر",importAliasesCount:"أسماء بديلة",importDisabledCount:"أمر مُعطَّل",importPrefix:"البادئة",importApply:"تطبيق الاستيراد",importSuccess:"تم استيراد الإعدادات بنجاح",importSkipped:"تم تخطي",importRestartNeeded:"تحتاج إعادة تشغيل البوت لتُطبَّق",changePassword:"تغيير كلمة مرور لوحة التحكم",currentPassword:"كلمة المرور الحالية",newPassword:"كلمة المرور الجديدة",confirmPassword:"تأكيد كلمة المرور الجديدة",passwordMatchError:"كلمتا المرور غير متطابقتين",passwordMinLength:"يجب ألا تقل كلمة المرور عن 8 خانات",passwordChangedSuccess:"تم تغيير كلمة مرور لوحة التحكم بنجاح!",proxyTitle:"بروكسي واتساب الصادر (Outbound Proxy)",proxyDesc:"توجيه اتصالات Baileys إلى واتساب عبر بروكسي خارجي لتجاوز قيود الشبكة أو الحظر",proxyEnabled:"تفعيل البروكسي لاتصالات واتساب",proxyProtocol:"بروتوكول البروكسي (Protocol)",proxyHost:"عنوان المضيف (Host / IP)",proxyPort:"المنفذ (Port)",proxyUsername:"اسم المستخدم (اختياري)",proxyPassword:"كلمة المرور (اختياري)",proxyApplyHint:"⚠️ ملاحظة: عند تعديل إعدادات البروكسي، اضغط على زر إعادة الاتصال في صفحة الاتصال لتطبيق التغييرات.",storageTitle:"إدارة البيانات والاحتفاظ بها",storageDesc:"تحديد مدد صلاحية البيانات المؤقتة وسجلات الرسائل الموجهة والحدود القصوى للجلب",forwardTtl:"صلاحية سجلات الرسائل الموجهة (أيام)",forwardTtlDesc:"حذف إحصائيات الرسائل الموجهة القديمة تلقائياً بعد مرور هذا العدد من الأيام",maxFetchBytes:"الحد الأقصى لجلب محتوى صفحات الويب (Bytes)",maxFetchBytesDesc:"حجم المحتوى الأقصى المسموح لأدوات الذكاء الاصطناعي بجلبه من صفحات الويب (افتراضي: 512KB)",ffmpegPath:"مسار محرك FFmpeg مخصص (اختياري)",weatherApiKey:"مفتاح OpenWeatherMap API (اختياري)",chooseLanguage:"اختر اللغة",langCardTitle:"لغة الواجهة: العربية (RTL)",langCardDesc:"تصميم مخصص بالكامل لاتجاه الكتابة العربي من اليمين لليسار مع خط تجوال",langSwitchBtn:"Switch to English",langName:"العربية",interfaceLanguage:"لغة لوحة التحكم",interfaceLanguageDesc:"التبديل الفوري بين الواجهة العربية (RTL) والإنجليزية (LTR)",botPort:"منفذ خادم لوحة التحكم (Port)",botPortHint:"* يتطلب تغيير المنفذ إعادة تشغيل البوت ليأخذ مفعوله",searchPlaceholder:"ابحث في الأوامر أو الأسماء البديلة...",thCommand:"الأمر",thAliases:"الأسماء البديلة",thDescription:"الوصف",thScope:"النطاق",thRequiredRole:"الرتبة المطلوبة",thStatus:"الحالة",thGroupName:"اسم المجموعة",thGroupJid:"معرف المجموعة (JID)",thMembers:"الأعضاء",thAntiLink:"مانع الروابط",thMedia:"الوسائط",thWelcome:"الترحيب",thTarget:"الوجهة",thMessage:"الرسالة",thSchedule:"الموعد",thType:"النوع",thDelivery:"حالة الإرسال",thActions:"إجراءات",scheduleNewMsg:"جدولة رسالة جديدة",liveServerLogs:"سجلات النظام المباشرة",clearLogs:"مسح السجلات",allLogs:"جميع المستويات",noLogs:"لا توجد سجلات مسجلة حتى الآن.",logSourceBot:"البوت",logSourceHost:"مضيف أندرويد",shareLogs:"مشاركة السجلات",share:"مشاركة",savedSuccessfully:"تم حفظ الإعدادات بنجاح!",saveFailed:"حدث خطأ أثناء حفظ الإعدادات.",connectionStatusUpdated:"تم تحديث حالة الاتصال.",networkError:"تعذر الاتصال بالخادم.",loading:"جارٍ التحميل...",aiAssistantDesc:"وكيل ذكي متعدد الأدوات مع ذاكرة طويلة الأمد",settingsSub:"البادئة، التأخير، الخدمات، والأمان",editAliases:"تعديل الأسماء المستعارة",aliasesFor:"الأسماء المستعارة لـ",addAlias:"إضافة اسم مستعار",newAliasPlaceholder:"اكتب اسماً جديداً...",noAliases:"لا توجد أسماء مستعارة",aliasesHelp:"الأسماء المستعارة تتيح استدعاء هذا الأمر بأسماء بديلة (مثل: p بدلاً من ping).",aliasAlreadyAdded:"هذا الاسم المستعار مضاف بالفعل",aliasScriptArabic:"اسم مستعار بالعربية",aliasScriptLatin:"اسم مستعار بالإنجليزية",commandsSub:"إدارة رتب الأوامر والأسماء المستعارة وتفعيلها أو تعطيلها مباشرة",editPrefixHint:"اضغط لتعديل البادئة",usage:"الاستخدام",usageHint:"الأمر كما يُرسل في واتساب",noMatchingCommands:"لا توجد أوامر مطابقة لبحثك.",commandEnabled:"تم تفعيل الأمر '{name}'",commandDisabled:"تم تعطيل الأمر '{name}'",permissionUpdated:"تم تحديث رتبة '{name}'",scopeAll:"الكل",scopeGroup:"المجموعات",scopePrivate:"خاص",permMembers:"الجميع (الأعضاء)",permAdminsOnly:"مشرفو المجموعة",permAdminsOwner:"مشرفو المجموعة أو المالك",permOwnerOnly:"مالك البوت فقط",selectRecipient:"اختر المحادثة المستهدفة",searchRecipients:"ابحث بالاسم أو رقم الهاتف...",recipients:"المستلمون",chooseChat:"اختر جهة اتصال أو مجموعة...",noRecipientsFound:"لم يتم العثور على محادثات",pickPhoneContact:"من دليل الهاتف",pickPhoneContactHint:"اختر جهة اتصال من هاتف أندرويد",maxSchedulesReached:"تم بلوغ الحد الأقصى (3 رسائل مجدولة)",limitReached:"الحد الأقصى مكتمل",scheduleType:"نوع الجدولة",scheduleRecurring:"دوري متكرر",scheduleOnce:"مرة واحدة (تاريخ ووقت محدد)",repeat:"التكرار",repeatDaily:"كل يوم",repeatWeekly:"كل أسبوع",repeatMonthly:"كل شهر",repeatHourly:"كل عدد من الساعات",weekdays:"أيام الأسبوع",dayOfMonth:"يوم الشهر",monthDayHint:"إذا كان الشهر أقصر من اليوم المختار (مثل 31 في فبراير) تُتخطى تلك المرة.",everyHours:"كل كم ساعة",atMinute:"عند الدقيقة",sendTime:"وقت الإرسال",deliveryDateTime:"موعد وتاريخ الإرسال",timezoneLabel:"المنطقة الزمنية",recurrencePreview:"المعاينة",weekdaySun:"الأحد",weekdayMon:"الاثنين",weekdayTue:"الثلاثاء",weekdayWed:"الأربعاء",weekdayThu:"الخميس",weekdayFri:"الجمعة",weekdaySat:"السبت",contactFallback:"جهة اتصال",groupFallback:"مجموعة",hoursUnit:"ساعة",messageText:"نص الرسالة",messagePlaceholder:"اكتب الرسالة التي سيتم إرسالها تلقائياً...",scheduleAction:"جدولة الرسالة",scheduledCount:"مجدول",headerSubtitle:"إرسال دوري ومحدد بالوقت",noSchedules:"لا توجد رسائل مجدولة حالياً.",typeRecurring:"متكرر",typeOnce:"مرة واحدة",deliveryFailed:"فشل الإرسال",deliveryActive:"نشط",changeChat:"تغيير المحادثة",weekdayRequired:"اختر يوماً واحداً على الأقل",tabIntegrations:"الربط والخدمات",integrationsDesc:"مفاتيح واجهات البرمجة (API) للخدمات الخارجية المرتبطة بالبوت",youtubeApiKey:"مفتاح YouTube Data API (اختياري)",selectModel:"اختر نموذجاً من القائمة...",availableModels:"النماذج المتاحة من المزود",customModel:"أو اكتب اسم نموذج مخصص",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",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:"عدد الملصقات التي يمكن لكل شخص الاحتفاظ بها في استوديو الملصقات.",stickerUploadInfo:"{kind} · {size} كيلوبايت",stickerRemoveHint:"تُطبّق إزالة الخلفية المسطحة عند الإنشاء.",stickerSelect:"تحديد الملصق",stickerOpen:"فتح تفاصيل الملصق",stickerShareSaved:"حُفظ الملف في {dir}",stickerDrag:"اسحب ملفًا إلى هنا أو اختره",stickerAlignmentStart:"البداية",stickerAlignmentCenter:"الوسط",stickerAlignmentEnd:"النهاية",stickerKindImage:"صورة",stickerKindGif:"صورة متحركة",stickerKindVideo:"فيديو",stickerKindWebp:"ملصق WebP",stickerDeletePackWarning:"سيُحذف الملصق من جميع الحزم.",stickerSendLimit:"يمكن إرسال عدد محدود من الملصقات دفعة واحدة.",stickerExportLimit:"اختر عددًا أقل من الملصقات للتصدير.",tolerance:"نسبة التسامح",stickerName:"اسم الملصق",stickerNamePlaceholder:"اسم اختياري…",trimStart:"البداية",trimDuration:"المدة",trimSeconds:"ثوانٍ",textContent:"النص",textSize:"الحجم",textColor:"اللون",textAlignment:"المحاذاة",textOutline:"إطار",textBackground:"خلفية النص",layerRotation:"الدوران",deleteLayer:"حذف الطبقة",noLayers:"لا توجد طبقات",reorderUp:"تقديم",reorderDown:"تأخير",renamePack:"تغيير اسم الحزمة",deletePack:"حذف الحزمة",packEmpty:"هذه الحزمة فارغة",noPacks:"لا توجد حزم بعد",createFirstPack:"أنشئ حزمتك الأولى",stickerCount:"{n} ملصقات",notConnectedHint:"اتصل بواتساب أولاً",exportFirstFrame:"يصدّر الإطار الأول",downloadWebp:"تحميل WebP",downloadPng:"تحميل PNG",downloadGif:"تحميل GIF",reorderDragHint:"اسحب لإعادة الترتيب",saved:"تم الحفظ",createBtn:"إنشاء ملصق",uploadHint:"يقبل JPEG، PNG، WebP، GIF، MP4، WebM",stickerCreated:"تم إنشاء الملصق!",stickerSent:"تم إرسال الملصق",stickersSent:"تم إرسال الملصقات",stickerPreview:"معاينة الملصق",firstFrameHint:"يُصدَّر الملصق المتحرك كصورة ثابتة من إطاره الأول.",gifOnlyAnimated:"تصدير GIF متاح للملصقات المتحركة فقط.",rename:"إعادة التسمية",inUsePacksLabel:"في هذه الحزم",notInPack:"ليس في أي حزمة",retryLoad:"إعادة المحاولة",showingCount:"يُعرض {shown} من {total}",emojiPaletteLabel:"الرموز التعبيرية",customEmoji:"رمز آخر",emojiInputLabel:"اكتب رمزًا تعبيريًا",textPlaceholder:"نص",layerSelected:"الطبقة المحددة",selectVisible:"تحديد الظاهر",downloadZip:"تنزيل ملف مضغوط",noRecipients:"لا توجد محادثات",recipientGroup:"مجموعة",recipientContact:"جهة اتصال",sending:"جارٍ الإرسال…",deleteStickersTitle:"حذف الملصقات",inUseBody:"هذا الملصق داخل حزمة. حذفه يزيله من تلك الحزم أيضًا.",inUseBulkBody:"بعض الملصقات المحددة موجودة في حزم، ولم تُحذف.",deleteEverywhereHint:"الحذف من كل مكان يزيل الملصقات من جميع الحزم ومن المكتبة.",packNameLength:"يجب أن يكون اسم الحزمة بين حرف واحد و40 حرفًا.",newPackPlaceholder:"اسم الحزمة",createPack:"إنشاء حزمة",skippedOther:"تعذّر تحديث بعض الملصقات.",addedToPack:"أُضيف إلى الحزمة",movedToPack:"نُقل إلى الحزمة",removedFromPack:"أُزيل من الحزمة",renamed:"تم تحديث الاسم",downloaded:"بدأ التنزيل",shareDone:"تمت المشاركة",backToPacks:"كل الحزم",confirmMerge:"دمج الحزم",mergeTitle:"دمج في حزمة أخرى",mergeConfirmBody:"تبقى الملصقات في المكتبة. تُلحَق عناصر هذه الحزمة بالحزمة الأخرى، ويُتخطى المكرر، ثم تُحذف هذه الحزمة.",trimApplied:"يُطبَّق الاقتطاع عند إنشاء الملصق.",gifTrimNote:"يُطبَّق اقتطاع الصورة المتحركة عند الإنشاء، وقد لا يطابق المعاينة إطارًا بإطار.",animatedUnavailable:"هذا الخادم لا يستطيع ترميز الملصقات المتحركة.",targetPack:"إضافة إلى حزمة",previewStage:"معاينة الملصق",rotateQuarter:"تدوير 90 درجة",uploadReady:"الملف جاهز",stickerNameTooLong:"يمكن أن يبلغ اسم الملصق 60 حرفًا كحد أقصى.",noDestinationPack:"اختر حزمة للدمج فيها.",deletePackTitle:"حذف الحزمة",openPack:"فتح الحزمة",searchStickers:"البحث في الملصقات",sortBy:"الترتيب",filterBy:"التصفية",packFilter:"الحزمة",noResults:"لا توجد ملصقات مطابقة للبحث",favoritesEmpty:"لا توجد ملصقات مفضلة بعد",recentEmpty:"لا توجد ملصقات استُخدمت أو أُنشئت خلال آخر 30 يومًا",favoriteBadge:"مفضلة",deleted:"تم الحذف"},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...",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",refresh:"Refresh",logout:"Sign Out",backToApp:"Back to app",close:"Close",copy:"Copy",copied:"Copied!",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",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",baseUrl:"Base URL",maxToolSteps:"Max Tool Steps",googleSearch:"Built-in Google Search Grounding",personaPrompt:"AI Persona System Prompt",personaDesc:"Edit the live system prompt that shapes your AI assistant's persona, tone, and behavior.",editPersona:"Edit System Prompt",memoryFiles:"Long-term Memory",memoryDesc:"The bot's durable memory. Global memory is shared by every chat; each chat also has its own file. The bot reads saved entries and any free-form text you write.",manageMemory:"Manage Memory Files",memoryGlobalScope:"Global memory",memoryGlobalScopeHint:"Injected into every chat",memoryChatScopeHint:"Injected into this chat only",memoryEntriesCount:"{n} saved entries",memoryProseHint:"Everything in this file reaches the bot: lines starting with '-' are separate entries it can add or forget, and free-form text is included verbatim.",memoryEditorPlaceholder:"Write anything you want the bot to remember for good…",aiInspector:"AI Conversation Inspector",aiInspectorDesc:"Read-only view of each chat's stored conversation context: replies, media references and tool usage.",openInspector:"Open Inspector",noConversations:"No stored conversations yet.",convTurns:"{n} parts",backToList:"Back to list",convTruncated:"Showing only the latest 200 parts.",convMedia:"media file",capabilities:"Capabilities & Toggles",modelsAvailableLive:"Models Available for Your Account (Live API Verified)",modelsRecommendedSeed:"Recommended / Known Models (Catalog)",connectKeyFirstPrompt:"Please connect your API key first to discover models available to your account",refreshModels:"Refresh Models",refreshing:"Refreshing...",fetchModels:"Fetch Available Models",fetchingModels:"Discovering models...",capVision:"Vision",capStt:"Speech",capAudio:"Audio in",capText:"Text",capPdf:"PDF",capVideo:"Video",supported:"Supported",unsupported:"Unsupported",sourceLive:"Your account",sourceSeed:"Catalog",sourceUnknown:"Unknown",visionUnsupportedNotice:"The selected model does not support Vision (image understanding). Feature disabled automatically.",sttUnsupportedNotice:"The selected model does not support Speech-to-Text (STT). Feature disabled automatically.",aiSttEnabled:"Enable Speech-to-Text (STT)",aiSttEnabledDesc:"Audio transcription and voice note understanding using the active model",providerGemini:"Google Gemini",providerGeminiDesc:"Default provider with native Google Search, Files upload, and Multimodal support",providerGroq:"Groq Cloud",providerGroqDesc:"Ultra-fast inference for Llama 3 & Mixtral models with Vision support",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"For GPT-4o models or any OpenAI-compatible API gateway",providerOllama:"Ollama (Local)",providerOllamaDesc:"Run local open-source models completely offline on your own machine",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"For Claude 3.5 Sonnet advanced reasoning models",scanQrHint:"Open WhatsApp on your phone > Settings > Linked Devices > Link a Device, and scan the QR code below.",pairingCode:"Pairing Code",reconnectingSoon:"Reconnecting soon...",nextAttemptIn:"Next attempt in",seconds:"seconds",tabGeneral:"General & Prefix",tabAI:"AI Assistant",tabSecurity:"Security & Access",tabProxy:"WhatsApp Proxy",tabStorage:"Storage & Media",tabLogs:"System Logs",prefixTitle:"Bot Command Prefix",prefixDesc:"The leading character or symbol that triggers commands in WhatsApp chats (e.g. !help, /ping)",prefixPlaceholder:"e.g. !",prefixPresets:"Common Quick Presets:",prefixPreview:"Live Command Syntax Preview:",prefixSaveBtn:"Save New Prefix",prefixUpdated:"Command prefix updated successfully!",prefixValidation:"Prefix must be 1 to 3 characters long",activePrefix:"Active Prefix",changePrefix:"Change Prefix",prefix:"Command Prefix",botTimezone:"Timezone",botTimezoneDesc:"IANA timezone used for prayer times, AI context, and cron schedules (e.g. Africa/Cairo)",botMinDelay:"Min Human Delay (ms)",botMaxDelay:"Max Human Delay (ms)",delaysDesc:"Simulated human typing pause before replying to avoid robotic triggers",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.",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:"Instantly toggle between Arabic (RTL) and English (LTR)",botPort:"Control Panel Port",botPortHint:"* Changing port takes effect on next process restart",searchPlaceholder:"Search commands or aliases...",thCommand:"Command",thAliases:"Aliases",thDescription:"Description",thScope:"Scope",thRequiredRole:"Required Role",thStatus:"Status",thGroupName:"Group Name",thGroupJid:"Group JID",thMembers:"Members",thAntiLink:"Anti-Link",thMedia:"Media",thWelcome:"Welcome",thTarget:"Target",thMessage:"Message",thSchedule:"Schedule",thType:"Type",thDelivery:"Delivery Status",thActions:"Actions",scheduleNewMsg:"Schedule New Message",liveServerLogs:"Live Server Logs",clearLogs:"Clear Logs",allLogs:"All Levels",noLogs:"No log entries to display.",logSourceBot:"Bot",logSourceHost:"Android host",shareLogs:"Share logs",share:"Share",savedSuccessfully:"Settings saved successfully!",saveFailed:"Failed to save settings.",connectionStatusUpdated:"Connection status updated.",networkError:"Network error connecting to server.",loading:"Loading...",aiAssistantDesc:"Autonomous tool-calling AI agent with long-term memory",settingsSub:"Prefix, delays, integrations, & security",editAliases:"Edit Aliases",aliasesFor:"Aliases for",addAlias:"Add Alias",newAliasPlaceholder:"Type new alias...",noAliases:"No custom aliases",aliasesHelp:"Aliases allow invoking this command using alternative names.",aliasAlreadyAdded:"Alias already added",aliasScriptArabic:"Arabic alias",aliasScriptLatin:"Latin alias",commandsSub:"Manage role permissions, edit aliases, or enable/disable bot commands live",editPrefixHint:"Click to change prefix",usage:"Usage",usageHint:"The command as it is sent in WhatsApp",noMatchingCommands:"No commands match your search.",commandEnabled:"Command '{name}' enabled",commandDisabled:"Command '{name}' disabled",permissionUpdated:"Permission for '{name}' updated",scopeAll:"All",scopeGroup:"Group",scopePrivate:"Private",permMembers:"Members (Everyone)",permAdminsOnly:"Group Admins",permAdminsOwner:"Group Admins or Owner",permOwnerOnly:"Bot Owner Only",selectRecipient:"Select Target Chat",searchRecipients:"Search by name or phone...",recipients:"Recipients",chooseChat:"Choose a contact or group...",noRecipientsFound:"No matching chats found",pickPhoneContact:"From phone book",pickPhoneContactHint:"Pick a contact from this Android phone",maxSchedulesReached:"Maximum limit reached (3 scheduled messages)",limitReached:"Limit Reached",scheduleType:"Schedule Type",scheduleRecurring:"Recurring",scheduleOnce:"One-Off (Specific Date & Time)",repeat:"Repeat",repeatDaily:"Every day",repeatWeekly:"Every week",repeatMonthly:"Every month",repeatHourly:"Every N hours",weekdays:"Weekdays",dayOfMonth:"Day of month",monthDayHint:"If the month is shorter than the chosen day (for example 31 in February), that month is skipped.",everyHours:"Every how many hours",atMinute:"At minute",sendTime:"Send time",deliveryDateTime:"Delivery Date & Time",timezoneLabel:"Timezone",recurrencePreview:"Preview",weekdaySun:"Sun",weekdayMon:"Mon",weekdayTue:"Tue",weekdayWed:"Wed",weekdayThu:"Thu",weekdayFri:"Fri",weekdaySat:"Sat",contactFallback:"Contact",groupFallback:"Group",hoursUnit:"hours",messageText:"Message Text",messagePlaceholder:"Message to be sent automatically...",scheduleAction:"Schedule",scheduledCount:"scheduled",headerSubtitle:"Recurring and one-off automated message deliveries",noSchedules:"No active schedules found.",typeRecurring:"Recurring",typeOnce:"Once",deliveryFailed:"Failed",deliveryActive:"Active",changeChat:"Change chat",weekdayRequired:"Select at least one weekday",tabIntegrations:"Integrations",integrationsDesc:"API keys for external services connected to the bot",youtubeApiKey:"YouTube Data API Key (Optional)",selectModel:"Select a model from list...",availableModels:"Models Available from Provider",customModel:"Or type a custom model name",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, 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:"فتح Issue على GitHub",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.",stickerUploadInfo:"{kind} · {size} KB",stickerRemoveHint:"Flat background removal is applied when you create the sticker.",stickerSelect:"Select sticker",stickerOpen:"Open sticker details",stickerShareSaved:"Saved to {dir}",stickerDrag:"Drop a file here or choose one",stickerAlignmentStart:"Start",stickerAlignmentCenter:"Center",stickerAlignmentEnd:"End",stickerKindImage:"Image",stickerKindGif:"GIF",stickerKindVideo:"Video",stickerKindWebp:"WebP sticker",stickerDeletePackWarning:"The sticker will be removed from every pack.",stickerSendLimit:"Only a limited number of stickers can be sent at once.",stickerExportLimit:"Select fewer stickers to export.",tolerance:"Tolerance",stickerName:"Sticker name",stickerNamePlaceholder:"Optional name…",trimStart:"Start",trimDuration:"Duration",trimSeconds:"seconds",textContent:"Text",textSize:"Size",textColor:"Color",textAlignment:"Alignment",textOutline:"Outline",textBackground:"Background pill",layerRotation:"Rotation",deleteLayer:"Delete layer",noLayers:"No overlay layers",reorderUp:"Move earlier",reorderDown:"Move later",renamePack:"Rename pack",deletePack:"Delete pack",packEmpty:"This pack is empty",noPacks:"No packs yet",createFirstPack:"Create your first pack",stickerCount:"{n} stickers",notConnectedHint:"Connect WhatsApp first",exportFirstFrame:"Exports the first frame",downloadWebp:"Download WebP",downloadPng:"Download PNG",downloadGif:"Download GIF",reorderDragHint:"Drag to reorder",saved:"Saved",createBtn:"Create sticker",uploadHint:"Accepts JPEG, PNG, WebP, GIF, MP4, WebM",stickerCreated:"Sticker created!",stickerSent:"Sticker sent",stickersSent:"Stickers sent",stickerPreview:"Sticker preview",firstFrameHint:"An animated sticker exports its first frame as a still image.",gifOnlyAnimated:"GIF export is only available for animated stickers.",rename:"Rename",inUsePacksLabel:"In these packs",notInPack:"Not in any pack",retryLoad:"Try again",showingCount:"Showing {shown} of {total}",emojiPaletteLabel:"Emoji",customEmoji:"Other emoji",emojiInputLabel:"Type an emoji",textPlaceholder:"Text",layerSelected:"Selected layer",selectVisible:"Select visible",downloadZip:"Download ZIP",noRecipients:"No chats found",recipientGroup:"Group",recipientContact:"Contact",sending:"Sending…",deleteStickersTitle:"Delete stickers",inUseBody:"This sticker is in a pack. Deleting it removes it from those packs too.",inUseBulkBody:"Some selected stickers are in packs. They were not deleted.",deleteEverywhereHint:"Delete everywhere removes the stickers from every pack and from the library.",packNameLength:"A pack name must be between 1 and 40 characters.",newPackPlaceholder:"Pack name",createPack:"Create pack",skippedOther:"Some stickers could not be updated.",addedToPack:"Added to the pack",movedToPack:"Moved to the pack",removedFromPack:"Removed from the pack",renamed:"Name updated",downloaded:"Download started",shareDone:"Shared",backToPacks:"All packs",confirmMerge:"Merge packs",mergeTitle:"Merge into another pack",mergeConfirmBody:"Stickers stay in the library. Items from this pack are appended to the other pack, duplicates are skipped, and this pack is then deleted.",trimApplied:"The trim is applied when the sticker is created.",gifTrimNote:"GIF trim is applied on create and may not match the preview frame for frame.",animatedUnavailable:"This server cannot encode animated stickers.",targetPack:"Add to pack",previewStage:"Sticker preview",rotateQuarter:"Rotate 90 degrees",uploadReady:"File ready",stickerNameTooLong:"A sticker name can be at most 60 characters.",noDestinationPack:"Choose a pack to merge into.",deletePackTitle:"Delete pack",openPack:"Open pack",searchStickers:"Search stickers",sortBy:"Sort",filterBy:"Filter",packFilter:"Pack",noResults:"No stickers match this search",favoritesEmpty:"No favorite stickers yet",recentEmpty:"No stickers used or created in the last 30 days",favoriteBadge:"Favorite",deleted:"Deleted"}},G0=w.createContext(null),HN=({children:l})=>{const[i,c]=w.useState(()=>{const h=localStorage.getItem("levix_lang");return h==="ar"||h==="en"?h:navigator.language.startsWith("ar")?"ar":"en"}),o=i==="ar"?"rtl":"ltr";w.useEffect(()=>{localStorage.setItem("levix_lang",i),document.documentElement.lang=i,document.documentElement.dir=o},[i,o]);const d=h=>{c(h)},f=w.useMemo(()=>(h,p)=>(Nd[i]||Nd.en)[h]??Nd.en[h]??p??String(h),[i]);return s.jsx(G0.Provider,{value:{language:i,direction:o,setLanguage:d,t:f},children:l})},at=()=>{const l=w.useContext(G0);if(!l)throw new Error("useI18n must be used within an I18nProvider");return l},qN=({onToggleMobileMenu:l,title:i,status:c})=>{var O;const{language:o,setLanguage:d,t:f}=at(),[h,p]=yi.useState(!1),x=yi.useRef(null);yi.useEffect(()=>{if(!h)return;const C=A=>{x.current&&!x.current.contains(A.target)&&p(!1)},E=A=>{A.key==="Escape"&&p(!1)};return document.addEventListener("mousedown",C),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",E)}},[h]);const[N,y]=yi.useState(()=>{const C=localStorage.getItem("levix_theme");return C?(document.documentElement.setAttribute("data-theme",C),C):document.documentElement.getAttribute("data-theme")||"dark"}),b=()=>{const C=N==="dark"?"light":"dark";y(C),document.documentElement.setAttribute("data-theme",C),localStorage.setItem("levix_theme",C)},S=typeof((O=window.LevixHost)==null?void 0:O.closePanel)=="function";return s.jsxs("header",{className:"h-16 sticky top-0 z-30 flex items-center justify-between px-4 md:px-6 bg-panel/85 backdrop-blur-md border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[S&&s.jsx("button",{type:"button",onClick:()=>window.LevixHost.closePanel(),className:"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",title:f("backToApp"),"aria-label":f("backToApp"),children:s.jsx(eN,{size:20,className:"rtl:-scale-x-100 transition-transform"})}),s.jsx("button",{type:"button",onClick:l,className:"inline-flex md:hidden items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",id:"mobile-menu-btn","aria-label":"Open navigation menu",children:s.jsx(wN,{size:20})}),s.jsx("h1",{className:"text-lg md:text-xl font-bold tracking-tight text-text-main truncate",title:i,children:i})]}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[s.jsxs("div",{className:"relative",ref:x,children:[s.jsx("button",{type:"button",onClick:()=>p(C=>!C),className:"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",title:f("chooseLanguage","Choose Language"),"aria-label":f("chooseLanguage","Choose Language"),"aria-expanded":h,"aria-haspopup":"true",id:"btn-header-lang",children:s.jsx(Ei,{size:18,className:"text-brand-cyan"})}),h&&s.jsxs("div",{role:"menu","aria-orientation":"vertical","aria-labelledby":"btn-header-lang",className:"absolute end-0 mt-2 w-48 rounded-2xl border border-line bg-panel-solid shadow-2xl p-1.5 z-50 ring-1 ring-black/10 animate-in fade-in zoom-in-95 duration-150",children:[s.jsx("div",{className:"px-2.5 py-1.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider",children:f("chooseLanguage","Choose Language")}),s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{d("ar"),p(!1)},className:`w-full flex items-center justify-between px-3 py-2 text-xs md:text-sm font-medium rounded-lg transition-colors ${o==="ar"?"bg-brand-blue/15 text-brand-cyan font-bold":"text-text-main hover:bg-panel-hover"}`,children:[s.jsx("span",{children:"العربية"}),o==="ar"&&s.jsx(_i,{size:16,className:"text-brand-cyan"})]}),s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{d("en"),p(!1)},className:`w-full flex items-center justify-between px-3 py-2 text-xs md:text-sm font-medium rounded-lg transition-colors ${o==="en"?"bg-brand-blue/15 text-brand-cyan font-bold":"text-text-main hover:bg-panel-hover"}`,children:[s.jsx("span",{children:"English"}),o==="en"&&s.jsx(_i,{size:16,className:"text-brand-cyan"})]})]})]}),s.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",title:"Toggle Theme","aria-label":"Toggle dark/light theme",children:N==="dark"?s.jsx(RN,{size:18}):s.jsx(EN,{size:18})}),s.jsx("form",{action:"/logout",method:"POST",className:"m-0",children:s.jsx("button",{type:"submit",className:"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-danger/15 hover:border-danger/40 hover:text-danger text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-danger/50",title:f("logout"),"aria-label":"Sign out",children:s.jsx(jN,{size:18,className:"rtl:-scale-x-100 transition-transform"})})})]})]})};function P0(l){var i,c,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var d=l.length;for(i=0;i<d;i++)l[i]&&(c=P0(l[i]))&&(o&&(o+=" "),o+=c)}else for(c in l)l[c]&&(o&&(o+=" "),o+=c);return o}function GN(){for(var l,i,c=0,o="",d=arguments.length;c<d;c++)(l=arguments[c])&&(i=P0(l))&&(o&&(o+=" "),o+=i);return o}const PN=(l,i)=>{const c=new Array(l.length+i.length);for(let o=0;o<l.length;o++)c[o]=l[o];for(let o=0;o<i.length;o++)c[l.length+o]=i[o];return c},VN=(l,i)=>({classGroupId:l,validator:i}),V0=(l=new Map,i=null,c)=>({nextPart:l,validators:i,classGroupId:c}),_o="-",bg=[],YN="arbitrary..",IN=l=>{const i=QN(l),{conflictingClassGroups:c,conflictingClassGroupModifiers:o}=l;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return KN(h);const p=h.split(_o),x=p[0]===""&&p.length>1?1:0;return Y0(p,x,i)},getConflictingClassGroupIds:(h,p)=>{if(p){const x=o[h],N=c[h];return x?N?PN(N,x):x:N||bg}return c[h]||bg}}},Y0=(l,i,c)=>{if(l.length-i===0)return c.classGroupId;const d=l[i],f=c.nextPart.get(d);if(f){const N=Y0(l,i+1,f);if(N)return N}const h=c.validators;if(h===null)return;const p=i===0?l.join(_o):l.slice(i).join(_o),x=h.length;for(let N=0;N<x;N++){const y=h[N];if(y.validator(p))return y.classGroupId}},KN=l=>l.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=l.slice(1,-1),c=i.indexOf(":"),o=i.slice(0,c);return o?YN+o:void 0})(),QN=l=>{const{theme:i,classGroups:c}=l;return XN(c,i)},XN=(l,i)=>{const c=V0();for(const o in l){const d=l[o];wf(d,c,o,i)}return c},wf=(l,i,c,o)=>{const d=l.length;for(let f=0;f<d;f++){const h=l[f];FN(h,i,c,o)}},FN=(l,i,c,o)=>{if(typeof l=="string"){ZN(l,i,c);return}if(typeof l=="function"){JN(l,i,c,o);return}$N(l,i,c,o)},ZN=(l,i,c)=>{const o=l===""?i:I0(i,l);o.classGroupId=c},JN=(l,i,c,o)=>{if(WN(l)){wf(l(o),i,c,o);return}i.validators===null&&(i.validators=[]),i.validators.push(VN(c,l))},$N=(l,i,c,o)=>{const d=Object.entries(l),f=d.length;for(let h=0;h<f;h++){const[p,x]=d[h];wf(x,I0(i,p),c,o)}},I0=(l,i)=>{let c=l;const o=i.split(_o),d=o.length;for(let f=0;f<d;f++){const h=o[f];let p=c.nextPart.get(h);p||(p=V0(),c.nextPart.set(h,p)),c=p}return c},WN=l=>"isThemeGetter"in l&&l.isThemeGetter===!0,eS=l=>{if(l<1)return{get:()=>{},set:()=>{}};let i=0,c=Object.create(null),o=Object.create(null);const d=(f,h)=>{c[f]=h,i++,i>l&&(i=0,o=c,c=Object.create(null))};return{get(f){let h=c[f];if(h!==void 0)return h;if((h=o[f])!==void 0)return d(f,h),h},set(f,h){f in c?c[f]=h:d(f,h)}}},of="!",yg=":",tS=[],vg=(l,i,c,o,d)=>({modifiers:l,hasImportantModifier:i,baseClassName:c,maybePostfixModifierPosition:o,isExternal:d}),nS=l=>{const{prefix:i,experimentalParseClassName:c}=l;let o=d=>{const f=[];let h=0,p=0,x=0,N;const y=d.length;for(let E=0;E<y;E++){const A=d[E];if(h===0&&p===0){if(A===yg){f.push(d.slice(x,E)),x=E+1;continue}if(A==="/"){N=E;continue}}A==="["?h++:A==="]"?h--:A==="("?p++:A===")"&&p--}const b=f.length===0?d:d.slice(x);let S=b,O=!1;b.endsWith(of)?(S=b.slice(0,-1),O=!0):b.startsWith(of)&&(S=b.slice(1),O=!0);const C=N&&N>x?N-x:void 0;return vg(f,O,S,C)};if(i){const d=i+yg,f=o;o=h=>h.startsWith(d)?f(h.slice(d.length)):vg(tS,!1,h,void 0,!0)}if(c){const d=o;o=f=>c({className:f,parseClassName:d})}return o},aS=l=>{const i=new Map;return l.orderSensitiveModifiers.forEach((c,o)=>{i.set(c,1e6+o)}),c=>{const o=[];let d=[];for(let f=0;f<c.length;f++){const h=c[f],p=h[0]==="[",x=i.has(h);p||x?(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}},lS=l=>({cache:eS(l.cacheSize),parseClassName:nS(l),sortModifiers:aS(l),postfixLookupClassGroupIds:sS(l),...IN(l)}),sS=l=>{const i=Object.create(null),c=l.postfixLookupClassGroups;if(c)for(let o=0;o<c.length;o++)i[c[o]]=!0;return i},iS=/\s+/,rS=(l,i)=>{const{parseClassName:c,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:h}=i,p=[],x=l.trim().split(iS);let N="";for(let y=x.length-1;y>=0;y-=1){const b=x[y],{isExternal:S,modifiers:O,hasImportantModifier:C,baseClassName:E,maybePostfixModifierPosition:A}=c(b);if(S){N=b+(N.length>0?" "+N:N);continue}let M=!!A,q;if(M){const _=E.substring(0,A);q=o(_);const j=q&&h[q]?o(E):void 0;j&&j!==q&&(q=j,M=!1)}else q=o(E);if(!q){if(!M){N=b+(N.length>0?" "+N:N);continue}if(q=o(E),!q){N=b+(N.length>0?" "+N:N);continue}M=!1}const te=O.length===0?"":O.length===1?O[0]:f(O).join(":"),Z=C?te+of:te,ie=Z+q;if(p.indexOf(ie)>-1)continue;p.push(ie);const J=d(q,M);for(let _=0;_<J.length;++_){const j=J[_];p.push(Z+j)}N=b+(N.length>0?" "+N:N)}return N},oS=(...l)=>{let i=0,c,o,d="";for(;i<l.length;)(c=l[i++])&&(o=K0(c))&&(d&&(d+=" "),d+=o);return d},K0=l=>{if(typeof l=="string")return l;let i,c="";for(let o=0;o<l.length;o++)l[o]&&(i=K0(l[o]))&&(c&&(c+=" "),c+=i);return c},cS=(l,...i)=>{let c,o,d,f;const h=x=>{const N=i.reduce((y,b)=>b(y),l());return c=lS(N),o=c.cache.get,d=c.cache.set,f=p,p(x)},p=x=>{const N=o(x);if(N)return N;const y=rS(x,c);return d(x,y),y};return f=h,(...x)=>f(oS(...x))},uS=[],_t=l=>{const i=c=>c[l]||uS;return i.isThemeGetter=!0,i.themeKey=l,i},Q0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,X0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dS=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mS=/\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$/,hS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,pS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pa=l=>dS.test(l),qe=l=>!!l&&!Number.isNaN(Number(l)),Vn=l=>!!l&&Number.isInteger(Number(l)),Sd=l=>l.endsWith("%")&&qe(l.slice(0,-1)),ua=l=>fS.test(l),F0=()=>!0,gS=l=>mS.test(l)&&!hS.test(l),kf=()=>!1,bS=l=>pS.test(l),yS=l=>xS.test(l),vS=l=>!be(l)&&!ye(l),NS=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),SS=l=>Qa(l,$0,kf),be=l=>Q0.test(l),yl=l=>Qa(l,W0,gS),Ng=l=>Qa(l,AS,qe),jS=l=>Qa(l,ty,F0),wS=l=>Qa(l,ey,kf),Sg=l=>Qa(l,Z0,kf),kS=l=>Qa(l,J0,yS),io=l=>Qa(l,ny,bS),ye=l=>X0.test(l),xi=l=>Nl(l,W0),_S=l=>Nl(l,ey),jg=l=>Nl(l,Z0),ES=l=>Nl(l,$0),CS=l=>Nl(l,J0),ro=l=>Nl(l,ny,!0),TS=l=>Nl(l,ty,!0),Qa=(l,i,c)=>{const o=Q0.exec(l);return o?o[1]?i(o[1]):c(o[2]):!1},Nl=(l,i,c=!1)=>{const o=X0.exec(l);return o?o[1]?i(o[1]):c:!1},Z0=l=>l==="position"||l==="percentage",J0=l=>l==="image"||l==="url",$0=l=>l==="length"||l==="size"||l==="bg-size",W0=l=>l==="length",AS=l=>l==="number",ey=l=>l==="family-name",ty=l=>l==="number"||l==="weight",ny=l=>l==="shadow",zS=()=>{const l=_t("color"),i=_t("font"),c=_t("text"),o=_t("font-weight"),d=_t("tracking"),f=_t("leading"),h=_t("breakpoint"),p=_t("container"),x=_t("spacing"),N=_t("radius"),y=_t("shadow"),b=_t("inset-shadow"),S=_t("text-shadow"),O=_t("drop-shadow"),C=_t("blur"),E=_t("perspective"),A=_t("aspect"),M=_t("ease"),q=_t("animate"),te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ie=()=>[...Z(),ye,be],J=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],j=()=>[ye,be,x],I=()=>[Pa,"full","auto",...j()],Q=()=>[Vn,"none","subgrid",ye,be],se=()=>["auto",{span:["full",Vn,ye,be]},Vn,ye,be],ce=()=>[Vn,"auto",ye,be],oe=()=>["auto","min","max","fr",ye,be],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Pa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],ue=()=>[p,Pa,"screen","full","dvw","lvw","svw","min","max","fit",...j()],je=()=>[Pa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],H=()=>[l,ye,be],re=()=>[...Z(),jg,Sg,{position:[ye,be]}],Ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ke=()=>["auto","cover","contain",ES,SS,{size:[ye,be]}],v=()=>[Sd,xi,yl],T=()=>["","none","full",N,ye,be],ne=()=>["",qe,xi,yl],le=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[qe,Sd,jg,Sg],we=()=>["","none",C,ye,be],fe=()=>["none",qe,ye,be],pe=()=>["none",qe,ye,be],dt=()=>[qe,ye,be],ee=()=>[Pa,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ua],breakpoint:[ua],color:[F0],container:[ua],"drop-shadow":[ua],ease:["in","out","in-out"],font:[vS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ua],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ua],shadow:[ua],spacing:["px",qe],text:[ua],"text-shadow":[ua],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pa,be,ye,A]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,be]}],"container-named":[NS],columns:[{columns:[qe,"auto",be,ye,p]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:ie()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Vn,"auto",ye,be]}],basis:[{basis:[Pa,"full","auto",p,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Pa,"auto","initial","none",be]}],grow:[{grow:["",qe,ye,be]}],shrink:[{shrink:["",qe,ye,be]}],order:[{order:[Vn,"first","last","none",ye,be]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[p,"screen",...X()]}],"min-w":[{"min-w":[p,"screen","none",...X()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[h]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh","none",...X()]}],"font-size":[{text:["base",c,xi,yl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,TS,jS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sd,be]}],"font-family":[{font:[_S,wS,i]}],"font-features":[{"font-features":[be]}],"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,ye,be]}],"line-clamp":[{"line-clamp":[qe,"none",ye,Ng]}],leading:[{leading:["none",f,...j()]}],"list-image":[{"list-image":["none",ye,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",ye,yl]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",ye,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Vn,ye,be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,be]}],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",ye,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:Ae()}],"bg-size":[{bg:ke()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vn,ye,be],radial:["",ye,be],conic:["",Vn,ye,be]},CS,kS]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:v()}],"gradient-via-pos":[{via:v()}],"gradient-to-pos":[{to:v()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,ye,be]}],"outline-w":[{outline:["",qe,xi,yl]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","inner","none",y,ro,io]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",b,ro,io]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,yl]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",S,ro,io]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,ye,be]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[ye,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:Ae()}],"mask-size":[{mask:ke()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,be]}],filter:[{filter:["","none",ye,be]}],blur:[{blur:we()}],brightness:[{brightness:[qe,ye,be]}],contrast:[{contrast:[qe,ye,be]}],"drop-shadow":[{"drop-shadow":["","none",O,ro,io]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,ye,be]}],"hue-rotate":[{"hue-rotate":[qe,ye,be]}],invert:[{invert:["",qe,ye,be]}],saturate:[{saturate:[qe,ye,be]}],sepia:[{sepia:["",qe,ye,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,be]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[qe,ye,be]}],"backdrop-contrast":[{"backdrop-contrast":[qe,ye,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,ye,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,ye,be]}],"backdrop-invert":[{"backdrop-invert":["",qe,ye,be]}],"backdrop-opacity":[{"backdrop-opacity":[qe,ye,be]}],"backdrop-saturate":[{"backdrop-saturate":[qe,ye,be]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,ye,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",ye,be]}],ease:[{ease:["linear","initial",M,ye,be]}],delay:[{delay:[qe,ye,be]}],animate:[{animate:["none",q,ye,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ye,be]}],"perspective-origin":[{"perspective-origin":ie()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[ye,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:ie()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],zoom:[{zoom:[Vn,ye,be]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",ye,be]}],"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":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",ye,be]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,xi,yl,Ng]}],stroke:[{stroke:["none",...H()]}],"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"]}},OS=cS(zS);function Mt(...l){return OS(GN(l))}const MS=({currentView:l,onSelectView:i,isOpenMobile:c,onCloseMobile:o})=>{const{t:d}=at(),f=window.__BRAND__||{name:"Levix",tagline:"Private control room",version:"",developer:"Abdelrhman Diab",studio:"Leviro",developerSite:"https://github.com/Abdodiab2005",studioSite:"https://leviro.net"},h=[{id:"overview",label:d("overview"),icon:vN},{id:"connection",label:d("connection"),icon:Ci},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:xs},{id:"ai",label:d("ai"),icon:bf},{id:"groups",label:d("groups"),icon:ps},{id:"schedules",label:d("schedules"),icon:nf},{id:"stickers",label:d("stickers"),icon:jf},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:MN},{id:"logs",label:d("logs"),icon:mo}];return s.jsxs(s.Fragment,{children:[c&&s.jsx("button",{type:"button",className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-40 md:hidden border-0 p-0 cursor-default",onClick:o,"aria-label":"Close mobile sidebar backdrop"}),s.jsxs("aside",{className:Mt("fixed top-0 bottom-0 start-0 z-50 w-72 md:w-64 md:static md:z-auto bg-panel border-e border-line flex flex-col transition-transform duration-200 ease-out",c?"translate-x-0":"max-md:-translate-x-full rtl:max-md:translate-x-full"),"aria-label":"Main Navigation",children:[s.jsxs("div",{className:"p-4 flex items-center justify-between border-b border-line",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-gradient-to-br from-brand-blue via-brand-blue to-brand-cyan flex items-center justify-center shadow-md shadow-brand-blue/20 shrink-0 text-white",children:s.jsx(BN,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-extrabold text-base text-text-main leading-tight tracking-tight truncate",children:f.name}),s.jsx("div",{className:"text-xs text-muted leading-none truncate mt-0.5",children:f.tagline})]})]}),s.jsx("button",{type:"button",onClick:o,className:"inline-flex md:hidden items-center justify-center w-10 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors shrink-0","aria-label":"Close menu",children:s.jsx(ys,{size:18})})]}),s.jsx("nav",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:h.map(p=>{if(p.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:p.labelCategory},`cat-${p.labelCategory}`);if(!p.icon)return null;const x=p.icon,N=l===p.id;return s.jsxs("button",{type:"button",onClick:()=>{p.id&&(i(p.id),o())},className:Mt("w-full flex items-center gap-3 px-3.5 py-2.5 rounded-xl font-medium text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 text-start min-h-[44px]",N?"bg-brand-blue text-white shadow-md shadow-brand-blue/25 font-bold":"text-muted hover:bg-panel-hover hover:text-text-main"),children:[s.jsx(x,{size:20,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:p.label})]},p.id)})}),s.jsxs("div",{className:"p-4 border-t border-line text-xs text-faint flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted",children:[s.jsx("span",{className:"font-mono",children:f.version?`v${f.version}`:""}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Nf,{size:14,className:"text-brand-cyan"})," Local-first"]})]}),s.jsxs("div",{className:"text-[11px] text-muted truncate",children:["© ",f.copyrightYear||2026," ",s.jsx("a",{href:f.developerSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:f.developer})," ","(",s.jsx("a",{href:f.studioSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:f.studio}),")"]})]})]})]})},ay=w.createContext(null),DS=({children:l})=>{const[i,c]=w.useState([]),o=w.useCallback(f=>{c(h=>h.filter(p=>p.id!==f))},[]),d=w.useCallback((f,h="info",p=4e3)=>{const x=Math.random().toString(36).slice(2,9);c(N=>[...N,{id:x,message:f,type:h,duration:p}]),setTimeout(()=>o(x),p)},[o]);return s.jsxs(ay.Provider,{value:{toast:d},children:[l,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:i.map(f=>s.jsxs("div",{className:`pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-xl border bg-panel-raised/95 backdrop-blur-md shadow-xl text-xs md:text-sm text-text-main transition-all ${f.type==="success"?"border-ok/35":f.type==="error"?"border-danger/35":f.type==="warning"?"border-warn/35":"border-line"}`,children:[f.type==="success"&&s.jsx(Ai,{size:18,className:"text-ok shrink-0"}),f.type==="error"&&s.jsx(oN,{size:18,className:"text-danger shrink-0"}),f.type==="warning"&&s.jsx(Si,{size:18,className:"text-warn shrink-0"}),f.type==="info"&&s.jsx(yN,{size:18,className:"text-info shrink-0"}),s.jsx("span",{className:"flex-1 font-medium",children:f.message}),s.jsx("button",{type:"button",onClick:()=>o(f.id),className:"inline-flex items-center justify-center w-6 h-6 rounded-lg text-muted hover:text-text-main hover:bg-panel-hover transition-colors shrink-0","aria-label":"Dismiss notification",children:s.jsx(ys,{size:14})})]},f.id))})]})},Gt=()=>{const l=w.useContext(ay);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},Qn=Object.create(null);Qn.open="0";Qn.close="1";Qn.ping="2";Qn.pong="3";Qn.message="4";Qn.upgrade="5";Qn.noop="6";const ho=Object.create(null);Object.keys(Qn).forEach(l=>{ho[Qn[l]]=l});const cf={type:"error",data:"parser error"},ly=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",sy=typeof ArrayBuffer=="function",iy=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l&&l.buffer instanceof ArrayBuffer,_f=({type:l,data:i},c,o)=>ly&&i instanceof Blob?c?o(i):wg(i,o):sy&&(i instanceof ArrayBuffer||iy(i))?c?o(i):wg(new Blob([i]),o):o(Qn[l]+(i||"")),wg=(l,i)=>{const c=new FileReader;return c.onload=function(){const o=c.result.split(",")[1];i("b"+(o||""))},c.readAsDataURL(l)};function kg(l){return l instanceof Uint8Array?l:l instanceof ArrayBuffer?new Uint8Array(l):new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}let jd;function RS(l,i){if(ly&&l.data instanceof Blob)return l.data.arrayBuffer().then(kg).then(i);if(sy&&(l.data instanceof ArrayBuffer||iy(l.data)))return i(kg(l.data));_f(l,!1,c=>{jd||(jd=new TextEncoder),i(jd.encode(c))})}const _g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let l=0;l<_g.length;l++)vi[_g.charCodeAt(l)]=l;const LS=l=>{let i=l.length*.75,c=l.length,o,d=0,f,h,p,x;l[l.length-1]==="="&&(i--,l[l.length-2]==="="&&i--);const N=new ArrayBuffer(i),y=new Uint8Array(N);for(o=0;o<c;o+=4)f=vi[l.charCodeAt(o)],h=vi[l.charCodeAt(o+1)],p=vi[l.charCodeAt(o+2)],x=vi[l.charCodeAt(o+3)],y[d++]=f<<2|h>>4,y[d++]=(h&15)<<4|p>>2,y[d++]=(p&3)<<6|x&63;return N},US=typeof ArrayBuffer=="function",Ef=(l,i)=>{if(typeof l!="string")return{type:"message",data:ry(l,i)};const c=l.charAt(0);return c==="b"?{type:"message",data:BS(l.substring(1),i)}:ho[c]?l.length>1?{type:ho[c],data:l.substring(1)}:{type:ho[c]}:cf},BS=(l,i)=>{if(US){const c=LS(l);return ry(c,i)}else return{base64:!0,data:l}},ry=(l,i)=>{switch(i){case"blob":return l instanceof Blob?l:new Blob([l]);case"arraybuffer":default:return l instanceof ArrayBuffer?l:l.buffer}},oy="",HS=(l,i)=>{const c=l.length,o=new Array(c);let d=0;l.forEach((f,h)=>{_f(f,!1,p=>{o[h]=p,++d===c&&i(o.join(oy))})})},qS=(l,i)=>{const c=l.split(oy),o=[];for(let d=0;d<c.length;d++){const f=Ef(c[d],i);if(o.push(f),f.type==="error")break}return o};function GS(){return new TransformStream({transform(l,i){RS(l,c=>{const o=c.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))}l.data&&typeof l.data!="string"&&(d[0]|=128),i.enqueue(d),i.enqueue(c)})}})}let wd;function oo(l){return l.reduce((i,c)=>i+c.length,0)}function co(l,i){if(l[0].length===i)return l.shift();const c=new Uint8Array(i);let o=0;for(let d=0;d<i;d++)c[d]=l[0][o++],o===l[0].length&&(l.shift(),o=0);return l.length&&o<l[0].length&&(l[0]=l[0].slice(o)),c}function PS(l,i){wd||(wd=new TextDecoder);const c=[];let o=0,d=-1,f=!1;return new TransformStream({transform(h,p){for(c.push(h);;){if(o===0){if(oo(c)<1)break;const x=co(c,1);f=(x[0]&128)===128,d=x[0]&127,d<126?o=3:d===126?o=1:o=2}else if(o===1){if(oo(c)<2)break;const x=co(c,2);d=new DataView(x.buffer,x.byteOffset,x.length).getUint16(0),o=3}else if(o===2){if(oo(c)<8)break;const x=co(c,8),N=new DataView(x.buffer,x.byteOffset,x.length),y=N.getUint32(0);if(y>Math.pow(2,21)-1){p.enqueue(cf);break}d=y*Math.pow(2,32)+N.getUint32(4),o=3}else{if(oo(c)<d)break;const x=co(c,d);p.enqueue(Ef(f?x:wd.decode(x),i)),o=0}if(d===0||d>l){p.enqueue(cf);break}}}})}const cy=4;function wt(l){if(l)return VS(l)}function VS(l){for(var i in wt.prototype)l[i]=wt.prototype[i];return l}wt.prototype.on=wt.prototype.addEventListener=function(l,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+l]=this._callbacks["$"+l]||[]).push(i),this};wt.prototype.once=function(l,i){function c(){this.off(l,c),i.apply(this,arguments)}return c.fn=i,this.on(l,c),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(l,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var c=this._callbacks["$"+l];if(!c)return this;if(arguments.length==1)return delete this._callbacks["$"+l],this;for(var o,d=0;d<c.length;d++)if(o=c[d],o===i||o.fn===i){c.splice(d,1);break}return c.length===0&&delete this._callbacks["$"+l],this};wt.prototype.emit=function(l){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),c=this._callbacks["$"+l],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(c){c=c.slice(0);for(var o=0,d=c.length;o<d;++o)c[o].apply(this,i)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(l){return this._callbacks=this._callbacks||{},this._callbacks["$"+l]||[]};wt.prototype.hasListeners=function(l){return!!this.listeners(l).length};const Ao=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,c)=>c(i,0),jn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),YS="arraybuffer";function uy(l,...i){return i.reduce((c,o)=>(l.hasOwnProperty(o)&&(c[o]=l[o]),c),{})}const IS=jn.setTimeout,KS=jn.clearTimeout;function zo(l,i){i.useNativeTimers?(l.setTimeoutFn=IS.bind(jn),l.clearTimeoutFn=KS.bind(jn)):(l.setTimeoutFn=jn.setTimeout.bind(jn),l.clearTimeoutFn=jn.clearTimeout.bind(jn))}const QS=1.33;function XS(l){return typeof l=="string"?FS(l):Math.ceil((l.byteLength||l.size)*QS)}function FS(l){let i=0,c=0;for(let o=0,d=l.length;o<d;o++)i=l.charCodeAt(o),i<128?c+=1:i<2048?c+=2:i<55296||i>=57344?c+=3:(o++,c+=4);return c}function dy(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ZS(l){let i="";for(let c in l)l.hasOwnProperty(c)&&(i.length&&(i+="&"),i+=encodeURIComponent(c)+"="+encodeURIComponent(l[c]));return i}function JS(l){let i={},c=l.split("&");for(let o=0,d=c.length;o<d;o++){let f=c[o].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class $S extends Error{constructor(i,c,o){super(i),this.description=c,this.context=o,this.type="TransportError"}}class Cf extends wt{constructor(i){super(),this.writable=!1,zo(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,c,o){return super.emitReserved("error",new $S(i,c,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 c=Ef(i,this.socket.binaryType);this.onPacket(c)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,c={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(c)}_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 c=ZS(i);return c.length?"?"+c:""}}class WS extends Cf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const c=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||c()})),this.writable||(o++,this.once("drain",function(){--o||c()}))}else c()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const c=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)};qS(i,this.socket.binaryType).forEach(c),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,HS(i,c=>{this.doWrite(c,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",c=this.query||{};return this.opts.timestampRequests!==!1&&(c[this.opts.timestampParam]=dy()),!this.supportsBinary&&!c.sid&&(c.b64=1),this.createUri(i,c)}}let fy=!1;try{fy=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ej=fy;function tj(){}class nj extends WS{constructor(i){if(super(i),typeof location<"u"){const c=location.protocol==="https:";let o=location.port;o||(o=c?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||o!==i.port}}doWrite(i,c){const o=this.request({method:"POST",data:i});o.on("success",c),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",(c,o)=>{this.onError("xhr poll error",c,o)}),this.pollXhr=i}}class Kn extends wt{constructor(i,c,o){super(),this.createRequest=i,zo(this,o),this._opts=o,this._method=o.method||"GET",this._uri=c,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var i;const c=uy(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");c.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(c);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=Kn.requestsCount++,Kn.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=tj,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Kn.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()}}Kn.requestsCount=0;Kn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Eg);else if(typeof addEventListener=="function"){const l="onpagehide"in jn?"pagehide":"unload";addEventListener(l,Eg,!1)}}function Eg(){for(let l in Kn.requests)Kn.requests.hasOwnProperty(l)&&Kn.requests[l].abort()}const aj=(function(){const l=my({xdomain:!1});return l&&l.responseType!==null})();class lj extends nj{constructor(i){super(i);const c=i&&i.forceBase64;this.supportsBinary=aj&&!c}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Kn(my,this.uri(),i)}}function my(l){const i=l.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||ej))return new XMLHttpRequest}catch{}if(!i)try{return new jn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const hy=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class sj extends Cf{get name(){return"websocket"}doOpen(){const i=this.uri(),c=this.opts.protocols,o=hy?{}:uy(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,c,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 c=0;c<i.length;c++){const o=i[c],d=c===i.length-1;_f(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Ao(()=>{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",c=this.query||{};return this.opts.timestampRequests&&(c[this.opts.timestampParam]=dy()),this.supportsBinary||(c.b64=1),this.createUri(i,c)}}const kd=jn.WebSocket||jn.MozWebSocket;class ij extends sj{createSocket(i,c,o){return hy?new kd(i,c,o):c?new kd(i,c):new kd(i)}doWrite(i,c){this.ws.send(c)}}class rj extends Cf{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 c=PS(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(c).getReader(),d=GS();d.readable.pipeTo(i.writable),this._writer=d.writable.getWriter();const f=()=>{o.read().then(({done:p,value:x})=>{p||(this.onPacket(x),f())}).catch(p=>{})};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 c=0;c<i.length;c++){const o=i[c],d=c===i.length-1;this._writer.write(o).then(()=>{d&&Ao(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const oj={websocket:ij,webtransport:rj,polling:lj},cj=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,uj=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function uf(l){if(l.length>8e3)throw"URI too long";const i=l,c=l.indexOf("["),o=l.indexOf("]");c!=-1&&o!=-1&&(l=l.substring(0,c)+l.substring(c,o).replace(/:/g,";")+l.substring(o,l.length));let d=cj.exec(l||""),f={},h=14;for(;h--;)f[uj[h]]=d[h]||"";return c!=-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=dj(f,f.path),f.queryKey=fj(f,f.query),f}function dj(l,i){const c=/\/{2,9}/g,o=i.replace(c,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function fj(l,i){const c={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(c[d]=f)}),c}const df=typeof addEventListener=="function"&&typeof removeEventListener=="function",po=[];df&&addEventListener("offline",()=>{po.forEach(l=>l())},!1);class Ya extends wt{constructor(i,c){if(super(),this.binaryType=YS,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(c=i,i=null),i){const o=uf(i);c.hostname=o.host,c.secure=o.protocol==="https"||o.protocol==="wss",c.port=o.port,o.query&&(c.query=o.query)}else c.host&&(c.hostname=uf(c.host).host);zo(this,c),this.secure=c.secure!=null?c.secure:typeof location<"u"&&location.protocol==="https:",c.hostname&&!c.port&&(c.port=this.secure?"443":"80"),this.hostname=c.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=c.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},c.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},c),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=JS(this.opts.query)),df&&(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"})},po.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const c=Object.assign({},this.opts.query);c.EIO=cy,c.transport=i,this.id&&(c.sid=this.id);const o=Object.assign({},this.opts,{query:c,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&&Ya.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const c=this.createTransport(i);c.open(),this.setTransport(c)}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",c=>this._onClose("transport close",c))}onOpen(){this.readyState="open",Ya.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 c=new Error("server error");c.code=i.data,this._onError(c);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 c=1;for(let o=0;o<this.writeBuffer.length;o++){const d=this.writeBuffer[o].data;if(d&&(c+=XS(d)),o>0&&c>this._maxPayload)return this.writeBuffer.slice(0,o);c+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,Ao(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,c,o){return this._sendPacket("message",i,c,o),this}send(i,c,o){return this._sendPacket("message",i,c,o),this}_sendPacket(i,c,o,d){if(typeof c=="function"&&(d=c,c=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:c,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()},c=()=>{this.off("upgrade",c),this.off("upgradeError",c),i()},o=()=>{this.once("upgrade",c),this.once("upgradeError",c)};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(Ya.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,c){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(),df&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=po.indexOf(this._offlineEventListener);o!==-1&&po.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,c),this.writeBuffer=[],this._prevBufferLen=0}}}Ya.protocol=cy;class mj extends Ya{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 c=this.createTransport(i),o=!1;Ya.priorWebsocketSuccess=!1;const d=()=>{o||(c.send([{type:"ping",data:"probe"}]),c.once("packet",b=>{if(!o)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",c),!c)return;Ya.priorWebsocketSuccess=c.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(y(),this.setTransport(c),c.send([{type:"upgrade"}]),this.emitReserved("upgrade",c),c=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=c.name,this.emitReserved("upgradeError",S)}}))};function f(){o||(o=!0,y(),c.close(),c=null)}const h=b=>{const S=new Error("probe error: "+b);S.transport=c.name,f(),this.emitReserved("upgradeError",S)};function p(){h("transport closed")}function x(){h("socket closed")}function N(b){c&&b.name!==c.name&&f()}const y=()=>{c.removeListener("open",d),c.removeListener("error",h),c.removeListener("close",p),this.off("close",x),this.off("upgrading",N)};c.once("open",d),c.once("error",h),c.once("close",p),this.once("close",x),this.once("upgrading",N),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||c.open()},200):c.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const c=[];for(let o=0;o<i.length;o++)~this.transports.indexOf(i[o])&&c.push(i[o]);return c}}let hj=class extends mj{constructor(i,c={}){const o=typeof i=="object",d=o?{...i}:{...c};(!d.transports||d.transports&&typeof d.transports[0]=="string")&&(d.transports=(d.transports||["polling","websocket","webtransport"]).map(f=>oj[f]).filter(f=>!!f)),super(o?d:i,d)}};function pj(l,i="",c){let o=l;c=c||typeof location<"u"&&location,l==null&&(l=c.protocol+"//"+c.host),typeof l=="string"&&(l.charAt(0)==="/"&&(l.charAt(1)==="/"?l=c.protocol+l:l=c.host+l),/^(https?|wss?):\/\//.test(l)||(typeof c<"u"?l=c.protocol+"//"+l:l="https://"+l),o=uf(l)),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+(c&&c.port===o.port?"":":"+o.port),o}const xj=typeof ArrayBuffer=="function",gj=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l.buffer instanceof ArrayBuffer,py=Object.prototype.toString,bj=typeof Blob=="function"||typeof Blob<"u"&&py.call(Blob)==="[object BlobConstructor]",yj=typeof File=="function"||typeof File<"u"&&py.call(File)==="[object FileConstructor]";function Tf(l){return xj&&(l instanceof ArrayBuffer||gj(l))||bj&&l instanceof Blob||yj&&l instanceof File}function xo(l,i){if(!l||typeof l!="object")return!1;if(Array.isArray(l)){for(let c=0,o=l.length;c<o;c++)if(xo(l[c]))return!0;return!1}if(Tf(l))return!0;if(l.toJSON&&typeof l.toJSON=="function"&&arguments.length===1)return xo(l.toJSON(),!0);for(const c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&xo(l[c]))return!0;return!1}function vj(l){const i=[],c=l.data,o=l;return o.data=go(c,i),o.attachments=i.length,{packet:o,buffers:i}}function go(l,i,c){if(!l)return l;if(Tf(l)){const o={_placeholder:!0,num:i.length};return i.push(l),o}else if(Array.isArray(l)){const o=new Array(l.length);for(let d=0;d<l.length;d++)o[d]=go(l[d],i);return o}else if(typeof l=="object"&&!(l instanceof Date)){if(l.toJSON&&typeof l.toJSON=="function"&&!c)return go(l.toJSON(),i,!0);const o={};for(const d in l)Object.prototype.hasOwnProperty.call(l,d)&&(o[d]=go(l[d],i));return o}return l}function Nj(l,i){return l.data=ff(l.data,i),delete l.attachments,l}function ff(l,i){if(!l)return l;if(l&&l._placeholder===!0){if(typeof l.num=="number"&&l.num>=0&&l.num<i.length)return i[l.num];throw new Error("illegal attachments")}else if(Array.isArray(l))for(let c=0;c<l.length;c++)l[c]=ff(l[c],i);else if(typeof l=="object")for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&(l[c]=ff(l[c],i));return l}const Sj=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ke;(function(l){l[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK"})(Ke||(Ke={}));class jj{constructor(i){this.replacer=i}encode(i){return(i.type===Ke.EVENT||i.type===Ke.ACK)&&xo(i)?this.encodeAsBinary({type:i.type===Ke.EVENT?Ke.BINARY_EVENT:Ke.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let c=""+i.type;return(i.type===Ke.BINARY_EVENT||i.type===Ke.BINARY_ACK)&&(c+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(c+=i.nsp+","),i.id!=null&&(c+=i.id),i.data!=null&&(c+=JSON.stringify(i.data,this.replacer)),c}encodeAsBinary(i){const c=vj(i),o=this.encodeAsString(c.packet),d=c.buffers;return d.unshift(o),d}}class Af extends wt{constructor(i){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof i=="function"?{reviver:i}:i)}add(i){let c;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");c=this.decodeString(i);const o=c.type===Ke.BINARY_EVENT;o||c.type===Ke.BINARY_ACK?(c.type=o?Ke.EVENT:Ke.ACK,this.reconstructor=new wj(c)):super.emitReserved("decoded",c)}else if(Tf(i)||i.base64)if(this.reconstructor)c=this.reconstructor.takeBinaryData(i),c&&(this.reconstructor=null,super.emitReserved("decoded",c));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let c=0;const o={type:Number(i.charAt(0))};if(Ke[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ke.BINARY_EVENT||o.type===Ke.BINARY_ACK){const f=c+1;for(;i.charAt(++c)!=="-"&&c!=i.length;);const h=i.substring(f,c);if(h!=Number(h)||i.charAt(c)!=="-")throw new Error("Illegal attachments");const p=Number(h);if(!kj(p)||p<1)throw new Error("Illegal attachments");if(p>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=p}if(i.charAt(c+1)==="/"){const f=c+1;for(;++c&&!(i.charAt(c)===","||c===i.length););o.nsp=i.substring(f,c)}else o.nsp="/";const d=i.charAt(c+1);if(d!==""&&Number(d)==d){const f=c+1;for(;++c;){const h=i.charAt(c);if(h==null||Number(h)!=h){--c;break}if(c===i.length)break}o.id=Number(i.substring(f,c+1))}if(i.charAt(++c)){const f=this.tryParse(i.substr(c));if(Af.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,c){switch(i){case Ke.CONNECT:return Cg(c);case Ke.DISCONNECT:return c===void 0;case Ke.CONNECT_ERROR:return typeof c=="string"||Cg(c);case Ke.EVENT:case Ke.BINARY_EVENT:return Array.isArray(c)&&(typeof c[0]=="number"||typeof c[0]=="string"&&Sj.indexOf(c[0])===-1);case Ke.ACK:case Ke.BINARY_ACK:return Array.isArray(c)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wj{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const c=Nj(this.reconPack,this.buffers);return this.finishedReconstruction(),c}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const kj=Number.isInteger||function(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l};function Cg(l){return Object.prototype.toString.call(l)==="[object Object]"}const _j=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Af,Encoder:jj,get PacketType(){return Ke}},Symbol.toStringTag,{value:"Module"}));function An(l,i,c){return l.on(i,c),function(){l.off(i,c)}}const Ej=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class xy extends wt{constructor(i,c,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=c,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=[An(i,"open",this.onopen.bind(this)),An(i,"packet",this.onpacket.bind(this)),An(i,"error",this.onerror.bind(this)),An(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,...c){var o,d,f;if(Ej.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(c.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(c),this;const h={type:Ke.EVENT,data:c};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof c[c.length-1]=="function"){const y=this.ids++,b=c.pop();this._registerAckCallback(y,b),h.id=y}const p=(d=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||d===void 0?void 0:d.writable,x=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!p||(x?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,c){var o;const d=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(d===void 0){this.acks[i]=c;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let p=0;p<this.sendBuffer.length;p++)this.sendBuffer[p].id===i&&this.sendBuffer.splice(p,1);c.call(this,new Error("operation has timed out"))},d),h=(...p)=>{this.io.clearTimeoutFn(f),c.apply(this,p)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...c){return new Promise((o,d)=>{const f=(h,p)=>h?d(h):o(p);f.withError=!0,c.push(f),this.emit(i,...c)})}_addToQueue(i){let c;typeof i[i.length-1]=="function"&&(c=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(),c&&c(d)):(this._queue.shift(),c&&c(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 c=this._queue[0];c.pending&&!i||(c.pending=!0,c.tryCount++,this.flags=c.flags,this.emit.apply(this,c.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:Ke.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,c){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,c),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 Ke.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 Ke.EVENT:case Ke.BINARY_EVENT:this.onevent(i);break;case Ke.ACK:case Ke.BINARY_ACK:this.onack(i);break;case Ke.DISCONNECT:this.ondisconnect();break;case Ke.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 c=i.data||[];i.id!=null&&c.push(this.ack(i.id)),this.connected?this.emitEvent(c):this.receiveBuffer.push(Object.freeze(c))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const c=this._anyListeners.slice();for(const o of c)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 c=this;let o=!1;return function(...d){o||(o=!0,c.packet({type:Ke.ACK,id:i,data:d}))}}onack(i){const c=this.acks[i.id];typeof c=="function"&&(delete this.acks[i.id],c.withError&&i.data.unshift(null),c.apply(this,i.data))}onconnect(i,c){this.id=i,this.recovered=c&&this._pid===c,this._pid=c,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:Ke.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 c=this._anyListeners;for(let o=0;o<c.length;o++)if(i===c[o])return c.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 c=this._anyOutgoingListeners;for(let o=0;o<c.length;o++)if(i===c[o])return c.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const c=this._anyOutgoingListeners.slice();for(const o of c)o.apply(this,i.data)}}}function vs(l){l=l||{},this.ms=l.min||100,this.max=l.max||1e4,this.factor=l.factor||2,this.jitter=l.jitter>0&&l.jitter<=1?l.jitter:0,this.attempts=0}vs.prototype.duration=function(){var l=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),c=Math.floor(i*this.jitter*l);l=(Math.floor(i*10)&1)==0?l-c:l+c}return Math.min(l,this.max)|0};vs.prototype.reset=function(){this.attempts=0};vs.prototype.setMin=function(l){this.ms=l};vs.prototype.setMax=function(l){this.max=l};vs.prototype.setJitter=function(l){this.jitter=l};class mf extends wt{constructor(i,c){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(c=i,i=void 0),c=c||{},c.path=c.path||"/socket.io",this.opts=c,zo(this,c),this.reconnection(c.reconnection!==!1),this.reconnectionAttempts(c.reconnectionAttempts||1/0),this.reconnectionDelay(c.reconnectionDelay||1e3),this.reconnectionDelayMax(c.reconnectionDelayMax||5e3),this.randomizationFactor((o=c.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new vs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(c.timeout==null?2e4:c.timeout),this._readyState="closed",this.uri=i;const d=c.parser||_j;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=c.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 c;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(c=this.backoff)===null||c===void 0||c.setMin(i),this)}randomizationFactor(i){var c;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(c=this.backoff)===null||c===void 0||c.setJitter(i),this)}reconnectionDelayMax(i){var c;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(c=this.backoff)===null||c===void 0||c.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 hj(this.uri,this.opts);const c=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const d=An(c,"open",function(){o.onopen(),i&&i()}),f=p=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",p),i?i(p):this.maybeReconnectOnOpen()},h=An(c,"error",f);if(this._timeout!==!1){const p=this._timeout,x=this.setTimeoutFn(()=>{d(),f(new Error("timeout")),c.close()},p);this.opts.autoUnref&&x.unref(),this.subs.push(()=>{this.clearTimeoutFn(x)})}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(An(i,"ping",this.onping.bind(this)),An(i,"data",this.ondata.bind(this)),An(i,"error",this.onerror.bind(this)),An(i,"close",this.onclose.bind(this)),An(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(c){this.onclose("parse error",c)}}ondecoded(i){Ao(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,c){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new xy(this,i,c),this.nsps[i]=o),o}_destroy(i){const c=Object.keys(this.nsps);for(const o of c)if(this.nsps[o].active)return;this._close()}_packet(i){const c=this.encoder.encode(i);for(let o=0;o<c.length;o++)this.engine.write(c[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,c){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,c),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 c=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()}))},c);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 gi={};function bo(l,i){typeof l=="object"&&(i=l,l=void 0),i=i||{};const c=pj(l,i.path||"/socket.io"),o=c.source,d=c.id,f=c.path,h=gi[d]&&f in gi[d].nsps,p=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let x;return p?x=new mf(o,i):(gi[d]||(gi[d]=new mf(o,i)),x=gi[d]),c.query&&!i.query&&(i.query=c.queryKey),x.socket(c.path,i)}Object.assign(bo,{Manager:mf,Socket:xy,io:bo,connect:bo});let _d=null;function Tg(){return _d||(_d=bo(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),_d}function Cj(l){const[i,c]=w.useState(!1),[o,d]=w.useState(null);return w.useEffect(()=>{const f=Tg(),h=()=>c(!0),p=()=>c(!1),x=A=>{d(M=>({...M,...A,state:(A==null?void 0:A.state)||(M==null?void 0:M.state)||"idle"})),l==null||l("session",A)},N=A=>{d(M=>({...M,state:(A==null?void 0:A.state)||(M==null?void 0:M.state)||"idle",status:(A==null?void 0:A.status)||(M==null?void 0:M.status)})),l==null||l("status_update",A)},y=A=>{d(M=>({...M,...A})),l==null||l("status",A)},b=A=>{d(M=>({...M,state:"waiting_for_qr",qr:A})),l==null||l("qr",A)},S=A=>{const M=typeof A=="object"&&A&&"code"in A?String(A.code):String(A||"");d(q=>({...q,state:"waiting_for_qr",pairingCode:M})),l==null||l("pairing_code",M)},O=()=>{d(A=>A?{...A,qr:null}:null),l==null||l("qr_cleared",{})},C=()=>{d(A=>A?{...A,pairingCode:null}:null),l==null||l("pairing_code_cleared",{})},E=(A,...M)=>{l==null||l(A,M[0])};return f.on("connect",h),f.on("disconnect",p),f.on("session",x),f.on("status_update",N),f.on("status",y),f.on("qr",b),f.on("pairing_code",S),f.on("pairing-code",S),f.on("qr_cleared",O),f.on("pairing_code_cleared",C),f.onAny(E),c(f.connected),()=>{f.off("connect",h),f.off("disconnect",p),f.off("session",x),f.off("status_update",N),f.off("status",y),f.off("qr",b),f.off("pairing_code",S),f.off("pairing-code",S),f.off("qr_cleared",O),f.off("pairing_code_cleared",C),f.offAny(E)}},[l]),{isConnected:i,sessionStatus:o,socket:Tg()}}const tn=({isOpen:l,onClose:i,title:c,children:o,footer:d,maxWidth:f})=>(w.useEffect(()=>{const h=p=>{p.key==="Escape"&&i()};return l&&(document.addEventListener("keydown",h),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",h),document.body.style.overflow="auto"}},[l,i]),l?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 overflow-y-auto",children:[s.jsx("button",{type:"button",className:"fixed inset-0 bg-black/65 backdrop-blur-sm border-0 p-0 cursor-default",onClick:i,"aria-label":"Close modal backdrop"}),s.jsxs("div",{className:"relative w-full rounded-2xl border border-line bg-panel shadow-2xl overflow-hidden my-auto z-10 animate-in fade-in zoom-in-95 duration-150",role:"dialog","aria-modal":"true","aria-label":c,style:f?{maxWidth:f}:{maxWidth:"520px"},children:[s.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-line",children:[s.jsx("h3",{className:"text-base md:text-lg font-bold text-text-main",children:c}),s.jsx("button",{type:"button",onClick:i,className:"inline-flex items-center justify-center w-8 h-8 rounded-lg border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors","aria-label":"Close modal",children:s.jsx(ys,{size:18})})]}),s.jsx("div",{className:"p-5 overflow-y-auto max-h-[75vh]",children:o}),d&&s.jsx("div",{className:"flex items-center justify-end gap-3 p-4 border-t border-line bg-panel-raised/50",children:d})]})]}):null),vl=({checked:l,onChange:i,disabled:c=!1,id:o,label:d,description:f})=>{const h=o||`toggle-${Math.random().toString(36).slice(2,8)}`;return s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[(d||f)&&s.jsxs("div",{className:"min-w-0 flex-1",children:[d&&s.jsx("label",{htmlFor:h,className:"font-semibold text-sm cursor-pointer block text-text-main",children:d}),f&&s.jsx("p",{className:"text-xs text-muted mt-0.5",children:f})]}),s.jsx("button",{type:"button",role:"switch","aria-checked":l,id:h,disabled:c,onClick:()=>i(!l),className:Mt("relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 disabled:cursor-not-allowed",l?"bg-brand-blue":"bg-panel-hover border border-line"),children:s.jsx("span",{className:Mt("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow-md ring-0 transition duration-200 ease-in-out",l?"translate-x-5 rtl:-translate-x-5":"translate-x-0")})})]})},Tj=()=>{var Pt,gt,Xn,zn,zi;const{t:l,language:i}=at(),{toast:c}=Gt(),[o,d]=w.useState({}),[f,h]=w.useState({}),[p,x]=w.useState(!0),[N,y]=w.useState({}),[b,S]=w.useState(!1),[O,C]=w.useState(!1),[E,A]=w.useState(!1),[M,q]=w.useState(""),[te,Z]=w.useState([]),[ie,J]=w.useState(null),[_,j]=w.useState(""),[I,Q]=w.useState(!1),[se,ce]=w.useState(!1),[oe,F]=w.useState([]),[Y,G]=w.useState(null),[X,ue]=w.useState(null),[je,H]=w.useState(!1),re=[{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"}],Ae=async()=>{try{const P=await K.getSettings();if(P!=null&&P.settings){const Te={},it={};P.settings.forEach(ct=>{Te[ct.key]=ct.value,ct.type==="secret"&&(it[ct.key]=!!ct.configured)}),d(Te),h(it)}}catch(P){c(P.message,"error")}finally{x(!1)}};w.useEffect(()=>{Ae()},[]);const ke=async(P,Te,it=!1)=>{d(ct=>({...ct,[P]:Te}));try{const ct=await K.updateSetting(P,Te);if(it||c(l("savedSuccessfully"),"success"),P.endsWith("_api_key")&&(d(Qe=>({...Qe,[P]:""})),h(Qe=>({...Qe,[P]:!!Te}))),ct!=null&&ct.settings&&Array.isArray(ct.settings)){const Qe={},ha={};ct.settings.forEach($e=>{$e.type==="secret"?(ha[$e.key]=!!$e.configured,Qe[$e.key]=""):Qe[$e.key]=$e.value}),d($e=>({...$e,...Qe})),h($e=>({...$e,...ha}))}}catch(ct){c(ct.message,"error")}},v=o.ai_provider||"gemini",T=re.find(P=>{var Te,it;return P.provider!==v?!1:!!(P.id==="gemini"||P.id==="anthropic"||P.id==="groq"&&((Te=o.openai_base_url)!=null&&Te.includes("groq.com"))||P.id==="ollama"&&((it=o.openai_base_url)!=null&&it.includes("11434"))||P.id==="openai"&&(!o.openai_base_url||o.openai_base_url.includes("api.openai.com")))})||re[0],ne=async P=>{const Te={...o,ai_provider:P.provider};P.baseUrlSetting&&(Te[P.baseUrlSetting]=P.defaultBaseUrl),P.defaultModel&&(Te[P.modelSetting]=P.defaultModel),d(Te);try{await K.updateSetting("ai_provider",P.provider),P.baseUrlSetting&&await K.updateSetting(P.baseUrlSetting,P.defaultBaseUrl),P.defaultModel&&await K.updateSetting(P.modelSetting,P.defaultModel),c(i==="ar"?`تم التبديل إلى ${P.name}`:`Switched provider to ${P.name}`,"success")}catch(it){c(it.message,"error")}},le=async(P=!1)=>{S(!0);const Te=String(o[T.keySetting]||"").trim(),it=!!f[T.keySetting];try{const ct={provider:T.provider,refresh:P};Te&&(ct.apiKey=Te),T.baseUrlSetting&&o[T.baseUrlSetting]&&(ct.baseUrl=o[T.baseUrlSetting]);const Qe=await K.fetchAiModels(ct);Qe&&(Qe.success||Qe.fallback)?(y(ha=>{var $e;return{...ha,[T.id]:{live:!!Qe.live,requiresApiKey:!!Qe.requiresApiKey,fallback:!!Qe.fallback,models:Qe.models||[],cached:!!Qe.cached,error:Qe.success||($e=Qe.error)==null?void 0:$e.message}}}),Qe.live&&Qe.success?c(i==="ar"?`تم التحقق بنجاح وجلب ${Qe.models.length} نموذجاً متاحاً لحسابك`:`Discovered ${Qe.models.length} live models available for your account`,"success"):Qe.requiresApiKey?P&&c(i==="ar"?"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك":"Enter an API key to discover account models","info"):!Qe.success&&Qe.error&&c(Qe.error.message||"Failed to discover models","error")):Qe&&!Qe.success&&Qe.error&&(y(ha=>{var $e;return{...ha,[T.id]:{live:!1,requiresApiKey:!(it||Te),fallback:!0,models:Qe.models||[],error:($e=Qe.error)==null?void 0:$e.message}}}),c(Qe.error.message||"Failed to discover models","error"))}catch(ct){c(ct.message||"Failed to fetch models","error")}finally{S(!1)}};w.useEffect(()=>{p||le(!1)},[T.id,f[T.keySetting],p]);const ve=((Pt=N[T.id])==null?void 0:Pt.models)||[],xe=!!((gt=N[T.id])!=null&&gt.live),we=!!(((Xn=N[T.id])==null?void 0:Xn.requiresApiKey)??!f[T.keySetting]),fe=o[T.modelSetting]||T.defaultModel,pe=ve.find(P=>P.id.toLowerCase()===fe.toLowerCase())||{displayName:fe,provider:T.provider,capabilities:{textInput:!0,textOutput:!0,vision:!1,audioInput:!1,stt:!1,videoInput:!1,pdfInput:!1},capabilitySource:"unknown"},dt=!!pe.capabilities.vision,ee=!!pe.capabilities.stt,De=pe.capabilitySource==="provider"||pe.capabilitySource==="seed",Be=o.ai_auto_detect_capabilities!==!1,Re=De&&Be&&!dt,ze=De&&Be&&!ee;w.useEffect(()=>{p||(Re&&o.ai_vision_enabled&&ke("ai_vision_enabled",!1,!0),ze&&o.ai_stt_enabled&&ke("ai_stt_enabled",!1,!0))},[fe,Re,ze,p]);const xt=async()=>{try{const P=await K.getPersona(),Te=P==null?void 0:P.persona;q(typeof Te=="string"?Te:(Te==null?void 0:Te.body)||""),A(!0)}catch(P){c(P.message,"error")}},ae=async()=>{try{await K.updatePersona(M),c(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),A(!1)}catch(P){c(P.message,"error")}},_e=async()=>{try{const P=await K.getMemoryFiles(),Te=((P==null?void 0:P.scopes)||[]).map(it=>({scope:it.scope,label:it.label,entries:it.entries??0}));Z(Te.some(it=>it.scope==="global")?Te:[{scope:"global",label:"Global memory",entries:0},...Te])}catch(P){Z([{scope:"global",label:"Global memory",entries:0}]),c(P.message,"error")}},Ve=async P=>{J(P),j(""),Q(!0);try{const Te=await K.getMemoryFile(P);j((Te==null?void 0:Te.content)||"")}catch(Te){c(Te.message,"error")}finally{Q(!1)}},Ct=async()=>{J("global"),Q(!0),await _e();try{const P=await K.getMemoryFile("global");j((P==null?void 0:P.content)||"")}catch(P){c(P.message,"error")}finally{Q(!1)}},de=async()=>{if(ie)try{await K.updateMemoryFile(ie,_),c(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),_e(),J(null)}catch(P){c(P.message,"error")}},Ne=async()=>{ce(!0),G(null),ue(null),H(!0);try{const P=await K.getAiConversations();F((P==null?void 0:P.conversations)||[])}catch(P){c(P.message,"error")}finally{H(!1)}},Je=async P=>{G(P),ue(null),H(!0);try{const Te=await K.getAiConversation(P);ue(Te||null)}catch(Te){c(Te.message,"error")}finally{H(!1)}},yt=P=>P?new Date(P).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—";return p?s.jsxs("div",{className:"flex items-center justify-center p-12 text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("starting")})]}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised via-panel to-panel p-4 sm:p-6 shadow-sm flex flex-col gap-3.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[s.jsx("div",{className:"w-11 h-11 sm:w-12 sm:h-12 rounded-2xl bg-gradient-to-br from-brand-blue to-brand-cyan text-white flex items-center justify-center shrink-0 shadow-md shadow-brand-blue/20",children:s.jsx(bf,{size:22,className:"sm:w-6 sm:h-6"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"text-base sm:text-xl font-extrabold text-text-main truncate",children:l("aiTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted truncate",children:l("aiSubtitle")})]})]}),s.jsxs("div",{className:"shrink-0 flex items-center gap-2 bg-panel/60 border border-line/70 rounded-xl px-2.5 py-1.5 shadow-xs",children:[s.jsx("span",{className:"text-xs font-bold text-muted hidden sm:inline",children:o.ai_agent?i==="ar"?"مفعل":"Enabled":i==="ar"?"معطل":"Disabled"}),s.jsx(vl,{checked:!!o.ai_agent,onChange:P=>ke("ai_agent",P)})]})]}),s.jsx("div",{className:"flex items-center gap-2 pt-1 border-t border-line/40",children:s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-bold border ${o.ai_agent?"bg-ok/15 text-ok border-ok/30":"bg-danger/10 text-danger border-danger/25"}`,children:[s.jsx("span",{className:"pulse-dot"}),s.jsx("span",{children:o.ai_agent?l("aiAgentEnabled"):i==="ar"?"مساعد الذكاء الاصطناعي معطل":"AI Assistant Disabled"})]})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(sf,{size:18,className:"text-brand-cyan shrink-0"}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("aiProvider")})]}),s.jsxs("div",{className:"flex items-center gap-2 self-start sm:self-auto",children:[s.jsx("span",{className:"text-xs text-muted font-medium",children:i==="ar"?"المزود النشط:":"Active:"}),s.jsxs("span",{className:"text-xs font-bold text-brand-cyan px-2.5 py-1 rounded-lg bg-brand-cyan/10 border border-brand-cyan/25",children:[T.name," • ",s.jsx("span",{className:"font-mono",children:fe})]})]})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 sm:gap-3",children:re.map(P=>{const Te=T.id===P.id;return s.jsxs("button",{type:"button",onClick:()=>ne(P),className:`p-3.5 rounded-xl border text-start transition-all flex flex-col justify-between gap-2.5 focus-visible:ring-2 focus-visible:ring-brand-blue/50 ${Te?"bg-brand-blue/15 border-brand-blue/60 shadow-sm ring-1 ring-brand-blue/40":"bg-panel-raised border-line hover:bg-panel-hover"}`,children:[s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"font-bold text-xs sm:text-sm text-text-main",children:P.name}),Te?s.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-blue text-white flex items-center justify-center shrink-0",children:s.jsx(_i,{size:12,strokeWidth:3})}):s.jsx("span",{className:"w-2 h-2 rounded-full bg-line"})]}),s.jsx("span",{className:"text-[10px] sm:text-[11px] font-mono text-muted truncate block",children:P.defaultModel})]},P.id)})}),we&&s.jsxs("div",{className:"p-3.5 rounded-xl bg-amber-500/10 border border-amber-500/25 flex items-start gap-3",children:[s.jsx(Si,{size:18,className:"text-amber-500 shrink-0 mt-0.5"}),s.jsxs("div",{className:"text-xs text-text-main",children:[s.jsx("p",{className:"font-bold",children:l("connectKeyFirstPrompt")}),s.jsx("p",{className:"text-muted mt-0.5",children:i==="ar"?"النماذج المعروضة أدناه هي نماذج مقترحة من الدليل المحلي وليست مؤكدة لحسابك حتى يتم ربط المفتاح.":"Models shown below are catalog recommendations and are not verified for your account until a key is configured."})]})]}),((zn=N[T.id])==null?void 0:zn.error)&&s.jsxs("div",{className:"p-3 rounded-xl bg-danger/10 border border-danger/25 flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-danger font-semibold",children:[s.jsx(jo,{size:16,className:"shrink-0"}),s.jsx("span",{children:(zi=N[T.id])==null?void 0:zi.error})]}),s.jsx("button",{type:"button",onClick:()=>le(!0),className:"text-xs font-bold underline hover:opacity-80 shrink-0",children:l("refreshModels")})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 pt-4 border-t border-line",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{htmlFor:"input-api-key",className:"block text-xs font-bold text-muted",children:l("apiKey")}),f[T.keySetting]&&s.jsxs("span",{className:"text-[10px] text-ok font-semibold flex items-center gap-1",children:[s.jsx(Ai,{size:11}),i==="ar"?"محفوظ":"Saved"]})]}),s.jsx("input",{id:"input-api-key",type:"password",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o[T.keySetting]||"",onChange:P=>d({...o,[T.keySetting]:P.target.value}),onBlur:P=>ke(T.keySetting,P.target.value),placeholder:f[T.keySetting]?"••••••••••••":i==="ar"?"أدخل المفتاح":"Enter API key"})]}),T.baseUrlSetting&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"input-base-url",className:"block text-xs font-bold text-muted",children:l("baseUrl")}),s.jsx("input",{id:"input-base-url",type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o[T.baseUrlSetting]||"",onChange:P=>{T.baseUrlSetting&&d({...o,[T.baseUrlSetting]:P.target.value})},onBlur:P=>{T.baseUrlSetting&&ke(T.baseUrlSetting,P.target.value)},placeholder:T.defaultBaseUrl})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("label",{htmlFor:"input-model-name",className:"block text-xs font-bold text-muted",children:l("modelName")}),xe?s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-ok/15 text-ok border border-ok/30",children:l("sourceLive")}):s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-brand-cyan/15 text-brand-cyan border border-brand-cyan/30",children:l("sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>C(!O),className:"text-[11px] text-brand-cyan hover:underline font-semibold",children:O?i==="ar"?"القائمة":"List":i==="ar"?"مخصص":"Custom"}),s.jsxs("button",{type:"button",onClick:()=>le(!0),disabled:b,className:"inline-flex items-center gap-1 text-[11px] text-brand-blue hover:text-brand-blue/80 font-bold",title:l("refreshModels"),children:[s.jsx(wo,{size:11,className:b?"animate-spin":""}),s.jsx("span",{children:l(b?"refreshing":"refreshModels")})]})]})]}),O?s.jsx("input",{id:"input-model-name",type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o[T.modelSetting]||"",onChange:P=>d({...o,[T.modelSetting]:P.target.value}),onBlur:P=>ke(T.modelSetting,P.target.value),placeholder:T.defaultModel}):s.jsxs("select",{id:"input-model-name",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:fe,onChange:P=>{ke(T.modelSetting,P.target.value)},children:[s.jsx("optgroup",{label:l(xe?"modelsAvailableLive":"modelsRecommendedSeed"),children:ve.map(P=>s.jsxs("option",{value:P.id,children:[P.displayName&&P.displayName!==P.id?`${P.displayName} (${P.id})`:P.id,P.recommended?" ★":""]},P.id))}),!ve.some(P=>P.id.toLowerCase()===fe.toLowerCase())&&s.jsxs("option",{value:fe,children:[fe," (current)"]})]})]})]}),s.jsxs("div",{className:"p-3.5 rounded-xl border border-line bg-panel-raised/60 flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[s.jsxs("span",{className:"font-bold text-text-main flex items-center gap-1.5",children:[s.jsx(sf,{size:14,className:"text-brand-cyan shrink-0"}),i==="ar"?"القدرات:":"Capabilities:"," ",s.jsx("span",{className:"font-mono text-brand-cyan",children:pe.displayName||fe})]}),s.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-full border ${pe.capabilitySource==="provider"?"bg-ok/15 text-ok border-ok/30":pe.capabilitySource==="seed"?"bg-brand-blue/15 text-brand-blue border-brand-blue/30":"bg-muted/15 text-muted border-line"}`,children:pe.capabilitySource==="provider"?l("sourceLive"):pe.capabilitySource==="seed"?l("sourceSeed"):l("sourceUnknown")})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2 text-xs",children:[{icon:da,label:l("capVision"),on:dt},{icon:gd,label:l("capStt"),on:ee},{icon:UN,label:l("capAudio"),on:!!pe.capabilities.audioInput},{icon:mo,label:l("capText"),on:!!(pe.capabilities.textInput&&pe.capabilities.textOutput)},{icon:mo,label:l("capPdf"),on:!!pe.capabilities.pdfInput},{icon:da,label:l("capVideo"),on:!!pe.capabilities.videoInput}].map(({icon:P,label:Te,on:it})=>s.jsxs("div",{className:`p-2 rounded-lg border flex items-center justify-between ${De&&it?"bg-ok/10 border-ok/25 text-ok":"bg-panel border-line text-muted"}`,children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[s.jsx(P,{size:14}),s.jsx("span",{children:Te})]}),s.jsx("span",{className:"text-[10px] font-bold",children:De?l(it?"supported":"unsupported"):"—"})]},Te))})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4",children:[s.jsx("h3",{className:"text-base font-bold text-text-main",children:l("capabilities")}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"relative rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsx("div",{className:"absolute top-3.5 end-3.5",children:s.jsx(vl,{checked:Re?!1:!!o.ai_vision_enabled,disabled:Re,onChange:P=>{Re||ke("ai_vision_enabled",P)}})}),s.jsxs("div",{className:"pe-12",children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(da,{size:17,className:Re?"text-muted shrink-0":"text-brand-cyan shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("aiVision")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("aiVisionDesc")}),Re&&s.jsxs("p",{className:"text-[11px] text-amber-500 font-semibold mt-2 flex items-center gap-1",children:[s.jsx(Si,{size:13,className:"shrink-0"}),s.jsx("span",{children:l("visionUnsupportedNotice")})]})]})]}),s.jsxs("div",{className:"relative rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsx("div",{className:"absolute top-3.5 end-3.5",children:s.jsx(vl,{checked:ze?!1:!!(o.ai_stt_enabled??!0),disabled:ze,onChange:P=>{ze||ke("ai_stt_enabled",P)}})}),s.jsxs("div",{className:"pe-12",children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(gd,{size:17,className:ze?"text-muted shrink-0":"text-purple-400 shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("aiSttEnabled")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("aiSttEnabledDesc")}),ze&&s.jsxs("p",{className:"text-[11px] text-amber-500 font-semibold mt-2 flex items-center gap-1",children:[s.jsx(Si,{size:13,className:"shrink-0"}),s.jsx("span",{children:l("sttUnsupportedNotice")})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(gd,{size:17,className:"text-purple-400 shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("aiStt")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("sttDesc")})]}),s.jsxs("select",{className:"w-full h-10 px-3 rounded-lg border border-line bg-panel text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50 disabled:opacity-50",value:o.ai_stt_provider||"auto",disabled:ze,onChange:P=>{ze||ke("ai_stt_provider",P.target.value)},children:[s.jsx("option",{value:"auto",children:l("sttAuto")}),s.jsx("option",{value:"gemini",children:l("sttGemini")}),s.jsx("option",{value:"openai",children:l("sttOpenAI")})]})]}),s.jsxs("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(Ei,{size:17,className:"text-ok shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("botLanguage")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("botLanguageDesc")})]}),s.jsxs("select",{className:"w-full h-10 px-3 rounded-lg border border-line bg-panel text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o.bot_language||"auto",onChange:P=>ke("bot_language",P.target.value),children:[s.jsx("option",{value:"auto",children:l("langAuto")}),s.jsx("option",{value:"ar",children:l("langAr")}),s.jsx("option",{value:"en",children:l("langEn")})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 text-text-main mb-2",children:[s.jsx(mo,{size:20,className:"text-brand-blue shrink-0"}),s.jsx("h3",{className:"text-base font-bold",children:l("personaPrompt")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("personaDesc")})]}),s.jsx("button",{type:"button",onClick:xt,className:"w-full h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 flex items-center justify-center gap-2",children:s.jsx("span",{children:l("editPersona")})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 text-text-main mb-2",children:[s.jsx(dN,{size:20,className:"text-brand-cyan shrink-0"}),s.jsx("h3",{className:"text-base font-bold",children:l("memoryFiles")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("memoryDesc")})]}),s.jsx("button",{type:"button",onClick:Ct,className:"w-full h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 flex items-center justify-center gap-2",children:s.jsx("span",{children:l("manageMemory")})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 text-text-main mb-2",children:[s.jsx(ON,{size:20,className:"text-brand-blue shrink-0"}),s.jsx("h3",{className:"text-base font-bold",children:l("aiInspector")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("aiInspectorDesc")})]}),s.jsx("button",{type:"button",onClick:Ne,className:"w-full h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 flex items-center justify-center gap-2",children:s.jsx("span",{children:l("openInspector")})})]})]}),s.jsx(tn,{isOpen:E,onClose:()=>A(!1),title:l("personaPrompt"),maxWidth:"750px",footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>A(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")}),s.jsxs("button",{type:"button",onClick:ae,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/25 transition-colors flex items-center gap-2",children:[s.jsx(ko,{size:16}),s.jsx("span",{children:l("save")})]})]}),children:s.jsx("textarea",{className:"w-full rounded-xl border border-line bg-panel-raised p-3.5 text-text-main font-mono text-xs sm:text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-brand-blue/50",rows:12,value:M,onChange:P=>q(P.target.value)})}),s.jsx(tn,{isOpen:!!ie,onClose:()=>J(null),title:l("memoryFiles"),maxWidth:"900px",footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>J(null),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")}),s.jsxs("button",{type:"button",onClick:de,disabled:I,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/25 transition-colors flex items-center gap-2 disabled:opacity-50",children:[s.jsx(ko,{size:16}),s.jsx("span",{children:l("save")})]})]}),children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[s.jsx("div",{className:"md:w-60 shrink-0 flex flex-col gap-1.5 md:max-h-[420px] overflow-y-auto",children:te.map(P=>{const Te=P.scope==="global",it=ie===P.scope;return s.jsxs("button",{type:"button",onClick:()=>Ve(P.scope),className:`text-start p-2.5 rounded-xl border transition-colors ${it?"bg-brand-blue/15 border-brand-blue/60":"bg-panel-raised border-line hover:bg-panel-hover"}`,children:[s.jsxs("span",{className:"flex items-center gap-2 font-bold text-xs text-text-main min-w-0",children:[Te?s.jsx(Ei,{size:14,className:"text-brand-cyan shrink-0"}):s.jsx(lf,{size:14,className:"text-brand-blue shrink-0"}),s.jsx("span",{className:"truncate",children:Te?l("memoryGlobalScope"):P.scope})]}),s.jsxs("span",{className:"block text-[10px] text-muted mt-1",children:[l(Te?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",l("memoryEntriesCount").replace("{n}",String(P.entries))]})]},P.scope)})}),s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] text-muted leading-relaxed",children:l("memoryProseHint")}),I?s.jsxs("div",{className:"flex items-center justify-center min-h-[340px] text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("starting")})]}):s.jsx("textarea",{className:"w-full min-h-[340px] flex-1 rounded-xl border border-line bg-panel-raised p-3.5 text-text-main font-mono text-xs sm:text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-brand-blue/50",rows:12,value:_,onChange:P=>j(P.target.value),placeholder:l("memoryEditorPlaceholder")})]})]})}),s.jsx(tn,{isOpen:se,onClose:()=>ce(!1),title:l("aiInspector"),maxWidth:"750px",footer:s.jsx("div",{className:"flex items-center justify-end gap-2.5 w-full",children:s.jsx("button",{type:"button",onClick:()=>ce(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")})}),children:je?s.jsxs("div",{className:"flex items-center justify-center min-h-[280px] text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("starting")})]}):Y?s.jsxs("div",{className:"flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>G(null),className:"text-xs font-bold text-brand-cyan hover:underline",children:["← ",l("backToList")]}),s.jsx("span",{className:"text-[10px] text-muted font-mono truncate",children:Y})]}),(X==null?void 0:X.truncated)&&s.jsx("p",{className:"text-[11px] text-amber-500 font-semibold",children:l("convTruncated")}),s.jsxs("div",{className:"flex flex-col gap-1.5 max-h-[420px] overflow-y-auto",children:[(X==null?void 0:X.messages.length)===0&&s.jsx("p",{className:"text-xs text-muted text-center py-6",children:l("noConversations")}),X==null?void 0:X.messages.map((P,Te)=>s.jsxs("div",{className:`p-2.5 rounded-xl border text-xs ${P.kind==="tool"||P.kind==="toolResult"?"bg-panel border-line text-muted font-mono":P.role==="model"?"bg-brand-blue/10 border-brand-blue/25 text-text-main":"bg-panel-raised border-line text-text-main"}`,children:[P.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:P.text}),P.kind==="media"&&s.jsxs("span",{children:["📎 ",P.mimeType||l("convMedia")]}),P.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",P.name]}),P.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",P.name]})]},Te))]})]}):s.jsxs("div",{className:"flex flex-col gap-1.5",children:[oe.length===0&&s.jsx("p",{className:"text-xs text-muted text-center py-8",children:l("noConversations")}),oe.map(P=>s.jsxs("button",{type:"button",onClick:()=>Je(P.chatId),className:"text-start p-3 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover transition-colors",children:[s.jsxs("span",{className:"flex items-center gap-2 font-bold text-xs text-text-main",children:[s.jsx(lf,{size:14,className:"text-brand-blue shrink-0"}),s.jsx("span",{className:"truncate font-mono",children:P.chatId})]}),s.jsxs("span",{className:"block text-[10px] text-muted mt-1",children:[l("convTurns").replace("{n}",String(P.turns))," · ",yt(P.updatedAt)]})]},P.chatId))]})})]})},Aj=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],Ag=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,zj=()=>{const{t:l,language:i}=at(),{toast:c}=Gt(),[o,d]=w.useState([]),[f,h]=w.useState(Aj),[p,x]=w.useState("!"),[N,y]=w.useState(!1),[b,S]=w.useState("!"),[O,C]=w.useState(""),[E,A]=w.useState(!0),[M,q]=w.useState(null),[te,Z]=w.useState([]),[ie,J]=w.useState(""),[_,j]=w.useState(!1),I=async()=>{try{const v=await K.getCommands();v!=null&&v.commands&&d(v.commands),v!=null&&v.prefix&&(x(v.prefix),S(v.prefix)),Array.isArray(v==null?void 0:v.levels)&&v.levels.length&&h(v.levels)}catch(v){c(v.message,"error")}finally{A(!1)}};w.useEffect(()=>{I()},[]);const Q=async()=>{const v=b.trim();if(!v||v.length>3){c(l("prefixValidation"),"error");return}try{await K.updatePrefix(v),x(v),y(!1),c(`${l("prefixUpdated")} (${v})`,"success")}catch(T){c(T.message,"error")}},se=async(v,T)=>{d(ne=>ne.map(le=>le.name===v.name?{...le,enabled:T,overridden:!0}:le));try{await K.updateCommand(v.name,{enabled:T}),c(l(T?"commandEnabled":"commandDisabled").replace("{name}",v.name),"success")}catch(ne){c(ne.message,"error"),I()}},ce=async(v,T)=>{d(ne=>ne.map(le=>le.name===v.name?{...le,permission:T,overridden:!0}:le));try{await K.updateCommand(v.name,{permission:T}),c(l("permissionUpdated").replace("{name}",v.name),"success")}catch(ne){c(ne.message,"error"),I()}},oe=v=>{q(v),Z(Array.isArray(v.aliases)?[...v.aliases]:[]),J("")},F=()=>{const v=ie.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(v){if(te.includes(v)){c(l("aliasAlreadyAdded"),"warning");return}Z([...te,v]),J("")}},Y=v=>{Z(te.filter(T=>T!==v))},G=async()=>{if(M){j(!0);try{await K.updateCommand(M.name,{aliases:te}),d(v=>v.map(T=>T.name===M.name?{...T,aliases:te}:T)),c(l("savedSuccessfully"),"success"),q(null)}catch(v){c(v.message,"error")}finally{j(!1)}}},X=v=>{var T;return((T=v.descriptions)==null?void 0:T[i])||v.description||""},ue=v=>{var T;return((T=v.usages)==null?void 0:T[i])||v.usage||""},je=v=>ue(v).split(`
505
+ `).map(T=>T.trim()).filter(Boolean).map(T=>`${p}${T}`),H=v=>({MEMBERS:l("permMembers"),ALL:l("permMembers"),ADMINS_ONLY:l("permAdminsOnly"),ADMINS_OWNER:l("permAdminsOwner"),OWNER_ONLY:l("permOwnerOnly")})[v]||v,re=v=>({all:l("scopeAll"),group:l("scopeGroup"),private:l("scopePrivate")})[v]||v,Ae=O.trim().toLowerCase(),ke=Ae?o.filter(v=>{var T,ne;return[v.name,...v.aliases||[],X(v),v.description,ue(v),(T=v.usages)==null?void 0:T.en,(ne=v.usages)==null?void 0:ne.ar].filter(Boolean).join(" ").toLowerCase().includes(Ae)}):o;return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:l("commands")}),s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-xl border border-line bg-panel-raised",children:[s.jsxs("span",{className:"text-xs text-muted font-semibold",children:[l("activePrefix"),":"]}),N?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx("input",{type:"text",maxLength:3,value:b,onChange:v=>S(v.target.value),className:"w-12 h-7 px-1.5 text-center font-mono font-bold text-xs rounded-lg border border-line bg-panel text-text-main focus:outline-none focus:ring-2 focus:ring-brand-blue/50",onKeyDown:v=>{v.key==="Enter"&&Q(),v.key==="Escape"&&y(!1)}}),s.jsx("button",{type:"button",onClick:Q,className:"px-2 h-7 rounded-lg bg-brand-blue text-white font-bold text-xs hover:bg-brand-blue/90 transition-colors",children:l("save")}),s.jsx("button",{type:"button",onClick:()=>y(!1),className:"px-2 h-7 rounded-lg border border-line bg-panel-raised text-muted font-bold text-xs hover:bg-panel-hover transition-colors",children:l("cancel")})]}):s.jsx("button",{type:"button",onClick:()=>{S(p),y(!0)},className:"px-2.5 py-0.5 rounded-lg bg-brand-cyan/15 text-brand-cyan border border-brand-cyan/30 font-mono font-bold text-xs hover:bg-brand-cyan/25 transition-colors",title:l("editPrefixHint"),children:p})]})]}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-1",children:l("commandsSub")})]}),s.jsxs("div",{className:"relative w-full md:w-72 shrink-0",children:[s.jsx(vf,{size:18,className:"absolute start-3.5 top-3 text-muted"}),s.jsx("input",{type:"text",className:"w-full h-11 ps-10 pe-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:l("searchPlaceholder"),value:O,onChange:v=>C(v.target.value)})]})]}),s.jsx("div",{className:"rounded-2xl border border-line bg-panel overflow-hidden shadow-sm overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[760px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thCommand")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thAliases")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thDescription")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thScope")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thRequiredRole")}),s.jsx("th",{className:"px-4 py-3.5 text-center",children:l("thStatus")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:E?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12 text-muted",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:l("loading")})]})})}):ke.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12 text-muted text-xs md:text-sm",children:l("noMatchingCommands")})}):ke.map(v=>{var T;return s.jsxs("tr",{className:"hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-4 py-3.5 font-mono font-bold text-brand-cyan",children:s.jsxs("bdi",{children:[p,v.name]})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[(T=v.aliases)!=null&&T.length?v.aliases.map(ne=>{const le=Ag.test(ne),ve=le!==(i==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] px-2 py-0.5 rounded-md bg-panel-raised border border-line text-muted",title:ve?l(le?"aliasScriptArabic":"aliasScriptLatin"):void 0,children:[s.jsxs("bdi",{children:[p,ne]}),ve&&s.jsx("span",{className:"font-sans font-bold text-[9px] uppercase tracking-wide text-brand-cyan/80",children:le?"AR":"EN"})]},ne)}):s.jsx("span",{className:"text-xs text-muted/60",children:"—"}),s.jsx("button",{type:"button",onClick:()=>oe(v),className:"inline-flex items-center justify-center w-6 h-6 rounded-md bg-panel-raised hover:bg-brand-blue/15 hover:text-brand-cyan text-muted border border-line transition-colors",title:l("editAliases"),children:s.jsx(CN,{size:12})})]})}),s.jsxs("td",{className:"px-4 py-3.5 max-w-xs text-text-main text-xs md:text-sm",children:[X(v),je(v).length>0&&s.jsx("ul",{className:"mt-1.5 flex flex-col gap-0.5 list-none","aria-label":l("usage"),title:l("usageHint"),children:je(v).map(ne=>s.jsx("li",{children:s.jsx("code",{className:"font-mono text-[11px] text-muted bg-panel-raised border border-line rounded px-1.5 py-0.5 w-fit max-w-full overflow-x-auto",children:s.jsx("bdi",{children:ne})})},ne))})]}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx("span",{className:"inline-flex px-2.5 py-0.5 rounded-lg bg-brand-blue/10 text-brand-cyan text-xs font-semibold",children:re(v.chat)})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx("select",{className:"h-9 px-2.5 rounded-lg border border-line bg-panel-raised text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:v.permission,onChange:ne=>ce(v,ne.target.value),children:f.map(ne=>s.jsx("option",{value:ne,children:H(ne)},ne))})}),s.jsx("td",{className:"px-4 py-3.5 text-center",children:s.jsx(vl,{checked:v.enabled,onChange:ne=>se(v,ne)})})]},v.name)})})]})}),s.jsx(tn,{isOpen:!!M,onClose:()=>q(null),title:`${l("aliasesFor")} ${p}${(M==null?void 0:M.name)||""}`,footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>q(null),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")}),s.jsx("button",{type:"button",onClick:G,disabled:_,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/25 transition-colors disabled:opacity-50",children:l(_?"saving":"save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted",children:l("aliasesHelp")}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"text-xs font-bold text-muted block",children:l("thAliases")}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap min-h-[42px] p-2 rounded-xl border border-line bg-panel-raised",children:te.length>0?te.map(v=>{const T=Ag.test(v),ne=T!==(i==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-panel border border-line text-xs font-mono font-bold text-text-main",title:ne?l(T?"aliasScriptArabic":"aliasScriptLatin"):void 0,children:[s.jsxs("bdi",{children:[p,v]}),ne&&s.jsx("span",{className:"font-sans font-bold text-[9px] uppercase tracking-wide text-brand-cyan/80",children:T?"AR":"EN"}),s.jsx("button",{type:"button",onClick:()=>Y(v),className:"text-muted hover:text-danger p-0.5 rounded transition-colors",children:s.jsx(ys,{size:13})})]},v)}):s.jsx("span",{className:"text-xs text-muted/60 px-1",children:l("noAliases")})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-alias-input",className:"text-xs font-bold text-muted block",children:l("addAlias")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(LN,{size:16,className:"absolute start-3 top-3 text-muted"}),s.jsx("input",{id:"new-alias-input",type:"text",value:ie,onChange:v=>J(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),F())},placeholder:l("newAliasPlaceholder"),className:"w-full h-11 ps-9 pe-3 rounded-xl border border-line bg-panel text-text-main font-mono text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50"})]}),s.jsxs("button",{type:"button",onClick:F,className:"inline-flex items-center justify-center gap-1.5 px-4 h-11 rounded-xl bg-panel-raised hover:bg-panel-hover border border-line text-text-main font-bold text-xs sm:text-sm transition-colors shrink-0",children:[s.jsx(Co,{size:16}),s.jsx("span",{children:l("add")})]})]})]})]})})]})};var hs={},Ed,zg;function Oj(){return zg||(zg=1,Ed=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ed}var Cd={},Va={},Og;function Sl(){if(Og)return Va;Og=1;let l;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 Va.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},Va.getSymbolTotalCodewords=function(o){return i[o]},Va.getBCHDigit=function(c){let o=0;for(;c!==0;)o++,c>>>=1;return o},Va.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');l=o},Va.isKanjiModeEnabled=function(){return typeof l<"u"},Va.toSJIS=function(o){return l(o)},Va}var Td={},Mg;function zf(){return Mg||(Mg=1,(function(l){l.L={bit:1},l.M={bit:0},l.Q={bit:3},l.H={bit:2};function i(c){if(typeof c!="string")throw new Error("Param is not a string");switch(c.toLowerCase()){case"l":case"low":return l.L;case"m":case"medium":return l.M;case"q":case"quartile":return l.Q;case"h":case"high":return l.H;default:throw new Error("Unknown EC Level: "+c)}}l.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},l.from=function(o,d){if(l.isValid(o))return o;try{return i(o)}catch{return d}}})(Td)),Td}var Ad,Dg;function Mj(){if(Dg)return Ad;Dg=1;function l(){this.buffer=[],this.length=0}return l.prototype={get:function(i){const c=Math.floor(i/8);return(this.buffer[c]>>>7-i%8&1)===1},put:function(i,c){for(let o=0;o<c;o++)this.putBit((i>>>c-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0),i&&(this.buffer[c]|=128>>>this.length%8),this.length++}},Ad=l,Ad}var zd,Rg;function Dj(){if(Rg)return zd;Rg=1;function l(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 l.prototype.set=function(i,c,o,d){const f=i*this.size+c;this.data[f]=o,d&&(this.reservedBit[f]=!0)},l.prototype.get=function(i,c){return this.data[i*this.size+c]},l.prototype.xor=function(i,c,o){this.data[i*this.size+c]^=o},l.prototype.isReserved=function(i,c){return this.reservedBit[i*this.size+c]},zd=l,zd}var Od={},Lg;function Rj(){return Lg||(Lg=1,(function(l){const i=Sl().getSymbolSize;l.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,p=[f-7];for(let x=1;x<d-1;x++)p[x]=p[x-1]-h;return p.push(6),p.reverse()},l.getPositions=function(o){const d=[],f=l.getRowColCoords(o),h=f.length;for(let p=0;p<h;p++)for(let x=0;x<h;x++)p===0&&x===0||p===0&&x===h-1||p===h-1&&x===0||d.push([f[p],f[x]]);return d}})(Od)),Od}var Md={},Ug;function Lj(){if(Ug)return Md;Ug=1;const l=Sl().getSymbolSize,i=7;return Md.getPositions=function(o){const d=l(o);return[[0,0],[d-i,0],[0,d-i]]},Md}var Dd={},Bg;function Uj(){return Bg||(Bg=1,(function(l){l.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};l.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},l.from=function(d){return l.isValid(d)?parseInt(d,10):void 0},l.getPenaltyN1=function(d){const f=d.size;let h=0,p=0,x=0,N=null,y=null;for(let b=0;b<f;b++){p=x=0,N=y=null;for(let S=0;S<f;S++){let O=d.get(b,S);O===N?p++:(p>=5&&(h+=i.N1+(p-5)),N=O,p=1),O=d.get(S,b),O===y?x++:(x>=5&&(h+=i.N1+(x-5)),y=O,x=1)}p>=5&&(h+=i.N1+(p-5)),x>=5&&(h+=i.N1+(x-5))}return h},l.getPenaltyN2=function(d){const f=d.size;let h=0;for(let p=0;p<f-1;p++)for(let x=0;x<f-1;x++){const N=d.get(p,x)+d.get(p,x+1)+d.get(p+1,x)+d.get(p+1,x+1);(N===4||N===0)&&h++}return h*i.N2},l.getPenaltyN3=function(d){const f=d.size;let h=0,p=0,x=0;for(let N=0;N<f;N++){p=x=0;for(let y=0;y<f;y++)p=p<<1&2047|d.get(N,y),y>=10&&(p===1488||p===93)&&h++,x=x<<1&2047|d.get(y,N),y>=10&&(x===1488||x===93)&&h++}return h*i.N3},l.getPenaltyN4=function(d){let f=0;const h=d.data.length;for(let x=0;x<h;x++)f+=d.data[x];return Math.abs(Math.ceil(f*100/h/5)-10)*i.N4};function c(o,d,f){switch(o){case l.Patterns.PATTERN000:return(d+f)%2===0;case l.Patterns.PATTERN001:return d%2===0;case l.Patterns.PATTERN010:return f%3===0;case l.Patterns.PATTERN011:return(d+f)%3===0;case l.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case l.Patterns.PATTERN101:return d*f%2+d*f%3===0;case l.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case l.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}l.applyMask=function(d,f){const h=f.size;for(let p=0;p<h;p++)for(let x=0;x<h;x++)f.isReserved(x,p)||f.xor(x,p,c(d,x,p))},l.getBestMask=function(d,f){const h=Object.keys(l.Patterns).length;let p=0,x=1/0;for(let N=0;N<h;N++){f(N),l.applyMask(N,d);const y=l.getPenaltyN1(d)+l.getPenaltyN2(d)+l.getPenaltyN3(d)+l.getPenaltyN4(d);l.applyMask(N,d),y<x&&(x=y,p=N)}return p}})(Dd)),Dd}var uo={},Hg;function gy(){if(Hg)return uo;Hg=1;const l=zf(),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],c=[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 uo.getBlocksCount=function(d,f){switch(f){case l.L:return i[(d-1)*4+0];case l.M:return i[(d-1)*4+1];case l.Q:return i[(d-1)*4+2];case l.H:return i[(d-1)*4+3];default:return}},uo.getTotalCodewordsCount=function(d,f){switch(f){case l.L:return c[(d-1)*4+0];case l.M:return c[(d-1)*4+1];case l.Q:return c[(d-1)*4+2];case l.H:return c[(d-1)*4+3];default:return}},uo}var Rd={},bi={},qg;function Bj(){if(qg)return bi;qg=1;const l=new Uint8Array(512),i=new Uint8Array(256);return(function(){let o=1;for(let d=0;d<255;d++)l[d]=o,i[o]=d,o<<=1,o&256&&(o^=285);for(let d=255;d<512;d++)l[d]=l[d-255]})(),bi.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},bi.exp=function(o){return l[o]},bi.mul=function(o,d){return o===0||d===0?0:l[i[o]+i[d]]},bi}var Gg;function Hj(){return Gg||(Gg=1,(function(l){const i=Bj();l.mul=function(o,d){const f=new Uint8Array(o.length+d.length-1);for(let h=0;h<o.length;h++)for(let p=0;p<d.length;p++)f[h+p]^=i.mul(o[h],d[p]);return f},l.mod=function(o,d){let f=new Uint8Array(o);for(;f.length-d.length>=0;){const h=f[0];for(let x=0;x<d.length;x++)f[x]^=i.mul(d[x],h);let p=0;for(;p<f.length&&f[p]===0;)p++;f=f.slice(p)}return f},l.generateECPolynomial=function(o){let d=new Uint8Array([1]);for(let f=0;f<o;f++)d=l.mul(d,new Uint8Array([1,i.exp(f)]));return d}})(Rd)),Rd}var Ld,Pg;function qj(){if(Pg)return Ld;Pg=1;const l=Hj();function i(c){this.genPoly=void 0,this.degree=c,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(o){this.degree=o,this.genPoly=l.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=l.mod(d,this.genPoly),h=this.degree-f.length;if(h>0){const p=new Uint8Array(this.degree);return p.set(f,h),p}return f},Ld=i,Ld}var Ud={},Bd={},Hd={},Vg;function by(){return Vg||(Vg=1,Hd.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),Hd}var Yn={},Yg;function yy(){if(Yg)return Yn;Yg=1;const l="[0-9]+",i="[A-Z $%*+\\-./:]+";let c="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";c=c.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+c+`)(?:.|[\r
506
+ ]))+`;Yn.KANJI=new RegExp(c,"g"),Yn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Yn.BYTE=new RegExp(o,"g"),Yn.NUMERIC=new RegExp(l,"g"),Yn.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+c+"$"),f=new RegExp("^"+l+"$"),h=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Yn.testKanji=function(x){return d.test(x)},Yn.testNumeric=function(x){return f.test(x)},Yn.testAlphanumeric=function(x){return h.test(x)},Yn}var Ig;function jl(){return Ig||(Ig=1,(function(l){const i=by(),c=yy();l.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},l.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},l.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},l.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},l.MIXED={bit:-1},l.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]},l.getBestModeForData=function(f){return c.testNumeric(f)?l.NUMERIC:c.testAlphanumeric(f)?l.ALPHANUMERIC:c.testKanji(f)?l.KANJI:l.BYTE},l.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},l.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 l.NUMERIC;case"alphanumeric":return l.ALPHANUMERIC;case"kanji":return l.KANJI;case"byte":return l.BYTE;default:throw new Error("Unknown mode: "+d)}}l.from=function(f,h){if(l.isValid(f))return f;try{return o(f)}catch{return h}}})(Bd)),Bd}var Kg;function Gj(){return Kg||(Kg=1,(function(l){const i=Sl(),c=gy(),o=zf(),d=jl(),f=by(),h=7973,p=i.getBCHDigit(h);function x(S,O,C){for(let E=1;E<=40;E++)if(O<=l.getCapacity(E,C,S))return E}function N(S,O){return d.getCharCountIndicator(S,O)+4}function y(S,O){let C=0;return S.forEach(function(E){const A=N(E.mode,O);C+=A+E.getBitsLength()}),C}function b(S,O){for(let C=1;C<=40;C++)if(y(S,C)<=l.getCapacity(C,O,d.MIXED))return C}l.from=function(O,C){return f.isValid(O)?parseInt(O,10):C},l.getCapacity=function(O,C,E){if(!f.isValid(O))throw new Error("Invalid QR Code version");typeof E>"u"&&(E=d.BYTE);const A=i.getSymbolTotalCodewords(O),M=c.getTotalCodewordsCount(O,C),q=(A-M)*8;if(E===d.MIXED)return q;const te=q-N(E,O);switch(E){case d.NUMERIC:return Math.floor(te/10*3);case d.ALPHANUMERIC:return Math.floor(te/11*2);case d.KANJI:return Math.floor(te/13);case d.BYTE:default:return Math.floor(te/8)}},l.getBestVersionForData=function(O,C){let E;const A=o.from(C,o.M);if(Array.isArray(O)){if(O.length>1)return b(O,A);if(O.length===0)return 1;E=O[0]}else E=O;return x(E.mode,E.getLength(),A)},l.getEncodedBits=function(O){if(!f.isValid(O)||O<7)throw new Error("Invalid QR Code version");let C=O<<12;for(;i.getBCHDigit(C)-p>=0;)C^=h<<i.getBCHDigit(C)-p;return O<<12|C}})(Ud)),Ud}var qd={},Qg;function Pj(){if(Qg)return qd;Qg=1;const l=Sl(),i=1335,c=21522,o=l.getBCHDigit(i);return qd.getEncodedBits=function(f,h){const p=f.bit<<3|h;let x=p<<10;for(;l.getBCHDigit(x)-o>=0;)x^=i<<l.getBCHDigit(x)-o;return(p<<10|x)^c},qd}var Gd={},Pd,Xg;function Vj(){if(Xg)return Pd;Xg=1;const l=jl();function i(c){this.mode=l.NUMERIC,this.data=c.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 p=this.data.length-d;p>0&&(f=this.data.substr(d),h=parseInt(f,10),o.put(h,p*3+1))},Pd=i,Pd}var Vd,Fg;function Yj(){if(Fg)return Vd;Fg=1;const l=jl(),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 c(o){this.mode=l.ALPHANUMERIC,this.data=o}return c.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.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)},Vd=c,Vd}var Yd,Zg;function Ij(){if(Zg)return Yd;Zg=1;const l=jl();function i(c){this.mode=l.BYTE,typeof c=="string"?this.data=new TextEncoder().encode(c):this.data=new Uint8Array(c)}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(c){for(let o=0,d=this.data.length;o<d;o++)c.put(this.data[o],8)},Yd=i,Yd}var Id,Jg;function Kj(){if(Jg)return Id;Jg=1;const l=jl(),i=Sl();function c(o){this.mode=l.KANJI,this.data=o}return c.getBitsLength=function(d){return d*13},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(o){let d;for(d=0;d<this.data.length;d++){let f=i.toSJIS(this.data[d]);if(f>=33088&&f<=40956)f-=33088;else if(f>=57408&&f<=60351)f-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+`
507
+ Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},Id=c,Id}var Kd={exports:{}},$g;function Qj(){return $g||($g=1,(function(l){var i={single_source_shortest_paths:function(c,o,d){var f={},h={};h[o]=0;var p=i.PriorityQueue.make();p.push(o,0);for(var x,N,y,b,S,O,C,E,A;!p.empty();){x=p.pop(),N=x.value,b=x.cost,S=c[N]||{};for(y in S)S.hasOwnProperty(y)&&(O=S[y],C=b+O,E=h[y],A=typeof h[y]>"u",(A||E>C)&&(h[y]=C,p.push(y,C),f[y]=N))}if(typeof d<"u"&&typeof h[d]>"u"){var M=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(M)}return f},extract_shortest_path_from_predecessor_list:function(c,o){for(var d=[],f=o;f;)d.push(f),c[f],f=c[f];return d.reverse(),d},find_path:function(c,o,d){var f=i.single_source_shortest_paths(c,o,d);return i.extract_shortest_path_from_predecessor_list(f,d)},PriorityQueue:{make:function(c){var o=i.PriorityQueue,d={},f;c=c||{};for(f in o)o.hasOwnProperty(f)&&(d[f]=o[f]);return d.queue=[],d.sorter=c.sorter||o.default_sorter,d},default_sorter:function(c,o){return c.cost-o.cost},push:function(c,o){var d={value:c,cost:o};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};l.exports=i})(Kd)),Kd.exports}var Wg;function Xj(){return Wg||(Wg=1,(function(l){const i=jl(),c=Vj(),o=Yj(),d=Ij(),f=Kj(),h=yy(),p=Sl(),x=Qj();function N(M){return unescape(encodeURIComponent(M)).length}function y(M,q,te){const Z=[];let ie;for(;(ie=M.exec(te))!==null;)Z.push({data:ie[0],index:ie.index,mode:q,length:ie[0].length});return Z}function b(M){const q=y(h.NUMERIC,i.NUMERIC,M),te=y(h.ALPHANUMERIC,i.ALPHANUMERIC,M);let Z,ie;return p.isKanjiModeEnabled()?(Z=y(h.BYTE,i.BYTE,M),ie=y(h.KANJI,i.KANJI,M)):(Z=y(h.BYTE_KANJI,i.BYTE,M),ie=[]),q.concat(te,Z,ie).sort(function(_,j){return _.index-j.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function S(M,q){switch(q){case i.NUMERIC:return c.getBitsLength(M);case i.ALPHANUMERIC:return o.getBitsLength(M);case i.KANJI:return f.getBitsLength(M);case i.BYTE:return d.getBitsLength(M)}}function O(M){return M.reduce(function(q,te){const Z=q.length-1>=0?q[q.length-1]:null;return Z&&Z.mode===te.mode?(q[q.length-1].data+=te.data,q):(q.push(te),q)},[])}function C(M){const q=[];for(let te=0;te<M.length;te++){const Z=M[te];switch(Z.mode){case i.NUMERIC:q.push([Z,{data:Z.data,mode:i.ALPHANUMERIC,length:Z.length},{data:Z.data,mode:i.BYTE,length:Z.length}]);break;case i.ALPHANUMERIC:q.push([Z,{data:Z.data,mode:i.BYTE,length:Z.length}]);break;case i.KANJI:q.push([Z,{data:Z.data,mode:i.BYTE,length:N(Z.data)}]);break;case i.BYTE:q.push([{data:Z.data,mode:i.BYTE,length:N(Z.data)}])}}return q}function E(M,q){const te={},Z={start:{}};let ie=["start"];for(let J=0;J<M.length;J++){const _=M[J],j=[];for(let I=0;I<_.length;I++){const Q=_[I],se=""+J+I;j.push(se),te[se]={node:Q,lastCount:0},Z[se]={};for(let ce=0;ce<ie.length;ce++){const oe=ie[ce];te[oe]&&te[oe].node.mode===Q.mode?(Z[oe][se]=S(te[oe].lastCount+Q.length,Q.mode)-S(te[oe].lastCount,Q.mode),te[oe].lastCount+=Q.length):(te[oe]&&(te[oe].lastCount=Q.length),Z[oe][se]=S(Q.length,Q.mode)+4+i.getCharCountIndicator(Q.mode,q))}}ie=j}for(let J=0;J<ie.length;J++)Z[ie[J]].end=0;return{map:Z,table:te}}function A(M,q){let te;const Z=i.getBestModeForData(M);if(te=i.from(q,Z),te!==i.BYTE&&te.bit<Z.bit)throw new Error('"'+M+'" cannot be encoded with mode '+i.toString(te)+`.
508
+ Suggested mode is: `+i.toString(Z));switch(te===i.KANJI&&!p.isKanjiModeEnabled()&&(te=i.BYTE),te){case i.NUMERIC:return new c(M);case i.ALPHANUMERIC:return new o(M);case i.KANJI:return new f(M);case i.BYTE:return new d(M)}}l.fromArray=function(q){return q.reduce(function(te,Z){return typeof Z=="string"?te.push(A(Z,null)):Z.data&&te.push(A(Z.data,Z.mode)),te},[])},l.fromString=function(q,te){const Z=b(q,p.isKanjiModeEnabled()),ie=C(Z),J=E(ie,te),_=x.find_path(J.map,"start","end"),j=[];for(let I=1;I<_.length-1;I++)j.push(J.table[_[I]].node);return l.fromArray(O(j))},l.rawSplit=function(q){return l.fromArray(b(q,p.isKanjiModeEnabled()))}})(Gd)),Gd}var eb;function Fj(){if(eb)return Cd;eb=1;const l=Sl(),i=zf(),c=Mj(),o=Dj(),d=Rj(),f=Lj(),h=Uj(),p=gy(),x=qj(),N=Gj(),y=Pj(),b=jl(),S=Xj();function O(J,_){const j=J.size,I=f.getPositions(_);for(let Q=0;Q<I.length;Q++){const se=I[Q][0],ce=I[Q][1];for(let oe=-1;oe<=7;oe++)if(!(se+oe<=-1||j<=se+oe))for(let F=-1;F<=7;F++)ce+F<=-1||j<=ce+F||(oe>=0&&oe<=6&&(F===0||F===6)||F>=0&&F<=6&&(oe===0||oe===6)||oe>=2&&oe<=4&&F>=2&&F<=4?J.set(se+oe,ce+F,!0,!0):J.set(se+oe,ce+F,!1,!0))}}function C(J){const _=J.size;for(let j=8;j<_-8;j++){const I=j%2===0;J.set(j,6,I,!0),J.set(6,j,I,!0)}}function E(J,_){const j=d.getPositions(_);for(let I=0;I<j.length;I++){const Q=j[I][0],se=j[I][1];for(let ce=-2;ce<=2;ce++)for(let oe=-2;oe<=2;oe++)ce===-2||ce===2||oe===-2||oe===2||ce===0&&oe===0?J.set(Q+ce,se+oe,!0,!0):J.set(Q+ce,se+oe,!1,!0)}}function A(J,_){const j=J.size,I=N.getEncodedBits(_);let Q,se,ce;for(let oe=0;oe<18;oe++)Q=Math.floor(oe/3),se=oe%3+j-8-3,ce=(I>>oe&1)===1,J.set(Q,se,ce,!0),J.set(se,Q,ce,!0)}function M(J,_,j){const I=J.size,Q=y.getEncodedBits(_,j);let se,ce;for(se=0;se<15;se++)ce=(Q>>se&1)===1,se<6?J.set(se,8,ce,!0):se<8?J.set(se+1,8,ce,!0):J.set(I-15+se,8,ce,!0),se<8?J.set(8,I-se-1,ce,!0):se<9?J.set(8,15-se-1+1,ce,!0):J.set(8,15-se-1,ce,!0);J.set(I-8,8,1,!0)}function q(J,_){const j=J.size;let I=-1,Q=j-1,se=7,ce=0;for(let oe=j-1;oe>0;oe-=2)for(oe===6&&oe--;;){for(let F=0;F<2;F++)if(!J.isReserved(Q,oe-F)){let Y=!1;ce<_.length&&(Y=(_[ce]>>>se&1)===1),J.set(Q,oe-F,Y),se--,se===-1&&(ce++,se=7)}if(Q+=I,Q<0||j<=Q){Q-=I,I=-I;break}}}function te(J,_,j){const I=new c;j.forEach(function(F){I.put(F.mode.bit,4),I.put(F.getLength(),b.getCharCountIndicator(F.mode,J)),F.write(I)});const Q=l.getSymbolTotalCodewords(J),se=p.getTotalCodewordsCount(J,_),ce=(Q-se)*8;for(I.getLengthInBits()+4<=ce&&I.put(0,4);I.getLengthInBits()%8!==0;)I.putBit(0);const oe=(ce-I.getLengthInBits())/8;for(let F=0;F<oe;F++)I.put(F%2?17:236,8);return Z(I,J,_)}function Z(J,_,j){const I=l.getSymbolTotalCodewords(_),Q=p.getTotalCodewordsCount(_,j),se=I-Q,ce=p.getBlocksCount(_,j),oe=I%ce,F=ce-oe,Y=Math.floor(I/ce),G=Math.floor(se/ce),X=G+1,ue=Y-G,je=new x(ue);let H=0;const re=new Array(ce),Ae=new Array(ce);let ke=0;const v=new Uint8Array(J.buffer);for(let xe=0;xe<ce;xe++){const we=xe<F?G:X;re[xe]=v.slice(H,H+we),Ae[xe]=je.encode(re[xe]),H+=we,ke=Math.max(ke,we)}const T=new Uint8Array(I);let ne=0,le,ve;for(le=0;le<ke;le++)for(ve=0;ve<ce;ve++)le<re[ve].length&&(T[ne++]=re[ve][le]);for(le=0;le<ue;le++)for(ve=0;ve<ce;ve++)T[ne++]=Ae[ve][le];return T}function ie(J,_,j,I){let Q;if(Array.isArray(J))Q=S.fromArray(J);else if(typeof J=="string"){let Y=_;if(!Y){const G=S.rawSplit(J);Y=N.getBestVersionForData(G,j)}Q=S.fromString(J,Y||40)}else throw new Error("Invalid data");const se=N.getBestVersionForData(Q,j);if(!se)throw new Error("The amount of data is too big to be stored in a QR Code");if(!_)_=se;else if(_<se)throw new Error(`
509
+ The chosen QR Code version cannot contain this amount of data.
510
+ Minimum version required to store current data is: `+se+`.
511
+ `);const ce=te(_,j,Q),oe=l.getSymbolSize(_),F=new o(oe);return O(F,_),C(F),E(F,_),M(F,j,0),_>=7&&A(F,_),q(F,ce),isNaN(I)&&(I=h.getBestMask(F,M.bind(null,F,j))),h.applyMask(I,F),M(F,j,I),{modules:F,version:_,errorCorrectionLevel:j,maskPattern:I,segments:Q}}return Cd.create=function(_,j){if(typeof _>"u"||_==="")throw new Error("No input text");let I=i.M,Q,se;return typeof j<"u"&&(I=i.from(j.errorCorrectionLevel,i.M),Q=N.from(j.version),se=h.from(j.maskPattern),j.toSJISFunc&&l.setToSJISFunction(j.toSJISFunc)),ie(_,Q,I,se)},Cd}var Qd={},Xd={},tb;function vy(){return tb||(tb=1,(function(l){function i(c){if(typeof c=="number"&&(c=c.toString()),typeof c!="string")throw new Error("Color should be defined as hex string");let o=c.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+c);(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("")}}l.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||{}}},l.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},l.getImageWidth=function(o,d){const f=l.getScale(o,d);return Math.floor((o+d.margin*2)*f)},l.qrToImageData=function(o,d,f){const h=d.modules.size,p=d.modules.data,x=l.getScale(h,f),N=Math.floor((h+f.margin*2)*x),y=f.margin*x,b=[f.color.light,f.color.dark];for(let S=0;S<N;S++)for(let O=0;O<N;O++){let C=(S*N+O)*4,E=f.color.light;if(S>=y&&O>=y&&S<N-y&&O<N-y){const A=Math.floor((S-y)/x),M=Math.floor((O-y)/x);E=b[p[A*h+M]?1:0]}o[C++]=E.r,o[C++]=E.g,o[C++]=E.b,o[C]=E.a}}})(Xd)),Xd}var nb;function Zj(){return nb||(nb=1,(function(l){const i=vy();function c(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")}}l.render=function(f,h,p){let x=p,N=h;typeof x>"u"&&(!h||!h.getContext)&&(x=h,h=void 0),h||(N=o()),x=i.getOptions(x);const y=i.getImageWidth(f.modules.size,x),b=N.getContext("2d"),S=b.createImageData(y,y);return i.qrToImageData(S.data,f,x),c(b,N,y),b.putImageData(S,0,0),N},l.renderToDataURL=function(f,h,p){let x=p;typeof x>"u"&&(!h||!h.getContext)&&(x=h,h=void 0),x||(x={});const N=l.render(f,h,x),y=x.type||"image/png",b=x.rendererOpts||{};return N.toDataURL(y,b.quality)}})(Qd)),Qd}var Fd={},ab;function Jj(){if(ab)return Fd;ab=1;const l=vy();function i(d,f){const h=d.a/255,p=f+'="'+d.hex+'"';return h<1?p+" "+f+'-opacity="'+h.toFixed(2).slice(1)+'"':p}function c(d,f,h){let p=d+f;return typeof h<"u"&&(p+=" "+h),p}function o(d,f,h){let p="",x=0,N=!1,y=0;for(let b=0;b<d.length;b++){const S=Math.floor(b%f),O=Math.floor(b/f);!S&&!N&&(N=!0),d[b]?(y++,b>0&&S>0&&d[b-1]||(p+=N?c("M",S+h,.5+O+h):c("m",x,0),x=0,N=!1),S+1<f&&d[b+1]||(p+=c("h",y),y=0)):x++}return p}return Fd.render=function(f,h,p){const x=l.getOptions(h),N=f.modules.size,y=f.modules.data,b=N+x.margin*2,S=x.color.light.a?"<path "+i(x.color.light,"fill")+' d="M0 0h'+b+"v"+b+'H0z"/>':"",O="<path "+i(x.color.dark,"stroke")+' d="'+o(y,N,x.margin)+'"/>',C='viewBox="0 0 '+b+" "+b+'"',A='<svg xmlns="http://www.w3.org/2000/svg" '+(x.width?'width="'+x.width+'" height="'+x.width+'" ':"")+C+' shape-rendering="crispEdges">'+S+O+`</svg>
512
+ `;return typeof p=="function"&&p(null,A),A},Fd}var lb;function $j(){if(lb)return hs;lb=1;const l=Oj(),i=Fj(),c=Zj(),o=Jj();function d(f,h,p,x,N){const y=[].slice.call(arguments,1),b=y.length,S=typeof y[b-1]=="function";if(!S&&!l())throw new Error("Callback required as last argument");if(S){if(b<2)throw new Error("Too few arguments provided");b===2?(N=p,p=h,h=x=void 0):b===3&&(h.getContext&&typeof N>"u"?(N=x,x=void 0):(N=x,x=p,p=h,h=void 0))}else{if(b<1)throw new Error("Too few arguments provided");return b===1?(p=h,h=x=void 0):b===2&&!h.getContext&&(x=p,p=h,h=void 0),new Promise(function(O,C){try{const E=i.create(p,x);O(f(E,h,x))}catch(E){C(E)}})}try{const O=i.create(p,x);N(null,f(O,h,x))}catch(O){N(O)}}return hs.create=i.create,hs.toCanvas=d.bind(null,c.render),hs.toDataURL=d.bind(null,c.renderToDataURL),hs.toString=d.bind(null,function(f,h,p){return o.render(f,p)}),hs}var Ny=$j();const Zd=xf(Ny);function Wj(){return typeof window<"u"&&!!window.LevixHost}const ew=({status:l,onRefresh:i,onStatusUpdate:c})=>{var Ae;const{t:o,language:d}=at(),{toast:f}=Gt(),[h,p]=w.useState(!1),[x,N]=w.useState(!1),[y,b]=w.useState(null),[S,O]=w.useState("pairing"),[C,E]=w.useState(""),[A,M]=w.useState(!1),q=(l==null?void 0:l.state)||"idle",te=q==="connected",Z=q==="waiting_for_qr",ie=q==="starting"||q==="linking",J=q==="reconnecting",_=q==="paused",j=q==="logged_out",I=!!(l!=null&&l.linked)&&!j,Q=!I,se=!!(l!=null&&l.canUnlink),ce=(l==null?void 0:l.isOnline)!==!1,oe=_||q==="disconnected"||q==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";w.useEffect(()=>{if(l!=null&&l.qr){const ke=Ny.toDataURL||(Zd==null?void 0:Zd.toDataURL);typeof ke=="function"&&ke(l.qr,{width:280,margin:2,color:{dark:"#0b1629",light:"#ffffff"}}).then(v=>b(v)).catch(()=>b(null))}else b(null)},[l==null?void 0:l.qr]),w.useEffect(()=>{if(Z&&!(l!=null&&l.qr)&&!(l!=null&&l.pairingCode)){const ke=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(ke)}},[Z,l==null?void 0:l.qr,l==null?void 0:l.pairingCode,i]);const F=async(ke,v)=>{N(!0);try{const T=await ke();T&&typeof T=="object"&&"session"in T&&(c==null||c(T.session)),f(v,"success"),await(i==null?void 0:i())}catch(T){f(T instanceof Error?T.message:String(T),"error")}finally{N(!1)}},Y=async ke=>{ke&&ke.preventDefault();const v=C.replace(/\D/g,"");if(!v){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(v.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await F(()=>K.startSession({method:"pairing",phone:v}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},G=async()=>{await F(()=>K.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},X=async()=>{await F(K.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),O("pairing")},ue=()=>{l!=null&&l.pairingCode&&(navigator.clipboard.writeText(l.pairingCode.replace(/\s+/g,"")),M(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>M(!1),2500))},je=async()=>{p(!1),await F(K.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},H=(Ae=l==null?void 0:l.user)!=null&&Ae.id?l.user.id.split("@")[0].split(":")[0]:null,re=Wj();return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised via-panel to-panel p-4 sm:p-6 shadow-sm 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 ${te?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":Z?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":ie||J?"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(Ci,{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:te?o("sessionActive"):_?o("paused"):I?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 ${te?"bg-ok/15 text-ok border-ok/30":Z?"bg-warn/15 text-warn border-warn/30":ie||J?"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(q,q)})]})})]}),l!=null&&l.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(jo,{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"?`المحاولة التالية خلال ${l.retryInSeconds} ثانية`:`Next attempt in ${l.retryInSeconds}s`})]})]}):null,te&&H&&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(Ai,{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:["+",H]})]})]}),s.jsx("span",{className:"text-xs font-bold text-ok px-2.5 py-1 rounded-lg bg-ok/15 border border-ok/30 shrink-0",children:d==="ar"?"متصل":"Online"})]}),s.jsxs("div",{children:[te&&s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5 sm:gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>F(K.stopSession,o("stop")),disabled:x,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl border border-danger/40 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",children:[s.jsx(rf,{size:16}),s.jsx("span",{children:o("stop")})]}),s.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto",children:[s.jsxs("button",{type:"button",onClick:()=>F(K.reconnectSession,o("reconnecting")),disabled:x,className:"flex-1 sm:flex-initial inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("reconnect"),children:[s.jsx(wo,{size:15}),s.jsx("span",{children:o("reconnect")})]}),s.jsxs("button",{type:"button",onClick:()=>p(!0),disabled:x,className:"flex-1 sm:flex-initial inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-danger/30 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",title:o("unlink"),children:[s.jsx(yd,{size:15}),s.jsx("span",{children:o("unlink")})]}),!re&&s.jsxs("button",{type:"button",onClick:()=>F(K.restartBot,o("restart")),disabled:x,className:"flex-1 sm:flex-initial inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("restart"),children:[s.jsx(so,{size:15}),s.jsx("span",{children:o("restart")})]})]})]}),(ie||Z||J)&&s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5 sm:gap-3 w-full sm:w-auto",children:[s.jsxs("button",{type:"button",onClick:()=>F(K.stopSession,o("stop")),disabled:x,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl border border-danger/40 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",children:[s.jsx(rf,{size:16}),s.jsx("span",{children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"})]}),!re&&s.jsxs("button",{type:"button",onClick:()=>F(K.restartBot,o("restart")),disabled:x,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("restart"),children:[s.jsx(so,{size:15}),s.jsx("span",{children:o("restart")})]})]}),!te&&!ie&&!Z&&!J&&I&&s.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xl",children:[_&&s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:ce?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 flex-col sm:flex-row items-stretch sm:items-center gap-2.5",children:[s.jsxs("button",{type:"button",onClick:()=>F(K.startSession,oe),disabled:x,className:"inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-sm shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 w-full sm:w-fit",children:[s.jsx(Ci,{size:16}),s.jsx("span",{children:oe})]}),se&&s.jsxs("button",{type:"button",onClick:()=>p(!0),disabled:x,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-danger/30 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-xs sm:text-sm transition-all disabled:opacity-50",title:o("unlink"),children:[s.jsx(yd,{size:15}),s.jsx("span",{children:o("unlink")})]}),!re&&s.jsxs("button",{type:"button",onClick:()=>F(K.restartBot,o("restart")),disabled:x,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all disabled:opacity-50",title:o("restart"),children:[s.jsx(so,{size:15}),s.jsx("span",{children:o("restart")})]})]})]}),!te&&!ie&&!Z&&!J&&Q&&s.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[s.jsxs("div",{className:"flex items-center gap-1.5 p-1 rounded-xl bg-panel-raised border border-line w-full sm:w-fit",children:[s.jsxs("button",{type:"button",onClick:()=>O("pairing"),className:`flex-1 sm:flex-initial inline-flex items-center justify-center gap-2 px-4 h-10 rounded-lg text-xs sm:text-sm font-bold transition-all ${S==="pairing"?"bg-brand-blue text-white shadow-sm shadow-brand-blue/30":"text-muted hover:text-text-main"}`,children:[s.jsx(Ni,{size:16}),s.jsx("span",{children:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)"})]}),s.jsxs("button",{type:"button",onClick:()=>O("qr"),className:`flex-1 sm:flex-initial inline-flex items-center justify-center gap-2 px-4 h-10 rounded-lg text-xs sm:text-sm font-bold transition-all ${S==="qr"?"bg-brand-blue text-white shadow-sm shadow-brand-blue/30":"text-muted hover:text-text-main"}`,children:[s.jsx(bd,{size:16}),s.jsx("span",{children:d==="ar"?"مسح رمز QR":"QR Code Scan"})]})]}),S==="pairing"&&s.jsxs("form",{onSubmit:Y,className:"flex flex-col gap-3 max-w-xl w-full",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(AN,{size:17,className:"absolute top-1/2 -translate-y-1/2 start-3.5 text-muted pointer-events-none"}),s.jsx("input",{type:"tel",value:C,onChange:ke=>E(ke.target.value),placeholder:d==="ar"?"201012345678 (مع كود الدولة)":"e.g. 201012345678",dir:"ltr",className:"w-full h-12 sm:h-11 ps-10 pe-4 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-sm placeholder:text-muted/60 focus:border-brand-blue focus:ring-2 focus:ring-brand-blue/20 outline-none transition-all"})]}),s.jsxs("button",{type:"submit",disabled:x,className:"inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-sm shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 shrink-0",children:[s.jsx(af,{size:16}),s.jsx("span",{children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"})]})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:d==="ar"?"💡 أدخل رقم هاتفك مسبوقاً بكود الدولة وبدون 0 في البداية (مثال: 2010... وليس 010...). سيظهر لك كود لإدخاله في واتساب فوراً.":"💡 Enter your number with country code, no leading zeros (e.g. 2010... not 010...). A code will appear to enter into WhatsApp."})]}),S==="qr"&&s.jsxs("div",{className:"flex flex-col gap-2 max-w-xl",children:[s.jsxs("button",{type:"button",onClick:G,disabled:x,className:"inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-sm shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 w-full sm:w-fit",children:[s.jsx(bd,{size:18}),s.jsx("span",{children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"})]}),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."})]}),s.jsxs("div",{className:"flex items-center gap-2.5 pt-1",children:[se&&s.jsxs("button",{type:"button",onClick:()=>p(!0),disabled:x,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-danger/30 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",title:o("unlink"),children:[s.jsx(yd,{size:15}),s.jsx("span",{children:o("unlink")})]}),!re&&s.jsxs("button",{type:"button",onClick:()=>F(K.restartBot,o("restart")),disabled:x,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("restart"),children:[s.jsx(so,{size:15}),s.jsx("span",{children:o("restart")})]})]})]})]})]}),ie&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-6 sm:p-8 shadow-sm 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(wo,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children:q==="linking"?d==="ar"?"جارٍ إتمام الربط مع الهاتف...":"Finishing link handshake...":d==="ar"?"جارٍ بدء تشغيل الجلسة...":"Initializing WhatsApp session..."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md",children:d==="ar"?"يتم الآن إنشاء مقبس الاتصال، ستظهر بيانات الربط خلال ثوانٍ معدودة.":"Creating connection socket. Pairing details will appear in just a few seconds."})]}),Z&&s.jsx("div",{className:"rounded-2xl border border-line bg-panel p-6 sm:p-8 shadow-sm flex flex-col items-center text-center max-w-2xl mx-auto w-full",children:l!=null&&l.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(Ni,{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:l.pairingCode.length===8?`${l.pairingCode.slice(0,4)} - ${l.pairingCode.slice(4)}`:l.pairingCode}),s.jsxs("button",{type:"button",onClick:ue,className:"inline-flex items-center justify-center gap-2 px-6 h-11 rounded-xl bg-brand-cyan hover:bg-brand-cyan/90 text-bg font-extrabold text-sm shadow-md shadow-brand-cyan/25 transition-all active:scale-95",children:[A?s.jsx(_i,{size:18}):s.jsx(uN,{size:18}),s.jsx("span",{children:A?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!"})]})]})]}):y?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(bd,{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-white rounded-2xl shadow-xl border border-line animate-in fade-in zoom-in-95 duration-300",children:s.jsx("img",{src:y,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.jsxs("button",{type:"button",onClick:X,disabled:x,className:"w-full inline-flex items-center justify-center gap-2 px-4 h-12 sm:h-11 rounded-xl border border-brand-cyan/40 bg-brand-cyan/10 hover:bg-brand-cyan/20 text-brand-cyan font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-cyan/50",children:[s.jsx(Ni,{size:17}),s.jsx("span",{children:d==="ar"?"الربط برقم الهاتف (كود الربط الرقمي) بدلاً من QR":"Link with Phone Pairing Code Instead"})]})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-muted",children:[s.jsx("div",{className:"w-9 h-9 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs sm:text-sm font-semibold animate-pulse",children:d==="ar"?"جارٍ تجهيز بيانات الربط من واتساب...":"Preparing pairing details from WhatsApp..."})]})}),s.jsxs(tn,{isOpen:h,onClose:()=>p(!1),title:o("unlink"),footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>p(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:o("cancel")}),s.jsx("button",{type:"button",onClick:je,className:"px-4 h-10 rounded-xl bg-danger hover:bg-danger/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-danger/25 transition-colors",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")})]})]})},tw=()=>{const{t:l,language:i}=at(),{toast:c}=Gt(),[o,d]=w.useState([]),[f,h]=w.useState(!0),p=y=>{var O,C;const b=y.jid||y.id||"",S=typeof y.antilink=="boolean"?y.antilink:!!(y.antilinkEnabled??((O=y.antilink)==null?void 0:O.enabled));return{...y,jid:b,subject:y.subject||"",memberCount:y.memberCount??y.participants??0,antilink:S,antilinkEnabled:S,welcomeEnabled:!!(y.welcomeEnabled??((C=y.welcome_system)==null?void 0:C.enabled)),mediaRestriction:y.mediaRestriction||"none"}},x=async()=>{try{const y=await K.getGroups();y!=null&&y.groups&&d(y.groups.map(p))}catch(y){c(y.message,"error")}finally{h(!1)}};w.useEffect(()=>{x()},[]);const N=async(y,b)=>{d(S=>S.map(O=>O.jid===y?{...O,...b}:O));try{await K.updateGroup(y,b),c(l("savedSuccessfully"),"success")}catch(S){c(S.message,"error"),x()}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{className:"rounded-2xl border border-line bg-panel p-5 md:p-6 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-4",children:s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-blue/10 text-brand-blue flex items-center justify-center shrink-0",children:s.jsx(ps,{size:24})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:l("groups")}),s.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-brand-blue/10 text-brand-cyan border border-brand-cyan/20",children:[o.length," ",i==="ar"?"مجموعة":"groups"]})]}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-1",children:i==="ar"?"إدارة مجموعات واتساب، الحماية من الروابط، تقييد الوسائط، ورسائل الترحيب التلقائية":"WhatsApp group moderation, anti-link defense, media filtering, and automated greetings"})]})]})}),s.jsx("div",{className:"rounded-2xl border border-line bg-panel overflow-hidden shadow-sm overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[640px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-5 py-4 text-start",children:l("thGroupName")}),s.jsx("th",{className:"px-5 py-4 text-start",children:l("thGroupJid")}),s.jsx("th",{className:"px-5 py-4 text-start",children:l("thMembers")}),s.jsx("th",{className:"px-5 py-4 text-center",children:l("thAntiLink")}),s.jsx("th",{className:"px-5 py-4 text-start",children:l("thMedia")}),s.jsx("th",{className:"px-5 py-4 text-center",children:l("thWelcome")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:f?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 text-muted",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-blue border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:l("loading")})]})})}):o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 px-4",children:s.jsxs("div",{className:"max-w-md mx-auto flex flex-col items-center gap-3",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-panel-raised flex items-center justify-center text-muted",children:s.jsx(DN,{size:28})}),s.jsx("h4",{className:"text-base font-bold text-text-main",children:i==="ar"?"لا توجد مجموعات حتى الآن":"No active groups found"}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:i==="ar"?"بمجرد إضافة البوت إلى مجموعات واتساب، ستظهر تلقائياً هنا مع خيارات الإشراف والحماية.":"Once the bot is added to WhatsApp groups, they will automatically appear here with full moderation and anti-link controls."})]})})}):o.map(y=>{var b;return s.jsxs("tr",{className:"hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-5 py-4 font-bold text-text-main",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-brand-blue/10 text-brand-cyan flex items-center justify-center font-bold text-sm shrink-0",children:(y.subject||"G").charAt(0).toUpperCase()}),s.jsx("span",{className:"line-clamp-1",children:y.subject||(i==="ar"?"مجموعة بدون اسم":"Unnamed group")})]})}),s.jsx("td",{className:"px-5 py-4 font-mono text-xs text-muted",children:s.jsx("bdi",{className:"px-2 py-1 rounded bg-bg-soft border border-line select-all",children:((b=y.jid)==null?void 0:b.split("@")[0])||y.jid})}),s.jsx("td",{className:"px-5 py-4",children:s.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-panel-raised border border-line text-xs font-semibold text-text-main",children:y.memberCount||"—"})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsx(vl,{checked:!!y.antilink,onChange:S=>N(y.jid,{antilink:S})})}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("select",{className:"h-9 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:y.mediaRestriction||"none",onChange:S=>N(y.jid,{mediaRestriction:S.target.value}),children:[s.jsx("option",{value:"none",children:i==="ar"?"بلا قيود (الكل)":"No Restrictions"}),s.jsx("option",{value:"block_all",children:i==="ar"?"حظر كافة الوسائط":"Block All Media"})]})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsx(vl,{checked:!!y.welcomeEnabled,onChange:S=>N(y.jid,{welcomeEnabled:S})})})]},y.jid)})})]})})]})};var db;const Jd=typeof((db=window.LevixHost)==null?void 0:db.hostLog)=="function",nw=({socket:l})=>{const{t:i,language:c}=at(),[o,d]=w.useState([]),[f,h]=w.useState("all"),[p,x]=w.useState(!0),N=w.useRef(null),[y,b]=w.useState("bot"),[S,O]=w.useState([]);w.useEffect(()=>{y==="bot"&&K.getLogs().then(M=>{M!=null&&M.logs&&d(M.logs)}).catch(()=>{})},[y]),w.useEffect(()=>{if(y!=="bot"||!l)return;const M=q=>{d(te=>[...te.slice(-400),q])};return l.on("log",M),()=>{l.off("log",M)}},[l,y]);const C=w.useCallback(()=>{var M;try{const q=((M=window.LevixHost)==null?void 0:M.hostLog(500))??"";O(q?q.split(`
513
+ `).filter(Boolean):[])}catch{O([])}},[]);w.useEffect(()=>{if(y!=="host"||!Jd)return;C();const M=setInterval(C,3e3);return()=>clearInterval(M)},[y,C]),w.useEffect(()=>{p&&N.current&&N.current.scrollIntoView({behavior:"smooth"})},[o,S,p]);const E=o.filter(M=>f==="all"?!0:M.level===f),A=y==="bot"?E.length:S.length;return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 md:p-5 shadow-sm flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(xs,{size:20})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("h2",{className:"text-base md:text-lg font-bold text-text-main",children:i("liveServerLogs")}),s.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-mono font-bold bg-panel-raised border border-line text-muted",children:A})]}),s.jsx("p",{className:"text-xs text-muted mt-0.5",children:c==="ar"?"سجل أحداث النظام واتصالات واتساب واستدعاءات الذكاء الاصطناعي في الوقت الفعلي":"Real-time streaming console for WhatsApp socket, AI calls, and bot commands"})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap sm:flex-nowrap",children:[Jd&&s.jsxs("div",{className:"flex rounded-xl border border-line overflow-hidden",children:[s.jsx("button",{type:"button",onClick:()=>b("bot"),className:`px-3 h-10 text-xs font-semibold transition-colors ${y==="bot"?"bg-brand-cyan/15 text-brand-cyan":"bg-panel-raised text-muted hover:text-text-main"}`,children:i("logSourceBot")}),s.jsxs("button",{type:"button",onClick:()=>b("host"),className:`px-3 h-10 text-xs font-semibold transition-colors border-s border-line flex items-center gap-1.5 ${y==="host"?"bg-brand-cyan/15 text-brand-cyan":"bg-panel-raised text-muted hover:text-text-main"}`,children:[s.jsx(Ni,{size:13}),i("logSourceHost")]})]}),y==="bot"&&s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(hN,{size:15,className:"absolute start-3 text-muted pointer-events-none"}),s.jsxs("select",{className:"h-10 ps-9 pe-8 rounded-xl border border-line bg-panel-raised text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:f,onChange:M=>h(M.target.value),children:[s.jsx("option",{value:"all",children:i("allLogs")}),s.jsx("option",{value:"info",children:"INFO"}),s.jsx("option",{value:"warn",children:"WARN"}),s.jsx("option",{value:"error",children:"ERROR"})]})]}),y==="host"&&Jd&&s.jsxs("button",{type:"button",onClick:()=>{var M;try{(M=window.LevixHost)==null||M.shareHostLogs()}catch{}},className:"inline-flex items-center gap-1.5 px-3 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-muted hover:text-brand-cyan text-xs font-semibold transition-colors",title:i("shareLogs"),children:[s.jsx(To,{size:14}),s.jsx("span",{children:i("share")})]}),s.jsxs("button",{type:"button",onClick:()=>x(!p),className:`inline-flex items-center gap-1.5 px-3 h-10 rounded-xl border text-xs font-semibold transition-colors ${p?"bg-brand-cyan/15 text-brand-cyan border-brand-cyan/30":"bg-panel-raised text-muted border-line hover:text-text-main"}`,title:"Auto-scroll to latest log entry",children:[s.jsx(W2,{size:14,className:p?"animate-bounce":""}),s.jsx("span",{children:p?"Auto-scroll ON":"Auto-scroll OFF"})]}),s.jsxs("button",{type:"button",onClick:()=>{y==="bot"?d([]):O([])},className:"inline-flex items-center gap-1.5 px-3 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-muted hover:text-danger text-xs font-semibold transition-colors",title:"Clear logs view",children:[s.jsx(bs,{size:14}),s.jsx("span",{children:i("clearLogs")})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-[#030712] p-4 md:p-5 shadow-2xl h-[65vh] overflow-y-auto font-mono text-xs leading-relaxed flex flex-col gap-1.5 text-slate-300",dir:"ltr",children:[y==="bot"?E.length===0?s.jsxs("div",{className:"m-auto text-center py-16 text-muted text-xs flex flex-col items-center gap-2",children:[s.jsx(xs,{size:24,className:"opacity-40"}),s.jsx("span",{children:i("noLogs")})]}):E.map((M,q)=>{const te=M.level==="error"?"text-red-400 bg-red-500/10 border-red-500/20":M.level==="warn"?"text-amber-300 bg-amber-500/10 border-amber-500/20":"text-cyan-400 bg-cyan-500/10 border-cyan-500/20";return s.jsxs("div",{className:"flex items-baseline gap-2.5 py-0.5 hover:bg-white/[0.03] px-1 rounded transition-colors",children:[s.jsx("span",{className:"text-slate-500 shrink-0 select-none text-[11px]",children:M.time||new Date().toLocaleTimeString()}),s.jsx("span",{className:`inline-flex items-center px-1.5 py-0.2 rounded border font-mono font-bold text-[10px] shrink-0 ${te}`,children:(M.level||"info").toUpperCase()}),s.jsx("span",{className:"text-slate-200 break-all font-mono",children:M.msg})]},q)}):S.length===0?s.jsxs("div",{className:"m-auto text-center py-16 text-muted text-xs flex flex-col items-center gap-2",children:[s.jsx(Ni,{size:24,className:"opacity-40"}),s.jsx("span",{children:i("noLogs")})]}):S.map((M,q)=>s.jsx("div",{className:"flex items-baseline gap-2.5 py-0.5 hover:bg-white/[0.03] px-1 rounded transition-colors",children:s.jsx("span",{className:"text-slate-200 break-all font-mono",children:M})},q)),s.jsx("div",{ref:N})]})]})},aw=({status:l,onNavigate:i})=>{var C;const{t:c,language:o}=at(),{toast:d}=Gt(),[f,h]=w.useState(null),[p,x]=w.useState(!0);w.useEffect(()=>{let E=!0;return K.getStats().then(A=>{E&&(A!=null&&A.stats)&&h(A.stats)}).catch(A=>{d(A.message,"error")}).finally(()=>{E&&x(!1)}),()=>{E=!1}},[d]);const N=E=>{const A=Math.floor(E/86400),M=Math.floor(E%86400/3600),q=Math.floor(E%3600/60);return A?`${A}d ${M}h`:M?`${M}h ${q}m`:`${q}m`},y=(l==null?void 0:l.state)==="connected",b=async()=>{try{await K.startSession(),d(c("starting"),"info")}catch(E){d(E.message,"error")}},S=async()=>{try{await K.stopSession(),d(c("stop"),"info")}catch(E){d(E.message,"error")}},O=[{id:"connection",title:c("connection"),desc:y?c("connected"):c(l==null?void 0:l.state,"disconnected"),icon:Ci,color:"text-brand-cyan bg-brand-cyan/10 border-brand-cyan/20"},{id:"ai",title:c("ai"),desc:c("aiAssistantDesc")||"Autonomous tool-calling AI agent",icon:bf,color:"text-purple-400 bg-purple-500/10 border-purple-500/20"},{id:"commands",title:c("commands"),desc:`${(f==null?void 0:f.commandCount)??56} active bot commands & aliases`,icon:xs,color:"text-brand-blue bg-blue-500/10 border-blue-500/20"},{id:"settings",title:c("settings"),desc:c("settingsSub")||"Prefix, ports, delays, security & storage",icon:S0,color:"text-ok bg-ok/10 border-ok/20"}];return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised via-panel to-panel p-5 sm:p-6 shadow-sm flex flex-col sm:flex-row sm:items-center justify-between gap-5",children:[s.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 border ${y?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20"}`,children:s.jsx($2,{size:24})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-extrabold text-text-main tracking-tight truncate",children:y?c("connected"):c(l==null?void 0:l.state,"disconnected")}),s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold border ${y?"bg-ok/10 text-ok border-ok/30":"bg-warn/10 text-warn border-warn/30"}`,children:[s.jsx("span",{className:"pulse-dot"}),y?"ONLINE":"OFFLINE"]})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted truncate mt-1",children:y?(C=l==null?void 0:l.user)!=null&&C.id?s.jsx("bdi",{dir:"ltr",children:`+${l.user.id.split("@")[0]}`}):c("activeListening"):c("pausedOrLinking")})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap shrink-0",children:[y?s.jsxs("button",{type:"button",onClick:S,className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-danger/15 hover:border-danger/40 hover:text-danger text-text-main text-xs sm:text-sm font-bold transition-all focus-visible:ring-2 focus-visible:ring-danger/50",children:[s.jsx(rf,{size:16}),s.jsx("span",{children:c("stop")})]}):s.jsxs("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center gap-2 px-5 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white text-xs sm:text-sm font-bold shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(zN,{size:16}),s.jsx("span",{children:c("start")})]}),s.jsxs("button",{type:"button",onClick:()=>i("connection"),className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main text-xs sm:text-sm font-bold transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(Ci,{size:16,className:"text-brand-cyan"}),s.jsx("span",{children:c("connection")})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-brand-blue/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("totalGroups")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-blue-500/10 text-brand-blue flex items-center justify-center shrink-0 border border-blue-500/20",children:s.jsx(ps,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:p?"—":(f==null?void 0:f.totalGroups)??0})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-brand-cyan/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("commandCount")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0 border border-brand-cyan/20",children:s.jsx(xs,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:p?"—":(f==null?void 0:f.commandCount)??0})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-ok/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("uptime")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-ok/10 text-ok flex items-center justify-center shrink-0 border border-ok/20",children:s.jsx(cN,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:p?"—":N((f==null?void 0:f.uptime)||0)})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-purple-500/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("activeSchedules")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-purple-500/10 text-purple-400 flex items-center justify-center shrink-0 border border-purple-500/20",children:s.jsx(lf,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:p?"—":(f==null?void 0:f.activeSchedules)??0})]})]}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4",children:O.map(E=>{const A=E.icon;return s.jsxs("button",{type:"button",onClick:()=>i(E.id),className:"group rounded-2xl border border-line bg-panel hover:bg-panel-hover p-4 sm:p-5 shadow-sm text-start flex flex-col justify-between gap-3 sm:gap-4 transition-all hover:-translate-y-0.5 hover:border-brand-blue/30 focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("div",{className:`w-9 h-9 sm:w-10 sm:h-10 rounded-xl flex items-center justify-center shrink-0 border ${E.color}`,children:s.jsx(A,{size:18})}),s.jsx("div",{className:"w-7 h-7 rounded-full bg-white/[0.04] border border-white/[0.08] flex items-center justify-center text-muted group-hover:text-brand-cyan group-hover:border-brand-cyan/40 group-hover:bg-brand-cyan/10 transition-all",children:s.jsx(iN,{size:14,className:"rtl:rotate-180 transition-transform group-hover:translate-x-0.5 rtl:group-hover:-translate-x-0.5"})})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs sm:text-sm font-bold text-text-main group-hover:text-brand-cyan transition-colors",children:E.title}),s.jsx("p",{className:"text-[11px] sm:text-xs text-muted mt-0.5 line-clamp-2 leading-relaxed",children:E.desc})]})]},E.id)})}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 shadow-sm flex items-center gap-3.5",children:[s.jsx(mN,{size:20,className:"text-faint shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-xs font-semibold text-muted",children:c("dataDir")}),s.jsx("div",{className:"text-xs font-mono text-text-main truncate text-start",dir:"ltr",children:(f==null?void 0:f.dataDir)||"..."})]})]})]})},lw=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],sw=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],iw=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],Sy=[1,2,3,4,6,8,12];function rw(){const l=window.LevixHost;return!!(l&&typeof l.pickContact=="function")}function ow(l){let i=String(l||"").replace(/\D/g,"");return i.startsWith("00")&&(i=i.slice(2)),i.length<8||i.length>15?null:`${i}@s.whatsapp.net`}function fa(l){const i=String(l||"").trim();return!i||i.includes("@")?null:i}function cw(l,i){return fa(l.savedName)||fa(l.pushName)||fa(l.name)||fa(l.targetLabel)||l.phone||i}function hf(l){return String(l).padStart(2,"0")}function uw(l,i){const c=l.map(o=>i?iw[o]:sw[o]);return i?c.join(" و"):c.length===1?c[0]:c.length===2?`${c[0]} and ${c[1]}`:`${c.slice(0,-1).join(", ")} and ${c[c.length-1]}`}function dw(l){return l===1?"كل ساعة":l===2?"كل ساعتين":l>=3&&l<=10?`كل ${l} ساعات`:`كل ${l} ساعة`}function fw(l,i,c,o,d,f,h,p){const x=/^\d{1,2}:\d{2}$/.test(i),N=h||"UTC";if(l==="hourly")return!Number.isInteger(d)||!Sy.includes(d)||!Number.isInteger(f)||f<0||f>59?null:p?`${`${dw(d)} عند الدقيقة ${f}`} (${N})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${N})`;if(!x)return null;const[y,b]=i.split(":").map(Number);if(y>23||b>59)return null;const S=`${hf(y)}:${hf(b)}`;if(l==="daily")return p?`يومياً الساعة ${S} (${N})`:`Daily at ${S} (${N})`;if(l==="weekly"){const O=[...new Set(c.filter(E=>E>=0&&E<=6))].sort((E,A)=>E-A);if(!O.length)return null;const C=uw(O,p);return p?`كل يوم ${C} الساعة ${S} (${N})`:`Every ${C} at ${S} (${N})`}return l==="monthly"?!Number.isInteger(o)||o<1||o>31?null:p?`كل شهر في اليوم ${o} الساعة ${S} (${N})`:`Every month on day ${o} at ${S} (${N})`:null}const mw=({isConnected:l=!1,onNavigate:i})=>{const{t:c,language:o}=at(),{toast:d}=Gt(),[f,h]=w.useState([]),[p,x]=w.useState("UTC"),[N,y]=w.useState(!0),[b,S]=w.useState([]),[O,C]=w.useState(!1),[E,A]=w.useState(null),[M,q]=w.useState(""),[te,Z]=w.useState(!1),[ie,J]=w.useState(""),[_,j]=w.useState("recurring"),[I,Q]=w.useState("daily"),[se,ce]=w.useState("09:00"),[oe,F]=w.useState([1]),[Y,G]=w.useState(1),[X,ue]=w.useState(1),[je,H]=w.useState(0),[re,Ae]=w.useState(""),[ke,v]=w.useState(!1),T=3,ne=f.length>=T,le=o==="ar",ve=w.useMemo(()=>fw(I,se,oe,Y,X,je,p,le),[I,se,oe,Y,X,je,p,le]),xe=async()=>{try{const ae=await K.getSchedules();ae!=null&&ae.schedules&&(h(ae.schedules),ae.timezone&&x(ae.timezone))}catch(ae){d(ae.message,"error")}finally{y(!1)}},we=async()=>{C(!0);try{const ae=await K.getRecipients();ae!=null&&ae.recipients&&S(ae.recipients)}catch{}finally{C(!1)}};w.useEffect(()=>{xe(),l&&we()},[l]);const fe=async ae=>{try{await K.deleteSchedule(ae),d(c("savedSuccessfully"),"success"),h(_e=>_e.filter(Ve=>Ve.id!==ae))}catch(_e){d(_e.message,"error")}},pe=async ae=>{if(!l){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await K.retrySchedule(ae),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),xe()}catch(_e){d(_e.message,"error")}},dt=async()=>{const ae=window.LevixHost;if(!(ae!=null&&ae.pickContact)){d(o==="ar"?"دليل الهاتف متاح من تطبيق أندرويد فقط":"Phone book is available in the Android app","info");return}const _e=await new Promise(Ne=>{var yt;const Je=Pt=>{window.removeEventListener("levix-contact",Je);const gt=Pt.detail;if(!(gt!=null&&gt.phone)){Ne(null);return}Ne({name:String(gt.name||""),phone:String(gt.phone)})};window.addEventListener("levix-contact",Je);try{(yt=ae.pickContact)==null||yt.call(ae)}catch{window.removeEventListener("levix-contact",Je),Ne(null)}});if(!_e)return;const Ve=ow(_e.phone);if(!Ve){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const Ct=`+${Ve.split("@")[0]}`,de=fa(_e.name);A({id:Ve,name:de||Ct,savedName:de,pushName:null,phone:Ct,type:"contact"})},ee=()=>{A(null),q(""),J(""),j("recurring"),Q("daily"),ce("09:00"),F([1]),G(1),ue(1),H(0),Ae("")},De=()=>{if(!l){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(ne){d(c("maxSchedulesReached"),"warning");return}ee(),Z(!0),b.length||we()},Be=ae=>{F(_e=>_e.includes(ae)?_e.filter(Ve=>Ve!==ae):[..._e,ae].sort((Ve,Ct)=>Ve-Ct))},Re=async()=>{if(!E){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!ie.trim()){d(o==="ar"?"يرجى كتابة نص الرسالة":"Please write the message text","warning");return}if(_==="once"&&(!re||new Date(re).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if(_==="recurring"&&I==="weekly"&&oe.length===0){d(c("weekdayRequired"),"warning");return}v(!0);const ae={targetJid:E.id,message:ie.trim(),type:_};if(E.type==="contact"){const _e=fa(E.savedName)||fa(E.name);_e&&_e!==E.phone&&(ae.targetName=_e)}if(_==="recurring"){const _e={kind:I};I==="hourly"?(_e.everyHours=X,_e.time=`00:${hf(je)}`):(_e.time=se,I==="weekly"&&(_e.weekdays=oe),I==="monthly"&&(_e.dayOfMonth=Y)),ae.recurrence=_e}else ae.scheduledTime=new Date(re).getTime();try{await K.createSchedule(ae),d(c("savedSuccessfully"),"success"),Z(!1),ee(),xe()}catch(_e){d(_e.message,"error")}finally{v(!1)}},ze=b.filter(ae=>{var Ve,Ct,de;const _e=M.toLowerCase().trim();return _e?ae.name.toLowerCase().includes(_e)||!!((Ve=ae.savedName)!=null&&Ve.toLowerCase().includes(_e))||!!((Ct=ae.pushName)!=null&&Ct.toLowerCase().includes(_e))||!!((de=ae.phone)!=null&&de.toLowerCase().includes(_e)):!0}),xt=(ae,_e,Ve=!0)=>{var yt;if(ae.type==="group"||ae.targetKind==="group"||!!((yt=ae.targetJid)!=null&&yt.includes("@g.us"))){const Pt=fa(ae.name)||(fa(ae.targetLabel)&&ae.targetLabel!=="Group"?ae.targetLabel:null)||c("groupFallback");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-brand-cyan min-w-0",children:[Ve&&s.jsx(ps,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${_e} truncate`,children:Pt})]})}const de=ae.phone||ae.targetPhone||null,Ne=cw(ae,c("contactFallback")),Je=!!(de&&Ne!==de);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[Ve&&s.jsx(vd,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${_e} truncate block`,children:Ne}),Je&&s.jsx("span",{className:"block text-[11px] text-muted font-mono",dir:"ltr",children:de})]})]})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[!l&&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(jo,{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("button",{type:"button",onClick:()=>i==null?void 0:i("connection"),className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl bg-warn hover:bg-warn/90 text-bg font-bold text-xs sm:text-sm shadow-sm transition-all shrink-0",children:s.jsx("span",{children:o==="ar"?"الذهاب للاتصال":"Go to Connection"})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm 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-12 h-12 rounded-2xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(nf,{size:24})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:c("schedules")}),s.jsxs("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-bold border ${ne?"bg-warn/15 text-warn border-warn/30":"bg-brand-cyan/10 text-brand-cyan border-brand-cyan/20"}`,children:[f.length," / ",T," ",c("scheduledCount")]})]}),s.jsxs("p",{className:"text-xs md:text-sm text-muted mt-1",children:[c("timezoneLabel"),":"," ",s.jsx("code",{className:"text-brand-cyan font-mono font-semibold px-1.5 py-0.5 rounded bg-bg-soft border border-line",children:p})," ","· ",c("headerSubtitle")]})]})]}),s.jsxs("button",{type:"button",onClick:De,disabled:ne||!l,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-5 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 shrink-0 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Co,{size:18}),s.jsx("span",{children:l?c(ne?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"})]})]}),s.jsx("div",{className:"rounded-2xl border border-line bg-panel overflow-hidden shadow-sm overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[680px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-5 py-4 text-start",children:c("thTarget")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thMessage")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thSchedule")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thType")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thDelivery")}),s.jsx("th",{className:"px-5 py-4 text-center",children:c("thActions")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:N?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 text-muted",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:c("loading")})]})})}):f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 text-muted text-xs sm:text-sm",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx(nf,{size:28,className:"text-muted/40"}),s.jsx("span",{children:c("noSchedules")})]})})}):f.map(ae=>s.jsxs("tr",{className:"hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-5 py-4 text-xs text-text-main",children:s.jsx("bdi",{children:xt({targetJid:ae.targetJid,targetKind:ae.targetKind,targetLabel:ae.targetLabel,targetPhone:ae.targetPhone,savedName:ae.savedName,pushName:ae.pushName,phone:ae.phone},"font-semibold max-w-[12rem]")})}),s.jsx("td",{className:"px-5 py-4 max-w-xs text-text-main truncate text-xs sm:text-sm",children:ae.message}),s.jsx("td",{className:"px-5 py-4 text-xs text-muted",children:le?ae.whenAr||ae.when:ae.when||ae.cronString||"—"}),s.jsx("td",{className:"px-5 py-4",children:s.jsx("span",{className:`inline-flex px-2.5 py-0.5 rounded-lg text-xs font-semibold ${ae.type==="recurring"?"bg-brand-blue/10 text-brand-cyan":"bg-purple-500/10 text-purple-400"}`,children:ae.type==="recurring"?c("typeRecurring"):c("typeOnce")})}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-bold ${ae.lastDeliveryStatus==="failed"?"bg-danger/10 text-danger border border-danger/25":ae.status==="active"?"bg-ok/10 text-ok border border-ok/25":"bg-muted/10 text-muted"}`,children:[ae.lastDeliveryStatus==="failed"?s.jsx(jo,{size:13}):s.jsx(Ai,{size:13}),s.jsx("span",{children:ae.lastDeliveryStatus==="failed"?c("deliveryFailed"):ae.status==="active"?c("deliveryActive"):ae.status})]})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[ae.lastDeliveryStatus==="failed"&&s.jsx("button",{type:"button",onClick:()=>pe(ae.id),className:"inline-flex items-center justify-center w-8 h-8 rounded-lg border border-line bg-panel-raised hover:bg-panel-hover text-brand-cyan transition-colors",title:"Retry delivery",children:s.jsx(wo,{size:14})}),s.jsx("button",{type:"button",onClick:()=>fe(ae.id),className:"inline-flex items-center justify-center w-8 h-8 rounded-lg border border-danger/25 bg-danger/10 hover:bg-danger/20 text-danger transition-colors",title:c("delete"),children:s.jsx(bs,{size:14})})]})})]},ae.id))})]})}),s.jsx(tn,{isOpen:te,onClose:()=>Z(!1),title:c("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>Z(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:c("cancel")}),s.jsx("button",{type:"button",onClick:Re,disabled:ke||!E||!ie.trim(),className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all disabled:opacity-50",children:c(ke?"saving":"scheduleAction")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"block text-xs font-bold text-text-main",children:[c("selectRecipient")," ",s.jsx("span",{className:"text-danger",children:"*"})]}),E?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:E.type==="group"?s.jsx(ps,{size:16}):s.jsx(vd,{size:16})}),s.jsx("div",{className:"min-w-0",children:xt(E,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx("button",{type:"button",onClick:()=>A(null),className:"p-1 rounded-lg hover:bg-panel text-muted hover:text-danger transition-colors",title:c("changeChat"),children:s.jsx(ys,{size:16})})]}):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 flex-1",children:[s.jsx(vf,{size:16,className:"absolute start-3 top-3 text-muted"}),s.jsx("input",{type:"search",value:M,onChange:ae=>q(ae.target.value),placeholder:c("searchRecipients"),"aria-label":c("searchRecipients"),className:"w-full h-10 ps-9 pe-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50"})]}),rw()&&s.jsxs("button",{type:"button",onClick:dt,className:"inline-flex items-center justify-center gap-1.5 h-10 px-3 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main text-xs font-bold shrink-0",title:c("pickPhoneContactHint"),children:[s.jsx(nN,{size:15}),s.jsx("span",{className:"hidden sm:inline",children:c("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:O?s.jsx("div",{className:"p-4 text-center text-xs text-muted",children:c("loading")}):ze.length===0?s.jsx("div",{className:"p-4 text-center text-xs text-muted",children:c("noRecipientsFound")}):ze.map(ae=>s.jsxs("button",{type:"button",onClick:()=>A(ae),className:"w-full p-2.5 flex items-center justify-between gap-2 hover:bg-panel text-start transition-colors",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:ae.type==="group"?s.jsx(ps,{size:14}):s.jsx(vd,{size:14})}),s.jsx("div",{className:"min-w-0",children:xt(ae,"text-xs font-bold text-text-main",!1)})]}),s.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded bg-panel text-muted shrink-0",children:ae.type==="group"?c("groupFallback"):c("contactFallback")})]},ae.id))})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"schedule-type",className:"block text-xs font-bold text-text-main",children:c("scheduleType")}),s.jsxs("select",{id:"schedule-type",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:_,onChange:ae=>j(ae.target.value),children:[s.jsx("option",{value:"recurring",children:c("scheduleRecurring")}),s.jsx("option",{value:"once",children:c("scheduleOnce")})]})]}),_==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"repeat-kind",className:"block text-xs font-bold text-text-main",children:c("repeat")}),s.jsxs("select",{id:"repeat-kind",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:I,onChange:ae=>Q(ae.target.value),children:[s.jsx("option",{value:"daily",children:c("repeatDaily")}),s.jsx("option",{value:"weekly",children:c("repeatWeekly")}),s.jsx("option",{value:"monthly",children:c("repeatMonthly")}),s.jsx("option",{value:"hourly",children:c("repeatHourly")})]})]}),I==="weekly"&&s.jsxs("fieldset",{className:"space-y-1.5",children:[s.jsx("legend",{className:"block text-xs font-bold text-text-main",children:c("weekdays")}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:lw.map((ae,_e)=>{const Ve=oe.includes(_e);return s.jsx("button",{type:"button","aria-pressed":Ve,onClick:()=>Be(_e),className:`h-9 px-2.5 rounded-lg text-xs font-bold border transition-colors ${Ve?"bg-brand-blue text-white border-brand-blue":"bg-panel-raised text-text-main border-line hover:bg-panel-hover"}`,children:c(ae)},ae)})})]}),I==="monthly"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"day-of-month",className:"block text-xs font-bold text-text-main",children:c("dayOfMonth")}),s.jsx("input",{id:"day-of-month",type:"number",min:1,max:31,inputMode:"numeric",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:Y,onChange:ae=>G(Number(ae.target.value))}),s.jsx("p",{className:"text-xs text-muted",children:c("monthDayHint")})]}),I==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"every-hours",className:"block text-xs font-bold text-text-main",children:c("everyHours")}),s.jsx("select",{id:"every-hours",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:X,onChange:ae=>ue(Number(ae.target.value)),children:Sy.map(ae=>s.jsx("option",{value:ae,children:ae},ae))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"hourly-minute",className:"block text-xs font-bold text-text-main",children:c("atMinute")}),s.jsx("input",{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:je,onChange:ae=>H(Number(ae.target.value)),dir:"ltr"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{htmlFor:"send-time",className:"block text-xs font-bold text-text-main",children:[c("sendTime"),s.jsxs("span",{className:"ms-1.5 font-semibold text-muted",children:["(",p,")"]})]}),s.jsx("input",{id:"send-time",type:"time",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:se,onChange:ae=>ce(ae.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:[c("recurrencePreview"),": "]}),s.jsx("span",{dir:"auto",children:ve||"—"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"one-off-time",className:"block text-xs font-bold text-text-main",children:c("deliveryDateTime")}),s.jsx("input",{id:"one-off-time",type:"datetime-local",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:re,onChange:ae=>Ae(ae.target.value),dir:"ltr"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{htmlFor:"schedule-message",className:"block text-xs font-bold text-text-main",children:[c("messageText")," ",s.jsx("span",{className:"text-danger",children:"*"})]}),s.jsx("textarea",{id:"schedule-message",className:"w-full p-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50 resize-y min-h-[90px]",rows:3,placeholder:c("messagePlaceholder"),value:ie,onChange:ae=>J(ae.target.value)})]})]})})]})},sb={messageMin:10,messageMax:2e3},$d={bug:{icon:aN,labelKey:"feedbackTopicBug"},idea:{icon:NN,labelKey:"feedbackTopicIdea"},question:{icon:sf,labelKey:"feedbackTopicQuestion"},praise:{icon:pN,labelKey:"feedbackTopicPraise"},other:{icon:Ti,labelKey:"feedbackTopicOther"}},hw=["bug","idea","question","praise","other"],pw=()=>{var _;const{t:l}=at(),{toast:i}=Gt(),[c,o]=w.useState(null),[d,f]=w.useState("bug"),[h,p]=w.useState(""),[x,N]=w.useState(0),[y,b]=w.useState(""),[S,O]=w.useState(!1),[C,E]=w.useState(!1);w.useEffect(()=>{K.getFeedbackMeta().then(o).catch(()=>{})},[]);const A=(c==null?void 0:c.messageMin)??sb.messageMin,M=(c==null?void 0:c.messageMax)??sb.messageMax,q=h.trim(),te=Math.max(0,A-q.length),Z=((_=c==null?void 0:c.topics)!=null&&_.length?c.topics:hw).filter(j=>j in $d),ie=async j=>{if(j.preventDefault(),!(te>0||S)){O(!0);try{await K.sendFeedback({message:q,topic:d,rating:x||null,contact:y.trim()||null}),E(!0),i(l("feedbackSent"),"success")}catch(I){i(I.message,"error")}finally{O(!1)}}},J=()=>{p(""),b(""),N(0),f("bug"),E(!1)};return C?s.jsxs("div",{className:"rounded-2xl border border-ok/30 bg-panel p-6 sm:p-8 text-center shadow-sm",children:[s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-ok/10 text-ok flex items-center justify-center",children:s.jsx(Ai,{size:26})}),s.jsx("h3",{className:"mt-4 text-lg font-bold text-text-main",children:l("feedbackSent")}),s.jsx("p",{className:"mt-2 mx-auto max-w-md text-xs sm:text-sm text-muted leading-relaxed",children:l("feedbackSentDesc")}),s.jsx("button",{type:"button",onClick:J,className:"mt-6 inline-flex items-center justify-center px-4 h-11 rounded-xl border border-line bg-panel-raised text-text-main font-bold text-xs sm:text-sm hover:bg-panel-hover transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:l("feedbackSendAnother")})]}):s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("form",{onSubmit:ie,className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm 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(Ti,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("feedbackTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("feedbackDesc")})]})]}),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-2",children:l("feedbackTopicLabel")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:Z.map(j=>{const I=$d[j].icon,Q=d===j;return s.jsxs("button",{type:"button","aria-pressed":Q,onClick:()=>f(j),className:Mt("inline-flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl border font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",Q?"bg-brand-blue text-white border-brand-blue shadow-md shadow-brand-blue/20":"bg-panel-raised border-line text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(I,{size:16,className:"shrink-0"}),s.jsx("span",{children:l($d[j].labelKey)})]},j)})})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{htmlFor:"feedback-message",className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackMessageLabel")}),s.jsx("textarea",{id:"feedback-message",rows:6,required:!0,maxLength:M,value:h,onChange:j=>p(j.target.value),placeholder:l("feedbackMessagePlaceholder"),className:"w-full resize-y px-3.5 py-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-brand-blue/50"}),s.jsx("span",{className:"self-end text-[11px] text-muted tabular-nums",children:te>0?`${te} ${l("feedbackCharsNeeded")}`:`${h.length} / ${M}`})]}),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:l("feedbackRatingLabel")}),s.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(j=>s.jsx("button",{type:"button","aria-label":`${j} / 5`,"aria-pressed":x===j,onClick:()=>N(x===j?0:j),className:"p-2 rounded-lg hover:bg-panel-hover transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:s.jsx(Sf,{size:22,className:Mt("transition-colors",j<=x?"fill-brand-cyan text-brand-cyan":"text-muted")})},j))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{htmlFor:"feedback-contact",className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackContactLabel")}),s.jsx("input",{id:"feedback-contact",type:"text",maxLength:200,value:y,onChange:j=>b(j.target.value),placeholder:l("feedbackContactPlaceholder"),className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50"})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 pt-1",children:[c!=null&&c.runtime?s.jsxs("span",{className:"text-[11px] text-muted",children:[l("feedbackRuntimeLabel"),": v",c.runtime.version," · ",c.runtime.platform]}):s.jsx("span",{}),s.jsxs("button",{type:"submit",disabled:te>0||S,className:"inline-flex items-center justify-center gap-2 px-5 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm transition-all shadow-md shadow-brand-blue/20 focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Ti,{size:16}),s.jsx("span",{children:l(S?"feedbackSending":"feedbackSendBtn")})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(Nf,{size:16,className:"text-brand-cyan shrink-0"}),s.jsx("h4",{className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackWhatIsSent")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("feedbackWhatIsSentDesc")}),s.jsxs("div",{className:"pt-2 border-t border-line flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[s.jsx("span",{className:"text-xs text-muted leading-relaxed",children:l("feedbackGithubHint")}),s.jsxs("a",{href:"https://github.com/Abdodiab2005/levix/issues",target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 text-xs font-bold text-brand-cyan hover:underline whitespace-nowrap",children:[l("feedbackOpenGithub"),s.jsx(fN,{size:13})]})]})]})]})},xw=["!","/",".","#","$","?"],gw="levix-settings";function bw(l){const i=new TextEncoder().encode(l);let c="";for(const o of i)c+=String.fromCharCode(o);return btoa(c)}const yw=()=>{var we,fe,pe,dt;const{t:l,language:i,setLanguage:c}=at(),{toast:o}=Gt(),[d,f]=w.useState("general"),[h,p]=w.useState({}),[x,N]=w.useState(!0),[y,b]=w.useState("!"),[S,O]=w.useState("!"),[C,E]=w.useState(!1),[A,M]=w.useState(""),[q,te]=w.useState(""),[Z,ie]=w.useState(""),[J,_]=w.useState(!1),[j,I]=w.useState(!1),[Q,se]=w.useState(!1),[ce,oe]=w.useState(!1),[F,Y]=w.useState(!1),[G,X]=w.useState(!1),[ue,je]=w.useState(!1),[H,re]=w.useState(null),Ae=w.useRef(null),ke=async()=>{var ee;X(!0);try{const De=await K.exportSettings(),Be=JSON.stringify(De,null,2),Re=`levix-settings-${((ee=De.exportedAt)==null?void 0:ee.slice(0,10))||"export"}.json`,ze=window.LevixHost;if(ze&&typeof ze.saveExportFile=="function"){const Ve=JSON.parse(ze.saveExportFile(Re,bw(Be)));if(!(Ve!=null&&Ve.ok))throw new Error((Ve==null?void 0:Ve.error)||l("exportSettingsError"));o(`${l("exportSettingsSuccess")} — ${l("exportSavedTo")} ${Ve.dir}`,"success");return}const xt=new Blob([Be],{type:"application/json"}),ae=URL.createObjectURL(xt),_e=document.createElement("a");_e.href=ae,_e.download=Re,_e.click(),URL.revokeObjectURL(ae),o(l("exportSettingsSuccess"),"success")}catch(De){o(De.message||l("exportSettingsError"),"error")}finally{X(!1)}},v=async ee=>{var Re;const De=(Re=ee.target.files)==null?void 0:Re[0];if(ee.target.value="",!De)return;let Be;try{Be=JSON.parse(await De.text())}catch{o(l("importSettingsError"),"error");return}if((Be==null?void 0:Be.format)!==gw){o(l("importSettingsError"),"error");return}re(Be)},T=async()=>{var ee,De,Be;if(H){je(!0);try{const Re=await K.importSettings(H),ze=[`${((ee=Re.applied)==null?void 0:ee.length)||0} ${l("importSettingsCount")}`];(De=Re.skipped)!=null&&De.length&&ze.push(`${l("importSkipped")}: ${Re.skipped.length}`),(Be=Re.restartNeeded)!=null&&Be.length&&ze.push(`${l("importRestartNeeded")}: ${Re.restartNeeded.join(", ")}`),o(`${l("importSuccess")} — ${ze.join(" · ")}`,"success"),re(null),await ne()}catch(Re){o(Re.message,"error")}finally{je(!1)}}},ne=async()=>{try{const ee=await K.getSettings();if(ee!=null&&ee.settings){const De={};ee.settings.forEach(Be=>{De[Be.key]=Be.value}),p(De)}ee!=null&&ee.prefix&&(b(ee.prefix),O(ee.prefix))}catch(ee){o(ee.message,"error")}finally{N(!1)}};w.useEffect(()=>{ne()},[]);const le=async(ee,De)=>{p(Be=>({...Be,[ee]:De}));try{await K.updateSetting(ee,De),o(l("savedSuccessfully"),"success")}catch(Be){o(Be.message,"error")}},ve=async ee=>{const De=(ee!==void 0?ee:S).trim();if(!De||De.length>3){o(l("prefixValidation"),"error");return}E(!0);try{await K.updatePrefix(De),b(De),O(De),o(`${l("prefixUpdated")} (${De})`,"success")}catch(Be){o(Be.message,"error")}finally{E(!1)}},xe=async ee=>{if(ee.preventDefault(),q!==Z){o(l("passwordMatchError"),"error");return}if(q.length<8){o(l("passwordMinLength"),"error");return}_(!0);try{await K.changePassword(A,q),o(l("passwordChangedSuccess"),"success"),M(""),te(""),ie("")}catch(De){o(De.message,"error")}finally{_(!1)}};return x?s.jsxs("div",{className:"flex items-center justify-center p-12 text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("loading")})]}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{role:"tablist","aria-label":"Settings Categories",className:"flex items-center gap-1.5 p-1.5 rounded-2xl bg-panel border border-line overflow-x-auto no-scrollbar shadow-sm",children:[s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="general",onClick:()=>f("general"),className:Mt("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="general"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(S0,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabGeneral")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="integrations",onClick:()=>f("integrations"),className:Mt("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="integrations"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(af,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabIntegrations")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="proxy",onClick:()=>f("proxy"),className:Mt("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="proxy"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(Ei,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabProxy")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="security",onClick:()=>f("security"),className:Mt("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="security"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(Nf,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabSecurity")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="storage",onClick:()=>f("storage"),className:Mt("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="storage"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(xg,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabStorage")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="feedback",onClick:()=>f("feedback"),className:Mt("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="feedback"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(_N,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabFeedback")})]})]}),d==="general"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised to-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4 sm:gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3",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(xs,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("prefixTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("prefixDesc")})]})]}),s.jsxs("div",{className:"flex items-center gap-2 self-start sm:self-auto",children:[s.jsxs("span",{className:"text-xs text-muted font-semibold",children:[l("activePrefix"),":"]}),s.jsx("span",{className:"inline-flex items-center justify-center px-3 py-1 rounded-lg bg-brand-cyan/15 text-brand-cyan font-mono font-bold text-base border border-brand-cyan/30 shadow-sm",children:y})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-4 pt-1",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs text-muted font-semibold",children:l("prefixPresets")}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:xw.map(ee=>{const De=y===ee;return s.jsx("button",{type:"button",className:Mt("w-10 h-10 sm:w-11 sm:h-11 rounded-xl border font-mono font-bold text-sm transition-all flex items-center justify-center focus-visible:ring-2 focus-visible:ring-brand-blue/50",De?"bg-brand-cyan text-slate-900 border-brand-cyan shadow-sm":"bg-panel-raised border-line text-text-main hover:bg-panel-hover"),onClick:()=>{O(ee),ve(ee)},children:ee},ee)})})]}),s.jsxs("div",{className:"flex flex-col gap-1.5 flex-1 min-w-[200px]",children:[s.jsx("span",{className:"text-xs text-muted font-semibold",children:l("changePrefix")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"text",className:"w-20 sm:w-24 h-11 px-3 text-center font-mono font-bold text-base rounded-xl border border-line bg-panel text-text-main focus:outline-none focus:ring-2 focus:ring-brand-blue/50 shrink-0",maxLength:3,placeholder:l("prefixPlaceholder"),value:S,onChange:ee=>O(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&ve()}}),s.jsxs("button",{type:"button",onClick:()=>ve(),disabled:C||S.trim()===y,className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm whitespace-nowrap transition-all shadow-md shadow-brand-blue/20 focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",children:[s.jsx(ko,{size:16}),s.jsx("span",{children:l(C?"saving":"prefixSaveBtn")})]})]})]})]}),s.jsxs("div",{className:"rounded-xl bg-bg-soft/70 border border-line p-3 flex flex-wrap items-center gap-2 text-xs sm:text-sm",children:[s.jsx("span",{className:"font-semibold text-muted",children:l("prefixPreview")}),s.jsx("div",{className:"px-2 py-0.5 rounded-lg bg-panel border border-line font-mono font-medium text-brand-cyan text-xs",children:s.jsxs("code",{children:[S||y,"help"]})}),s.jsx("div",{className:"px-2 py-0.5 rounded-lg bg-panel border border-line font-mono font-medium text-brand-cyan text-xs",children:s.jsxs("code",{children:[S||y,"lang ar"]})}),s.jsx("div",{className:"px-2 py-0.5 rounded-lg bg-panel border border-line font-mono font-medium text-brand-cyan text-xs",children:s.jsxs("code",{children:[S||y,"sticker"]})})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4",children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:i==="ar"?"سلوك النظام والردود":"System Behavior & Delays"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("interfaceLanguage")}),s.jsxs("select",{className:"w-full h-11 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:i,onChange:ee=>c(ee.target.value),children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("interfaceLanguageDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botLanguage")}),s.jsxs("select",{className:"w-full h-11 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.bot_language||"auto",onChange:ee=>le("bot_language",ee.target.value),children:[s.jsx("option",{value:"auto",children:l("langAuto")}),s.jsx("option",{value:"ar",children:l("langAr")}),s.jsx("option",{value:"en",children:l("langEn")})]}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("botLanguageDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botTimezone")}),s.jsx("input",{type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised font-mono text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"Africa/Cairo",value:h.bot_timezone||"Africa/Cairo",onChange:ee=>p({...h,bot_timezone:ee.target.value}),onBlur:ee=>le("bot_timezone",ee.target.value)}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("botTimezoneDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botMinDelay")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.bot_min_delay_ms||400,onChange:ee=>p({...h,bot_min_delay_ms:Number(ee.target.value)}),onBlur:ee=>le("bot_min_delay_ms",Number(ee.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("delaysDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botMaxDelay")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.bot_max_delay_ms||900,onChange:ee=>p({...h,bot_max_delay_ms:Number(ee.target.value)}),onBlur:ee=>le("bot_max_delay_ms",Number(ee.target.value))})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-3 border-b border-line",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-brand-blue/10 text-brand-blue flex items-center justify-center shrink-0",children:s.jsx(To,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("shareSettingsTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("shareSettingsDesc")})]})]}),s.jsxs("div",{className:"flex flex-row gap-3",children:[s.jsxs("button",{type:"button",onClick:ke,disabled:G,className:"flex-1 min-w-0 inline-flex items-center justify-center gap-1.5 sm:gap-2 px-2.5 sm:px-5 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",children:[s.jsx(yf,{size:16,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:l("exportSettings")})]}),s.jsxs("button",{type:"button",onClick:()=>{var ee;return(ee=Ae.current)==null?void 0:ee.click()},className:"flex-1 min-w-0 inline-flex items-center justify-center gap-1.5 sm:gap-2 px-2.5 sm:px-5 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(R0,{size:16,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:l("importSettings")})]}),s.jsx("input",{ref:Ae,type:"file",accept:"application/json,.json",className:"hidden",onChange:v})]})]})]}),d==="integrations"&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3.5 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(af,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("tabIntegrations")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("integrationsDesc")})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[s.jsx("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main mb-1",children:l("weatherApiKey")}),s.jsx("p",{className:"text-xs text-muted mb-3",children:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:ce?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"OpenWeatherMap API Key",value:h.openweathermap_api_key||"",onChange:ee=>p({...h,openweathermap_api_key:ee.target.value}),onBlur:ee=>le("openweathermap_api_key",ee.target.value)}),s.jsx("button",{type:"button",onClick:()=>oe(!ce),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:ce?s.jsx(ms,{size:16}):s.jsx(da,{size:16})})]})]})}),s.jsx("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main mb-1",children:l("youtubeApiKey")}),s.jsx("p",{className:"text-xs text-muted mb-3",children:i==="ar"?"مطلوب لأدوات البحث ومعلومات الفيديوهات من يوتيوب":"Required for YouTube search and video tools"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:F?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"YouTube Data API Key",value:h.youtube_api_key||"",onChange:ee=>p({...h,youtube_api_key:ee.target.value}),onBlur:ee=>le("youtube_api_key",ee.target.value)}),s.jsx("button",{type:"button",onClick:()=>Y(!F),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:F?s.jsx(ms,{size:16}):s.jsx(da,{size:16})})]})]})})]})]}),d==="proxy"&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3.5 min-w-0 flex-1",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-blue-500/10 text-brand-blue flex items-center justify-center shrink-0",children:s.jsx(Ei,{size:22})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main truncate",children:l("proxyTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5 truncate",children:l("proxyDesc")})]})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(vl,{checked:!!h.whatsapp_proxy_enabled,onChange:ee=>le("whatsapp_proxy_enabled",ee)})})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyProtocol")}),s.jsxs("select",{className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.whatsapp_proxy_protocol||"http",onChange:ee=>le("whatsapp_proxy_protocol",ee.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.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyHost")}),s.jsx("input",{type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised font-mono text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"proxy.example.com",value:h.whatsapp_proxy_host||"",onChange:ee=>p({...h,whatsapp_proxy_host:ee.target.value}),onBlur:ee=>le("whatsapp_proxy_host",ee.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyPort")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"1080",value:h.whatsapp_proxy_port||"",onChange:ee=>p({...h,whatsapp_proxy_port:Number(ee.target.value)}),onBlur:ee=>le("whatsapp_proxy_port",Number(ee.target.value))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyUsername")}),s.jsx("input",{type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised font-mono text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.whatsapp_proxy_username||"",onChange:ee=>p({...h,whatsapp_proxy_username:ee.target.value}),onBlur:ee=>le("whatsapp_proxy_username",ee.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:j?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.whatsapp_proxy_password||"",onChange:ee=>p({...h,whatsapp_proxy_password:ee.target.value}),onBlur:ee=>le("whatsapp_proxy_password",ee.target.value)}),s.jsx("button",{type:"button",onClick:()=>I(!j),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:j?s.jsx(ms,{size:16}):s.jsx(da,{size:16})})]})]})]})]}),d==="security"&&s.jsx("div",{className:"flex flex-col gap-5",children:s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4 max-w-xl",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-3 border-b border-line",children:[s.jsx(SN,{size:20,className:"text-ok"}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("changePassword")})]}),s.jsxs("form",{onSubmit:xe,className:"flex flex-col gap-3.5",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("currentPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:Q?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",required:!0,value:A,onChange:ee=>M(ee.target.value)}),s.jsx("button",{type:"button","aria-label":i==="ar"?"إظهار كلمة السر":"Show password",onClick:()=>se(!Q),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:Q?s.jsx(ms,{size:16}):s.jsx(da,{size:16})})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("newPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:Q?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",required:!0,minLength:8,value:q,onChange:ee=>te(ee.target.value)}),s.jsx("button",{type:"button","aria-label":i==="ar"?"إظهار كلمة السر":"Show password",onClick:()=>se(!Q),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:Q?s.jsx(ms,{size:16}):s.jsx(da,{size:16})})]}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("passwordMinLength")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("confirmPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:Q?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",required:!0,minLength:8,value:Z,onChange:ee=>ie(ee.target.value)}),s.jsx("button",{type:"button","aria-label":i==="ar"?"إظهار كلمة السر":"Show password",onClick:()=>se(!Q),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:Q?s.jsx(ms,{size:16}):s.jsx(da,{size:16})})]})]}),s.jsxs("button",{type:"submit",disabled:J,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 self-start mt-2",children:[s.jsx(ko,{size:16}),s.jsx("span",{children:l(J?"saving":"save")})]})]})]})}),d==="storage"&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3.5 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-purple-500/10 text-purple-400 flex items-center justify-center shrink-0",children:s.jsx(xg,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("storageTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("storageDesc")})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("forwardTtl")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.forward_score_ttl_days||30,onChange:ee=>p({...h,forward_score_ttl_days:Number(ee.target.value)}),onBlur:ee=>le("forward_score_ttl_days",Number(ee.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("forwardTtlDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("maxFetchBytes")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.max_fetch_bytes||524288,onChange:ee=>p({...h,max_fetch_bytes:Number(ee.target.value)}),onBlur:ee=>le("max_fetch_bytes",Number(ee.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("maxFetchBytesDesc")})]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"sticker-library-limit",className:"block text-xs sm:text-sm font-bold text-text-main",children:l("stickerLibraryLimit")}),s.jsx("input",{id:"sticker-library-limit",type:"number",min:1,max:1e5,className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.sticker_library_limit||1e3,onChange:ee=>p({...h,sticker_library_limit:Number(ee.target.value)}),onBlur:ee=>le("sticker_library_limit",Number(ee.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("stickerLibraryLimitDesc")})]})})]}),d==="feedback"&&s.jsx(pw,{}),s.jsx(tn,{isOpen:!!H,onClose:()=>re(null),title:l("importTitle"),footer:s.jsxs("div",{className:"flex gap-3 justify-end",children:[s.jsx("button",{type:"button",onClick:()=>re(null),className:"px-5 h-10 rounded-xl border border-line text-muted hover:text-text-main font-bold text-xs sm:text-sm transition-colors",children:i==="ar"?"إلغاء":"Cancel"}),s.jsx("button",{type:"button",onClick:T,disabled:ue,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all disabled:opacity-50",children:l("importApply")})]}),children:H&&s.jsxs("div",{className:"flex flex-col gap-3 text-xs sm:text-sm text-text-main",children:[s.jsx("p",{className:"text-muted",children:l("importSummary")}),s.jsxs("ul",{className:"flex flex-col gap-1.5 bg-panel-raised rounded-xl border border-line p-4",children:[s.jsxs("li",{children:[l("importPrefix"),":"," ",s.jsx("span",{className:"font-mono font-bold",children:(we=H.commands)==null?void 0:we.prefix})]}),s.jsxs("li",{children:[Object.keys(H.settings||{}).length," ",l("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((fe=H.commands)==null?void 0:fe.permissions)||{}).length," ",l("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((pe=H.commands)==null?void 0:pe.aliases)||{}).length," ",l("importAliasesCount")]}),s.jsxs("li",{children:[(((dt=H.commands)==null?void 0:dt.disabled)||[]).length," ",l("importDisabledCount")]})]})]})})]})},Oo=()=>window.LevixHost,ji=new Map;let ib=!1;function vw(){ib||(ib=!0,window.__levixHostDone=(l,i)=>{const c=ji.get(l);ji.delete(l),c==null||c(i)})}function Of(l,i,c){const o=Oo(),d=o==null?void 0:o[l];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});vw();const f=crypto.randomUUID();return new Promise(h=>{var x,N,y;const p=b=>{h(b)};ji.set(f,p);try{const b=l==="pickStickerSource"?(x=o.pickStickerSource)==null?void 0:x.call(o,f):l==="uploadSource"?(N=o.uploadSource)==null?void 0:N.call(o,f,i[0],i[1],i[2]):(y=o.exportFile)==null?void 0:y.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),S=JSON.parse(b||"");S.ok||(ji.delete(f),p(S))}catch{ji.delete(f),p({ok:!1,code:"UNAVAILABLE"})}})}function yo(){var l;return typeof((l=Oo())==null?void 0:l.pickStickerSource)=="function"}function Mo(){var l;return typeof((l=Oo())==null?void 0:l.exportFile)=="function"}async function Nw(){const l=await Of("pickStickerSource",[]);if(!l.ok&&!l.cancelled)throw Mf(l);return l.ok&&l.token&&l.url?l:null}function Sw(){try{const l=Oo(),i=l!=null&&l.takePendingSticker?JSON.parse(l.takePendingSticker()):null;return i!=null&&i.ok&&i.token&&i.url&&["create","save"].includes(i.intent)?i:null}catch{return null}}function Mf(l){l.status===401&&(window.location.href="/login");const i=l.body,c=i?(()=>{try{return JSON.parse(i)}catch{return null}})():null,o=l.cancelled?"CANCELLED":l.code==="UNAVAILABLE"?"STORAGE_UNAVAILABLE":l.code;return new ma(l.status||0,(c==null?void 0:c.error)||l.error||o||"Sticker operation failed",c||{code:o})}async function jy(l,i,c,o){const d=await Of("uploadSource",[l,i,c]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw Mf(d);try{return JSON.parse(d.body||"")}catch{throw new ma(d.status,"Invalid upload response",{code:"INTERNAL"})}}async function jw(l,i,c,o,d,f){const h=await Of("exportFile",[l,i,c,o,d,f]);if(!h.ok)throw Mf(h);return h}const ww={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 kw(l){return l?ww[l]??null:null}function Df(l,i){const c=kw(i);return l(c||"stickerErr_INTERNAL")}function ut(l,i){return i instanceof ma?Df(l,i.code):l("stickerErr_INTERNAL")}function _w(l,i){const o=i?{probing:"jobStage_probing",decoding:"jobStage_decoding",encoding:"jobStage_encoding",optimizing:"jobStage_optimizing",queued:"jobQueued"}[i]:null;return l(o||"jobQueued")}function Ia(l,i){return l.replace(/\{([A-Za-z0-9_]+)\}/g,(c,o)=>Object.hasOwn(i,o)?String(i[o]):c)}function Eo(l,i){return`${[...(l||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function wy(l,i){const c=URL.createObjectURL(l),o=document.createElement("a");o.href=c,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(c),1500)}async function ky(l,i){return wy(l,i),{ok:!0,via:"browser"}}async function _y(l,i,c){const o=new File([l],i,{type:c});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 wy(l,i),{ok:!0,via:"browser"}}async function Do(l,i,c,o,d,f){const h=await jw(l,i,c,o,d,f);return l==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:h.name||d,dir:h.dir||"Downloads/Levix"}}const Ka={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function Ro(l,i,c,o){return{name:l||i,mime:c.type||o,blob:c}}async function wi(l,i){if(Mo())return Do("save",`/dashboard/api/stickers/${encodeURIComponent(l.id)}/export?format=${i}`,"GET","",Eo(l.name,i),Ka[i]);const c=await K.exportSticker(l.id,i),o=Ro(c.fileName,Eo(l.name,i),c.blob,Ka[i]);return ky(o.blob,o.name)}async function Ey(l,i){if(Mo())return Do("share",`/dashboard/api/stickers/${encodeURIComponent(l.id)}/export?format=${i}`,"GET","",Eo(l.name,i),Ka[i]);const c=await K.exportSticker(l.id,i),o=Ro(c.fileName,Eo(l.name,i),c.blob,Ka[i]);return _y(o.blob,o.name,o.mime)}async function Ew(l,i){if(Mo())return Do("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:l,format:i}),`stickers-${i}.zip`,Ka.zip);const c=await K.exportStickers(l,i),o=Ro(c.fileName,`stickers-${i}.zip`,c.blob,Ka.zip);return ky(o.blob,o.name)}async function Cw(l,i){if(Mo())return Do("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:l,format:i}),`stickers-${i}.zip`,Ka.zip);const c=await K.exportStickers(l,i),o=Ro(c.fileName,`stickers-${i}.zip`,c.blob,Ka.zip);return _y(o.blob,o.name,o.mime)}async function pf(l){if(l.length)try{await K.bulkStickers({action:"touch",ids:l})}catch{}}const Tw=16*1024*1024,rb=200,Aw=10,Cy=40,Lo=60,zw=60;function ki(l){const i=[...l.trim()].length;return i<1?"empty":i>Cy?"long":null}function Ow(l){return l.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(l.name)}function Mw(l){return new Promise(i=>{const c=URL.createObjectURL(l),o=new Image;o.onload=()=>{URL.revokeObjectURL(c),i({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(c),i(null)},o.src=c})}function Dw(l){return new Promise(i=>{const c=URL.createObjectURL(l),o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{const d={width:o.videoWidth,height:o.videoHeight,duration:o.duration};URL.revokeObjectURL(c),o.src="",i(d)},o.onerror=()=>{URL.revokeObjectURL(c),i(null)},o.src=c})}async function Rw(l,i){if(l.size<=0)return"stickerErr_NO_MEDIA";if(l.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(Ow(l)){const o=await Dw(l);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 c=await Mw(l);return c&&(c.width>i.maxSide||c.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}const Lw={primary:"bg-brand-blue hover:bg-brand-blue/90 text-white shadow-md shadow-brand-blue/20",ghost:"border border-line bg-panel-raised hover:bg-panel-hover text-text-main",danger:"bg-danger hover:bg-danger/90 text-white shadow-md shadow-danger/25",quiet:"text-muted hover:bg-panel-hover hover:text-text-main"};function Ce({variant:l="ghost",className:i,children:c,...o}){return s.jsx("button",{...o,type:"button",className:Mt("inline-flex items-center justify-center gap-1.5 px-3 h-10 rounded-xl font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",Lw[l],i),children:c})}function Sn({label:l,danger:i,className:c,children:o,...d}){return s.jsxs("button",{...d,type:"button",title:l,"aria-label":l,className:Mt("inline-flex items-center gap-1.5 px-2.5 min-h-9 rounded-lg border text-xs font-bold transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",i?"border-danger/40 text-danger hover:bg-danger/10":"border-line bg-panel-raised text-text-main hover:bg-panel-hover",c),children:[o,s.jsx("span",{className:"hidden md:inline",children:l})]})}const Yt="w-full h-10 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50";function vo({children:l,htmlFor:i}){return s.jsx("label",{htmlFor:i,className:"block text-xs font-bold text-text-main mb-1",children:l})}function Rf({icon:l,text:i}){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-2 text-muted",children:[l,s.jsx("span",{className:"text-xs sm:text-sm text-center",children:i})]})}function gs({text:l}){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-2 text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:l})]})}function Uw(l){return!l||l==="transparent"?"transparent":l==="#ffffff"?"white":l==="#000000"?"black":"custom"}const Bw=({options:l,onChange:i,kind:c,durationMs:o,limits:d,canRemoveBackground:f,animatedOk:h,name:p,onName:x,packId:N,onPack:y,packs:b})=>{var Z,ie,J;const{t:S}=at(),O=c==="video"||c==="gif",C=o>0?o/1e3:d.videoSeconds,E=Math.min(d.videoSeconds,Math.max(0,C)),A=Uw(l.background),M=((Z=l.removeBackground)==null?void 0:Z.tolerance)??.15,q=l.rotate??0,te=(_,j)=>{const I=Math.min(E,Math.max(0,_)),Q=Math.min(d.stickerSeconds,Math.max(.5,j));i({trim:{start:I,duration:Q}})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[!h&&O&&s.jsx("p",{className:"text-xs text-warn",children:S("animatedUnavailable")}),s.jsxs("div",{children:[s.jsx(vo,{htmlFor:"sticker-fit",children:S("fit")}),s.jsxs("select",{id:"sticker-fit",className:Yt,value:l.fit||"contain",onChange:_=>i({fit:_.target.value==="cover"?"cover":"contain"}),children:[s.jsx("option",{value:"contain",children:S("contain")}),s.jsx("option",{value:"cover",children:S("cover")})]})]}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-zoom",children:[S("zoom")," (",(l.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:l.zoom??1,onChange:_=>i({zoom:Number(_.target.value)})}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-x",children:[S("panX")," (",(l.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:l.panX??0,onChange:_=>i({panX:Number(_.target.value)})}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-y",children:[S("panY")," (",(l.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:l.panY??0,onChange:_=>i({panY:Number(_.target.value)})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Ce,{onClick:()=>i({panX:0,panY:0,zoom:1}),children:S("resetPan")}),s.jsxs(Ce,{onClick:()=>{const _=(q+90)%360;i({rotate:_})},children:[S("rotateQuarter")," (",q,"°)"]})]}),s.jsx("p",{className:"text-xs font-bold",children:S("background")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:[["transparent",S("transparent")],["white",S("white")],["black",S("black")],["custom",S("customColor")]].map(([_,j])=>s.jsx(Ce,{variant:A===_?"primary":"ghost",onClick:()=>{i(_==="transparent"?{background:"transparent"}:_==="white"?{background:"#ffffff"}:_==="black"?{background:"#000000"}:{background:"#3366ff"})},children:j},_))}),A==="custom"&&s.jsx("input",{type:"color","aria-label":S("customColor"),value:/^#[0-9a-f]{6}$/i.test(l.background||"")?l.background:"#3366ff",onChange:_=>i({background:_.target.value.toLowerCase()}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),f&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:((ie=l.removeBackground)==null?void 0:ie.mode)==="plain",onChange:_=>i({removeBackground:_.target.checked?{mode:"plain",tolerance:.15}:null})}),S("removePlainBackground")]}),s.jsx("p",{className:"text-xs text-muted",children:S("stickerRemoveHint")}),((J=l.removeBackground)==null?void 0:J.mode)==="plain"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-tolerance",children:[S("tolerance")," (",M.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:M,onChange:_=>i({removeBackground:{mode:"plain",tolerance:Number(_.target.value)}})})]})]}),O&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:!!l.trim,onChange:_=>{_.target.checked?te(0,Math.min(d.stickerSeconds,Math.max(.5,C))):i({trim:null})}}),S("trim")]}),s.jsx("p",{className:"text-xs text-muted",children:S(c==="gif"?"gifTrimNote":"trimApplied")}),l.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[S("trimStart")," (",l.trim.start.toFixed(1)," ",S("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:E,step:.1,value:l.trim.start,onChange:_=>{var j;return te(Number(_.target.value),((j=l.trim)==null?void 0:j.duration)??.5)}}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-duration",children:[S("trimDuration")," (",l.trim.duration.toFixed(1)," ",S("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:l.trim.duration,onChange:_=>{var j;return te(((j=l.trim)==null?void 0:j.start)??0,Number(_.target.value))}})]})]}),s.jsxs("div",{children:[s.jsx(vo,{htmlFor:"sticker-name",children:S("stickerName")}),s.jsx("input",{id:"sticker-name",value:p,maxLength:Lo,onChange:_=>x(_.target.value),placeholder:S("stickerNamePlaceholder"),className:Yt})]}),s.jsxs("div",{children:[s.jsx(vo,{htmlFor:"sticker-pack",children:S("targetPack")}),s.jsxs("select",{id:"sticker-pack",value:N,onChange:_=>y(_.target.value),className:Yt,children:[s.jsx("option",{value:"",children:S("noPack")}),b.map(_=>s.jsx("option",{value:_.id,children:_.name},_.id))]})]})]})},Et=512;function Hw(l,i,c){const o=c.fit||"contain",d=c.zoom??1,f=c.panX??0,h=c.panY??0,p=c.rotate??0,x=p===90||p===270,N=x?i:l,y=x?l:i,S=(o==="cover"?Et/Math.min(N,y):Et/Math.max(N,y))*d,O=Math.max(1,Math.round(N*S)),C=Math.max(1,Math.round(y*S)),E=Math.round((Et-O)/2+f*Math.abs(Et-O)/2),A=Math.round((Et-C)/2+h*Math.abs(Et-C)/2);return{width:O,height:C,x:E,y:A}}const qw='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function Gw(l){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(l)}function Pw(l){const i=/^#([0-9a-f]{6})$/i.exec(l.trim());if(!i)return"#000000";const c=Number.parseInt(i[1],16),o=c>>16&255,d=c>>8&255,f=c&255;return(.2126*o+.7152*d+.0722*f)/255>.6?"#000000":"#ffffff"}function Vw(l,i,c,o,d,f){const h=Math.max(0,Math.min(f,o/2,d/2));l.beginPath(),l.moveTo(i+h,c),l.arcTo(i+o,c,i+o,c+d,h),l.arcTo(i+o,c+d,i,c+d,h),l.arcTo(i,c+d,i,c,h),l.arcTo(i,c,i+o,c,h),l.closePath(),l.fill()}function Yw(l,i,c,o){const d=l==="center"?"center":l==="start"?i==="rtl"?"right":"left":i==="rtl"?"left":"right";return d==="center"?-c/2-o:d==="right"?-c-o:-o}function Ty(l,i,c){const o=[];for(const d of i){if(!d.text)continue;const f=Gw(d.text)?"rtl":"ltr";l.save(),l.translate(d.x,d.y),l.rotate(d.rotate*Math.PI/180),l.direction=f,l.font=`${d.fontSize}px ${qw}`,l.textAlign=d.align,l.textBaseline="middle";const h=l.measureText(d.text).width,p=d.background?d.fontSize*.4:8,x=d.background?d.fontSize*.22:6,N=h+p*2,y=d.fontSize*1.25+x*2,b=Yw(d.align,f,h,p),S=-y/2;d.background&&(l.fillStyle="rgba(0, 0, 0, 0.55)",Vw(l,b,S,N,y,y/2)),c===d.id&&(l.strokeStyle="#38bdf8",l.lineWidth=2,l.strokeRect(b-3,S-3,N+6,y+6)),d.outline&&(l.lineJoin="round",l.miterLimit=2,l.lineWidth=Math.max(2,d.fontSize/10),l.strokeStyle=Pw(d.color),l.strokeText(d.text,0,0)),l.fillStyle=d.color,l.fillText(d.text,0,0),l.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:b,top:S,right:b+N,bottom:S+y})}return o}function Iw(l,i,c){for(let o=l.length-1;o>=0;o--){const d=l[o],f=i-d.cx,h=c-d.cy,p=-d.rotate*Math.PI/180,x=f*Math.cos(p)-h*Math.sin(p),N=f*Math.sin(p)+h*Math.cos(p);if(x>=d.left&&x<=d.right&&N>=d.top&&N<=d.bottom)return d.id}return null}function Kw(l){const i=l.filter(d=>d.text.trim().length>0);if(!i.length)return;const c=document.createElement("canvas");c.width=512,c.height=512;const o=c.getContext("2d");if(o)return Ty(o,i,null),c.toDataURL("image/png")}const Qw=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function fo(l,i,c){return Math.min(c,Math.max(i,l))}const Xw=({mediaUrl:l,kind:i,width:c,height:o,options:d,layers:f,selectedId:h,onPan:p,onSelect:x,onMoveLayer:N,label:y})=>{const b=w.useRef(null),S=w.useRef(null),O=w.useRef([]),C=w.useRef(null),E=w.useRef(null),A=w.useRef(1),M=d.rotate??0,q=c>0&&o>0?Hw(c,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:M}):null,te=M===90||M===270,Z=q?te?q.height:q.width:0,ie=q?te?q.width:q.height:0,J=q?q.x+(q.width-Z)/2:0,_=q?q.y+(q.height-ie)/2:0,j=d.background&&d.background!=="transparent"?d.background:null;w.useEffect(()=>{const F=b.current;if(!F)return;const Y=()=>{const X=Math.min(F.clientWidth,512);A.current=X>0?X/Et:1,F.style.setProperty("--stage-scale",String(A.current))};Y();const G=new ResizeObserver(Y);return G.observe(F),()=>G.disconnect()},[]),w.useEffect(()=>{const F=S.current;if(!F)return;const Y=window.devicePixelRatio||1;F.width=Et*Y,F.height=Et*Y;const G=F.getContext("2d");G&&(G.setTransform(Y,0,0,Y,0,0),G.clearRect(0,0,Et,Et),O.current=Ty(G,f,h))},[f,h]),w.useEffect(()=>{const F=E.current,Y=d.trim;if(!F||!Y||i!=="video"||!l)return;const G=Y.start,X=Y.start+Y.duration,ue=()=>{(F.currentTime<G-.05||F.currentTime>=X-.02)&&(F.currentTime=G)};return F.addEventListener("timeupdate",ue),F.addEventListener("ended",ue),F.currentTime=G,()=>{F.removeEventListener("timeupdate",ue),F.removeEventListener("ended",ue)}},[d.trim,i,l]);const I=F=>{const Y=F.currentTarget.getBoundingClientRect();return{x:(F.clientX-Y.left)/Y.width*Et,y:(F.clientY-Y.top)/Y.height*Et}},Q=F=>{if(F.button!==0)return;F.currentTarget.setPointerCapture(F.pointerId);const Y=I(F),G=Iw(O.current,Y.x,Y.y);if(G){const X=f.find(ue=>ue.id===G);if(!X)return;x(G),C.current={kind:"layer",id:G,x:Y.x,y:Y.y,originX:X.x,originY:X.y};return}x(null),q&&(C.current={kind:"pan",x:Y.x,y:Y.y,panX:d.panX??0,panY:d.panY??0,placeW:q.width,placeH:q.height})},se=F=>{const Y=C.current;if(!Y)return;const G=I(F);if(Y.kind==="layer"){N(Y.id,fo(Y.originX+(G.x-Y.x),0,Et),fo(Y.originY+(G.y-Y.y),0,Et));return}const X=Math.abs(Et-Y.placeW),ue=Math.abs(Et-Y.placeH),je=X<1?Y.panX:fo(Y.panX+(G.x-Y.x)*2/X,-1,1),H=ue<1?Y.panY:fo(Y.panY+(G.y-Y.y)*2/ue,-1,1);p(je,H)},ce=()=>{C.current=null},oe={position:"absolute",left:J,top:_,width:Z,height:ie,transform:`rotate(${M}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:b,className:"w-full",children:s.jsx("div",{className:"relative mx-auto overflow-hidden rounded-2xl border border-line",style:{width:"calc(512px * var(--stage-scale, 1))",height:"calc(512px * var(--stage-scale, 1))"},children:s.jsxs("div",{role:"img","aria-label":y,className:"absolute top-0 start-0 origin-top-left",style:{width:Et,height:Et,transform:"scale(var(--stage-scale, 1))",backgroundColor:"#1a1a1e",backgroundImage:"linear-gradient(45deg, #2c2c31 25%, transparent 25%), linear-gradient(-45deg, #2c2c31 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2c2c31 75%), linear-gradient(-45deg, transparent 75%, #2c2c31 75%)",backgroundSize:"32px 32px",backgroundPosition:"0 0, 0 16px, 16px -16px, -16px 0"},children:[j&&s.jsx("div",{className:"absolute inset-0",style:{background:j}}),q&&i==="video"?s.jsx("video",{ref:E,src:l,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:oe}):q&&s.jsx("img",{src:l,alt:"",draggable:!1,style:oe}),s.jsx("canvas",{ref:S,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:Q,onPointerMove:se,onPointerUp:ce,onPointerCancel:ce})]})})})},Fw=({layers:l,selectedId:i,onSelect:c,onChange:o,onDelete:d,onAddText:f,onAddEmoji:h})=>{const{t:p}=at(),x=l.find(N=>N.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(Ce,{onClick:f,children:p("addText")}),s.jsx(Ce,{onClick:()=>h("😀"),children:p("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(vo,{children:p("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:Qw.map(N=>s.jsx("button",{type:"button",className:"w-9 h-9 rounded-lg border border-line hover:bg-panel-hover text-lg",onClick:()=>h(N),"aria-label":N,children:N},N))}),s.jsx("label",{className:"block mt-2 text-xs font-bold text-text-main",htmlFor:"emoji-free",children:p("customEmoji")}),s.jsx("input",{id:"emoji-free",className:`${Yt} mt-1`,placeholder:p("emojiInputLabel"),onKeyDown:N=>{if(N.key==="Enter"){const y=N.currentTarget.value.trim();y&&(h(y),N.currentTarget.value="")}}})]}),l.length===0&&s.jsx("p",{className:"text-xs text-muted",children:p("noLayers")}),l.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:l.map(N=>s.jsx("button",{type:"button","aria-pressed":N.id===i,onClick:()=>c(N.id),className:`text-start px-3 py-2 rounded-lg border text-sm truncate ${N.id===i?"border-brand-blue bg-brand-blue/10":"border-line"}`,children:N.text||p("textPlaceholder")},N.id))}),x&&s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-line p-3",children:[s.jsx("p",{className:"text-xs font-bold",children:p("layerSelected")}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-text",children:p("textContent")}),s.jsx("input",{id:"layer-text",value:x.text,onChange:N=>o(x.id,{text:N.target.value}),className:Yt}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-size",children:p("textSize")}),s.jsx("input",{id:"layer-size",type:"range",min:16,max:200,value:x.fontSize,onChange:N=>o(x.id,{fontSize:Number(N.target.value)})}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-color",children:p("textColor")}),s.jsx("input",{id:"layer-color",type:"color",value:/^#[0-9a-f]{6}$/i.test(x.color)?x.color:"#ffffff",onChange:N=>o(x.id,{color:N.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx("p",{className:"text-xs font-bold",children:p("textAlignment")}),s.jsx("div",{className:"flex gap-1",children:["start","center","end"].map(N=>s.jsx(Ce,{className:"flex-1",variant:x.align===N?"primary":"ghost",onClick:()=>o(x.id,{align:N}),children:p(N==="start"?"stickerAlignmentStart":N==="center"?"stickerAlignmentCenter":"stickerAlignmentEnd")},N))}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-rotate",children:p("layerRotation")}),s.jsx("input",{id:"layer-rotate",type:"range",min:-180,max:180,value:x.rotate,onChange:N=>o(x.id,{rotate:Number(N.target.value)})}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:x.outline,onChange:N=>o(x.id,{outline:N.target.checked})}),p("textOutline")]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:x.background,onChange:N=>o(x.id,{background:N.target.checked})}),p("textBackground")]}),s.jsxs(Ce,{variant:"danger",onClick:()=>d(x.id),children:[s.jsx(bs,{size:14}),p("deleteLayer")]})]})]})},Ay=({open:l,title:i,packs:c,onClose:o,onPick:d,onCreated:f})=>{const{t:h}=at(),{toast:p}=Gt(),[x,N]=w.useState(""),[y,b]=w.useState(null),[S,O]=w.useState(!1);w.useEffect(()=>{l||(N(""),b(null))},[l]);const C=async()=>{if(ki(x)){b(h("packNameLength"));return}O(!0),b(null);try{const A=await K.createPack(x.trim());N(""),f(A),d(A.id),p(h("packCreated"),"success")}catch(A){p(ut(h,A),"error")}finally{O(!1)}};return s.jsx(tn,{isOpen:l,onClose:o,title:i,footer:s.jsx(Ce,{onClick:o,children:h("close")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[c.length===0?s.jsx("p",{className:"text-sm text-muted",children:h("noPacks")}):s.jsx("div",{className:"flex flex-col gap-1.5 max-h-64 overflow-y-auto",children:c.map(E=>s.jsxs("button",{type:"button",onClick:()=>d(E.id),className:"w-full text-start px-3 py-2.5 rounded-xl border border-line hover:bg-panel-hover text-sm font-semibold",children:[E.name,s.jsx("span",{className:"text-muted font-medium ms-2",children:E.count})]},E.id))}),s.jsxs("div",{className:"flex flex-col gap-1.5 border-t border-line pt-3",children:[s.jsx("label",{className:"text-xs font-bold text-text-main",htmlFor:"new-pack-name",children:h("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{id:"new-pack-name",value:x,onChange:E=>{const A=E.target.value;N(A),y&&b(ki(A)?h("packNameLength"):null)},placeholder:h("newPackPlaceholder"),className:Yt,maxLength:80}),s.jsx(Ce,{variant:"primary",onClick:C,disabled:S,children:h("createPack")})]}),y&&s.jsx("p",{className:"text-xs text-danger",children:y})]})]})})},zy=({open:l,busy:i,onClose:c,onPick:o})=>{const{t:d}=at(),[f,h]=w.useState([]),[p,x]=w.useState(""),[N,y]=w.useState(!1),[b,S]=w.useState(null);w.useEffect(()=>{if(!l)return;let C=!1;return y(!0),S(null),K.getRecipients().then(E=>{C||h(E.recipients)}).catch(E=>{C||S(ut(d,E))}).finally(()=>{C||y(!1)}),()=>{C=!0}},[l,d]);const O=w.useMemo(()=>{const C=p.trim().toLowerCase();return C?f.filter(E=>E.name.toLowerCase().includes(C)||(E.phone||"").toLowerCase().includes(C)):f},[f,p]);return s.jsx(tn,{isOpen:l,onClose:c,title:d("sendViaWhatsapp"),footer:s.jsx(Ce,{onClick:c,children:d("cancel")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(vf,{size:16,className:"absolute start-3 top-3 text-muted"}),s.jsx("input",{type:"search",value:p,onChange:C=>x(C.target.value),placeholder:d("searchRecipients"),"aria-label":d("searchRecipients"),className:`${Yt} ps-9`})]}),N&&s.jsx(gs,{text:d("loading")}),b&&s.jsx("p",{className:"text-sm text-danger",children:b}),!N&&!b&&O.length===0&&s.jsx("p",{className:"text-sm text-muted",children:d("noRecipients")}),s.jsx("div",{className:"flex flex-col gap-1.5 max-h-72 overflow-y-auto",children:O.map(C=>s.jsxs("button",{type:"button",disabled:i,onClick:()=>o(C.id),className:"w-full text-start px-3 py-2.5 rounded-xl border border-line hover:bg-panel-hover disabled:opacity-50",children:[s.jsx("span",{className:"block text-sm font-semibold truncate",children:C.name}),s.jsxs("span",{className:"block text-[11px] text-muted",children:[C.type==="group"?d("recipientGroup"):d("recipientContact"),C.phone?s.jsx("span",{dir:"ltr",className:"ms-2",children:C.phone}):null]})]},C.id))}),i&&s.jsx("p",{className:"text-xs text-muted",children:d("sending")})]})})},Zw=600;function Jw(){const[l,i]=w.useState(null),[c,o]=w.useState(!1),[d,f]=w.useState(null),h=w.useRef(0);return w.useEffect(()=>()=>{h.current+=1},[]),{job:l,running:c,submitError:d,start:async N=>{const y=++h.current;f(null),i(null),o(!0);try{const{jobId:b}=await K.createStickerJob(N);for(;h.current===y;){const S=await K.getStickerJob(b);if(h.current!==y)return;if(i(S),S.state==="done"||S.state==="failed")break;await new Promise(O=>setTimeout(O,Zw))}}catch(b){h.current===y&&f(b)}finally{h.current===y&&o(!1)}},reset:()=>{h.current+=1,i(null),f(null),o(!1)}}}const Wd={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function $w(l,i){return l(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const Ww=({capabilities:l,capsError:i,onRetryCaps:c,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:h,onCreated:p})=>{var pe,dt,ee,De,Be,Re,ze,xt,ae,_e,Ve,Ct;const{t:x}=at(),{toast:N}=Gt(),y=Jw(),[b,S]=w.useState(null),[O,C]=w.useState(null),[E,A]=w.useState("PANEL_UPLOAD"),[M,q]=w.useState(!1),[te,Z]=w.useState(!1),[ie,J]=w.useState(Wd),[_,j]=w.useState([]),[I,Q]=w.useState(null),[se,ce]=w.useState(""),[oe,F]=w.useState(""),[Y,G]=w.useState([]),[X,ue]=w.useState(!1),[je,H]=w.useState(!1),re=w.useRef(null),Ae=w.useRef(null),ke=w.useRef(async()=>{});w.useEffect(()=>(K.getPacks().then(de=>G(de.packs)).catch(()=>{}),()=>{re.current&&URL.revokeObjectURL(re.current)}),[]);const v=de=>{re.current&&URL.revokeObjectURL(re.current);const Ne=URL.createObjectURL(de);re.current=Ne,C(Ne)},T=async(de,Ne,Je,yt,Pt)=>{if(!(l!=null&&l.webp))return;const gt=de instanceof File?de:new File([de],Ne,{type:de.type}),Xn=await Rw(gt,l.limits);if(Xn){N(x(Xn),"error");return}q(!0),A(Je);try{const zn=yt?await jy(yt,Ne,l.limits.uploadBytes):Pt?await K.uploadExistingStickerSource(Pt):await K.uploadStickerSource(gt,Ne);v(gt),S(zn),J(Wd),N(x("uploadReady"),"success")}catch(zn){N(ut(x,zn),"error")}finally{q(!1)}};ke.current=T,w.useEffect(()=>{!o||!l||o===Ae.current||(Ae.current=o,d(),Promise.resolve(o.blob).then(de=>ke.current(de,o.name,o.source,o.token,o.existingId)).catch(de=>N(ut(x,de),"error")))},[o,l,d]);const ne=()=>{y.reset(),S(null),ce(""),F(""),j([]),Q(null),J(Wd),A("PANEL_UPLOAD"),re.current&&URL.revokeObjectURL(re.current),re.current=null,C(null),Ae.current=null},le=()=>{if(!b)return null;const de=se.trim();if([...de].length>Lo)return N(x("stickerNameTooLong"),"warning"),null;const Ne=Kw(_);return{uploadId:b.uploadId,options:ie,...Ne?{overlay:Ne}:{},...de?{name:de}:{},...oe?{packId:oe}:{},source:E}},ve=()=>{const de=le();de&&y.start(de)},xe=async(de,Ne)=>{de.ok&&(de.via==="host"?N(Ia(x("stickerShareSaved"),{dir:de.dir}),"success"):de.via==="share"?N(x("shareDone"),"success"):N(x("downloaded"),"success"),await pf([Ne.id]),p())};if(i)return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:i}),s.jsx(Ce,{onClick:c,children:x("retryLoad")})]});if(!l)return s.jsx(gs,{text:x("loading")});if(!l.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:x("stickerErr_ENCODER_MISSING")});const we=((pe=y.job)==null?void 0:pe.state)==="done"?y.job.sticker:null;if(we)return s.jsxs("div",{className:"flex flex-col gap-4 max-w-md mx-auto",children:[s.jsx("div",{className:"aspect-square rounded-2xl border border-line overflow-hidden bg-[repeating-conic-gradient(#2a2a2e_0%_25%,#1c1c20_0%_50%)] bg-[length:20px_20px]",children:s.jsx("img",{src:we.url,alt:we.name||x("stickerPreview"),className:"w-full h-full object-contain"})}),((dt=y.job)==null?void 0:dt.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:x("alreadyInLibrary")}),((ee=y.job)==null?void 0:ee.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:x("qualityReduced")}),((De=y.job)==null?void 0:De.created)!==!1&&s.jsx("p",{className:"text-sm text-ok",children:x("stickerCreated")}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Ce,{onClick:()=>{wi(we,"webp").then(de=>xe(de,we)).catch(de=>N(ut(x,de),"error"))},children:x("downloadWebp")}),s.jsx(Ce,{onClick:()=>{we.animated&&N(x("firstFrameHint"),"info"),wi(we,"png").then(de=>xe(de,we)).catch(de=>N(ut(x,de),"error"))},children:x("downloadPng")}),we.animated&&s.jsx(Ce,{disabled:!l.gif,title:x("gifOnlyAnimated"),onClick:()=>{wi(we,"gif").then(de=>xe(de,we)).catch(de=>N(ut(x,de),"error"))},children:x("downloadGif")}),s.jsx(Ce,{onClick:()=>{Ey(we,"webp").then(de=>xe(de,we)).catch(de=>N(ut(x,de),"error"))},children:x("shareSticker")}),s.jsx(Ce,{disabled:!f,title:f?void 0:x("notConnectedHint"),onClick:()=>ue(!0),children:x("sendViaWhatsapp")}),s.jsx(Ce,{onClick:()=>H(!0),children:x("addToPack")}),s.jsx(Ce,{variant:"primary",onClick:ne,children:x("createAnother")}),s.jsx(Ce,{onClick:h,children:x("goToLibrary")})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:x("notConnectedHint")}),s.jsx(zy,{open:X,busy:!1,onClose:()=>ue(!1),onPick:de=>{K.sendStickers({ids:[we.id],jid:de}).then(Ne=>{Ne.sent>0?(N(x("stickerSent"),"success"),ue(!1),p()):N(x("stickerErr_NOT_CONNECTED"),"error")}).catch(Ne=>N(ut(x,Ne),"error"))}}),s.jsx(Ay,{open:je,title:x("addToPack"),packs:Y,onClose:()=>H(!1),onCreated:de=>G(Ne=>[...Ne,de]),onPick:de=>{K.bulkStickers({action:"addToPack",ids:[we.id],packId:de}).then(()=>{N(x("addedToPack"),"success"),H(!1),p()}).catch(Ne=>N(ut(x,Ne),"error"))}})]});const fe=y.submitError||((Be=y.job)==null?void 0:Be.state)==="failed";return s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_320px] gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3",children:[!b&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${te?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:de=>{yo()&&(de.preventDefault(),Nw().then(async Ne=>{if(!Ne)return;const Je=await fetch(Ne.url);if(!Je.ok)throw new Error("source unavailable");await T(await Je.blob(),Ne.name,"PANEL_UPLOAD",Ne.token)}).catch(Ne=>N(ut(x,Ne),"error")))},onDragOver:de=>{de.preventDefault(),Z(!0)},onDragLeave:()=>Z(!1),onDrop:de=>{if(de.preventDefault(),Z(!1),yo())return;const Ne=de.dataTransfer.files[0];Ne&&T(Ne,Ne.name,"PANEL_UPLOAD")},children:[s.jsx(R0,{size:28,className:"text-muted"}),s.jsx("span",{className:"text-sm font-bold text-text-main",children:x("stickerDrag")}),s.jsx("span",{className:"text-xs text-muted",children:x("uploadHint")}),s.jsx("input",{type:"file",accept:"image/*,video/*,.webp,.gif",className:"sr-only",disabled:yo(),onChange:de=>{var Je;const Ne=(Je=de.target.files)==null?void 0:Je[0];de.target.value="",Ne&&T(Ne,Ne.name,"PANEL_UPLOAD")}})]}),M&&s.jsx(gs,{text:x("loading")}),b&&O&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:Ia(x("stickerUploadInfo"),{kind:$w(x,b.kind),size:Math.max(1,Math.round(b.size/1024))})}),s.jsx(Xw,{mediaUrl:O,kind:b.kind,width:b.width,height:b.height,options:ie,layers:_,selectedId:I,label:x("previewStage"),onPan:(de,Ne)=>J(Je=>({...Je,panX:de,panY:Ne})),onSelect:Q,onMoveLayer:(de,Ne,Je)=>j(yt=>yt.map(Pt=>Pt.id===de?{...Pt,x:Ne,y:Je}:Pt))})]}),(y.running||((Re=y.job)==null?void 0:Re.state)==="queued"||((ze=y.job)==null?void 0:ze.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((((xt=y.job)==null?void 0:xt.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:_w(x,((ae=y.job)==null?void 0:ae.state)==="queued"?"queued":(_e=y.job)==null?void 0:_e.stage)})]}),fe&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:y.submitError?ut(x,y.submitError):Df(x,(Ct=(Ve=y.job)==null?void 0:Ve.error)==null?void 0:Ct.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ce,{variant:"primary",onClick:ve,children:x("tryAgain")}),s.jsx(Ce,{onClick:ne,children:x("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[b&&s.jsx(Bw,{options:ie,onChange:de=>J(Ne=>({...Ne,...de})),kind:b.kind,durationMs:b.durationMs,limits:l.limits,canRemoveBackground:l.backgroundRemoval.includes("plain"),animatedOk:l.animated,name:se,onName:ce,packId:oe,onPack:F,packs:Y}),b&&s.jsx(Fw,{layers:_,selectedId:I,onSelect:Q,onChange:(de,Ne)=>j(Je=>Je.map(yt=>yt.id===de?{...yt,...Ne}:yt)),onDelete:de=>{j(Ne=>Ne.filter(Je=>Je.id!==de)),Q(Ne=>Ne===de?null:Ne)},onAddText:()=>{const de=crypto.randomUUID();j(Ne=>[...Ne,{id:de,text:x("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),Q(de)},onAddEmoji:de=>{const Ne=crypto.randomUUID();j(Je=>[...Je,{id:Ne,text:de,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),Q(Ne)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Ce,{variant:"primary",disabled:!b||y.running||M,onClick:ve,children:[s.jsx(Co,{size:16}),x("createBtn")]}),b&&s.jsx(Ce,{onClick:ne,disabled:y.running,children:x("clearLbl")})]})]})]})};let No=null,So=!1,In=null;function ob(l){In=l}async function ek(l,i){var c;try{const o=await jy(l,i,Tw),{jobId:d}=await K.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await K.getStickerJob(d);if(f.state==="done"){In==null||In({type:"saved",created:f.created!==!1,qualityReduced:f.qualityReduced===!0});return}if(f.state==="failed"){In==null||In({type:"error",code:(c=f.error)==null?void 0:c.code});return}await new Promise(h=>setTimeout(h,600))}}catch(o){In==null||In({type:"error",code:o instanceof ma?o.code:void 0})}finally{So=!1}}function tk(){if(So)return No;const l=Sw();return(l==null?void 0:l.intent)==="create"?No={blob:fetch(l.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:l.name||"sticker",source:"MEDIA_HUB",token:l.token}:(l==null?void 0:l.intent)==="save"&&!So&&(So=!0,ek(l.token,l.name||"sticker")),No}function nk(){No=null}const Oy=({count:l,animatedSelected:i,canRemove:c,sendReason:o,exportReason:d,onSelectAll:f,onClear:h,onFavorite:p,onUnfavorite:x,onAdd:N,onMove:y,onRemove:b,onDownload:S,onConvert:O,onShare:C,onSend:E,onDelete:A})=>{const{t:M}=at();return l===0?null:s.jsxs("div",{className:"rounded-xl border border-brand-blue/30 bg-brand-blue/10 p-3 flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-sm font-bold text-text-main",children:Ia(M("nSelected"),{n:l})}),s.jsx(Ce,{variant:"quiet",className:"h-8 px-2",onClick:f,children:M("selectVisible")}),s.jsx(Ce,{variant:"quiet",className:"h-8 px-2",onClick:h,children:M("clearSelection")})]}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.jsx(Sn,{label:M("favorite"),onClick:p,children:s.jsx(gN,{size:14})}),s.jsx(Sn,{label:M("unfavorite"),onClick:x,children:s.jsx(xN,{size:14})}),s.jsx(Sn,{label:M("addToPack"),onClick:N,children:s.jsx("span",{className:"text-[11px] font-bold",children:"+"})}),s.jsx(Sn,{label:M("moveToPack"),onClick:y,children:s.jsx(tN,{size:14,className:"rtl:-scale-x-100"})}),c&&s.jsx(Sn,{label:M("removeFromPack"),onClick:b,children:s.jsx(ys,{size:14})}),s.jsx(Sn,{label:l>1?M("downloadZip"):M("download"),onClick:S,disabled:!!d,children:s.jsx(yf,{size:14})}),s.jsx(Sn,{label:M("convertToImage"),onClick:O,disabled:!!d,children:s.jsx(bN,{size:14})}),s.jsx(Sn,{label:M("shareSticker"),onClick:C,children:s.jsx(To,{size:14})}),s.jsx(Sn,{label:M("sendViaWhatsapp"),onClick:E,disabled:!!o,children:s.jsx(Ti,{size:14,className:"rtl:-scale-x-100"})}),s.jsx(Sn,{label:M("delete"),onClick:A,danger:!0,children:s.jsx(bs,{size:14})})]}),o&&s.jsx("p",{className:"text-xs text-muted",children:o}),d&&s.jsx("p",{className:"text-xs text-muted",children:d}),i&&s.jsx("p",{className:"text-xs text-muted",children:M("firstFrameHint")})]})},My=({sticker:l,selected:i,onToggle:c,onOpen:o,onFavorite:d})=>{const{t:f}=at(),h=l.name||f("stickerPreview");return s.jsxs("div",{className:Mt("relative aspect-square rounded-xl border bg-panel overflow-hidden",i?"border-brand-blue ring-2 ring-brand-blue/50":"border-line"),children:[s.jsx("button",{type:"button",onClick:()=>o(),className:"absolute inset-0 focus-visible:ring-2 focus-visible:ring-brand-blue/50","aria-label":f("stickerOpen"),children:s.jsx("img",{src:l.thumbUrl,alt:"",loading:"lazy",draggable:!1,className:"w-full h-full object-contain bg-[repeating-conic-gradient(#2a2a2e_0%_25%,#1c1c20_0%_50%)] bg-[length:16px_16px]"})}),s.jsx("button",{type:"button","aria-pressed":i,"aria-label":f("stickerSelect"),onClick:p=>c(p.shiftKey),className:Mt("absolute top-1 start-1 z-10 w-7 h-7 rounded-lg border flex items-center justify-center focus-visible:ring-2 focus-visible:ring-brand-blue/50",i?"bg-brand-blue border-brand-blue text-white":"bg-panel/90 border-line text-transparent hover:text-muted"),children:s.jsx(_i,{size:16,strokeWidth:3})}),l.animated&&s.jsx("span",{className:"absolute bottom-1 start-1 z-10 px-1.5 py-0.5 rounded-md bg-black/70 text-white text-[10px] font-bold pointer-events-none",children:f("gifBadge")}),s.jsx("button",{type:"button",onClick:d,"aria-pressed":l.favorite,"aria-label":l.favorite?f("unfavorite"):f("favorite"),title:l.favorite?f("favoriteBadge"):f("favorite"),className:"absolute top-1 end-1 z-10 w-7 h-7 rounded-lg bg-panel/90 border border-line flex items-center justify-center focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:s.jsx(Sf,{size:14,className:l.favorite?"fill-warn text-warn":"text-muted"})}),s.jsx("span",{className:"sr-only",children:h})]})},ak=({items:l,total:i,loading:c,loadingMore:o,error:d,hasMore:f,emptyText:h,selected:p,onToggle:x,onOpen:N,onFavorite:y,onLoadMore:b,onRetry:S})=>{const{t:O}=at();return c&&l.length===0?s.jsx(gs,{text:O("loading")}):d&&l.length===0?s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:d}),s.jsx(Ce,{onClick:S,children:O("retryLoad")})]}):l.length===0?s.jsx(Rf,{icon:s.jsx(jf,{size:28,className:"text-muted/40"}),text:h}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:Ia(O("showingCount"),{shown:l.length,total:i})}),s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8 gap-2 sm:gap-3",children:l.map((C,E)=>s.jsx(My,{sticker:C,selected:p.has(C.id),onToggle:A=>x(E,A),onOpen:()=>N(C),onFavorite:()=>y(C)},C.id))}),f&&s.jsx(Ce,{onClick:b,disabled:o,className:"self-center",children:O(o?"loading":"loadMore")})]})},lk=({open:l,busy:i,count:c,inUse:o,packs:d,onClose:f,onConfirm:h,onConfirmEverywhere:p})=>{const{t:x}=at(),N=d.map(y=>y.name).join(", ");return s.jsx(tn,{isOpen:l,onClose:f,title:x("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex flex-wrap justify-end gap-2 w-full",children:[s.jsx(Ce,{onClick:f,disabled:i,children:x("cancel")}),o?s.jsx(Ce,{variant:"danger",onClick:p,disabled:i,children:x("deleteEverywhere")}):s.jsx(Ce,{variant:"danger",onClick:h,disabled:i,children:x("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2 text-sm text-text-main",children:[s.jsx("p",{children:Ia(x("nSelected"),{n:c})}),o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:x(c===1?"inUseBody":"inUseBulkBody")}),N&&s.jsxs("p",{children:[x("inUsePacksLabel"),": ",N]}),s.jsx("p",{className:"text-muted text-xs",children:x("deleteEverywhereHint")})]}):s.jsx("p",{children:x("deleteConfirm")})]})})},sk=({sticker:l,packs:i,isConnected:c,gifEnabled:o,onClose:d,onRename:f,onFavorite:h,onAddToPack:p,onRemoveFromPack:x,onDownload:N,onShare:y,onSend:b,onDelete:S,onOpenInCreate:O})=>{const{t:C}=at(),[E,A]=w.useState(""),[M,q]=w.useState("");if(w.useEffect(()=>{A((l==null?void 0:l.name)||""),q("")},[l]),!l)return null;const te=i.filter(ie=>l.packIds.includes(ie.id)),Z=i.filter(ie=>!l.packIds.includes(ie.id));return s.jsx(tn,{isOpen:!!l,onClose:d,title:l.name||C("stickerPreview"),maxWidth:"680px",footer:s.jsxs("div",{className:"flex flex-wrap justify-end gap-2 w-full",children:[s.jsx(Ce,{onClick:d,children:C("close")}),s.jsxs(Ce,{variant:"danger",onClick:S,children:[s.jsx(bs,{size:14}),C("delete")]})]}),children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx("div",{className:"mx-auto w-full max-w-[280px] aspect-square rounded-2xl border border-line overflow-hidden bg-[repeating-conic-gradient(#2a2a2e_0%_25%,#1c1c20_0%_50%)] bg-[length:20px_20px]",children:s.jsx("img",{src:l.url,alt:l.name||C("stickerPreview"),className:"w-full h-full object-contain"})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Ce,{onClick:()=>N("webp"),children:[s.jsx(yf,{size:14}),C("downloadWebp")]}),s.jsx(Ce,{onClick:()=>N("png"),title:l.animated?C("firstFrameHint"):void 0,children:C("downloadPng")}),l.animated&&s.jsx(Ce,{onClick:()=>N("gif"),disabled:!o,title:C("gifOnlyAnimated"),children:C("downloadGif")}),s.jsxs(Ce,{onClick:y,children:[s.jsx(To,{size:14}),C("shareSticker")]}),s.jsxs(Ce,{onClick:b,disabled:!c,title:c?void 0:C("notConnectedHint"),children:[s.jsx(Ti,{size:14,className:"rtl:-scale-x-100"}),C("sendViaWhatsapp")]}),s.jsx(Ce,{onClick:O,children:C("openInCreate")})]}),l.animated&&s.jsx("p",{className:"text-xs text-muted",children:C("firstFrameHint")}),!c&&s.jsx("p",{className:"text-xs text-muted",children:C("notConnectedHint")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{value:E,onChange:ie=>A(ie.target.value),maxLength:Lo,"aria-label":C("stickerName"),placeholder:C("stickerNamePlaceholder"),className:Yt}),s.jsx(Ce,{variant:"primary",onClick:()=>f(E.trim()),children:C("rename")})]}),s.jsxs(Ce,{onClick:()=>h(!l.favorite),children:[s.jsx(Sf,{size:14,className:l.favorite?"fill-warn text-warn":""}),l.favorite?C("unfavorite"):C("favorite")]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-bold text-text-main mb-1.5",children:C("inUsePacksLabel")}),te.length===0?s.jsx("p",{className:"text-xs text-muted",children:C("notInPack")}):s.jsx("ul",{className:"flex flex-col gap-1.5",children:te.map(ie=>s.jsxs("li",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-sm truncate",children:ie.name}),s.jsx(Ce,{className:"h-8",onClick:()=>x(ie.id),children:C("removeFromPack")})]},ie.id))}),Z.length>0&&s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.jsxs("select",{value:M,onChange:ie=>q(ie.target.value),"aria-label":C("addToPack"),className:Yt,children:[s.jsx("option",{value:"",children:C("selectPack")}),Z.map(ie=>s.jsx("option",{value:ie.id,children:ie.name},ie.id))]}),s.jsx(Ce,{variant:"primary",disabled:!M,onClick:()=>M&&p(M),children:C("addToPack")})]})]})]})})};function ik(l){const{t:i}=at(),{toast:c}=Gt(),[o,d]=w.useState(null),[f,h]=w.useState(!1);return{phase:o,busy:f,requestDelete:y=>{y.length&&d({kind:"ask",ids:y})},run:async(y,b)=>{var S;h(!0);try{if(y.length===1&&!b){try{await K.deleteSticker(y[0],!1),c(i("deleted"),"success"),d(null),l()}catch(A){if(A instanceof ma&&A.code==="IN_USE"){const M=Array.isArray((S=A.data)==null?void 0:S.packs)?A.data.packs:[];d({kind:"inUse",ids:y,packs:M,otherSkipped:0})}else c(ut(i,A),"error")}return}const O=await K.bulkStickers({action:"delete",ids:y,confirm:b}),C=O.skipped.filter(A=>A.code==="IN_USE").map(A=>A.id),E=O.skipped.length-C.length;if(!b&&C.length>0){d({kind:"inUse",ids:C,packs:[],otherSkipped:E});return}E>0?c(i("skippedOther"),"warning"):c(i("deleted"),"success"),d(null),l()}catch(O){c(ut(i,O),"error")}finally{h(!1)}},close:()=>{f||d(null)}}}function rk(l,i,c){const o=new Map(c.map(f=>[f.id,f.name])),d=new Map;for(const f of l){const h=i.find(p=>p.id===f);for(const p of(h==null?void 0:h.packIds)??[])d.set(p,o.get(p)||p)}return[...d].map(([f,h])=>({id:f,name:h}))}function Dy({items:l,packs:i,selectedIds:c,clearSelection:o,reload:d,fromPackId:f,isConnected:h,gifEnabled:p,onOpenInCreate:x,onPackCreated:N}){var ue,je,H;const{t:y}=at(),{toast:b}=Gt(),S=w.useRef(!1),[O,C]=w.useState(null),[E,A]=w.useState(null),[M,q]=w.useState([]),[te,Z]=w.useState([]),[ie,J]=w.useState(!1),_=ik(()=>{C(null),o(),d()}),j=l.find(re=>re.id===O)||null,I=c.length>rb?y("stickerExportLimit"):null,Q=h?c.length>Aw?y("stickerSendLimit"):null:y("notConnectedHint"),se=((ue=_.phase)==null?void 0:ue.kind)==="inUse"?_.phase.packs.length?_.phase.packs:rk(_.phase.ids,l,i):[],ce=re=>{re.ok&&(re.via==="host"?b(Ia(y("stickerShareSaved"),{dir:re.dir}),"success"):re.via==="share"?b(y("shareDone"),"success"):b(y("downloaded"),"success"))},oe=async re=>{if(!S.current){S.current=!0;try{await re()}catch(Ae){b(ut(y,Ae),"error")}finally{S.current=!1}}},F=re=>l.find(Ae=>Ae.id===re),Y=(re,Ae,ke)=>oe(async()=>{if(!re.length||re.length>rb)return;const v=re.length===1?F(re[0]):null;if(re.length===1&&!v)return;const T=re.some(le=>{var ve;return(ve=F(le))==null?void 0:ve.animated});Ae==="png"&&T&&b(y("firstFrameHint"),"info");const ne=re.length===1&&v?await(ke?Ey(v,Ae):wi(v,Ae)):await(ke?Cw(re,Ae):Ew(re,Ae));ce(ne),ne.ok&&(await pf(re),d())}),G=(re,Ae)=>oe(async()=>{if(!re.length)return;const ke=await K.bulkStickers({action:Ae?"favorite":"unfavorite",ids:re});b(ke.skipped.length?y("skippedOther"):y("saved"),ke.skipped.length?"warning":"success"),d()}),X=(re,Ae,ke)=>oe(async()=>{if(!ke.length)return;const v=await K.bulkStickers({action:re,ids:ke,packId:Ae,...re==="moveToPack"&&f?{fromPackId:f}:{}}),T=y(re==="addToPack"?"addedToPack":"movedToPack");b(v.skipped.length?y("skippedOther"):T,v.skipped.length?"warning":"success"),A(null),d()});return{exportReason:I,sendReason:Q,openDetail:re=>C(re.id),toggleFavorite:re=>void G([re.id],!re.favorite),favorite:()=>void G(c,!0),unfavorite:()=>void G(c,!1),askAdd:()=>{q(c),A("add")},askMove:()=>{q(c),A("move")},remove:()=>{!f||!c.length||oe(async()=>{const re=await K.bulkStickers({action:"removeFromPack",ids:c,packId:f});b(re.skipped.length?y("skippedOther"):y("removedFromPack"),re.skipped.length?"warning":"success"),o(),d()})},download:()=>void Y(c,"webp",!1),convert:()=>void Y(c,"png",!1),share:()=>void Y(c,"webp",!0),askSend:()=>{Q||!c.length||Z(c)},askDelete:()=>_.requestDelete(c),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(Ay,{open:E!==null,title:y(E==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>A(null),onCreated:N,onPick:re=>void X(E==="move"?"moveToPack":"addToPack",re,M)}),s.jsx(zy,{open:te.length>0,busy:ie,onClose:()=>Z([]),onPick:re=>{oe(async()=>{J(!0);try{(await K.sendStickers({ids:te,jid:re})).sent>0?(b(te.length>1?y("stickersSent"):y("stickerSent"),"success"),Z([]),d()):b(y("stickerErr_NOT_CONNECTED"),"error")}finally{J(!1)}})}}),s.jsx(lk,{open:_.phase!==null,busy:_.busy,count:((je=_.phase)==null?void 0:je.ids.length)??0,inUse:((H=_.phase)==null?void 0:H.kind)==="inUse",packs:se,onClose:_.close,onConfirm:()=>{_.phase&&_.run(_.phase.ids,!1)},onConfirmEverywhere:()=>{_.phase&&_.run(_.phase.ids,!0)}}),s.jsx(sk,{sticker:j,packs:i,isConnected:h,gifEnabled:p,onClose:()=>C(null),onRename:re=>{if(j){if([...re.trim()].length>Lo){b(y("stickerNameTooLong"),"warning");return}oe(async()=>{await K.updateSticker(j.id,{name:re.trim()}),b(y("renamed"),"success"),d()})}},onFavorite:re=>{j&&oe(async()=>{await K.updateSticker(j.id,{favorite:re}),b(y("saved"),"success"),d()})},onAddToPack:re=>{j&&X("addToPack",re,[j.id])},onRemoveFromPack:re=>{j&&oe(async()=>{await K.bulkStickers({action:"removeFromPack",ids:[j.id],packId:re}),b(y("removedFromPack"),"success"),d()})},onDownload:re=>{if(j){if(re==="gif"){oe(async()=>{const Ae=await wi(j,"gif");ce(Ae),Ae.ok&&(await pf([j.id]),d())});return}Y([j.id],re,!1)}},onShare:()=>{j&&Y([j.id],"webp",!0)},onSend:()=>{j&&h&&Z([j.id])},onDelete:()=>{j&&_.requestDelete([j.id])},onOpenInCreate:()=>{j&&(C(null),x(j))}})]})}}function Ry(l){const[i,c]=w.useState(new Set),o=w.useRef(null),d=l.join(`
514
+ `);return w.useEffect(()=>{const x=new Set(d?d.split(`
515
+ `):[]);c(N=>{let y=!1;const b=new Set;for(const S of N)x.has(S)?b.add(S):y=!0;return y?b:N})},[d]),{selected:i,toggle:(x,N)=>{const y=l[x];y&&c(b=>{const S=new Set(b);if(N&&o.current!=null){const O=Math.min(o.current,x),C=Math.max(o.current,x);for(let E=O;E<=C;E++){const A=l[E];A&&S.add(A)}return S}return S.has(y)?S.delete(y):S.add(y),o.current=x,S})},selectAll:()=>c(new Set(l)),clear:()=>{o.current=null,c(new Set)}}}function ok(l){const{t:i}=at(),{toast:c}=Gt(),[o,d]=w.useState(""),[f,h]=w.useState(""),[p,x]=w.useState(l==="recent"?"recent":"newest"),[N,y]=w.useState(l),[b,S]=w.useState(""),[O,C]=w.useState([]),[E,A]=w.useState(0),[M,q]=w.useState([]),[te,Z]=w.useState(!0),[ie,J]=w.useState(!1),[_,j]=w.useState(null),I=w.useRef(0);w.useEffect(()=>{const F=setTimeout(()=>h(o),300);return()=>clearTimeout(F)},[o]);const Q=w.useCallback(()=>{K.getPacks().then(F=>q(F.packs)).catch(()=>{})},[]);w.useEffect(()=>{Q()},[Q]);const se=w.useCallback(async(F,Y)=>{const G=++I.current;Y?J(!0):Z(!0),j(null);try{const X=await K.getStickers({q:f||void 0,sort:p,filter:N,pack:b||void 0,offset:F,limit:zw});if(G!==I.current)return;C(ue=>Y?[...ue,...X.items]:X.items),A(X.total)}catch(X){if(G!==I.current)return;const ue=ut(i,X);j(ue),c(ue,"error")}finally{G===I.current&&(Z(!1),J(!1))}},[f,p,N,b,i,c]);w.useEffect(()=>{se(0,!1)},[se]);const ce=w.useCallback(()=>{Q(),se(0,!1)},[se,Q]),oe=w.useCallback(()=>{ie||O.length>=E||se(O.length,!0)},[O.length,se,ie,E]);return{q:o,setQ:d,sort:p,setSort:x,filter:N,setFilter:y,pack:b,setPack:S,items:O,total:E,packs:M,loading:te,loadingMore:ie,error:_,hasMore:O.length<E,reload:ce,loadMore:oe,loadPacks:Q,lockedFilter:l!=="all"}}const ef=({preset:l,isConnected:i,gifEnabled:c,refreshKey:o,onOpenInCreate:d})=>{const{t:f}=at(),h=ok(l),p=h.items.map(E=>E.id),x=Ry(p),N=[...x.selected],y=h.pack&&h.pack!=="none"?h.pack:void 0,b=w.useRef(h.reload);b.current=h.reload,w.useEffect(()=>{o!==0&&b.current()},[o]);const S=Dy({items:h.items,packs:h.packs,selectedIds:N,clearSelection:x.clear,reload:h.reload,fromPackId:y,isConnected:i,gifEnabled:c,onOpenInCreate:d,onPackCreated:h.loadPacks}),O=h.q||h.pack||!h.lockedFilter&&h.filter!=="all"?f("noResults"):f(l==="favorites"?"favoritesEmpty":l==="recent"?"recentEmpty":"emptyLibrary"),C=h.items.some(E=>x.selected.has(E.id)&&E.animated);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2",children:[s.jsx("input",{type:"search",value:h.q,onChange:E=>h.setQ(E.target.value),placeholder:f("searchStickers"),"aria-label":f("searchStickers"),className:Yt}),s.jsxs("select",{"aria-label":f("sortBy"),value:h.sort,onChange:E=>h.setSort(E.target.value),className:Yt,children:[s.jsx("option",{value:"newest",children:f("sortNewest")}),s.jsx("option",{value:"oldest",children:f("sortOldest")}),s.jsx("option",{value:"name",children:f("sortName")}),s.jsx("option",{value:"recent",children:f("sortRecent")})]}),!h.lockedFilter&&s.jsxs("select",{"aria-label":f("filterBy"),value:h.filter,onChange:E=>h.setFilter(E.target.value),className:Yt,children:[s.jsx("option",{value:"all",children:f("allStickers")}),s.jsx("option",{value:"favorites",children:f("favorites")}),s.jsx("option",{value:"recent",children:f("recent")}),s.jsx("option",{value:"animated",children:f("animated")}),s.jsx("option",{value:"static",children:f("static")})]}),s.jsxs("select",{"aria-label":f("packFilter"),value:h.pack,onChange:E=>h.setPack(E.target.value),className:Yt,children:[s.jsx("option",{value:"",children:f("anyPack")}),s.jsx("option",{value:"none",children:f("noPack")}),h.packs.map(E=>s.jsx("option",{value:E.id,children:E.name},E.id))]})]}),h.items.length>0&&N.length===0&&s.jsx("div",{children:s.jsx(Ce,{variant:"quiet",className:"h-8 px-2",onClick:x.selectAll,children:f("selectAll")})}),s.jsx(Oy,{count:N.length,animatedSelected:C,canRemove:!!y,sendReason:N.length?S.sendReason:null,exportReason:N.length?S.exportReason:null,onSelectAll:x.selectAll,onClear:x.clear,onFavorite:S.favorite,onUnfavorite:S.unfavorite,onAdd:S.askAdd,onMove:S.askMove,onRemove:S.remove,onDownload:S.download,onConvert:S.convert,onShare:S.share,onSend:S.askSend,onDelete:S.askDelete}),s.jsx(ak,{items:h.items,total:h.total,loading:h.loading,loadingMore:h.loadingMore,error:h.error,hasMore:h.hasMore,emptyText:O,selected:x.selected,onToggle:x.toggle,onOpen:S.openDetail,onFavorite:S.toggleFavorite,onLoadMore:h.loadMore,onRetry:h.reload}),S.dialogs]})},ck=({packId:l,isConnected:i,gifEnabled:c,onBack:o,onOpenInCreate:d})=>{const{t:f}=at(),{toast:h}=Gt(),[p,x]=w.useState(null),[N,y]=w.useState([]),[b,S]=w.useState([]),[O,C]=w.useState(!0),[E,A]=w.useState(null),[M,q]=w.useState(0),[te,Z]=w.useState(!1),ie=w.useRef(""),J=N.map(Y=>Y.id),_=Ry(J),j=[..._.selected];w.useEffect(()=>{if(M<0)return;let Y=!0;return A(null),Promise.all([K.getPack(l),K.getPacks()]).then(([G,X])=>{Y&&(x(G.pack),y(G.items),S(X.packs))}).catch(G=>{Y&&A(ut(f,G))}).finally(()=>{Y&&C(!1)}),()=>{Y=!1}},[l,M,f]);const I=()=>{C(N.length===0),q(Y=>Y+1)},Q=Dy({items:N,packs:b,selectedIds:j,clearSelection:_.clear,reload:I,fromPackId:l,isConnected:i,gifEnabled:c,onOpenInCreate:d,onPackCreated:I}),se=async Y=>{const G=N;y(Y),Z(!0);try{await K.reorderPack(l,Y.map(X=>X.id))}catch(X){y(G),h(ut(f,X),"error")}finally{Z(!1)}},ce=(Y,G)=>{const X=Y+G;if(te||X<0||X>=N.length)return;const ue=N.slice(),[je]=ue.splice(Y,1);je&&(ue.splice(X,0,je),se(ue))},oe=Y=>{const G=N.findIndex(H=>H.id===ie.current),X=N.findIndex(H=>H.id===Y);if(ie.current="",te||G<0||X<0||G===X)return;const ue=N.slice(),[je]=ue.splice(G,1);je&&(ue.splice(X,0,je),se(ue))},F=N.some(Y=>_.selected.has(Y.id)&&Y.animated);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Ce,{onClick:o,children:[s.jsx(sN,{size:16,className:"rtl:-scale-x-100"}),f("backToPacks")]}),p&&s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-base font-bold text-text-main truncate",children:p.name}),s.jsx("p",{className:"text-xs text-muted",children:Ia(f("stickerCount"),{n:p.count})})]})]}),O&&N.length===0&&s.jsx(gs,{text:f("loading")}),E&&N.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:E}),s.jsx(Ce,{onClick:I,children:f("retryLoad")})]}),!O&&!E&&N.length===0&&s.jsx(Rf,{icon:s.jsx(pg,{size:28,className:"text-muted/40"}),text:f("packEmpty")}),N.length>0&&s.jsxs(s.Fragment,{children:[j.length===0&&s.jsx("div",{children:s.jsx(Ce,{variant:"quiet",className:"h-8 px-2",onClick:_.selectAll,children:f("selectAll")})}),s.jsx(Oy,{count:j.length,animatedSelected:F,canRemove:!0,sendReason:j.length?Q.sendReason:null,exportReason:j.length?Q.exportReason:null,onSelectAll:_.selectAll,onClear:_.clear,onFavorite:Q.favorite,onUnfavorite:Q.unfavorite,onAdd:Q.askAdd,onMove:Q.askMove,onRemove:Q.remove,onDownload:Q.download,onConvert:Q.convert,onShare:Q.share,onSend:Q.askSend,onDelete:Q.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:N.map((Y,G)=>s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:X=>X.preventDefault(),onDrop:X=>{X.preventDefault(),oe(Y.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(My,{sticker:Y,selected:_.selected.has(Y.id),onToggle:X=>_.toggle(G,X),onOpen:()=>Q.openDetail(Y),onFavorite:()=>Q.toggleFavorite(Y)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold truncate",children:Y.name||f("stickerPreview")}),s.jsx(Sn,{label:f("reorderUp"),disabled:te||G===0,onClick:()=>ce(G,-1),children:s.jsx(rN,{size:14})}),s.jsx(Sn,{label:f("reorderDown"),disabled:te||G===N.length-1,onClick:()=>ce(G,1),children:s.jsx(lN,{size:14})}),s.jsx("button",{type:"button",draggable:!te,"aria-label":f("reorderDragHint"),title:f("reorderDragHint"),className:"inline-flex items-center justify-center w-10 h-10 rounded-lg border border-line text-muted cursor-grab",onDragStart:X=>{ie.current=Y.id,X.dataTransfer.effectAllowed="move",X.dataTransfer.setData("text/plain",Y.id)},children:s.jsx(pg,{size:16})})]},Y.id))})]}),Q.dialogs]})},uk=({isConnected:l,gifEnabled:i,onOpenInCreate:c})=>{const{t:o}=at(),{toast:d}=Gt(),[f,h]=w.useState([]),[p,x]=w.useState(!0),[N,y]=w.useState(null),[b,S]=w.useState(""),[O,C]=w.useState(null),[E,A]=w.useState(!1),[M,q]=w.useState(null),[te,Z]=w.useState(null),[ie,J]=w.useState(""),[_,j]=w.useState(null),[I,Q]=w.useState(!1),[se,ce]=w.useState(null),[oe,F]=w.useState(""),Y=w.useCallback(()=>{y(null),K.getPacks().then(H=>h(H.packs)).catch(H=>y(ut(o,H))).finally(()=>x(!1))},[o]);w.useEffect(()=>{Y()},[Y]);const G=async()=>{if(ki(b)){C(o("packNameLength"));return}A(!0),C(null);try{await K.createPack(b.trim()),S(""),d(o("packCreated"),"success"),Y()}catch(H){d(ut(o,H),"error")}finally{A(!1)}},X=async()=>{if(te){if(ki(ie)){d(o("packNameLength"),"warning");return}A(!0);try{await K.updatePack(te.id,ie.trim()),d(o("packRenamed"),"success"),Z(null),Y()}catch(H){d(ut(o,H),"error")}finally{A(!1)}}},ue=async()=>{if(_){A(!0);try{await K.deletePack(_.id,I),d(o("packDeleted"),"success"),j(null),Q(!1),Y()}catch(H){d(ut(o,H),"error")}finally{A(!1)}}},je=async()=>{if(se){if(!oe){d(o("noDestinationPack"),"warning");return}A(!0);try{await K.mergePack(se.id,oe),d(o("packsMerged"),"success"),ce(null),F(""),Y()}catch(H){d(ut(o,H),"error")}finally{A(!1)}}};return M?s.jsx(ck,{packId:M,isConnected:l,gifEnabled:i,onOpenInCreate:c,onBack:()=>{q(null),Y()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[s.jsx("input",{value:b,onChange:H=>{const re=H.target.value;S(re),O&&C(ki(re)?o("packNameLength"):null)},onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),G())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),maxLength:Cy+20,className:Yt}),s.jsxs(Ce,{variant:"primary",onClick:()=>void G(),disabled:E,children:[s.jsx(Co,{size:16}),o("createPack")]})]}),O&&s.jsx("p",{className:"text-xs text-danger",children:O}),p&&s.jsx(gs,{text:o("loading")}),N&&!p&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-10",children:[s.jsx("p",{className:"text-sm text-danger",children:N}),s.jsx(Ce,{onClick:Y,children:o("retryLoad")})]}),!p&&!N&&f.length===0&&s.jsx(Rf,{icon:s.jsx(gg,{size:28,className:"text-muted/40"}),text:o("noPacks")}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f.map(H=>s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-3 flex items-center gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>q(H.id),className:"flex items-center gap-3 flex-1 min-w-0 text-start focus-visible:ring-2 focus-visible:ring-brand-blue/50 rounded-xl","aria-label":o("openPack"),children:[H.coverUrl?s.jsx("img",{src:H.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(gg,{size:20})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-bold text-text-main truncate",children:H.name}),s.jsx("span",{className:"block text-xs text-muted",children:Ia(o("stickerCount"),{n:H.count})})]})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(Ce,{className:"h-8 px-2",title:o("renamePack"),onClick:()=>{Z(H),J(H.name)},children:[s.jsx(TN,{size:14}),s.jsx("span",{className:"sr-only",children:o("renamePack")})]}),s.jsxs(Ce,{className:"h-8 px-2",title:o("mergeInto"),onClick:()=>{ce(H),F("")},children:[s.jsx(kN,{size:14}),s.jsx("span",{className:"sr-only",children:o("merge")})]}),s.jsxs(Ce,{className:"h-8 px-2",variant:"danger",title:o("deletePack"),onClick:()=>{j(H),Q(!1)},children:[s.jsx(bs,{size:14}),s.jsx("span",{className:"sr-only",children:o("deletePack")})]})]})]},H.id))}),s.jsx(tn,{isOpen:te!==null,onClose:()=>Z(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[s.jsx(Ce,{onClick:()=>Z(null),children:o("cancel")}),s.jsx(Ce,{variant:"primary",onClick:()=>void X(),disabled:E,children:o("save")})]}),children:s.jsx("input",{value:ie,onChange:H=>J(H.target.value),"aria-label":o("packName"),className:Yt})}),s.jsx(tn,{isOpen:_!==null,onClose:()=>j(null),title:o("deletePackTitle"),footer:s.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[s.jsx(Ce,{onClick:()=>j(null),children:o("cancel")}),s.jsx(Ce,{variant:"danger",onClick:()=>void ue(),disabled:E,children:o("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("button",{type:"button","aria-pressed":!I,onClick:()=>Q(!1),className:"text-start px-3 py-3 rounded-xl border border-line hover:bg-panel-hover aria-pressed:border-brand-blue",children:s.jsx("span",{className:"block text-sm font-bold",children:o("deleteKeepStickers")})}),s.jsx("button",{type:"button","aria-pressed":I,onClick:()=>Q(!0),className:"text-start px-3 py-3 rounded-xl border border-line hover:bg-panel-hover aria-pressed:border-danger",children:s.jsx("span",{className:"block text-sm font-bold",children:o("deletePackAndStickers")})})]})}),s.jsx(tn,{isOpen:se!==null,onClose:()=>ce(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[s.jsx(Ce,{onClick:()=>ce(null),children:o("cancel")}),s.jsx(Ce,{variant:"primary",onClick:()=>void je(),disabled:E||!oe,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("select",{id:"merge-into",value:oe,onChange:H=>F(H.target.value),className:Yt,children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(H=>H.id!==(se==null?void 0:se.id)).map(H=>s.jsx("option",{value:H.id,children:H.name},H.id))]})]})})]})},dk=["library","packs","favorites","create","recent"];function cb(){const l=window.location.hash.replace(/^#/,"");if(l.startsWith("stickers/")){const i=l.slice(9);if(dk.includes(i))return i}return"library"}const fk=({isConnected:l})=>{const{t:i}=at(),{toast:c}=Gt(),[o,d]=w.useState(cb),[f,h]=w.useState(o==="create"),[p,x]=w.useState(null),[N,y]=w.useState(null),[b,S]=w.useState(0),[O,C]=w.useState(null),[E,A]=w.useState(0),M=w.useCallback(()=>{let _=!0;return y(null),K.getStickerCapabilities().then(j=>{_&&x(j)}).catch(j=>{_&&y(ut(i,j))}),()=>{_=!1}},[i]);w.useEffect(()=>{if(!(b<0))return M()},[M,b]);const q=w.useCallback(_=>{d(_),_==="create"&&h(!0);const j=`stickers/${_}`;window.location.hash.replace(/^#/,"")!==j&&(window.location.hash=j)},[]);w.useEffect(()=>{const _=()=>d(cb());return window.addEventListener("hashchange",_),()=>window.removeEventListener("hashchange",_)},[]),w.useEffect(()=>{o==="create"&&h(!0)},[o]),w.useEffect(()=>(ob(_=>{if(_.type==="saved"){c(_.created?i("stickerCreated"):i("alreadyInLibrary"),_.created?"success":"info"),_.qualityReduced&&c(i("qualityReduced"),"info"),A(j=>j+1);return}c(Df(i,_.code),"error")}),()=>ob(null)),[i,c]),w.useEffect(()=>{const _=()=>{const I=tk();I&&(C(I),h(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};_();const j=()=>{document.visibilityState==="visible"&&_()};return document.addEventListener("visibilitychange",j),()=>document.removeEventListener("visibilitychange",j)},[]);const te=w.useCallback(()=>{nk(),C(null)},[]),Z=w.useCallback(async _=>{try{const j=await fetch(_.url,{credentials:"same-origin"});if(!j.ok)throw new Error(String(j.status));const I=await j.blob(),Q=_.name.trim(),se=Q?Q.toLowerCase().endsWith(".webp")?Q:`${Q}.webp`:"sticker.webp";C({blob:I,name:se,source:"PANEL_UPLOAD",...yo()?{existingId:_.id}:{}}),q("create")}catch(j){c(ut(i,j),"error")}},[q,i,c]),ie=p!==null&&!p.webp,J=[{id:"library",label:i("library")},{id:"packs",label:i("packs")},{id:"favorites",label:i("favorites")},{id:"create",label:i("create")},{id:"recent",label:i("recent")}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex items-center gap-3.5",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(jf,{size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:i("stickers")}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-0.5",children:i("stickersDesc")})]})]}),ie&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(Si,{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:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:s.jsx("div",{className:"flex items-center gap-2 min-w-max",children:J.map(_=>s.jsx("button",{type:"button",onClick:()=>q(_.id),className:Mt("px-4 py-2.5 rounded-xl text-sm font-bold transition-all whitespace-nowrap min-h-10",o===_.id?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:bg-panel-hover hover:text-text-main"),children:_.label},_.id))})}),o==="library"&&s.jsx(ef,{preset:"all",isConnected:l,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:E,onOpenInCreate:_=>void Z(_)}),o==="favorites"&&s.jsx(ef,{preset:"favorites",isConnected:l,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:E,onOpenInCreate:_=>void Z(_)}),o==="recent"&&s.jsx(ef,{preset:"recent",isConnected:l,gifEnabled:(p==null?void 0:p.gif)===!0,refreshKey:E,onOpenInCreate:_=>void Z(_)}),o==="packs"&&s.jsx(uk,{isConnected:l,gifEnabled:(p==null?void 0:p.gif)===!0,onOpenInCreate:_=>void Z(_)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(Ww,{capabilities:p,capsError:N,onRetryCaps:()=>S(_=>_+1),incoming:O,onConsumedIncoming:te,isConnected:l,onGoLibrary:()=>q("library"),onCreated:()=>A(_=>_+1)})})]})},Ly=["overview","connection","commands","ai","groups","schedules","settings","logs","stickers"];function mk(){const l=window.location.hash.replace(/^#/,"").split("/")[0];return Ly.includes(l)?l:"overview"}const hk=()=>{const{t:l}=at(),{toast:i}=Gt(),[c,o]=w.useState(mk),[d,f]=w.useState(!1),{sessionStatus:h,socket:p}=Cj((E,A)=>{if(E==="status"){const M=A==null?void 0:A.state;i(`Connection state: ${M}`,"info")}}),[x,N]=w.useState(null),y=w.useCallback(async()=>{try{const E=await K.getSession();E!=null&&E.session?N({...E.session,qr:E.qr??null,pairingCode:E.pairingCode??null}):E!=null&&E.status&&N(E.status)}catch{}},[]);w.useEffect(()=>{y()},[y]);const b=x||h?{state:(h==null?void 0:h.state)||(x==null?void 0:x.state)||"idle",...x||{},...h||{}}:null,S=(b==null?void 0:b.connected)===!0||(b==null?void 0:b.state)==="connected";w.useEffect(()=>{const E=b==null?void 0:b.state,M=E==="starting"||E==="linking"||E==="reconnecting"||E==="waiting_for_qr"&&!(b!=null&&b.qr)&&!(b!=null&&b.pairingCode)?2e3:15e3,q=setInterval(()=>{y()},M);return()=>clearInterval(q)},[b==null?void 0:b.state,b==null?void 0:b.qr,b==null?void 0:b.pairingCode,y]);const O=E=>{o(E),window.location.hash=E};w.useEffect(()=>{const E=()=>{const A=window.location.hash.replace(/^#/,"").split("/")[0];Ly.includes(A)&&o(A)};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]);const C={overview:l("overview"),connection:l("connection"),commands:l("commands"),ai:l("ai"),groups:l("groups"),schedules:l("schedules"),settings:l("settings"),logs:l("logs"),stickers:l("stickers")};return s.jsxs("div",{className:"min-h-screen min-h-[100dvh] flex bg-bg text-text-main bg-ambient-glow overflow-x-clip relative",children:[s.jsx(MS,{currentView:c,onSelectView:O,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(qN,{onToggleMobileMenu:()=>f(E=>!E),title:C[c]||"Dashboard",status:b}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[c==="overview"&&s.jsx(aw,{status:b,onNavigate:O}),c==="connection"&&s.jsx(ew,{status:b,onRefresh:y,onStatusUpdate:E=>N(A=>({...A||{},...E}))}),c==="ai"&&s.jsx(Tj,{}),c==="commands"&&s.jsx(zj,{}),c==="schedules"&&s.jsx(mw,{isConnected:S,onNavigate:O}),c==="groups"&&s.jsx(tw,{}),c==="settings"&&s.jsx(yw,{}),c==="stickers"&&s.jsx(fk,{isConnected:S}),c==="logs"&&s.jsx(nw,{socket:p})]})]})]})},pk=()=>s.jsx(HN,{children:s.jsx(DS,{children:s.jsx(hk,{})})}),ub=document.getElementById("root");ub&&q2.createRoot(ub).render(s.jsx(yi.StrictMode,{children:s.jsx(pk,{})}));